@mapcatch/util 2.0.5-b → 2.0.6
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.esm.js +4 -4
- package/dist/catchUtil.min.js +1 -1
- package/package.json +1 -21
- package/src/constants/crs.js +42098 -42098
- package/src/event/event.js +4 -5
- package/src/gl-operations/constants.js +9 -9
- package/src/gl-operations/default_options.js +97 -97
- package/src/gl-operations/index.js +532 -532
- package/src/gl-operations/reglCommands/contours.js +27 -27
- package/src/gl-operations/reglCommands/default.js +45 -45
- package/src/gl-operations/reglCommands/hillshading.js +340 -340
- package/src/gl-operations/reglCommands/index.js +6 -6
- package/src/gl-operations/reglCommands/multiLayers.js +303 -303
- package/src/gl-operations/reglCommands/transitions.js +111 -111
- package/src/gl-operations/reglCommands/util.js +71 -71
- package/src/gl-operations/renderer.js +209 -209
- package/src/gl-operations/shaders/fragment/convertDem.js +25 -25
- package/src/gl-operations/shaders/fragment/convolutionSmooth.js +54 -54
- package/src/gl-operations/shaders/fragment/diffCalc.js +33 -33
- package/src/gl-operations/shaders/fragment/drawResult.js +46 -46
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvAmbientShadows.js +78 -78
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvDirect.js +59 -59
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalBaselayer.js +30 -30
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalColorscale.js +60 -60
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvMergeAndScaleTiles.js +26 -26
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvNormals.js +25 -25
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvSmooth.js +53 -53
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvSoftShadows.js +80 -80
- package/src/gl-operations/shaders/fragment/hillshading/hsPregen.js +54 -54
- package/src/gl-operations/shaders/fragment/interpolateColor.js +65 -65
- package/src/gl-operations/shaders/fragment/interpolateColorOnly.js +49 -49
- package/src/gl-operations/shaders/fragment/interpolateValue.js +136 -136
- package/src/gl-operations/shaders/fragment/multiAnalyze1Calc.js +35 -35
- package/src/gl-operations/shaders/fragment/multiAnalyze2Calc.js +45 -45
- package/src/gl-operations/shaders/fragment/multiAnalyze3Calc.js +53 -53
- package/src/gl-operations/shaders/fragment/multiAnalyze4Calc.js +61 -61
- package/src/gl-operations/shaders/fragment/multiAnalyze5Calc.js +69 -69
- package/src/gl-operations/shaders/fragment/multiAnalyze6Calc.js +77 -77
- package/src/gl-operations/shaders/fragment/single.js +93 -93
- package/src/gl-operations/shaders/transform.js +21 -21
- package/src/gl-operations/shaders/util/computeColor.glsl +85 -85
- package/src/gl-operations/shaders/util/getTexelValue.glsl +10 -10
- package/src/gl-operations/shaders/util/isCloseEnough.glsl +9 -9
- package/src/gl-operations/shaders/util/rgbaToFloat.glsl +17 -17
- package/src/gl-operations/shaders/vertex/double.js +16 -16
- package/src/gl-operations/shaders/vertex/multi3.js +19 -19
- package/src/gl-operations/shaders/vertex/multi4.js +22 -22
- package/src/gl-operations/shaders/vertex/multi5.js +25 -25
- package/src/gl-operations/shaders/vertex/multi6.js +28 -28
- package/src/gl-operations/shaders/vertex/single.js +13 -13
- package/src/gl-operations/shaders/vertex/singleNotTransformed.js +11 -11
- package/src/gl-operations/texture_manager.js +141 -141
- package/src/gl-operations/util.js +336 -336
- package/README.md +0 -44
package/dist/catchUtil.min.js
CHANGED
|
@@ -205,7 +205,7 @@ Current state: `+c[R]+`
|
|
|
205
205
|
`)}for(d=0;d<h;++d){n=o[d];var L=n.match(/\S*/g),ae=[];for(H=0;H<L.length;++H)L[H]!==""&&ae.push(L[H]);if(ae.length!==0){for(H=0;H<c.length&&n.substr(0,c[H].length)!==c[H];++H);if(H<c.length){if(R=H,H===1&&(ne=ae[1]),H===6)return{name:ne,c:ie,A:numeric.transpose(Re),b:Te,rows:j,vars:q};continue}switch(R){case 0:case 1:$("Unexpected line");case 2:switch(ae[0]){case"N":D===0?D=ae[1]:$("Two or more N rows");break;case"L":j[ae[1]]=w,z[w]=1,Te[w]=0,++w;break;case"G":j[ae[1]]=w,z[w]=-1,Te[w]=0,++w;break;case"E":j[ae[1]]=w,z[w]=0,Te[w]=0,++w;break;default:$("Parse error "+numeric.prettyPrint(ae))}break;case 3:q.hasOwnProperty(ae[0])||(q[ae[0]]=re,ie[re]=0,Re[re]=numeric.rep([w],0),++re);var W=q[ae[0]];for(H=1;H<ae.length;H+=2){if(ae[H]===D){ie[W]=parseFloat(ae[H+1]);continue}var Pe=j[ae[H]];Re[W][Pe]=(z[Pe]<0?-1:1)*parseFloat(ae[H+1])}break;case 4:for(H=1;H<ae.length;H+=2)Te[j[ae[H]]]=(z[j[ae[H]]]<0?-1:1)*parseFloat(ae[H+1]);break;case 5:break;case 6:$("Internal error")}}}$("Reached end of file without ENDATA")},numeric.seedrandom={pow:Math.pow,random:Math.random},function(t,o,R,c,h,d,H){o.seedrandom=function(q,re){var ne=[],ie;return q=j(D(re?[q,t]:arguments.length?q:[new Date().getTime(),t,window],3),ne),ie=new n(ne),j(ie.S,t),o.random=function(){for(var Te=ie.g(c),$=H,L=0;Te<h;)Te=(Te+L)*R,$*=R,L=ie.g(1);for(;Te>=d;)Te/=2,$/=2,L>>>=1;return(Te+L)/$},q};function n(w){var q,re,ne=this,ie=w.length,Re=0,Te=ne.i=ne.j=ne.m=0;for(ne.S=[],ne.c=[],ie||(w=[ie++]);Re<R;)ne.S[Re]=Re++;for(Re=0;Re<R;Re++)q=ne.S[Re],Te=z(Te+q+w[Re%ie]),re=ne.S[Te],ne.S[Re]=re,ne.S[Te]=q;ne.g=function(L){var ae=ne.S,W=z(ne.i+1),Pe=ae[W],Ie=z(ne.j+Pe),Ae=ae[Ie];ae[W]=Ae,ae[Ie]=Pe;for(var de=ae[z(Pe+Ae)];--L;)W=z(W+1),Pe=ae[W],Ie=z(Ie+Pe),Ae=ae[Ie],ae[W]=Ae,ae[Ie]=Pe,de=de*R+ae[z(Pe+Ae)];return ne.i=W,ne.j=Ie,de},ne.g(R)}function D(w,q,re,ne,ie){if(re=[],ie=typeof w,q&&ie=="object"){for(ne in w)if(ne.indexOf("S")<5)try{re.push(D(w[ne],q-1))}catch(Re){}}return re.length?re:w+(ie!="string"?"\0":"")}function j(w,q,re,ne){for(w+="",re=0,ne=0;ne<w.length;ne++)q[z(ne)]=z((re^=q[z(ne)]*19)+w.charCodeAt(ne));w="";for(ne in q)w+=String.fromCharCode(q[ne]);return w}function z(w){return w&R-1}H=o.pow(R,c),h=o.pow(2,h),d=h*2,j(o.random(),t)}([],numeric.seedrandom,256,6,52),function(t){function o(D){if(typeof D!="object")return D;var j=[],z,w=D.length;for(z=0;z<w;z++)j[z+1]=o(D[z]);return j}function R(D){if(typeof D!="object")return D;var j=[],z,w=D.length;for(z=1;z<w;z++)j[z-1]=R(D[z]);return j}function c(D,j,z){var w,q,re,ne,ie;for(re=1;re<=z;re=re+1){for(D[re][re]=1/D[re][re],ie=-D[re][re],w=1;w<re;w=w+1)D[w][re]=ie*D[w][re];if(ne=re+1,z<ne)break;for(q=ne;q<=z;q=q+1)for(ie=D[re][q],D[re][q]=0,w=1;w<=re;w=w+1)D[w][q]=D[w][q]+ie*D[w][re]}}function h(D,j,z,w){var q,re,ne,ie;for(re=1;re<=z;re=re+1){for(ie=0,q=1;q<re;q=q+1)ie=ie+D[q][re]*w[q];w[re]=(w[re]-ie)/D[re][re]}for(ne=1;ne<=z;ne=ne+1)for(re=z+1-ne,w[re]=w[re]/D[re][re],ie=-w[re],q=1;q<re;q=q+1)w[q]=w[q]+ie*D[q][re]}function d(D,j,z,w){var q,re,ne,ie,Re,Te;for(re=1;re<=z;re=re+1){if(w[1]=re,Te=0,ne=re-1,ne<1){if(Te=D[re][re]-Te,Te<=0)break;D[re][re]=Math.sqrt(Te)}else{for(ie=1;ie<=ne;ie=ie+1){for(Re=D[ie][re],q=1;q<ie;q=q+1)Re=Re-D[q][re]*D[q][ie];Re=Re/D[ie][ie],D[ie][re]=Re,Te=Te+Re*Re}if(Te=D[re][re]-Te,Te<=0)break;D[re][re]=Math.sqrt(Te)}w[1]=0}}function H(D,j,z,w,q,re,ne,ie,Re,Te,$,L,ae,W,Pe,Ie){var Ae,de,Ye,Ue,ye,rt,St,Yt,Et,pt,Ht,rr,mr,na,cr,yr,fa,$a,Ta,Sa,_r,Qr,la,Nn,ma,va,Ya;mr=Math.min(w,Te),Ye=2*w+mr*(mr+5)/2+2*Te+1,Nn=1e-60;do Nn=Nn+Nn,ma=1+.1*Nn,va=1+.2*Nn;while(ma<=1||va<=1);for(Ae=1;Ae<=w;Ae=Ae+1)Pe[Ae]=j[Ae];for(Ae=w+1;Ae<=Ye;Ae=Ae+1)Pe[Ae]=0;for(Ae=1;Ae<=Te;Ae=Ae+1)L[Ae]=0;if(ye=[],Ie[1]===0){if(d(D,z,w,ye),ye[1]!==0){Ie[1]=2;return}h(D,z,w,j),c(D,z,w)}else{for(de=1;de<=w;de=de+1)for(q[de]=0,Ae=1;Ae<=de;Ae=Ae+1)q[de]=q[de]+D[Ae][de]*j[Ae];for(de=1;de<=w;de=de+1)for(j[de]=0,Ae=de;Ae<=w;Ae=Ae+1)j[de]=j[de]+D[de][Ae]*q[Ae]}for(re[1]=0,de=1;de<=w;de=de+1)for(q[de]=j[de],re[1]=re[1]+Pe[de]*q[de],Pe[de]=0,Ae=de+1;Ae<=w;Ae=Ae+1)D[Ae][de]=0;for(re[1]=-re[1]/2,Ie[1]=0,St=w,Yt=St+w,Ht=Yt+mr,Et=Ht+mr+1,pt=Et+mr*(mr+1)/2,na=pt+Te,Ae=1;Ae<=Te;Ae=Ae+1){for(yr=0,de=1;de<=w;de=de+1)yr=yr+ne[de][Ae]*ne[de][Ae];Pe[na+Ae]=Math.sqrt(yr)}ae=0,W[1]=0,W[2]=0;function An(){for(W[1]=W[1]+1,Ye=pt,Ae=1;Ae<=Te;Ae=Ae+1){for(Ye=Ye+1,yr=-ie[Ae],de=1;de<=w;de=de+1)yr=yr+ne[de][Ae]*q[de];if(Math.abs(yr)<Nn&&(yr=0),Ae>$)Pe[Ye]=yr;else if(Pe[Ye]=-Math.abs(yr),yr>0){for(de=1;de<=w;de=de+1)ne[de][Ae]=-ne[de][Ae];ie[Ae]=-ie[Ae]}}for(Ae=1;Ae<=ae;Ae=Ae+1)Pe[pt+L[Ae]]=0;for(rr=0,cr=0,Ae=1;Ae<=Te;Ae=Ae+1)Pe[pt+Ae]<cr*Pe[na+Ae]&&(rr=Ae,cr=Pe[pt+Ae]/Pe[na+Ae]);return rr===0?999:0}function En(){for(Ae=1;Ae<=w;Ae=Ae+1){for(yr=0,de=1;de<=w;de=de+1)yr=yr+D[de][Ae]*ne[de][rr];Pe[Ae]=yr}for(Ue=St,Ae=1;Ae<=w;Ae=Ae+1)Pe[Ue+Ae]=0;for(de=ae+1;de<=w;de=de+1)for(Ae=1;Ae<=w;Ae=Ae+1)Pe[Ue+Ae]=Pe[Ue+Ae]+D[Ae][de]*Pe[de];for(Qr=!0,Ae=ae;Ae>=1;Ae=Ae-1){for(yr=Pe[Ae],Ye=Et+Ae*(Ae+3)/2,Ue=Ye-Ae,de=Ae+1;de<=ae;de=de+1)yr=yr-Pe[Ye]*Pe[Yt+de],Ye=Ye+de;if(yr=yr/Pe[Ue],Pe[Yt+Ae]=yr,L[Ae]<$||yr<0)break;Qr=!1,rt=Ae}if(!Qr)for(fa=Pe[Ht+rt]/Pe[Yt+rt],Ae=1;Ae<=ae&&!(L[Ae]<$||Pe[Yt+Ae]<0);Ae=Ae+1)cr=Pe[Ht+Ae]/Pe[Yt+Ae],cr<fa&&(fa=cr,rt=Ae);for(yr=0,Ae=St+1;Ae<=St+w;Ae=Ae+1)yr=yr+Pe[Ae]*Pe[Ae];if(Math.abs(yr)<=Nn){if(Qr)return Ie[1]=1,999;for(Ae=1;Ae<=ae;Ae=Ae+1)Pe[Ht+Ae]=Pe[Ht+Ae]-fa*Pe[Yt+Ae];return Pe[Ht+ae+1]=Pe[Ht+ae+1]+fa,700}else{for(yr=0,Ae=1;Ae<=w;Ae=Ae+1)yr=yr+Pe[St+Ae]*ne[Ae][rr];for($a=-Pe[pt+rr]/yr,la=!0,Qr||fa<$a&&($a=fa,la=!1),Ae=1;Ae<=w;Ae=Ae+1)q[Ae]=q[Ae]+$a*Pe[St+Ae],Math.abs(q[Ae])<Nn&&(q[Ae]=0);for(re[1]=re[1]+$a*yr*($a/2+Pe[Ht+ae+1]),Ae=1;Ae<=ae;Ae=Ae+1)Pe[Ht+Ae]=Pe[Ht+Ae]-$a*Pe[Yt+Ae];if(Pe[Ht+ae+1]=Pe[Ht+ae+1]+$a,la){for(ae=ae+1,L[ae]=rr,Ye=Et+(ae-1)*ae/2+1,Ae=1;Ae<=ae-1;Ae=Ae+1)Pe[Ye]=Pe[Ae],Ye=Ye+1;if(ae===w)Pe[Ye]=Pe[w];else{for(Ae=w;Ae>=ae+1&&!(Pe[Ae]===0||(Ta=Math.max(Math.abs(Pe[Ae-1]),Math.abs(Pe[Ae])),Sa=Math.min(Math.abs(Pe[Ae-1]),Math.abs(Pe[Ae])),Pe[Ae-1]>=0?cr=Math.abs(Ta*Math.sqrt(1+Sa*Sa/(Ta*Ta))):cr=-Math.abs(Ta*Math.sqrt(1+Sa*Sa/(Ta*Ta))),Ta=Pe[Ae-1]/cr,Sa=Pe[Ae]/cr,Ta===1));Ae=Ae-1)if(Ta===0)for(Pe[Ae-1]=Sa*cr,de=1;de<=w;de=de+1)cr=D[de][Ae-1],D[de][Ae-1]=D[de][Ae],D[de][Ae]=cr;else for(Pe[Ae-1]=cr,_r=Sa/(1+Ta),de=1;de<=w;de=de+1)cr=Ta*D[de][Ae-1]+Sa*D[de][Ae],D[de][Ae]=_r*(D[de][Ae-1]+cr)-D[de][Ae],D[de][Ae-1]=cr;Pe[Ye]=Pe[ae]}}else{for(yr=-ie[rr],de=1;de<=w;de=de+1)yr=yr+q[de]*ne[de][rr];if(rr>$)Pe[pt+rr]=yr;else if(Pe[pt+rr]=-Math.abs(yr),yr>0){for(de=1;de<=w;de=de+1)ne[de][rr]=-ne[de][rr];ie[rr]=-ie[rr]}return 700}}return 0}function In(){if(Ye=Et+rt*(rt+1)/2+1,Ue=Ye+rt,Pe[Ue]===0||(Ta=Math.max(Math.abs(Pe[Ue-1]),Math.abs(Pe[Ue])),Sa=Math.min(Math.abs(Pe[Ue-1]),Math.abs(Pe[Ue])),Pe[Ue-1]>=0?cr=Math.abs(Ta*Math.sqrt(1+Sa*Sa/(Ta*Ta))):cr=-Math.abs(Ta*Math.sqrt(1+Sa*Sa/(Ta*Ta))),Ta=Pe[Ue-1]/cr,Sa=Pe[Ue]/cr,Ta===1))return 798;if(Ta===0){for(Ae=rt+1;Ae<=ae;Ae=Ae+1)cr=Pe[Ue-1],Pe[Ue-1]=Pe[Ue],Pe[Ue]=cr,Ue=Ue+Ae;for(Ae=1;Ae<=w;Ae=Ae+1)cr=D[Ae][rt],D[Ae][rt]=D[Ae][rt+1],D[Ae][rt+1]=cr}else{for(_r=Sa/(1+Ta),Ae=rt+1;Ae<=ae;Ae=Ae+1)cr=Ta*Pe[Ue-1]+Sa*Pe[Ue],Pe[Ue]=_r*(Pe[Ue-1]+cr)-Pe[Ue],Pe[Ue-1]=cr,Ue=Ue+Ae;for(Ae=1;Ae<=w;Ae=Ae+1)cr=Ta*D[Ae][rt]+Sa*D[Ae][rt+1],D[Ae][rt+1]=_r*(D[Ae][rt]+cr)-D[Ae][rt+1],D[Ae][rt]=cr}return 0}function wa(){for(Ue=Ye-rt,Ae=1;Ae<=rt;Ae=Ae+1)Pe[Ue]=Pe[Ye],Ye=Ye+1,Ue=Ue+1;return Pe[Ht+rt]=Pe[Ht+rt+1],L[rt]=L[rt+1],rt=rt+1,rt<ae?797:0}function _a(){return Pe[Ht+ae]=Pe[Ht+ae+1],Pe[Ht+ae+1]=0,L[ae]=0,ae=ae-1,W[2]=W[2]+1,0}for(Ya=0;;){if(Ya=An(),Ya===999)return;for(;Ya=En(),Ya!==0;){if(Ya===999)return;if(Ya===700)if(rt===ae)_a();else{for(;In(),Ya=wa(),Ya===797;);_a()}}}}function n(D,j,z,w,q,re){D=o(D),j=o(j),z=o(z);var ne,ie,Re,Te,$,L=[],ae=[],W=[],Pe=[],Ie=[],Ae;if(q=q||0,re=re?o(re):[void 0,0],w=w?o(w):[],ie=D.length-1,Re=z[1].length-1,!w)for(ne=1;ne<=Re;ne=ne+1)w[ne]=0;for(ne=1;ne<=Re;ne=ne+1)ae[ne]=0;for(Te=0,$=Math.min(ie,Re),ne=1;ne<=ie;ne=ne+1)W[ne]=0;for(L[1]=0,ne=1;ne<=2*ie+$*($+5)/2+2*Re+1;ne=ne+1)Pe[ne]=0;for(ne=1;ne<=2;ne=ne+1)Ie[ne]=0;return H(D,j,ie,ie,W,L,z,w,ie,Re,q,ae,Te,Ie,Pe,re),Ae="",re[1]===1&&(Ae="constraints are inconsistent, no solution!"),re[1]===2&&(Ae="matrix D in quadratic function is not positive definite!"),{solution:R(W),value:R(L),unconstrained_solution:R(j),iterations:R(Ie),iact:R(ae),message:Ae}}t.solveQP=n}(numeric),numeric.svd=function t(o){var R,c=numeric.epsilon,h=1e-64/c,d=50,H=0,n=0,D=0,j=0,z=0,w=numeric.clone(o),q=w.length,re=w[0].length;if(q<re)throw"Need more rows than columns";var ne=new Array(re),ie=new Array(re);for(n=0;n<re;n++)ne[n]=ie[n]=0;var Re=numeric.rep([re,re],0);function Te(ye,rt){return ye=Math.abs(ye),rt=Math.abs(rt),ye>rt?ye*Math.sqrt(1+rt*rt/ye/ye):rt==0?ye:rt*Math.sqrt(1+ye*ye/rt/rt)}var $=0,L=0,ae=0,W=0,Pe=0,Ie=0,Ae=0;for(n=0;n<re;n++){for(ne[n]=L,Ae=0,z=n+1,D=n;D<q;D++)Ae+=w[D][n]*w[D][n];if(Ae<=h)L=0;else for($=w[n][n],L=Math.sqrt(Ae),$>=0&&(L=-L),ae=$*L-Ae,w[n][n]=$-L,D=z;D<re;D++){for(Ae=0,j=n;j<q;j++)Ae+=w[j][n]*w[j][D];for($=Ae/ae,j=n;j<q;j++)w[j][D]+=$*w[j][n]}for(ie[n]=L,Ae=0,D=z;D<re;D++)Ae=Ae+w[n][D]*w[n][D];if(Ae<=h)L=0;else{for($=w[n][n+1],L=Math.sqrt(Ae),$>=0&&(L=-L),ae=$*L-Ae,w[n][n+1]=$-L,D=z;D<re;D++)ne[D]=w[n][D]/ae;for(D=z;D<q;D++){for(Ae=0,j=z;j<re;j++)Ae+=w[D][j]*w[n][j];for(j=z;j<re;j++)w[D][j]+=Ae*ne[j]}}Pe=Math.abs(ie[n])+Math.abs(ne[n]),Pe>W&&(W=Pe)}for(n=re-1;n!=-1;n+=-1){if(L!=0){for(ae=L*w[n][n+1],D=z;D<re;D++)Re[D][n]=w[n][D]/ae;for(D=z;D<re;D++){for(Ae=0,j=z;j<re;j++)Ae+=w[n][j]*Re[j][D];for(j=z;j<re;j++)Re[j][D]+=Ae*Re[j][n]}}for(D=z;D<re;D++)Re[n][D]=0,Re[D][n]=0;Re[n][n]=1,L=ne[n],z=n}for(n=re-1;n!=-1;n+=-1){for(z=n+1,L=ie[n],D=z;D<re;D++)w[n][D]=0;if(L!=0){for(ae=w[n][n]*L,D=z;D<re;D++){for(Ae=0,j=z;j<q;j++)Ae+=w[j][n]*w[j][D];for($=Ae/ae,j=n;j<q;j++)w[j][D]+=$*w[j][n]}for(D=n;D<q;D++)w[D][n]=w[D][n]/L}else for(D=n;D<q;D++)w[D][n]=0;w[n][n]+=1}for(c=c*W,j=re-1;j!=-1;j+=-1)for(var de=0;de<d;de++){var Ye=!1;for(z=j;z!=-1;z+=-1){if(Math.abs(ne[z])<=c){Ye=!0;break}if(Math.abs(ie[z-1])<=c)break}if(!Ye){H=0,Ae=1;var Ue=z-1;for(n=z;n<j+1&&($=Ae*ne[n],ne[n]=H*ne[n],!(Math.abs($)<=c));n++)for(L=ie[n],ae=Te($,L),ie[n]=ae,H=L/ae,Ae=-$/ae,D=0;D<q;D++)Pe=w[D][Ue],Ie=w[D][n],w[D][Ue]=Pe*H+Ie*Ae,w[D][n]=-Pe*Ae+Ie*H}if(Ie=ie[j],z==j){if(Ie<0)for(ie[j]=-Ie,D=0;D<re;D++)Re[D][j]=-Re[D][j];break}if(de>=d-1)throw"Error: no convergence.";for(W=ie[z],Pe=ie[j-1],L=ne[j-1],ae=ne[j],$=((Pe-Ie)*(Pe+Ie)+(L-ae)*(L+ae))/(2*ae*Pe),L=Te($,1),$<0?$=((W-Ie)*(W+Ie)+ae*(Pe/($-L)-ae))/W:$=((W-Ie)*(W+Ie)+ae*(Pe/($+L)-ae))/W,H=1,Ae=1,n=z+1;n<j+1;n++){for(L=ne[n],Pe=ie[n],ae=Ae*L,L=H*L,Ie=Te($,ae),ne[n-1]=Ie,H=$/Ie,Ae=ae/Ie,$=W*H+L*Ae,L=-W*Ae+L*H,ae=Pe*Ae,Pe=Pe*H,D=0;D<re;D++)W=Re[D][n-1],Ie=Re[D][n],Re[D][n-1]=W*H+Ie*Ae,Re[D][n]=-W*Ae+Ie*H;for(Ie=Te($,ae),ie[n-1]=Ie,H=$/Ie,Ae=ae/Ie,$=H*L+Ae*Pe,W=-Ae*L+H*Pe,D=0;D<q;D++)Pe=w[D][n-1],Ie=w[D][n],w[D][n-1]=Pe*H+Ie*Ae,w[D][n]=-Pe*Ae+Ie*H}ne[z]=0,ne[j]=$,ie[j]=W}for(n=0;n<ie.length;n++)ie[n]<c&&(ie[n]=0);for(n=0;n<re;n++)for(D=n-1;D>=0;D--)if(ie[D]<ie[n]){for(H=ie[D],ie[D]=ie[n],ie[n]=H,j=0;j<w.length;j++)R=w[j][n],w[j][n]=w[j][D],w[j][D]=R;for(j=0;j<Re.length;j++)R=Re[j][n],Re[j][n]=Re[j][D],Re[j][D]=R;n=D}return{U:w,S:ie,V:Re}}});function _calc(t){if(t.length<4)return{gdop:"#",pdop:"#",vdop:"#",hdop:"#"};var o=numeric1_2_6.rep([t.length,4],0),R=[],c=[];t.forEach(function(w,q){R.push(w.az),c.push(w.el);var re=[Math.cos(w.el*Math.PI/180)*Math.sin(w.az*Math.PI/180),Math.cos(w.el*Math.PI/180)*Math.cos(w.az*Math.PI/180),Math.sin(w.el*Math.PI/180),1];numeric1_2_6.setBlock(o,[q,0],[q,3],[re])});var h=numeric1_2_6.dot(numeric1_2_6.transpose(o),o),d=numeric1_2_6.inv(h),H=2,n=Math.sqrt(d[0][0]+d[1][1]+d[2][2]).toFixed(H),D=Math.sqrt(d[0][0]+d[1][1]).toFixed(H),j=Math.sqrt(d[0][0]+d[1][1]+d[2][2]+d[3][3]).toFixed(H),z=Math.sqrt(d[2][2]).toFixed(H);return{pdop:n,hdop:D,gdop:j,vdop:z}}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(t){return t/1e3});function w2uOrigin(t){var o=t.wn,R=t.tow,c=Number(o)*7*24*60*60+Number(R),h=0;return gpsLeapS.forEach(function(d){c>d&&h++}),zero+c-h}function u2wOrigin(t){for(var o=Number(t)-zero,R=0;R<gpsLeapS.length;R++)o+1>=gpsLeapS[R]&&o++;var c=Number((o/604800).toFixed(0)),h=o%604800;return{wn:c,tow:h}}var gpsweek={u2w:u2wOrigin,w2u:w2uOrigin},index={coordinateTransfer,mercator,dop,gpsweek};return index})})(bundle);const satellite_geo_calc=bundle.exports;function globals(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("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"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["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,exports$3={};exports$3.greenwich=0,exports$3.lisbon=-9.131906111111,exports$3.paris=2.337229166667,exports$3.bogota=-74.080916666667,exports$3.madrid=-3.687938888889,exports$3.rome=12.452333333333,exports$3.bern=7.439583333333,exports$3.jakarta=106.807719444444,exports$3.ferro=-17.666666666667,exports$3.brussels=4.367975,exports$3.stockholm=18.058277777778,exports$3.athens=23.7163375,exports$3.oslo=10.722916666667;const units$1={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var ignoredChar=/[\s_\-\/\(\)]/g;function match(t,o){if(t[o])return t[o];for(var R=Object.keys(t),c=o.toLowerCase().replace(ignoredChar,""),h=-1,d,H;++h<R.length;)if(d=R[h],H=d.toLowerCase().replace(ignoredChar,""),H===c)return t[d]}function projStr(t){var o={},R=t.split("+").map(function(n){return n.trim()}).filter(function(n){return n}).reduce(function(n,D){var j=D.split("=");return j.push(!0),n[j[0].toLowerCase()]=j[1],n},{}),c,h,d,H={proj:"projName",datum:"datumCode",rf:function(n){o.rf=parseFloat(n)},lat_0:function(n){o.lat0=n*D2R$1},lat_1:function(n){o.lat1=n*D2R$1},lat_2:function(n){o.lat2=n*D2R$1},lat_ts:function(n){o.lat_ts=n*D2R$1},lon_0:function(n){o.long0=n*D2R$1},lon_1:function(n){o.long1=n*D2R$1},lon_2:function(n){o.long2=n*D2R$1},alpha:function(n){o.alpha=parseFloat(n)*D2R$1},gamma:function(n){o.rectified_grid_angle=parseFloat(n)},lonc:function(n){o.longc=n*D2R$1},x_0:function(n){o.x0=parseFloat(n)},y_0:function(n){o.y0=parseFloat(n)},k_0:function(n){o.k0=parseFloat(n)},k:function(n){o.k0=parseFloat(n)},a:function(n){o.a=parseFloat(n)},b:function(n){o.b=parseFloat(n)},r:function(n){o.a=o.b=parseFloat(n)},r_a:function(){o.R_A=!0},zone:function(n){o.zone=parseInt(n,10)},south:function(){o.utmSouth=!0},towgs84:function(n){o.datum_params=n.split(",").map(function(D){return parseFloat(D)})},to_meter:function(n){o.to_meter=parseFloat(n)},units:function(n){o.units=n;var D=match(units$1,n);D&&(o.to_meter=D.to_meter)},from_greenwich:function(n){o.from_greenwich=n*D2R$1},pm:function(n){var D=match(exports$3,n);o.from_greenwich=(D||parseFloat(n))*D2R$1},nadgrids:function(n){n==="@null"?o.datumCode="none":o.nadgrids=n},axis:function(n){var D="ewnsud";n.length===3&&D.indexOf(n.substr(0,1))!==-1&&D.indexOf(n.substr(1,1))!==-1&&D.indexOf(n.substr(2,1))!==-1&&(o.axis=n)},approx:function(){o.approx=!0}};for(c in R)h=R[c],c in H?(d=H[c],typeof d=="function"?d(h):o[d]=h):o[c]=h;return typeof o.datumCode=="string"&&o.datumCode!=="WGS84"&&(o.datumCode=o.datumCode.toLowerCase()),o}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(t){if(typeof t!="string")throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=NEUTRAL}Parser.prototype.readCharicter=function(){var t=this.text[this.place++];if(this.state!==QUOTED)for(;whitespace.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case NEUTRAL:return this.neutral(t);case KEYWORD:return this.keyword(t);case QUOTED:return this.quoted(t);case AFTERQUOTE:return this.afterquote(t);case NUMBER:return this.number(t);case ENDED:return}},Parser.prototype.afterquote=function(t){if(t==='"'){this.word+='"',this.state=QUOTED;return}if(endThings.test(t)){this.word=this.word.trim(),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in afterquote yet, index '+this.place)},Parser.prototype.afterItem=function(t){if(t===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=NEUTRAL;return}if(t==="]"){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(t){if(digets.test(t)){this.word+=t;return}if(endThings.test(t)){this.word=parseFloat(this.word),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in number yet, index '+this.place)},Parser.prototype.quoted=function(t){if(t==='"'){this.state=AFTERQUOTE;return}this.word+=t},Parser.prototype.keyword=function(t){if(keyword.test(t)){this.word+=t;return}if(t==="["){var o=[];o.push(this.word),this.level++,this.root===null?this.root=o:this.currentObject.push(o),this.stack.push(this.currentObject),this.currentObject=o,this.state=NEUTRAL;return}if(endThings.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in keyword yet, index '+this.place)},Parser.prototype.neutral=function(t){if(latin.test(t)){this.word=t,this.state=KEYWORD;return}if(t==='"'){this.word="",this.state=QUOTED;return}if(digets.test(t)){this.word=t,this.state=NUMBER;return}if(endThings.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" 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(t){var o=new Parser(t);return o.output()}function mapit(t,o,R){Array.isArray(o)&&(R.unshift(o),o=null);var c=o?{}:t,h=R.reduce(function(d,H){return sExpr(H,d),d},c);o&&(t[o]=h)}function sExpr(t,o){if(!Array.isArray(t)){o[t]=!0;return}var R=t.shift();if(R==="PARAMETER"&&(R=t.shift()),t.length===1){if(Array.isArray(t[0])){o[R]={},sExpr(t[0],o[R]);return}o[R]=t[0];return}if(!t.length){o[R]=!0;return}if(R==="TOWGS84"){o[R]=t;return}if(R==="AXIS"){R in o||(o[R]=[]),o[R].push(t);return}Array.isArray(R)||(o[R]={});var c;switch(R){case"UNIT":case"PRIMEM":case"VERT_DATUM":o[R]={name:t[0].toLowerCase(),convert:t[1]},t.length===3&&sExpr(t[2],o[R]);return;case"SPHEROID":case"ELLIPSOID":o[R]={name:t[0],a:t[1],rf:t[2]},t.length===4&&sExpr(t[3],o[R]);return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":t[0]=["name",t[0]],mapit(o,R,t);return;default:for(c=-1;++c<t.length;)if(!Array.isArray(t[c]))return sExpr(t,o[R]);return mapit(o,R,t)}}var D2R=.017453292519943295;function rename(t,o){var R=o[0],c=o[1];!(R in t)&&c in t&&(t[R]=t[c],o.length===3&&(t[R]=o[2](t[R])))}function d2r(t){return t*D2R}function cleanWKT(t){if(t.type==="GEOGCS"?t.projName="longlat":t.type==="LOCAL_CS"?(t.projName="identity",t.local=!0):typeof t.PROJECTION=="object"?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var o="",R=0,c=t.AXIS.length;R<c;++R){var h=[t.AXIS[R][0].toLowerCase(),t.AXIS[R][1].toLowerCase()];h[0].indexOf("north")!==-1||(h[0]==="y"||h[0]==="lat")&&h[1]==="north"?o+="n":h[0].indexOf("south")!==-1||(h[0]==="y"||h[0]==="lat")&&h[1]==="south"?o+="s":h[0].indexOf("east")!==-1||(h[0]==="x"||h[0]==="lon")&&h[1]==="east"?o+="e":(h[0].indexOf("west")!==-1||(h[0]==="x"||h[0]==="lon")&&h[1]==="west")&&(o+="w")}o.length===2&&(o+="u"),o.length===3&&(t.axis=o)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.UNIT.convert&&(t.type==="GEOGCS"?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var d=t.GEOGCS;t.type==="GEOGCS"&&(d=t),d&&(d.DATUM?t.datumCode=d.DATUM.name.toLowerCase():t.datumCode=d.name.toLowerCase(),t.datumCode.slice(0,2)==="d_"&&(t.datumCode=t.datumCode.slice(2)),(t.datumCode==="new_zealand_geodetic_datum_1949"||t.datumCode==="new_zealand_1949")&&(t.datumCode="nzgd49"),(t.datumCode==="wgs_1984"||t.datumCode==="world_geodetic_system_1984")&&(t.PROJECTION==="Mercator_Auxiliary_Sphere"&&(t.sphere=!0),t.datumCode="wgs84"),t.datumCode.slice(-6)==="_ferro"&&(t.datumCode=t.datumCode.slice(0,-6)),t.datumCode.slice(-8)==="_jakarta"&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),d.DATUM&&d.DATUM.SPHEROID&&(t.ellps=d.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),t.ellps.toLowerCase().slice(0,13)==="international"&&(t.ellps="intl"),t.a=d.DATUM.SPHEROID.a,t.rf=parseFloat(d.DATUM.SPHEROID.rf,10)),d.DATUM&&d.DATUM.TOWGS84&&(t.datum_params=d.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),t.datumCode==="ch1903+"&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a);function H(j){var z=t.to_meter||1;return j*z}var n=function(j){return rename(t,j)},D=[["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",H],["y0","false_northing",H],["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"]];D.forEach(n),!t.long0&&t.longc&&(t.projName==="Albers_Conic_Equal_Area"||t.projName==="Lambert_Azimuthal_Equal_Area")&&(t.long0=t.longc),!t.lat_ts&&t.lat1&&(t.projName==="Stereographic_South_Pole"||t.projName==="Polar Stereographic (variant B)")?(t.lat0=d2r(t.lat1>0?90:-90),t.lat_ts=t.lat1):!t.lat_ts&&t.lat0&&t.projName==="Polar_Stereographic"&&(t.lat_ts=t.lat0,t.lat0=d2r(t.lat0>0?90:-90))}function wkt(t){var o=parseString(t),R=o.shift(),c=o.shift();o.unshift(["name",c]),o.unshift(["type",R]);var h={};return sExpr(o,h),cleanWKT(h),h}function defs(t){var o=this;if(arguments.length===2){var R=arguments[1];typeof R=="string"?R.charAt(0)==="+"?defs[t]=projStr(arguments[1]):defs[t]=wkt(arguments[1]):defs[t]=R}else if(arguments.length===1){if(Array.isArray(t))return t.map(function(c){Array.isArray(c)?defs.apply(o,c):defs(c)});if(typeof t=="string"){if(t in defs)return defs[t]}else"EPSG"in t?defs["EPSG:"+t.EPSG]=t:"ESRI"in t?defs["ESRI:"+t.ESRI]=t:"IAU2000"in t?defs["IAU2000:"+t.IAU2000]=t:console.log(t);return}}globals(defs);function testObj(t){return typeof t=="string"}function testDef(t){return t in defs}var codeWords=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function testWKT(t){return codeWords.some(function(o){return t.indexOf(o)>-1})}var codes=["3857","900913","3785","102113"];function checkMercator(t){var o=match(t,"authority");if(!!o){var R=match(o,"epsg");return R&&codes.indexOf(R)>-1}}function checkProjStr(t){var o=match(t,"extension");if(!!o)return match(o,"proj4")}function testProj(t){return t[0]==="+"}function parse$3(t){if(testObj(t)){if(testDef(t))return defs[t];if(testWKT(t)){var o=wkt(t);if(checkMercator(o))return defs["EPSG:3857"];var R=checkProjStr(o);return R?projStr(R):o}if(testProj(t))return projStr(t)}else return t}function extend$1(t,o){t=t||{};var R,c;if(!o)return t;for(c in o)R=o[c],R!==void 0&&(t[c]=R);return t}function msfnz(t,o,R){var c=t*o;return R/Math.sqrt(1-c*c)}function sign$1(t){return t<0?-1:1}function adjust_lon(t){return Math.abs(t)<=SPI?t:t-sign$1(t)*TWO_PI}function tsfnz(t,o,R){var c=t*R,h=.5*t;return c=Math.pow((1-c)/(1+c),h),Math.tan(.5*(HALF_PI-o))/c}function phi2z(t,o){for(var R=.5*t,c,h,d=HALF_PI-2*Math.atan(o),H=0;H<=15;H++)if(c=t*Math.sin(d),h=HALF_PI-2*Math.atan(o*Math.pow((1-c)/(1+c),R))-d,d+=h,Math.abs(h)<=1e-10)return d;return-9999}function init$x(){var t=this.b/this.a;this.es=1-t*t,"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(t){var o=t.x,R=t.y;if(R*R2D>90&&R*R2D<-90&&o*R2D>180&&o*R2D<-180)return null;var c,h;if(Math.abs(Math.abs(R)-HALF_PI)<=EPSLN)return null;if(this.sphere)c=this.x0+this.a*this.k0*adjust_lon(o-this.long0),h=this.y0+this.a*this.k0*Math.log(Math.tan(FORTPI+.5*R));else{var d=Math.sin(R),H=tsfnz(this.e,R,d);c=this.x0+this.a*this.k0*adjust_lon(o-this.long0),h=this.y0-this.a*this.k0*Math.log(H)}return t.x=c,t.y=h,t}function inverse$v(t){var o=t.x-this.x0,R=t.y-this.y0,c,h;if(this.sphere)h=HALF_PI-2*Math.atan(Math.exp(-R/(this.a*this.k0)));else{var d=Math.exp(-R/(this.a*this.k0));if(h=phi2z(this.e,d),h===-9999)return null}return c=adjust_lon(this.long0+o/(this.a*this.k0)),t.x=c,t.y=h,t}var names$y=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const merc={init:init$x,forward:forward$v,inverse:inverse$v,names:names$y};function init$w(){}function identity$1(t){return t}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$1(t,o){var R=projStore.length;return t.names?(projStore[R]=t,t.names.forEach(function(c){names$w[c.toLowerCase()]=R}),this):(console.log(o),!0)}function get(t){if(!t)return!1;var o=t.toLowerCase();if(typeof names$w[o]!="undefined"&&projStore[names$w[o]])return projStore[names$w[o]]}function start(){projs.forEach(add$1)}const projections={start,add:add$1,get};var exports$2={};exports$2.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},exports$2.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},exports$2.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},exports$2.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},exports$2.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},exports$2.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},exports$2.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},exports$2.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},exports$2.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},exports$2.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},exports$2.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},exports$2.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},exports$2.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},exports$2.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},exports$2.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},exports$2.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},exports$2.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},exports$2.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},exports$2.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},exports$2.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},exports$2.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},exports$2.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},exports$2.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},exports$2.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},exports$2.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},exports$2.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},exports$2.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},exports$2.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},exports$2.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},exports$2.hough={a:6378270,rf:297,ellipseName:"Hough"},exports$2.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},exports$2.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},exports$2.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},exports$2.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},exports$2.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},exports$2.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},exports$2.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},exports$2.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},exports$2.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},exports$2.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},exports$2.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},exports$2.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var WGS84=exports$2.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};exports$2.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function eccentricity(t,o,R,c){var h=t*t,d=o*o,H=(h-d)/h,n=0;c?(t*=1-H*(SIXTH+H*(RA4+H*RA6)),h=t*t,H=0):n=Math.sqrt(H);var D=(h-d)/d;return{es:H,e:n,ep2:D}}function sphere(t,o,R,c,h){if(!t){var d=match(exports$2,c);d||(d=WGS84),t=d.a,o=d.b,R=d.rf}return R&&!o&&(o=(1-1/R)*t),(R===0||Math.abs(t-o)<EPSLN)&&(h=!0,o=t),{a:t,b:o,rf:R,sphere:h}}var exports$1={};exports$1.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},exports$1.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},exports$1.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},exports$1.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},exports$1.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},exports$1.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},exports$1.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},exports$1.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},exports$1.militargeographische_institut={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},exports$1.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},exports$1.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},exports$1.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},exports$1.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},exports$1.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},exports$1.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},exports$1.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},exports$1.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},exports$1.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function datum(t,o,R,c,h,d,H){var n={};return t===void 0||t==="none"?n.datum_type=PJD_NODATUM:n.datum_type=PJD_WGS84,o&&(n.datum_params=o.map(parseFloat),(n.datum_params[0]!==0||n.datum_params[1]!==0||n.datum_params[2]!==0)&&(n.datum_type=PJD_3PARAM),n.datum_params.length>3&&(n.datum_params[3]!==0||n.datum_params[4]!==0||n.datum_params[5]!==0||n.datum_params[6]!==0)&&(n.datum_type=PJD_7PARAM,n.datum_params[3]*=SEC_TO_RAD,n.datum_params[4]*=SEC_TO_RAD,n.datum_params[5]*=SEC_TO_RAD,n.datum_params[6]=n.datum_params[6]/1e6+1)),H&&(n.datum_type=PJD_GRIDSHIFT,n.grids=H),n.a=R,n.b=c,n.es=h,n.ep2=d,n}var loadedNadgrids={};function nadgrid(t,o){var R=new DataView(o),c=detectLittleEndian(R),h=readHeader(R,c),d=readSubgrids(R,h,c),H={header:h,subgrids:d};return loadedNadgrids[t]=H,H}function getNadgrids(t){if(t===void 0)return null;var o=t.split(",");return o.map(parseNadgridString)}function parseNadgridString(t){if(t.length===0)return null;var o=t[0]==="@";return o&&(t=t.slice(1)),t==="null"?{name:"null",mandatory:!o,grid:null,isNull:!0}:{name:t,mandatory:!o,grid:loadedNadgrids[t]||null,isNull:!1}}function secondsToRadians(t){return t/3600*Math.PI/180}function detectLittleEndian(t){var o=t.getInt32(8,!1);return o===11?!1:(o=t.getInt32(8,!0),o!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function readHeader(t,o){return{nFields:t.getInt32(8,o),nSubgridFields:t.getInt32(24,o),nSubgrids:t.getInt32(40,o),shiftType:decodeString(t,56,56+8).trim(),fromSemiMajorAxis:t.getFloat64(120,o),fromSemiMinorAxis:t.getFloat64(136,o),toSemiMajorAxis:t.getFloat64(152,o),toSemiMinorAxis:t.getFloat64(168,o)}}function decodeString(t,o,R){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(o,R)))}function readSubgrids(t,o,R){for(var c=176,h=[],d=0;d<o.nSubgrids;d++){var H=readGridHeader(t,c,R),n=readGridNodes(t,c,H,R),D=Math.round(1+(H.upperLongitude-H.lowerLongitude)/H.longitudeInterval),j=Math.round(1+(H.upperLatitude-H.lowerLatitude)/H.latitudeInterval);h.push({ll:[secondsToRadians(H.lowerLongitude),secondsToRadians(H.lowerLatitude)],del:[secondsToRadians(H.longitudeInterval),secondsToRadians(H.latitudeInterval)],lim:[D,j],count:H.gridNodeCount,cvs:mapNodes(n)}),c+=176+H.gridNodeCount*16}return h}function mapNodes(t){return t.map(function(o){return[secondsToRadians(o.longitudeShift),secondsToRadians(o.latitudeShift)]})}function readGridHeader(t,o,R){return{name:decodeString(t,o+8,o+16).trim(),parent:decodeString(t,o+24,o+24+8).trim(),lowerLatitude:t.getFloat64(o+72,R),upperLatitude:t.getFloat64(o+88,R),lowerLongitude:t.getFloat64(o+104,R),upperLongitude:t.getFloat64(o+120,R),latitudeInterval:t.getFloat64(o+136,R),longitudeInterval:t.getFloat64(o+152,R),gridNodeCount:t.getInt32(o+168,R)}}function readGridNodes(t,o,R,c){for(var h=o+176,d=16,H=[],n=0;n<R.gridNodeCount;n++){var D={latitudeShift:t.getFloat32(h+n*d,c),longitudeShift:t.getFloat32(h+n*d+4,c),latitudeAccuracy:t.getFloat32(h+n*d+8,c),longitudeAccuracy:t.getFloat32(h+n*d+12,c)};H.push(D)}return H}function Projection(t,o){if(!(this instanceof Projection))return new Projection(t);o=o||function(j){if(j)throw j};var R=parse$3(t);if(typeof R!="object"){o("Could not parse to valid json: "+t);return}var c=Projection.projections.get(R.projName);if(!c){o("Could not get projection name from: "+t);return}if(R.datumCode&&R.datumCode!=="none"){var h=match(exports$1,R.datumCode);h&&(R.datum_params=R.datum_params||(h.towgs84?h.towgs84.split(","):null),R.ellps=h.ellipse,R.datumName=h.datumName?h.datumName:R.datumCode)}R.k0=R.k0||1,R.axis=R.axis||"enu",R.ellps=R.ellps||"wgs84",R.lat1=R.lat1||R.lat0;var d=sphere(R.a,R.b,R.rf,R.ellps,R.sphere),H=eccentricity(d.a,d.b,d.rf,R.R_A),n=getNadgrids(R.nadgrids),D=R.datum||datum(R.datumCode,R.datum_params,d.a,d.b,H.es,H.ep2,n);extend$1(this,R),extend$1(this,c),this.a=d.a,this.b=d.b,this.rf=d.rf,this.sphere=d.sphere,this.es=H.es,this.e=H.e,this.ep2=H.ep2,this.datum=D,this.init(),o(null,this)}Projection.projections=projections,Projection.projections.start();function compareDatums(t,o){return t.datum_type!==o.datum_type||t.a!==o.a||Math.abs(t.es-o.es)>5e-11?!1:t.datum_type===PJD_3PARAM?t.datum_params[0]===o.datum_params[0]&&t.datum_params[1]===o.datum_params[1]&&t.datum_params[2]===o.datum_params[2]:t.datum_type===PJD_7PARAM?t.datum_params[0]===o.datum_params[0]&&t.datum_params[1]===o.datum_params[1]&&t.datum_params[2]===o.datum_params[2]&&t.datum_params[3]===o.datum_params[3]&&t.datum_params[4]===o.datum_params[4]&&t.datum_params[5]===o.datum_params[5]&&t.datum_params[6]===o.datum_params[6]:!0}function geodeticToGeocentric(t,o,R){var c=t.x,h=t.y,d=t.z?t.z:0,H,n,D,j;if(h<-HALF_PI&&h>-1.001*HALF_PI)h=-HALF_PI;else if(h>HALF_PI&&h<1.001*HALF_PI)h=HALF_PI;else{if(h<-HALF_PI)return{x:-1/0,y:-1/0,z:t.z};if(h>HALF_PI)return{x:1/0,y:1/0,z:t.z}}return c>Math.PI&&(c-=2*Math.PI),n=Math.sin(h),j=Math.cos(h),D=n*n,H=R/Math.sqrt(1-o*D),{x:(H+d)*j*Math.cos(c),y:(H+d)*j*Math.sin(c),z:(H*(1-o)+d)*n}}function geocentricToGeodetic(t,o,R,c){var h=1e-12,d=h*h,H=30,n,D,j,z,w,q,re,ne,ie,Re,Te,$,L,ae=t.x,W=t.y,Pe=t.z?t.z:0,Ie,Ae,de;if(n=Math.sqrt(ae*ae+W*W),D=Math.sqrt(ae*ae+W*W+Pe*Pe),n/R<h){if(Ie=0,D/R<h)return Ae=HALF_PI,de=-c,{x:t.x,y:t.y,z:t.z}}else Ie=Math.atan2(W,ae);j=Pe/D,z=n/D,w=1/Math.sqrt(1-o*(2-o)*z*z),ne=z*(1-o)*w,ie=j*w,L=0;do L++,re=R/Math.sqrt(1-o*ie*ie),de=n*ne+Pe*ie-re*(1-o*ie*ie),q=o*re/(re+de),w=1/Math.sqrt(1-q*(2-q)*z*z),Re=z*(1-q)*w,Te=j*w,$=Te*ne-Re*ie,ne=Re,ie=Te;while($*$>d&&L<H);return Ae=Math.atan(Te/Math.abs(Re)),{x:Ie,y:Ae,z:de}}function geocentricToWgs84(t,o,R){if(o===PJD_3PARAM)return{x:t.x+R[0],y:t.y+R[1],z:t.z+R[2]};if(o===PJD_7PARAM){var c=R[0],h=R[1],d=R[2],H=R[3],n=R[4],D=R[5],j=R[6];return{x:j*(t.x-D*t.y+n*t.z)+c,y:j*(D*t.x+t.y-H*t.z)+h,z:j*(-n*t.x+H*t.y+t.z)+d}}}function geocentricFromWgs84(t,o,R){if(o===PJD_3PARAM)return{x:t.x-R[0],y:t.y-R[1],z:t.z-R[2]};if(o===PJD_7PARAM){var c=R[0],h=R[1],d=R[2],H=R[3],n=R[4],D=R[5],j=R[6],z=(t.x-c)/j,w=(t.y-h)/j,q=(t.z-d)/j;return{x:z+D*w-n*q,y:-D*z+w+H*q,z:n*z-H*w+q}}}function checkParams(t){return t===PJD_3PARAM||t===PJD_7PARAM}function datum_transform(t,o,R){if(compareDatums(t,o)||t.datum_type===PJD_NODATUM||o.datum_type===PJD_NODATUM)return R;var c=t.a,h=t.es;if(t.datum_type===PJD_GRIDSHIFT){var d=applyGridShift(t,!1,R);if(d!==0)return;c=SRS_WGS84_SEMIMAJOR,h=SRS_WGS84_ESQUARED}var H=o.a,n=o.b,D=o.es;if(o.datum_type===PJD_GRIDSHIFT&&(H=SRS_WGS84_SEMIMAJOR,n=SRS_WGS84_SEMIMINOR,D=SRS_WGS84_ESQUARED),h===D&&c===H&&!checkParams(t.datum_type)&&!checkParams(o.datum_type))return R;if(R=geodeticToGeocentric(R,h,c),checkParams(t.datum_type)&&(R=geocentricToWgs84(R,t.datum_type,t.datum_params)),checkParams(o.datum_type)&&(R=geocentricFromWgs84(R,o.datum_type,o.datum_params)),R=geocentricToGeodetic(R,D,H,n),o.datum_type===PJD_GRIDSHIFT){var j=applyGridShift(o,!0,R);if(j!==0)return}return R}function applyGridShift(t,o,R){if(t.grids===null||t.grids.length===0)return console.log("Grid shift grids not found"),-1;var c={x:-R.x,y:R.y},h={x:Number.NaN,y:Number.NaN},d=[];e:for(var H=0;H<t.grids.length;H++){var n=t.grids[H];if(d.push(n.name),n.isNull){h=c;break}if(n.mandatory,n.grid===null){if(n.mandatory)return console.log("Unable to find mandatory grid '"+n.name+"'"),-1;continue}for(var D=n.grid.subgrids,j=0,z=D.length;j<z;j++){var w=D[j],q=(Math.abs(w.del[1])+Math.abs(w.del[0]))/1e4,re=w.ll[0]-q,ne=w.ll[1]-q,ie=w.ll[0]+(w.lim[0]-1)*w.del[0]+q,Re=w.ll[1]+(w.lim[1]-1)*w.del[1]+q;if(!(ne>c.y||re>c.x||Re<c.y||ie<c.x)&&(h=applySubgridShift(c,o,w),!isNaN(h.x)))break e}}return isNaN(h.x)?(console.log("Failed to find a grid shift table for location '"+-c.x*R2D+" "+c.y*R2D+" tried: '"+d+"'"),-1):(R.x=-h.x,R.y=h.y,0)}function applySubgridShift(t,o,R){var c={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return c;var h={x:t.x,y:t.y};h.x-=R.ll[0],h.y-=R.ll[1],h.x=adjust_lon(h.x-Math.PI)+Math.PI;var d=nadInterpolate(h,R);if(o){if(isNaN(d.x))return c;d.x=h.x-d.x,d.y=h.y-d.y;var H=9,n=1e-12,D,j;do{if(j=nadInterpolate(d,R),isNaN(j.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}D={x:h.x-(j.x+d.x),y:h.y-(j.y+d.y)},d.x+=D.x,d.y+=D.y}while(H--&&Math.abs(D.x)>n&&Math.abs(D.y)>n);if(H<0)return console.log("Inverse grid shift iterator failed to converge."),c;c.x=adjust_lon(d.x+R.ll[0]),c.y=d.y+R.ll[1]}else isNaN(d.x)||(c.x=t.x+d.x,c.y=t.y+d.y);return c}function nadInterpolate(t,o){var R={x:t.x/o.del[0],y:t.y/o.del[1]},c={x:Math.floor(R.x),y:Math.floor(R.y)},h={x:R.x-1*c.x,y:R.y-1*c.y},d={x:Number.NaN,y:Number.NaN},H;if(c.x<0||c.x>=o.lim[0]||c.y<0||c.y>=o.lim[1])return d;H=c.y*o.lim[0]+c.x;var n={x:o.cvs[H][0],y:o.cvs[H][1]};H++;var D={x:o.cvs[H][0],y:o.cvs[H][1]};H+=o.lim[0];var j={x:o.cvs[H][0],y:o.cvs[H][1]};H--;var z={x:o.cvs[H][0],y:o.cvs[H][1]},w=h.x*h.y,q=h.x*(1-h.y),re=(1-h.x)*(1-h.y),ne=(1-h.x)*h.y;return d.x=re*n.x+q*D.x+ne*z.x+w*j.x,d.y=re*n.y+q*D.y+ne*z.y+w*j.y,d}function adjust_axis(t,o,R){var c=R.x,h=R.y,d=R.z||0,H,n,D,j={};for(D=0;D<3;D++)if(!(o&&D===2&&R.z===void 0))switch(D===0?(H=c,"ew".indexOf(t.axis[D])!==-1?n="x":n="y"):D===1?(H=h,"ns".indexOf(t.axis[D])!==-1?n="y":n="x"):(H=d,n="z"),t.axis[D]){case"e":j[n]=H;break;case"w":j[n]=-H;break;case"n":j[n]=H;break;case"s":j[n]=-H;break;case"u":R[n]!==void 0&&(j.z=H);break;case"d":R[n]!==void 0&&(j.z=-H);break;default:return null}return j}function common$1(t){var o={x:t[0],y:t[1]};return t.length>2&&(o.z=t[2]),t.length>3&&(o.m=t[3]),o}function checkSanity(t){checkCoord(t.x),checkCoord(t.y)}function checkCoord(t){if(typeof Number.isFinite=="function"){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if(typeof t!="number"||t!==t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function checkNotWGS(t,o){return(t.datum.datum_type===PJD_3PARAM||t.datum.datum_type===PJD_7PARAM||t.datum.datum_type===PJD_GRIDSHIFT)&&o.datumCode!=="WGS84"||(o.datum.datum_type===PJD_3PARAM||o.datum.datum_type===PJD_7PARAM||o.datum.datum_type===PJD_GRIDSHIFT)&&t.datumCode!=="WGS84"}function transform$1(t,o,R,c){var h;Array.isArray(R)?R=common$1(R):R={x:R.x,y:R.y,z:R.z,m:R.m};var d=R.z!==void 0;if(checkSanity(R),t.datum&&o.datum&&checkNotWGS(t,o)&&(h=new Projection("WGS84"),R=transform$1(t,h,R,c),t=h),c&&t.axis!=="enu"&&(R=adjust_axis(t,!1,R)),t.projName==="longlat")R={x:R.x*D2R$1,y:R.y*D2R$1,z:R.z||0};else if(t.to_meter&&(R={x:R.x*t.to_meter,y:R.y*t.to_meter,z:R.z||0}),R=t.inverse(R),!R)return;if(t.from_greenwich&&(R.x+=t.from_greenwich),R=datum_transform(t.datum,o.datum,R),!!R)return o.from_greenwich&&(R={x:R.x-o.from_greenwich,y:R.y,z:R.z||0}),o.projName==="longlat"?R={x:R.x*R2D,y:R.y*R2D,z:R.z||0}:(R=o.forward(R),o.to_meter&&(R={x:R.x/o.to_meter,y:R.y/o.to_meter,z:R.z||0})),c&&o.axis!=="enu"?adjust_axis(o,!0,R):(R&&!d&&delete R.z,R)}var wgs84=Projection("WGS84");function transformer(t,o,R,c){var h,d,H;return Array.isArray(R)?(h=transform$1(t,o,R,c)||{x:NaN,y:NaN},R.length>2?typeof t.name!="undefined"&&t.name==="geocent"||typeof o.name!="undefined"&&o.name==="geocent"?typeof h.z=="number"?[h.x,h.y,h.z].concat(R.slice(3)):[h.x,h.y,R[2]].concat(R.slice(3)):[h.x,h.y].concat(R.slice(2)):[h.x,h.y]):(d=transform$1(t,o,R,c),H=Object.keys(R),H.length===2||H.forEach(function(n){if(typeof t.name!="undefined"&&t.name==="geocent"||typeof o.name!="undefined"&&o.name==="geocent"){if(n==="x"||n==="y"||n==="z")return}else if(n==="x"||n==="y")return;d[n]=R[n]}),d)}function checkProj(t){return t instanceof Projection?t:t.oProj?t.oProj:Projection(t)}function proj4(t,o,R){t=checkProj(t);var c=!1,h;return typeof o=="undefined"?(o=t,t=wgs84,c=!0):(typeof o.x!="undefined"||Array.isArray(o))&&(R=o,o=t,t=wgs84,c=!0),o=checkProj(o),R?transformer(t,o,R):(h={forward:function(d,H){return transformer(t,o,d,H)},inverse:function(d,H){return transformer(o,t,d,H)}},c&&(h.oProj=o),h)}var NUM_100K_SETS=6,SET_ORIGIN_COLUMN_LETTERS="AJSAJS",SET_ORIGIN_ROW_LETTERS="AFAFAF",A=65,I=73,O=79,V=86,Z=90;const mgrs={forward:forward$u,inverse:inverse$u,toPoint};function forward$u(t,o){return o=o||5,encode(LLtoUTM({lat:t[1],lon:t[0]}),o)}function inverse$u(t){var o=UTMtoLL(decode(t.toUpperCase()));return o.lat&&o.lon?[o.lon,o.lat,o.lon,o.lat]:[o.left,o.bottom,o.right,o.top]}function toPoint(t){var o=UTMtoLL(decode(t.toUpperCase()));return o.lat&&o.lon?[o.lon,o.lat]:[(o.left+o.right)/2,(o.top+o.bottom)/2]}function degToRad(t){return t*(Math.PI/180)}function radToDeg(t){return 180*(t/Math.PI)}function LLtoUTM(t){var o=t.lat,R=t.lon,c=6378137,h=.00669438,d=.9996,H,n,D,j,z,w,q,re=degToRad(o),ne=degToRad(R),ie,Re;Re=Math.floor((R+180)/6)+1,R===180&&(Re=60),o>=56&&o<64&&R>=3&&R<12&&(Re=32),o>=72&&o<84&&(R>=0&&R<9?Re=31:R>=9&&R<21?Re=33:R>=21&&R<33?Re=35:R>=33&&R<42&&(Re=37)),H=(Re-1)*6-180+3,ie=degToRad(H),n=h/(1-h),D=c/Math.sqrt(1-h*Math.sin(re)*Math.sin(re)),j=Math.tan(re)*Math.tan(re),z=n*Math.cos(re)*Math.cos(re),w=Math.cos(re)*(ne-ie),q=c*((1-h/4-3*h*h/64-5*h*h*h/256)*re-(3*h/8+3*h*h/32+45*h*h*h/1024)*Math.sin(2*re)+(15*h*h/256+45*h*h*h/1024)*Math.sin(4*re)-35*h*h*h/3072*Math.sin(6*re));var Te=d*D*(w+(1-j+z)*w*w*w/6+(5-18*j+j*j+72*z-58*n)*w*w*w*w*w/120)+5e5,$=d*(q+D*Math.tan(re)*(w*w/2+(5-j+9*z+4*z*z)*w*w*w*w/24+(61-58*j+j*j+600*z-330*n)*w*w*w*w*w*w/720));return o<0&&($+=1e7),{northing:Math.round($),easting:Math.round(Te),zoneNumber:Re,zoneLetter:getLetterDesignator(o)}}function UTMtoLL(t){var o=t.northing,R=t.easting,c=t.zoneLetter,h=t.zoneNumber;if(h<0||h>60)return null;var d=.9996,H=6378137,n=.00669438,D,j=(1-Math.sqrt(1-n))/(1+Math.sqrt(1-n)),z,w,q,re,ne,ie,Re,Te,$,L=R-5e5,ae=o;c<"N"&&(ae-=1e7),Re=(h-1)*6-180+3,D=n/(1-n),ie=ae/d,Te=ie/(H*(1-n/4-3*n*n/64-5*n*n*n/256)),$=Te+(3*j/2-27*j*j*j/32)*Math.sin(2*Te)+(21*j*j/16-55*j*j*j*j/32)*Math.sin(4*Te)+151*j*j*j/96*Math.sin(6*Te),z=H/Math.sqrt(1-n*Math.sin($)*Math.sin($)),w=Math.tan($)*Math.tan($),q=D*Math.cos($)*Math.cos($),re=H*(1-n)/Math.pow(1-n*Math.sin($)*Math.sin($),1.5),ne=L/(z*d);var W=$-z*Math.tan($)/re*(ne*ne/2-(5+3*w+10*q-4*q*q-9*D)*ne*ne*ne*ne/24+(61+90*w+298*q+45*w*w-252*D-3*q*q)*ne*ne*ne*ne*ne*ne/720);W=radToDeg(W);var Pe=(ne-(1+2*w+q)*ne*ne*ne/6+(5-2*q+28*w-3*q*q+8*D+24*w*w)*ne*ne*ne*ne*ne/120)/Math.cos($);Pe=Re+radToDeg(Pe);var Ie;if(t.accuracy){var Ae=UTMtoLL({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});Ie={top:Ae.lat,right:Ae.lon,bottom:W,left:Pe}}else Ie={lat:W,lon:Pe};return Ie}function getLetterDesignator(t){var o="Z";return 84>=t&&t>=72?o="X":72>t&&t>=64?o="W":64>t&&t>=56?o="V":56>t&&t>=48?o="U":48>t&&t>=40?o="T":40>t&&t>=32?o="S":32>t&&t>=24?o="R":24>t&&t>=16?o="Q":16>t&&t>=8?o="P":8>t&&t>=0?o="N":0>t&&t>=-8?o="M":-8>t&&t>=-16?o="L":-16>t&&t>=-24?o="K":-24>t&&t>=-32?o="J":-32>t&&t>=-40?o="H":-40>t&&t>=-48?o="G":-48>t&&t>=-56?o="F":-56>t&&t>=-64?o="E":-64>t&&t>=-72?o="D":-72>t&&t>=-80&&(o="C"),o}function encode(t,o){var R="00000"+t.easting,c="00000"+t.northing;return t.zoneNumber+t.zoneLetter+get100kID(t.easting,t.northing,t.zoneNumber)+R.substr(R.length-5,o)+c.substr(c.length-5,o)}function get100kID(t,o,R){var c=get100kSetForZone(R),h=Math.floor(t/1e5),d=Math.floor(o/1e5)%20;return getLetter100kID(h,d,c)}function get100kSetForZone(t){var o=t%NUM_100K_SETS;return o===0&&(o=NUM_100K_SETS),o}function getLetter100kID(t,o,R){var c=R-1,h=SET_ORIGIN_COLUMN_LETTERS.charCodeAt(c),d=SET_ORIGIN_ROW_LETTERS.charCodeAt(c),H=h+t-1,n=d+o,D=!1;H>Z&&(H=H-Z+A-1,D=!0),(H===I||h<I&&H>I||(H>I||h<I)&&D)&&H++,(H===O||h<O&&H>O||(H>O||h<O)&&D)&&(H++,H===I&&H++),H>Z&&(H=H-Z+A-1),n>V?(n=n-V+A-1,D=!0):D=!1,(n===I||d<I&&n>I||(n>I||d<I)&&D)&&n++,(n===O||d<O&&n>O||(n>O||d<O)&&D)&&(n++,n===I&&n++),n>V&&(n=n-V+A-1);var j=String.fromCharCode(H)+String.fromCharCode(n);return j}function decode(t){if(t&&t.length===0)throw"MGRSPoint coverting from nothing";for(var o=t.length,R=null,c="",h,d=0;!/[A-Z]/.test(h=t.charAt(d));){if(d>=2)throw"MGRSPoint bad conversion from: "+t;c+=h,d++}var H=parseInt(c,10);if(d===0||d+3>o)throw"MGRSPoint bad conversion from: "+t;var n=t.charAt(d++);if(n<="A"||n==="B"||n==="Y"||n>="Z"||n==="I"||n==="O")throw"MGRSPoint zone letter "+n+" not handled: "+t;R=t.substring(d,d+=2);for(var D=get100kSetForZone(H),j=getEastingFromChar(R.charAt(0),D),z=getNorthingFromChar(R.charAt(1),D);z<getMinNorthing(n);)z+=2e6;var w=o-d;if(w%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`+t;var q=w/2,re=0,ne=0,ie,Re,Te,$,L;return q>0&&(ie=1e5/Math.pow(10,q),Re=t.substring(d,d+q),re=parseFloat(Re)*ie,Te=t.substring(d+q),ne=parseFloat(Te)*ie),$=re+j,L=ne+z,{easting:$,northing:L,zoneLetter:n,zoneNumber:H,accuracy:ie}}function getEastingFromChar(t,o){for(var R=SET_ORIGIN_COLUMN_LETTERS.charCodeAt(o-1),c=1e5,h=!1;R!==t.charCodeAt(0);){if(R++,R===I&&R++,R===O&&R++,R>Z){if(h)throw"Bad character: "+t;R=A,h=!0}c+=1e5}return c}function getNorthingFromChar(t,o){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var R=SET_ORIGIN_ROW_LETTERS.charCodeAt(o-1),c=0,h=!1;R!==t.charCodeAt(0);){if(R++,R===I&&R++,R===O&&R++,R>V){if(h)throw"Bad character: "+t;R=A,h=!0}c+=1e5}return c}function getMinNorthing(t){var o;switch(t){case"C":o=11e5;break;case"D":o=2e6;break;case"E":o=28e5;break;case"F":o=37e5;break;case"G":o=46e5;break;case"H":o=55e5;break;case"J":o=64e5;break;case"K":o=73e5;break;case"L":o=82e5;break;case"M":o=91e5;break;case"N":o=0;break;case"P":o=8e5;break;case"Q":o=17e5;break;case"R":o=26e5;break;case"S":o=35e5;break;case"T":o=44e5;break;case"U":o=53e5;break;case"V":o=62e5;break;case"W":o=7e6;break;case"X":o=79e5;break;default:o=-1}if(o>=0)return o;throw"Invalid zone letter: "+t}function Point(t,o,R){if(!(this instanceof Point))return new Point(t,o,R);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if(typeof t=="object")this.x=t.x,this.y=t.y,this.z=t.z||0;else if(typeof t=="string"&&typeof o=="undefined"){var c=t.split(",");this.x=parseFloat(c[0],10),this.y=parseFloat(c[1],10),this.z=parseFloat(c[2],10)||0}else this.x=t,this.y=o,this.z=R||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Point.fromMGRS=function(t){return new Point(toPoint(t))},Point.prototype.toMGRS=function(t){return forward$u([this.x,this.y],t)};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(t){var o=[];o[0]=C00-t*(C02+t*(C04+t*(C06+t*C08))),o[1]=t*(C22-t*(C04+t*(C06+t*C08)));var R=t*t;return o[2]=R*(C44-t*(C46+t*C48)),R*=t,o[3]=R*(C66-t*C68),o[4]=R*t*C88,o}function pj_mlfn(t,o,R,c){return R*=o,o*=o,c[0]*t-R*(c[1]+o*(c[2]+o*(c[3]+o*c[4])))}var MAX_ITER$3=20;function pj_inv_mlfn(t,o,R){for(var c=1/(1-o),h=t,d=MAX_ITER$3;d;--d){var H=Math.sin(h),n=1-o*H*H;if(n=(pj_mlfn(h,H,Math.cos(h),R)-t)*(n*Math.sqrt(n))*c,h-=n,Math.abs(n)<EPSLN)return h}return h}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(t){var o=t.x,R=t.y,c=adjust_lon(o-this.long0),h,d,H,n=Math.sin(R),D=Math.cos(R);if(this.es){var z=D*c,w=Math.pow(z,2),q=this.ep2*Math.pow(D,2),re=Math.pow(q,2),ne=Math.abs(D)>EPSLN?Math.tan(R):0,ie=Math.pow(ne,2),Re=Math.pow(ie,2);h=1-this.es*Math.pow(n,2),z=z/Math.sqrt(h);var Te=pj_mlfn(R,n,D,this.en);d=this.a*(this.k0*z*(1+w/6*(1-ie+q+w/20*(5-18*ie+Re+14*q-58*ie*q+w/42*(61+179*Re-Re*ie-479*ie)))))+this.x0,H=this.a*(this.k0*(Te-this.ml0+n*c*z/2*(1+w/12*(5-ie+9*q+4*re+w/30*(61+Re-58*ie+270*q-330*ie*q+w/56*(1385+543*Re-Re*ie-3111*ie))))))+this.y0}else{var j=D*Math.sin(c);if(Math.abs(Math.abs(j)-1)<EPSLN)return 93;if(d=.5*this.a*this.k0*Math.log((1+j)/(1-j))+this.x0,H=D*Math.cos(c)/Math.sqrt(1-Math.pow(j,2)),j=Math.abs(H),j>=1){if(j-1>EPSLN)return 93;H=0}else H=Math.acos(H);R<0&&(H=-H),H=this.a*this.k0*(H-this.lat0)+this.y0}return t.x=d,t.y=H,t}function inverse$t(t){var o,R,c,h,d=(t.x-this.x0)*(1/this.a),H=(t.y-this.y0)*(1/this.a);if(this.es)if(o=this.ml0+H/this.k0,R=pj_inv_mlfn(o,this.es,this.en),Math.abs(R)<HALF_PI){var w=Math.sin(R),q=Math.cos(R),re=Math.abs(q)>EPSLN?Math.tan(R):0,ne=this.ep2*Math.pow(q,2),ie=Math.pow(ne,2),Re=Math.pow(re,2),Te=Math.pow(Re,2);o=1-this.es*Math.pow(w,2);var $=d*Math.sqrt(o)/this.k0,L=Math.pow($,2);o=o*re,c=R-o*L/(1-this.es)*.5*(1-L/12*(5+3*Re-9*ne*Re+ne-4*ie-L/30*(61+90*Re-252*ne*Re+45*Te+46*ne-L/56*(1385+3633*Re+4095*Te+1574*Te*Re)))),h=adjust_lon(this.long0+$*(1-L/6*(1+2*Re+ne-L/20*(5+28*Re+24*Te+8*ne*Re+6*ne-L/42*(61+662*Re+1320*Te+720*Te*Re))))/q)}else c=HALF_PI*sign$1(H),h=0;else{var n=Math.exp(d/this.k0),D=.5*(n-1/n),j=this.lat0+H/this.k0,z=Math.cos(j);o=Math.sqrt((1-Math.pow(z,2))/(1+Math.pow(D,2))),c=Math.asin(o),H<0&&(c=-c),D===0&&z===0?h=0:h=adjust_lon(Math.atan2(D,z)+this.long0)}return t.x=h,t.y=c,t}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$1(t){var o=Math.exp(t);return o=(o-1/o)/2,o}function hypot$1(t,o){t=Math.abs(t),o=Math.abs(o);var R=Math.max(t,o),c=Math.min(t,o)/(R||1);return R*Math.sqrt(1+Math.pow(c,2))}function log1py(t){var o=1+t,R=o-1;return R===0?t:t*Math.log(o)/R}function asinhy(t){var o=Math.abs(t);return o=log1py(o*(1+o/(hypot$1(1,o)+1))),t<0?-o:o}function gatg(t,o){for(var R=2*Math.cos(2*o),c=t.length-1,h=t[c],d=0,H;--c>=0;)H=-d+R*h+t[c],d=h,h=H;return o+H*Math.sin(2*o)}function clens(t,o){for(var R=2*Math.cos(o),c=t.length-1,h=t[c],d=0,H;--c>=0;)H=-d+R*h+t[c],d=h,h=H;return Math.sin(o)*H}function cosh$1(t){var o=Math.exp(t);return o=(o+1/o)/2,o}function clens_cmplx(t,o,R){for(var c=Math.sin(o),h=Math.cos(o),d=sinh$1(R),H=cosh$1(R),n=2*h*H,D=-2*c*d,j=t.length-1,z=t[j],w=0,q=0,re=0,ne,ie;--j>=0;)ne=q,ie=w,q=z,w=re,z=-ne+n*q-D*w+t[j],re=-ie+D*q+n*w;return n=c*H,D=h*d,[n*z-D*re,n*re+D*z]}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 t=this.es/(1+Math.sqrt(1-this.es)),o=t/(2-t),R=o;this.cgb[0]=o*(2+o*(-2/3+o*(-2+o*(116/45+o*(26/45+o*(-2854/675)))))),this.cbg[0]=o*(-2+o*(2/3+o*(4/3+o*(-82/45+o*(32/45+o*(4642/4725)))))),R=R*o,this.cgb[1]=R*(7/3+o*(-8/5+o*(-227/45+o*(2704/315+o*(2323/945))))),this.cbg[1]=R*(5/3+o*(-16/15+o*(-13/9+o*(904/315+o*(-1522/945))))),R=R*o,this.cgb[2]=R*(56/15+o*(-136/35+o*(-1262/105+o*(73814/2835)))),this.cbg[2]=R*(-26/15+o*(34/21+o*(8/5+o*(-12686/2835)))),R=R*o,this.cgb[3]=R*(4279/630+o*(-332/35+o*(-399572/14175))),this.cbg[3]=R*(1237/630+o*(-12/5+o*(-24832/14175))),R=R*o,this.cgb[4]=R*(4174/315+o*(-144838/6237)),this.cbg[4]=R*(-734/315+o*(109598/31185)),R=R*o,this.cgb[5]=R*(601676/22275),this.cbg[5]=R*(444337/155925),R=Math.pow(o,2),this.Qn=this.k0/(1+o)*(1+R*(1/4+R*(1/64+R/256))),this.utg[0]=o*(-.5+o*(2/3+o*(-37/96+o*(1/360+o*(81/512+o*(-96199/604800)))))),this.gtu[0]=o*(.5+o*(-2/3+o*(5/16+o*(41/180+o*(-127/288+o*(7891/37800)))))),this.utg[1]=R*(-1/48+o*(-1/15+o*(437/1440+o*(-46/105+o*(1118711/3870720))))),this.gtu[1]=R*(13/48+o*(-3/5+o*(557/1440+o*(281/630+o*(-1983433/1935360))))),R=R*o,this.utg[2]=R*(-17/480+o*(37/840+o*(209/4480+o*(-5569/90720)))),this.gtu[2]=R*(61/240+o*(-103/140+o*(15061/26880+o*(167603/181440)))),R=R*o,this.utg[3]=R*(-4397/161280+o*(11/504+o*(830251/7257600))),this.gtu[3]=R*(49561/161280+o*(-179/168+o*(6601661/7257600))),R=R*o,this.utg[4]=R*(-4583/161280+o*(108847/3991680)),this.gtu[4]=R*(34729/80640+o*(-3418889/1995840)),R=R*o,this.utg[5]=R*(-20648693/638668800),this.gtu[5]=R*(212378941/319334400);var c=gatg(this.cbg,this.lat0);this.Zb=-this.Qn*(c+clens(this.gtu,2*c))}function forward$s(t){var o=adjust_lon(t.x-this.long0),R=t.y;R=gatg(this.cbg,R);var c=Math.sin(R),h=Math.cos(R),d=Math.sin(o),H=Math.cos(o);R=Math.atan2(c,H*h),o=Math.atan2(d*h,hypot$1(c,h*H)),o=asinhy(Math.tan(o));var n=clens_cmplx(this.gtu,2*R,2*o);R=R+n[0],o=o+n[1];var D,j;return Math.abs(o)<=2.623395162778?(D=this.a*(this.Qn*o)+this.x0,j=this.a*(this.Qn*R+this.Zb)+this.y0):(D=1/0,j=1/0),t.x=D,t.y=j,t}function inverse$s(t){var o=(t.x-this.x0)*(1/this.a),R=(t.y-this.y0)*(1/this.a);R=(R-this.Zb)/this.Qn,o=o/this.Qn;var c,h;if(Math.abs(o)<=2.623395162778){var d=clens_cmplx(this.utg,2*R,2*o);R=R+d[0],o=o+d[1],o=Math.atan(sinh$1(o));var H=Math.sin(R),n=Math.cos(R),D=Math.sin(o),j=Math.cos(o);R=Math.atan2(H*j,hypot$1(D,j*n)),o=Math.atan2(D,j*n),c=adjust_lon(o+this.long0),h=gatg(this.cgb,R)}else c=1/0,h=1/0;return t.x=c,t.y=h,t}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(t,o){if(t===void 0){if(t=Math.floor((adjust_lon(o)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var dependsOn="etmerc";function init$t(){var t=adjust_zone(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-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(t,o){return Math.pow((1-t)/(1+t),o)}var MAX_ITER$2=20;function init$s(){var t=Math.sin(this.lat0),o=Math.cos(this.lat0);o*=o,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*o*o/(1-this.es)),this.phic0=Math.asin(t/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*t,this.ratexp))}function forward$r(t){var o=t.x,R=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*R+FORTPI),this.C)*srat(this.e*Math.sin(R),this.ratexp))-HALF_PI,t.x=this.C*o,t}function inverse$r(t){for(var o=1e-14,R=t.x/this.C,c=t.y,h=Math.pow(Math.tan(.5*c+FORTPI)/this.K,1/this.C),d=MAX_ITER$2;d>0&&(c=2*Math.atan(h*srat(this.e*Math.sin(t.y),-.5*this.e))-HALF_PI,!(Math.abs(c-t.y)<o));--d)t.y=c;return d?(t.x=R,t.y=c,t):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(t){var o,R,c,h;return t.x=adjust_lon(t.x-this.long0),gauss.forward.apply(this,[t]),o=Math.sin(t.y),R=Math.cos(t.y),c=Math.cos(t.x),h=this.k0*this.R2/(1+this.sinc0*o+this.cosc0*R*c),t.x=h*R*Math.sin(t.x),t.y=h*(this.cosc0*o-this.sinc0*R*c),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function inverse$q(t){var o,R,c,h,d;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,d=hypot$1(t.x,t.y)){var H=2*Math.atan2(d,this.R2);o=Math.sin(H),R=Math.cos(H),h=Math.asin(R*this.sinc0+t.y*o*this.cosc0/d),c=Math.atan2(t.x*o,d*this.cosc0*R-t.y*this.sinc0*o)}else h=this.phic0,c=0;return t.x=c,t.y=h,gauss.inverse.apply(this,[t]),t.x=adjust_lon(t.x+this.long0),t}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_(t,o,R){return o*=R,Math.tan(.5*(HALF_PI+t))*Math.pow((1-o)/(1+o),.5*R)}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(this.ssfn_(this.lat0,this.sinlat0,this.e))-HALF_PI,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function forward$p(t){var o=t.x,R=t.y,c=Math.sin(R),h=Math.cos(R),d,H,n,D,j,z,w=adjust_lon(o-this.long0);return Math.abs(Math.abs(o-this.long0)-Math.PI)<=EPSLN&&Math.abs(R+this.lat0)<=EPSLN?(t.x=NaN,t.y=NaN,t):this.sphere?(d=2*this.k0/(1+this.sinlat0*c+this.coslat0*h*Math.cos(w)),t.x=this.a*d*h*Math.sin(w)+this.x0,t.y=this.a*d*(this.coslat0*c-this.sinlat0*h*Math.cos(w))+this.y0,t):(H=2*Math.atan(this.ssfn_(R,c,this.e))-HALF_PI,D=Math.cos(H),n=Math.sin(H),Math.abs(this.coslat0)<=EPSLN?(j=tsfnz(this.e,R*this.con,this.con*c),z=2*this.a*this.k0*j/this.cons,t.x=this.x0+z*Math.sin(o-this.long0),t.y=this.y0-this.con*z*Math.cos(o-this.long0),t):(Math.abs(this.sinlat0)<EPSLN?(d=2*this.a*this.k0/(1+D*Math.cos(w)),t.y=d*n):(d=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*n+this.cosX0*D*Math.cos(w))),t.y=d*(this.cosX0*n-this.sinX0*D*Math.cos(w))+this.y0),t.x=d*D*Math.sin(w)+this.x0,t))}function inverse$p(t){t.x-=this.x0,t.y-=this.y0;var o,R,c,h,d,H=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var n=2*Math.atan(H/(2*this.a*this.k0));return o=this.long0,R=this.lat0,H<=EPSLN?(t.x=o,t.y=R,t):(R=Math.asin(Math.cos(n)*this.sinlat0+t.y*Math.sin(n)*this.coslat0/H),Math.abs(this.coslat0)<EPSLN?this.lat0>0?o=adjust_lon(this.long0+Math.atan2(t.x,-1*t.y)):o=adjust_lon(this.long0+Math.atan2(t.x,t.y)):o=adjust_lon(this.long0+Math.atan2(t.x*Math.sin(n),H*this.coslat0*Math.cos(n)-t.y*this.sinlat0*Math.sin(n))),t.x=o,t.y=R,t)}else if(Math.abs(this.coslat0)<=EPSLN){if(H<=EPSLN)return R=this.lat0,o=this.long0,t.x=o,t.y=R,t;t.x*=this.con,t.y*=this.con,c=H*this.cons/(2*this.a*this.k0),R=this.con*phi2z(this.e,c),o=this.con*adjust_lon(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else h=2*Math.atan(H*this.cosX0/(2*this.a*this.k0*this.ms1)),o=this.long0,H<=EPSLN?d=this.X0:(d=Math.asin(Math.cos(h)*this.sinX0+t.y*Math.sin(h)*this.cosX0/H),o=adjust_lon(this.long0+Math.atan2(t.x*Math.sin(h),H*this.cosX0*Math.cos(h)-t.y*this.sinX0*Math.sin(h)))),R=-1*phi2z(this.e,Math.tan(.5*(HALF_PI+d)));return t.x=o,t.y=R,t}var names$q=["stere","Stereographic_South_Pole","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 t=this.lat0;this.lambda0=this.long0;var o=Math.sin(t),R=this.a,c=this.rf,h=1/c,d=2*h-Math.pow(h,2),H=this.e=Math.sqrt(d);this.R=this.k0*R*Math.sqrt(1-d)/(1-d*Math.pow(o,2)),this.alpha=Math.sqrt(1+d/(1-d)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(o/this.alpha);var n=Math.log(Math.tan(Math.PI/4+this.b0/2)),D=Math.log(Math.tan(Math.PI/4+t/2)),j=Math.log((1+H*o)/(1-H*o));this.K=n-this.alpha*D+this.alpha*H/2*j}function forward$o(t){var o=Math.log(Math.tan(Math.PI/4-t.y/2)),R=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),c=-this.alpha*(o+R)+this.K,h=2*(Math.atan(Math.exp(c))-Math.PI/4),d=this.alpha*(t.x-this.lambda0),H=Math.atan(Math.sin(d)/(Math.sin(this.b0)*Math.tan(h)+Math.cos(this.b0)*Math.cos(d))),n=Math.asin(Math.cos(this.b0)*Math.sin(h)-Math.sin(this.b0)*Math.cos(h)*Math.cos(d));return t.y=this.R/2*Math.log((1+Math.sin(n))/(1-Math.sin(n)))+this.y0,t.x=this.R*H+this.x0,t}function inverse$o(t){for(var o=t.x-this.x0,R=t.y-this.y0,c=o/this.R,h=2*(Math.atan(Math.exp(R/this.R))-Math.PI/4),d=Math.asin(Math.cos(this.b0)*Math.sin(h)+Math.sin(this.b0)*Math.cos(h)*Math.cos(c)),H=Math.atan(Math.sin(c)/(Math.cos(this.b0)*Math.cos(c)-Math.sin(this.b0)*Math.tan(h))),n=this.lambda0+H/this.alpha,D=0,j=d,z=-1e3,w=0;Math.abs(j-z)>1e-7;){if(++w>20)return;D=1/this.alpha*(Math.log(Math.tan(Math.PI/4+d/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(j))/2)),z=j,j=2*Math.atan(Math.exp(D))-Math.PI/2}return t.x=n,t.y=j,t}var names$p=["somerc"];const somerc={init:init$p,forward:forward$o,inverse:inverse$o,names:names$p};var TOL=1e-7;function isTypeA(t){var o=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],R=typeof t.PROJECTION=="object"?Object.keys(t.PROJECTION)[0]:t.PROJECTION;return"no_uoff"in t||"no_off"in t||o.indexOf(R)!==-1}function init$o(){var t,o,R,c,h,d,H,n,D,j,z=0,w,q=0,re=0,ne=0,ie=0,Re=0,Te=0;this.no_off=isTypeA(this),this.no_rot="no_rot"in this;var $=!1;"alpha"in this&&($=!0);var L=!1;if("rectified_grid_angle"in this&&(L=!0),$&&(Te=this.alpha),L&&(z=this.rectified_grid_angle*D2R$1),$||L)q=this.longc;else if(re=this.long1,ie=this.lat1,ne=this.long2,Re=this.lat2,Math.abs(ie-Re)<=TOL||(t=Math.abs(ie))<=TOL||Math.abs(t-HALF_PI)<=TOL||Math.abs(Math.abs(this.lat0)-HALF_PI)<=TOL||Math.abs(Math.abs(Re)-HALF_PI)<=TOL)throw new Error;var ae=1-this.es;o=Math.sqrt(ae),Math.abs(this.lat0)>EPSLN?(n=Math.sin(this.lat0),R=Math.cos(this.lat0),t=1-this.es*n*n,this.B=R*R,this.B=Math.sqrt(1+this.es*this.B*this.B/ae),this.A=this.B*this.k0*o/t,c=this.B*o/(R*Math.sqrt(t)),h=c*c-1,h<=0?h=0:(h=Math.sqrt(h),this.lat0<0&&(h=-h)),this.E=h+=c,this.E*=Math.pow(tsfnz(this.e,this.lat0,n),this.B)):(this.B=1/o,this.A=this.k0,this.E=c=h=1),$||L?($?(w=Math.asin(Math.sin(Te)/c),L||(z=Te)):(w=z,Te=Math.asin(c*Math.sin(w))),this.lam0=q-Math.asin(.5*(h-1/h)*Math.tan(w))/this.B):(d=Math.pow(tsfnz(this.e,ie,Math.sin(ie)),this.B),H=Math.pow(tsfnz(this.e,Re,Math.sin(Re)),this.B),h=this.E/d,D=(H-d)/(H+d),j=this.E*this.E,j=(j-H*d)/(j+H*d),t=re-ne,t<-Math.pi?ne-=TWO_PI:t>Math.pi&&(ne+=TWO_PI),this.lam0=adjust_lon(.5*(re+ne)-Math.atan(j*Math.tan(.5*this.B*(re-ne))/D)/this.B),w=Math.atan(2*Math.sin(this.B*adjust_lon(re-this.lam0))/(h-1/h)),z=Te=Math.asin(c*Math.sin(w))),this.singam=Math.sin(w),this.cosgam=Math.cos(w),this.sinrot=Math.sin(z),this.cosrot=Math.cos(z),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(c*c-1)/Math.cos(Te))),this.lat0<0&&(this.u_0=-this.u_0)),h=.5*w,this.v_pole_n=this.ArB*Math.log(Math.tan(FORTPI-h)),this.v_pole_s=this.ArB*Math.log(Math.tan(FORTPI+h))}function forward$n(t){var o={},R,c,h,d,H,n,D,j;if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-HALF_PI)>EPSLN){if(H=this.E/Math.pow(tsfnz(this.e,t.y,Math.sin(t.y)),this.B),n=1/H,R=.5*(H-n),c=.5*(H+n),d=Math.sin(this.B*t.x),h=(R*this.singam-d*this.cosgam)/c,Math.abs(Math.abs(h)-1)<EPSLN)throw new Error;j=.5*this.ArB*Math.log((1-h)/(1+h)),n=Math.cos(this.B*t.x),Math.abs(n)<TOL?D=this.A*t.x:D=this.ArB*Math.atan2(R*this.cosgam+d*this.singam,n)}else j=t.y>0?this.v_pole_n:this.v_pole_s,D=this.ArB*t.y;return this.no_rot?(o.x=D,o.y=j):(D-=this.u_0,o.x=j*this.cosrot+D*this.sinrot,o.y=D*this.cosrot-j*this.sinrot),o.x=this.a*o.x+this.x0,o.y=this.a*o.y+this.y0,o}function inverse$n(t){var o,R,c,h,d,H,n,D={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(R=t.y,o=t.x):(R=t.x*this.cosrot-t.y*this.sinrot,o=t.y*this.cosrot+t.x*this.sinrot+this.u_0),c=Math.exp(-this.BrA*R),h=.5*(c-1/c),d=.5*(c+1/c),H=Math.sin(this.BrA*o),n=(H*this.cosgam+h*this.singam)/d,Math.abs(Math.abs(n)-1)<EPSLN)D.x=0,D.y=n<0?-HALF_PI:HALF_PI;else{if(D.y=this.E/Math.sqrt((1+n)/(1-n)),D.y=phi2z(this.e,Math.pow(D.y,1/this.B)),D.y===1/0)throw new Error;D.x=-this.rB*Math.atan2(h*this.cosgam-H*this.singam,Math.cos(this.BrA*o))}return D.x+=this.lam0,D}var names$o=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","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 t=this.b/this.a;this.e=Math.sqrt(1-t*t);var o=Math.sin(this.lat1),R=Math.cos(this.lat1),c=msfnz(this.e,o,R),h=tsfnz(this.e,this.lat1,o),d=Math.sin(this.lat2),H=Math.cos(this.lat2),n=msfnz(this.e,d,H),D=tsfnz(this.e,this.lat2,d),j=tsfnz(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>EPSLN?this.ns=Math.log(c/n)/Math.log(h/D):this.ns=o,isNaN(this.ns)&&(this.ns=o),this.f0=c/(this.ns*Math.pow(h,this.ns)),this.rh=this.a*this.f0*Math.pow(j,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function forward$m(t){var o=t.x,R=t.y;Math.abs(2*Math.abs(R)-Math.PI)<=EPSLN&&(R=sign$1(R)*(HALF_PI-2*EPSLN));var c=Math.abs(Math.abs(R)-HALF_PI),h,d;if(c>EPSLN)h=tsfnz(this.e,R,Math.sin(R)),d=this.a*this.f0*Math.pow(h,this.ns);else{if(c=R*this.ns,c<=0)return null;d=0}var H=this.ns*adjust_lon(o-this.long0);return t.x=this.k0*(d*Math.sin(H))+this.x0,t.y=this.k0*(this.rh-d*Math.cos(H))+this.y0,t}function inverse$m(t){var o,R,c,h,d,H=(t.x-this.x0)/this.k0,n=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(o=Math.sqrt(H*H+n*n),R=1):(o=-Math.sqrt(H*H+n*n),R=-1);var D=0;if(o!==0&&(D=Math.atan2(R*H,R*n)),o!==0||this.ns>0){if(R=1/this.ns,c=Math.pow(o/(this.a*this.f0),R),h=phi2z(this.e,c),h===-9999)return null}else h=-HALF_PI;return d=adjust_lon(D/this.ns+this.long0),t.x=d,t.y=h,t}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(t){var o,R,c,h,d,H,n,D=t.x,j=t.y,z=adjust_lon(D-this.long0);return o=Math.pow((1+this.e*Math.sin(j))/(1-this.e*Math.sin(j)),this.alfa*this.e/2),R=2*(Math.atan(this.k*Math.pow(Math.tan(j/2+this.s45),this.alfa)/o)-this.s45),c=-z*this.alfa,h=Math.asin(Math.cos(this.ad)*Math.sin(R)+Math.sin(this.ad)*Math.cos(R)*Math.cos(c)),d=Math.asin(Math.cos(R)*Math.sin(c)/Math.cos(h)),H=this.n*d,n=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(h/2+this.s45),this.n),t.y=n*Math.cos(H)/1,t.x=n*Math.sin(H)/1,this.czech||(t.y*=-1,t.x*=-1),t}function inverse$l(t){var o,R,c,h,d,H,n,D,j=t.x;t.x=t.y,t.y=j,this.czech||(t.y*=-1,t.x*=-1),H=Math.sqrt(t.x*t.x+t.y*t.y),d=Math.atan2(t.y,t.x),h=d/Math.sin(this.s0),c=2*(Math.atan(Math.pow(this.ro0/H,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),o=Math.asin(Math.cos(this.ad)*Math.sin(c)-Math.sin(this.ad)*Math.cos(c)*Math.cos(h)),R=Math.asin(Math.cos(c)*Math.sin(h)/Math.cos(o)),t.x=this.long0-R/this.alfa,n=o,D=0;var z=0;do t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(o/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(n))/(1-this.e*Math.sin(n)),this.e/2))-this.s45),Math.abs(n-t.y)<1e-10&&(D=1),n=t.y,z+=1;while(D===0&&z<15);return z>=15?null:t}var names$m=["Krovak","krovak"];const krovak={init:init$m,forward:forward$l,inverse:inverse$l,names:names$m};function mlfn(t,o,R,c,h){return t*h-o*Math.sin(2*h)+R*Math.sin(4*h)-c*Math.sin(6*h)}function e0fn(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function e1fn(t){return .375*t*(1+.25*t*(1+.46875*t))}function e2fn(t){return .05859375*t*t*(1+.75*t)}function e3fn(t){return t*t*t*(35/3072)}function gN(t,o,R){var c=o*R;return t/Math.sqrt(1-c*c)}function adjust_lat(t){return Math.abs(t)<HALF_PI?t:t-sign$1(t)*Math.PI}function imlfn(t,o,R,c,h){var d,H;d=t/o;for(var n=0;n<15;n++)if(H=(t-(o*d-R*Math.sin(2*d)+c*Math.sin(4*d)-h*Math.sin(6*d)))/(o-2*R*Math.cos(2*d)+4*c*Math.cos(4*d)-6*h*Math.cos(6*d)),d+=H,Math.abs(H)<=1e-10)return d;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(t){var o,R,c=t.x,h=t.y;if(c=adjust_lon(c-this.long0),this.sphere)o=this.a*Math.asin(Math.cos(h)*Math.sin(c)),R=this.a*(Math.atan2(Math.tan(h),Math.cos(c))-this.lat0);else{var d=Math.sin(h),H=Math.cos(h),n=gN(this.a,this.e,d),D=Math.tan(h)*Math.tan(h),j=c*Math.cos(h),z=j*j,w=this.es*H*H/(1-this.es),q=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,h);o=n*j*(1-z*D*(1/6-(8-D+8*w)*z/120)),R=q-this.ml0+n*d/H*z*(.5+(5-D+6*w)*z/24)}return t.x=o+this.x0,t.y=R+this.y0,t}function inverse$k(t){t.x-=this.x0,t.y-=this.y0;var o=t.x/this.a,R=t.y/this.a,c,h;if(this.sphere){var d=R+this.lat0;c=Math.asin(Math.sin(d)*Math.cos(o)),h=Math.atan2(Math.tan(o),Math.cos(d))}else{var H=this.ml0/this.a+R,n=imlfn(H,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(n)-HALF_PI)<=EPSLN)return t.x=this.long0,t.y=HALF_PI,R<0&&(t.y*=-1),t;var D=gN(this.a,this.e,Math.sin(n)),j=D*D*D/this.a/this.a*(1-this.es),z=Math.pow(Math.tan(n),2),w=o*this.a/D,q=w*w;c=n-D*Math.tan(n)/j*w*w*(.5-(1+3*z)*w*w/24),h=w*(1-q*(z/3+(1+3*z)*z*q/15))/Math.cos(n)}return t.x=adjust_lon(h+this.long0),t.y=adjust_lat(c),t}var names$l=["Cassini","Cassini_Soldner","cass"];const cass={init:init$l,forward:forward$k,inverse:inverse$k,names:names$l};function qsfnz(t,o){var R;return t>1e-7?(R=t*o,(1-t*t)*(o/(1-R*R)-.5/t*Math.log((1-R)/(1+R)))):2*o}var S_POLE=1,N_POLE=2,EQUIT=3,OBLIQ=4;function init$k(){var t=Math.abs(this.lat0);if(Math.abs(t-HALF_PI)<EPSLN?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<EPSLN?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var o;switch(this.qp=qsfnz(this.e,1),this.mmf=.5/(1-this.es),this.apa=authset(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),o=Math.sin(this.lat0),this.sinb1=qsfnz(this.e,o)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*o*o)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function forward$j(t){var o,R,c,h,d,H,n,D,j,z,w=t.x,q=t.y;if(w=adjust_lon(w-this.long0),this.sphere){if(d=Math.sin(q),z=Math.cos(q),c=Math.cos(w),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(R=this.mode===this.EQUIT?1+z*c:1+this.sinph0*d+this.cosph0*z*c,R<=EPSLN)return null;R=Math.sqrt(2/R),o=R*z*Math.sin(w),R*=this.mode===this.EQUIT?d:this.cosph0*d-this.sinph0*z*c}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(c=-c),Math.abs(q+this.lat0)<EPSLN)return null;R=FORTPI-q*.5,R=2*(this.mode===this.S_POLE?Math.cos(R):Math.sin(R)),o=R*Math.sin(w),R*=c}}else{switch(n=0,D=0,j=0,c=Math.cos(w),h=Math.sin(w),d=Math.sin(q),H=qsfnz(this.e,d),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(n=H/this.qp,D=Math.sqrt(1-n*n)),this.mode){case this.OBLIQ:j=1+this.sinb1*n+this.cosb1*D*c;break;case this.EQUIT:j=1+D*c;break;case this.N_POLE:j=HALF_PI+q,H=this.qp-H;break;case this.S_POLE:j=q-HALF_PI,H=this.qp+H;break}if(Math.abs(j)<EPSLN)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:j=Math.sqrt(2/j),this.mode===this.OBLIQ?R=this.ymf*j*(this.cosb1*n-this.sinb1*D*c):R=(j=Math.sqrt(2/(1+D*c)))*n*this.ymf,o=this.xmf*j*D*h;break;case this.N_POLE:case this.S_POLE:H>=0?(o=(j=Math.sqrt(H))*h,R=c*(this.mode===this.S_POLE?j:-j)):o=R=0;break}}return t.x=this.a*o+this.x0,t.y=this.a*R+this.y0,t}function inverse$j(t){t.x-=this.x0,t.y-=this.y0;var o=t.x/this.a,R=t.y/this.a,c,h,d,H,n,D,j;if(this.sphere){var z=0,w,q=0;if(w=Math.sqrt(o*o+R*R),h=w*.5,h>1)return null;switch(h=2*Math.asin(h),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(q=Math.sin(h),z=Math.cos(h)),this.mode){case this.EQUIT:h=Math.abs(w)<=EPSLN?0:Math.asin(R*q/w),o*=q,R=z*w;break;case this.OBLIQ:h=Math.abs(w)<=EPSLN?this.lat0:Math.asin(z*this.sinph0+R*q*this.cosph0/w),o*=q*this.cosph0,R=(z-Math.sin(h)*this.sinph0)*w;break;case this.N_POLE:R=-R,h=HALF_PI-h;break;case this.S_POLE:h-=HALF_PI;break}c=R===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(o,R)}else{if(j=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(o/=this.dd,R*=this.dd,D=Math.sqrt(o*o+R*R),D<EPSLN)return t.x=this.long0,t.y=this.lat0,t;H=2*Math.asin(.5*D/this.rq),d=Math.cos(H),o*=H=Math.sin(H),this.mode===this.OBLIQ?(j=d*this.sinb1+R*H*this.cosb1/D,n=this.qp*j,R=D*this.cosb1*d-R*this.sinb1*H):(j=R*H/D,n=this.qp*j,R=D*d)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(R=-R),n=o*o+R*R,!n)return t.x=this.long0,t.y=this.lat0,t;j=1-n/this.qp,this.mode===this.S_POLE&&(j=-j)}c=Math.atan2(o,R),h=authlat(Math.asin(j),this.apa)}return t.x=adjust_lon(this.long0+c),t.y=h,t}var P00=.3333333333333333,P01=.17222222222222222,P02=.10257936507936508,P10=.06388888888888888,P11=.0664021164021164,P20=.016415012942191543;function authset(t){var o,R=[];return R[0]=t*P00,o=t*t,R[0]+=o*P01,R[1]=o*P10,o*=t,R[0]+=o*P02,R[1]+=o*P11,R[2]=o*P20,R}function authlat(t,o){var R=t+t;return t+o[0]*Math.sin(R)+o[1]*Math.sin(R+R)+o[2]*Math.sin(R+R+R)}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(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}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(t){var o=t.x,R=t.y;this.sin_phi=Math.sin(R),this.cos_phi=Math.cos(R);var c=qsfnz(this.e3,this.sin_phi),h=this.a*Math.sqrt(this.c-this.ns0*c)/this.ns0,d=this.ns0*adjust_lon(o-this.long0),H=h*Math.sin(d)+this.x0,n=this.rh-h*Math.cos(d)+this.y0;return t.x=H,t.y=n,t}function inverse$i(t){var o,R,c,h,d,H;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(o=Math.sqrt(t.x*t.x+t.y*t.y),c=1):(o=-Math.sqrt(t.x*t.x+t.y*t.y),c=-1),h=0,o!==0&&(h=Math.atan2(c*t.x,c*t.y)),c=o*this.ns0/this.a,this.sphere?H=Math.asin((this.c-c*c)/(2*this.ns0)):(R=(this.c-c*c)/this.ns0,H=this.phi1z(this.e3,R)),d=adjust_lon(h/this.ns0+this.long0),t.x=d,t.y=H,t}function phi1z(t,o){var R,c,h,d,H,n=asinz(.5*o);if(t<EPSLN)return n;for(var D=t*t,j=1;j<=25;j++)if(R=Math.sin(n),c=Math.cos(n),h=t*R,d=1-h*h,H=.5*d*d/c*(o/(1-D)-R/d+.5/t*Math.log((1-h)/(1+h))),n=n+H,Math.abs(H)<=1e-7)return n;return null}var names$j=["Albers_Conic_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(t){var o,R,c,h,d,H,n,D,j=t.x,z=t.y;return c=adjust_lon(j-this.long0),o=Math.sin(z),R=Math.cos(z),h=Math.cos(c),H=this.sin_p14*o+this.cos_p14*R*h,d=1,H>0||Math.abs(H)<=EPSLN?(n=this.x0+this.a*d*R*Math.sin(c)/H,D=this.y0+this.a*d*(this.cos_p14*o-this.sin_p14*R*h)/H):(n=this.x0+this.infinity_dist*R*Math.sin(c),D=this.y0+this.infinity_dist*(this.cos_p14*o-this.sin_p14*R*h)),t.x=n,t.y=D,t}function inverse$h(t){var o,R,c,h,d,H;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(o=Math.sqrt(t.x*t.x+t.y*t.y))?(h=Math.atan2(o,this.rc),R=Math.sin(h),c=Math.cos(h),H=asinz(c*this.sin_p14+t.y*R*this.cos_p14/o),d=Math.atan2(t.x*R,o*this.cos_p14*c-t.y*this.sin_p14*R),d=adjust_lon(this.long0+d)):(H=this.phic0,d=0),t.x=d,t.y=H,t}var names$i=["gnom"];const gnom={init:init$i,forward:forward$h,inverse:inverse$h,names:names$i};function iqsfnz(t,o){var R=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(o)-R)<1e-6)return o<0?-1*HALF_PI:HALF_PI;for(var c=Math.asin(.5*o),h,d,H,n,D=0;D<30;D++)if(d=Math.sin(c),H=Math.cos(c),n=t*d,h=Math.pow(1-n*n,2)/(2*H)*(o/(1-t*t)-d/(1-n*n)+.5/t*Math.log((1-n)/(1+n))),c+=h,Math.abs(h)<=1e-10)return c;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(t){var o=t.x,R=t.y,c,h,d=adjust_lon(o-this.long0);if(this.sphere)c=this.x0+this.a*d*Math.cos(this.lat_ts),h=this.y0+this.a*Math.sin(R)/Math.cos(this.lat_ts);else{var H=qsfnz(this.e,Math.sin(R));c=this.x0+this.a*this.k0*d,h=this.y0+this.a*H*.5/this.k0}return t.x=c,t.y=h,t}function inverse$g(t){t.x-=this.x0,t.y-=this.y0;var o,R;return this.sphere?(o=adjust_lon(this.long0+t.x/this.a/Math.cos(this.lat_ts)),R=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(R=iqsfnz(this.e,2*t.y*this.k0/this.a),o=adjust_lon(this.long0+t.x/(this.a*this.k0))),t.x=o,t.y=R,t}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(t){var o=t.x,R=t.y,c=adjust_lon(o-this.long0),h=adjust_lat(R-this.lat0);return t.x=this.x0+this.a*c*this.rc,t.y=this.y0+this.a*h,t}function inverse$f(t){var o=t.x,R=t.y;return t.x=adjust_lon(this.long0+(o-this.x0)/(this.a*this.rc)),t.y=adjust_lat(this.lat0+(R-this.y0)/this.a),t}var names$g=["Equirectangular","Equidistant_Cylindrical","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(t){var o=t.x,R=t.y,c,h,d,H=adjust_lon(o-this.long0);if(d=H*Math.sin(R),this.sphere)Math.abs(R)<=EPSLN?(c=this.a*H,h=-1*this.a*this.lat0):(c=this.a*Math.sin(d)/Math.tan(R),h=this.a*(adjust_lat(R-this.lat0)+(1-Math.cos(d))/Math.tan(R)));else if(Math.abs(R)<=EPSLN)c=this.a*H,h=-1*this.ml0;else{var n=gN(this.a,this.e,Math.sin(R))/Math.tan(R);c=n*Math.sin(d),h=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,R)-this.ml0+n*(1-Math.cos(d))}return t.x=c+this.x0,t.y=h+this.y0,t}function inverse$e(t){var o,R,c,h,d,H,n,D,j;if(c=t.x-this.x0,h=t.y-this.y0,this.sphere)if(Math.abs(h+this.a*this.lat0)<=EPSLN)o=adjust_lon(c/this.a+this.long0),R=0;else{H=this.lat0+h/this.a,n=c*c/this.a/this.a+H*H,D=H;var z;for(d=MAX_ITER$1;d;--d)if(z=Math.tan(D),j=-1*(H*(D*z+1)-D-.5*(D*D+n)*z)/((D-H)/z-1),D+=j,Math.abs(j)<=EPSLN){R=D;break}o=adjust_lon(this.long0+Math.asin(c*Math.tan(D)/this.a)/Math.sin(R))}else if(Math.abs(h+this.ml0)<=EPSLN)R=0,o=adjust_lon(this.long0+c/this.a);else{H=(this.ml0+h)/this.a,n=c*c/this.a/this.a+H*H,D=H;var w,q,re,ne,ie;for(d=MAX_ITER$1;d;--d)if(ie=this.e*Math.sin(D),w=Math.sqrt(1-ie*ie)*Math.tan(D),q=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,D),re=this.e0-2*this.e1*Math.cos(2*D)+4*this.e2*Math.cos(4*D)-6*this.e3*Math.cos(6*D),ne=q/this.a,j=(H*(w*ne+1)-ne-.5*w*(ne*ne+n))/(this.es*Math.sin(2*D)*(ne*ne+n-2*H*ne)/(4*w)+(H-ne)*(w*re-2/Math.sin(2*D))-re),D-=j,Math.abs(j)<=EPSLN){R=D;break}w=Math.sqrt(1-this.es*Math.pow(Math.sin(R),2))*Math.tan(R),o=adjust_lon(this.long0+Math.asin(c*w/this.a)/Math.sin(R))}return t.x=o,t.y=R,t}var names$f=["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(t){var o,R=t.x,c=t.y,h=c-this.lat0,d=R-this.long0,H=h/SEC_TO_RAD*1e-5,n=d,D=1,j=0;for(o=1;o<=10;o++)D=D*H,j=j+this.A[o]*D;var z=j,w=n,q=1,re=0,ne,ie,Re=0,Te=0;for(o=1;o<=6;o++)ne=q*z-re*w,ie=re*z+q*w,q=ne,re=ie,Re=Re+this.B_re[o]*q-this.B_im[o]*re,Te=Te+this.B_im[o]*q+this.B_re[o]*re;return t.x=Te*this.a+this.x0,t.y=Re*this.a+this.y0,t}function inverse$d(t){var o,R=t.x,c=t.y,h=R-this.x0,d=c-this.y0,H=d/this.a,n=h/this.a,D=1,j=0,z,w,q=0,re=0;for(o=1;o<=6;o++)z=D*H-j*n,w=j*H+D*n,D=z,j=w,q=q+this.C_re[o]*D-this.C_im[o]*j,re=re+this.C_im[o]*D+this.C_re[o]*j;for(var ne=0;ne<this.iterations;ne++){var ie=q,Re=re,Te,$,L=H,ae=n;for(o=2;o<=6;o++)Te=ie*q-Re*re,$=Re*q+ie*re,ie=Te,Re=$,L=L+(o-1)*(this.B_re[o]*ie-this.B_im[o]*Re),ae=ae+(o-1)*(this.B_im[o]*ie+this.B_re[o]*Re);ie=1,Re=0;var W=this.B_re[1],Pe=this.B_im[1];for(o=2;o<=6;o++)Te=ie*q-Re*re,$=Re*q+ie*re,ie=Te,Re=$,W=W+o*(this.B_re[o]*ie-this.B_im[o]*Re),Pe=Pe+o*(this.B_im[o]*ie+this.B_re[o]*Re);var Ie=W*W+Pe*Pe;q=(L*W+ae*Pe)/Ie,re=(ae*W-L*Pe)/Ie}var Ae=q,de=re,Ye=1,Ue=0;for(o=1;o<=9;o++)Ye=Ye*Ae,Ue=Ue+this.D[o]*Ye;var ye=this.lat0+Ue*SEC_TO_RAD*1e5,rt=this.long0+de;return t.x=rt,t.y=ye,t}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(t){var o=t.x,R=t.y,c=adjust_lon(o-this.long0),h=this.x0+this.a*c,d=this.y0+this.a*Math.log(Math.tan(Math.PI/4+R/2.5))*1.25;return t.x=h,t.y=d,t}function inverse$c(t){t.x-=this.x0,t.y-=this.y0;var o=adjust_lon(this.long0+t.x/this.a),R=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=o,t.y=R,t}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(t){var o,R,c=t.x,h=t.y;if(c=adjust_lon(c-this.long0),this.sphere){if(!this.m)h=this.n!==1?Math.asin(this.n*Math.sin(h)):h;else for(var d=this.n*Math.sin(h),H=MAX_ITER;H;--H){var n=(this.m*h+Math.sin(h)-d)/(this.m+Math.cos(h));if(h-=n,Math.abs(n)<EPSLN)break}o=this.a*this.C_x*c*(this.m+Math.cos(h)),R=this.a*this.C_y*h}else{var D=Math.sin(h),j=Math.cos(h);R=this.a*pj_mlfn(h,D,j,this.en),o=this.a*c*j/Math.sqrt(1-this.es*D*D)}return t.x=o,t.y=R,t}function inverse$b(t){var o,R,c,h;return t.x-=this.x0,c=t.x/this.a,t.y-=this.y0,o=t.y/this.a,this.sphere?(o/=this.C_y,c=c/(this.C_x*(this.m+Math.cos(o))),this.m?o=asinz((this.m*o+Math.sin(o))/this.n):this.n!==1&&(o=asinz(Math.sin(o)/this.n)),c=adjust_lon(c+this.long0),o=adjust_lat(o)):(o=pj_inv_mlfn(t.y/this.a,this.es,this.en),h=Math.abs(o),h<HALF_PI?(h=Math.sin(o),R=this.long0+t.x*Math.sqrt(1-this.es*h*h)/(this.a*Math.cos(o)),c=adjust_lon(R)):h-EPSLN<HALF_PI&&(c=this.long0)),t.x=c,t.y=o,t}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(t){for(var o=t.x,R=t.y,c=adjust_lon(o-this.long0),h=R,d=Math.PI*Math.sin(R);;){var H=-(h+Math.sin(h)-d)/(1+Math.cos(h));if(h+=H,Math.abs(H)<EPSLN)break}h/=2,Math.PI/2-Math.abs(R)<EPSLN&&(c=0);var n=.900316316158*this.a*c*Math.cos(h)+this.x0,D=1.4142135623731*this.a*Math.sin(h)+this.y0;return t.x=n,t.y=D,t}function inverse$a(t){var o,R;t.x-=this.x0,t.y-=this.y0,R=t.y/(1.4142135623731*this.a),Math.abs(R)>.999999999999&&(R=.999999999999),o=Math.asin(R);var c=adjust_lon(this.long0+t.x/(.900316316158*this.a*Math.cos(o)));c<-Math.PI&&(c=-Math.PI),c>Math.PI&&(c=Math.PI),R=(2*o+Math.sin(2*o))/Math.PI,Math.abs(R)>1&&(R=1);var h=Math.asin(R);return t.x=c,t.y=h,t}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.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=msfnz(this.e,this.sinphi,this.cosphi),this.ml1=mlfn(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<EPSLN?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=msfnz(this.e,this.sinphi,this.cosphi),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(t){var o=t.x,R=t.y,c;if(this.sphere)c=this.a*(this.g-R);else{var h=mlfn(this.e0,this.e1,this.e2,this.e3,R);c=this.a*(this.g-h)}var d=this.ns*adjust_lon(o-this.long0),H=this.x0+c*Math.sin(d),n=this.y0+this.rh-c*Math.cos(d);return t.x=H,t.y=n,t}function inverse$9(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var o,R,c,h;this.ns>=0?(R=Math.sqrt(t.x*t.x+t.y*t.y),o=1):(R=-Math.sqrt(t.x*t.x+t.y*t.y),o=-1);var d=0;if(R!==0&&(d=Math.atan2(o*t.x,o*t.y)),this.sphere)return h=adjust_lon(this.long0+d/this.ns),c=adjust_lat(this.g-R/this.a),t.x=h,t.y=c,t;var H=this.g-R/this.a;return c=imlfn(H,this.e0,this.e1,this.e2,this.e3),h=adjust_lon(this.long0+d/this.ns),t.x=h,t.y=c,t}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(t){var o=t.x,R=t.y,c=adjust_lon(o-this.long0),h,d;Math.abs(R)<=EPSLN&&(h=this.x0+this.R*c,d=this.y0);var H=asinz(2*Math.abs(R/Math.PI));(Math.abs(c)<=EPSLN||Math.abs(Math.abs(R)-HALF_PI)<=EPSLN)&&(h=this.x0,R>=0?d=this.y0+Math.PI*this.R*Math.tan(.5*H):d=this.y0+Math.PI*this.R*-Math.tan(.5*H));var n=.5*Math.abs(Math.PI/c-c/Math.PI),D=n*n,j=Math.sin(H),z=Math.cos(H),w=z/(j+z-1),q=w*w,re=w*(2/j-1),ne=re*re,ie=Math.PI*this.R*(n*(w-ne)+Math.sqrt(D*(w-ne)*(w-ne)-(ne+D)*(q-ne)))/(ne+D);c<0&&(ie=-ie),h=this.x0+ie;var Re=D+w;return ie=Math.PI*this.R*(re*Re-n*Math.sqrt((ne+D)*(D+1)-Re*Re))/(ne+D),R>=0?d=this.y0+ie:d=this.y0-ie,t.x=h,t.y=d,t}function inverse$8(t){var o,R,c,h,d,H,n,D,j,z,w,q,re;return t.x-=this.x0,t.y-=this.y0,w=Math.PI*this.R,c=t.x/w,h=t.y/w,d=c*c+h*h,H=-Math.abs(h)*(1+d),n=H-2*h*h+c*c,D=-2*H+1+2*h*h+d*d,re=h*h/D+(2*n*n*n/D/D/D-9*H*n/D/D)/27,j=(H-n*n/3/D)/D,z=2*Math.sqrt(-j/3),w=3*re/j/z,Math.abs(w)>1&&(w>=0?w=1:w=-1),q=Math.acos(w)/3,t.y>=0?R=(-z*Math.cos(q+Math.PI/3)-n/3/D)*Math.PI:R=-(-z*Math.cos(q+Math.PI/3)-n/3/D)*Math.PI,Math.abs(c)<EPSLN?o=this.long0:o=adjust_lon(this.long0+Math.PI*(d-1+Math.sqrt(1+2*(c*c-h*h)+d*d))/2/c),t.x=o,t.y=R,t}var names$9=["Van_der_Grinten_I","VanDerGrinten","vandg"];const vandg={init:init$9,forward:forward$8,inverse:inverse$8,names:names$9};function init$8(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function forward$7(t){var o=t.x,R=t.y,c=Math.sin(t.y),h=Math.cos(t.y),d=adjust_lon(o-this.long0),H,n,D,j,z,w,q,re,ne,ie,Re,Te,$,L,ae,W,Pe,Ie,Ae,de,Ye,Ue,ye;return this.sphere?Math.abs(this.sin_p12-1)<=EPSLN?(t.x=this.x0+this.a*(HALF_PI-R)*Math.sin(d),t.y=this.y0-this.a*(HALF_PI-R)*Math.cos(d),t):Math.abs(this.sin_p12+1)<=EPSLN?(t.x=this.x0+this.a*(HALF_PI+R)*Math.sin(d),t.y=this.y0+this.a*(HALF_PI+R)*Math.cos(d),t):(Ie=this.sin_p12*c+this.cos_p12*h*Math.cos(d),W=Math.acos(Ie),Pe=W?W/Math.sin(W):1,t.x=this.x0+this.a*Pe*h*Math.sin(d),t.y=this.y0+this.a*Pe*(this.cos_p12*c-this.sin_p12*h*Math.cos(d)),t):(H=e0fn(this.es),n=e1fn(this.es),D=e2fn(this.es),j=e3fn(this.es),Math.abs(this.sin_p12-1)<=EPSLN?(z=this.a*mlfn(H,n,D,j,HALF_PI),w=this.a*mlfn(H,n,D,j,R),t.x=this.x0+(z-w)*Math.sin(d),t.y=this.y0-(z-w)*Math.cos(d),t):Math.abs(this.sin_p12+1)<=EPSLN?(z=this.a*mlfn(H,n,D,j,HALF_PI),w=this.a*mlfn(H,n,D,j,R),t.x=this.x0+(z+w)*Math.sin(d),t.y=this.y0+(z+w)*Math.cos(d),t):(q=c/h,re=gN(this.a,this.e,this.sin_p12),ne=gN(this.a,this.e,c),ie=Math.atan((1-this.es)*q+this.es*re*this.sin_p12/(ne*h)),Re=Math.atan2(Math.sin(d),this.cos_p12*Math.tan(ie)-this.sin_p12*Math.cos(d)),Re===0?Ae=Math.asin(this.cos_p12*Math.sin(ie)-this.sin_p12*Math.cos(ie)):Math.abs(Math.abs(Re)-Math.PI)<=EPSLN?Ae=-Math.asin(this.cos_p12*Math.sin(ie)-this.sin_p12*Math.cos(ie)):Ae=Math.asin(Math.sin(d)*Math.cos(ie)/Math.sin(Re)),Te=this.e*this.sin_p12/Math.sqrt(1-this.es),$=this.e*this.cos_p12*Math.cos(Re)/Math.sqrt(1-this.es),L=Te*$,ae=$*$,de=Ae*Ae,Ye=de*Ae,Ue=Ye*Ae,ye=Ue*Ae,W=re*Ae*(1-de*ae*(1-ae)/6+Ye/8*L*(1-2*ae)+Ue/120*(ae*(4-7*ae)-3*Te*Te*(1-7*ae))-ye/48*L),t.x=this.x0+W*Math.sin(Re),t.y=this.y0+W*Math.cos(Re),t))}function inverse$7(t){t.x-=this.x0,t.y-=this.y0;var o,R,c,h,d,H,n,D,j,z,w,q,re,ne,ie,Re,Te,$,L,ae,W,Pe,Ie,Ae;return this.sphere?(o=Math.sqrt(t.x*t.x+t.y*t.y),o>2*HALF_PI*this.a?void 0:(R=o/this.a,c=Math.sin(R),h=Math.cos(R),d=this.long0,Math.abs(o)<=EPSLN?H=this.lat0:(H=asinz(h*this.sin_p12+t.y*c*this.cos_p12/o),n=Math.abs(this.lat0)-HALF_PI,Math.abs(n)<=EPSLN?this.lat0>=0?d=adjust_lon(this.long0+Math.atan2(t.x,-t.y)):d=adjust_lon(this.long0-Math.atan2(-t.x,t.y)):d=adjust_lon(this.long0+Math.atan2(t.x*c,o*this.cos_p12*h-t.y*this.sin_p12*c))),t.x=d,t.y=H,t)):(D=e0fn(this.es),j=e1fn(this.es),z=e2fn(this.es),w=e3fn(this.es),Math.abs(this.sin_p12-1)<=EPSLN?(q=this.a*mlfn(D,j,z,w,HALF_PI),o=Math.sqrt(t.x*t.x+t.y*t.y),re=q-o,H=imlfn(re/this.a,D,j,z,w),d=adjust_lon(this.long0+Math.atan2(t.x,-1*t.y)),t.x=d,t.y=H,t):Math.abs(this.sin_p12+1)<=EPSLN?(q=this.a*mlfn(D,j,z,w,HALF_PI),o=Math.sqrt(t.x*t.x+t.y*t.y),re=o-q,H=imlfn(re/this.a,D,j,z,w),d=adjust_lon(this.long0+Math.atan2(t.x,t.y)),t.x=d,t.y=H,t):(o=Math.sqrt(t.x*t.x+t.y*t.y),Re=Math.atan2(t.x,t.y),ne=gN(this.a,this.e,this.sin_p12),Te=Math.cos(Re),$=this.e*this.cos_p12*Te,L=-$*$/(1-this.es),ae=3*this.es*(1-L)*this.sin_p12*this.cos_p12*Te/(1-this.es),W=o/ne,Pe=W-L*(1+L)*Math.pow(W,3)/6-ae*(1+3*L)*Math.pow(W,4)/24,Ie=1-L*Pe*Pe/2-W*Pe*Pe*Pe/6,ie=Math.asin(this.sin_p12*Math.cos(Pe)+this.cos_p12*Math.sin(Pe)*Te),d=adjust_lon(this.long0+Math.asin(Math.sin(Re)*Math.sin(Pe)/Math.cos(ie))),Ae=Math.sin(ie),H=Math.atan2((Ae-this.es*Ie*this.sin_p12)*Math.tan(ie),Ae*(1-this.es)),t.x=d,t.y=H,t))}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(t){var o,R,c,h,d,H,n,D,j=t.x,z=t.y;return c=adjust_lon(j-this.long0),o=Math.sin(z),R=Math.cos(z),h=Math.cos(c),H=this.sin_p14*o+this.cos_p14*R*h,d=1,(H>0||Math.abs(H)<=EPSLN)&&(n=this.a*d*R*Math.sin(c),D=this.y0+this.a*d*(this.cos_p14*o-this.sin_p14*R*h)),t.x=n,t.y=D,t}function inverse$6(t){var o,R,c,h,d,H,n;return t.x-=this.x0,t.y-=this.y0,o=Math.sqrt(t.x*t.x+t.y*t.y),R=asinz(o/this.a),c=Math.sin(R),h=Math.cos(R),H=this.long0,Math.abs(o)<=EPSLN?(n=this.lat0,t.x=H,t.y=n,t):(n=asinz(h*this.sin_p14+t.y*c*this.cos_p14/o),d=Math.abs(this.lat0)-HALF_PI,Math.abs(d)<=EPSLN?(this.lat0>=0?H=adjust_lon(this.long0+Math.atan2(t.x,-t.y)):H=adjust_lon(this.long0-Math.atan2(-t.x,t.y)),t.x=H,t.y=n,t):(H=adjust_lon(this.long0+Math.atan2(t.x*c,o*this.cos_p14*h-t.y*this.sin_p14*c)),t.x=H,t.y=n,t))}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(t){var o={x:0,y:0},R,c,h,d,H,n,D={value:0};if(t.x-=this.long0,this.es!==0?R=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):R=t.y,c=t.x,this.face===FACE_ENUM.TOP)d=HALF_PI-R,c>=FORTPI&&c<=HALF_PI+FORTPI?(D.value=AREA_ENUM.AREA_0,h=c-HALF_PI):c>HALF_PI+FORTPI||c<=-(HALF_PI+FORTPI)?(D.value=AREA_ENUM.AREA_1,h=c>0?c-SPI:c+SPI):c>-(HALF_PI+FORTPI)&&c<=-FORTPI?(D.value=AREA_ENUM.AREA_2,h=c+HALF_PI):(D.value=AREA_ENUM.AREA_3,h=c);else if(this.face===FACE_ENUM.BOTTOM)d=HALF_PI+R,c>=FORTPI&&c<=HALF_PI+FORTPI?(D.value=AREA_ENUM.AREA_0,h=-c+HALF_PI):c<FORTPI&&c>=-FORTPI?(D.value=AREA_ENUM.AREA_1,h=-c):c<-FORTPI&&c>=-(HALF_PI+FORTPI)?(D.value=AREA_ENUM.AREA_2,h=-c-HALF_PI):(D.value=AREA_ENUM.AREA_3,h=c>0?-c+SPI:-c-SPI);else{var j,z,w,q,re,ne,ie;this.face===FACE_ENUM.RIGHT?c=qsc_shift_lon_origin(c,+HALF_PI):this.face===FACE_ENUM.BACK?c=qsc_shift_lon_origin(c,+SPI):this.face===FACE_ENUM.LEFT&&(c=qsc_shift_lon_origin(c,-HALF_PI)),q=Math.sin(R),re=Math.cos(R),ne=Math.sin(c),ie=Math.cos(c),j=re*ie,z=re*ne,w=q,this.face===FACE_ENUM.FRONT?(d=Math.acos(j),h=qsc_fwd_equat_face_theta(d,w,z,D)):this.face===FACE_ENUM.RIGHT?(d=Math.acos(z),h=qsc_fwd_equat_face_theta(d,w,-j,D)):this.face===FACE_ENUM.BACK?(d=Math.acos(-j),h=qsc_fwd_equat_face_theta(d,w,-z,D)):this.face===FACE_ENUM.LEFT?(d=Math.acos(-z),h=qsc_fwd_equat_face_theta(d,w,j,D)):(d=h=0,D.value=AREA_ENUM.AREA_0)}return n=Math.atan(12/SPI*(h+Math.acos(Math.sin(h)*Math.cos(FORTPI))-HALF_PI)),H=Math.sqrt((1-Math.cos(d))/(Math.cos(n)*Math.cos(n))/(1-Math.cos(Math.atan(1/Math.cos(h))))),D.value===AREA_ENUM.AREA_1?n+=HALF_PI:D.value===AREA_ENUM.AREA_2?n+=SPI:D.value===AREA_ENUM.AREA_3&&(n+=1.5*SPI),o.x=H*Math.cos(n),o.y=H*Math.sin(n),o.x=o.x*this.a+this.x0,o.y=o.y*this.a+this.y0,t.x=o.x,t.y=o.y,t}function inverse$5(t){var o={lam:0,phi:0},R,c,h,d,H,n,D,j,z,w={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,c=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),R=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?w.value=AREA_ENUM.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(w.value=AREA_ENUM.AREA_1,R-=HALF_PI):t.x<0&&-t.x>=Math.abs(t.y)?(w.value=AREA_ENUM.AREA_2,R=R<0?R+SPI:R-SPI):(w.value=AREA_ENUM.AREA_3,R+=HALF_PI),z=SPI/12*Math.tan(R),H=Math.sin(z)/(Math.cos(z)-1/Math.sqrt(2)),n=Math.atan(H),h=Math.cos(R),d=Math.tan(c),D=1-h*h*d*d*(1-Math.cos(Math.atan(1/Math.cos(n)))),D<-1?D=-1:D>1&&(D=1),this.face===FACE_ENUM.TOP)j=Math.acos(D),o.phi=HALF_PI-j,w.value===AREA_ENUM.AREA_0?o.lam=n+HALF_PI:w.value===AREA_ENUM.AREA_1?o.lam=n<0?n+SPI:n-SPI:w.value===AREA_ENUM.AREA_2?o.lam=n-HALF_PI:o.lam=n;else if(this.face===FACE_ENUM.BOTTOM)j=Math.acos(D),o.phi=j-HALF_PI,w.value===AREA_ENUM.AREA_0?o.lam=-n+HALF_PI:w.value===AREA_ENUM.AREA_1?o.lam=-n:w.value===AREA_ENUM.AREA_2?o.lam=-n-HALF_PI:o.lam=n<0?-n-SPI:-n+SPI;else{var q,re,ne;q=D,z=q*q,z>=1?ne=0:ne=Math.sqrt(1-z)*Math.sin(n),z+=ne*ne,z>=1?re=0:re=Math.sqrt(1-z),w.value===AREA_ENUM.AREA_1?(z=re,re=-ne,ne=z):w.value===AREA_ENUM.AREA_2?(re=-re,ne=-ne):w.value===AREA_ENUM.AREA_3&&(z=re,re=ne,ne=-z),this.face===FACE_ENUM.RIGHT?(z=q,q=-re,re=z):this.face===FACE_ENUM.BACK?(q=-q,re=-re):this.face===FACE_ENUM.LEFT&&(z=q,q=re,re=-z),o.phi=Math.acos(-ne)-HALF_PI,o.lam=Math.atan2(re,q),this.face===FACE_ENUM.RIGHT?o.lam=qsc_shift_lon_origin(o.lam,-HALF_PI):this.face===FACE_ENUM.BACK?o.lam=qsc_shift_lon_origin(o.lam,-SPI):this.face===FACE_ENUM.LEFT&&(o.lam=qsc_shift_lon_origin(o.lam,+HALF_PI))}if(this.es!==0){var ie,Re,Te;ie=o.phi<0?1:0,Re=Math.tan(o.phi),Te=this.b/Math.sqrt(Re*Re+this.one_minus_f_squared),o.phi=Math.atan(Math.sqrt(this.a*this.a-Te*Te)/(this.one_minus_f*Te)),ie&&(o.phi=-o.phi)}return o.lam+=this.long0,t.x=o.lam,t.y=o.phi,t}function qsc_fwd_equat_face_theta(t,o,R,c){var h;return t<EPSLN?(c.value=AREA_ENUM.AREA_0,h=0):(h=Math.atan2(o,R),Math.abs(h)<=FORTPI?c.value=AREA_ENUM.AREA_0:h>FORTPI&&h<=HALF_PI+FORTPI?(c.value=AREA_ENUM.AREA_1,h-=HALF_PI):h>HALF_PI+FORTPI||h<=-(HALF_PI+FORTPI)?(c.value=AREA_ENUM.AREA_2,h=h>=0?h-SPI:h+SPI):(c.value=AREA_ENUM.AREA_3,h+=HALF_PI)),h}function qsc_shift_lon_origin(t,o){var R=t+o;return R<-SPI?R+=TWO_PI:R>+SPI&&(R-=TWO_PI),R}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(t,o){return t[0]+o*(t[1]+o*(t[2]+o*t[3]))},poly3_der=function(t,o){return t[1]+o*(2*t[2]+o*3*t[3])};function newton_rapshon(t,o,R,c){for(var h=o;c;--c){var d=t(h);if(h-=d,Math.abs(d)<R)break}return h}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(t){var o=adjust_lon(t.x-this.long0),R=Math.abs(t.y),c=Math.floor(R*C1);c<0?c=0:c>=NODES&&(c=NODES-1),R=R2D*(R-RC1*c);var h={x:poly3_val(COEFS_X[c],R)*o,y:poly3_val(COEFS_Y[c],R)};return t.y<0&&(h.y=-h.y),h.x=h.x*this.a*FXC+this.x0,h.y=h.y*this.a*FYC+this.y0,h}function inverse$4(t){var o={x:(t.x-this.x0)/(this.a*FXC),y:Math.abs(t.y-this.y0)/(this.a*FYC)};if(o.y>=1)o.x/=COEFS_X[NODES][0],o.y=t.y<0?-HALF_PI:HALF_PI;else{var R=Math.floor(o.y*NODES);for(R<0?R=0:R>=NODES&&(R=NODES-1);;)if(COEFS_Y[R][0]>o.y)--R;else if(COEFS_Y[R+1][0]<=o.y)++R;else break;var c=COEFS_Y[R],h=5*(o.y-c[0])/(COEFS_Y[R+1][0]-c[0]);h=newton_rapshon(function(d){return(poly3_val(c,d)-o.y)/poly3_der(c,d)},h,EPSLN,100),o.x/=poly3_val(COEFS_X[R],h),o.y=(5*R+h)*D2R$1,t.y<0&&(o.y=-o.y)}return o.x=adjust_lon(o.x+this.long0),o}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(t){var o=geodeticToGeocentric(t,this.es,this.a);return o}function inverse$3(t){var o=geocentricToGeodetic(t,this.es,this.a,this.b);return o}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(R){if(typeof this[R]=="undefined")this[R]=params[R].def;else{if(params[R].num&&isNaN(this[R]))throw new Error("Invalid parameter value, must be numeric "+R+" = "+this[R]);params[R].num&&(this[R]=parseFloat(this[R]))}params[R].degrees&&(this[R]=this[R]*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 t=this.tilt,o=this.azi;this.cg=Math.cos(o),this.sg=Math.sin(o),this.cw=Math.cos(t),this.sw=Math.sin(t)}function forward$2(t){t.x-=this.long0;var o=Math.sin(t.y),R=Math.cos(t.y),c=Math.cos(t.x),h,d;switch(this.mode){case mode.OBLIQ:d=this.sinph0*o+this.cosph0*R*c;break;case mode.EQUIT:d=R*c;break;case mode.S_POLE:d=-o;break;case mode.N_POLE:d=o;break}switch(d=this.pn1/(this.p-d),h=d*R*Math.sin(t.x),this.mode){case mode.OBLIQ:d*=this.cosph0*o-this.sinph0*R*c;break;case mode.EQUIT:d*=o;break;case mode.N_POLE:d*=-(R*c);break;case mode.S_POLE:d*=R*c;break}var H,n;return H=d*this.cg+h*this.sg,n=1/(H*this.sw*this.h1+this.cw),h=(h*this.cg-d*this.sg)*this.cw*n,d=H*n,t.x=h*this.a,t.y=d*this.a,t}function inverse$2(t){t.x/=this.a,t.y/=this.a;var o={x:t.x,y:t.y},R,c,h;h=1/(this.pn1-t.y*this.sw),R=this.pn1*t.x*h,c=this.pn1*t.y*this.cw*h,t.x=R*this.cg+c*this.sg,t.y=c*this.cg-R*this.sg;var d=hypot$1(t.x,t.y);if(Math.abs(d)<EPSLN)o.x=0,o.y=t.y;else{var H,n;switch(n=1-d*d*this.pfact,n=(this.p-Math.sqrt(n))/(this.pn1/d+d/this.pn1),H=Math.sqrt(1-n*n),this.mode){case mode.OBLIQ:o.y=Math.asin(H*this.sinph0+t.y*n*this.cosph0/d),t.y=(H-this.sinph0*Math.sin(o.y))*d,t.x*=n*this.cosph0;break;case mode.EQUIT:o.y=Math.asin(t.y*n/d),t.y=H*d,t.x*=n;break;case mode.N_POLE:o.y=Math.asin(H),t.y=-t.y;break;case mode.S_POLE:o.y=-Math.asin(H);break}o.x=Math.atan2(t.x,t.y)}return t.x=o.x+this.long0,t.y=o.y,t}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 t=1-this.es,o=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=o,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(t){var o=t.x,R=t.y,c,h,d,H;if(o=o-this.long0,this.shape==="ellipse"){R=Math.atan(this.radius_p2*Math.tan(R));var n=this.radius_p/hypot$1(this.radius_p*Math.cos(R),Math.sin(R));if(h=n*Math.cos(o)*Math.cos(R),d=n*Math.sin(o)*Math.cos(R),H=n*Math.sin(R),(this.radius_g-h)*h-d*d-H*H*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;c=this.radius_g-h,this.flip_axis?(t.x=this.radius_g_1*Math.atan(d/hypot$1(H,c)),t.y=this.radius_g_1*Math.atan(H/c)):(t.x=this.radius_g_1*Math.atan(d/c),t.y=this.radius_g_1*Math.atan(H/hypot$1(d,c)))}else this.shape==="sphere"&&(c=Math.cos(R),h=Math.cos(o)*c,d=Math.sin(o)*c,H=Math.sin(R),c=this.radius_g-h,this.flip_axis?(t.x=this.radius_g_1*Math.atan(d/hypot$1(H,c)),t.y=this.radius_g_1*Math.atan(H/c)):(t.x=this.radius_g_1*Math.atan(d/c),t.y=this.radius_g_1*Math.atan(H/hypot$1(d,c))));return t.x=t.x*this.a,t.y=t.y*this.a,t}function inverse$1(t){var o=-1,R=0,c=0,h,d,H,n;if(t.x=t.x/this.a,t.y=t.y/this.a,this.shape==="ellipse"){this.flip_axis?(c=Math.tan(t.y/this.radius_g_1),R=Math.tan(t.x/this.radius_g_1)*hypot$1(1,c)):(R=Math.tan(t.x/this.radius_g_1),c=Math.tan(t.y/this.radius_g_1)*hypot$1(1,R));var D=c/this.radius_p;if(h=R*R+D*D+o*o,d=2*this.radius_g*o,H=d*d-4*h*this.C,H<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-d-Math.sqrt(H))/(2*h),o=this.radius_g+n*o,R*=n,c*=n,t.x=Math.atan2(R,o),t.y=Math.atan(c*Math.cos(t.x)/o),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if(this.shape==="sphere"){if(this.flip_axis?(c=Math.tan(t.y/this.radius_g_1),R=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+c*c)):(R=Math.tan(t.x/this.radius_g_1),c=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+R*R)),h=R*R+c*c+o*o,d=2*this.radius_g*o,H=d*d-4*h*this.C,H<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-d-Math.sqrt(H))/(2*h),o=this.radius_g+n*o,R*=n,c*=n,t.x=Math.atan2(R,o),t.y=Math.atan(c*Math.cos(t.x)/o)}return t.x=t.x+this.long0,t}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(t){var o=adjust_lon(t.x-this.long0),R=t.y,c=Math.asin(M*Math.sin(R)),h=c*c,d=h*h*h;return t.x=o*Math.cos(c)/(M*(A1+3*A2*h+d*(7*A3+9*A4*h))),t.y=c*(A1+A2*h+d*(A3+A4*h)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function inverse(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var o=1e-9,R=12,c=t.y,h,d,H,n,D,j;for(j=0;j<R&&(h=c*c,d=h*h*h,H=c*(A1+A2*h+d*(A3+A4*h))-t.y,n=A1+3*A2*h+d*(7*A3+9*A4*h),c-=D=H/n,!(Math.abs(D)<o));++j);return h=c*c,d=h*h*h,t.x=M*t.x*(A1+3*A2*h+d*(7*A3+9*A4*h))/Math.cos(c),t.y=Math.asin(Math.sin(c)/M),t.x=adjust_lon(t.x+this.long0),t}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 t;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),t=Math.cos(this.phi1),this.en),this.am1=t/(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(t){var o=adjust_lon(t.x-(this.long0||0)),R=t.y,c,h,d;return c=this.am1+this.m1-pj_mlfn(R,h=Math.sin(R),d=Math.cos(R),this.en),h=d*o/(c*Math.sqrt(1-this.es*h*h)),t.x=c*Math.sin(h),t.y=this.am1-c*Math.cos(h),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function e_inv(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var o,R,c,h;if(R=hypot$1(t.x,t.y=this.am1-t.y),h=pj_inv_mlfn(this.am1+this.m1-R,this.es,this.en),(o=Math.abs(h))<HALF_PI)o=Math.sin(h),c=R*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*o*o)/Math.cos(h);else if(Math.abs(o-HALF_PI)<=EPS10)c=0;else throw new Error;return t.x=adjust_lon(c+(this.long0||0)),t.y=adjust_lat(h),t}function s_fwd(t){var o=adjust_lon(t.x-(this.long0||0)),R=t.y,c,h;return h=this.cphi1+this.phi1-R,Math.abs(h)>EPS10?(t.x=h*Math.sin(c=o*Math.cos(R)/h),t.y=this.cphi1-h*Math.cos(c)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function s_inv(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var o,R,c=hypot$1(t.x,t.y=this.cphi1-t.y);if(R=this.cphi1+this.phi1-c,Math.abs(R)>HALF_PI)throw new Error;return Math.abs(Math.abs(R)-HALF_PI)<=EPS10?o=0:o=c*Math.atan2(t.x,t.y)/Math.cos(R),t.x=adjust_lon(o+(this.long0||0)),t.y=adjust_lat(R),t}var names=["bonne","Bonne (Werner lat_1=90)"];const bonne={init,names};function includedProjections(t){t.Proj.projections.add(tmerc),t.Proj.projections.add(etmerc),t.Proj.projections.add(utm),t.Proj.projections.add(sterea),t.Proj.projections.add(stere),t.Proj.projections.add(somerc),t.Proj.projections.add(omerc),t.Proj.projections.add(lcc),t.Proj.projections.add(krovak),t.Proj.projections.add(cass),t.Proj.projections.add(laea),t.Proj.projections.add(aea),t.Proj.projections.add(gnom),t.Proj.projections.add(cea),t.Proj.projections.add(eqc),t.Proj.projections.add(poly),t.Proj.projections.add(nzmg),t.Proj.projections.add(mill),t.Proj.projections.add(sinu),t.Proj.projections.add(moll),t.Proj.projections.add(eqdc),t.Proj.projections.add(vandg),t.Proj.projections.add(aeqd),t.Proj.projections.add(ortho),t.Proj.projections.add(qsc),t.Proj.projections.add(robin),t.Proj.projections.add(geocent),t.Proj.projections.add(tpers),t.Proj.projections.add(geos),t.Proj.projections.add(eqearth),t.Proj.projections.add(bonne)}proj4.defaultDatum="WGS84",proj4.Proj=Projection,proj4.WGS84=new proj4.Proj("WGS84"),proj4.Point=Point,proj4.toPoint=common$1,proj4.defs=defs,proj4.nadgrid=nadgrid,proj4.transform=transform$1,proj4.mgrs=mgrs,proj4.version="__VERSION__",includedProjections(proj4);function getWKTString(t){let{type:o,epsg_code:R}=t;for(let c=0;c<crsList.length;c++){if(!crsTypes[crsList[c].type]||crsTypes[crsList[c].type].code!==o)continue;let{authCode:d,wkt:H,children:n}=crsList[c];if(d==R)return H;if(n!=null&&n.length){for(let D=0;D<n.length;D++)if(n[D].children){for(let j=0;j<n[D].children.length;j++)if(n[D].children[j].authCode==R)return n[D].children[j].wkt}else if(n[D].authCode==R)return n[D].wkt}}return null}function project(t,o=12){let[R,c]=t,h=(180+R)/360,d=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c*Math.PI/360)))/360;return{x:h*Math.pow(2,o)*512,y:d*Math.pow(2,o)*512}}function getTileCoord(t,o){let[R,c]=o,h=(180+R)/360,d=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c*Math.PI/360)))/360;return{x:Math.floor(h*Math.pow(2,t)),y:Math.floor(d*Math.pow(2,t)),z:t}}function getTilePixelCoord(t,o){let[R,c]=o,h=(180+R)/360,d=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c*Math.PI/360)))/360;return{x:Math.round(h*Math.pow(2,t)*512)%512,y:Math.round(d*Math.pow(2,t)*512)%512}}function getUTMProjection(t){let o=32600,R=Math.ceil((t+180)/6);return{type:3,type_name:"Projected",label:`WGS 84 / UTM zone ${R}N`,epsg_code:o+R}}function transformCoordinate(t,o,R){if(!t)return null;if(t=[...t],t[2]||(t[2]=0),!o||!R||R.type===1||o.type===1)return t;if(o.type===0&&R.type===0){let c=satellite_geo_calc.coordinateTransfer.lla_to_enu({lon:o.origin_point[0],lat:o.origin_point[1],alt:o.origin_point[2]},{lon:R.origin_point[0],lat:R.origin_point[1],alt:R.origin_point[2]});return[c.x+t[0],c.y+t[1],c.z+t[2]]}else if(o.type===0){let c=satellite_geo_calc.coordinateTransfer.enu_to_lla({x:t[0],y:t[1],z:t[2]},{lon:o.origin_point[0],lat:o.origin_point[1],alt:o.origin_point[2]}),h=[c.lon,c.lat,c.alt],{wkt:d,epsg_code:H}=R;return H===4326||H===4490?h:(!d&&H&&(d=getWKTString(R)),d?proj4("EPSG:4326",d,h):null)}else if(R.type===0){let{wkt:c,epsg_code:h}=o,d=t;if(h!==4326){if(!c&&h&&(c=getWKTString(o)),!c)return null;d=proj4(c,"EPSG:4326",t)}let H=satellite_geo_calc.coordinateTransfer.lla_to_enu({lon:d[0],lat:d[1],alt:d[2]},{lon:R.origin_point[0],lat:R.origin_point[1],alt:R.origin_point[2]});return[H.x,H.y,H.z]}else{let c=o.wkt,h=R.wkt;return!c&&o.epsg_code&&(c=getWKTString(o)),!h&&R.epsg_code&&(h=getWKTString(R)),!c||!h?null:proj4(c,h,t)}}function transformCoordinateToLngLat(t,o){return transformCoordinate(t,o,{type:2,type_name:"Geographic",epsg_code:4326})}function transformLnglat(t,o){return transformCoordinate(t,{type:2,type_name:"Geographic",epsg_code:4326},o)}function geographicToCartesian(t){return proj4("+proj=longlat +datum=WGS84","+proj=geocent +datum=WGS84",t)}const transform=Object.freeze(Object.defineProperty({__proto__:null,getWKTString,project,getTileCoord,getTilePixelCoord,getUTMProjection,transformCoordinate,transformCoordinateToLngLat,transformLnglat,geographicToCartesian},Symbol.toStringTag,{value:"Module"}));function generateId(){return v4()}function formatDate(t){return t?hooks(t).format("YYYY-MM-DD HH:mm:ss"):"-"}function formatLocalDate(){return hooks().format("YYYY/M/D HH:mm:ss")}function formatFileSize(t){t=parseInt(t);let o=Math.floor(Math.log(t)/Math.log(1024)),R=["B","KB","MB","GB","TB","PB"];return _.round(t/Math.pow(1024,o),2)+R[o]}function getGeoCoordOperator(t){return t==="N"||t==="E"?1:-1}function toRadian(t){return t[0]+t[1]/60+t[2]/3600}function diffLayers(t,o=[]){t=_formatTree(t),o=_formatTree(o);let R=[];for(let c of t){let{visible:h}=c;for(let d of c.items||[]){let{id:H,type:n,opacity:D,visible:j}=d;if(h||(j=!1),["point","line","polygon"].includes(n)&&R.find(re=>re[0]==="updateAnnotations"))continue;let z=findNodeInTree(H,o);if(!z&&!j)continue;if(!z){["point","line","polygon"].includes(n)?R.push(["updateAnnotations",d]):R.push(["addLayer",d]);continue}let{opacity:w,visible:q}=z;_.isEqual(d,z)||(["point","line","polygon"].includes(n)?R.push(["updateAnnotations",d]):D!==w||!_.isEqual(d.metadata,z.metadata)?R.push(["updateLayer",d]):j!==q&&R.push([j?"addLayer":"removeLayer",d]))}}for(let c of o)for(let h of c.items||[]){let{id:d,type:H}=h;findNodeInTree(d,t)||(["point","line","polygon"].includes(H)?R.find(D=>D[0]==="updateAnnotations")||R.push(["updateAnnotations",h]):R.push(["removeLayer",h]))}return R}function findNodeInTree(t,o){var R;for(let c of o){if(c.id===t)return c;if((R=c.items)!=null&&R.length){let h=findNodeInTree(t,c.items);if(h)return h}}return null}function _formatTree(t){let o=_.cloneDeep(t);for(let R of o)for(let c of R.items||[])R.visible||(c.visible=!1);return o}function getBeforeId(t,o){let R=t.style._layers,c=t.style.order,{layerType:h}=o.metadata;return c.find(n=>{let D=R[n].metadata;return _.isEmpty(D)&&(D={layerType:"dsm"}),H(h,o.id)<H(D.layerType,n)})||"";function H(n,D){const j=[["bmap"],["dom"],["ndvi"],["dsm"],["circle"],["annotation"],["label"]];let z=-1;return D.startsWith("gl-draw")?z=5:z=j.findIndex(w=>w.includes(n)),z===-1?100:z}}function isTokenExpired(t){if(!t)return!1;let{message:o="",msg:R=""}=t.data;return t.status==401&&(R.toLowerCase().includes("expired")||o.toLowerCase().includes("expired"))}function getDataType$2(t){for(let o in cameras)if(cameras[o].includes(t))return o;return"normal"}function downloadImage(t){let o=`\u5FEB\u7167${hooks().format("YYYYMMDD")}${new Date().getTime()}.png`,R=document.createElement("a");R.href=t,R.download=o,document.body.appendChild(R),R.click(),document.body.removeChild(R)}function getGeometryType(t){let o=getType$1(t);return["Point","MultiPoint"].includes(o)?"point":["LineString","MultiLineString"].includes(o)?"line":"polygon"}function rgbaToFloat(t){let o=t[3]>128?0:1,R=-1*(1-o)+o,c=Math.floor((t[3]+.1)%128)*2+Math.floor((t[2]+.1)/128)-127,h=t[0]+t[1]*256+Math.floor((t[2]+.1)%128)*256*256;return R*(1+h/8388607)*Math.pow(2,c)}function getAnnotationFeature(t){let{geometry:o}=t,R=_.cloneDeep(t);return delete R.geometry,{id:R.id,type:"Feature",properties:R,geometry:_.cloneDeep(o)}}function getAnnotationName(t,o){let R=[],c=o==="point"?"\u70B9\u6CE8\u8BB0":o==="line"?"\u7EBF\u6CE8\u8BB0":"\u9762\u6CE8\u8BB0";t.forEach(h=>{if(h.name===c){R.push(0);return}if(h.name.startsWith(`${c} `)){let d=Number(h.name.split(" ").pop());Number.isNaN(d)||R.push(d)}}),R=R.sort((h,d)=>h-d);for(let h=0;h<R.length;h++)if(R[h]!==h)return h===0?c:`${c} ${h}`;return R.length===0?c:`${c} ${R.length}`}function getLineLabelFeature(t){let o=t.geometry.coordinates,R=[];for(let D=1;D<o.length;D++)distance(o[D-1],o[D],{units:"meters"})>30&&R.push([o[D-1],o[D]]);let c=[];if(R.length){let D=Math.floor(R.length/2);c=R[D]}else{let D=Math.floor(o.length/2-1);c=[o[D],o[D+1]]}let h=project(c[0]),d=project(c[1]),H=360-Math.atan((h.y-d.y)/(d.x-h.x))*180/Math.PI,n=midpoint(c[0],c[1]);return n.properties=t.properties,n.properties.angle=H,n.geometry.coordinates.push(((c[0][2]||0)+(c[1][2]||0))/2),n}function addIcons2Map(t,o){return new Promise((R,c)=>{let h=o.length;o.forEach(({url:d,sdf:H})=>{t.loadImage(d,(n,D)=>{h--;let j=d.split("/").pop().split(".")[0];if(!t.hasImage(j)){if(n){c(n);return}t.addImage(j,D,{sdf:H}),h<=0&&R(!0)}})})})}function getTaskTreeList(t,o,R){var d;let c=_.cloneDeep(((d=t.metadata)==null?void 0:d.groups)||layerGroups);return c.forEach(H=>H.items=[]),o.forEach(H=>{let n=_.cloneDeep(H);n.group||n.group,c.find(j=>j.id===n.group).items.push(n)}),(t.status==="complete"?R:[]).forEach(H=>{let{group:n}=H,D=c.find(j=>j.id===n);!D||D.items.push(H)}),c}function hasNaN(t){for(let o=0;o<t.length;o++)if(Number.isNaN(t[o]))return!0;return!1}function flatObject(t){let o={};for(let R in t)R.startsWith("xmlns")||Array.isArray(t[R])||(typeof t[R]=="object"?Object.assign(o,flatObject(t[R])):o[R]=t[R]);return o}function getRotationMatrix(t,o,R){let c=[],h=fromValues$2(0,1,0,0,1,0,0,0,0,0,-1,0,0,0,0,1),d=fromValues$2(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),H=fromZRotation(create$3(),R*Math.PI/180),n=fromYRotation(create$3(),t*Math.PI/180),D=fromXRotation(create$3(),o*Math.PI/180),j=multiply$1(create$3(),multiply$1(create$3(),H,n),D),z=multiply$1(create$3(),multiply$1(create$3(),d,transpose$1(create$3(),j)),h);for(let w=0;w<3;w++)for(let q=0;q<3;q++)c[w*3+q]=z[w+q*4];return c}function transformRoi(t,o){let{boundary:R,min_z:c,max_z:h}=t,{type:d,origin_point:H}=o;if(d===0){let n=[];return R.forEach(D=>{let j=transformCoordinateToLngLat([...D,0],o);n.push(j)}),c+=H[2],h+=H[2],{boundary:n,min_z:c,max_z:h}}return t}function getPosSigma(t){return t==="high"?[.03,.03,.06]:t==="low"?[10,10,10]:[1,1,1]}function photoPos2Geojson(t){let o=[],R=t.find(d=>d.meta_data.pos);if(R){let d=_.cloneDeep(R.meta_data.coordinate_system);t.forEach(H=>{let{meta_data:n={}}=H,{pos:D}=n,j=transformCoordinateToLngLat(D,d);if(!j)return;let z=_.cloneDeep(H);z.type="photo",o.push(point(j,z))})}let c=featureCollection(o),h=null;return o.length&&(h=bbox(c)),{geojson:c,bbox:h}}function getDistance(t,o){return Math.sqrt((t[0]-o[0])*(t[0]-o[0])+(t[1]-o[1])*(t[1]-o[1]))}function getMaxValue(t,o){let R=-1/0;return t.forEach(c=>{R=Math.max(c[o],R)}),R}function getAverageValue(t,o){let R=0;return t.forEach(c=>{R+=c[o]}),R/t.length}function getAppVersion(t){let{appVersion:o,environment:R}=t.metadata;return o||(R?`${R.platform}(${R.appVersion})`:"\u6682\u65E0")}function getResolutionLevelByQuality(t){switch(t){case"low":return 3;case"high":return 1;case"medium":default:return 2}}function getQualityAliasByLevel(t){let o="\u9AD8";return t===1?o="\u8D85\u9AD8":t===3&&(o="\u4E2D"),o}function getImageTypeByDataType(t){switch(t){case"normal":return 1;case"multispectral":return 2;case"infrared":default:return 3}}function getDataTypeAliasByImageType(t){return t==="infrared"?"\u70ED\u7EA2\u5916":t==="multispectral"?"\u591A\u5149\u8C31":"\u53EF\u89C1\u5149"}function getTaskStatusAlias(t){return t==="complete"?"\u5EFA\u6A21\u5B8C\u6210":t==="error"?"\u5EFA\u6A21\u51FA\u9519":t==="none"?"\u672A\u5F00\u59CB":t==="waiting"?"\u6B63\u5728\u6392\u961F":t==="aerotriangulation"?"\u7A7A\u4E09\u5B8C\u6210":t.startsWith("processing")?"\u6B63\u5728\u5904\u7406":t==="stop"?"\u4EFB\u52A1\u7EC8\u6B62":"\u672A\u77E5\u72B6\u6001"}function include3d(t=[]){return!!(t.length&&t.includes("mesh3d"))}function extend(t,...o){for(const R of o)for(const c in R)t[c]=R[c];return t}function endsWith(t,o){return t.indexOf(o,t.length-o.length)!==-1}let clickPoint=null;function _addEventListener(t,o,R){R[t]=R[t]||[],R[t].push(o)}function _removeEventListener(t,o,R){if(R&&R[t]){const c=R[t].indexOf(o);c!==-1&&R[t].splice(c,1)}}class Event$1{constructor(){this._listeners=[],this._oneTimeListeners=[],this._eventedParent=null,this._eventedParentData=null}on(o,R){return this._listeners=this._listeners||{},_addEventListener(o,R,this._listeners),this}off(o,R){if(!R){this._listeners={},this._oneTimeListeners={};return}return _removeEventListener(o,R,this._listeners),_removeEventListener(o,R,this._oneTimeListeners),this}once(o,R){return this._oneTimeListeners=this._oneTimeListeners||{},_addEventListener(o,R,this._oneTimeListeners),this}fire(o,R){if(this.listens(o)){if(R=extend({},R,{type:o,target:this}),clickPoint){if(R.point&&clickPoint===R.point.x+R.point.y){if(clickPoint===R.point.x+R.point.y)return;clickPoint=R.point.x+R.point.y}else if(R.feature){if(clickPoint===R.x+R.y)return;clickPoint=R.x+R.y}}else R.point?clickPoint=R.point.x+R.point.y:R.feature&&(clickPoint=R.x+R.y);const c=this._listeners&&this._listeners[o]?this._listeners[o].slice():[];for(let d=0;d<c.length;d++)c[d].call(this,R);const h=this._oneTimeListeners&&this._oneTimeListeners[o]?this._oneTimeListeners[o].slice():[];for(let d=0;d<h.length;d++)h[d].call(this,R),_removeEventListener(o,h[d],this._oneTimeListeners);this._eventedParent&&this._eventedParent.fire(o,extend({},R,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData))}else endsWith(o,"error")&&console.error(R&&R.error||R||"Empty error event");return this}listens(o){return this._listeners&&this._listeners[o]&&this._listeners[o].length>0||this._oneTimeListeners&&this._oneTimeListeners[o]&&this._oneTimeListeners[o].length>0||this._eventedParent&&this._eventedParent.listens(o)}setEventedParent(o,R){return this._eventedParent=o,this._eventedParentData=R,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(t){throw new Error('Could not dynamically require "'+t+'". 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(t){var o=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function R(d,H){return Object.prototype.hasOwnProperty.call(d,H)}t.assign=function(d){for(var H=Array.prototype.slice.call(arguments,1);H.length;){var n=H.shift();if(!!n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(var D in n)R(n,D)&&(d[D]=n[D])}}return d},t.shrinkBuf=function(d,H){return d.length===H?d:d.subarray?d.subarray(0,H):(d.length=H,d)};var c={arraySet:function(d,H,n,D,j){if(H.subarray&&d.subarray){d.set(H.subarray(n,n+D),j);return}for(var z=0;z<D;z++)d[j+z]=H[n+z]},flattenChunks:function(d){var H,n,D,j,z,w;for(D=0,H=0,n=d.length;H<n;H++)D+=d[H].length;for(w=new Uint8Array(D),j=0,H=0,n=d.length;H<n;H++)z=d[H],w.set(z,j),j+=z.length;return w}},h={arraySet:function(d,H,n,D,j){for(var z=0;z<D;z++)d[j+z]=H[n+z]},flattenChunks:function(d){return[].concat.apply([],d)}};t.setTyped=function(d){d?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,c)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,h))},t.setTyped(o)}(common)),common}var deflate$1={},deflate={},trees={},hasRequiredTrees;function requireTrees(){if(hasRequiredTrees)return trees;hasRequiredTrees=1;var t=requireCommon(),o=4,R=0,c=1,h=2;function d(Fe){for(var ar=Fe.length;--ar>=0;)Fe[ar]=0}var H=0,n=1,D=2,j=3,z=258,w=29,q=256,re=q+1+w,ne=30,ie=19,Re=2*re+1,Te=15,$=16,L=7,ae=256,W=16,Pe=17,Ie=18,Ae=[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],de=[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],Ye=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Ue=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ye=512,rt=new Array((re+2)*2);d(rt);var St=new Array(ne*2);d(St);var Yt=new Array(ye);d(Yt);var Et=new Array(z-j+1);d(Et);var pt=new Array(w);d(pt);var Ht=new Array(ne);d(Ht);function rr(Fe,ar,ea,Ma,Ut){this.static_tree=Fe,this.extra_bits=ar,this.extra_base=ea,this.elems=Ma,this.max_length=Ut,this.has_stree=Fe&&Fe.length}var mr,na,cr;function yr(Fe,ar){this.dyn_tree=Fe,this.max_code=0,this.stat_desc=ar}function fa(Fe){return Fe<256?Yt[Fe]:Yt[256+(Fe>>>7)]}function $a(Fe,ar){Fe.pending_buf[Fe.pending++]=ar&255,Fe.pending_buf[Fe.pending++]=ar>>>8&255}function Ta(Fe,ar,ea){Fe.bi_valid>$-ea?(Fe.bi_buf|=ar<<Fe.bi_valid&65535,$a(Fe,Fe.bi_buf),Fe.bi_buf=ar>>$-Fe.bi_valid,Fe.bi_valid+=ea-$):(Fe.bi_buf|=ar<<Fe.bi_valid&65535,Fe.bi_valid+=ea)}function Sa(Fe,ar,ea){Ta(Fe,ea[ar*2],ea[ar*2+1])}function _r(Fe,ar){var ea=0;do ea|=Fe&1,Fe>>>=1,ea<<=1;while(--ar>0);return ea>>>1}function Qr(Fe){Fe.bi_valid===16?($a(Fe,Fe.bi_buf),Fe.bi_buf=0,Fe.bi_valid=0):Fe.bi_valid>=8&&(Fe.pending_buf[Fe.pending++]=Fe.bi_buf&255,Fe.bi_buf>>=8,Fe.bi_valid-=8)}function la(Fe,ar){var ea=ar.dyn_tree,Ma=ar.max_code,Ut=ar.stat_desc.static_tree,br=ar.stat_desc.has_stree,ze=ar.stat_desc.extra_bits,Pa=ar.stat_desc.extra_base,hn=ar.stat_desc.max_length,me,Dr,Lr,Ze,Bt,Hr,Mn=0;for(Ze=0;Ze<=Te;Ze++)Fe.bl_count[Ze]=0;for(ea[Fe.heap[Fe.heap_max]*2+1]=0,me=Fe.heap_max+1;me<Re;me++)Dr=Fe.heap[me],Ze=ea[ea[Dr*2+1]*2+1]+1,Ze>hn&&(Ze=hn,Mn++),ea[Dr*2+1]=Ze,!(Dr>Ma)&&(Fe.bl_count[Ze]++,Bt=0,Dr>=Pa&&(Bt=ze[Dr-Pa]),Hr=ea[Dr*2],Fe.opt_len+=Hr*(Ze+Bt),br&&(Fe.static_len+=Hr*(Ut[Dr*2+1]+Bt)));if(Mn!==0){do{for(Ze=hn-1;Fe.bl_count[Ze]===0;)Ze--;Fe.bl_count[Ze]--,Fe.bl_count[Ze+1]+=2,Fe.bl_count[hn]--,Mn-=2}while(Mn>0);for(Ze=hn;Ze!==0;Ze--)for(Dr=Fe.bl_count[Ze];Dr!==0;)Lr=Fe.heap[--me],!(Lr>Ma)&&(ea[Lr*2+1]!==Ze&&(Fe.opt_len+=(Ze-ea[Lr*2+1])*ea[Lr*2],ea[Lr*2+1]=Ze),Dr--)}}function Nn(Fe,ar,ea){var Ma=new Array(Te+1),Ut=0,br,ze;for(br=1;br<=Te;br++)Ma[br]=Ut=Ut+ea[br-1]<<1;for(ze=0;ze<=ar;ze++){var Pa=Fe[ze*2+1];Pa!==0&&(Fe[ze*2]=_r(Ma[Pa]++,Pa))}}function ma(){var Fe,ar,ea,Ma,Ut,br=new Array(Te+1);for(ea=0,Ma=0;Ma<w-1;Ma++)for(pt[Ma]=ea,Fe=0;Fe<1<<Ae[Ma];Fe++)Et[ea++]=Ma;for(Et[ea-1]=Ma,Ut=0,Ma=0;Ma<16;Ma++)for(Ht[Ma]=Ut,Fe=0;Fe<1<<de[Ma];Fe++)Yt[Ut++]=Ma;for(Ut>>=7;Ma<ne;Ma++)for(Ht[Ma]=Ut<<7,Fe=0;Fe<1<<de[Ma]-7;Fe++)Yt[256+Ut++]=Ma;for(ar=0;ar<=Te;ar++)br[ar]=0;for(Fe=0;Fe<=143;)rt[Fe*2+1]=8,Fe++,br[8]++;for(;Fe<=255;)rt[Fe*2+1]=9,Fe++,br[9]++;for(;Fe<=279;)rt[Fe*2+1]=7,Fe++,br[7]++;for(;Fe<=287;)rt[Fe*2+1]=8,Fe++,br[8]++;for(Nn(rt,re+1,br),Fe=0;Fe<ne;Fe++)St[Fe*2+1]=5,St[Fe*2]=_r(Fe,5);mr=new rr(rt,Ae,q+1,re,Te),na=new rr(St,de,0,ne,Te),cr=new rr(new Array(0),Ye,0,ie,L)}function va(Fe){var ar;for(ar=0;ar<re;ar++)Fe.dyn_ltree[ar*2]=0;for(ar=0;ar<ne;ar++)Fe.dyn_dtree[ar*2]=0;for(ar=0;ar<ie;ar++)Fe.bl_tree[ar*2]=0;Fe.dyn_ltree[ae*2]=1,Fe.opt_len=Fe.static_len=0,Fe.last_lit=Fe.matches=0}function Ya(Fe){Fe.bi_valid>8?$a(Fe,Fe.bi_buf):Fe.bi_valid>0&&(Fe.pending_buf[Fe.pending++]=Fe.bi_buf),Fe.bi_buf=0,Fe.bi_valid=0}function An(Fe,ar,ea,Ma){Ya(Fe),Ma&&($a(Fe,ea),$a(Fe,~ea)),t.arraySet(Fe.pending_buf,Fe.window,ar,ea,Fe.pending),Fe.pending+=ea}function En(Fe,ar,ea,Ma){var Ut=ar*2,br=ea*2;return Fe[Ut]<Fe[br]||Fe[Ut]===Fe[br]&&Ma[ar]<=Ma[ea]}function In(Fe,ar,ea){for(var Ma=Fe.heap[ea],Ut=ea<<1;Ut<=Fe.heap_len&&(Ut<Fe.heap_len&&En(ar,Fe.heap[Ut+1],Fe.heap[Ut],Fe.depth)&&Ut++,!En(ar,Ma,Fe.heap[Ut],Fe.depth));)Fe.heap[ea]=Fe.heap[Ut],ea=Ut,Ut<<=1;Fe.heap[ea]=Ma}function wa(Fe,ar,ea){var Ma,Ut,br=0,ze,Pa;if(Fe.last_lit!==0)do Ma=Fe.pending_buf[Fe.d_buf+br*2]<<8|Fe.pending_buf[Fe.d_buf+br*2+1],Ut=Fe.pending_buf[Fe.l_buf+br],br++,Ma===0?Sa(Fe,Ut,ar):(ze=Et[Ut],Sa(Fe,ze+q+1,ar),Pa=Ae[ze],Pa!==0&&(Ut-=pt[ze],Ta(Fe,Ut,Pa)),Ma--,ze=fa(Ma),Sa(Fe,ze,ea),Pa=de[ze],Pa!==0&&(Ma-=Ht[ze],Ta(Fe,Ma,Pa)));while(br<Fe.last_lit);Sa(Fe,ae,ar)}function _a(Fe,ar){var ea=ar.dyn_tree,Ma=ar.stat_desc.static_tree,Ut=ar.stat_desc.has_stree,br=ar.stat_desc.elems,ze,Pa,hn=-1,me;for(Fe.heap_len=0,Fe.heap_max=Re,ze=0;ze<br;ze++)ea[ze*2]!==0?(Fe.heap[++Fe.heap_len]=hn=ze,Fe.depth[ze]=0):ea[ze*2+1]=0;for(;Fe.heap_len<2;)me=Fe.heap[++Fe.heap_len]=hn<2?++hn:0,ea[me*2]=1,Fe.depth[me]=0,Fe.opt_len--,Ut&&(Fe.static_len-=Ma[me*2+1]);for(ar.max_code=hn,ze=Fe.heap_len>>1;ze>=1;ze--)In(Fe,ea,ze);me=br;do ze=Fe.heap[1],Fe.heap[1]=Fe.heap[Fe.heap_len--],In(Fe,ea,1),Pa=Fe.heap[1],Fe.heap[--Fe.heap_max]=ze,Fe.heap[--Fe.heap_max]=Pa,ea[me*2]=ea[ze*2]+ea[Pa*2],Fe.depth[me]=(Fe.depth[ze]>=Fe.depth[Pa]?Fe.depth[ze]:Fe.depth[Pa])+1,ea[ze*2+1]=ea[Pa*2+1]=me,Fe.heap[1]=me++,In(Fe,ea,1);while(Fe.heap_len>=2);Fe.heap[--Fe.heap_max]=Fe.heap[1],la(Fe,ar),Nn(ea,hn,Fe.bl_count)}function pa(Fe,ar,ea){var Ma,Ut=-1,br,ze=ar[0*2+1],Pa=0,hn=7,me=4;for(ze===0&&(hn=138,me=3),ar[(ea+1)*2+1]=65535,Ma=0;Ma<=ea;Ma++)br=ze,ze=ar[(Ma+1)*2+1],!(++Pa<hn&&br===ze)&&(Pa<me?Fe.bl_tree[br*2]+=Pa:br!==0?(br!==Ut&&Fe.bl_tree[br*2]++,Fe.bl_tree[W*2]++):Pa<=10?Fe.bl_tree[Pe*2]++:Fe.bl_tree[Ie*2]++,Pa=0,Ut=br,ze===0?(hn=138,me=3):br===ze?(hn=6,me=3):(hn=7,me=4))}function Zn(Fe,ar,ea){var Ma,Ut=-1,br,ze=ar[0*2+1],Pa=0,hn=7,me=4;for(ze===0&&(hn=138,me=3),Ma=0;Ma<=ea;Ma++)if(br=ze,ze=ar[(Ma+1)*2+1],!(++Pa<hn&&br===ze)){if(Pa<me)do Sa(Fe,br,Fe.bl_tree);while(--Pa!==0);else br!==0?(br!==Ut&&(Sa(Fe,br,Fe.bl_tree),Pa--),Sa(Fe,W,Fe.bl_tree),Ta(Fe,Pa-3,2)):Pa<=10?(Sa(Fe,Pe,Fe.bl_tree),Ta(Fe,Pa-3,3)):(Sa(Fe,Ie,Fe.bl_tree),Ta(Fe,Pa-11,7));Pa=0,Ut=br,ze===0?(hn=138,me=3):br===ze?(hn=6,me=3):(hn=7,me=4)}}function yn(Fe){var ar;for(pa(Fe,Fe.dyn_ltree,Fe.l_desc.max_code),pa(Fe,Fe.dyn_dtree,Fe.d_desc.max_code),_a(Fe,Fe.bl_desc),ar=ie-1;ar>=3&&Fe.bl_tree[Ue[ar]*2+1]===0;ar--);return Fe.opt_len+=3*(ar+1)+5+5+4,ar}function pe(Fe,ar,ea,Ma){var Ut;for(Ta(Fe,ar-257,5),Ta(Fe,ea-1,5),Ta(Fe,Ma-4,4),Ut=0;Ut<Ma;Ut++)Ta(Fe,Fe.bl_tree[Ue[Ut]*2+1],3);Zn(Fe,Fe.dyn_ltree,ar-1),Zn(Fe,Fe.dyn_dtree,ea-1)}function $t(Fe){var ar=4093624447,ea;for(ea=0;ea<=31;ea++,ar>>>=1)if(ar&1&&Fe.dyn_ltree[ea*2]!==0)return R;if(Fe.dyn_ltree[9*2]!==0||Fe.dyn_ltree[10*2]!==0||Fe.dyn_ltree[13*2]!==0)return c;for(ea=32;ea<q;ea++)if(Fe.dyn_ltree[ea*2]!==0)return c;return R}var or=!1;function wr(Fe){or||(ma(),or=!0),Fe.l_desc=new yr(Fe.dyn_ltree,mr),Fe.d_desc=new yr(Fe.dyn_dtree,na),Fe.bl_desc=new yr(Fe.bl_tree,cr),Fe.bi_buf=0,Fe.bi_valid=0,va(Fe)}function Xr(Fe,ar,ea,Ma){Ta(Fe,(H<<1)+(Ma?1:0),3),An(Fe,ar,ea,!0)}function Mr(Fe){Ta(Fe,n<<1,3),Sa(Fe,ae,rt),Qr(Fe)}function za(Fe,ar,ea,Ma){var Ut,br,ze=0;Fe.level>0?(Fe.strm.data_type===h&&(Fe.strm.data_type=$t(Fe)),_a(Fe,Fe.l_desc),_a(Fe,Fe.d_desc),ze=yn(Fe),Ut=Fe.opt_len+3+7>>>3,br=Fe.static_len+3+7>>>3,br<=Ut&&(Ut=br)):Ut=br=ea+5,ea+4<=Ut&&ar!==-1?Xr(Fe,ar,ea,Ma):Fe.strategy===o||br===Ut?(Ta(Fe,(n<<1)+(Ma?1:0),3),wa(Fe,rt,St)):(Ta(Fe,(D<<1)+(Ma?1:0),3),pe(Fe,Fe.l_desc.max_code+1,Fe.d_desc.max_code+1,ze+1),wa(Fe,Fe.dyn_ltree,Fe.dyn_dtree)),va(Fe),Ma&&Ya(Fe)}function Ha(Fe,ar,ea){return Fe.pending_buf[Fe.d_buf+Fe.last_lit*2]=ar>>>8&255,Fe.pending_buf[Fe.d_buf+Fe.last_lit*2+1]=ar&255,Fe.pending_buf[Fe.l_buf+Fe.last_lit]=ea&255,Fe.last_lit++,ar===0?Fe.dyn_ltree[ea*2]++:(Fe.matches++,ar--,Fe.dyn_ltree[(Et[ea]+q+1)*2]++,Fe.dyn_dtree[fa(ar)*2]++),Fe.last_lit===Fe.lit_bufsize-1}return trees._tr_init=wr,trees._tr_stored_block=Xr,trees._tr_flush_block=za,trees._tr_tally=Ha,trees._tr_align=Mr,trees}var adler32_1,hasRequiredAdler32;function requireAdler32(){if(hasRequiredAdler32)return adler32_1;hasRequiredAdler32=1;function t(o,R,c,h){for(var d=o&65535|0,H=o>>>16&65535|0,n=0;c!==0;){n=c>2e3?2e3:c,c-=n;do d=d+R[h++]|0,H=H+d|0;while(--n);d%=65521,H%=65521}return d|H<<16|0}return adler32_1=t,adler32_1}var crc32_1,hasRequiredCrc32;function requireCrc32(){if(hasRequiredCrc32)return crc32_1;hasRequiredCrc32=1;function t(){for(var c,h=[],d=0;d<256;d++){c=d;for(var H=0;H<8;H++)c=c&1?3988292384^c>>>1:c>>>1;h[d]=c}return h}var o=t();function R(c,h,d,H){var n=o,D=H+d;c^=-1;for(var j=H;j<D;j++)c=c>>>8^n[(c^h[j])&255];return c^-1}return crc32_1=R,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 t=requireCommon(),o=requireTrees(),R=requireAdler32(),c=requireCrc32(),h=requireMessages(),d=0,H=1,n=3,D=4,j=5,z=0,w=1,q=-2,re=-3,ne=-5,ie=-1,Re=1,Te=2,$=3,L=4,ae=0,W=2,Pe=8,Ie=9,Ae=15,de=8,Ye=29,Ue=256,ye=Ue+1+Ye,rt=30,St=19,Yt=2*ye+1,Et=15,pt=3,Ht=258,rr=Ht+pt+1,mr=32,na=42,cr=69,yr=73,fa=91,$a=103,Ta=113,Sa=666,_r=1,Qr=2,la=3,Nn=4,ma=3;function va(me,Dr){return me.msg=h[Dr],Dr}function Ya(me){return(me<<1)-(me>4?9:0)}function An(me){for(var Dr=me.length;--Dr>=0;)me[Dr]=0}function En(me){var Dr=me.state,Lr=Dr.pending;Lr>me.avail_out&&(Lr=me.avail_out),Lr!==0&&(t.arraySet(me.output,Dr.pending_buf,Dr.pending_out,Lr,me.next_out),me.next_out+=Lr,Dr.pending_out+=Lr,me.total_out+=Lr,me.avail_out-=Lr,Dr.pending-=Lr,Dr.pending===0&&(Dr.pending_out=0))}function In(me,Dr){o._tr_flush_block(me,me.block_start>=0?me.block_start:-1,me.strstart-me.block_start,Dr),me.block_start=me.strstart,En(me.strm)}function wa(me,Dr){me.pending_buf[me.pending++]=Dr}function _a(me,Dr){me.pending_buf[me.pending++]=Dr>>>8&255,me.pending_buf[me.pending++]=Dr&255}function pa(me,Dr,Lr,Ze){var Bt=me.avail_in;return Bt>Ze&&(Bt=Ze),Bt===0?0:(me.avail_in-=Bt,t.arraySet(Dr,me.input,me.next_in,Bt,Lr),me.state.wrap===1?me.adler=R(me.adler,Dr,Bt,Lr):me.state.wrap===2&&(me.adler=c(me.adler,Dr,Bt,Lr)),me.next_in+=Bt,me.total_in+=Bt,Bt)}function Zn(me,Dr){var Lr=me.max_chain_length,Ze=me.strstart,Bt,Hr,Mn=me.prev_length,ja=me.nice_match,Pn=me.strstart>me.w_size-rr?me.strstart-(me.w_size-rr):0,ii=me.window,MT=me.w_mask,Hi=me.prev,$n=me.strstart+Ht,Qi=ii[Ze+Mn-1],R0=ii[Ze+Mn];me.prev_length>=me.good_match&&(Lr>>=2),ja>me.lookahead&&(ja=me.lookahead);do if(Bt=Dr,!(ii[Bt+Mn]!==R0||ii[Bt+Mn-1]!==Qi||ii[Bt]!==ii[Ze]||ii[++Bt]!==ii[Ze+1])){Ze+=2,Bt++;do;while(ii[++Ze]===ii[++Bt]&&ii[++Ze]===ii[++Bt]&&ii[++Ze]===ii[++Bt]&&ii[++Ze]===ii[++Bt]&&ii[++Ze]===ii[++Bt]&&ii[++Ze]===ii[++Bt]&&ii[++Ze]===ii[++Bt]&&ii[++Ze]===ii[++Bt]&&Ze<$n);if(Hr=Ht-($n-Ze),Ze=$n-Ht,Hr>Mn){if(me.match_start=Dr,Mn=Hr,Hr>=ja)break;Qi=ii[Ze+Mn-1],R0=ii[Ze+Mn]}}while((Dr=Hi[Dr&MT])>Pn&&--Lr!==0);return Mn<=me.lookahead?Mn:me.lookahead}function yn(me){var Dr=me.w_size,Lr,Ze,Bt,Hr,Mn;do{if(Hr=me.window_size-me.lookahead-me.strstart,me.strstart>=Dr+(Dr-rr)){t.arraySet(me.window,me.window,Dr,Dr,0),me.match_start-=Dr,me.strstart-=Dr,me.block_start-=Dr,Ze=me.hash_size,Lr=Ze;do Bt=me.head[--Lr],me.head[Lr]=Bt>=Dr?Bt-Dr:0;while(--Ze);Ze=Dr,Lr=Ze;do Bt=me.prev[--Lr],me.prev[Lr]=Bt>=Dr?Bt-Dr:0;while(--Ze);Hr+=Dr}if(me.strm.avail_in===0)break;if(Ze=pa(me.strm,me.window,me.strstart+me.lookahead,Hr),me.lookahead+=Ze,me.lookahead+me.insert>=pt)for(Mn=me.strstart-me.insert,me.ins_h=me.window[Mn],me.ins_h=(me.ins_h<<me.hash_shift^me.window[Mn+1])&me.hash_mask;me.insert&&(me.ins_h=(me.ins_h<<me.hash_shift^me.window[Mn+pt-1])&me.hash_mask,me.prev[Mn&me.w_mask]=me.head[me.ins_h],me.head[me.ins_h]=Mn,Mn++,me.insert--,!(me.lookahead+me.insert<pt)););}while(me.lookahead<rr&&me.strm.avail_in!==0)}function pe(me,Dr){var Lr=65535;for(Lr>me.pending_buf_size-5&&(Lr=me.pending_buf_size-5);;){if(me.lookahead<=1){if(yn(me),me.lookahead===0&&Dr===d)return _r;if(me.lookahead===0)break}me.strstart+=me.lookahead,me.lookahead=0;var Ze=me.block_start+Lr;if((me.strstart===0||me.strstart>=Ze)&&(me.lookahead=me.strstart-Ze,me.strstart=Ze,In(me,!1),me.strm.avail_out===0)||me.strstart-me.block_start>=me.w_size-rr&&(In(me,!1),me.strm.avail_out===0))return _r}return me.insert=0,Dr===D?(In(me,!0),me.strm.avail_out===0?la:Nn):(me.strstart>me.block_start&&(In(me,!1),me.strm.avail_out===0),_r)}function $t(me,Dr){for(var Lr,Ze;;){if(me.lookahead<rr){if(yn(me),me.lookahead<rr&&Dr===d)return _r;if(me.lookahead===0)break}if(Lr=0,me.lookahead>=pt&&(me.ins_h=(me.ins_h<<me.hash_shift^me.window[me.strstart+pt-1])&me.hash_mask,Lr=me.prev[me.strstart&me.w_mask]=me.head[me.ins_h],me.head[me.ins_h]=me.strstart),Lr!==0&&me.strstart-Lr<=me.w_size-rr&&(me.match_length=Zn(me,Lr)),me.match_length>=pt)if(Ze=o._tr_tally(me,me.strstart-me.match_start,me.match_length-pt),me.lookahead-=me.match_length,me.match_length<=me.max_lazy_match&&me.lookahead>=pt){me.match_length--;do me.strstart++,me.ins_h=(me.ins_h<<me.hash_shift^me.window[me.strstart+pt-1])&me.hash_mask,Lr=me.prev[me.strstart&me.w_mask]=me.head[me.ins_h],me.head[me.ins_h]=me.strstart;while(--me.match_length!==0);me.strstart++}else me.strstart+=me.match_length,me.match_length=0,me.ins_h=me.window[me.strstart],me.ins_h=(me.ins_h<<me.hash_shift^me.window[me.strstart+1])&me.hash_mask;else Ze=o._tr_tally(me,0,me.window[me.strstart]),me.lookahead--,me.strstart++;if(Ze&&(In(me,!1),me.strm.avail_out===0))return _r}return me.insert=me.strstart<pt-1?me.strstart:pt-1,Dr===D?(In(me,!0),me.strm.avail_out===0?la:Nn):me.last_lit&&(In(me,!1),me.strm.avail_out===0)?_r:Qr}function or(me,Dr){for(var Lr,Ze,Bt;;){if(me.lookahead<rr){if(yn(me),me.lookahead<rr&&Dr===d)return _r;if(me.lookahead===0)break}if(Lr=0,me.lookahead>=pt&&(me.ins_h=(me.ins_h<<me.hash_shift^me.window[me.strstart+pt-1])&me.hash_mask,Lr=me.prev[me.strstart&me.w_mask]=me.head[me.ins_h],me.head[me.ins_h]=me.strstart),me.prev_length=me.match_length,me.prev_match=me.match_start,me.match_length=pt-1,Lr!==0&&me.prev_length<me.max_lazy_match&&me.strstart-Lr<=me.w_size-rr&&(me.match_length=Zn(me,Lr),me.match_length<=5&&(me.strategy===Re||me.match_length===pt&&me.strstart-me.match_start>4096)&&(me.match_length=pt-1)),me.prev_length>=pt&&me.match_length<=me.prev_length){Bt=me.strstart+me.lookahead-pt,Ze=o._tr_tally(me,me.strstart-1-me.prev_match,me.prev_length-pt),me.lookahead-=me.prev_length-1,me.prev_length-=2;do++me.strstart<=Bt&&(me.ins_h=(me.ins_h<<me.hash_shift^me.window[me.strstart+pt-1])&me.hash_mask,Lr=me.prev[me.strstart&me.w_mask]=me.head[me.ins_h],me.head[me.ins_h]=me.strstart);while(--me.prev_length!==0);if(me.match_available=0,me.match_length=pt-1,me.strstart++,Ze&&(In(me,!1),me.strm.avail_out===0))return _r}else if(me.match_available){if(Ze=o._tr_tally(me,0,me.window[me.strstart-1]),Ze&&In(me,!1),me.strstart++,me.lookahead--,me.strm.avail_out===0)return _r}else me.match_available=1,me.strstart++,me.lookahead--}return me.match_available&&(Ze=o._tr_tally(me,0,me.window[me.strstart-1]),me.match_available=0),me.insert=me.strstart<pt-1?me.strstart:pt-1,Dr===D?(In(me,!0),me.strm.avail_out===0?la:Nn):me.last_lit&&(In(me,!1),me.strm.avail_out===0)?_r:Qr}function wr(me,Dr){for(var Lr,Ze,Bt,Hr,Mn=me.window;;){if(me.lookahead<=Ht){if(yn(me),me.lookahead<=Ht&&Dr===d)return _r;if(me.lookahead===0)break}if(me.match_length=0,me.lookahead>=pt&&me.strstart>0&&(Bt=me.strstart-1,Ze=Mn[Bt],Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Ze===Mn[++Bt])){Hr=me.strstart+Ht;do;while(Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Bt<Hr);me.match_length=Ht-(Hr-Bt),me.match_length>me.lookahead&&(me.match_length=me.lookahead)}if(me.match_length>=pt?(Lr=o._tr_tally(me,1,me.match_length-pt),me.lookahead-=me.match_length,me.strstart+=me.match_length,me.match_length=0):(Lr=o._tr_tally(me,0,me.window[me.strstart]),me.lookahead--,me.strstart++),Lr&&(In(me,!1),me.strm.avail_out===0))return _r}return me.insert=0,Dr===D?(In(me,!0),me.strm.avail_out===0?la:Nn):me.last_lit&&(In(me,!1),me.strm.avail_out===0)?_r:Qr}function Xr(me,Dr){for(var Lr;;){if(me.lookahead===0&&(yn(me),me.lookahead===0)){if(Dr===d)return _r;break}if(me.match_length=0,Lr=o._tr_tally(me,0,me.window[me.strstart]),me.lookahead--,me.strstart++,Lr&&(In(me,!1),me.strm.avail_out===0))return _r}return me.insert=0,Dr===D?(In(me,!0),me.strm.avail_out===0?la:Nn):me.last_lit&&(In(me,!1),me.strm.avail_out===0)?_r:Qr}function Mr(me,Dr,Lr,Ze,Bt){this.good_length=me,this.max_lazy=Dr,this.nice_length=Lr,this.max_chain=Ze,this.func=Bt}var za;za=[new Mr(0,0,0,0,pe),new Mr(4,4,8,4,$t),new Mr(4,5,16,8,$t),new Mr(4,6,32,32,$t),new Mr(4,4,16,16,or),new Mr(8,16,32,32,or),new Mr(8,16,128,128,or),new Mr(8,32,128,256,or),new Mr(32,128,258,1024,or),new Mr(32,258,258,4096,or)];function Ha(me){me.window_size=2*me.w_size,An(me.head),me.max_lazy_match=za[me.level].max_lazy,me.good_match=za[me.level].good_length,me.nice_match=za[me.level].nice_length,me.max_chain_length=za[me.level].max_chain,me.strstart=0,me.block_start=0,me.lookahead=0,me.insert=0,me.match_length=me.prev_length=pt-1,me.match_available=0,me.ins_h=0}function Fe(){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=Pe,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 t.Buf16(Yt*2),this.dyn_dtree=new t.Buf16((2*rt+1)*2),this.bl_tree=new t.Buf16((2*St+1)*2),An(this.dyn_ltree),An(this.dyn_dtree),An(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(Et+1),this.heap=new t.Buf16(2*ye+1),An(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*ye+1),An(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 ar(me){var Dr;return!me||!me.state?va(me,q):(me.total_in=me.total_out=0,me.data_type=W,Dr=me.state,Dr.pending=0,Dr.pending_out=0,Dr.wrap<0&&(Dr.wrap=-Dr.wrap),Dr.status=Dr.wrap?na:Ta,me.adler=Dr.wrap===2?0:1,Dr.last_flush=d,o._tr_init(Dr),z)}function ea(me){var Dr=ar(me);return Dr===z&&Ha(me.state),Dr}function Ma(me,Dr){return!me||!me.state||me.state.wrap!==2?q:(me.state.gzhead=Dr,z)}function Ut(me,Dr,Lr,Ze,Bt,Hr){if(!me)return q;var Mn=1;if(Dr===ie&&(Dr=6),Ze<0?(Mn=0,Ze=-Ze):Ze>15&&(Mn=2,Ze-=16),Bt<1||Bt>Ie||Lr!==Pe||Ze<8||Ze>15||Dr<0||Dr>9||Hr<0||Hr>L)return va(me,q);Ze===8&&(Ze=9);var ja=new Fe;return me.state=ja,ja.strm=me,ja.wrap=Mn,ja.gzhead=null,ja.w_bits=Ze,ja.w_size=1<<ja.w_bits,ja.w_mask=ja.w_size-1,ja.hash_bits=Bt+7,ja.hash_size=1<<ja.hash_bits,ja.hash_mask=ja.hash_size-1,ja.hash_shift=~~((ja.hash_bits+pt-1)/pt),ja.window=new t.Buf8(ja.w_size*2),ja.head=new t.Buf16(ja.hash_size),ja.prev=new t.Buf16(ja.w_size),ja.lit_bufsize=1<<Bt+6,ja.pending_buf_size=ja.lit_bufsize*4,ja.pending_buf=new t.Buf8(ja.pending_buf_size),ja.d_buf=1*ja.lit_bufsize,ja.l_buf=(1+2)*ja.lit_bufsize,ja.level=Dr,ja.strategy=Hr,ja.method=Lr,ea(me)}function br(me,Dr){return Ut(me,Dr,Pe,Ae,de,ae)}function ze(me,Dr){var Lr,Ze,Bt,Hr;if(!me||!me.state||Dr>j||Dr<0)return me?va(me,q):q;if(Ze=me.state,!me.output||!me.input&&me.avail_in!==0||Ze.status===Sa&&Dr!==D)return va(me,me.avail_out===0?ne:q);if(Ze.strm=me,Lr=Ze.last_flush,Ze.last_flush=Dr,Ze.status===na)if(Ze.wrap===2)me.adler=0,wa(Ze,31),wa(Ze,139),wa(Ze,8),Ze.gzhead?(wa(Ze,(Ze.gzhead.text?1:0)+(Ze.gzhead.hcrc?2:0)+(Ze.gzhead.extra?4:0)+(Ze.gzhead.name?8:0)+(Ze.gzhead.comment?16:0)),wa(Ze,Ze.gzhead.time&255),wa(Ze,Ze.gzhead.time>>8&255),wa(Ze,Ze.gzhead.time>>16&255),wa(Ze,Ze.gzhead.time>>24&255),wa(Ze,Ze.level===9?2:Ze.strategy>=Te||Ze.level<2?4:0),wa(Ze,Ze.gzhead.os&255),Ze.gzhead.extra&&Ze.gzhead.extra.length&&(wa(Ze,Ze.gzhead.extra.length&255),wa(Ze,Ze.gzhead.extra.length>>8&255)),Ze.gzhead.hcrc&&(me.adler=c(me.adler,Ze.pending_buf,Ze.pending,0)),Ze.gzindex=0,Ze.status=cr):(wa(Ze,0),wa(Ze,0),wa(Ze,0),wa(Ze,0),wa(Ze,0),wa(Ze,Ze.level===9?2:Ze.strategy>=Te||Ze.level<2?4:0),wa(Ze,ma),Ze.status=Ta);else{var Mn=Pe+(Ze.w_bits-8<<4)<<8,ja=-1;Ze.strategy>=Te||Ze.level<2?ja=0:Ze.level<6?ja=1:Ze.level===6?ja=2:ja=3,Mn|=ja<<6,Ze.strstart!==0&&(Mn|=mr),Mn+=31-Mn%31,Ze.status=Ta,_a(Ze,Mn),Ze.strstart!==0&&(_a(Ze,me.adler>>>16),_a(Ze,me.adler&65535)),me.adler=1}if(Ze.status===cr)if(Ze.gzhead.extra){for(Bt=Ze.pending;Ze.gzindex<(Ze.gzhead.extra.length&65535)&&!(Ze.pending===Ze.pending_buf_size&&(Ze.gzhead.hcrc&&Ze.pending>Bt&&(me.adler=c(me.adler,Ze.pending_buf,Ze.pending-Bt,Bt)),En(me),Bt=Ze.pending,Ze.pending===Ze.pending_buf_size));)wa(Ze,Ze.gzhead.extra[Ze.gzindex]&255),Ze.gzindex++;Ze.gzhead.hcrc&&Ze.pending>Bt&&(me.adler=c(me.adler,Ze.pending_buf,Ze.pending-Bt,Bt)),Ze.gzindex===Ze.gzhead.extra.length&&(Ze.gzindex=0,Ze.status=yr)}else Ze.status=yr;if(Ze.status===yr)if(Ze.gzhead.name){Bt=Ze.pending;do{if(Ze.pending===Ze.pending_buf_size&&(Ze.gzhead.hcrc&&Ze.pending>Bt&&(me.adler=c(me.adler,Ze.pending_buf,Ze.pending-Bt,Bt)),En(me),Bt=Ze.pending,Ze.pending===Ze.pending_buf_size)){Hr=1;break}Ze.gzindex<Ze.gzhead.name.length?Hr=Ze.gzhead.name.charCodeAt(Ze.gzindex++)&255:Hr=0,wa(Ze,Hr)}while(Hr!==0);Ze.gzhead.hcrc&&Ze.pending>Bt&&(me.adler=c(me.adler,Ze.pending_buf,Ze.pending-Bt,Bt)),Hr===0&&(Ze.gzindex=0,Ze.status=fa)}else Ze.status=fa;if(Ze.status===fa)if(Ze.gzhead.comment){Bt=Ze.pending;do{if(Ze.pending===Ze.pending_buf_size&&(Ze.gzhead.hcrc&&Ze.pending>Bt&&(me.adler=c(me.adler,Ze.pending_buf,Ze.pending-Bt,Bt)),En(me),Bt=Ze.pending,Ze.pending===Ze.pending_buf_size)){Hr=1;break}Ze.gzindex<Ze.gzhead.comment.length?Hr=Ze.gzhead.comment.charCodeAt(Ze.gzindex++)&255:Hr=0,wa(Ze,Hr)}while(Hr!==0);Ze.gzhead.hcrc&&Ze.pending>Bt&&(me.adler=c(me.adler,Ze.pending_buf,Ze.pending-Bt,Bt)),Hr===0&&(Ze.status=$a)}else Ze.status=$a;if(Ze.status===$a&&(Ze.gzhead.hcrc?(Ze.pending+2>Ze.pending_buf_size&&En(me),Ze.pending+2<=Ze.pending_buf_size&&(wa(Ze,me.adler&255),wa(Ze,me.adler>>8&255),me.adler=0,Ze.status=Ta)):Ze.status=Ta),Ze.pending!==0){if(En(me),me.avail_out===0)return Ze.last_flush=-1,z}else if(me.avail_in===0&&Ya(Dr)<=Ya(Lr)&&Dr!==D)return va(me,ne);if(Ze.status===Sa&&me.avail_in!==0)return va(me,ne);if(me.avail_in!==0||Ze.lookahead!==0||Dr!==d&&Ze.status!==Sa){var Pn=Ze.strategy===Te?Xr(Ze,Dr):Ze.strategy===$?wr(Ze,Dr):za[Ze.level].func(Ze,Dr);if((Pn===la||Pn===Nn)&&(Ze.status=Sa),Pn===_r||Pn===la)return me.avail_out===0&&(Ze.last_flush=-1),z;if(Pn===Qr&&(Dr===H?o._tr_align(Ze):Dr!==j&&(o._tr_stored_block(Ze,0,0,!1),Dr===n&&(An(Ze.head),Ze.lookahead===0&&(Ze.strstart=0,Ze.block_start=0,Ze.insert=0))),En(me),me.avail_out===0))return Ze.last_flush=-1,z}return Dr!==D?z:Ze.wrap<=0?w:(Ze.wrap===2?(wa(Ze,me.adler&255),wa(Ze,me.adler>>8&255),wa(Ze,me.adler>>16&255),wa(Ze,me.adler>>24&255),wa(Ze,me.total_in&255),wa(Ze,me.total_in>>8&255),wa(Ze,me.total_in>>16&255),wa(Ze,me.total_in>>24&255)):(_a(Ze,me.adler>>>16),_a(Ze,me.adler&65535)),En(me),Ze.wrap>0&&(Ze.wrap=-Ze.wrap),Ze.pending!==0?z:w)}function Pa(me){var Dr;return!me||!me.state?q:(Dr=me.state.status,Dr!==na&&Dr!==cr&&Dr!==yr&&Dr!==fa&&Dr!==$a&&Dr!==Ta&&Dr!==Sa?va(me,q):(me.state=null,Dr===Ta?va(me,re):z))}function hn(me,Dr){var Lr=Dr.length,Ze,Bt,Hr,Mn,ja,Pn,ii,MT;if(!me||!me.state||(Ze=me.state,Mn=Ze.wrap,Mn===2||Mn===1&&Ze.status!==na||Ze.lookahead))return q;for(Mn===1&&(me.adler=R(me.adler,Dr,Lr,0)),Ze.wrap=0,Lr>=Ze.w_size&&(Mn===0&&(An(Ze.head),Ze.strstart=0,Ze.block_start=0,Ze.insert=0),MT=new t.Buf8(Ze.w_size),t.arraySet(MT,Dr,Lr-Ze.w_size,Ze.w_size,0),Dr=MT,Lr=Ze.w_size),ja=me.avail_in,Pn=me.next_in,ii=me.input,me.avail_in=Lr,me.next_in=0,me.input=Dr,yn(Ze);Ze.lookahead>=pt;){Bt=Ze.strstart,Hr=Ze.lookahead-(pt-1);do Ze.ins_h=(Ze.ins_h<<Ze.hash_shift^Ze.window[Bt+pt-1])&Ze.hash_mask,Ze.prev[Bt&Ze.w_mask]=Ze.head[Ze.ins_h],Ze.head[Ze.ins_h]=Bt,Bt++;while(--Hr);Ze.strstart=Bt,Ze.lookahead=pt-1,yn(Ze)}return Ze.strstart+=Ze.lookahead,Ze.block_start=Ze.strstart,Ze.insert=Ze.lookahead,Ze.lookahead=0,Ze.match_length=Ze.prev_length=pt-1,Ze.match_available=0,me.next_in=Pn,me.input=ii,me.avail_in=ja,Ze.wrap=Mn,z}return deflate.deflateInit=br,deflate.deflateInit2=Ut,deflate.deflateReset=ea,deflate.deflateResetKeep=ar,deflate.deflateSetHeader=Ma,deflate.deflate=ze,deflate.deflateEnd=Pa,deflate.deflateSetDictionary=hn,deflate.deflateInfo="pako deflate (from Nodeca project)",deflate}var strings={},hasRequiredStrings;function requireStrings(){if(hasRequiredStrings)return strings;hasRequiredStrings=1;var t=requireCommon(),o=!0,R=!0;try{String.fromCharCode.apply(null,[0])}catch(H){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(H){R=!1}for(var c=new t.Buf8(256),h=0;h<256;h++)c[h]=h>=252?6:h>=248?5:h>=240?4:h>=224?3:h>=192?2:1;c[254]=c[254]=1,strings.string2buf=function(H){var n,D,j,z,w,q=H.length,re=0;for(z=0;z<q;z++)D=H.charCodeAt(z),(D&64512)===55296&&z+1<q&&(j=H.charCodeAt(z+1),(j&64512)===56320&&(D=65536+(D-55296<<10)+(j-56320),z++)),re+=D<128?1:D<2048?2:D<65536?3:4;for(n=new t.Buf8(re),w=0,z=0;w<re;z++)D=H.charCodeAt(z),(D&64512)===55296&&z+1<q&&(j=H.charCodeAt(z+1),(j&64512)===56320&&(D=65536+(D-55296<<10)+(j-56320),z++)),D<128?n[w++]=D:D<2048?(n[w++]=192|D>>>6,n[w++]=128|D&63):D<65536?(n[w++]=224|D>>>12,n[w++]=128|D>>>6&63,n[w++]=128|D&63):(n[w++]=240|D>>>18,n[w++]=128|D>>>12&63,n[w++]=128|D>>>6&63,n[w++]=128|D&63);return n};function d(H,n){if(n<65534&&(H.subarray&&R||!H.subarray&&o))return String.fromCharCode.apply(null,t.shrinkBuf(H,n));for(var D="",j=0;j<n;j++)D+=String.fromCharCode(H[j]);return D}return strings.buf2binstring=function(H){return d(H,H.length)},strings.binstring2buf=function(H){for(var n=new t.Buf8(H.length),D=0,j=n.length;D<j;D++)n[D]=H.charCodeAt(D);return n},strings.buf2string=function(H,n){var D,j,z,w,q=n||H.length,re=new Array(q*2);for(j=0,D=0;D<q;){if(z=H[D++],z<128){re[j++]=z;continue}if(w=c[z],w>4){re[j++]=65533,D+=w-1;continue}for(z&=w===2?31:w===3?15:7;w>1&&D<q;)z=z<<6|H[D++]&63,w--;if(w>1){re[j++]=65533;continue}z<65536?re[j++]=z:(z-=65536,re[j++]=55296|z>>10&1023,re[j++]=56320|z&1023)}return d(re,j)},strings.utf8border=function(H,n){var D;for(n=n||H.length,n>H.length&&(n=H.length),D=n-1;D>=0&&(H[D]&192)===128;)D--;return D<0||D===0?n:D+c[H[D]]>n?D:n},strings}var zstream,hasRequiredZstream;function requireZstream(){if(hasRequiredZstream)return zstream;hasRequiredZstream=1;function t(){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=t,zstream}var hasRequiredDeflate;function requireDeflate(){if(hasRequiredDeflate)return deflate$1;hasRequiredDeflate=1;var t=requireDeflate$1(),o=requireCommon(),R=requireStrings(),c=requireMessages(),h=requireZstream(),d=Object.prototype.toString,H=0,n=4,D=0,j=1,z=2,w=-1,q=0,re=8;function ne($){if(!(this instanceof ne))return new ne($);this.options=o.assign({level:w,method:re,chunkSize:16384,windowBits:15,memLevel:8,strategy:q,to:""},$||{});var L=this.options;L.raw&&L.windowBits>0?L.windowBits=-L.windowBits:L.gzip&&L.windowBits>0&&L.windowBits<16&&(L.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var ae=t.deflateInit2(this.strm,L.level,L.method,L.windowBits,L.memLevel,L.strategy);if(ae!==D)throw new Error(c[ae]);if(L.header&&t.deflateSetHeader(this.strm,L.header),L.dictionary){var W;if(typeof L.dictionary=="string"?W=R.string2buf(L.dictionary):d.call(L.dictionary)==="[object ArrayBuffer]"?W=new Uint8Array(L.dictionary):W=L.dictionary,ae=t.deflateSetDictionary(this.strm,W),ae!==D)throw new Error(c[ae]);this._dict_set=!0}}ne.prototype.push=function($,L){var ae=this.strm,W=this.options.chunkSize,Pe,Ie;if(this.ended)return!1;Ie=L===~~L?L:L===!0?n:H,typeof $=="string"?ae.input=R.string2buf($):d.call($)==="[object ArrayBuffer]"?ae.input=new Uint8Array($):ae.input=$,ae.next_in=0,ae.avail_in=ae.input.length;do{if(ae.avail_out===0&&(ae.output=new o.Buf8(W),ae.next_out=0,ae.avail_out=W),Pe=t.deflate(ae,Ie),Pe!==j&&Pe!==D)return this.onEnd(Pe),this.ended=!0,!1;(ae.avail_out===0||ae.avail_in===0&&(Ie===n||Ie===z))&&(this.options.to==="string"?this.onData(R.buf2binstring(o.shrinkBuf(ae.output,ae.next_out))):this.onData(o.shrinkBuf(ae.output,ae.next_out)))}while((ae.avail_in>0||ae.avail_out===0)&&Pe!==j);return Ie===n?(Pe=t.deflateEnd(this.strm),this.onEnd(Pe),this.ended=!0,Pe===D):(Ie===z&&(this.onEnd(D),ae.avail_out=0),!0)},ne.prototype.onData=function($){this.chunks.push($)},ne.prototype.onEnd=function($){$===D&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=$,this.msg=this.strm.msg};function ie($,L){var ae=new ne(L);if(ae.push($,!0),ae.err)throw ae.msg||c[ae.err];return ae.result}function Re($,L){return L=L||{},L.raw=!0,ie($,L)}function Te($,L){return L=L||{},L.gzip=!0,ie($,L)}return deflate$1.Deflate=ne,deflate$1.deflate=ie,deflate$1.deflateRaw=Re,deflate$1.gzip=Te,deflate$1}var inflate$1={},inflate={},inffast,hasRequiredInffast;function requireInffast(){if(hasRequiredInffast)return inffast;hasRequiredInffast=1;var t=30,o=12;return inffast=function(c,h){var d,H,n,D,j,z,w,q,re,ne,ie,Re,Te,$,L,ae,W,Pe,Ie,Ae,de,Ye,Ue,ye,rt;d=c.state,H=c.next_in,ye=c.input,n=H+(c.avail_in-5),D=c.next_out,rt=c.output,j=D-(h-c.avail_out),z=D+(c.avail_out-257),w=d.dmax,q=d.wsize,re=d.whave,ne=d.wnext,ie=d.window,Re=d.hold,Te=d.bits,$=d.lencode,L=d.distcode,ae=(1<<d.lenbits)-1,W=(1<<d.distbits)-1;e:do{Te<15&&(Re+=ye[H++]<<Te,Te+=8,Re+=ye[H++]<<Te,Te+=8),Pe=$[Re&ae];t:for(;;){if(Ie=Pe>>>24,Re>>>=Ie,Te-=Ie,Ie=Pe>>>16&255,Ie===0)rt[D++]=Pe&65535;else if(Ie&16){Ae=Pe&65535,Ie&=15,Ie&&(Te<Ie&&(Re+=ye[H++]<<Te,Te+=8),Ae+=Re&(1<<Ie)-1,Re>>>=Ie,Te-=Ie),Te<15&&(Re+=ye[H++]<<Te,Te+=8,Re+=ye[H++]<<Te,Te+=8),Pe=L[Re&W];r:for(;;){if(Ie=Pe>>>24,Re>>>=Ie,Te-=Ie,Ie=Pe>>>16&255,Ie&16){if(de=Pe&65535,Ie&=15,Te<Ie&&(Re+=ye[H++]<<Te,Te+=8,Te<Ie&&(Re+=ye[H++]<<Te,Te+=8)),de+=Re&(1<<Ie)-1,de>w){c.msg="invalid distance too far back",d.mode=t;break e}if(Re>>>=Ie,Te-=Ie,Ie=D-j,de>Ie){if(Ie=de-Ie,Ie>re&&d.sane){c.msg="invalid distance too far back",d.mode=t;break e}if(Ye=0,Ue=ie,ne===0){if(Ye+=q-Ie,Ie<Ae){Ae-=Ie;do rt[D++]=ie[Ye++];while(--Ie);Ye=D-de,Ue=rt}}else if(ne<Ie){if(Ye+=q+ne-Ie,Ie-=ne,Ie<Ae){Ae-=Ie;do rt[D++]=ie[Ye++];while(--Ie);if(Ye=0,ne<Ae){Ie=ne,Ae-=Ie;do rt[D++]=ie[Ye++];while(--Ie);Ye=D-de,Ue=rt}}}else if(Ye+=ne-Ie,Ie<Ae){Ae-=Ie;do rt[D++]=ie[Ye++];while(--Ie);Ye=D-de,Ue=rt}for(;Ae>2;)rt[D++]=Ue[Ye++],rt[D++]=Ue[Ye++],rt[D++]=Ue[Ye++],Ae-=3;Ae&&(rt[D++]=Ue[Ye++],Ae>1&&(rt[D++]=Ue[Ye++]))}else{Ye=D-de;do rt[D++]=rt[Ye++],rt[D++]=rt[Ye++],rt[D++]=rt[Ye++],Ae-=3;while(Ae>2);Ae&&(rt[D++]=rt[Ye++],Ae>1&&(rt[D++]=rt[Ye++]))}}else if((Ie&64)===0){Pe=L[(Pe&65535)+(Re&(1<<Ie)-1)];continue r}else{c.msg="invalid distance code",d.mode=t;break e}break}}else if((Ie&64)===0){Pe=$[(Pe&65535)+(Re&(1<<Ie)-1)];continue t}else if(Ie&32){d.mode=o;break e}else{c.msg="invalid literal/length code",d.mode=t;break e}break}}while(H<n&&D<z);Ae=Te>>3,H-=Ae,Te-=Ae<<3,Re&=(1<<Te)-1,c.next_in=H,c.next_out=D,c.avail_in=H<n?5+(n-H):5-(H-n),c.avail_out=D<z?257+(z-D):257-(D-z),d.hold=Re,d.bits=Te},inffast}var inftrees,hasRequiredInftrees;function requireInftrees(){if(hasRequiredInftrees)return inftrees;hasRequiredInftrees=1;var t=requireCommon(),o=15,R=852,c=592,h=0,d=1,H=2,n=[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],D=[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],j=[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],z=[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(q,re,ne,ie,Re,Te,$,L){var ae=L.bits,W=0,Pe=0,Ie=0,Ae=0,de=0,Ye=0,Ue=0,ye=0,rt=0,St=0,Yt,Et,pt,Ht,rr,mr=null,na=0,cr,yr=new t.Buf16(o+1),fa=new t.Buf16(o+1),$a=null,Ta=0,Sa,_r,Qr;for(W=0;W<=o;W++)yr[W]=0;for(Pe=0;Pe<ie;Pe++)yr[re[ne+Pe]]++;for(de=ae,Ae=o;Ae>=1&&yr[Ae]===0;Ae--);if(de>Ae&&(de=Ae),Ae===0)return Re[Te++]=1<<24|64<<16|0,Re[Te++]=1<<24|64<<16|0,L.bits=1,0;for(Ie=1;Ie<Ae&&yr[Ie]===0;Ie++);for(de<Ie&&(de=Ie),ye=1,W=1;W<=o;W++)if(ye<<=1,ye-=yr[W],ye<0)return-1;if(ye>0&&(q===h||Ae!==1))return-1;for(fa[1]=0,W=1;W<o;W++)fa[W+1]=fa[W]+yr[W];for(Pe=0;Pe<ie;Pe++)re[ne+Pe]!==0&&($[fa[re[ne+Pe]]++]=Pe);if(q===h?(mr=$a=$,cr=19):q===d?(mr=n,na-=257,$a=D,Ta-=257,cr=256):(mr=j,$a=z,cr=-1),St=0,Pe=0,W=Ie,rr=Te,Ye=de,Ue=0,pt=-1,rt=1<<de,Ht=rt-1,q===d&&rt>R||q===H&&rt>c)return 1;for(;;){Sa=W-Ue,$[Pe]<cr?(_r=0,Qr=$[Pe]):$[Pe]>cr?(_r=$a[Ta+$[Pe]],Qr=mr[na+$[Pe]]):(_r=32+64,Qr=0),Yt=1<<W-Ue,Et=1<<Ye,Ie=Et;do Et-=Yt,Re[rr+(St>>Ue)+Et]=Sa<<24|_r<<16|Qr|0;while(Et!==0);for(Yt=1<<W-1;St&Yt;)Yt>>=1;if(Yt!==0?(St&=Yt-1,St+=Yt):St=0,Pe++,--yr[W]===0){if(W===Ae)break;W=re[ne+$[Pe]]}if(W>de&&(St&Ht)!==pt){for(Ue===0&&(Ue=de),rr+=Ie,Ye=W-Ue,ye=1<<Ye;Ye+Ue<Ae&&(ye-=yr[Ye+Ue],!(ye<=0));)Ye++,ye<<=1;if(rt+=1<<Ye,q===d&&rt>R||q===H&&rt>c)return 1;pt=St&Ht,Re[pt]=de<<24|Ye<<16|rr-Te|0}}return St!==0&&(Re[rr+St]=W-Ue<<24|64<<16|0),L.bits=de,0},inftrees}var hasRequiredInflate$1;function requireInflate$1(){if(hasRequiredInflate$1)return inflate;hasRequiredInflate$1=1;var t=requireCommon(),o=requireAdler32(),R=requireCrc32(),c=requireInffast(),h=requireInftrees(),d=0,H=1,n=2,D=4,j=5,z=6,w=0,q=1,re=2,ne=-2,ie=-3,Re=-4,Te=-5,$=8,L=1,ae=2,W=3,Pe=4,Ie=5,Ae=6,de=7,Ye=8,Ue=9,ye=10,rt=11,St=12,Yt=13,Et=14,pt=15,Ht=16,rr=17,mr=18,na=19,cr=20,yr=21,fa=22,$a=23,Ta=24,Sa=25,_r=26,Qr=27,la=28,Nn=29,ma=30,va=31,Ya=32,An=852,En=592,In=15,wa=In;function _a(Ut){return(Ut>>>24&255)+(Ut>>>8&65280)+((Ut&65280)<<8)+((Ut&255)<<24)}function pa(){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 t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Zn(Ut){var br;return!Ut||!Ut.state?ne:(br=Ut.state,Ut.total_in=Ut.total_out=br.total=0,Ut.msg="",br.wrap&&(Ut.adler=br.wrap&1),br.mode=L,br.last=0,br.havedict=0,br.dmax=32768,br.head=null,br.hold=0,br.bits=0,br.lencode=br.lendyn=new t.Buf32(An),br.distcode=br.distdyn=new t.Buf32(En),br.sane=1,br.back=-1,w)}function yn(Ut){var br;return!Ut||!Ut.state?ne:(br=Ut.state,br.wsize=0,br.whave=0,br.wnext=0,Zn(Ut))}function pe(Ut,br){var ze,Pa;return!Ut||!Ut.state||(Pa=Ut.state,br<0?(ze=0,br=-br):(ze=(br>>4)+1,br<48&&(br&=15)),br&&(br<8||br>15))?ne:(Pa.window!==null&&Pa.wbits!==br&&(Pa.window=null),Pa.wrap=ze,Pa.wbits=br,yn(Ut))}function $t(Ut,br){var ze,Pa;return Ut?(Pa=new pa,Ut.state=Pa,Pa.window=null,ze=pe(Ut,br),ze!==w&&(Ut.state=null),ze):ne}function or(Ut){return $t(Ut,wa)}var wr=!0,Xr,Mr;function za(Ut){if(wr){var br;for(Xr=new t.Buf32(512),Mr=new t.Buf32(32),br=0;br<144;)Ut.lens[br++]=8;for(;br<256;)Ut.lens[br++]=9;for(;br<280;)Ut.lens[br++]=7;for(;br<288;)Ut.lens[br++]=8;for(h(H,Ut.lens,0,288,Xr,0,Ut.work,{bits:9}),br=0;br<32;)Ut.lens[br++]=5;h(n,Ut.lens,0,32,Mr,0,Ut.work,{bits:5}),wr=!1}Ut.lencode=Xr,Ut.lenbits=9,Ut.distcode=Mr,Ut.distbits=5}function Ha(Ut,br,ze,Pa){var hn,me=Ut.state;return me.window===null&&(me.wsize=1<<me.wbits,me.wnext=0,me.whave=0,me.window=new t.Buf8(me.wsize)),Pa>=me.wsize?(t.arraySet(me.window,br,ze-me.wsize,me.wsize,0),me.wnext=0,me.whave=me.wsize):(hn=me.wsize-me.wnext,hn>Pa&&(hn=Pa),t.arraySet(me.window,br,ze-Pa,hn,me.wnext),Pa-=hn,Pa?(t.arraySet(me.window,br,ze-Pa,Pa,0),me.wnext=Pa,me.whave=me.wsize):(me.wnext+=hn,me.wnext===me.wsize&&(me.wnext=0),me.whave<me.wsize&&(me.whave+=hn))),0}function Fe(Ut,br){var ze,Pa,hn,me,Dr,Lr,Ze,Bt,Hr,Mn,ja,Pn,ii,MT,Hi=0,$n,Qi,R0,u0,qi,WT,Rt,De,xe=new t.Buf8(4),$e,_t,Pt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Ut||!Ut.state||!Ut.output||!Ut.input&&Ut.avail_in!==0)return ne;ze=Ut.state,ze.mode===St&&(ze.mode=Yt),Dr=Ut.next_out,hn=Ut.output,Ze=Ut.avail_out,me=Ut.next_in,Pa=Ut.input,Lr=Ut.avail_in,Bt=ze.hold,Hr=ze.bits,Mn=Lr,ja=Ze,De=w;e:for(;;)switch(ze.mode){case L:if(ze.wrap===0){ze.mode=Yt;break}for(;Hr<16;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(ze.wrap&2&&Bt===35615){ze.check=0,xe[0]=Bt&255,xe[1]=Bt>>>8&255,ze.check=R(ze.check,xe,2,0),Bt=0,Hr=0,ze.mode=ae;break}if(ze.flags=0,ze.head&&(ze.head.done=!1),!(ze.wrap&1)||(((Bt&255)<<8)+(Bt>>8))%31){Ut.msg="incorrect header check",ze.mode=ma;break}if((Bt&15)!==$){Ut.msg="unknown compression method",ze.mode=ma;break}if(Bt>>>=4,Hr-=4,Rt=(Bt&15)+8,ze.wbits===0)ze.wbits=Rt;else if(Rt>ze.wbits){Ut.msg="invalid window size",ze.mode=ma;break}ze.dmax=1<<Rt,Ut.adler=ze.check=1,ze.mode=Bt&512?ye:St,Bt=0,Hr=0;break;case ae:for(;Hr<16;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(ze.flags=Bt,(ze.flags&255)!==$){Ut.msg="unknown compression method",ze.mode=ma;break}if(ze.flags&57344){Ut.msg="unknown header flags set",ze.mode=ma;break}ze.head&&(ze.head.text=Bt>>8&1),ze.flags&512&&(xe[0]=Bt&255,xe[1]=Bt>>>8&255,ze.check=R(ze.check,xe,2,0)),Bt=0,Hr=0,ze.mode=W;case W:for(;Hr<32;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}ze.head&&(ze.head.time=Bt),ze.flags&512&&(xe[0]=Bt&255,xe[1]=Bt>>>8&255,xe[2]=Bt>>>16&255,xe[3]=Bt>>>24&255,ze.check=R(ze.check,xe,4,0)),Bt=0,Hr=0,ze.mode=Pe;case Pe:for(;Hr<16;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}ze.head&&(ze.head.xflags=Bt&255,ze.head.os=Bt>>8),ze.flags&512&&(xe[0]=Bt&255,xe[1]=Bt>>>8&255,ze.check=R(ze.check,xe,2,0)),Bt=0,Hr=0,ze.mode=Ie;case Ie:if(ze.flags&1024){for(;Hr<16;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}ze.length=Bt,ze.head&&(ze.head.extra_len=Bt),ze.flags&512&&(xe[0]=Bt&255,xe[1]=Bt>>>8&255,ze.check=R(ze.check,xe,2,0)),Bt=0,Hr=0}else ze.head&&(ze.head.extra=null);ze.mode=Ae;case Ae:if(ze.flags&1024&&(Pn=ze.length,Pn>Lr&&(Pn=Lr),Pn&&(ze.head&&(Rt=ze.head.extra_len-ze.length,ze.head.extra||(ze.head.extra=new Array(ze.head.extra_len)),t.arraySet(ze.head.extra,Pa,me,Pn,Rt)),ze.flags&512&&(ze.check=R(ze.check,Pa,Pn,me)),Lr-=Pn,me+=Pn,ze.length-=Pn),ze.length))break e;ze.length=0,ze.mode=de;case de:if(ze.flags&2048){if(Lr===0)break e;Pn=0;do Rt=Pa[me+Pn++],ze.head&&Rt&&ze.length<65536&&(ze.head.name+=String.fromCharCode(Rt));while(Rt&&Pn<Lr);if(ze.flags&512&&(ze.check=R(ze.check,Pa,Pn,me)),Lr-=Pn,me+=Pn,Rt)break e}else ze.head&&(ze.head.name=null);ze.length=0,ze.mode=Ye;case Ye:if(ze.flags&4096){if(Lr===0)break e;Pn=0;do Rt=Pa[me+Pn++],ze.head&&Rt&&ze.length<65536&&(ze.head.comment+=String.fromCharCode(Rt));while(Rt&&Pn<Lr);if(ze.flags&512&&(ze.check=R(ze.check,Pa,Pn,me)),Lr-=Pn,me+=Pn,Rt)break e}else ze.head&&(ze.head.comment=null);ze.mode=Ue;case Ue:if(ze.flags&512){for(;Hr<16;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(Bt!==(ze.check&65535)){Ut.msg="header crc mismatch",ze.mode=ma;break}Bt=0,Hr=0}ze.head&&(ze.head.hcrc=ze.flags>>9&1,ze.head.done=!0),Ut.adler=ze.check=0,ze.mode=St;break;case ye:for(;Hr<32;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}Ut.adler=ze.check=_a(Bt),Bt=0,Hr=0,ze.mode=rt;case rt:if(ze.havedict===0)return Ut.next_out=Dr,Ut.avail_out=Ze,Ut.next_in=me,Ut.avail_in=Lr,ze.hold=Bt,ze.bits=Hr,re;Ut.adler=ze.check=1,ze.mode=St;case St:if(br===j||br===z)break e;case Yt:if(ze.last){Bt>>>=Hr&7,Hr-=Hr&7,ze.mode=Qr;break}for(;Hr<3;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}switch(ze.last=Bt&1,Bt>>>=1,Hr-=1,Bt&3){case 0:ze.mode=Et;break;case 1:if(za(ze),ze.mode=cr,br===z){Bt>>>=2,Hr-=2;break e}break;case 2:ze.mode=rr;break;case 3:Ut.msg="invalid block type",ze.mode=ma}Bt>>>=2,Hr-=2;break;case Et:for(Bt>>>=Hr&7,Hr-=Hr&7;Hr<32;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if((Bt&65535)!==(Bt>>>16^65535)){Ut.msg="invalid stored block lengths",ze.mode=ma;break}if(ze.length=Bt&65535,Bt=0,Hr=0,ze.mode=pt,br===z)break e;case pt:ze.mode=Ht;case Ht:if(Pn=ze.length,Pn){if(Pn>Lr&&(Pn=Lr),Pn>Ze&&(Pn=Ze),Pn===0)break e;t.arraySet(hn,Pa,me,Pn,Dr),Lr-=Pn,me+=Pn,Ze-=Pn,Dr+=Pn,ze.length-=Pn;break}ze.mode=St;break;case rr:for(;Hr<14;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(ze.nlen=(Bt&31)+257,Bt>>>=5,Hr-=5,ze.ndist=(Bt&31)+1,Bt>>>=5,Hr-=5,ze.ncode=(Bt&15)+4,Bt>>>=4,Hr-=4,ze.nlen>286||ze.ndist>30){Ut.msg="too many length or distance symbols",ze.mode=ma;break}ze.have=0,ze.mode=mr;case mr:for(;ze.have<ze.ncode;){for(;Hr<3;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}ze.lens[Pt[ze.have++]]=Bt&7,Bt>>>=3,Hr-=3}for(;ze.have<19;)ze.lens[Pt[ze.have++]]=0;if(ze.lencode=ze.lendyn,ze.lenbits=7,$e={bits:ze.lenbits},De=h(d,ze.lens,0,19,ze.lencode,0,ze.work,$e),ze.lenbits=$e.bits,De){Ut.msg="invalid code lengths set",ze.mode=ma;break}ze.have=0,ze.mode=na;case na:for(;ze.have<ze.nlen+ze.ndist;){for(;Hi=ze.lencode[Bt&(1<<ze.lenbits)-1],$n=Hi>>>24,Qi=Hi>>>16&255,R0=Hi&65535,!($n<=Hr);){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(R0<16)Bt>>>=$n,Hr-=$n,ze.lens[ze.have++]=R0;else{if(R0===16){for(_t=$n+2;Hr<_t;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(Bt>>>=$n,Hr-=$n,ze.have===0){Ut.msg="invalid bit length repeat",ze.mode=ma;break}Rt=ze.lens[ze.have-1],Pn=3+(Bt&3),Bt>>>=2,Hr-=2}else if(R0===17){for(_t=$n+3;Hr<_t;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}Bt>>>=$n,Hr-=$n,Rt=0,Pn=3+(Bt&7),Bt>>>=3,Hr-=3}else{for(_t=$n+7;Hr<_t;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}Bt>>>=$n,Hr-=$n,Rt=0,Pn=11+(Bt&127),Bt>>>=7,Hr-=7}if(ze.have+Pn>ze.nlen+ze.ndist){Ut.msg="invalid bit length repeat",ze.mode=ma;break}for(;Pn--;)ze.lens[ze.have++]=Rt}}if(ze.mode===ma)break;if(ze.lens[256]===0){Ut.msg="invalid code -- missing end-of-block",ze.mode=ma;break}if(ze.lenbits=9,$e={bits:ze.lenbits},De=h(H,ze.lens,0,ze.nlen,ze.lencode,0,ze.work,$e),ze.lenbits=$e.bits,De){Ut.msg="invalid literal/lengths set",ze.mode=ma;break}if(ze.distbits=6,ze.distcode=ze.distdyn,$e={bits:ze.distbits},De=h(n,ze.lens,ze.nlen,ze.ndist,ze.distcode,0,ze.work,$e),ze.distbits=$e.bits,De){Ut.msg="invalid distances set",ze.mode=ma;break}if(ze.mode=cr,br===z)break e;case cr:ze.mode=yr;case yr:if(Lr>=6&&Ze>=258){Ut.next_out=Dr,Ut.avail_out=Ze,Ut.next_in=me,Ut.avail_in=Lr,ze.hold=Bt,ze.bits=Hr,c(Ut,ja),Dr=Ut.next_out,hn=Ut.output,Ze=Ut.avail_out,me=Ut.next_in,Pa=Ut.input,Lr=Ut.avail_in,Bt=ze.hold,Hr=ze.bits,ze.mode===St&&(ze.back=-1);break}for(ze.back=0;Hi=ze.lencode[Bt&(1<<ze.lenbits)-1],$n=Hi>>>24,Qi=Hi>>>16&255,R0=Hi&65535,!($n<=Hr);){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(Qi&&(Qi&240)===0){for(u0=$n,qi=Qi,WT=R0;Hi=ze.lencode[WT+((Bt&(1<<u0+qi)-1)>>u0)],$n=Hi>>>24,Qi=Hi>>>16&255,R0=Hi&65535,!(u0+$n<=Hr);){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}Bt>>>=u0,Hr-=u0,ze.back+=u0}if(Bt>>>=$n,Hr-=$n,ze.back+=$n,ze.length=R0,Qi===0){ze.mode=_r;break}if(Qi&32){ze.back=-1,ze.mode=St;break}if(Qi&64){Ut.msg="invalid literal/length code",ze.mode=ma;break}ze.extra=Qi&15,ze.mode=fa;case fa:if(ze.extra){for(_t=ze.extra;Hr<_t;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}ze.length+=Bt&(1<<ze.extra)-1,Bt>>>=ze.extra,Hr-=ze.extra,ze.back+=ze.extra}ze.was=ze.length,ze.mode=$a;case $a:for(;Hi=ze.distcode[Bt&(1<<ze.distbits)-1],$n=Hi>>>24,Qi=Hi>>>16&255,R0=Hi&65535,!($n<=Hr);){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if((Qi&240)===0){for(u0=$n,qi=Qi,WT=R0;Hi=ze.distcode[WT+((Bt&(1<<u0+qi)-1)>>u0)],$n=Hi>>>24,Qi=Hi>>>16&255,R0=Hi&65535,!(u0+$n<=Hr);){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}Bt>>>=u0,Hr-=u0,ze.back+=u0}if(Bt>>>=$n,Hr-=$n,ze.back+=$n,Qi&64){Ut.msg="invalid distance code",ze.mode=ma;break}ze.offset=R0,ze.extra=Qi&15,ze.mode=Ta;case Ta:if(ze.extra){for(_t=ze.extra;Hr<_t;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}ze.offset+=Bt&(1<<ze.extra)-1,Bt>>>=ze.extra,Hr-=ze.extra,ze.back+=ze.extra}if(ze.offset>ze.dmax){Ut.msg="invalid distance too far back",ze.mode=ma;break}ze.mode=Sa;case Sa:if(Ze===0)break e;if(Pn=ja-Ze,ze.offset>Pn){if(Pn=ze.offset-Pn,Pn>ze.whave&&ze.sane){Ut.msg="invalid distance too far back",ze.mode=ma;break}Pn>ze.wnext?(Pn-=ze.wnext,ii=ze.wsize-Pn):ii=ze.wnext-Pn,Pn>ze.length&&(Pn=ze.length),MT=ze.window}else MT=hn,ii=Dr-ze.offset,Pn=ze.length;Pn>Ze&&(Pn=Ze),Ze-=Pn,ze.length-=Pn;do hn[Dr++]=MT[ii++];while(--Pn);ze.length===0&&(ze.mode=yr);break;case _r:if(Ze===0)break e;hn[Dr++]=ze.length,Ze--,ze.mode=yr;break;case Qr:if(ze.wrap){for(;Hr<32;){if(Lr===0)break e;Lr--,Bt|=Pa[me++]<<Hr,Hr+=8}if(ja-=Ze,Ut.total_out+=ja,ze.total+=ja,ja&&(Ut.adler=ze.check=ze.flags?R(ze.check,hn,ja,Dr-ja):o(ze.check,hn,ja,Dr-ja)),ja=Ze,(ze.flags?Bt:_a(Bt))!==ze.check){Ut.msg="incorrect data check",ze.mode=ma;break}Bt=0,Hr=0}ze.mode=la;case la:if(ze.wrap&&ze.flags){for(;Hr<32;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(Bt!==(ze.total&4294967295)){Ut.msg="incorrect length check",ze.mode=ma;break}Bt=0,Hr=0}ze.mode=Nn;case Nn:De=q;break e;case ma:De=ie;break e;case va:return Re;case Ya:default:return ne}return Ut.next_out=Dr,Ut.avail_out=Ze,Ut.next_in=me,Ut.avail_in=Lr,ze.hold=Bt,ze.bits=Hr,(ze.wsize||ja!==Ut.avail_out&&ze.mode<ma&&(ze.mode<Qr||br!==D))&&Ha(Ut,Ut.output,Ut.next_out,ja-Ut.avail_out),Mn-=Ut.avail_in,ja-=Ut.avail_out,Ut.total_in+=Mn,Ut.total_out+=ja,ze.total+=ja,ze.wrap&&ja&&(Ut.adler=ze.check=ze.flags?R(ze.check,hn,ja,Ut.next_out-ja):o(ze.check,hn,ja,Ut.next_out-ja)),Ut.data_type=ze.bits+(ze.last?64:0)+(ze.mode===St?128:0)+(ze.mode===cr||ze.mode===pt?256:0),(Mn===0&&ja===0||br===D)&&De===w&&(De=Te),De}function ar(Ut){if(!Ut||!Ut.state)return ne;var br=Ut.state;return br.window&&(br.window=null),Ut.state=null,w}function ea(Ut,br){var ze;return!Ut||!Ut.state||(ze=Ut.state,(ze.wrap&2)===0)?ne:(ze.head=br,br.done=!1,w)}function Ma(Ut,br){var ze=br.length,Pa,hn,me;return!Ut||!Ut.state||(Pa=Ut.state,Pa.wrap!==0&&Pa.mode!==rt)?ne:Pa.mode===rt&&(hn=1,hn=o(hn,br,ze,0),hn!==Pa.check)?ie:(me=Ha(Ut,br,ze,ze),me?(Pa.mode=va,Re):(Pa.havedict=1,w))}return inflate.inflateReset=yn,inflate.inflateReset2=pe,inflate.inflateResetKeep=Zn,inflate.inflateInit=or,inflate.inflateInit2=$t,inflate.inflate=Fe,inflate.inflateEnd=ar,inflate.inflateGetHeader=ea,inflate.inflateSetDictionary=Ma,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 t(){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=t,gzheader}var hasRequiredInflate;function requireInflate(){if(hasRequiredInflate)return inflate$1;hasRequiredInflate=1;var t=requireInflate$1(),o=requireCommon(),R=requireStrings(),c=requireConstants(),h=requireMessages(),d=requireZstream(),H=requireGzheader(),n=Object.prototype.toString;function D(w){if(!(this instanceof D))return new D(w);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},w||{});var q=this.options;q.raw&&q.windowBits>=0&&q.windowBits<16&&(q.windowBits=-q.windowBits,q.windowBits===0&&(q.windowBits=-15)),q.windowBits>=0&&q.windowBits<16&&!(w&&w.windowBits)&&(q.windowBits+=32),q.windowBits>15&&q.windowBits<48&&(q.windowBits&15)===0&&(q.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var re=t.inflateInit2(this.strm,q.windowBits);if(re!==c.Z_OK)throw new Error(h[re]);if(this.header=new H,t.inflateGetHeader(this.strm,this.header),q.dictionary&&(typeof q.dictionary=="string"?q.dictionary=R.string2buf(q.dictionary):n.call(q.dictionary)==="[object ArrayBuffer]"&&(q.dictionary=new Uint8Array(q.dictionary)),q.raw&&(re=t.inflateSetDictionary(this.strm,q.dictionary),re!==c.Z_OK)))throw new Error(h[re])}D.prototype.push=function(w,q){var re=this.strm,ne=this.options.chunkSize,ie=this.options.dictionary,Re,Te,$,L,ae,W=!1;if(this.ended)return!1;Te=q===~~q?q:q===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof w=="string"?re.input=R.binstring2buf(w):n.call(w)==="[object ArrayBuffer]"?re.input=new Uint8Array(w):re.input=w,re.next_in=0,re.avail_in=re.input.length;do{if(re.avail_out===0&&(re.output=new o.Buf8(ne),re.next_out=0,re.avail_out=ne),Re=t.inflate(re,c.Z_NO_FLUSH),Re===c.Z_NEED_DICT&&ie&&(Re=t.inflateSetDictionary(this.strm,ie)),Re===c.Z_BUF_ERROR&&W===!0&&(Re=c.Z_OK,W=!1),Re!==c.Z_STREAM_END&&Re!==c.Z_OK)return this.onEnd(Re),this.ended=!0,!1;re.next_out&&(re.avail_out===0||Re===c.Z_STREAM_END||re.avail_in===0&&(Te===c.Z_FINISH||Te===c.Z_SYNC_FLUSH))&&(this.options.to==="string"?($=R.utf8border(re.output,re.next_out),L=re.next_out-$,ae=R.buf2string(re.output,$),re.next_out=L,re.avail_out=ne-L,L&&o.arraySet(re.output,re.output,$,L,0),this.onData(ae)):this.onData(o.shrinkBuf(re.output,re.next_out))),re.avail_in===0&&re.avail_out===0&&(W=!0)}while((re.avail_in>0||re.avail_out===0)&&Re!==c.Z_STREAM_END);return Re===c.Z_STREAM_END&&(Te=c.Z_FINISH),Te===c.Z_FINISH?(Re=t.inflateEnd(this.strm),this.onEnd(Re),this.ended=!0,Re===c.Z_OK):(Te===c.Z_SYNC_FLUSH&&(this.onEnd(c.Z_OK),re.avail_out=0),!0)},D.prototype.onData=function(w){this.chunks.push(w)},D.prototype.onEnd=function(w){w===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=w,this.msg=this.strm.msg};function j(w,q){var re=new D(q);if(re.push(w,!0),re.err)throw re.msg||h[re.err];return re.result}function z(w,q){return q=q||{},q.raw=!0,j(w,q)}return inflate$1.Inflate=D,inflate$1.inflate=j,inflate$1.inflateRaw=z,inflate$1.ungzip=j,inflate$1}var pako_1,hasRequiredPako;function requirePako(){if(hasRequiredPako)return pako_1;hasRequiredPako=1;var t=requireCommon().assign,o=requireDeflate(),R=requireInflate(),c=requireConstants(),h={};return t(h,o,R,c),pako_1=h,pako_1}(function(t){(function(){var o={},R;t.exports=o,typeof commonjsRequire=="function"?R=requirePako():R=window.pako,function(c,h){c.toRGBA8=function(d){var H=d.width,n=d.height;if(d.tabs.acTL==null)return[c.toRGBA8.decodeImage(d.data,H,n,d).buffer];var D=[];d.frames[0].data==null&&(d.frames[0].data=d.data);for(var j,z=new Uint8Array(H*n*4),w=0;w<d.frames.length;w++){var q=d.frames[w],re=q.rect.x,ne=q.rect.y,ie=q.rect.width,Re=q.rect.height,Te=c.toRGBA8.decodeImage(q.data,ie,Re,d);if(w==0?j=Te:q.blend==0?c._copyTile(Te,ie,Re,j,H,n,re,ne,0):q.blend==1&&c._copyTile(Te,ie,Re,j,H,n,re,ne,1),D.push(j.buffer),j=j.slice(0),q.dispose!=0){if(q.dispose==1)c._copyTile(z,ie,Re,j,H,n,re,ne,0);else if(q.dispose==2){for(var $=w-1;d.frames[$].dispose==2;)$--;j=new Uint8Array(D[$]).slice(0)}}}return D},c.toRGBA8.decodeImage=function(d,H,n,D){var j=H*n,z=c.decode._getBPP(D),w=Math.ceil(H*z/8),q=new Uint8Array(j*4),re=new Uint32Array(q.buffer),ne=D.ctype,ie=D.depth,Re=c._bin.readUshort;if(ne==6){var Te=j<<2;if(ie==8)for(var $=0;$<Te;$++)q[$]=d[$];if(ie==16)for(var $=0;$<Te;$++)q[$]=d[$<<1]}else if(ne==2){var L=D.tabs.tRNS,ae=-1,W=-1,Pe=-1;if(L&&(ae=L[0],W=L[1],Pe=L[2]),ie==8)for(var $=0;$<j;$++){var Ie=$<<2,Ae=$*3;q[Ie]=d[Ae],q[Ie+1]=d[Ae+1],q[Ie+2]=d[Ae+2],q[Ie+3]=255,ae!=-1&&d[Ae]==ae&&d[Ae+1]==W&&d[Ae+2]==Pe&&(q[Ie+3]=0)}if(ie==16)for(var $=0;$<j;$++){var Ie=$<<2,Ae=$*6;q[Ie]=d[Ae],q[Ie+1]=d[Ae+2],q[Ie+2]=d[Ae+4],q[Ie+3]=255,ae!=-1&&Re(d,Ae)==ae&&Re(d,Ae+2)==W&&Re(d,Ae+4)==Pe&&(q[Ie+3]=0)}}else if(ne==3){var de=D.tabs.PLTE,Ye=D.tabs.tRNS,Ue=Ye?Ye.length:0;if(ie==1)for(var ye=0;ye<n;ye++)for(var rt=ye*w,St=ye*H,$=0;$<H;$++){var Ie=St+$<<2,Yt=d[rt+($>>3)]>>7-(($&7)<<0)&1,Et=3*Yt;q[Ie]=de[Et],q[Ie+1]=de[Et+1],q[Ie+2]=de[Et+2],q[Ie+3]=Yt<Ue?Ye[Yt]:255}if(ie==2)for(var ye=0;ye<n;ye++)for(var rt=ye*w,St=ye*H,$=0;$<H;$++){var Ie=St+$<<2,Yt=d[rt+($>>2)]>>6-(($&3)<<1)&3,Et=3*Yt;q[Ie]=de[Et],q[Ie+1]=de[Et+1],q[Ie+2]=de[Et+2],q[Ie+3]=Yt<Ue?Ye[Yt]:255}if(ie==4)for(var ye=0;ye<n;ye++)for(var rt=ye*w,St=ye*H,$=0;$<H;$++){var Ie=St+$<<2,Yt=d[rt+($>>1)]>>4-(($&1)<<2)&15,Et=3*Yt;q[Ie]=de[Et],q[Ie+1]=de[Et+1],q[Ie+2]=de[Et+2],q[Ie+3]=Yt<Ue?Ye[Yt]:255}if(ie==8)for(var $=0;$<j;$++){var Ie=$<<2,Yt=d[$],Et=3*Yt;q[Ie]=de[Et],q[Ie+1]=de[Et+1],q[Ie+2]=de[Et+2],q[Ie+3]=Yt<Ue?Ye[Yt]:255}}else if(ne==4){if(ie==8)for(var $=0;$<j;$++){var Ie=$<<2,pt=$<<1,Ht=d[pt];q[Ie]=Ht,q[Ie+1]=Ht,q[Ie+2]=Ht,q[Ie+3]=d[pt+1]}if(ie==16)for(var $=0;$<j;$++){var Ie=$<<2,pt=$<<2,Ht=d[pt];q[Ie]=Ht,q[Ie+1]=Ht,q[Ie+2]=Ht,q[Ie+3]=d[pt+2]}}else if(ne==0){var ae=D.tabs.tRNS?D.tabs.tRNS:-1;if(ie==1)for(var $=0;$<j;$++){var Ht=255*(d[$>>3]>>7-($&7)&1),rr=Ht==ae*255?0:255;re[$]=rr<<24|Ht<<16|Ht<<8|Ht}if(ie==2)for(var $=0;$<j;$++){var Ht=85*(d[$>>2]>>6-(($&3)<<1)&3),rr=Ht==ae*85?0:255;re[$]=rr<<24|Ht<<16|Ht<<8|Ht}if(ie==4)for(var $=0;$<j;$++){var Ht=17*(d[$>>1]>>4-(($&1)<<2)&15),rr=Ht==ae*17?0:255;re[$]=rr<<24|Ht<<16|Ht<<8|Ht}if(ie==8)for(var $=0;$<j;$++){var Ht=d[$],rr=Ht==ae?0:255;re[$]=rr<<24|Ht<<16|Ht<<8|Ht}if(ie==16)for(var $=0;$<j;$++){var Ht=d[$<<1],rr=Re(d,$<<1)==ae?0:255;re[$]=rr<<24|Ht<<16|Ht<<8|Ht}}return q},c.decode=function(d){for(var H=new Uint8Array(d),n=8,D=c._bin,j=D.readUshort,z=D.readUint,w={tabs:{},frames:[]},q=new Uint8Array(H.length),re=0,ne,ie=0,Re=[137,80,78,71,13,10,26,10],Te=0;Te<8;Te++)if(H[Te]!=Re[Te])throw"The input is not a PNG file!";for(;n<H.length;){var $=D.readUint(H,n);n+=4;var L=D.readASCII(H,n,4);if(n+=4,L=="IHDR")c.decode._IHDR(H,n,w);else if(L=="IDAT"){for(var Te=0;Te<$;Te++)q[re+Te]=H[n+Te];re+=$}else if(L=="acTL")w.tabs[L]={num_frames:z(H,n),num_plays:z(H,n+4)},ne=new Uint8Array(H.length);else if(L=="fcTL"){if(ie!=0){var ae=w.frames[w.frames.length-1];ae.data=c.decode._decompress(w,ne.slice(0,ie),ae.rect.width,ae.rect.height),ie=0}var W={x:z(H,n+12),y:z(H,n+16),width:z(H,n+4),height:z(H,n+8)},Pe=j(H,n+22);Pe=j(H,n+20)/(Pe==0?100:Pe);var Ie={rect:W,delay:Math.round(Pe*1e3),dispose:H[n+24],blend:H[n+25]};w.frames.push(Ie)}else if(L=="fdAT"){for(var Te=0;Te<$-4;Te++)ne[ie+Te]=H[n+Te+4];ie+=$-4}else if(L=="pHYs")w.tabs[L]=[D.readUint(H,n),D.readUint(H,n+4),H[n+8]];else if(L=="cHRM"){w.tabs[L]=[];for(var Te=0;Te<8;Te++)w.tabs[L].push(D.readUint(H,n+Te*4))}else if(L=="tEXt"){w.tabs[L]==null&&(w.tabs[L]={});var Ae=D.nextZero(H,n),de=D.readASCII(H,n,Ae-n),Ye=D.readASCII(H,Ae+1,n+$-Ae-1);w.tabs[L][de]=Ye}else if(L=="iTXt"){w.tabs[L]==null&&(w.tabs[L]={});var Ae=0,Ue=n;Ae=D.nextZero(H,Ue);var de=D.readASCII(H,Ue,Ae-Ue);Ue=Ae+1,H[Ue],H[Ue+1],Ue+=2,Ae=D.nextZero(H,Ue),D.readASCII(H,Ue,Ae-Ue),Ue=Ae+1,Ae=D.nextZero(H,Ue),D.readUTF8(H,Ue,Ae-Ue),Ue=Ae+1;var Ye=D.readUTF8(H,Ue,$-(Ue-n));w.tabs[L][de]=Ye}else if(L=="PLTE")w.tabs[L]=D.readBytes(H,n,$);else if(L=="hIST"){var ye=w.tabs.PLTE.length/3;w.tabs[L]=[];for(var Te=0;Te<ye;Te++)w.tabs[L].push(j(H,n+Te*2))}else if(L=="tRNS")w.ctype==3?w.tabs[L]=D.readBytes(H,n,$):w.ctype==0?w.tabs[L]=j(H,n):w.ctype==2&&(w.tabs[L]=[j(H,n),j(H,n+2),j(H,n+4)]);else if(L=="gAMA")w.tabs[L]=D.readUint(H,n)/1e5;else if(L=="sRGB")w.tabs[L]=H[n];else if(L=="bKGD")w.ctype==0||w.ctype==4?w.tabs[L]=[j(H,n)]:w.ctype==2||w.ctype==6?w.tabs[L]=[j(H,n),j(H,n+2),j(H,n+4)]:w.ctype==3&&(w.tabs[L]=H[n]);else if(L=="IEND"){if(ie!=0){var ae=w.frames[w.frames.length-1];ae.data=c.decode._decompress(w,ne.slice(0,ie),ae.rect.width,ae.rect.height),ie=0}w.data=c.decode._decompress(w,q,w.width,w.height);break}n+=$,D.readUint(H,n),n+=4}return delete w.compress,delete w.interlace,delete w.filter,w},c.decode._decompress=function(d,H,n,D){return d.compress==0&&(H=c.decode._inflate(H)),d.interlace==0?H=c.decode._filterZero(H,d,0,n,D):d.interlace==1&&(H=c.decode._readInterlace(H,d)),H},c.decode._inflate=function(d){return h.inflate(d)},c.decode._readInterlace=function(d,H){for(var n=H.width,D=H.height,j=c.decode._getBPP(H),z=j>>3,w=Math.ceil(n*j/8),q=new Uint8Array(D*w),re=0,ne=[0,0,4,0,2,0,1],ie=[0,4,0,2,0,1,0],Re=[8,8,8,4,4,2,2],Te=[8,8,4,4,2,2,1],$=0;$<7;){for(var L=Re[$],ae=Te[$],W=0,Pe=0,Ie=ne[$];Ie<D;)Ie+=L,Pe++;for(var Ae=ie[$];Ae<n;)Ae+=ae,W++;var de=Math.ceil(W*j/8);c.decode._filterZero(d,H,re,W,Pe);for(var Ye=0,Ue=ne[$];Ue<D;){for(var ye=ie[$],rt=re+Ye*de<<3;ye<n;){if(j==1){var St=d[rt>>3];St=St>>7-(rt&7)&1,q[Ue*w+(ye>>3)]|=St<<7-((ye&3)<<0)}if(j==2){var St=d[rt>>3];St=St>>6-(rt&7)&3,q[Ue*w+(ye>>2)]|=St<<6-((ye&3)<<1)}if(j==4){var St=d[rt>>3];St=St>>4-(rt&7)&15,q[Ue*w+(ye>>1)]|=St<<4-((ye&1)<<2)}if(j>=8)for(var Yt=Ue*w+ye*z,Et=0;Et<z;Et++)q[Yt+Et]=d[(rt>>3)+Et];rt+=j,ye+=ae}Ye++,Ue+=L}W*Pe!=0&&(re+=Pe*(1+de)),$=$+1}return q},c.decode._getBPP=function(d){var H=[1,null,3,1,2,null,4][d.ctype];return H*d.depth},c.decode._filterZero=function(d,H,n,D,j){var z=c.decode._getBPP(H),w=Math.ceil(D*z/8),q=c.decode._paeth;z=Math.ceil(z/8);for(var re=0;re<j;re++){var ne=n+re*w,ie=ne+re+1,Re=d[ie-1];if(Re==0)for(var Te=0;Te<w;Te++)d[ne+Te]=d[ie+Te];else if(Re==1){for(var Te=0;Te<z;Te++)d[ne+Te]=d[ie+Te];for(var Te=z;Te<w;Te++)d[ne+Te]=d[ie+Te]+d[ne+Te-z]&255}else if(re==0){for(var Te=0;Te<z;Te++)d[ne+Te]=d[ie+Te];if(Re==2)for(var Te=z;Te<w;Te++)d[ne+Te]=d[ie+Te]&255;if(Re==3)for(var Te=z;Te<w;Te++)d[ne+Te]=d[ie+Te]+(d[ne+Te-z]>>1)&255;if(Re==4)for(var Te=z;Te<w;Te++)d[ne+Te]=d[ie+Te]+q(d[ne+Te-z],0,0)&255}else{if(Re==2)for(var Te=0;Te<w;Te++)d[ne+Te]=d[ie+Te]+d[ne+Te-w]&255;if(Re==3){for(var Te=0;Te<z;Te++)d[ne+Te]=d[ie+Te]+(d[ne+Te-w]>>1)&255;for(var Te=z;Te<w;Te++)d[ne+Te]=d[ie+Te]+(d[ne+Te-w]+d[ne+Te-z]>>1)&255}if(Re==4){for(var Te=0;Te<z;Te++)d[ne+Te]=d[ie+Te]+q(0,d[ne+Te-w],0)&255;for(var Te=z;Te<w;Te++)d[ne+Te]=d[ie+Te]+q(d[ne+Te-z],d[ne+Te-w],d[ne+Te-z-w])&255}}}return d},c.decode._paeth=function(d,H,n){var D=d+H-n,j=Math.abs(D-d),z=Math.abs(D-H),w=Math.abs(D-n);return j<=z&&j<=w?d:z<=w?H:n},c.decode._IHDR=function(d,H,n){var D=c._bin;n.width=D.readUint(d,H),H+=4,n.height=D.readUint(d,H),H+=4,n.depth=d[H],H++,n.ctype=d[H],H++,n.compress=d[H],H++,n.filter=d[H],H++,n.interlace=d[H],H++},c._bin={nextZero:function(d,H){for(;d[H]!=0;)H++;return H},readUshort:function(d,H){return d[H]<<8|d[H+1]},writeUshort:function(d,H,n){d[H]=n>>8&255,d[H+1]=n&255},readUint:function(d,H){return d[H]*(256*256*256)+(d[H+1]<<16|d[H+2]<<8|d[H+3])},writeUint:function(d,H,n){d[H]=n>>24&255,d[H+1]=n>>16&255,d[H+2]=n>>8&255,d[H+3]=n&255},readASCII:function(d,H,n){for(var D="",j=0;j<n;j++)D+=String.fromCharCode(d[H+j]);return D},writeASCII:function(d,H,n){for(var D=0;D<n.length;D++)d[H+D]=n.charCodeAt(D)},readBytes:function(d,H,n){for(var D=[],j=0;j<n;j++)D.push(d[H+j]);return D},pad:function(d){return d.length<2?"0"+d:d},readUTF8:function(d,H,n){for(var D="",j,z=0;z<n;z++)D+="%"+c._bin.pad(d[H+z].toString(16));try{j=decodeURIComponent(D)}catch(w){return c._bin.readASCII(d,H,n)}return j}},c._copyTile=function(d,H,n,D,j,z,w,q,re){for(var ne=Math.min(H,j),ie=Math.min(n,z),Re=0,Te=0,$=0;$<ie;$++)for(var L=0;L<ne;L++)if(w>=0&&q>=0?(Re=$*H+L<<2,Te=(q+$)*j+w+L<<2):(Re=(-q+$)*H-w+L<<2,Te=$*j+L<<2),re==0)D[Te]=d[Re],D[Te+1]=d[Re+1],D[Te+2]=d[Re+2],D[Te+3]=d[Re+3];else if(re==1){var ae=d[Re+3]*.00392156862745098,W=d[Re]*ae,Pe=d[Re+1]*ae,Ie=d[Re+2]*ae,Ae=D[Te+3]*(1/255),de=D[Te]*Ae,Ye=D[Te+1]*Ae,Ue=D[Te+2]*Ae,ye=1-ae,rt=ae+Ae*ye,St=rt==0?0:1/rt;D[Te+3]=255*rt,D[Te+0]=(W+de*ye)*St,D[Te+1]=(Pe+Ye*ye)*St,D[Te+2]=(Ie+Ue*ye)*St}else if(re==2){var ae=d[Re+3],W=d[Re],Pe=d[Re+1],Ie=d[Re+2],Ae=D[Te+3],de=D[Te],Ye=D[Te+1],Ue=D[Te+2];ae==Ae&&W==de&&Pe==Ye&&Ie==Ue?(D[Te]=0,D[Te+1]=0,D[Te+2]=0,D[Te+3]=0):(D[Te]=W,D[Te+1]=Pe,D[Te+2]=Ie,D[Te+3]=ae)}else if(re==3){var ae=d[Re+3],W=d[Re],Pe=d[Re+1],Ie=d[Re+2],Ae=D[Te+3],de=D[Te],Ye=D[Te+1],Ue=D[Te+2];if(ae==Ae&&W==de&&Pe==Ye&&Ie==Ue)continue;if(ae<220&&Ae>20)return!1}return!0},c.encode=function(d,H,n,D,j,z){D==null&&(D=0),z==null&&(z=!1);for(var w=new Uint8Array(d[0].byteLength*d.length+100),q=[137,80,78,71,13,10,26,10],re=0;re<8;re++)w[re]=q[re];var ne=8,ie=c._bin,Re=c.crc.crc,Te=ie.writeUint,$=ie.writeUshort,L=ie.writeASCII,ae=c.encode.compressPNG(d,H,n,D,z);Te(w,ne,13),ne+=4,L(w,ne,"IHDR"),ne+=4,Te(w,ne,H),ne+=4,Te(w,ne,n),ne+=4,w[ne]=ae.depth,ne++,w[ne]=ae.ctype,ne++,w[ne]=0,ne++,w[ne]=0,ne++,w[ne]=0,ne++,Te(w,ne,Re(w,ne-17,17)),ne+=4,Te(w,ne,1),ne+=4,L(w,ne,"sRGB"),ne+=4,w[ne]=1,ne++,Te(w,ne,Re(w,ne-5,5)),ne+=4;var W=d.length>1;if(W&&(Te(w,ne,8),ne+=4,L(w,ne,"acTL"),ne+=4,Te(w,ne,d.length),ne+=4,Te(w,ne,0),ne+=4,Te(w,ne,Re(w,ne-12,12)),ne+=4),ae.ctype==3){var Pe=ae.plte.length;Te(w,ne,Pe*3),ne+=4,L(w,ne,"PLTE"),ne+=4;for(var re=0;re<Pe;re++){var Ie=re*3,Ae=ae.plte[re],de=Ae&255,Ye=Ae>>8&255,Ue=Ae>>16&255;w[ne+Ie+0]=de,w[ne+Ie+1]=Ye,w[ne+Ie+2]=Ue}if(ne+=Pe*3,Te(w,ne,Re(w,ne-Pe*3-4,Pe*3+4)),ne+=4,ae.gotAlpha){Te(w,ne,Pe),ne+=4,L(w,ne,"tRNS"),ne+=4;for(var re=0;re<Pe;re++)w[ne+re]=ae.plte[re]>>24&255;ne+=Pe,Te(w,ne,Re(w,ne-Pe-4,Pe+4)),ne+=4}}for(var ye=0,rt=0;rt<ae.frames.length;rt++){var St=ae.frames[rt];W&&(Te(w,ne,26),ne+=4,L(w,ne,"fcTL"),ne+=4,Te(w,ne,ye++),ne+=4,Te(w,ne,St.rect.width),ne+=4,Te(w,ne,St.rect.height),ne+=4,Te(w,ne,St.rect.x),ne+=4,Te(w,ne,St.rect.y),ne+=4,$(w,ne,j[rt]),ne+=2,$(w,ne,1e3),ne+=2,w[ne]=St.dispose,ne++,w[ne]=St.blend,ne++,Te(w,ne,Re(w,ne-30,30)),ne+=4);var Yt=St.cimg,Pe=Yt.length;Te(w,ne,Pe+(rt==0?0:4)),ne+=4;var Et=ne;L(w,ne,rt==0?"IDAT":"fdAT"),ne+=4,rt!=0&&(Te(w,ne,ye++),ne+=4);for(var re=0;re<Pe;re++)w[ne+re]=Yt[re];ne+=Pe,Te(w,ne,Re(w,Et,ne-Et)),ne+=4}return Te(w,ne,0),ne+=4,L(w,ne,"IEND"),ne+=4,Te(w,ne,Re(w,ne-4,4)),ne+=4,w.buffer.slice(0,ne)},c.encode.compressPNG=function(d,H,n,D,j){for(var z=c.encode.compress(d,H,n,D,!1,j),w=0;w<d.length;w++){var q=z.frames[w];q.rect.width;var re=q.rect.height,ne=q.bpl,ie=q.bpp,Re=new Uint8Array(re*ne+re);q.cimg=c.encode._filterZero(q.img,re,ie,ne,Re)}return z},c.encode.compress=function(d,H,n,D,j,z){z==null&&(z=!1);for(var w=6,q=8,re=4,ne=255,ie=0;ie<d.length;ie++)for(var Re=new Uint8Array(d[ie]),Te=Re.length,$=0;$<Te;$+=4)ne&=Re[$+3];var L=ne!=255,ae={},W=[];if(d.length!=0&&(ae[0]=0,W.push(0),D!=0&&D--),D!=0){var Pe=c.quantize(d,D,j);d=Pe.bufs;for(var $=0;$<Pe.plte.length;$++){var Ie=Pe.plte[$].est.rgba;ae[Ie]==null&&(ae[Ie]=W.length,W.push(Ie))}}else for(var ie=0;ie<d.length;ie++)for(var Ae=new Uint32Array(d[ie]),Te=Ae.length,$=0;$<Te;$++){var Ie=Ae[$];if(($<H||Ie!=Ae[$-1]&&Ie!=Ae[$-H])&&ae[Ie]==null&&(ae[Ie]=W.length,W.push(Ie),W.length>=300))break}var de=L?j:!1,Ye=W.length;Ye<=256&&z==!1&&(Ye<=2?q=1:Ye<=4?q=2:Ye<=16?q=4:q=8,j&&(q=8),L=!0);for(var Ue=[],ie=0;ie<d.length;ie++){var ye=new Uint8Array(d[ie]),rt=new Uint32Array(ye.buffer),St=0,Yt=0,Et=H,pt=n,Ht=0;if(ie!=0&&!de){for(var rr=j||ie==1||Ue[Ue.length-2].dispose==2?1:2,mr=0,na=1e9,cr=0;cr<rr;cr++){for(var Nn=new Uint8Array(d[ie-1-cr]),yr=new Uint32Array(d[ie-1-cr]),fa=H,$a=n,Ta=-1,Sa=-1,_r=0;_r<n;_r++)for(var Qr=0;Qr<H;Qr++){var $=_r*H+Qr;rt[$]!=yr[$]&&(Qr<fa&&(fa=Qr),Qr>Ta&&(Ta=Qr),_r<$a&&($a=_r),_r>Sa&&(Sa=_r))}var la=Ta==-1?1:(Ta-fa+1)*(Sa-$a+1);la<na&&(na=la,mr=cr,Ta==-1?(St=Yt=0,Et=pt=1):(St=fa,Yt=$a,Et=Ta-fa+1,pt=Sa-$a+1))}var Nn=new Uint8Array(d[ie-1-mr]);mr==1&&(Ue[Ue.length-1].dispose=2);var ma=new Uint8Array(Et*pt*4);new Uint32Array(ma.buffer),c._copyTile(Nn,H,n,ma,Et,pt,-St,-Yt,0),c._copyTile(ye,H,n,ma,Et,pt,-St,-Yt,3)?(c._copyTile(ye,H,n,ma,Et,pt,-St,-Yt,2),Ht=1):(c._copyTile(ye,H,n,ma,Et,pt,-St,-Yt,0),Ht=0),ye=ma,rt=new Uint32Array(ye.buffer)}var va=4*Et;if(Ye<=256&&z==!1){va=Math.ceil(q*Et/8);for(var ma=new Uint8Array(va*pt),_r=0;_r<pt;_r++){var $=_r*va,Ya=_r*Et;if(q==8)for(var Qr=0;Qr<Et;Qr++)ma[$+Qr]=ae[rt[Ya+Qr]];else if(q==4)for(var Qr=0;Qr<Et;Qr++)ma[$+(Qr>>1)]|=ae[rt[Ya+Qr]]<<4-(Qr&1)*4;else if(q==2)for(var Qr=0;Qr<Et;Qr++)ma[$+(Qr>>2)]|=ae[rt[Ya+Qr]]<<6-(Qr&3)*2;else if(q==1)for(var Qr=0;Qr<Et;Qr++)ma[$+(Qr>>3)]|=ae[rt[Ya+Qr]]<<7-(Qr&7)*1}ye=ma,w=3,re=1}else if(L==!1&&d.length==1){for(var ma=new Uint8Array(Et*pt*3),An=Et*pt,$=0;$<An;$++){var En=$*3,In=$*4;ma[En]=ye[In],ma[En+1]=ye[In+1],ma[En+2]=ye[In+2]}ye=ma,w=2,re=3,va=3*Et}Ue.push({rect:{x:St,y:Yt,width:Et,height:pt},img:ye,bpl:va,bpp:re,blend:Ht,dispose:de?1:0})}return{ctype:w,depth:q,plte:W,gotAlpha:L,frames:Ue}},c.encode._filterZero=function(d,H,n,D,j){for(var z=[],w=0;w<5;w++)if(!(H*D>5e5&&(w==2||w==3||w==4))){for(var q=0;q<H;q++)c.encode._filterLine(j,d,q,D,n,w);if(z.push(h.deflate(j)),n==1)break}for(var re,ne=1e9,ie=0;ie<z.length;ie++)z[ie].length<ne&&(re=ie,ne=z[ie].length);return z[re]},c.encode._filterLine=function(d,H,n,D,j,z){var w=n*D,q=w+n,re=c.decode._paeth;if(d[q]=z,q++,z==0)for(var ne=0;ne<D;ne++)d[q+ne]=H[w+ne];else if(z==1){for(var ne=0;ne<j;ne++)d[q+ne]=H[w+ne];for(var ne=j;ne<D;ne++)d[q+ne]=H[w+ne]-H[w+ne-j]+256&255}else if(n==0){for(var ne=0;ne<j;ne++)d[q+ne]=H[w+ne];if(z==2)for(var ne=j;ne<D;ne++)d[q+ne]=H[w+ne];if(z==3)for(var ne=j;ne<D;ne++)d[q+ne]=H[w+ne]-(H[w+ne-j]>>1)+256&255;if(z==4)for(var ne=j;ne<D;ne++)d[q+ne]=H[w+ne]-re(H[w+ne-j],0,0)+256&255}else{if(z==2)for(var ne=0;ne<D;ne++)d[q+ne]=H[w+ne]+256-H[w+ne-D]&255;if(z==3){for(var ne=0;ne<j;ne++)d[q+ne]=H[w+ne]+256-(H[w+ne-D]>>1)&255;for(var ne=j;ne<D;ne++)d[q+ne]=H[w+ne]+256-(H[w+ne-D]+H[w+ne-j]>>1)&255}if(z==4){for(var ne=0;ne<j;ne++)d[q+ne]=H[w+ne]+256-re(0,H[w+ne-D],0)&255;for(var ne=j;ne<D;ne++)d[q+ne]=H[w+ne]+256-re(H[w+ne-j],H[w+ne-D],H[w+ne-j-D])&255}}},c.crc={table:function(){for(var d=new Uint32Array(256),H=0;H<256;H++){for(var n=H,D=0;D<8;D++)n&1?n=3988292384^n>>>1:n=n>>>1;d[H]=n}return d}(),update:function(d,H,n,D){for(var j=0;j<D;j++)d=c.crc.table[(d^H[n+j])&255]^d>>>8;return d},crc:function(d,H,n){return c.crc.update(4294967295,d,H,n)^4294967295}},c.quantize=function(d,H,n){for(var D=[],j=0,z=0;z<d.length;z++)D.push(c.encode.alphaMul(new Uint8Array(d[z]),n)),j+=d[z].byteLength;for(var w=new Uint8Array(j),q=new Uint32Array(w.buffer),re=0,z=0;z<D.length;z++){for(var ne=D[z],ie=ne.length,Re=0;Re<ie;Re++)w[re+Re]=ne[Re];re+=ie}var Te={i0:0,i1:w.length,bst:null,est:null,tdst:0,left:null,right:null};Te.bst=c.quantize.stats(w,Te.i0,Te.i1),Te.est=c.quantize.estats(Te.bst);for(var $=[Te];$.length<H;){for(var L=0,ae=0,z=0;z<$.length;z++)$[z].est.L>L&&(L=$[z].est.L,ae=z);if(L<.001)break;var W=$[ae],Pe=c.quantize.splitPixels(w,q,W.i0,W.i1,W.est.e,W.est.eMq255),Ie={i0:W.i0,i1:Pe,bst:null,est:null,tdst:0,left:null,right:null};Ie.bst=c.quantize.stats(w,Ie.i0,Ie.i1),Ie.est=c.quantize.estats(Ie.bst);var Ae={i0:Pe,i1:W.i1,bst:null,est:null,tdst:0,left:null,right:null};Ae.bst={R:[],m:[],N:W.bst.N-Ie.bst.N};for(var z=0;z<16;z++)Ae.bst.R[z]=W.bst.R[z]-Ie.bst.R[z];for(var z=0;z<4;z++)Ae.bst.m[z]=W.bst.m[z]-Ie.bst.m[z];Ae.est=c.quantize.estats(Ae.bst),W.left=Ie,W.right=Ae,$[ae]=Ie,$.push(Ae)}$.sort(function(rr,mr){return mr.bst.N-rr.bst.N});for(var de=0;de<D.length;de++){for(var Ye=c.quantize.planeDst,Ue=new Uint8Array(D[de].buffer),ye=new Uint32Array(D[de].buffer),rt=Ue.length,z=0;z<rt;z+=4){for(var St=Ue[z]*.00392156862745098,Yt=Ue[z+1]*(1/255),Et=Ue[z+2]*(1/255),pt=Ue[z+3]*(1/255),Ht=Te;Ht.left;)Ht=Ye(Ht.est,St,Yt,Et,pt)<=0?Ht.left:Ht.right;ye[z>>2]=Ht.est.rgba}D[de]=ye.buffer}return{bufs:D,plte:$}},c.quantize.getNearest=function(d,H,n,D,j){if(d.left==null)return d.tdst=c.quantize.dist(d.est.q,H,n,D,j),d;var z=c.quantize.planeDst(d.est,H,n,D,j),w=d.left,q=d.right;z>0&&(w=d.right,q=d.left);var re=c.quantize.getNearest(w,H,n,D,j);if(re.tdst<=z*z)return re;var ne=c.quantize.getNearest(q,H,n,D,j);return ne.tdst<re.tdst?ne:re},c.quantize.planeDst=function(d,H,n,D,j){var z=d.e;return z[0]*H+z[1]*n+z[2]*D+z[3]*j-d.eMq},c.quantize.dist=function(d,H,n,D,j){var z=H-d[0],w=n-d[1],q=D-d[2],re=j-d[3];return z*z+w*w+q*q+re*re},c.quantize.splitPixels=function(d,H,n,D,j,z){var w=c.quantize.vecDot;for(D-=4;n<D;){for(;w(d,n,j)<=z;)n+=4;for(;w(d,D,j)>z;)D-=4;if(n>=D)break;var q=H[n>>2];H[n>>2]=H[D>>2],H[D>>2]=q,n+=4,D-=4}for(;w(d,n,j)>z;)n-=4;return n+4},c.quantize.vecDot=function(d,H,n){return d[H]*n[0]+d[H+1]*n[1]+d[H+2]*n[2]+d[H+3]*n[3]},c.quantize.stats=function(d,H,n){for(var D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],j=[0,0,0,0],z=n-H>>2,w=H;w<n;w+=4){var q=d[w]*.00392156862745098,re=d[w+1]*(1/255),ne=d[w+2]*(1/255),ie=d[w+3]*(1/255);j[0]+=q,j[1]+=re,j[2]+=ne,j[3]+=ie,D[0]+=q*q,D[1]+=q*re,D[2]+=q*ne,D[3]+=q*ie,D[5]+=re*re,D[6]+=re*ne,D[7]+=re*ie,D[10]+=ne*ne,D[11]+=ne*ie,D[15]+=ie*ie}return D[4]=D[1],D[8]=D[2],D[12]=D[3],D[9]=D[6],D[13]=D[7],D[14]=D[11],{R:D,m:j,N:z}},c.quantize.estats=function(d){var H=d.R,n=d.m,D=d.N,j=n[0],z=n[1],w=n[2],q=n[3],re=D==0?0:1/D,ne=[H[0]-j*j*re,H[1]-j*z*re,H[2]-j*w*re,H[3]-j*q*re,H[4]-z*j*re,H[5]-z*z*re,H[6]-z*w*re,H[7]-z*q*re,H[8]-w*j*re,H[9]-w*z*re,H[10]-w*w*re,H[11]-w*q*re,H[12]-q*j*re,H[13]-q*z*re,H[14]-q*w*re,H[15]-q*q*re],ie=ne,Re=c.M4,Te=[.5,.5,.5,.5],$=0,L=0;if(D!=0)for(var ae=0;ae<10&&(Te=Re.multVec(ie,Te),L=Math.sqrt(Re.dot(Te,Te)),Te=Re.sml(1/L,Te),!(Math.abs(L-$)<1e-9));ae++)$=L;var W=[j*re,z*re,w*re,q*re],Pe=Re.dot(Re.sml(255,W),Te),Ie=W[3]<.001?0:1/W[3];return{Cov:ne,q:W,e:Te,L:$,eMq255:Pe,eMq:Re.dot(Te,W),rgba:(Math.round(255*W[3])<<24|Math.round(255*W[2]*Ie)<<16|Math.round(255*W[1]*Ie)<<8|Math.round(255*W[0]*Ie)<<0)>>>0}},c.M4={multVec:function(d,H){return[d[0]*H[0]+d[1]*H[1]+d[2]*H[2]+d[3]*H[3],d[4]*H[0]+d[5]*H[1]+d[6]*H[2]+d[7]*H[3],d[8]*H[0]+d[9]*H[1]+d[10]*H[2]+d[11]*H[3],d[12]*H[0]+d[13]*H[1]+d[14]*H[2]+d[15]*H[3]]},dot:function(d,H){return d[0]*H[0]+d[1]*H[1]+d[2]*H[2]+d[3]*H[3]},sml:function(d,H){return[d*H[0],d*H[1],d*H[2],d*H[3]]}},c.encode.alphaMul=function(d,H){for(var n=new Uint8Array(d.length),D=d.length>>2,j=0;j<D;j++){var z=j<<2,w=d[z+3];H&&(w=w<128?0:255);var q=w*(1/255);n[z+0]=d[z+0]*q,n[z+1]=d[z+1]*q,n[z+2]=d[z+2]*q,n[z+3]=w}return n}}(o,R)})()})(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 t=new Uint8Array([170,187]);return new Uint16Array(t.buffer)[0]===48042}function range(...t){if(t.length===1){const[o]=t;return new Array(o).fill(void 0).map((R,c)=>c)}else{const[o,R,c=1]=t;if(c===0)throw new Error("Argument step must be nonzero.");const h=[];for(let d=o;c>0?d<R:d>R;d+=c)h.push(d);return h}}function fetchPNGData(t,o,R){return KE(this,null,function*(){return new Promise((c,h)=>{const d=new XMLHttpRequest;d.open("GET",t,!0),d.responseType="arraybuffer",d.addEventListener("load",()=>{c(d.response)}),d.addEventListener("error",h),d.send(null)}).then(c=>{const h=UPNG.exports.decode(c),d=UPNG.exports.toRGBA8(h)[0];return new Uint8Array(d)}).catch(()=>createNoDataTile(o,R))})}function typedArraysAreEqual(t,o){return t.byteLength!==o.byteLength?!1:t.every((R,c)=>R===o[c])}function getTransformMatrix(t,o){const R=2/t,c=-2/o;return[R,0,0,0,0,c,0,0,0,0,1,0,-1,1,0,1]}function getTexCoordVerticesTriangleStripQuad(t){const[{x:o,y:R},{x:c,y:h}]=t;return[[o,R],[c,R],[o,h],[c,h]]}const createNoDataTile=lodash.exports.memoize((t,o=256)=>{const R=new Float32Array(o*o);return R.fill(t),new Uint8Array(R.buffer)});function defineMacros(t,o){return`${Object.keys(o).map(c=>`#define ${c} ${o[c]}
|
|
208
|
+
northing meters`+t;var q=w/2,re=0,ne=0,ie,Re,Te,$,L;return q>0&&(ie=1e5/Math.pow(10,q),Re=t.substring(d,d+q),re=parseFloat(Re)*ie,Te=t.substring(d+q),ne=parseFloat(Te)*ie),$=re+j,L=ne+z,{easting:$,northing:L,zoneLetter:n,zoneNumber:H,accuracy:ie}}function getEastingFromChar(t,o){for(var R=SET_ORIGIN_COLUMN_LETTERS.charCodeAt(o-1),c=1e5,h=!1;R!==t.charCodeAt(0);){if(R++,R===I&&R++,R===O&&R++,R>Z){if(h)throw"Bad character: "+t;R=A,h=!0}c+=1e5}return c}function getNorthingFromChar(t,o){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var R=SET_ORIGIN_ROW_LETTERS.charCodeAt(o-1),c=0,h=!1;R!==t.charCodeAt(0);){if(R++,R===I&&R++,R===O&&R++,R>V){if(h)throw"Bad character: "+t;R=A,h=!0}c+=1e5}return c}function getMinNorthing(t){var o;switch(t){case"C":o=11e5;break;case"D":o=2e6;break;case"E":o=28e5;break;case"F":o=37e5;break;case"G":o=46e5;break;case"H":o=55e5;break;case"J":o=64e5;break;case"K":o=73e5;break;case"L":o=82e5;break;case"M":o=91e5;break;case"N":o=0;break;case"P":o=8e5;break;case"Q":o=17e5;break;case"R":o=26e5;break;case"S":o=35e5;break;case"T":o=44e5;break;case"U":o=53e5;break;case"V":o=62e5;break;case"W":o=7e6;break;case"X":o=79e5;break;default:o=-1}if(o>=0)return o;throw"Invalid zone letter: "+t}function Point(t,o,R){if(!(this instanceof Point))return new Point(t,o,R);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if(typeof t=="object")this.x=t.x,this.y=t.y,this.z=t.z||0;else if(typeof t=="string"&&typeof o=="undefined"){var c=t.split(",");this.x=parseFloat(c[0],10),this.y=parseFloat(c[1],10),this.z=parseFloat(c[2],10)||0}else this.x=t,this.y=o,this.z=R||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Point.fromMGRS=function(t){return new Point(toPoint(t))},Point.prototype.toMGRS=function(t){return forward$u([this.x,this.y],t)};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(t){var o=[];o[0]=C00-t*(C02+t*(C04+t*(C06+t*C08))),o[1]=t*(C22-t*(C04+t*(C06+t*C08)));var R=t*t;return o[2]=R*(C44-t*(C46+t*C48)),R*=t,o[3]=R*(C66-t*C68),o[4]=R*t*C88,o}function pj_mlfn(t,o,R,c){return R*=o,o*=o,c[0]*t-R*(c[1]+o*(c[2]+o*(c[3]+o*c[4])))}var MAX_ITER$3=20;function pj_inv_mlfn(t,o,R){for(var c=1/(1-o),h=t,d=MAX_ITER$3;d;--d){var H=Math.sin(h),n=1-o*H*H;if(n=(pj_mlfn(h,H,Math.cos(h),R)-t)*(n*Math.sqrt(n))*c,h-=n,Math.abs(n)<EPSLN)return h}return h}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(t){var o=t.x,R=t.y,c=adjust_lon(o-this.long0),h,d,H,n=Math.sin(R),D=Math.cos(R);if(this.es){var z=D*c,w=Math.pow(z,2),q=this.ep2*Math.pow(D,2),re=Math.pow(q,2),ne=Math.abs(D)>EPSLN?Math.tan(R):0,ie=Math.pow(ne,2),Re=Math.pow(ie,2);h=1-this.es*Math.pow(n,2),z=z/Math.sqrt(h);var Te=pj_mlfn(R,n,D,this.en);d=this.a*(this.k0*z*(1+w/6*(1-ie+q+w/20*(5-18*ie+Re+14*q-58*ie*q+w/42*(61+179*Re-Re*ie-479*ie)))))+this.x0,H=this.a*(this.k0*(Te-this.ml0+n*c*z/2*(1+w/12*(5-ie+9*q+4*re+w/30*(61+Re-58*ie+270*q-330*ie*q+w/56*(1385+543*Re-Re*ie-3111*ie))))))+this.y0}else{var j=D*Math.sin(c);if(Math.abs(Math.abs(j)-1)<EPSLN)return 93;if(d=.5*this.a*this.k0*Math.log((1+j)/(1-j))+this.x0,H=D*Math.cos(c)/Math.sqrt(1-Math.pow(j,2)),j=Math.abs(H),j>=1){if(j-1>EPSLN)return 93;H=0}else H=Math.acos(H);R<0&&(H=-H),H=this.a*this.k0*(H-this.lat0)+this.y0}return t.x=d,t.y=H,t}function inverse$t(t){var o,R,c,h,d=(t.x-this.x0)*(1/this.a),H=(t.y-this.y0)*(1/this.a);if(this.es)if(o=this.ml0+H/this.k0,R=pj_inv_mlfn(o,this.es,this.en),Math.abs(R)<HALF_PI){var w=Math.sin(R),q=Math.cos(R),re=Math.abs(q)>EPSLN?Math.tan(R):0,ne=this.ep2*Math.pow(q,2),ie=Math.pow(ne,2),Re=Math.pow(re,2),Te=Math.pow(Re,2);o=1-this.es*Math.pow(w,2);var $=d*Math.sqrt(o)/this.k0,L=Math.pow($,2);o=o*re,c=R-o*L/(1-this.es)*.5*(1-L/12*(5+3*Re-9*ne*Re+ne-4*ie-L/30*(61+90*Re-252*ne*Re+45*Te+46*ne-L/56*(1385+3633*Re+4095*Te+1574*Te*Re)))),h=adjust_lon(this.long0+$*(1-L/6*(1+2*Re+ne-L/20*(5+28*Re+24*Te+8*ne*Re+6*ne-L/42*(61+662*Re+1320*Te+720*Te*Re))))/q)}else c=HALF_PI*sign$1(H),h=0;else{var n=Math.exp(d/this.k0),D=.5*(n-1/n),j=this.lat0+H/this.k0,z=Math.cos(j);o=Math.sqrt((1-Math.pow(z,2))/(1+Math.pow(D,2))),c=Math.asin(o),H<0&&(c=-c),D===0&&z===0?h=0:h=adjust_lon(Math.atan2(D,z)+this.long0)}return t.x=h,t.y=c,t}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$1(t){var o=Math.exp(t);return o=(o-1/o)/2,o}function hypot$1(t,o){t=Math.abs(t),o=Math.abs(o);var R=Math.max(t,o),c=Math.min(t,o)/(R||1);return R*Math.sqrt(1+Math.pow(c,2))}function log1py(t){var o=1+t,R=o-1;return R===0?t:t*Math.log(o)/R}function asinhy(t){var o=Math.abs(t);return o=log1py(o*(1+o/(hypot$1(1,o)+1))),t<0?-o:o}function gatg(t,o){for(var R=2*Math.cos(2*o),c=t.length-1,h=t[c],d=0,H;--c>=0;)H=-d+R*h+t[c],d=h,h=H;return o+H*Math.sin(2*o)}function clens(t,o){for(var R=2*Math.cos(o),c=t.length-1,h=t[c],d=0,H;--c>=0;)H=-d+R*h+t[c],d=h,h=H;return Math.sin(o)*H}function cosh$1(t){var o=Math.exp(t);return o=(o+1/o)/2,o}function clens_cmplx(t,o,R){for(var c=Math.sin(o),h=Math.cos(o),d=sinh$1(R),H=cosh$1(R),n=2*h*H,D=-2*c*d,j=t.length-1,z=t[j],w=0,q=0,re=0,ne,ie;--j>=0;)ne=q,ie=w,q=z,w=re,z=-ne+n*q-D*w+t[j],re=-ie+D*q+n*w;return n=c*H,D=h*d,[n*z-D*re,n*re+D*z]}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 t=this.es/(1+Math.sqrt(1-this.es)),o=t/(2-t),R=o;this.cgb[0]=o*(2+o*(-2/3+o*(-2+o*(116/45+o*(26/45+o*(-2854/675)))))),this.cbg[0]=o*(-2+o*(2/3+o*(4/3+o*(-82/45+o*(32/45+o*(4642/4725)))))),R=R*o,this.cgb[1]=R*(7/3+o*(-8/5+o*(-227/45+o*(2704/315+o*(2323/945))))),this.cbg[1]=R*(5/3+o*(-16/15+o*(-13/9+o*(904/315+o*(-1522/945))))),R=R*o,this.cgb[2]=R*(56/15+o*(-136/35+o*(-1262/105+o*(73814/2835)))),this.cbg[2]=R*(-26/15+o*(34/21+o*(8/5+o*(-12686/2835)))),R=R*o,this.cgb[3]=R*(4279/630+o*(-332/35+o*(-399572/14175))),this.cbg[3]=R*(1237/630+o*(-12/5+o*(-24832/14175))),R=R*o,this.cgb[4]=R*(4174/315+o*(-144838/6237)),this.cbg[4]=R*(-734/315+o*(109598/31185)),R=R*o,this.cgb[5]=R*(601676/22275),this.cbg[5]=R*(444337/155925),R=Math.pow(o,2),this.Qn=this.k0/(1+o)*(1+R*(1/4+R*(1/64+R/256))),this.utg[0]=o*(-.5+o*(2/3+o*(-37/96+o*(1/360+o*(81/512+o*(-96199/604800)))))),this.gtu[0]=o*(.5+o*(-2/3+o*(5/16+o*(41/180+o*(-127/288+o*(7891/37800)))))),this.utg[1]=R*(-1/48+o*(-1/15+o*(437/1440+o*(-46/105+o*(1118711/3870720))))),this.gtu[1]=R*(13/48+o*(-3/5+o*(557/1440+o*(281/630+o*(-1983433/1935360))))),R=R*o,this.utg[2]=R*(-17/480+o*(37/840+o*(209/4480+o*(-5569/90720)))),this.gtu[2]=R*(61/240+o*(-103/140+o*(15061/26880+o*(167603/181440)))),R=R*o,this.utg[3]=R*(-4397/161280+o*(11/504+o*(830251/7257600))),this.gtu[3]=R*(49561/161280+o*(-179/168+o*(6601661/7257600))),R=R*o,this.utg[4]=R*(-4583/161280+o*(108847/3991680)),this.gtu[4]=R*(34729/80640+o*(-3418889/1995840)),R=R*o,this.utg[5]=R*(-20648693/638668800),this.gtu[5]=R*(212378941/319334400);var c=gatg(this.cbg,this.lat0);this.Zb=-this.Qn*(c+clens(this.gtu,2*c))}function forward$s(t){var o=adjust_lon(t.x-this.long0),R=t.y;R=gatg(this.cbg,R);var c=Math.sin(R),h=Math.cos(R),d=Math.sin(o),H=Math.cos(o);R=Math.atan2(c,H*h),o=Math.atan2(d*h,hypot$1(c,h*H)),o=asinhy(Math.tan(o));var n=clens_cmplx(this.gtu,2*R,2*o);R=R+n[0],o=o+n[1];var D,j;return Math.abs(o)<=2.623395162778?(D=this.a*(this.Qn*o)+this.x0,j=this.a*(this.Qn*R+this.Zb)+this.y0):(D=1/0,j=1/0),t.x=D,t.y=j,t}function inverse$s(t){var o=(t.x-this.x0)*(1/this.a),R=(t.y-this.y0)*(1/this.a);R=(R-this.Zb)/this.Qn,o=o/this.Qn;var c,h;if(Math.abs(o)<=2.623395162778){var d=clens_cmplx(this.utg,2*R,2*o);R=R+d[0],o=o+d[1],o=Math.atan(sinh$1(o));var H=Math.sin(R),n=Math.cos(R),D=Math.sin(o),j=Math.cos(o);R=Math.atan2(H*j,hypot$1(D,j*n)),o=Math.atan2(D,j*n),c=adjust_lon(o+this.long0),h=gatg(this.cgb,R)}else c=1/0,h=1/0;return t.x=c,t.y=h,t}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(t,o){if(t===void 0){if(t=Math.floor((adjust_lon(o)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var dependsOn="etmerc";function init$t(){var t=adjust_zone(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-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(t,o){return Math.pow((1-t)/(1+t),o)}var MAX_ITER$2=20;function init$s(){var t=Math.sin(this.lat0),o=Math.cos(this.lat0);o*=o,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*o*o/(1-this.es)),this.phic0=Math.asin(t/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*t,this.ratexp))}function forward$r(t){var o=t.x,R=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*R+FORTPI),this.C)*srat(this.e*Math.sin(R),this.ratexp))-HALF_PI,t.x=this.C*o,t}function inverse$r(t){for(var o=1e-14,R=t.x/this.C,c=t.y,h=Math.pow(Math.tan(.5*c+FORTPI)/this.K,1/this.C),d=MAX_ITER$2;d>0&&(c=2*Math.atan(h*srat(this.e*Math.sin(t.y),-.5*this.e))-HALF_PI,!(Math.abs(c-t.y)<o));--d)t.y=c;return d?(t.x=R,t.y=c,t):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(t){var o,R,c,h;return t.x=adjust_lon(t.x-this.long0),gauss.forward.apply(this,[t]),o=Math.sin(t.y),R=Math.cos(t.y),c=Math.cos(t.x),h=this.k0*this.R2/(1+this.sinc0*o+this.cosc0*R*c),t.x=h*R*Math.sin(t.x),t.y=h*(this.cosc0*o-this.sinc0*R*c),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function inverse$q(t){var o,R,c,h,d;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,d=hypot$1(t.x,t.y)){var H=2*Math.atan2(d,this.R2);o=Math.sin(H),R=Math.cos(H),h=Math.asin(R*this.sinc0+t.y*o*this.cosc0/d),c=Math.atan2(t.x*o,d*this.cosc0*R-t.y*this.sinc0*o)}else h=this.phic0,c=0;return t.x=c,t.y=h,gauss.inverse.apply(this,[t]),t.x=adjust_lon(t.x+this.long0),t}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_(t,o,R){return o*=R,Math.tan(.5*(HALF_PI+t))*Math.pow((1-o)/(1+o),.5*R)}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(this.ssfn_(this.lat0,this.sinlat0,this.e))-HALF_PI,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function forward$p(t){var o=t.x,R=t.y,c=Math.sin(R),h=Math.cos(R),d,H,n,D,j,z,w=adjust_lon(o-this.long0);return Math.abs(Math.abs(o-this.long0)-Math.PI)<=EPSLN&&Math.abs(R+this.lat0)<=EPSLN?(t.x=NaN,t.y=NaN,t):this.sphere?(d=2*this.k0/(1+this.sinlat0*c+this.coslat0*h*Math.cos(w)),t.x=this.a*d*h*Math.sin(w)+this.x0,t.y=this.a*d*(this.coslat0*c-this.sinlat0*h*Math.cos(w))+this.y0,t):(H=2*Math.atan(this.ssfn_(R,c,this.e))-HALF_PI,D=Math.cos(H),n=Math.sin(H),Math.abs(this.coslat0)<=EPSLN?(j=tsfnz(this.e,R*this.con,this.con*c),z=2*this.a*this.k0*j/this.cons,t.x=this.x0+z*Math.sin(o-this.long0),t.y=this.y0-this.con*z*Math.cos(o-this.long0),t):(Math.abs(this.sinlat0)<EPSLN?(d=2*this.a*this.k0/(1+D*Math.cos(w)),t.y=d*n):(d=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*n+this.cosX0*D*Math.cos(w))),t.y=d*(this.cosX0*n-this.sinX0*D*Math.cos(w))+this.y0),t.x=d*D*Math.sin(w)+this.x0,t))}function inverse$p(t){t.x-=this.x0,t.y-=this.y0;var o,R,c,h,d,H=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var n=2*Math.atan(H/(2*this.a*this.k0));return o=this.long0,R=this.lat0,H<=EPSLN?(t.x=o,t.y=R,t):(R=Math.asin(Math.cos(n)*this.sinlat0+t.y*Math.sin(n)*this.coslat0/H),Math.abs(this.coslat0)<EPSLN?this.lat0>0?o=adjust_lon(this.long0+Math.atan2(t.x,-1*t.y)):o=adjust_lon(this.long0+Math.atan2(t.x,t.y)):o=adjust_lon(this.long0+Math.atan2(t.x*Math.sin(n),H*this.coslat0*Math.cos(n)-t.y*this.sinlat0*Math.sin(n))),t.x=o,t.y=R,t)}else if(Math.abs(this.coslat0)<=EPSLN){if(H<=EPSLN)return R=this.lat0,o=this.long0,t.x=o,t.y=R,t;t.x*=this.con,t.y*=this.con,c=H*this.cons/(2*this.a*this.k0),R=this.con*phi2z(this.e,c),o=this.con*adjust_lon(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else h=2*Math.atan(H*this.cosX0/(2*this.a*this.k0*this.ms1)),o=this.long0,H<=EPSLN?d=this.X0:(d=Math.asin(Math.cos(h)*this.sinX0+t.y*Math.sin(h)*this.cosX0/H),o=adjust_lon(this.long0+Math.atan2(t.x*Math.sin(h),H*this.cosX0*Math.cos(h)-t.y*this.sinX0*Math.sin(h)))),R=-1*phi2z(this.e,Math.tan(.5*(HALF_PI+d)));return t.x=o,t.y=R,t}var names$q=["stere","Stereographic_South_Pole","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 t=this.lat0;this.lambda0=this.long0;var o=Math.sin(t),R=this.a,c=this.rf,h=1/c,d=2*h-Math.pow(h,2),H=this.e=Math.sqrt(d);this.R=this.k0*R*Math.sqrt(1-d)/(1-d*Math.pow(o,2)),this.alpha=Math.sqrt(1+d/(1-d)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(o/this.alpha);var n=Math.log(Math.tan(Math.PI/4+this.b0/2)),D=Math.log(Math.tan(Math.PI/4+t/2)),j=Math.log((1+H*o)/(1-H*o));this.K=n-this.alpha*D+this.alpha*H/2*j}function forward$o(t){var o=Math.log(Math.tan(Math.PI/4-t.y/2)),R=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),c=-this.alpha*(o+R)+this.K,h=2*(Math.atan(Math.exp(c))-Math.PI/4),d=this.alpha*(t.x-this.lambda0),H=Math.atan(Math.sin(d)/(Math.sin(this.b0)*Math.tan(h)+Math.cos(this.b0)*Math.cos(d))),n=Math.asin(Math.cos(this.b0)*Math.sin(h)-Math.sin(this.b0)*Math.cos(h)*Math.cos(d));return t.y=this.R/2*Math.log((1+Math.sin(n))/(1-Math.sin(n)))+this.y0,t.x=this.R*H+this.x0,t}function inverse$o(t){for(var o=t.x-this.x0,R=t.y-this.y0,c=o/this.R,h=2*(Math.atan(Math.exp(R/this.R))-Math.PI/4),d=Math.asin(Math.cos(this.b0)*Math.sin(h)+Math.sin(this.b0)*Math.cos(h)*Math.cos(c)),H=Math.atan(Math.sin(c)/(Math.cos(this.b0)*Math.cos(c)-Math.sin(this.b0)*Math.tan(h))),n=this.lambda0+H/this.alpha,D=0,j=d,z=-1e3,w=0;Math.abs(j-z)>1e-7;){if(++w>20)return;D=1/this.alpha*(Math.log(Math.tan(Math.PI/4+d/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(j))/2)),z=j,j=2*Math.atan(Math.exp(D))-Math.PI/2}return t.x=n,t.y=j,t}var names$p=["somerc"];const somerc={init:init$p,forward:forward$o,inverse:inverse$o,names:names$p};var TOL=1e-7;function isTypeA(t){var o=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],R=typeof t.PROJECTION=="object"?Object.keys(t.PROJECTION)[0]:t.PROJECTION;return"no_uoff"in t||"no_off"in t||o.indexOf(R)!==-1}function init$o(){var t,o,R,c,h,d,H,n,D,j,z=0,w,q=0,re=0,ne=0,ie=0,Re=0,Te=0;this.no_off=isTypeA(this),this.no_rot="no_rot"in this;var $=!1;"alpha"in this&&($=!0);var L=!1;if("rectified_grid_angle"in this&&(L=!0),$&&(Te=this.alpha),L&&(z=this.rectified_grid_angle*D2R$1),$||L)q=this.longc;else if(re=this.long1,ie=this.lat1,ne=this.long2,Re=this.lat2,Math.abs(ie-Re)<=TOL||(t=Math.abs(ie))<=TOL||Math.abs(t-HALF_PI)<=TOL||Math.abs(Math.abs(this.lat0)-HALF_PI)<=TOL||Math.abs(Math.abs(Re)-HALF_PI)<=TOL)throw new Error;var ae=1-this.es;o=Math.sqrt(ae),Math.abs(this.lat0)>EPSLN?(n=Math.sin(this.lat0),R=Math.cos(this.lat0),t=1-this.es*n*n,this.B=R*R,this.B=Math.sqrt(1+this.es*this.B*this.B/ae),this.A=this.B*this.k0*o/t,c=this.B*o/(R*Math.sqrt(t)),h=c*c-1,h<=0?h=0:(h=Math.sqrt(h),this.lat0<0&&(h=-h)),this.E=h+=c,this.E*=Math.pow(tsfnz(this.e,this.lat0,n),this.B)):(this.B=1/o,this.A=this.k0,this.E=c=h=1),$||L?($?(w=Math.asin(Math.sin(Te)/c),L||(z=Te)):(w=z,Te=Math.asin(c*Math.sin(w))),this.lam0=q-Math.asin(.5*(h-1/h)*Math.tan(w))/this.B):(d=Math.pow(tsfnz(this.e,ie,Math.sin(ie)),this.B),H=Math.pow(tsfnz(this.e,Re,Math.sin(Re)),this.B),h=this.E/d,D=(H-d)/(H+d),j=this.E*this.E,j=(j-H*d)/(j+H*d),t=re-ne,t<-Math.pi?ne-=TWO_PI:t>Math.pi&&(ne+=TWO_PI),this.lam0=adjust_lon(.5*(re+ne)-Math.atan(j*Math.tan(.5*this.B*(re-ne))/D)/this.B),w=Math.atan(2*Math.sin(this.B*adjust_lon(re-this.lam0))/(h-1/h)),z=Te=Math.asin(c*Math.sin(w))),this.singam=Math.sin(w),this.cosgam=Math.cos(w),this.sinrot=Math.sin(z),this.cosrot=Math.cos(z),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(c*c-1)/Math.cos(Te))),this.lat0<0&&(this.u_0=-this.u_0)),h=.5*w,this.v_pole_n=this.ArB*Math.log(Math.tan(FORTPI-h)),this.v_pole_s=this.ArB*Math.log(Math.tan(FORTPI+h))}function forward$n(t){var o={},R,c,h,d,H,n,D,j;if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-HALF_PI)>EPSLN){if(H=this.E/Math.pow(tsfnz(this.e,t.y,Math.sin(t.y)),this.B),n=1/H,R=.5*(H-n),c=.5*(H+n),d=Math.sin(this.B*t.x),h=(R*this.singam-d*this.cosgam)/c,Math.abs(Math.abs(h)-1)<EPSLN)throw new Error;j=.5*this.ArB*Math.log((1-h)/(1+h)),n=Math.cos(this.B*t.x),Math.abs(n)<TOL?D=this.A*t.x:D=this.ArB*Math.atan2(R*this.cosgam+d*this.singam,n)}else j=t.y>0?this.v_pole_n:this.v_pole_s,D=this.ArB*t.y;return this.no_rot?(o.x=D,o.y=j):(D-=this.u_0,o.x=j*this.cosrot+D*this.sinrot,o.y=D*this.cosrot-j*this.sinrot),o.x=this.a*o.x+this.x0,o.y=this.a*o.y+this.y0,o}function inverse$n(t){var o,R,c,h,d,H,n,D={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(R=t.y,o=t.x):(R=t.x*this.cosrot-t.y*this.sinrot,o=t.y*this.cosrot+t.x*this.sinrot+this.u_0),c=Math.exp(-this.BrA*R),h=.5*(c-1/c),d=.5*(c+1/c),H=Math.sin(this.BrA*o),n=(H*this.cosgam+h*this.singam)/d,Math.abs(Math.abs(n)-1)<EPSLN)D.x=0,D.y=n<0?-HALF_PI:HALF_PI;else{if(D.y=this.E/Math.sqrt((1+n)/(1-n)),D.y=phi2z(this.e,Math.pow(D.y,1/this.B)),D.y===1/0)throw new Error;D.x=-this.rB*Math.atan2(h*this.cosgam-H*this.singam,Math.cos(this.BrA*o))}return D.x+=this.lam0,D}var names$o=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","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 t=this.b/this.a;this.e=Math.sqrt(1-t*t);var o=Math.sin(this.lat1),R=Math.cos(this.lat1),c=msfnz(this.e,o,R),h=tsfnz(this.e,this.lat1,o),d=Math.sin(this.lat2),H=Math.cos(this.lat2),n=msfnz(this.e,d,H),D=tsfnz(this.e,this.lat2,d),j=tsfnz(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>EPSLN?this.ns=Math.log(c/n)/Math.log(h/D):this.ns=o,isNaN(this.ns)&&(this.ns=o),this.f0=c/(this.ns*Math.pow(h,this.ns)),this.rh=this.a*this.f0*Math.pow(j,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function forward$m(t){var o=t.x,R=t.y;Math.abs(2*Math.abs(R)-Math.PI)<=EPSLN&&(R=sign$1(R)*(HALF_PI-2*EPSLN));var c=Math.abs(Math.abs(R)-HALF_PI),h,d;if(c>EPSLN)h=tsfnz(this.e,R,Math.sin(R)),d=this.a*this.f0*Math.pow(h,this.ns);else{if(c=R*this.ns,c<=0)return null;d=0}var H=this.ns*adjust_lon(o-this.long0);return t.x=this.k0*(d*Math.sin(H))+this.x0,t.y=this.k0*(this.rh-d*Math.cos(H))+this.y0,t}function inverse$m(t){var o,R,c,h,d,H=(t.x-this.x0)/this.k0,n=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(o=Math.sqrt(H*H+n*n),R=1):(o=-Math.sqrt(H*H+n*n),R=-1);var D=0;if(o!==0&&(D=Math.atan2(R*H,R*n)),o!==0||this.ns>0){if(R=1/this.ns,c=Math.pow(o/(this.a*this.f0),R),h=phi2z(this.e,c),h===-9999)return null}else h=-HALF_PI;return d=adjust_lon(D/this.ns+this.long0),t.x=d,t.y=h,t}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(t){var o,R,c,h,d,H,n,D=t.x,j=t.y,z=adjust_lon(D-this.long0);return o=Math.pow((1+this.e*Math.sin(j))/(1-this.e*Math.sin(j)),this.alfa*this.e/2),R=2*(Math.atan(this.k*Math.pow(Math.tan(j/2+this.s45),this.alfa)/o)-this.s45),c=-z*this.alfa,h=Math.asin(Math.cos(this.ad)*Math.sin(R)+Math.sin(this.ad)*Math.cos(R)*Math.cos(c)),d=Math.asin(Math.cos(R)*Math.sin(c)/Math.cos(h)),H=this.n*d,n=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(h/2+this.s45),this.n),t.y=n*Math.cos(H)/1,t.x=n*Math.sin(H)/1,this.czech||(t.y*=-1,t.x*=-1),t}function inverse$l(t){var o,R,c,h,d,H,n,D,j=t.x;t.x=t.y,t.y=j,this.czech||(t.y*=-1,t.x*=-1),H=Math.sqrt(t.x*t.x+t.y*t.y),d=Math.atan2(t.y,t.x),h=d/Math.sin(this.s0),c=2*(Math.atan(Math.pow(this.ro0/H,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),o=Math.asin(Math.cos(this.ad)*Math.sin(c)-Math.sin(this.ad)*Math.cos(c)*Math.cos(h)),R=Math.asin(Math.cos(c)*Math.sin(h)/Math.cos(o)),t.x=this.long0-R/this.alfa,n=o,D=0;var z=0;do t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(o/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(n))/(1-this.e*Math.sin(n)),this.e/2))-this.s45),Math.abs(n-t.y)<1e-10&&(D=1),n=t.y,z+=1;while(D===0&&z<15);return z>=15?null:t}var names$m=["Krovak","krovak"];const krovak={init:init$m,forward:forward$l,inverse:inverse$l,names:names$m};function mlfn(t,o,R,c,h){return t*h-o*Math.sin(2*h)+R*Math.sin(4*h)-c*Math.sin(6*h)}function e0fn(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function e1fn(t){return .375*t*(1+.25*t*(1+.46875*t))}function e2fn(t){return .05859375*t*t*(1+.75*t)}function e3fn(t){return t*t*t*(35/3072)}function gN(t,o,R){var c=o*R;return t/Math.sqrt(1-c*c)}function adjust_lat(t){return Math.abs(t)<HALF_PI?t:t-sign$1(t)*Math.PI}function imlfn(t,o,R,c,h){var d,H;d=t/o;for(var n=0;n<15;n++)if(H=(t-(o*d-R*Math.sin(2*d)+c*Math.sin(4*d)-h*Math.sin(6*d)))/(o-2*R*Math.cos(2*d)+4*c*Math.cos(4*d)-6*h*Math.cos(6*d)),d+=H,Math.abs(H)<=1e-10)return d;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(t){var o,R,c=t.x,h=t.y;if(c=adjust_lon(c-this.long0),this.sphere)o=this.a*Math.asin(Math.cos(h)*Math.sin(c)),R=this.a*(Math.atan2(Math.tan(h),Math.cos(c))-this.lat0);else{var d=Math.sin(h),H=Math.cos(h),n=gN(this.a,this.e,d),D=Math.tan(h)*Math.tan(h),j=c*Math.cos(h),z=j*j,w=this.es*H*H/(1-this.es),q=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,h);o=n*j*(1-z*D*(1/6-(8-D+8*w)*z/120)),R=q-this.ml0+n*d/H*z*(.5+(5-D+6*w)*z/24)}return t.x=o+this.x0,t.y=R+this.y0,t}function inverse$k(t){t.x-=this.x0,t.y-=this.y0;var o=t.x/this.a,R=t.y/this.a,c,h;if(this.sphere){var d=R+this.lat0;c=Math.asin(Math.sin(d)*Math.cos(o)),h=Math.atan2(Math.tan(o),Math.cos(d))}else{var H=this.ml0/this.a+R,n=imlfn(H,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(n)-HALF_PI)<=EPSLN)return t.x=this.long0,t.y=HALF_PI,R<0&&(t.y*=-1),t;var D=gN(this.a,this.e,Math.sin(n)),j=D*D*D/this.a/this.a*(1-this.es),z=Math.pow(Math.tan(n),2),w=o*this.a/D,q=w*w;c=n-D*Math.tan(n)/j*w*w*(.5-(1+3*z)*w*w/24),h=w*(1-q*(z/3+(1+3*z)*z*q/15))/Math.cos(n)}return t.x=adjust_lon(h+this.long0),t.y=adjust_lat(c),t}var names$l=["Cassini","Cassini_Soldner","cass"];const cass={init:init$l,forward:forward$k,inverse:inverse$k,names:names$l};function qsfnz(t,o){var R;return t>1e-7?(R=t*o,(1-t*t)*(o/(1-R*R)-.5/t*Math.log((1-R)/(1+R)))):2*o}var S_POLE=1,N_POLE=2,EQUIT=3,OBLIQ=4;function init$k(){var t=Math.abs(this.lat0);if(Math.abs(t-HALF_PI)<EPSLN?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<EPSLN?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var o;switch(this.qp=qsfnz(this.e,1),this.mmf=.5/(1-this.es),this.apa=authset(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),o=Math.sin(this.lat0),this.sinb1=qsfnz(this.e,o)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*o*o)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function forward$j(t){var o,R,c,h,d,H,n,D,j,z,w=t.x,q=t.y;if(w=adjust_lon(w-this.long0),this.sphere){if(d=Math.sin(q),z=Math.cos(q),c=Math.cos(w),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(R=this.mode===this.EQUIT?1+z*c:1+this.sinph0*d+this.cosph0*z*c,R<=EPSLN)return null;R=Math.sqrt(2/R),o=R*z*Math.sin(w),R*=this.mode===this.EQUIT?d:this.cosph0*d-this.sinph0*z*c}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(c=-c),Math.abs(q+this.lat0)<EPSLN)return null;R=FORTPI-q*.5,R=2*(this.mode===this.S_POLE?Math.cos(R):Math.sin(R)),o=R*Math.sin(w),R*=c}}else{switch(n=0,D=0,j=0,c=Math.cos(w),h=Math.sin(w),d=Math.sin(q),H=qsfnz(this.e,d),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(n=H/this.qp,D=Math.sqrt(1-n*n)),this.mode){case this.OBLIQ:j=1+this.sinb1*n+this.cosb1*D*c;break;case this.EQUIT:j=1+D*c;break;case this.N_POLE:j=HALF_PI+q,H=this.qp-H;break;case this.S_POLE:j=q-HALF_PI,H=this.qp+H;break}if(Math.abs(j)<EPSLN)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:j=Math.sqrt(2/j),this.mode===this.OBLIQ?R=this.ymf*j*(this.cosb1*n-this.sinb1*D*c):R=(j=Math.sqrt(2/(1+D*c)))*n*this.ymf,o=this.xmf*j*D*h;break;case this.N_POLE:case this.S_POLE:H>=0?(o=(j=Math.sqrt(H))*h,R=c*(this.mode===this.S_POLE?j:-j)):o=R=0;break}}return t.x=this.a*o+this.x0,t.y=this.a*R+this.y0,t}function inverse$j(t){t.x-=this.x0,t.y-=this.y0;var o=t.x/this.a,R=t.y/this.a,c,h,d,H,n,D,j;if(this.sphere){var z=0,w,q=0;if(w=Math.sqrt(o*o+R*R),h=w*.5,h>1)return null;switch(h=2*Math.asin(h),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(q=Math.sin(h),z=Math.cos(h)),this.mode){case this.EQUIT:h=Math.abs(w)<=EPSLN?0:Math.asin(R*q/w),o*=q,R=z*w;break;case this.OBLIQ:h=Math.abs(w)<=EPSLN?this.lat0:Math.asin(z*this.sinph0+R*q*this.cosph0/w),o*=q*this.cosph0,R=(z-Math.sin(h)*this.sinph0)*w;break;case this.N_POLE:R=-R,h=HALF_PI-h;break;case this.S_POLE:h-=HALF_PI;break}c=R===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(o,R)}else{if(j=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(o/=this.dd,R*=this.dd,D=Math.sqrt(o*o+R*R),D<EPSLN)return t.x=this.long0,t.y=this.lat0,t;H=2*Math.asin(.5*D/this.rq),d=Math.cos(H),o*=H=Math.sin(H),this.mode===this.OBLIQ?(j=d*this.sinb1+R*H*this.cosb1/D,n=this.qp*j,R=D*this.cosb1*d-R*this.sinb1*H):(j=R*H/D,n=this.qp*j,R=D*d)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(R=-R),n=o*o+R*R,!n)return t.x=this.long0,t.y=this.lat0,t;j=1-n/this.qp,this.mode===this.S_POLE&&(j=-j)}c=Math.atan2(o,R),h=authlat(Math.asin(j),this.apa)}return t.x=adjust_lon(this.long0+c),t.y=h,t}var P00=.3333333333333333,P01=.17222222222222222,P02=.10257936507936508,P10=.06388888888888888,P11=.0664021164021164,P20=.016415012942191543;function authset(t){var o,R=[];return R[0]=t*P00,o=t*t,R[0]+=o*P01,R[1]=o*P10,o*=t,R[0]+=o*P02,R[1]+=o*P11,R[2]=o*P20,R}function authlat(t,o){var R=t+t;return t+o[0]*Math.sin(R)+o[1]*Math.sin(R+R)+o[2]*Math.sin(R+R+R)}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(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}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(t){var o=t.x,R=t.y;this.sin_phi=Math.sin(R),this.cos_phi=Math.cos(R);var c=qsfnz(this.e3,this.sin_phi),h=this.a*Math.sqrt(this.c-this.ns0*c)/this.ns0,d=this.ns0*adjust_lon(o-this.long0),H=h*Math.sin(d)+this.x0,n=this.rh-h*Math.cos(d)+this.y0;return t.x=H,t.y=n,t}function inverse$i(t){var o,R,c,h,d,H;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(o=Math.sqrt(t.x*t.x+t.y*t.y),c=1):(o=-Math.sqrt(t.x*t.x+t.y*t.y),c=-1),h=0,o!==0&&(h=Math.atan2(c*t.x,c*t.y)),c=o*this.ns0/this.a,this.sphere?H=Math.asin((this.c-c*c)/(2*this.ns0)):(R=(this.c-c*c)/this.ns0,H=this.phi1z(this.e3,R)),d=adjust_lon(h/this.ns0+this.long0),t.x=d,t.y=H,t}function phi1z(t,o){var R,c,h,d,H,n=asinz(.5*o);if(t<EPSLN)return n;for(var D=t*t,j=1;j<=25;j++)if(R=Math.sin(n),c=Math.cos(n),h=t*R,d=1-h*h,H=.5*d*d/c*(o/(1-D)-R/d+.5/t*Math.log((1-h)/(1+h))),n=n+H,Math.abs(H)<=1e-7)return n;return null}var names$j=["Albers_Conic_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(t){var o,R,c,h,d,H,n,D,j=t.x,z=t.y;return c=adjust_lon(j-this.long0),o=Math.sin(z),R=Math.cos(z),h=Math.cos(c),H=this.sin_p14*o+this.cos_p14*R*h,d=1,H>0||Math.abs(H)<=EPSLN?(n=this.x0+this.a*d*R*Math.sin(c)/H,D=this.y0+this.a*d*(this.cos_p14*o-this.sin_p14*R*h)/H):(n=this.x0+this.infinity_dist*R*Math.sin(c),D=this.y0+this.infinity_dist*(this.cos_p14*o-this.sin_p14*R*h)),t.x=n,t.y=D,t}function inverse$h(t){var o,R,c,h,d,H;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(o=Math.sqrt(t.x*t.x+t.y*t.y))?(h=Math.atan2(o,this.rc),R=Math.sin(h),c=Math.cos(h),H=asinz(c*this.sin_p14+t.y*R*this.cos_p14/o),d=Math.atan2(t.x*R,o*this.cos_p14*c-t.y*this.sin_p14*R),d=adjust_lon(this.long0+d)):(H=this.phic0,d=0),t.x=d,t.y=H,t}var names$i=["gnom"];const gnom={init:init$i,forward:forward$h,inverse:inverse$h,names:names$i};function iqsfnz(t,o){var R=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(o)-R)<1e-6)return o<0?-1*HALF_PI:HALF_PI;for(var c=Math.asin(.5*o),h,d,H,n,D=0;D<30;D++)if(d=Math.sin(c),H=Math.cos(c),n=t*d,h=Math.pow(1-n*n,2)/(2*H)*(o/(1-t*t)-d/(1-n*n)+.5/t*Math.log((1-n)/(1+n))),c+=h,Math.abs(h)<=1e-10)return c;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(t){var o=t.x,R=t.y,c,h,d=adjust_lon(o-this.long0);if(this.sphere)c=this.x0+this.a*d*Math.cos(this.lat_ts),h=this.y0+this.a*Math.sin(R)/Math.cos(this.lat_ts);else{var H=qsfnz(this.e,Math.sin(R));c=this.x0+this.a*this.k0*d,h=this.y0+this.a*H*.5/this.k0}return t.x=c,t.y=h,t}function inverse$g(t){t.x-=this.x0,t.y-=this.y0;var o,R;return this.sphere?(o=adjust_lon(this.long0+t.x/this.a/Math.cos(this.lat_ts)),R=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(R=iqsfnz(this.e,2*t.y*this.k0/this.a),o=adjust_lon(this.long0+t.x/(this.a*this.k0))),t.x=o,t.y=R,t}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(t){var o=t.x,R=t.y,c=adjust_lon(o-this.long0),h=adjust_lat(R-this.lat0);return t.x=this.x0+this.a*c*this.rc,t.y=this.y0+this.a*h,t}function inverse$f(t){var o=t.x,R=t.y;return t.x=adjust_lon(this.long0+(o-this.x0)/(this.a*this.rc)),t.y=adjust_lat(this.lat0+(R-this.y0)/this.a),t}var names$g=["Equirectangular","Equidistant_Cylindrical","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(t){var o=t.x,R=t.y,c,h,d,H=adjust_lon(o-this.long0);if(d=H*Math.sin(R),this.sphere)Math.abs(R)<=EPSLN?(c=this.a*H,h=-1*this.a*this.lat0):(c=this.a*Math.sin(d)/Math.tan(R),h=this.a*(adjust_lat(R-this.lat0)+(1-Math.cos(d))/Math.tan(R)));else if(Math.abs(R)<=EPSLN)c=this.a*H,h=-1*this.ml0;else{var n=gN(this.a,this.e,Math.sin(R))/Math.tan(R);c=n*Math.sin(d),h=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,R)-this.ml0+n*(1-Math.cos(d))}return t.x=c+this.x0,t.y=h+this.y0,t}function inverse$e(t){var o,R,c,h,d,H,n,D,j;if(c=t.x-this.x0,h=t.y-this.y0,this.sphere)if(Math.abs(h+this.a*this.lat0)<=EPSLN)o=adjust_lon(c/this.a+this.long0),R=0;else{H=this.lat0+h/this.a,n=c*c/this.a/this.a+H*H,D=H;var z;for(d=MAX_ITER$1;d;--d)if(z=Math.tan(D),j=-1*(H*(D*z+1)-D-.5*(D*D+n)*z)/((D-H)/z-1),D+=j,Math.abs(j)<=EPSLN){R=D;break}o=adjust_lon(this.long0+Math.asin(c*Math.tan(D)/this.a)/Math.sin(R))}else if(Math.abs(h+this.ml0)<=EPSLN)R=0,o=adjust_lon(this.long0+c/this.a);else{H=(this.ml0+h)/this.a,n=c*c/this.a/this.a+H*H,D=H;var w,q,re,ne,ie;for(d=MAX_ITER$1;d;--d)if(ie=this.e*Math.sin(D),w=Math.sqrt(1-ie*ie)*Math.tan(D),q=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,D),re=this.e0-2*this.e1*Math.cos(2*D)+4*this.e2*Math.cos(4*D)-6*this.e3*Math.cos(6*D),ne=q/this.a,j=(H*(w*ne+1)-ne-.5*w*(ne*ne+n))/(this.es*Math.sin(2*D)*(ne*ne+n-2*H*ne)/(4*w)+(H-ne)*(w*re-2/Math.sin(2*D))-re),D-=j,Math.abs(j)<=EPSLN){R=D;break}w=Math.sqrt(1-this.es*Math.pow(Math.sin(R),2))*Math.tan(R),o=adjust_lon(this.long0+Math.asin(c*w/this.a)/Math.sin(R))}return t.x=o,t.y=R,t}var names$f=["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(t){var o,R=t.x,c=t.y,h=c-this.lat0,d=R-this.long0,H=h/SEC_TO_RAD*1e-5,n=d,D=1,j=0;for(o=1;o<=10;o++)D=D*H,j=j+this.A[o]*D;var z=j,w=n,q=1,re=0,ne,ie,Re=0,Te=0;for(o=1;o<=6;o++)ne=q*z-re*w,ie=re*z+q*w,q=ne,re=ie,Re=Re+this.B_re[o]*q-this.B_im[o]*re,Te=Te+this.B_im[o]*q+this.B_re[o]*re;return t.x=Te*this.a+this.x0,t.y=Re*this.a+this.y0,t}function inverse$d(t){var o,R=t.x,c=t.y,h=R-this.x0,d=c-this.y0,H=d/this.a,n=h/this.a,D=1,j=0,z,w,q=0,re=0;for(o=1;o<=6;o++)z=D*H-j*n,w=j*H+D*n,D=z,j=w,q=q+this.C_re[o]*D-this.C_im[o]*j,re=re+this.C_im[o]*D+this.C_re[o]*j;for(var ne=0;ne<this.iterations;ne++){var ie=q,Re=re,Te,$,L=H,ae=n;for(o=2;o<=6;o++)Te=ie*q-Re*re,$=Re*q+ie*re,ie=Te,Re=$,L=L+(o-1)*(this.B_re[o]*ie-this.B_im[o]*Re),ae=ae+(o-1)*(this.B_im[o]*ie+this.B_re[o]*Re);ie=1,Re=0;var W=this.B_re[1],Pe=this.B_im[1];for(o=2;o<=6;o++)Te=ie*q-Re*re,$=Re*q+ie*re,ie=Te,Re=$,W=W+o*(this.B_re[o]*ie-this.B_im[o]*Re),Pe=Pe+o*(this.B_im[o]*ie+this.B_re[o]*Re);var Ie=W*W+Pe*Pe;q=(L*W+ae*Pe)/Ie,re=(ae*W-L*Pe)/Ie}var Ae=q,de=re,Ye=1,Ue=0;for(o=1;o<=9;o++)Ye=Ye*Ae,Ue=Ue+this.D[o]*Ye;var ye=this.lat0+Ue*SEC_TO_RAD*1e5,rt=this.long0+de;return t.x=rt,t.y=ye,t}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(t){var o=t.x,R=t.y,c=adjust_lon(o-this.long0),h=this.x0+this.a*c,d=this.y0+this.a*Math.log(Math.tan(Math.PI/4+R/2.5))*1.25;return t.x=h,t.y=d,t}function inverse$c(t){t.x-=this.x0,t.y-=this.y0;var o=adjust_lon(this.long0+t.x/this.a),R=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=o,t.y=R,t}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(t){var o,R,c=t.x,h=t.y;if(c=adjust_lon(c-this.long0),this.sphere){if(!this.m)h=this.n!==1?Math.asin(this.n*Math.sin(h)):h;else for(var d=this.n*Math.sin(h),H=MAX_ITER;H;--H){var n=(this.m*h+Math.sin(h)-d)/(this.m+Math.cos(h));if(h-=n,Math.abs(n)<EPSLN)break}o=this.a*this.C_x*c*(this.m+Math.cos(h)),R=this.a*this.C_y*h}else{var D=Math.sin(h),j=Math.cos(h);R=this.a*pj_mlfn(h,D,j,this.en),o=this.a*c*j/Math.sqrt(1-this.es*D*D)}return t.x=o,t.y=R,t}function inverse$b(t){var o,R,c,h;return t.x-=this.x0,c=t.x/this.a,t.y-=this.y0,o=t.y/this.a,this.sphere?(o/=this.C_y,c=c/(this.C_x*(this.m+Math.cos(o))),this.m?o=asinz((this.m*o+Math.sin(o))/this.n):this.n!==1&&(o=asinz(Math.sin(o)/this.n)),c=adjust_lon(c+this.long0),o=adjust_lat(o)):(o=pj_inv_mlfn(t.y/this.a,this.es,this.en),h=Math.abs(o),h<HALF_PI?(h=Math.sin(o),R=this.long0+t.x*Math.sqrt(1-this.es*h*h)/(this.a*Math.cos(o)),c=adjust_lon(R)):h-EPSLN<HALF_PI&&(c=this.long0)),t.x=c,t.y=o,t}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(t){for(var o=t.x,R=t.y,c=adjust_lon(o-this.long0),h=R,d=Math.PI*Math.sin(R);;){var H=-(h+Math.sin(h)-d)/(1+Math.cos(h));if(h+=H,Math.abs(H)<EPSLN)break}h/=2,Math.PI/2-Math.abs(R)<EPSLN&&(c=0);var n=.900316316158*this.a*c*Math.cos(h)+this.x0,D=1.4142135623731*this.a*Math.sin(h)+this.y0;return t.x=n,t.y=D,t}function inverse$a(t){var o,R;t.x-=this.x0,t.y-=this.y0,R=t.y/(1.4142135623731*this.a),Math.abs(R)>.999999999999&&(R=.999999999999),o=Math.asin(R);var c=adjust_lon(this.long0+t.x/(.900316316158*this.a*Math.cos(o)));c<-Math.PI&&(c=-Math.PI),c>Math.PI&&(c=Math.PI),R=(2*o+Math.sin(2*o))/Math.PI,Math.abs(R)>1&&(R=1);var h=Math.asin(R);return t.x=c,t.y=h,t}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.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=msfnz(this.e,this.sinphi,this.cosphi),this.ml1=mlfn(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<EPSLN?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=msfnz(this.e,this.sinphi,this.cosphi),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(t){var o=t.x,R=t.y,c;if(this.sphere)c=this.a*(this.g-R);else{var h=mlfn(this.e0,this.e1,this.e2,this.e3,R);c=this.a*(this.g-h)}var d=this.ns*adjust_lon(o-this.long0),H=this.x0+c*Math.sin(d),n=this.y0+this.rh-c*Math.cos(d);return t.x=H,t.y=n,t}function inverse$9(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var o,R,c,h;this.ns>=0?(R=Math.sqrt(t.x*t.x+t.y*t.y),o=1):(R=-Math.sqrt(t.x*t.x+t.y*t.y),o=-1);var d=0;if(R!==0&&(d=Math.atan2(o*t.x,o*t.y)),this.sphere)return h=adjust_lon(this.long0+d/this.ns),c=adjust_lat(this.g-R/this.a),t.x=h,t.y=c,t;var H=this.g-R/this.a;return c=imlfn(H,this.e0,this.e1,this.e2,this.e3),h=adjust_lon(this.long0+d/this.ns),t.x=h,t.y=c,t}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(t){var o=t.x,R=t.y,c=adjust_lon(o-this.long0),h,d;Math.abs(R)<=EPSLN&&(h=this.x0+this.R*c,d=this.y0);var H=asinz(2*Math.abs(R/Math.PI));(Math.abs(c)<=EPSLN||Math.abs(Math.abs(R)-HALF_PI)<=EPSLN)&&(h=this.x0,R>=0?d=this.y0+Math.PI*this.R*Math.tan(.5*H):d=this.y0+Math.PI*this.R*-Math.tan(.5*H));var n=.5*Math.abs(Math.PI/c-c/Math.PI),D=n*n,j=Math.sin(H),z=Math.cos(H),w=z/(j+z-1),q=w*w,re=w*(2/j-1),ne=re*re,ie=Math.PI*this.R*(n*(w-ne)+Math.sqrt(D*(w-ne)*(w-ne)-(ne+D)*(q-ne)))/(ne+D);c<0&&(ie=-ie),h=this.x0+ie;var Re=D+w;return ie=Math.PI*this.R*(re*Re-n*Math.sqrt((ne+D)*(D+1)-Re*Re))/(ne+D),R>=0?d=this.y0+ie:d=this.y0-ie,t.x=h,t.y=d,t}function inverse$8(t){var o,R,c,h,d,H,n,D,j,z,w,q,re;return t.x-=this.x0,t.y-=this.y0,w=Math.PI*this.R,c=t.x/w,h=t.y/w,d=c*c+h*h,H=-Math.abs(h)*(1+d),n=H-2*h*h+c*c,D=-2*H+1+2*h*h+d*d,re=h*h/D+(2*n*n*n/D/D/D-9*H*n/D/D)/27,j=(H-n*n/3/D)/D,z=2*Math.sqrt(-j/3),w=3*re/j/z,Math.abs(w)>1&&(w>=0?w=1:w=-1),q=Math.acos(w)/3,t.y>=0?R=(-z*Math.cos(q+Math.PI/3)-n/3/D)*Math.PI:R=-(-z*Math.cos(q+Math.PI/3)-n/3/D)*Math.PI,Math.abs(c)<EPSLN?o=this.long0:o=adjust_lon(this.long0+Math.PI*(d-1+Math.sqrt(1+2*(c*c-h*h)+d*d))/2/c),t.x=o,t.y=R,t}var names$9=["Van_der_Grinten_I","VanDerGrinten","vandg"];const vandg={init:init$9,forward:forward$8,inverse:inverse$8,names:names$9};function init$8(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function forward$7(t){var o=t.x,R=t.y,c=Math.sin(t.y),h=Math.cos(t.y),d=adjust_lon(o-this.long0),H,n,D,j,z,w,q,re,ne,ie,Re,Te,$,L,ae,W,Pe,Ie,Ae,de,Ye,Ue,ye;return this.sphere?Math.abs(this.sin_p12-1)<=EPSLN?(t.x=this.x0+this.a*(HALF_PI-R)*Math.sin(d),t.y=this.y0-this.a*(HALF_PI-R)*Math.cos(d),t):Math.abs(this.sin_p12+1)<=EPSLN?(t.x=this.x0+this.a*(HALF_PI+R)*Math.sin(d),t.y=this.y0+this.a*(HALF_PI+R)*Math.cos(d),t):(Ie=this.sin_p12*c+this.cos_p12*h*Math.cos(d),W=Math.acos(Ie),Pe=W?W/Math.sin(W):1,t.x=this.x0+this.a*Pe*h*Math.sin(d),t.y=this.y0+this.a*Pe*(this.cos_p12*c-this.sin_p12*h*Math.cos(d)),t):(H=e0fn(this.es),n=e1fn(this.es),D=e2fn(this.es),j=e3fn(this.es),Math.abs(this.sin_p12-1)<=EPSLN?(z=this.a*mlfn(H,n,D,j,HALF_PI),w=this.a*mlfn(H,n,D,j,R),t.x=this.x0+(z-w)*Math.sin(d),t.y=this.y0-(z-w)*Math.cos(d),t):Math.abs(this.sin_p12+1)<=EPSLN?(z=this.a*mlfn(H,n,D,j,HALF_PI),w=this.a*mlfn(H,n,D,j,R),t.x=this.x0+(z+w)*Math.sin(d),t.y=this.y0+(z+w)*Math.cos(d),t):(q=c/h,re=gN(this.a,this.e,this.sin_p12),ne=gN(this.a,this.e,c),ie=Math.atan((1-this.es)*q+this.es*re*this.sin_p12/(ne*h)),Re=Math.atan2(Math.sin(d),this.cos_p12*Math.tan(ie)-this.sin_p12*Math.cos(d)),Re===0?Ae=Math.asin(this.cos_p12*Math.sin(ie)-this.sin_p12*Math.cos(ie)):Math.abs(Math.abs(Re)-Math.PI)<=EPSLN?Ae=-Math.asin(this.cos_p12*Math.sin(ie)-this.sin_p12*Math.cos(ie)):Ae=Math.asin(Math.sin(d)*Math.cos(ie)/Math.sin(Re)),Te=this.e*this.sin_p12/Math.sqrt(1-this.es),$=this.e*this.cos_p12*Math.cos(Re)/Math.sqrt(1-this.es),L=Te*$,ae=$*$,de=Ae*Ae,Ye=de*Ae,Ue=Ye*Ae,ye=Ue*Ae,W=re*Ae*(1-de*ae*(1-ae)/6+Ye/8*L*(1-2*ae)+Ue/120*(ae*(4-7*ae)-3*Te*Te*(1-7*ae))-ye/48*L),t.x=this.x0+W*Math.sin(Re),t.y=this.y0+W*Math.cos(Re),t))}function inverse$7(t){t.x-=this.x0,t.y-=this.y0;var o,R,c,h,d,H,n,D,j,z,w,q,re,ne,ie,Re,Te,$,L,ae,W,Pe,Ie,Ae;return this.sphere?(o=Math.sqrt(t.x*t.x+t.y*t.y),o>2*HALF_PI*this.a?void 0:(R=o/this.a,c=Math.sin(R),h=Math.cos(R),d=this.long0,Math.abs(o)<=EPSLN?H=this.lat0:(H=asinz(h*this.sin_p12+t.y*c*this.cos_p12/o),n=Math.abs(this.lat0)-HALF_PI,Math.abs(n)<=EPSLN?this.lat0>=0?d=adjust_lon(this.long0+Math.atan2(t.x,-t.y)):d=adjust_lon(this.long0-Math.atan2(-t.x,t.y)):d=adjust_lon(this.long0+Math.atan2(t.x*c,o*this.cos_p12*h-t.y*this.sin_p12*c))),t.x=d,t.y=H,t)):(D=e0fn(this.es),j=e1fn(this.es),z=e2fn(this.es),w=e3fn(this.es),Math.abs(this.sin_p12-1)<=EPSLN?(q=this.a*mlfn(D,j,z,w,HALF_PI),o=Math.sqrt(t.x*t.x+t.y*t.y),re=q-o,H=imlfn(re/this.a,D,j,z,w),d=adjust_lon(this.long0+Math.atan2(t.x,-1*t.y)),t.x=d,t.y=H,t):Math.abs(this.sin_p12+1)<=EPSLN?(q=this.a*mlfn(D,j,z,w,HALF_PI),o=Math.sqrt(t.x*t.x+t.y*t.y),re=o-q,H=imlfn(re/this.a,D,j,z,w),d=adjust_lon(this.long0+Math.atan2(t.x,t.y)),t.x=d,t.y=H,t):(o=Math.sqrt(t.x*t.x+t.y*t.y),Re=Math.atan2(t.x,t.y),ne=gN(this.a,this.e,this.sin_p12),Te=Math.cos(Re),$=this.e*this.cos_p12*Te,L=-$*$/(1-this.es),ae=3*this.es*(1-L)*this.sin_p12*this.cos_p12*Te/(1-this.es),W=o/ne,Pe=W-L*(1+L)*Math.pow(W,3)/6-ae*(1+3*L)*Math.pow(W,4)/24,Ie=1-L*Pe*Pe/2-W*Pe*Pe*Pe/6,ie=Math.asin(this.sin_p12*Math.cos(Pe)+this.cos_p12*Math.sin(Pe)*Te),d=adjust_lon(this.long0+Math.asin(Math.sin(Re)*Math.sin(Pe)/Math.cos(ie))),Ae=Math.sin(ie),H=Math.atan2((Ae-this.es*Ie*this.sin_p12)*Math.tan(ie),Ae*(1-this.es)),t.x=d,t.y=H,t))}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(t){var o,R,c,h,d,H,n,D,j=t.x,z=t.y;return c=adjust_lon(j-this.long0),o=Math.sin(z),R=Math.cos(z),h=Math.cos(c),H=this.sin_p14*o+this.cos_p14*R*h,d=1,(H>0||Math.abs(H)<=EPSLN)&&(n=this.a*d*R*Math.sin(c),D=this.y0+this.a*d*(this.cos_p14*o-this.sin_p14*R*h)),t.x=n,t.y=D,t}function inverse$6(t){var o,R,c,h,d,H,n;return t.x-=this.x0,t.y-=this.y0,o=Math.sqrt(t.x*t.x+t.y*t.y),R=asinz(o/this.a),c=Math.sin(R),h=Math.cos(R),H=this.long0,Math.abs(o)<=EPSLN?(n=this.lat0,t.x=H,t.y=n,t):(n=asinz(h*this.sin_p14+t.y*c*this.cos_p14/o),d=Math.abs(this.lat0)-HALF_PI,Math.abs(d)<=EPSLN?(this.lat0>=0?H=adjust_lon(this.long0+Math.atan2(t.x,-t.y)):H=adjust_lon(this.long0-Math.atan2(-t.x,t.y)),t.x=H,t.y=n,t):(H=adjust_lon(this.long0+Math.atan2(t.x*c,o*this.cos_p14*h-t.y*this.sin_p14*c)),t.x=H,t.y=n,t))}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(t){var o={x:0,y:0},R,c,h,d,H,n,D={value:0};if(t.x-=this.long0,this.es!==0?R=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):R=t.y,c=t.x,this.face===FACE_ENUM.TOP)d=HALF_PI-R,c>=FORTPI&&c<=HALF_PI+FORTPI?(D.value=AREA_ENUM.AREA_0,h=c-HALF_PI):c>HALF_PI+FORTPI||c<=-(HALF_PI+FORTPI)?(D.value=AREA_ENUM.AREA_1,h=c>0?c-SPI:c+SPI):c>-(HALF_PI+FORTPI)&&c<=-FORTPI?(D.value=AREA_ENUM.AREA_2,h=c+HALF_PI):(D.value=AREA_ENUM.AREA_3,h=c);else if(this.face===FACE_ENUM.BOTTOM)d=HALF_PI+R,c>=FORTPI&&c<=HALF_PI+FORTPI?(D.value=AREA_ENUM.AREA_0,h=-c+HALF_PI):c<FORTPI&&c>=-FORTPI?(D.value=AREA_ENUM.AREA_1,h=-c):c<-FORTPI&&c>=-(HALF_PI+FORTPI)?(D.value=AREA_ENUM.AREA_2,h=-c-HALF_PI):(D.value=AREA_ENUM.AREA_3,h=c>0?-c+SPI:-c-SPI);else{var j,z,w,q,re,ne,ie;this.face===FACE_ENUM.RIGHT?c=qsc_shift_lon_origin(c,+HALF_PI):this.face===FACE_ENUM.BACK?c=qsc_shift_lon_origin(c,+SPI):this.face===FACE_ENUM.LEFT&&(c=qsc_shift_lon_origin(c,-HALF_PI)),q=Math.sin(R),re=Math.cos(R),ne=Math.sin(c),ie=Math.cos(c),j=re*ie,z=re*ne,w=q,this.face===FACE_ENUM.FRONT?(d=Math.acos(j),h=qsc_fwd_equat_face_theta(d,w,z,D)):this.face===FACE_ENUM.RIGHT?(d=Math.acos(z),h=qsc_fwd_equat_face_theta(d,w,-j,D)):this.face===FACE_ENUM.BACK?(d=Math.acos(-j),h=qsc_fwd_equat_face_theta(d,w,-z,D)):this.face===FACE_ENUM.LEFT?(d=Math.acos(-z),h=qsc_fwd_equat_face_theta(d,w,j,D)):(d=h=0,D.value=AREA_ENUM.AREA_0)}return n=Math.atan(12/SPI*(h+Math.acos(Math.sin(h)*Math.cos(FORTPI))-HALF_PI)),H=Math.sqrt((1-Math.cos(d))/(Math.cos(n)*Math.cos(n))/(1-Math.cos(Math.atan(1/Math.cos(h))))),D.value===AREA_ENUM.AREA_1?n+=HALF_PI:D.value===AREA_ENUM.AREA_2?n+=SPI:D.value===AREA_ENUM.AREA_3&&(n+=1.5*SPI),o.x=H*Math.cos(n),o.y=H*Math.sin(n),o.x=o.x*this.a+this.x0,o.y=o.y*this.a+this.y0,t.x=o.x,t.y=o.y,t}function inverse$5(t){var o={lam:0,phi:0},R,c,h,d,H,n,D,j,z,w={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,c=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),R=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?w.value=AREA_ENUM.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(w.value=AREA_ENUM.AREA_1,R-=HALF_PI):t.x<0&&-t.x>=Math.abs(t.y)?(w.value=AREA_ENUM.AREA_2,R=R<0?R+SPI:R-SPI):(w.value=AREA_ENUM.AREA_3,R+=HALF_PI),z=SPI/12*Math.tan(R),H=Math.sin(z)/(Math.cos(z)-1/Math.sqrt(2)),n=Math.atan(H),h=Math.cos(R),d=Math.tan(c),D=1-h*h*d*d*(1-Math.cos(Math.atan(1/Math.cos(n)))),D<-1?D=-1:D>1&&(D=1),this.face===FACE_ENUM.TOP)j=Math.acos(D),o.phi=HALF_PI-j,w.value===AREA_ENUM.AREA_0?o.lam=n+HALF_PI:w.value===AREA_ENUM.AREA_1?o.lam=n<0?n+SPI:n-SPI:w.value===AREA_ENUM.AREA_2?o.lam=n-HALF_PI:o.lam=n;else if(this.face===FACE_ENUM.BOTTOM)j=Math.acos(D),o.phi=j-HALF_PI,w.value===AREA_ENUM.AREA_0?o.lam=-n+HALF_PI:w.value===AREA_ENUM.AREA_1?o.lam=-n:w.value===AREA_ENUM.AREA_2?o.lam=-n-HALF_PI:o.lam=n<0?-n-SPI:-n+SPI;else{var q,re,ne;q=D,z=q*q,z>=1?ne=0:ne=Math.sqrt(1-z)*Math.sin(n),z+=ne*ne,z>=1?re=0:re=Math.sqrt(1-z),w.value===AREA_ENUM.AREA_1?(z=re,re=-ne,ne=z):w.value===AREA_ENUM.AREA_2?(re=-re,ne=-ne):w.value===AREA_ENUM.AREA_3&&(z=re,re=ne,ne=-z),this.face===FACE_ENUM.RIGHT?(z=q,q=-re,re=z):this.face===FACE_ENUM.BACK?(q=-q,re=-re):this.face===FACE_ENUM.LEFT&&(z=q,q=re,re=-z),o.phi=Math.acos(-ne)-HALF_PI,o.lam=Math.atan2(re,q),this.face===FACE_ENUM.RIGHT?o.lam=qsc_shift_lon_origin(o.lam,-HALF_PI):this.face===FACE_ENUM.BACK?o.lam=qsc_shift_lon_origin(o.lam,-SPI):this.face===FACE_ENUM.LEFT&&(o.lam=qsc_shift_lon_origin(o.lam,+HALF_PI))}if(this.es!==0){var ie,Re,Te;ie=o.phi<0?1:0,Re=Math.tan(o.phi),Te=this.b/Math.sqrt(Re*Re+this.one_minus_f_squared),o.phi=Math.atan(Math.sqrt(this.a*this.a-Te*Te)/(this.one_minus_f*Te)),ie&&(o.phi=-o.phi)}return o.lam+=this.long0,t.x=o.lam,t.y=o.phi,t}function qsc_fwd_equat_face_theta(t,o,R,c){var h;return t<EPSLN?(c.value=AREA_ENUM.AREA_0,h=0):(h=Math.atan2(o,R),Math.abs(h)<=FORTPI?c.value=AREA_ENUM.AREA_0:h>FORTPI&&h<=HALF_PI+FORTPI?(c.value=AREA_ENUM.AREA_1,h-=HALF_PI):h>HALF_PI+FORTPI||h<=-(HALF_PI+FORTPI)?(c.value=AREA_ENUM.AREA_2,h=h>=0?h-SPI:h+SPI):(c.value=AREA_ENUM.AREA_3,h+=HALF_PI)),h}function qsc_shift_lon_origin(t,o){var R=t+o;return R<-SPI?R+=TWO_PI:R>+SPI&&(R-=TWO_PI),R}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(t,o){return t[0]+o*(t[1]+o*(t[2]+o*t[3]))},poly3_der=function(t,o){return t[1]+o*(2*t[2]+o*3*t[3])};function newton_rapshon(t,o,R,c){for(var h=o;c;--c){var d=t(h);if(h-=d,Math.abs(d)<R)break}return h}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(t){var o=adjust_lon(t.x-this.long0),R=Math.abs(t.y),c=Math.floor(R*C1);c<0?c=0:c>=NODES&&(c=NODES-1),R=R2D*(R-RC1*c);var h={x:poly3_val(COEFS_X[c],R)*o,y:poly3_val(COEFS_Y[c],R)};return t.y<0&&(h.y=-h.y),h.x=h.x*this.a*FXC+this.x0,h.y=h.y*this.a*FYC+this.y0,h}function inverse$4(t){var o={x:(t.x-this.x0)/(this.a*FXC),y:Math.abs(t.y-this.y0)/(this.a*FYC)};if(o.y>=1)o.x/=COEFS_X[NODES][0],o.y=t.y<0?-HALF_PI:HALF_PI;else{var R=Math.floor(o.y*NODES);for(R<0?R=0:R>=NODES&&(R=NODES-1);;)if(COEFS_Y[R][0]>o.y)--R;else if(COEFS_Y[R+1][0]<=o.y)++R;else break;var c=COEFS_Y[R],h=5*(o.y-c[0])/(COEFS_Y[R+1][0]-c[0]);h=newton_rapshon(function(d){return(poly3_val(c,d)-o.y)/poly3_der(c,d)},h,EPSLN,100),o.x/=poly3_val(COEFS_X[R],h),o.y=(5*R+h)*D2R$1,t.y<0&&(o.y=-o.y)}return o.x=adjust_lon(o.x+this.long0),o}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(t){var o=geodeticToGeocentric(t,this.es,this.a);return o}function inverse$3(t){var o=geocentricToGeodetic(t,this.es,this.a,this.b);return o}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(R){if(typeof this[R]=="undefined")this[R]=params[R].def;else{if(params[R].num&&isNaN(this[R]))throw new Error("Invalid parameter value, must be numeric "+R+" = "+this[R]);params[R].num&&(this[R]=parseFloat(this[R]))}params[R].degrees&&(this[R]=this[R]*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 t=this.tilt,o=this.azi;this.cg=Math.cos(o),this.sg=Math.sin(o),this.cw=Math.cos(t),this.sw=Math.sin(t)}function forward$2(t){t.x-=this.long0;var o=Math.sin(t.y),R=Math.cos(t.y),c=Math.cos(t.x),h,d;switch(this.mode){case mode.OBLIQ:d=this.sinph0*o+this.cosph0*R*c;break;case mode.EQUIT:d=R*c;break;case mode.S_POLE:d=-o;break;case mode.N_POLE:d=o;break}switch(d=this.pn1/(this.p-d),h=d*R*Math.sin(t.x),this.mode){case mode.OBLIQ:d*=this.cosph0*o-this.sinph0*R*c;break;case mode.EQUIT:d*=o;break;case mode.N_POLE:d*=-(R*c);break;case mode.S_POLE:d*=R*c;break}var H,n;return H=d*this.cg+h*this.sg,n=1/(H*this.sw*this.h1+this.cw),h=(h*this.cg-d*this.sg)*this.cw*n,d=H*n,t.x=h*this.a,t.y=d*this.a,t}function inverse$2(t){t.x/=this.a,t.y/=this.a;var o={x:t.x,y:t.y},R,c,h;h=1/(this.pn1-t.y*this.sw),R=this.pn1*t.x*h,c=this.pn1*t.y*this.cw*h,t.x=R*this.cg+c*this.sg,t.y=c*this.cg-R*this.sg;var d=hypot$1(t.x,t.y);if(Math.abs(d)<EPSLN)o.x=0,o.y=t.y;else{var H,n;switch(n=1-d*d*this.pfact,n=(this.p-Math.sqrt(n))/(this.pn1/d+d/this.pn1),H=Math.sqrt(1-n*n),this.mode){case mode.OBLIQ:o.y=Math.asin(H*this.sinph0+t.y*n*this.cosph0/d),t.y=(H-this.sinph0*Math.sin(o.y))*d,t.x*=n*this.cosph0;break;case mode.EQUIT:o.y=Math.asin(t.y*n/d),t.y=H*d,t.x*=n;break;case mode.N_POLE:o.y=Math.asin(H),t.y=-t.y;break;case mode.S_POLE:o.y=-Math.asin(H);break}o.x=Math.atan2(t.x,t.y)}return t.x=o.x+this.long0,t.y=o.y,t}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 t=1-this.es,o=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=o,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(t){var o=t.x,R=t.y,c,h,d,H;if(o=o-this.long0,this.shape==="ellipse"){R=Math.atan(this.radius_p2*Math.tan(R));var n=this.radius_p/hypot$1(this.radius_p*Math.cos(R),Math.sin(R));if(h=n*Math.cos(o)*Math.cos(R),d=n*Math.sin(o)*Math.cos(R),H=n*Math.sin(R),(this.radius_g-h)*h-d*d-H*H*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;c=this.radius_g-h,this.flip_axis?(t.x=this.radius_g_1*Math.atan(d/hypot$1(H,c)),t.y=this.radius_g_1*Math.atan(H/c)):(t.x=this.radius_g_1*Math.atan(d/c),t.y=this.radius_g_1*Math.atan(H/hypot$1(d,c)))}else this.shape==="sphere"&&(c=Math.cos(R),h=Math.cos(o)*c,d=Math.sin(o)*c,H=Math.sin(R),c=this.radius_g-h,this.flip_axis?(t.x=this.radius_g_1*Math.atan(d/hypot$1(H,c)),t.y=this.radius_g_1*Math.atan(H/c)):(t.x=this.radius_g_1*Math.atan(d/c),t.y=this.radius_g_1*Math.atan(H/hypot$1(d,c))));return t.x=t.x*this.a,t.y=t.y*this.a,t}function inverse$1(t){var o=-1,R=0,c=0,h,d,H,n;if(t.x=t.x/this.a,t.y=t.y/this.a,this.shape==="ellipse"){this.flip_axis?(c=Math.tan(t.y/this.radius_g_1),R=Math.tan(t.x/this.radius_g_1)*hypot$1(1,c)):(R=Math.tan(t.x/this.radius_g_1),c=Math.tan(t.y/this.radius_g_1)*hypot$1(1,R));var D=c/this.radius_p;if(h=R*R+D*D+o*o,d=2*this.radius_g*o,H=d*d-4*h*this.C,H<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-d-Math.sqrt(H))/(2*h),o=this.radius_g+n*o,R*=n,c*=n,t.x=Math.atan2(R,o),t.y=Math.atan(c*Math.cos(t.x)/o),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if(this.shape==="sphere"){if(this.flip_axis?(c=Math.tan(t.y/this.radius_g_1),R=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+c*c)):(R=Math.tan(t.x/this.radius_g_1),c=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+R*R)),h=R*R+c*c+o*o,d=2*this.radius_g*o,H=d*d-4*h*this.C,H<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-d-Math.sqrt(H))/(2*h),o=this.radius_g+n*o,R*=n,c*=n,t.x=Math.atan2(R,o),t.y=Math.atan(c*Math.cos(t.x)/o)}return t.x=t.x+this.long0,t}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(t){var o=adjust_lon(t.x-this.long0),R=t.y,c=Math.asin(M*Math.sin(R)),h=c*c,d=h*h*h;return t.x=o*Math.cos(c)/(M*(A1+3*A2*h+d*(7*A3+9*A4*h))),t.y=c*(A1+A2*h+d*(A3+A4*h)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function inverse(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var o=1e-9,R=12,c=t.y,h,d,H,n,D,j;for(j=0;j<R&&(h=c*c,d=h*h*h,H=c*(A1+A2*h+d*(A3+A4*h))-t.y,n=A1+3*A2*h+d*(7*A3+9*A4*h),c-=D=H/n,!(Math.abs(D)<o));++j);return h=c*c,d=h*h*h,t.x=M*t.x*(A1+3*A2*h+d*(7*A3+9*A4*h))/Math.cos(c),t.y=Math.asin(Math.sin(c)/M),t.x=adjust_lon(t.x+this.long0),t}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 t;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),t=Math.cos(this.phi1),this.en),this.am1=t/(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(t){var o=adjust_lon(t.x-(this.long0||0)),R=t.y,c,h,d;return c=this.am1+this.m1-pj_mlfn(R,h=Math.sin(R),d=Math.cos(R),this.en),h=d*o/(c*Math.sqrt(1-this.es*h*h)),t.x=c*Math.sin(h),t.y=this.am1-c*Math.cos(h),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function e_inv(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var o,R,c,h;if(R=hypot$1(t.x,t.y=this.am1-t.y),h=pj_inv_mlfn(this.am1+this.m1-R,this.es,this.en),(o=Math.abs(h))<HALF_PI)o=Math.sin(h),c=R*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*o*o)/Math.cos(h);else if(Math.abs(o-HALF_PI)<=EPS10)c=0;else throw new Error;return t.x=adjust_lon(c+(this.long0||0)),t.y=adjust_lat(h),t}function s_fwd(t){var o=adjust_lon(t.x-(this.long0||0)),R=t.y,c,h;return h=this.cphi1+this.phi1-R,Math.abs(h)>EPS10?(t.x=h*Math.sin(c=o*Math.cos(R)/h),t.y=this.cphi1-h*Math.cos(c)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function s_inv(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var o,R,c=hypot$1(t.x,t.y=this.cphi1-t.y);if(R=this.cphi1+this.phi1-c,Math.abs(R)>HALF_PI)throw new Error;return Math.abs(Math.abs(R)-HALF_PI)<=EPS10?o=0:o=c*Math.atan2(t.x,t.y)/Math.cos(R),t.x=adjust_lon(o+(this.long0||0)),t.y=adjust_lat(R),t}var names=["bonne","Bonne (Werner lat_1=90)"];const bonne={init,names};function includedProjections(t){t.Proj.projections.add(tmerc),t.Proj.projections.add(etmerc),t.Proj.projections.add(utm),t.Proj.projections.add(sterea),t.Proj.projections.add(stere),t.Proj.projections.add(somerc),t.Proj.projections.add(omerc),t.Proj.projections.add(lcc),t.Proj.projections.add(krovak),t.Proj.projections.add(cass),t.Proj.projections.add(laea),t.Proj.projections.add(aea),t.Proj.projections.add(gnom),t.Proj.projections.add(cea),t.Proj.projections.add(eqc),t.Proj.projections.add(poly),t.Proj.projections.add(nzmg),t.Proj.projections.add(mill),t.Proj.projections.add(sinu),t.Proj.projections.add(moll),t.Proj.projections.add(eqdc),t.Proj.projections.add(vandg),t.Proj.projections.add(aeqd),t.Proj.projections.add(ortho),t.Proj.projections.add(qsc),t.Proj.projections.add(robin),t.Proj.projections.add(geocent),t.Proj.projections.add(tpers),t.Proj.projections.add(geos),t.Proj.projections.add(eqearth),t.Proj.projections.add(bonne)}proj4.defaultDatum="WGS84",proj4.Proj=Projection,proj4.WGS84=new proj4.Proj("WGS84"),proj4.Point=Point,proj4.toPoint=common$1,proj4.defs=defs,proj4.nadgrid=nadgrid,proj4.transform=transform$1,proj4.mgrs=mgrs,proj4.version="__VERSION__",includedProjections(proj4);function getWKTString(t){let{type:o,epsg_code:R}=t;for(let c=0;c<crsList.length;c++){if(!crsTypes[crsList[c].type]||crsTypes[crsList[c].type].code!==o)continue;let{authCode:d,wkt:H,children:n}=crsList[c];if(d==R)return H;if(n!=null&&n.length){for(let D=0;D<n.length;D++)if(n[D].children){for(let j=0;j<n[D].children.length;j++)if(n[D].children[j].authCode==R)return n[D].children[j].wkt}else if(n[D].authCode==R)return n[D].wkt}}return null}function project(t,o=12){let[R,c]=t,h=(180+R)/360,d=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c*Math.PI/360)))/360;return{x:h*Math.pow(2,o)*512,y:d*Math.pow(2,o)*512}}function getTileCoord(t,o){let[R,c]=o,h=(180+R)/360,d=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c*Math.PI/360)))/360;return{x:Math.floor(h*Math.pow(2,t)),y:Math.floor(d*Math.pow(2,t)),z:t}}function getTilePixelCoord(t,o){let[R,c]=o,h=(180+R)/360,d=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c*Math.PI/360)))/360;return{x:Math.round(h*Math.pow(2,t)*512)%512,y:Math.round(d*Math.pow(2,t)*512)%512}}function getUTMProjection(t){let o=32600,R=Math.ceil((t+180)/6);return{type:3,type_name:"Projected",label:`WGS 84 / UTM zone ${R}N`,epsg_code:o+R}}function transformCoordinate(t,o,R){if(!t)return null;if(t=[...t],t[2]||(t[2]=0),!o||!R||R.type===1||o.type===1)return t;if(o.type===0&&R.type===0){let c=satellite_geo_calc.coordinateTransfer.lla_to_enu({lon:o.origin_point[0],lat:o.origin_point[1],alt:o.origin_point[2]},{lon:R.origin_point[0],lat:R.origin_point[1],alt:R.origin_point[2]});return[c.x+t[0],c.y+t[1],c.z+t[2]]}else if(o.type===0){let c=satellite_geo_calc.coordinateTransfer.enu_to_lla({x:t[0],y:t[1],z:t[2]},{lon:o.origin_point[0],lat:o.origin_point[1],alt:o.origin_point[2]}),h=[c.lon,c.lat,c.alt],{wkt:d,epsg_code:H}=R;return H===4326||H===4490?h:(!d&&H&&(d=getWKTString(R)),d?proj4("EPSG:4326",d,h):null)}else if(R.type===0){let{wkt:c,epsg_code:h}=o,d=t;if(h!==4326){if(!c&&h&&(c=getWKTString(o)),!c)return null;d=proj4(c,"EPSG:4326",t)}let H=satellite_geo_calc.coordinateTransfer.lla_to_enu({lon:d[0],lat:d[1],alt:d[2]},{lon:R.origin_point[0],lat:R.origin_point[1],alt:R.origin_point[2]});return[H.x,H.y,H.z]}else{let c=o.wkt,h=R.wkt;return!c&&o.epsg_code&&(c=getWKTString(o)),!h&&R.epsg_code&&(h=getWKTString(R)),!c||!h?null:proj4(c,h,t)}}function transformCoordinateToLngLat(t,o){return transformCoordinate(t,o,{type:2,type_name:"Geographic",epsg_code:4326})}function transformLnglat(t,o){return transformCoordinate(t,{type:2,type_name:"Geographic",epsg_code:4326},o)}function geographicToCartesian(t){return proj4("+proj=longlat +datum=WGS84","+proj=geocent +datum=WGS84",t)}const transform=Object.freeze(Object.defineProperty({__proto__:null,getWKTString,project,getTileCoord,getTilePixelCoord,getUTMProjection,transformCoordinate,transformCoordinateToLngLat,transformLnglat,geographicToCartesian},Symbol.toStringTag,{value:"Module"}));function generateId(){return v4()}function formatDate(t){return t?hooks(t).format("YYYY-MM-DD HH:mm:ss"):"-"}function formatLocalDate(){return hooks().format("YYYY/M/D HH:mm:ss")}function formatFileSize(t){t=parseInt(t);let o=Math.floor(Math.log(t)/Math.log(1024)),R=["B","KB","MB","GB","TB","PB"];return _.round(t/Math.pow(1024,o),2)+R[o]}function getGeoCoordOperator(t){return t==="N"||t==="E"?1:-1}function toRadian(t){return t[0]+t[1]/60+t[2]/3600}function diffLayers(t,o=[]){t=_formatTree(t),o=_formatTree(o);let R=[];for(let c of t){let{visible:h}=c;for(let d of c.items||[]){let{id:H,type:n,opacity:D,visible:j}=d;if(h||(j=!1),["point","line","polygon"].includes(n)&&R.find(re=>re[0]==="updateAnnotations"))continue;let z=findNodeInTree(H,o);if(!z&&!j)continue;if(!z){["point","line","polygon"].includes(n)?R.push(["updateAnnotations",d]):R.push(["addLayer",d]);continue}let{opacity:w,visible:q}=z;_.isEqual(d,z)||(["point","line","polygon"].includes(n)?R.push(["updateAnnotations",d]):D!==w||!_.isEqual(d.metadata,z.metadata)?R.push(["updateLayer",d]):j!==q&&R.push([j?"addLayer":"removeLayer",d]))}}for(let c of o)for(let h of c.items||[]){let{id:d,type:H}=h;findNodeInTree(d,t)||(["point","line","polygon"].includes(H)?R.find(D=>D[0]==="updateAnnotations")||R.push(["updateAnnotations",h]):R.push(["removeLayer",h]))}return R}function findNodeInTree(t,o){var R;for(let c of o){if(c.id===t)return c;if((R=c.items)!=null&&R.length){let h=findNodeInTree(t,c.items);if(h)return h}}return null}function _formatTree(t){let o=_.cloneDeep(t);for(let R of o)for(let c of R.items||[])R.visible||(c.visible=!1);return o}function getBeforeId(t,o){let R=t.style._layers,c=t.style.order,{layerType:h}=o.metadata;return c.find(n=>{let D=R[n].metadata;return _.isEmpty(D)&&(D={layerType:"dsm"}),H(h,o.id)<H(D.layerType,n)})||"";function H(n,D){const j=[["bmap"],["dom"],["ndvi"],["dsm"],["circle"],["annotation"],["label"]];let z=-1;return D.startsWith("gl-draw")?z=5:z=j.findIndex(w=>w.includes(n)),z===-1?100:z}}function isTokenExpired(t){if(!t)return!1;let{message:o="",msg:R=""}=t.data;return t.status==401&&(R.toLowerCase().includes("expired")||o.toLowerCase().includes("expired"))}function getDataType$2(t){for(let o in cameras)if(cameras[o].includes(t))return o;return"normal"}function downloadImage(t){let o=`\u5FEB\u7167${hooks().format("YYYYMMDD")}${new Date().getTime()}.png`,R=document.createElement("a");R.href=t,R.download=o,document.body.appendChild(R),R.click(),document.body.removeChild(R)}function getGeometryType(t){let o=getType$1(t);return["Point","MultiPoint"].includes(o)?"point":["LineString","MultiLineString"].includes(o)?"line":"polygon"}function rgbaToFloat(t){let o=t[3]>128?0:1,R=-1*(1-o)+o,c=Math.floor((t[3]+.1)%128)*2+Math.floor((t[2]+.1)/128)-127,h=t[0]+t[1]*256+Math.floor((t[2]+.1)%128)*256*256;return R*(1+h/8388607)*Math.pow(2,c)}function getAnnotationFeature(t){let{geometry:o}=t,R=_.cloneDeep(t);return delete R.geometry,{id:R.id,type:"Feature",properties:R,geometry:_.cloneDeep(o)}}function getAnnotationName(t,o){let R=[],c=o==="point"?"\u70B9\u6CE8\u8BB0":o==="line"?"\u7EBF\u6CE8\u8BB0":"\u9762\u6CE8\u8BB0";t.forEach(h=>{if(h.name===c){R.push(0);return}if(h.name.startsWith(`${c} `)){let d=Number(h.name.split(" ").pop());Number.isNaN(d)||R.push(d)}}),R=R.sort((h,d)=>h-d);for(let h=0;h<R.length;h++)if(R[h]!==h)return h===0?c:`${c} ${h}`;return R.length===0?c:`${c} ${R.length}`}function getLineLabelFeature(t){let o=t.geometry.coordinates,R=[];for(let D=1;D<o.length;D++)distance(o[D-1],o[D],{units:"meters"})>30&&R.push([o[D-1],o[D]]);let c=[];if(R.length){let D=Math.floor(R.length/2);c=R[D]}else{let D=Math.floor(o.length/2-1);c=[o[D],o[D+1]]}let h=project(c[0]),d=project(c[1]),H=360-Math.atan((h.y-d.y)/(d.x-h.x))*180/Math.PI,n=midpoint(c[0],c[1]);return n.properties=t.properties,n.properties.angle=H,n.geometry.coordinates.push(((c[0][2]||0)+(c[1][2]||0))/2),n}function addIcons2Map(t,o){return new Promise((R,c)=>{let h=o.length;o.forEach(({url:d,sdf:H})=>{t.loadImage(d,(n,D)=>{h--;let j=d.split("/").pop().split(".")[0];if(!t.hasImage(j)){if(n){c(n);return}t.addImage(j,D,{sdf:H}),h<=0&&R(!0)}})})})}function getTaskTreeList(t,o,R){var d;let c=_.cloneDeep(((d=t.metadata)==null?void 0:d.groups)||layerGroups);return c.forEach(H=>H.items=[]),o.forEach(H=>{let n=_.cloneDeep(H);n.group||n.group,c.find(j=>j.id===n.group).items.push(n)}),(t.status==="complete"?R:[]).forEach(H=>{let{group:n}=H,D=c.find(j=>j.id===n);!D||D.items.push(H)}),c}function hasNaN(t){for(let o=0;o<t.length;o++)if(Number.isNaN(t[o]))return!0;return!1}function flatObject(t){let o={};for(let R in t)R.startsWith("xmlns")||Array.isArray(t[R])||(typeof t[R]=="object"?Object.assign(o,flatObject(t[R])):o[R]=t[R]);return o}function getRotationMatrix(t,o,R){let c=[],h=fromValues$2(0,1,0,0,1,0,0,0,0,0,-1,0,0,0,0,1),d=fromValues$2(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),H=fromZRotation(create$3(),R*Math.PI/180),n=fromYRotation(create$3(),t*Math.PI/180),D=fromXRotation(create$3(),o*Math.PI/180),j=multiply$1(create$3(),multiply$1(create$3(),H,n),D),z=multiply$1(create$3(),multiply$1(create$3(),d,transpose$1(create$3(),j)),h);for(let w=0;w<3;w++)for(let q=0;q<3;q++)c[w*3+q]=z[w+q*4];return c}function transformRoi(t,o){let{boundary:R,min_z:c,max_z:h}=t,{type:d,origin_point:H}=o;if(d===0){let n=[];return R.forEach(D=>{let j=transformCoordinateToLngLat([...D,0],o);n.push(j)}),c+=H[2],h+=H[2],{boundary:n,min_z:c,max_z:h}}return t}function getPosSigma(t){return t==="high"?[.03,.03,.06]:t==="low"?[10,10,10]:[1,1,1]}function photoPos2Geojson(t){let o=[],R=t.find(d=>d.meta_data.pos);if(R){let d=_.cloneDeep(R.meta_data.coordinate_system);t.forEach(H=>{let{meta_data:n={}}=H,{pos:D}=n,j=transformCoordinateToLngLat(D,d);if(!j)return;let z=_.cloneDeep(H);z.type="photo",o.push(point(j,z))})}let c=featureCollection(o),h=null;return o.length&&(h=bbox(c)),{geojson:c,bbox:h}}function getDistance(t,o){return Math.sqrt((t[0]-o[0])*(t[0]-o[0])+(t[1]-o[1])*(t[1]-o[1]))}function getMaxValue(t,o){let R=-1/0;return t.forEach(c=>{R=Math.max(c[o],R)}),R}function getAverageValue(t,o){let R=0;return t.forEach(c=>{R+=c[o]}),R/t.length}function getAppVersion(t){let{appVersion:o,environment:R}=t.metadata;return o||(R?`${R.platform}(${R.appVersion})`:"\u6682\u65E0")}function getResolutionLevelByQuality(t){switch(t){case"low":return 3;case"high":return 1;case"medium":default:return 2}}function getQualityAliasByLevel(t){let o="\u9AD8";return t===1?o="\u8D85\u9AD8":t===3&&(o="\u4E2D"),o}function getImageTypeByDataType(t){switch(t){case"normal":return 1;case"multispectral":return 2;case"infrared":default:return 3}}function getDataTypeAliasByImageType(t){return t==="infrared"?"\u70ED\u7EA2\u5916":t==="multispectral"?"\u591A\u5149\u8C31":"\u53EF\u89C1\u5149"}function getTaskStatusAlias(t){return t==="complete"?"\u5EFA\u6A21\u5B8C\u6210":t==="error"?"\u5EFA\u6A21\u51FA\u9519":t==="none"?"\u672A\u5F00\u59CB":t==="waiting"?"\u6B63\u5728\u6392\u961F":t==="aerotriangulation"?"\u7A7A\u4E09\u5B8C\u6210":t.startsWith("processing")?"\u6B63\u5728\u5904\u7406":t==="stop"?"\u4EFB\u52A1\u7EC8\u6B62":"\u672A\u77E5\u72B6\u6001"}function include3d(t=[]){return!!(t.length&&t.includes("mesh3d"))}function extend(t,...o){for(const R of o)for(const c in R)t[c]=R[c];return t}function endsWith(t,o){return t.indexOf(o,t.length-o.length)!==-1}let clickPoint=null;function _addEventListener(t,o,R){R[t]=R[t]||[],R[t].push(o)}function _removeEventListener(t,o,R){if(R&&R[t]){if(!o){delete R[t];return}const c=R[t].indexOf(o);c!==-1&&R[t].splice(c,1)}}class Event$1{constructor(){this._listeners=[],this._oneTimeListeners=[],this._eventedParent=null,this._eventedParentData=null}on(o,R){return this._listeners=this._listeners||{},_addEventListener(o,R,this._listeners),this}off(o,R){return _removeEventListener(o,R,this._listeners),_removeEventListener(o,R,this._oneTimeListeners),this}once(o,R){return this._oneTimeListeners=this._oneTimeListeners||{},_addEventListener(o,R,this._oneTimeListeners),this}fire(o,R){if(this.listens(o)){if(R=extend({},R,{type:o,target:this}),clickPoint){if(R.point&&clickPoint===R.point.x+R.point.y){if(clickPoint===R.point.x+R.point.y)return;clickPoint=R.point.x+R.point.y}else if(R.feature){if(clickPoint===R.x+R.y)return;clickPoint=R.x+R.y}}else R.point?clickPoint=R.point.x+R.point.y:R.feature&&(clickPoint=R.x+R.y);const c=this._listeners&&this._listeners[o]?this._listeners[o].slice():[];for(let d=0;d<c.length;d++)c[d].call(this,R);const h=this._oneTimeListeners&&this._oneTimeListeners[o]?this._oneTimeListeners[o].slice():[];for(let d=0;d<h.length;d++)h[d].call(this,R),_removeEventListener(o,h[d],this._oneTimeListeners);this._eventedParent&&this._eventedParent.fire(o,extend({},R,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData))}else endsWith(o,"error")&&console.error(R&&R.error||R||"Empty error event");return this}listens(o){return this._listeners&&this._listeners[o]&&this._listeners[o].length>0||this._oneTimeListeners&&this._oneTimeListeners[o]&&this._oneTimeListeners[o].length>0||this._eventedParent&&this._eventedParent.listens(o)}setEventedParent(o,R){return this._eventedParent=o,this._eventedParentData=R,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(t){throw new Error('Could not dynamically require "'+t+'". 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(t){var o=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function R(d,H){return Object.prototype.hasOwnProperty.call(d,H)}t.assign=function(d){for(var H=Array.prototype.slice.call(arguments,1);H.length;){var n=H.shift();if(!!n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(var D in n)R(n,D)&&(d[D]=n[D])}}return d},t.shrinkBuf=function(d,H){return d.length===H?d:d.subarray?d.subarray(0,H):(d.length=H,d)};var c={arraySet:function(d,H,n,D,j){if(H.subarray&&d.subarray){d.set(H.subarray(n,n+D),j);return}for(var z=0;z<D;z++)d[j+z]=H[n+z]},flattenChunks:function(d){var H,n,D,j,z,w;for(D=0,H=0,n=d.length;H<n;H++)D+=d[H].length;for(w=new Uint8Array(D),j=0,H=0,n=d.length;H<n;H++)z=d[H],w.set(z,j),j+=z.length;return w}},h={arraySet:function(d,H,n,D,j){for(var z=0;z<D;z++)d[j+z]=H[n+z]},flattenChunks:function(d){return[].concat.apply([],d)}};t.setTyped=function(d){d?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,c)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,h))},t.setTyped(o)}(common)),common}var deflate$1={},deflate={},trees={},hasRequiredTrees;function requireTrees(){if(hasRequiredTrees)return trees;hasRequiredTrees=1;var t=requireCommon(),o=4,R=0,c=1,h=2;function d(Fe){for(var ar=Fe.length;--ar>=0;)Fe[ar]=0}var H=0,n=1,D=2,j=3,z=258,w=29,q=256,re=q+1+w,ne=30,ie=19,Re=2*re+1,Te=15,$=16,L=7,ae=256,W=16,Pe=17,Ie=18,Ae=[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],de=[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],Ye=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Ue=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ye=512,rt=new Array((re+2)*2);d(rt);var St=new Array(ne*2);d(St);var Yt=new Array(ye);d(Yt);var Et=new Array(z-j+1);d(Et);var pt=new Array(w);d(pt);var Ht=new Array(ne);d(Ht);function rr(Fe,ar,ea,Ma,Ut){this.static_tree=Fe,this.extra_bits=ar,this.extra_base=ea,this.elems=Ma,this.max_length=Ut,this.has_stree=Fe&&Fe.length}var mr,na,cr;function yr(Fe,ar){this.dyn_tree=Fe,this.max_code=0,this.stat_desc=ar}function fa(Fe){return Fe<256?Yt[Fe]:Yt[256+(Fe>>>7)]}function $a(Fe,ar){Fe.pending_buf[Fe.pending++]=ar&255,Fe.pending_buf[Fe.pending++]=ar>>>8&255}function Ta(Fe,ar,ea){Fe.bi_valid>$-ea?(Fe.bi_buf|=ar<<Fe.bi_valid&65535,$a(Fe,Fe.bi_buf),Fe.bi_buf=ar>>$-Fe.bi_valid,Fe.bi_valid+=ea-$):(Fe.bi_buf|=ar<<Fe.bi_valid&65535,Fe.bi_valid+=ea)}function Sa(Fe,ar,ea){Ta(Fe,ea[ar*2],ea[ar*2+1])}function _r(Fe,ar){var ea=0;do ea|=Fe&1,Fe>>>=1,ea<<=1;while(--ar>0);return ea>>>1}function Qr(Fe){Fe.bi_valid===16?($a(Fe,Fe.bi_buf),Fe.bi_buf=0,Fe.bi_valid=0):Fe.bi_valid>=8&&(Fe.pending_buf[Fe.pending++]=Fe.bi_buf&255,Fe.bi_buf>>=8,Fe.bi_valid-=8)}function la(Fe,ar){var ea=ar.dyn_tree,Ma=ar.max_code,Ut=ar.stat_desc.static_tree,br=ar.stat_desc.has_stree,ze=ar.stat_desc.extra_bits,Pa=ar.stat_desc.extra_base,hn=ar.stat_desc.max_length,me,Dr,Lr,Ze,Bt,Hr,Mn=0;for(Ze=0;Ze<=Te;Ze++)Fe.bl_count[Ze]=0;for(ea[Fe.heap[Fe.heap_max]*2+1]=0,me=Fe.heap_max+1;me<Re;me++)Dr=Fe.heap[me],Ze=ea[ea[Dr*2+1]*2+1]+1,Ze>hn&&(Ze=hn,Mn++),ea[Dr*2+1]=Ze,!(Dr>Ma)&&(Fe.bl_count[Ze]++,Bt=0,Dr>=Pa&&(Bt=ze[Dr-Pa]),Hr=ea[Dr*2],Fe.opt_len+=Hr*(Ze+Bt),br&&(Fe.static_len+=Hr*(Ut[Dr*2+1]+Bt)));if(Mn!==0){do{for(Ze=hn-1;Fe.bl_count[Ze]===0;)Ze--;Fe.bl_count[Ze]--,Fe.bl_count[Ze+1]+=2,Fe.bl_count[hn]--,Mn-=2}while(Mn>0);for(Ze=hn;Ze!==0;Ze--)for(Dr=Fe.bl_count[Ze];Dr!==0;)Lr=Fe.heap[--me],!(Lr>Ma)&&(ea[Lr*2+1]!==Ze&&(Fe.opt_len+=(Ze-ea[Lr*2+1])*ea[Lr*2],ea[Lr*2+1]=Ze),Dr--)}}function Nn(Fe,ar,ea){var Ma=new Array(Te+1),Ut=0,br,ze;for(br=1;br<=Te;br++)Ma[br]=Ut=Ut+ea[br-1]<<1;for(ze=0;ze<=ar;ze++){var Pa=Fe[ze*2+1];Pa!==0&&(Fe[ze*2]=_r(Ma[Pa]++,Pa))}}function ma(){var Fe,ar,ea,Ma,Ut,br=new Array(Te+1);for(ea=0,Ma=0;Ma<w-1;Ma++)for(pt[Ma]=ea,Fe=0;Fe<1<<Ae[Ma];Fe++)Et[ea++]=Ma;for(Et[ea-1]=Ma,Ut=0,Ma=0;Ma<16;Ma++)for(Ht[Ma]=Ut,Fe=0;Fe<1<<de[Ma];Fe++)Yt[Ut++]=Ma;for(Ut>>=7;Ma<ne;Ma++)for(Ht[Ma]=Ut<<7,Fe=0;Fe<1<<de[Ma]-7;Fe++)Yt[256+Ut++]=Ma;for(ar=0;ar<=Te;ar++)br[ar]=0;for(Fe=0;Fe<=143;)rt[Fe*2+1]=8,Fe++,br[8]++;for(;Fe<=255;)rt[Fe*2+1]=9,Fe++,br[9]++;for(;Fe<=279;)rt[Fe*2+1]=7,Fe++,br[7]++;for(;Fe<=287;)rt[Fe*2+1]=8,Fe++,br[8]++;for(Nn(rt,re+1,br),Fe=0;Fe<ne;Fe++)St[Fe*2+1]=5,St[Fe*2]=_r(Fe,5);mr=new rr(rt,Ae,q+1,re,Te),na=new rr(St,de,0,ne,Te),cr=new rr(new Array(0),Ye,0,ie,L)}function va(Fe){var ar;for(ar=0;ar<re;ar++)Fe.dyn_ltree[ar*2]=0;for(ar=0;ar<ne;ar++)Fe.dyn_dtree[ar*2]=0;for(ar=0;ar<ie;ar++)Fe.bl_tree[ar*2]=0;Fe.dyn_ltree[ae*2]=1,Fe.opt_len=Fe.static_len=0,Fe.last_lit=Fe.matches=0}function Ya(Fe){Fe.bi_valid>8?$a(Fe,Fe.bi_buf):Fe.bi_valid>0&&(Fe.pending_buf[Fe.pending++]=Fe.bi_buf),Fe.bi_buf=0,Fe.bi_valid=0}function An(Fe,ar,ea,Ma){Ya(Fe),Ma&&($a(Fe,ea),$a(Fe,~ea)),t.arraySet(Fe.pending_buf,Fe.window,ar,ea,Fe.pending),Fe.pending+=ea}function En(Fe,ar,ea,Ma){var Ut=ar*2,br=ea*2;return Fe[Ut]<Fe[br]||Fe[Ut]===Fe[br]&&Ma[ar]<=Ma[ea]}function In(Fe,ar,ea){for(var Ma=Fe.heap[ea],Ut=ea<<1;Ut<=Fe.heap_len&&(Ut<Fe.heap_len&&En(ar,Fe.heap[Ut+1],Fe.heap[Ut],Fe.depth)&&Ut++,!En(ar,Ma,Fe.heap[Ut],Fe.depth));)Fe.heap[ea]=Fe.heap[Ut],ea=Ut,Ut<<=1;Fe.heap[ea]=Ma}function wa(Fe,ar,ea){var Ma,Ut,br=0,ze,Pa;if(Fe.last_lit!==0)do Ma=Fe.pending_buf[Fe.d_buf+br*2]<<8|Fe.pending_buf[Fe.d_buf+br*2+1],Ut=Fe.pending_buf[Fe.l_buf+br],br++,Ma===0?Sa(Fe,Ut,ar):(ze=Et[Ut],Sa(Fe,ze+q+1,ar),Pa=Ae[ze],Pa!==0&&(Ut-=pt[ze],Ta(Fe,Ut,Pa)),Ma--,ze=fa(Ma),Sa(Fe,ze,ea),Pa=de[ze],Pa!==0&&(Ma-=Ht[ze],Ta(Fe,Ma,Pa)));while(br<Fe.last_lit);Sa(Fe,ae,ar)}function _a(Fe,ar){var ea=ar.dyn_tree,Ma=ar.stat_desc.static_tree,Ut=ar.stat_desc.has_stree,br=ar.stat_desc.elems,ze,Pa,hn=-1,me;for(Fe.heap_len=0,Fe.heap_max=Re,ze=0;ze<br;ze++)ea[ze*2]!==0?(Fe.heap[++Fe.heap_len]=hn=ze,Fe.depth[ze]=0):ea[ze*2+1]=0;for(;Fe.heap_len<2;)me=Fe.heap[++Fe.heap_len]=hn<2?++hn:0,ea[me*2]=1,Fe.depth[me]=0,Fe.opt_len--,Ut&&(Fe.static_len-=Ma[me*2+1]);for(ar.max_code=hn,ze=Fe.heap_len>>1;ze>=1;ze--)In(Fe,ea,ze);me=br;do ze=Fe.heap[1],Fe.heap[1]=Fe.heap[Fe.heap_len--],In(Fe,ea,1),Pa=Fe.heap[1],Fe.heap[--Fe.heap_max]=ze,Fe.heap[--Fe.heap_max]=Pa,ea[me*2]=ea[ze*2]+ea[Pa*2],Fe.depth[me]=(Fe.depth[ze]>=Fe.depth[Pa]?Fe.depth[ze]:Fe.depth[Pa])+1,ea[ze*2+1]=ea[Pa*2+1]=me,Fe.heap[1]=me++,In(Fe,ea,1);while(Fe.heap_len>=2);Fe.heap[--Fe.heap_max]=Fe.heap[1],la(Fe,ar),Nn(ea,hn,Fe.bl_count)}function pa(Fe,ar,ea){var Ma,Ut=-1,br,ze=ar[0*2+1],Pa=0,hn=7,me=4;for(ze===0&&(hn=138,me=3),ar[(ea+1)*2+1]=65535,Ma=0;Ma<=ea;Ma++)br=ze,ze=ar[(Ma+1)*2+1],!(++Pa<hn&&br===ze)&&(Pa<me?Fe.bl_tree[br*2]+=Pa:br!==0?(br!==Ut&&Fe.bl_tree[br*2]++,Fe.bl_tree[W*2]++):Pa<=10?Fe.bl_tree[Pe*2]++:Fe.bl_tree[Ie*2]++,Pa=0,Ut=br,ze===0?(hn=138,me=3):br===ze?(hn=6,me=3):(hn=7,me=4))}function Zn(Fe,ar,ea){var Ma,Ut=-1,br,ze=ar[0*2+1],Pa=0,hn=7,me=4;for(ze===0&&(hn=138,me=3),Ma=0;Ma<=ea;Ma++)if(br=ze,ze=ar[(Ma+1)*2+1],!(++Pa<hn&&br===ze)){if(Pa<me)do Sa(Fe,br,Fe.bl_tree);while(--Pa!==0);else br!==0?(br!==Ut&&(Sa(Fe,br,Fe.bl_tree),Pa--),Sa(Fe,W,Fe.bl_tree),Ta(Fe,Pa-3,2)):Pa<=10?(Sa(Fe,Pe,Fe.bl_tree),Ta(Fe,Pa-3,3)):(Sa(Fe,Ie,Fe.bl_tree),Ta(Fe,Pa-11,7));Pa=0,Ut=br,ze===0?(hn=138,me=3):br===ze?(hn=6,me=3):(hn=7,me=4)}}function yn(Fe){var ar;for(pa(Fe,Fe.dyn_ltree,Fe.l_desc.max_code),pa(Fe,Fe.dyn_dtree,Fe.d_desc.max_code),_a(Fe,Fe.bl_desc),ar=ie-1;ar>=3&&Fe.bl_tree[Ue[ar]*2+1]===0;ar--);return Fe.opt_len+=3*(ar+1)+5+5+4,ar}function pe(Fe,ar,ea,Ma){var Ut;for(Ta(Fe,ar-257,5),Ta(Fe,ea-1,5),Ta(Fe,Ma-4,4),Ut=0;Ut<Ma;Ut++)Ta(Fe,Fe.bl_tree[Ue[Ut]*2+1],3);Zn(Fe,Fe.dyn_ltree,ar-1),Zn(Fe,Fe.dyn_dtree,ea-1)}function $t(Fe){var ar=4093624447,ea;for(ea=0;ea<=31;ea++,ar>>>=1)if(ar&1&&Fe.dyn_ltree[ea*2]!==0)return R;if(Fe.dyn_ltree[9*2]!==0||Fe.dyn_ltree[10*2]!==0||Fe.dyn_ltree[13*2]!==0)return c;for(ea=32;ea<q;ea++)if(Fe.dyn_ltree[ea*2]!==0)return c;return R}var or=!1;function wr(Fe){or||(ma(),or=!0),Fe.l_desc=new yr(Fe.dyn_ltree,mr),Fe.d_desc=new yr(Fe.dyn_dtree,na),Fe.bl_desc=new yr(Fe.bl_tree,cr),Fe.bi_buf=0,Fe.bi_valid=0,va(Fe)}function Xr(Fe,ar,ea,Ma){Ta(Fe,(H<<1)+(Ma?1:0),3),An(Fe,ar,ea,!0)}function Mr(Fe){Ta(Fe,n<<1,3),Sa(Fe,ae,rt),Qr(Fe)}function za(Fe,ar,ea,Ma){var Ut,br,ze=0;Fe.level>0?(Fe.strm.data_type===h&&(Fe.strm.data_type=$t(Fe)),_a(Fe,Fe.l_desc),_a(Fe,Fe.d_desc),ze=yn(Fe),Ut=Fe.opt_len+3+7>>>3,br=Fe.static_len+3+7>>>3,br<=Ut&&(Ut=br)):Ut=br=ea+5,ea+4<=Ut&&ar!==-1?Xr(Fe,ar,ea,Ma):Fe.strategy===o||br===Ut?(Ta(Fe,(n<<1)+(Ma?1:0),3),wa(Fe,rt,St)):(Ta(Fe,(D<<1)+(Ma?1:0),3),pe(Fe,Fe.l_desc.max_code+1,Fe.d_desc.max_code+1,ze+1),wa(Fe,Fe.dyn_ltree,Fe.dyn_dtree)),va(Fe),Ma&&Ya(Fe)}function Ha(Fe,ar,ea){return Fe.pending_buf[Fe.d_buf+Fe.last_lit*2]=ar>>>8&255,Fe.pending_buf[Fe.d_buf+Fe.last_lit*2+1]=ar&255,Fe.pending_buf[Fe.l_buf+Fe.last_lit]=ea&255,Fe.last_lit++,ar===0?Fe.dyn_ltree[ea*2]++:(Fe.matches++,ar--,Fe.dyn_ltree[(Et[ea]+q+1)*2]++,Fe.dyn_dtree[fa(ar)*2]++),Fe.last_lit===Fe.lit_bufsize-1}return trees._tr_init=wr,trees._tr_stored_block=Xr,trees._tr_flush_block=za,trees._tr_tally=Ha,trees._tr_align=Mr,trees}var adler32_1,hasRequiredAdler32;function requireAdler32(){if(hasRequiredAdler32)return adler32_1;hasRequiredAdler32=1;function t(o,R,c,h){for(var d=o&65535|0,H=o>>>16&65535|0,n=0;c!==0;){n=c>2e3?2e3:c,c-=n;do d=d+R[h++]|0,H=H+d|0;while(--n);d%=65521,H%=65521}return d|H<<16|0}return adler32_1=t,adler32_1}var crc32_1,hasRequiredCrc32;function requireCrc32(){if(hasRequiredCrc32)return crc32_1;hasRequiredCrc32=1;function t(){for(var c,h=[],d=0;d<256;d++){c=d;for(var H=0;H<8;H++)c=c&1?3988292384^c>>>1:c>>>1;h[d]=c}return h}var o=t();function R(c,h,d,H){var n=o,D=H+d;c^=-1;for(var j=H;j<D;j++)c=c>>>8^n[(c^h[j])&255];return c^-1}return crc32_1=R,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 t=requireCommon(),o=requireTrees(),R=requireAdler32(),c=requireCrc32(),h=requireMessages(),d=0,H=1,n=3,D=4,j=5,z=0,w=1,q=-2,re=-3,ne=-5,ie=-1,Re=1,Te=2,$=3,L=4,ae=0,W=2,Pe=8,Ie=9,Ae=15,de=8,Ye=29,Ue=256,ye=Ue+1+Ye,rt=30,St=19,Yt=2*ye+1,Et=15,pt=3,Ht=258,rr=Ht+pt+1,mr=32,na=42,cr=69,yr=73,fa=91,$a=103,Ta=113,Sa=666,_r=1,Qr=2,la=3,Nn=4,ma=3;function va(me,Dr){return me.msg=h[Dr],Dr}function Ya(me){return(me<<1)-(me>4?9:0)}function An(me){for(var Dr=me.length;--Dr>=0;)me[Dr]=0}function En(me){var Dr=me.state,Lr=Dr.pending;Lr>me.avail_out&&(Lr=me.avail_out),Lr!==0&&(t.arraySet(me.output,Dr.pending_buf,Dr.pending_out,Lr,me.next_out),me.next_out+=Lr,Dr.pending_out+=Lr,me.total_out+=Lr,me.avail_out-=Lr,Dr.pending-=Lr,Dr.pending===0&&(Dr.pending_out=0))}function In(me,Dr){o._tr_flush_block(me,me.block_start>=0?me.block_start:-1,me.strstart-me.block_start,Dr),me.block_start=me.strstart,En(me.strm)}function wa(me,Dr){me.pending_buf[me.pending++]=Dr}function _a(me,Dr){me.pending_buf[me.pending++]=Dr>>>8&255,me.pending_buf[me.pending++]=Dr&255}function pa(me,Dr,Lr,Ze){var Bt=me.avail_in;return Bt>Ze&&(Bt=Ze),Bt===0?0:(me.avail_in-=Bt,t.arraySet(Dr,me.input,me.next_in,Bt,Lr),me.state.wrap===1?me.adler=R(me.adler,Dr,Bt,Lr):me.state.wrap===2&&(me.adler=c(me.adler,Dr,Bt,Lr)),me.next_in+=Bt,me.total_in+=Bt,Bt)}function Zn(me,Dr){var Lr=me.max_chain_length,Ze=me.strstart,Bt,Hr,Mn=me.prev_length,ja=me.nice_match,Pn=me.strstart>me.w_size-rr?me.strstart-(me.w_size-rr):0,ii=me.window,MT=me.w_mask,Hi=me.prev,$n=me.strstart+Ht,Qi=ii[Ze+Mn-1],R0=ii[Ze+Mn];me.prev_length>=me.good_match&&(Lr>>=2),ja>me.lookahead&&(ja=me.lookahead);do if(Bt=Dr,!(ii[Bt+Mn]!==R0||ii[Bt+Mn-1]!==Qi||ii[Bt]!==ii[Ze]||ii[++Bt]!==ii[Ze+1])){Ze+=2,Bt++;do;while(ii[++Ze]===ii[++Bt]&&ii[++Ze]===ii[++Bt]&&ii[++Ze]===ii[++Bt]&&ii[++Ze]===ii[++Bt]&&ii[++Ze]===ii[++Bt]&&ii[++Ze]===ii[++Bt]&&ii[++Ze]===ii[++Bt]&&ii[++Ze]===ii[++Bt]&&Ze<$n);if(Hr=Ht-($n-Ze),Ze=$n-Ht,Hr>Mn){if(me.match_start=Dr,Mn=Hr,Hr>=ja)break;Qi=ii[Ze+Mn-1],R0=ii[Ze+Mn]}}while((Dr=Hi[Dr&MT])>Pn&&--Lr!==0);return Mn<=me.lookahead?Mn:me.lookahead}function yn(me){var Dr=me.w_size,Lr,Ze,Bt,Hr,Mn;do{if(Hr=me.window_size-me.lookahead-me.strstart,me.strstart>=Dr+(Dr-rr)){t.arraySet(me.window,me.window,Dr,Dr,0),me.match_start-=Dr,me.strstart-=Dr,me.block_start-=Dr,Ze=me.hash_size,Lr=Ze;do Bt=me.head[--Lr],me.head[Lr]=Bt>=Dr?Bt-Dr:0;while(--Ze);Ze=Dr,Lr=Ze;do Bt=me.prev[--Lr],me.prev[Lr]=Bt>=Dr?Bt-Dr:0;while(--Ze);Hr+=Dr}if(me.strm.avail_in===0)break;if(Ze=pa(me.strm,me.window,me.strstart+me.lookahead,Hr),me.lookahead+=Ze,me.lookahead+me.insert>=pt)for(Mn=me.strstart-me.insert,me.ins_h=me.window[Mn],me.ins_h=(me.ins_h<<me.hash_shift^me.window[Mn+1])&me.hash_mask;me.insert&&(me.ins_h=(me.ins_h<<me.hash_shift^me.window[Mn+pt-1])&me.hash_mask,me.prev[Mn&me.w_mask]=me.head[me.ins_h],me.head[me.ins_h]=Mn,Mn++,me.insert--,!(me.lookahead+me.insert<pt)););}while(me.lookahead<rr&&me.strm.avail_in!==0)}function pe(me,Dr){var Lr=65535;for(Lr>me.pending_buf_size-5&&(Lr=me.pending_buf_size-5);;){if(me.lookahead<=1){if(yn(me),me.lookahead===0&&Dr===d)return _r;if(me.lookahead===0)break}me.strstart+=me.lookahead,me.lookahead=0;var Ze=me.block_start+Lr;if((me.strstart===0||me.strstart>=Ze)&&(me.lookahead=me.strstart-Ze,me.strstart=Ze,In(me,!1),me.strm.avail_out===0)||me.strstart-me.block_start>=me.w_size-rr&&(In(me,!1),me.strm.avail_out===0))return _r}return me.insert=0,Dr===D?(In(me,!0),me.strm.avail_out===0?la:Nn):(me.strstart>me.block_start&&(In(me,!1),me.strm.avail_out===0),_r)}function $t(me,Dr){for(var Lr,Ze;;){if(me.lookahead<rr){if(yn(me),me.lookahead<rr&&Dr===d)return _r;if(me.lookahead===0)break}if(Lr=0,me.lookahead>=pt&&(me.ins_h=(me.ins_h<<me.hash_shift^me.window[me.strstart+pt-1])&me.hash_mask,Lr=me.prev[me.strstart&me.w_mask]=me.head[me.ins_h],me.head[me.ins_h]=me.strstart),Lr!==0&&me.strstart-Lr<=me.w_size-rr&&(me.match_length=Zn(me,Lr)),me.match_length>=pt)if(Ze=o._tr_tally(me,me.strstart-me.match_start,me.match_length-pt),me.lookahead-=me.match_length,me.match_length<=me.max_lazy_match&&me.lookahead>=pt){me.match_length--;do me.strstart++,me.ins_h=(me.ins_h<<me.hash_shift^me.window[me.strstart+pt-1])&me.hash_mask,Lr=me.prev[me.strstart&me.w_mask]=me.head[me.ins_h],me.head[me.ins_h]=me.strstart;while(--me.match_length!==0);me.strstart++}else me.strstart+=me.match_length,me.match_length=0,me.ins_h=me.window[me.strstart],me.ins_h=(me.ins_h<<me.hash_shift^me.window[me.strstart+1])&me.hash_mask;else Ze=o._tr_tally(me,0,me.window[me.strstart]),me.lookahead--,me.strstart++;if(Ze&&(In(me,!1),me.strm.avail_out===0))return _r}return me.insert=me.strstart<pt-1?me.strstart:pt-1,Dr===D?(In(me,!0),me.strm.avail_out===0?la:Nn):me.last_lit&&(In(me,!1),me.strm.avail_out===0)?_r:Qr}function or(me,Dr){for(var Lr,Ze,Bt;;){if(me.lookahead<rr){if(yn(me),me.lookahead<rr&&Dr===d)return _r;if(me.lookahead===0)break}if(Lr=0,me.lookahead>=pt&&(me.ins_h=(me.ins_h<<me.hash_shift^me.window[me.strstart+pt-1])&me.hash_mask,Lr=me.prev[me.strstart&me.w_mask]=me.head[me.ins_h],me.head[me.ins_h]=me.strstart),me.prev_length=me.match_length,me.prev_match=me.match_start,me.match_length=pt-1,Lr!==0&&me.prev_length<me.max_lazy_match&&me.strstart-Lr<=me.w_size-rr&&(me.match_length=Zn(me,Lr),me.match_length<=5&&(me.strategy===Re||me.match_length===pt&&me.strstart-me.match_start>4096)&&(me.match_length=pt-1)),me.prev_length>=pt&&me.match_length<=me.prev_length){Bt=me.strstart+me.lookahead-pt,Ze=o._tr_tally(me,me.strstart-1-me.prev_match,me.prev_length-pt),me.lookahead-=me.prev_length-1,me.prev_length-=2;do++me.strstart<=Bt&&(me.ins_h=(me.ins_h<<me.hash_shift^me.window[me.strstart+pt-1])&me.hash_mask,Lr=me.prev[me.strstart&me.w_mask]=me.head[me.ins_h],me.head[me.ins_h]=me.strstart);while(--me.prev_length!==0);if(me.match_available=0,me.match_length=pt-1,me.strstart++,Ze&&(In(me,!1),me.strm.avail_out===0))return _r}else if(me.match_available){if(Ze=o._tr_tally(me,0,me.window[me.strstart-1]),Ze&&In(me,!1),me.strstart++,me.lookahead--,me.strm.avail_out===0)return _r}else me.match_available=1,me.strstart++,me.lookahead--}return me.match_available&&(Ze=o._tr_tally(me,0,me.window[me.strstart-1]),me.match_available=0),me.insert=me.strstart<pt-1?me.strstart:pt-1,Dr===D?(In(me,!0),me.strm.avail_out===0?la:Nn):me.last_lit&&(In(me,!1),me.strm.avail_out===0)?_r:Qr}function wr(me,Dr){for(var Lr,Ze,Bt,Hr,Mn=me.window;;){if(me.lookahead<=Ht){if(yn(me),me.lookahead<=Ht&&Dr===d)return _r;if(me.lookahead===0)break}if(me.match_length=0,me.lookahead>=pt&&me.strstart>0&&(Bt=me.strstart-1,Ze=Mn[Bt],Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Ze===Mn[++Bt])){Hr=me.strstart+Ht;do;while(Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Ze===Mn[++Bt]&&Bt<Hr);me.match_length=Ht-(Hr-Bt),me.match_length>me.lookahead&&(me.match_length=me.lookahead)}if(me.match_length>=pt?(Lr=o._tr_tally(me,1,me.match_length-pt),me.lookahead-=me.match_length,me.strstart+=me.match_length,me.match_length=0):(Lr=o._tr_tally(me,0,me.window[me.strstart]),me.lookahead--,me.strstart++),Lr&&(In(me,!1),me.strm.avail_out===0))return _r}return me.insert=0,Dr===D?(In(me,!0),me.strm.avail_out===0?la:Nn):me.last_lit&&(In(me,!1),me.strm.avail_out===0)?_r:Qr}function Xr(me,Dr){for(var Lr;;){if(me.lookahead===0&&(yn(me),me.lookahead===0)){if(Dr===d)return _r;break}if(me.match_length=0,Lr=o._tr_tally(me,0,me.window[me.strstart]),me.lookahead--,me.strstart++,Lr&&(In(me,!1),me.strm.avail_out===0))return _r}return me.insert=0,Dr===D?(In(me,!0),me.strm.avail_out===0?la:Nn):me.last_lit&&(In(me,!1),me.strm.avail_out===0)?_r:Qr}function Mr(me,Dr,Lr,Ze,Bt){this.good_length=me,this.max_lazy=Dr,this.nice_length=Lr,this.max_chain=Ze,this.func=Bt}var za;za=[new Mr(0,0,0,0,pe),new Mr(4,4,8,4,$t),new Mr(4,5,16,8,$t),new Mr(4,6,32,32,$t),new Mr(4,4,16,16,or),new Mr(8,16,32,32,or),new Mr(8,16,128,128,or),new Mr(8,32,128,256,or),new Mr(32,128,258,1024,or),new Mr(32,258,258,4096,or)];function Ha(me){me.window_size=2*me.w_size,An(me.head),me.max_lazy_match=za[me.level].max_lazy,me.good_match=za[me.level].good_length,me.nice_match=za[me.level].nice_length,me.max_chain_length=za[me.level].max_chain,me.strstart=0,me.block_start=0,me.lookahead=0,me.insert=0,me.match_length=me.prev_length=pt-1,me.match_available=0,me.ins_h=0}function Fe(){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=Pe,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 t.Buf16(Yt*2),this.dyn_dtree=new t.Buf16((2*rt+1)*2),this.bl_tree=new t.Buf16((2*St+1)*2),An(this.dyn_ltree),An(this.dyn_dtree),An(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(Et+1),this.heap=new t.Buf16(2*ye+1),An(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*ye+1),An(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 ar(me){var Dr;return!me||!me.state?va(me,q):(me.total_in=me.total_out=0,me.data_type=W,Dr=me.state,Dr.pending=0,Dr.pending_out=0,Dr.wrap<0&&(Dr.wrap=-Dr.wrap),Dr.status=Dr.wrap?na:Ta,me.adler=Dr.wrap===2?0:1,Dr.last_flush=d,o._tr_init(Dr),z)}function ea(me){var Dr=ar(me);return Dr===z&&Ha(me.state),Dr}function Ma(me,Dr){return!me||!me.state||me.state.wrap!==2?q:(me.state.gzhead=Dr,z)}function Ut(me,Dr,Lr,Ze,Bt,Hr){if(!me)return q;var Mn=1;if(Dr===ie&&(Dr=6),Ze<0?(Mn=0,Ze=-Ze):Ze>15&&(Mn=2,Ze-=16),Bt<1||Bt>Ie||Lr!==Pe||Ze<8||Ze>15||Dr<0||Dr>9||Hr<0||Hr>L)return va(me,q);Ze===8&&(Ze=9);var ja=new Fe;return me.state=ja,ja.strm=me,ja.wrap=Mn,ja.gzhead=null,ja.w_bits=Ze,ja.w_size=1<<ja.w_bits,ja.w_mask=ja.w_size-1,ja.hash_bits=Bt+7,ja.hash_size=1<<ja.hash_bits,ja.hash_mask=ja.hash_size-1,ja.hash_shift=~~((ja.hash_bits+pt-1)/pt),ja.window=new t.Buf8(ja.w_size*2),ja.head=new t.Buf16(ja.hash_size),ja.prev=new t.Buf16(ja.w_size),ja.lit_bufsize=1<<Bt+6,ja.pending_buf_size=ja.lit_bufsize*4,ja.pending_buf=new t.Buf8(ja.pending_buf_size),ja.d_buf=1*ja.lit_bufsize,ja.l_buf=(1+2)*ja.lit_bufsize,ja.level=Dr,ja.strategy=Hr,ja.method=Lr,ea(me)}function br(me,Dr){return Ut(me,Dr,Pe,Ae,de,ae)}function ze(me,Dr){var Lr,Ze,Bt,Hr;if(!me||!me.state||Dr>j||Dr<0)return me?va(me,q):q;if(Ze=me.state,!me.output||!me.input&&me.avail_in!==0||Ze.status===Sa&&Dr!==D)return va(me,me.avail_out===0?ne:q);if(Ze.strm=me,Lr=Ze.last_flush,Ze.last_flush=Dr,Ze.status===na)if(Ze.wrap===2)me.adler=0,wa(Ze,31),wa(Ze,139),wa(Ze,8),Ze.gzhead?(wa(Ze,(Ze.gzhead.text?1:0)+(Ze.gzhead.hcrc?2:0)+(Ze.gzhead.extra?4:0)+(Ze.gzhead.name?8:0)+(Ze.gzhead.comment?16:0)),wa(Ze,Ze.gzhead.time&255),wa(Ze,Ze.gzhead.time>>8&255),wa(Ze,Ze.gzhead.time>>16&255),wa(Ze,Ze.gzhead.time>>24&255),wa(Ze,Ze.level===9?2:Ze.strategy>=Te||Ze.level<2?4:0),wa(Ze,Ze.gzhead.os&255),Ze.gzhead.extra&&Ze.gzhead.extra.length&&(wa(Ze,Ze.gzhead.extra.length&255),wa(Ze,Ze.gzhead.extra.length>>8&255)),Ze.gzhead.hcrc&&(me.adler=c(me.adler,Ze.pending_buf,Ze.pending,0)),Ze.gzindex=0,Ze.status=cr):(wa(Ze,0),wa(Ze,0),wa(Ze,0),wa(Ze,0),wa(Ze,0),wa(Ze,Ze.level===9?2:Ze.strategy>=Te||Ze.level<2?4:0),wa(Ze,ma),Ze.status=Ta);else{var Mn=Pe+(Ze.w_bits-8<<4)<<8,ja=-1;Ze.strategy>=Te||Ze.level<2?ja=0:Ze.level<6?ja=1:Ze.level===6?ja=2:ja=3,Mn|=ja<<6,Ze.strstart!==0&&(Mn|=mr),Mn+=31-Mn%31,Ze.status=Ta,_a(Ze,Mn),Ze.strstart!==0&&(_a(Ze,me.adler>>>16),_a(Ze,me.adler&65535)),me.adler=1}if(Ze.status===cr)if(Ze.gzhead.extra){for(Bt=Ze.pending;Ze.gzindex<(Ze.gzhead.extra.length&65535)&&!(Ze.pending===Ze.pending_buf_size&&(Ze.gzhead.hcrc&&Ze.pending>Bt&&(me.adler=c(me.adler,Ze.pending_buf,Ze.pending-Bt,Bt)),En(me),Bt=Ze.pending,Ze.pending===Ze.pending_buf_size));)wa(Ze,Ze.gzhead.extra[Ze.gzindex]&255),Ze.gzindex++;Ze.gzhead.hcrc&&Ze.pending>Bt&&(me.adler=c(me.adler,Ze.pending_buf,Ze.pending-Bt,Bt)),Ze.gzindex===Ze.gzhead.extra.length&&(Ze.gzindex=0,Ze.status=yr)}else Ze.status=yr;if(Ze.status===yr)if(Ze.gzhead.name){Bt=Ze.pending;do{if(Ze.pending===Ze.pending_buf_size&&(Ze.gzhead.hcrc&&Ze.pending>Bt&&(me.adler=c(me.adler,Ze.pending_buf,Ze.pending-Bt,Bt)),En(me),Bt=Ze.pending,Ze.pending===Ze.pending_buf_size)){Hr=1;break}Ze.gzindex<Ze.gzhead.name.length?Hr=Ze.gzhead.name.charCodeAt(Ze.gzindex++)&255:Hr=0,wa(Ze,Hr)}while(Hr!==0);Ze.gzhead.hcrc&&Ze.pending>Bt&&(me.adler=c(me.adler,Ze.pending_buf,Ze.pending-Bt,Bt)),Hr===0&&(Ze.gzindex=0,Ze.status=fa)}else Ze.status=fa;if(Ze.status===fa)if(Ze.gzhead.comment){Bt=Ze.pending;do{if(Ze.pending===Ze.pending_buf_size&&(Ze.gzhead.hcrc&&Ze.pending>Bt&&(me.adler=c(me.adler,Ze.pending_buf,Ze.pending-Bt,Bt)),En(me),Bt=Ze.pending,Ze.pending===Ze.pending_buf_size)){Hr=1;break}Ze.gzindex<Ze.gzhead.comment.length?Hr=Ze.gzhead.comment.charCodeAt(Ze.gzindex++)&255:Hr=0,wa(Ze,Hr)}while(Hr!==0);Ze.gzhead.hcrc&&Ze.pending>Bt&&(me.adler=c(me.adler,Ze.pending_buf,Ze.pending-Bt,Bt)),Hr===0&&(Ze.status=$a)}else Ze.status=$a;if(Ze.status===$a&&(Ze.gzhead.hcrc?(Ze.pending+2>Ze.pending_buf_size&&En(me),Ze.pending+2<=Ze.pending_buf_size&&(wa(Ze,me.adler&255),wa(Ze,me.adler>>8&255),me.adler=0,Ze.status=Ta)):Ze.status=Ta),Ze.pending!==0){if(En(me),me.avail_out===0)return Ze.last_flush=-1,z}else if(me.avail_in===0&&Ya(Dr)<=Ya(Lr)&&Dr!==D)return va(me,ne);if(Ze.status===Sa&&me.avail_in!==0)return va(me,ne);if(me.avail_in!==0||Ze.lookahead!==0||Dr!==d&&Ze.status!==Sa){var Pn=Ze.strategy===Te?Xr(Ze,Dr):Ze.strategy===$?wr(Ze,Dr):za[Ze.level].func(Ze,Dr);if((Pn===la||Pn===Nn)&&(Ze.status=Sa),Pn===_r||Pn===la)return me.avail_out===0&&(Ze.last_flush=-1),z;if(Pn===Qr&&(Dr===H?o._tr_align(Ze):Dr!==j&&(o._tr_stored_block(Ze,0,0,!1),Dr===n&&(An(Ze.head),Ze.lookahead===0&&(Ze.strstart=0,Ze.block_start=0,Ze.insert=0))),En(me),me.avail_out===0))return Ze.last_flush=-1,z}return Dr!==D?z:Ze.wrap<=0?w:(Ze.wrap===2?(wa(Ze,me.adler&255),wa(Ze,me.adler>>8&255),wa(Ze,me.adler>>16&255),wa(Ze,me.adler>>24&255),wa(Ze,me.total_in&255),wa(Ze,me.total_in>>8&255),wa(Ze,me.total_in>>16&255),wa(Ze,me.total_in>>24&255)):(_a(Ze,me.adler>>>16),_a(Ze,me.adler&65535)),En(me),Ze.wrap>0&&(Ze.wrap=-Ze.wrap),Ze.pending!==0?z:w)}function Pa(me){var Dr;return!me||!me.state?q:(Dr=me.state.status,Dr!==na&&Dr!==cr&&Dr!==yr&&Dr!==fa&&Dr!==$a&&Dr!==Ta&&Dr!==Sa?va(me,q):(me.state=null,Dr===Ta?va(me,re):z))}function hn(me,Dr){var Lr=Dr.length,Ze,Bt,Hr,Mn,ja,Pn,ii,MT;if(!me||!me.state||(Ze=me.state,Mn=Ze.wrap,Mn===2||Mn===1&&Ze.status!==na||Ze.lookahead))return q;for(Mn===1&&(me.adler=R(me.adler,Dr,Lr,0)),Ze.wrap=0,Lr>=Ze.w_size&&(Mn===0&&(An(Ze.head),Ze.strstart=0,Ze.block_start=0,Ze.insert=0),MT=new t.Buf8(Ze.w_size),t.arraySet(MT,Dr,Lr-Ze.w_size,Ze.w_size,0),Dr=MT,Lr=Ze.w_size),ja=me.avail_in,Pn=me.next_in,ii=me.input,me.avail_in=Lr,me.next_in=0,me.input=Dr,yn(Ze);Ze.lookahead>=pt;){Bt=Ze.strstart,Hr=Ze.lookahead-(pt-1);do Ze.ins_h=(Ze.ins_h<<Ze.hash_shift^Ze.window[Bt+pt-1])&Ze.hash_mask,Ze.prev[Bt&Ze.w_mask]=Ze.head[Ze.ins_h],Ze.head[Ze.ins_h]=Bt,Bt++;while(--Hr);Ze.strstart=Bt,Ze.lookahead=pt-1,yn(Ze)}return Ze.strstart+=Ze.lookahead,Ze.block_start=Ze.strstart,Ze.insert=Ze.lookahead,Ze.lookahead=0,Ze.match_length=Ze.prev_length=pt-1,Ze.match_available=0,me.next_in=Pn,me.input=ii,me.avail_in=ja,Ze.wrap=Mn,z}return deflate.deflateInit=br,deflate.deflateInit2=Ut,deflate.deflateReset=ea,deflate.deflateResetKeep=ar,deflate.deflateSetHeader=Ma,deflate.deflate=ze,deflate.deflateEnd=Pa,deflate.deflateSetDictionary=hn,deflate.deflateInfo="pako deflate (from Nodeca project)",deflate}var strings={},hasRequiredStrings;function requireStrings(){if(hasRequiredStrings)return strings;hasRequiredStrings=1;var t=requireCommon(),o=!0,R=!0;try{String.fromCharCode.apply(null,[0])}catch(H){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(H){R=!1}for(var c=new t.Buf8(256),h=0;h<256;h++)c[h]=h>=252?6:h>=248?5:h>=240?4:h>=224?3:h>=192?2:1;c[254]=c[254]=1,strings.string2buf=function(H){var n,D,j,z,w,q=H.length,re=0;for(z=0;z<q;z++)D=H.charCodeAt(z),(D&64512)===55296&&z+1<q&&(j=H.charCodeAt(z+1),(j&64512)===56320&&(D=65536+(D-55296<<10)+(j-56320),z++)),re+=D<128?1:D<2048?2:D<65536?3:4;for(n=new t.Buf8(re),w=0,z=0;w<re;z++)D=H.charCodeAt(z),(D&64512)===55296&&z+1<q&&(j=H.charCodeAt(z+1),(j&64512)===56320&&(D=65536+(D-55296<<10)+(j-56320),z++)),D<128?n[w++]=D:D<2048?(n[w++]=192|D>>>6,n[w++]=128|D&63):D<65536?(n[w++]=224|D>>>12,n[w++]=128|D>>>6&63,n[w++]=128|D&63):(n[w++]=240|D>>>18,n[w++]=128|D>>>12&63,n[w++]=128|D>>>6&63,n[w++]=128|D&63);return n};function d(H,n){if(n<65534&&(H.subarray&&R||!H.subarray&&o))return String.fromCharCode.apply(null,t.shrinkBuf(H,n));for(var D="",j=0;j<n;j++)D+=String.fromCharCode(H[j]);return D}return strings.buf2binstring=function(H){return d(H,H.length)},strings.binstring2buf=function(H){for(var n=new t.Buf8(H.length),D=0,j=n.length;D<j;D++)n[D]=H.charCodeAt(D);return n},strings.buf2string=function(H,n){var D,j,z,w,q=n||H.length,re=new Array(q*2);for(j=0,D=0;D<q;){if(z=H[D++],z<128){re[j++]=z;continue}if(w=c[z],w>4){re[j++]=65533,D+=w-1;continue}for(z&=w===2?31:w===3?15:7;w>1&&D<q;)z=z<<6|H[D++]&63,w--;if(w>1){re[j++]=65533;continue}z<65536?re[j++]=z:(z-=65536,re[j++]=55296|z>>10&1023,re[j++]=56320|z&1023)}return d(re,j)},strings.utf8border=function(H,n){var D;for(n=n||H.length,n>H.length&&(n=H.length),D=n-1;D>=0&&(H[D]&192)===128;)D--;return D<0||D===0?n:D+c[H[D]]>n?D:n},strings}var zstream,hasRequiredZstream;function requireZstream(){if(hasRequiredZstream)return zstream;hasRequiredZstream=1;function t(){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=t,zstream}var hasRequiredDeflate;function requireDeflate(){if(hasRequiredDeflate)return deflate$1;hasRequiredDeflate=1;var t=requireDeflate$1(),o=requireCommon(),R=requireStrings(),c=requireMessages(),h=requireZstream(),d=Object.prototype.toString,H=0,n=4,D=0,j=1,z=2,w=-1,q=0,re=8;function ne($){if(!(this instanceof ne))return new ne($);this.options=o.assign({level:w,method:re,chunkSize:16384,windowBits:15,memLevel:8,strategy:q,to:""},$||{});var L=this.options;L.raw&&L.windowBits>0?L.windowBits=-L.windowBits:L.gzip&&L.windowBits>0&&L.windowBits<16&&(L.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var ae=t.deflateInit2(this.strm,L.level,L.method,L.windowBits,L.memLevel,L.strategy);if(ae!==D)throw new Error(c[ae]);if(L.header&&t.deflateSetHeader(this.strm,L.header),L.dictionary){var W;if(typeof L.dictionary=="string"?W=R.string2buf(L.dictionary):d.call(L.dictionary)==="[object ArrayBuffer]"?W=new Uint8Array(L.dictionary):W=L.dictionary,ae=t.deflateSetDictionary(this.strm,W),ae!==D)throw new Error(c[ae]);this._dict_set=!0}}ne.prototype.push=function($,L){var ae=this.strm,W=this.options.chunkSize,Pe,Ie;if(this.ended)return!1;Ie=L===~~L?L:L===!0?n:H,typeof $=="string"?ae.input=R.string2buf($):d.call($)==="[object ArrayBuffer]"?ae.input=new Uint8Array($):ae.input=$,ae.next_in=0,ae.avail_in=ae.input.length;do{if(ae.avail_out===0&&(ae.output=new o.Buf8(W),ae.next_out=0,ae.avail_out=W),Pe=t.deflate(ae,Ie),Pe!==j&&Pe!==D)return this.onEnd(Pe),this.ended=!0,!1;(ae.avail_out===0||ae.avail_in===0&&(Ie===n||Ie===z))&&(this.options.to==="string"?this.onData(R.buf2binstring(o.shrinkBuf(ae.output,ae.next_out))):this.onData(o.shrinkBuf(ae.output,ae.next_out)))}while((ae.avail_in>0||ae.avail_out===0)&&Pe!==j);return Ie===n?(Pe=t.deflateEnd(this.strm),this.onEnd(Pe),this.ended=!0,Pe===D):(Ie===z&&(this.onEnd(D),ae.avail_out=0),!0)},ne.prototype.onData=function($){this.chunks.push($)},ne.prototype.onEnd=function($){$===D&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=$,this.msg=this.strm.msg};function ie($,L){var ae=new ne(L);if(ae.push($,!0),ae.err)throw ae.msg||c[ae.err];return ae.result}function Re($,L){return L=L||{},L.raw=!0,ie($,L)}function Te($,L){return L=L||{},L.gzip=!0,ie($,L)}return deflate$1.Deflate=ne,deflate$1.deflate=ie,deflate$1.deflateRaw=Re,deflate$1.gzip=Te,deflate$1}var inflate$1={},inflate={},inffast,hasRequiredInffast;function requireInffast(){if(hasRequiredInffast)return inffast;hasRequiredInffast=1;var t=30,o=12;return inffast=function(c,h){var d,H,n,D,j,z,w,q,re,ne,ie,Re,Te,$,L,ae,W,Pe,Ie,Ae,de,Ye,Ue,ye,rt;d=c.state,H=c.next_in,ye=c.input,n=H+(c.avail_in-5),D=c.next_out,rt=c.output,j=D-(h-c.avail_out),z=D+(c.avail_out-257),w=d.dmax,q=d.wsize,re=d.whave,ne=d.wnext,ie=d.window,Re=d.hold,Te=d.bits,$=d.lencode,L=d.distcode,ae=(1<<d.lenbits)-1,W=(1<<d.distbits)-1;e:do{Te<15&&(Re+=ye[H++]<<Te,Te+=8,Re+=ye[H++]<<Te,Te+=8),Pe=$[Re&ae];t:for(;;){if(Ie=Pe>>>24,Re>>>=Ie,Te-=Ie,Ie=Pe>>>16&255,Ie===0)rt[D++]=Pe&65535;else if(Ie&16){Ae=Pe&65535,Ie&=15,Ie&&(Te<Ie&&(Re+=ye[H++]<<Te,Te+=8),Ae+=Re&(1<<Ie)-1,Re>>>=Ie,Te-=Ie),Te<15&&(Re+=ye[H++]<<Te,Te+=8,Re+=ye[H++]<<Te,Te+=8),Pe=L[Re&W];r:for(;;){if(Ie=Pe>>>24,Re>>>=Ie,Te-=Ie,Ie=Pe>>>16&255,Ie&16){if(de=Pe&65535,Ie&=15,Te<Ie&&(Re+=ye[H++]<<Te,Te+=8,Te<Ie&&(Re+=ye[H++]<<Te,Te+=8)),de+=Re&(1<<Ie)-1,de>w){c.msg="invalid distance too far back",d.mode=t;break e}if(Re>>>=Ie,Te-=Ie,Ie=D-j,de>Ie){if(Ie=de-Ie,Ie>re&&d.sane){c.msg="invalid distance too far back",d.mode=t;break e}if(Ye=0,Ue=ie,ne===0){if(Ye+=q-Ie,Ie<Ae){Ae-=Ie;do rt[D++]=ie[Ye++];while(--Ie);Ye=D-de,Ue=rt}}else if(ne<Ie){if(Ye+=q+ne-Ie,Ie-=ne,Ie<Ae){Ae-=Ie;do rt[D++]=ie[Ye++];while(--Ie);if(Ye=0,ne<Ae){Ie=ne,Ae-=Ie;do rt[D++]=ie[Ye++];while(--Ie);Ye=D-de,Ue=rt}}}else if(Ye+=ne-Ie,Ie<Ae){Ae-=Ie;do rt[D++]=ie[Ye++];while(--Ie);Ye=D-de,Ue=rt}for(;Ae>2;)rt[D++]=Ue[Ye++],rt[D++]=Ue[Ye++],rt[D++]=Ue[Ye++],Ae-=3;Ae&&(rt[D++]=Ue[Ye++],Ae>1&&(rt[D++]=Ue[Ye++]))}else{Ye=D-de;do rt[D++]=rt[Ye++],rt[D++]=rt[Ye++],rt[D++]=rt[Ye++],Ae-=3;while(Ae>2);Ae&&(rt[D++]=rt[Ye++],Ae>1&&(rt[D++]=rt[Ye++]))}}else if((Ie&64)===0){Pe=L[(Pe&65535)+(Re&(1<<Ie)-1)];continue r}else{c.msg="invalid distance code",d.mode=t;break e}break}}else if((Ie&64)===0){Pe=$[(Pe&65535)+(Re&(1<<Ie)-1)];continue t}else if(Ie&32){d.mode=o;break e}else{c.msg="invalid literal/length code",d.mode=t;break e}break}}while(H<n&&D<z);Ae=Te>>3,H-=Ae,Te-=Ae<<3,Re&=(1<<Te)-1,c.next_in=H,c.next_out=D,c.avail_in=H<n?5+(n-H):5-(H-n),c.avail_out=D<z?257+(z-D):257-(D-z),d.hold=Re,d.bits=Te},inffast}var inftrees,hasRequiredInftrees;function requireInftrees(){if(hasRequiredInftrees)return inftrees;hasRequiredInftrees=1;var t=requireCommon(),o=15,R=852,c=592,h=0,d=1,H=2,n=[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],D=[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],j=[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],z=[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(q,re,ne,ie,Re,Te,$,L){var ae=L.bits,W=0,Pe=0,Ie=0,Ae=0,de=0,Ye=0,Ue=0,ye=0,rt=0,St=0,Yt,Et,pt,Ht,rr,mr=null,na=0,cr,yr=new t.Buf16(o+1),fa=new t.Buf16(o+1),$a=null,Ta=0,Sa,_r,Qr;for(W=0;W<=o;W++)yr[W]=0;for(Pe=0;Pe<ie;Pe++)yr[re[ne+Pe]]++;for(de=ae,Ae=o;Ae>=1&&yr[Ae]===0;Ae--);if(de>Ae&&(de=Ae),Ae===0)return Re[Te++]=1<<24|64<<16|0,Re[Te++]=1<<24|64<<16|0,L.bits=1,0;for(Ie=1;Ie<Ae&&yr[Ie]===0;Ie++);for(de<Ie&&(de=Ie),ye=1,W=1;W<=o;W++)if(ye<<=1,ye-=yr[W],ye<0)return-1;if(ye>0&&(q===h||Ae!==1))return-1;for(fa[1]=0,W=1;W<o;W++)fa[W+1]=fa[W]+yr[W];for(Pe=0;Pe<ie;Pe++)re[ne+Pe]!==0&&($[fa[re[ne+Pe]]++]=Pe);if(q===h?(mr=$a=$,cr=19):q===d?(mr=n,na-=257,$a=D,Ta-=257,cr=256):(mr=j,$a=z,cr=-1),St=0,Pe=0,W=Ie,rr=Te,Ye=de,Ue=0,pt=-1,rt=1<<de,Ht=rt-1,q===d&&rt>R||q===H&&rt>c)return 1;for(;;){Sa=W-Ue,$[Pe]<cr?(_r=0,Qr=$[Pe]):$[Pe]>cr?(_r=$a[Ta+$[Pe]],Qr=mr[na+$[Pe]]):(_r=32+64,Qr=0),Yt=1<<W-Ue,Et=1<<Ye,Ie=Et;do Et-=Yt,Re[rr+(St>>Ue)+Et]=Sa<<24|_r<<16|Qr|0;while(Et!==0);for(Yt=1<<W-1;St&Yt;)Yt>>=1;if(Yt!==0?(St&=Yt-1,St+=Yt):St=0,Pe++,--yr[W]===0){if(W===Ae)break;W=re[ne+$[Pe]]}if(W>de&&(St&Ht)!==pt){for(Ue===0&&(Ue=de),rr+=Ie,Ye=W-Ue,ye=1<<Ye;Ye+Ue<Ae&&(ye-=yr[Ye+Ue],!(ye<=0));)Ye++,ye<<=1;if(rt+=1<<Ye,q===d&&rt>R||q===H&&rt>c)return 1;pt=St&Ht,Re[pt]=de<<24|Ye<<16|rr-Te|0}}return St!==0&&(Re[rr+St]=W-Ue<<24|64<<16|0),L.bits=de,0},inftrees}var hasRequiredInflate$1;function requireInflate$1(){if(hasRequiredInflate$1)return inflate;hasRequiredInflate$1=1;var t=requireCommon(),o=requireAdler32(),R=requireCrc32(),c=requireInffast(),h=requireInftrees(),d=0,H=1,n=2,D=4,j=5,z=6,w=0,q=1,re=2,ne=-2,ie=-3,Re=-4,Te=-5,$=8,L=1,ae=2,W=3,Pe=4,Ie=5,Ae=6,de=7,Ye=8,Ue=9,ye=10,rt=11,St=12,Yt=13,Et=14,pt=15,Ht=16,rr=17,mr=18,na=19,cr=20,yr=21,fa=22,$a=23,Ta=24,Sa=25,_r=26,Qr=27,la=28,Nn=29,ma=30,va=31,Ya=32,An=852,En=592,In=15,wa=In;function _a(Ut){return(Ut>>>24&255)+(Ut>>>8&65280)+((Ut&65280)<<8)+((Ut&255)<<24)}function pa(){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 t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Zn(Ut){var br;return!Ut||!Ut.state?ne:(br=Ut.state,Ut.total_in=Ut.total_out=br.total=0,Ut.msg="",br.wrap&&(Ut.adler=br.wrap&1),br.mode=L,br.last=0,br.havedict=0,br.dmax=32768,br.head=null,br.hold=0,br.bits=0,br.lencode=br.lendyn=new t.Buf32(An),br.distcode=br.distdyn=new t.Buf32(En),br.sane=1,br.back=-1,w)}function yn(Ut){var br;return!Ut||!Ut.state?ne:(br=Ut.state,br.wsize=0,br.whave=0,br.wnext=0,Zn(Ut))}function pe(Ut,br){var ze,Pa;return!Ut||!Ut.state||(Pa=Ut.state,br<0?(ze=0,br=-br):(ze=(br>>4)+1,br<48&&(br&=15)),br&&(br<8||br>15))?ne:(Pa.window!==null&&Pa.wbits!==br&&(Pa.window=null),Pa.wrap=ze,Pa.wbits=br,yn(Ut))}function $t(Ut,br){var ze,Pa;return Ut?(Pa=new pa,Ut.state=Pa,Pa.window=null,ze=pe(Ut,br),ze!==w&&(Ut.state=null),ze):ne}function or(Ut){return $t(Ut,wa)}var wr=!0,Xr,Mr;function za(Ut){if(wr){var br;for(Xr=new t.Buf32(512),Mr=new t.Buf32(32),br=0;br<144;)Ut.lens[br++]=8;for(;br<256;)Ut.lens[br++]=9;for(;br<280;)Ut.lens[br++]=7;for(;br<288;)Ut.lens[br++]=8;for(h(H,Ut.lens,0,288,Xr,0,Ut.work,{bits:9}),br=0;br<32;)Ut.lens[br++]=5;h(n,Ut.lens,0,32,Mr,0,Ut.work,{bits:5}),wr=!1}Ut.lencode=Xr,Ut.lenbits=9,Ut.distcode=Mr,Ut.distbits=5}function Ha(Ut,br,ze,Pa){var hn,me=Ut.state;return me.window===null&&(me.wsize=1<<me.wbits,me.wnext=0,me.whave=0,me.window=new t.Buf8(me.wsize)),Pa>=me.wsize?(t.arraySet(me.window,br,ze-me.wsize,me.wsize,0),me.wnext=0,me.whave=me.wsize):(hn=me.wsize-me.wnext,hn>Pa&&(hn=Pa),t.arraySet(me.window,br,ze-Pa,hn,me.wnext),Pa-=hn,Pa?(t.arraySet(me.window,br,ze-Pa,Pa,0),me.wnext=Pa,me.whave=me.wsize):(me.wnext+=hn,me.wnext===me.wsize&&(me.wnext=0),me.whave<me.wsize&&(me.whave+=hn))),0}function Fe(Ut,br){var ze,Pa,hn,me,Dr,Lr,Ze,Bt,Hr,Mn,ja,Pn,ii,MT,Hi=0,$n,Qi,R0,u0,qi,WT,Rt,De,xe=new t.Buf8(4),$e,_t,Pt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Ut||!Ut.state||!Ut.output||!Ut.input&&Ut.avail_in!==0)return ne;ze=Ut.state,ze.mode===St&&(ze.mode=Yt),Dr=Ut.next_out,hn=Ut.output,Ze=Ut.avail_out,me=Ut.next_in,Pa=Ut.input,Lr=Ut.avail_in,Bt=ze.hold,Hr=ze.bits,Mn=Lr,ja=Ze,De=w;e:for(;;)switch(ze.mode){case L:if(ze.wrap===0){ze.mode=Yt;break}for(;Hr<16;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(ze.wrap&2&&Bt===35615){ze.check=0,xe[0]=Bt&255,xe[1]=Bt>>>8&255,ze.check=R(ze.check,xe,2,0),Bt=0,Hr=0,ze.mode=ae;break}if(ze.flags=0,ze.head&&(ze.head.done=!1),!(ze.wrap&1)||(((Bt&255)<<8)+(Bt>>8))%31){Ut.msg="incorrect header check",ze.mode=ma;break}if((Bt&15)!==$){Ut.msg="unknown compression method",ze.mode=ma;break}if(Bt>>>=4,Hr-=4,Rt=(Bt&15)+8,ze.wbits===0)ze.wbits=Rt;else if(Rt>ze.wbits){Ut.msg="invalid window size",ze.mode=ma;break}ze.dmax=1<<Rt,Ut.adler=ze.check=1,ze.mode=Bt&512?ye:St,Bt=0,Hr=0;break;case ae:for(;Hr<16;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(ze.flags=Bt,(ze.flags&255)!==$){Ut.msg="unknown compression method",ze.mode=ma;break}if(ze.flags&57344){Ut.msg="unknown header flags set",ze.mode=ma;break}ze.head&&(ze.head.text=Bt>>8&1),ze.flags&512&&(xe[0]=Bt&255,xe[1]=Bt>>>8&255,ze.check=R(ze.check,xe,2,0)),Bt=0,Hr=0,ze.mode=W;case W:for(;Hr<32;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}ze.head&&(ze.head.time=Bt),ze.flags&512&&(xe[0]=Bt&255,xe[1]=Bt>>>8&255,xe[2]=Bt>>>16&255,xe[3]=Bt>>>24&255,ze.check=R(ze.check,xe,4,0)),Bt=0,Hr=0,ze.mode=Pe;case Pe:for(;Hr<16;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}ze.head&&(ze.head.xflags=Bt&255,ze.head.os=Bt>>8),ze.flags&512&&(xe[0]=Bt&255,xe[1]=Bt>>>8&255,ze.check=R(ze.check,xe,2,0)),Bt=0,Hr=0,ze.mode=Ie;case Ie:if(ze.flags&1024){for(;Hr<16;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}ze.length=Bt,ze.head&&(ze.head.extra_len=Bt),ze.flags&512&&(xe[0]=Bt&255,xe[1]=Bt>>>8&255,ze.check=R(ze.check,xe,2,0)),Bt=0,Hr=0}else ze.head&&(ze.head.extra=null);ze.mode=Ae;case Ae:if(ze.flags&1024&&(Pn=ze.length,Pn>Lr&&(Pn=Lr),Pn&&(ze.head&&(Rt=ze.head.extra_len-ze.length,ze.head.extra||(ze.head.extra=new Array(ze.head.extra_len)),t.arraySet(ze.head.extra,Pa,me,Pn,Rt)),ze.flags&512&&(ze.check=R(ze.check,Pa,Pn,me)),Lr-=Pn,me+=Pn,ze.length-=Pn),ze.length))break e;ze.length=0,ze.mode=de;case de:if(ze.flags&2048){if(Lr===0)break e;Pn=0;do Rt=Pa[me+Pn++],ze.head&&Rt&&ze.length<65536&&(ze.head.name+=String.fromCharCode(Rt));while(Rt&&Pn<Lr);if(ze.flags&512&&(ze.check=R(ze.check,Pa,Pn,me)),Lr-=Pn,me+=Pn,Rt)break e}else ze.head&&(ze.head.name=null);ze.length=0,ze.mode=Ye;case Ye:if(ze.flags&4096){if(Lr===0)break e;Pn=0;do Rt=Pa[me+Pn++],ze.head&&Rt&&ze.length<65536&&(ze.head.comment+=String.fromCharCode(Rt));while(Rt&&Pn<Lr);if(ze.flags&512&&(ze.check=R(ze.check,Pa,Pn,me)),Lr-=Pn,me+=Pn,Rt)break e}else ze.head&&(ze.head.comment=null);ze.mode=Ue;case Ue:if(ze.flags&512){for(;Hr<16;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(Bt!==(ze.check&65535)){Ut.msg="header crc mismatch",ze.mode=ma;break}Bt=0,Hr=0}ze.head&&(ze.head.hcrc=ze.flags>>9&1,ze.head.done=!0),Ut.adler=ze.check=0,ze.mode=St;break;case ye:for(;Hr<32;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}Ut.adler=ze.check=_a(Bt),Bt=0,Hr=0,ze.mode=rt;case rt:if(ze.havedict===0)return Ut.next_out=Dr,Ut.avail_out=Ze,Ut.next_in=me,Ut.avail_in=Lr,ze.hold=Bt,ze.bits=Hr,re;Ut.adler=ze.check=1,ze.mode=St;case St:if(br===j||br===z)break e;case Yt:if(ze.last){Bt>>>=Hr&7,Hr-=Hr&7,ze.mode=Qr;break}for(;Hr<3;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}switch(ze.last=Bt&1,Bt>>>=1,Hr-=1,Bt&3){case 0:ze.mode=Et;break;case 1:if(za(ze),ze.mode=cr,br===z){Bt>>>=2,Hr-=2;break e}break;case 2:ze.mode=rr;break;case 3:Ut.msg="invalid block type",ze.mode=ma}Bt>>>=2,Hr-=2;break;case Et:for(Bt>>>=Hr&7,Hr-=Hr&7;Hr<32;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if((Bt&65535)!==(Bt>>>16^65535)){Ut.msg="invalid stored block lengths",ze.mode=ma;break}if(ze.length=Bt&65535,Bt=0,Hr=0,ze.mode=pt,br===z)break e;case pt:ze.mode=Ht;case Ht:if(Pn=ze.length,Pn){if(Pn>Lr&&(Pn=Lr),Pn>Ze&&(Pn=Ze),Pn===0)break e;t.arraySet(hn,Pa,me,Pn,Dr),Lr-=Pn,me+=Pn,Ze-=Pn,Dr+=Pn,ze.length-=Pn;break}ze.mode=St;break;case rr:for(;Hr<14;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(ze.nlen=(Bt&31)+257,Bt>>>=5,Hr-=5,ze.ndist=(Bt&31)+1,Bt>>>=5,Hr-=5,ze.ncode=(Bt&15)+4,Bt>>>=4,Hr-=4,ze.nlen>286||ze.ndist>30){Ut.msg="too many length or distance symbols",ze.mode=ma;break}ze.have=0,ze.mode=mr;case mr:for(;ze.have<ze.ncode;){for(;Hr<3;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}ze.lens[Pt[ze.have++]]=Bt&7,Bt>>>=3,Hr-=3}for(;ze.have<19;)ze.lens[Pt[ze.have++]]=0;if(ze.lencode=ze.lendyn,ze.lenbits=7,$e={bits:ze.lenbits},De=h(d,ze.lens,0,19,ze.lencode,0,ze.work,$e),ze.lenbits=$e.bits,De){Ut.msg="invalid code lengths set",ze.mode=ma;break}ze.have=0,ze.mode=na;case na:for(;ze.have<ze.nlen+ze.ndist;){for(;Hi=ze.lencode[Bt&(1<<ze.lenbits)-1],$n=Hi>>>24,Qi=Hi>>>16&255,R0=Hi&65535,!($n<=Hr);){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(R0<16)Bt>>>=$n,Hr-=$n,ze.lens[ze.have++]=R0;else{if(R0===16){for(_t=$n+2;Hr<_t;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(Bt>>>=$n,Hr-=$n,ze.have===0){Ut.msg="invalid bit length repeat",ze.mode=ma;break}Rt=ze.lens[ze.have-1],Pn=3+(Bt&3),Bt>>>=2,Hr-=2}else if(R0===17){for(_t=$n+3;Hr<_t;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}Bt>>>=$n,Hr-=$n,Rt=0,Pn=3+(Bt&7),Bt>>>=3,Hr-=3}else{for(_t=$n+7;Hr<_t;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}Bt>>>=$n,Hr-=$n,Rt=0,Pn=11+(Bt&127),Bt>>>=7,Hr-=7}if(ze.have+Pn>ze.nlen+ze.ndist){Ut.msg="invalid bit length repeat",ze.mode=ma;break}for(;Pn--;)ze.lens[ze.have++]=Rt}}if(ze.mode===ma)break;if(ze.lens[256]===0){Ut.msg="invalid code -- missing end-of-block",ze.mode=ma;break}if(ze.lenbits=9,$e={bits:ze.lenbits},De=h(H,ze.lens,0,ze.nlen,ze.lencode,0,ze.work,$e),ze.lenbits=$e.bits,De){Ut.msg="invalid literal/lengths set",ze.mode=ma;break}if(ze.distbits=6,ze.distcode=ze.distdyn,$e={bits:ze.distbits},De=h(n,ze.lens,ze.nlen,ze.ndist,ze.distcode,0,ze.work,$e),ze.distbits=$e.bits,De){Ut.msg="invalid distances set",ze.mode=ma;break}if(ze.mode=cr,br===z)break e;case cr:ze.mode=yr;case yr:if(Lr>=6&&Ze>=258){Ut.next_out=Dr,Ut.avail_out=Ze,Ut.next_in=me,Ut.avail_in=Lr,ze.hold=Bt,ze.bits=Hr,c(Ut,ja),Dr=Ut.next_out,hn=Ut.output,Ze=Ut.avail_out,me=Ut.next_in,Pa=Ut.input,Lr=Ut.avail_in,Bt=ze.hold,Hr=ze.bits,ze.mode===St&&(ze.back=-1);break}for(ze.back=0;Hi=ze.lencode[Bt&(1<<ze.lenbits)-1],$n=Hi>>>24,Qi=Hi>>>16&255,R0=Hi&65535,!($n<=Hr);){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(Qi&&(Qi&240)===0){for(u0=$n,qi=Qi,WT=R0;Hi=ze.lencode[WT+((Bt&(1<<u0+qi)-1)>>u0)],$n=Hi>>>24,Qi=Hi>>>16&255,R0=Hi&65535,!(u0+$n<=Hr);){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}Bt>>>=u0,Hr-=u0,ze.back+=u0}if(Bt>>>=$n,Hr-=$n,ze.back+=$n,ze.length=R0,Qi===0){ze.mode=_r;break}if(Qi&32){ze.back=-1,ze.mode=St;break}if(Qi&64){Ut.msg="invalid literal/length code",ze.mode=ma;break}ze.extra=Qi&15,ze.mode=fa;case fa:if(ze.extra){for(_t=ze.extra;Hr<_t;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}ze.length+=Bt&(1<<ze.extra)-1,Bt>>>=ze.extra,Hr-=ze.extra,ze.back+=ze.extra}ze.was=ze.length,ze.mode=$a;case $a:for(;Hi=ze.distcode[Bt&(1<<ze.distbits)-1],$n=Hi>>>24,Qi=Hi>>>16&255,R0=Hi&65535,!($n<=Hr);){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if((Qi&240)===0){for(u0=$n,qi=Qi,WT=R0;Hi=ze.distcode[WT+((Bt&(1<<u0+qi)-1)>>u0)],$n=Hi>>>24,Qi=Hi>>>16&255,R0=Hi&65535,!(u0+$n<=Hr);){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}Bt>>>=u0,Hr-=u0,ze.back+=u0}if(Bt>>>=$n,Hr-=$n,ze.back+=$n,Qi&64){Ut.msg="invalid distance code",ze.mode=ma;break}ze.offset=R0,ze.extra=Qi&15,ze.mode=Ta;case Ta:if(ze.extra){for(_t=ze.extra;Hr<_t;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}ze.offset+=Bt&(1<<ze.extra)-1,Bt>>>=ze.extra,Hr-=ze.extra,ze.back+=ze.extra}if(ze.offset>ze.dmax){Ut.msg="invalid distance too far back",ze.mode=ma;break}ze.mode=Sa;case Sa:if(Ze===0)break e;if(Pn=ja-Ze,ze.offset>Pn){if(Pn=ze.offset-Pn,Pn>ze.whave&&ze.sane){Ut.msg="invalid distance too far back",ze.mode=ma;break}Pn>ze.wnext?(Pn-=ze.wnext,ii=ze.wsize-Pn):ii=ze.wnext-Pn,Pn>ze.length&&(Pn=ze.length),MT=ze.window}else MT=hn,ii=Dr-ze.offset,Pn=ze.length;Pn>Ze&&(Pn=Ze),Ze-=Pn,ze.length-=Pn;do hn[Dr++]=MT[ii++];while(--Pn);ze.length===0&&(ze.mode=yr);break;case _r:if(Ze===0)break e;hn[Dr++]=ze.length,Ze--,ze.mode=yr;break;case Qr:if(ze.wrap){for(;Hr<32;){if(Lr===0)break e;Lr--,Bt|=Pa[me++]<<Hr,Hr+=8}if(ja-=Ze,Ut.total_out+=ja,ze.total+=ja,ja&&(Ut.adler=ze.check=ze.flags?R(ze.check,hn,ja,Dr-ja):o(ze.check,hn,ja,Dr-ja)),ja=Ze,(ze.flags?Bt:_a(Bt))!==ze.check){Ut.msg="incorrect data check",ze.mode=ma;break}Bt=0,Hr=0}ze.mode=la;case la:if(ze.wrap&&ze.flags){for(;Hr<32;){if(Lr===0)break e;Lr--,Bt+=Pa[me++]<<Hr,Hr+=8}if(Bt!==(ze.total&4294967295)){Ut.msg="incorrect length check",ze.mode=ma;break}Bt=0,Hr=0}ze.mode=Nn;case Nn:De=q;break e;case ma:De=ie;break e;case va:return Re;case Ya:default:return ne}return Ut.next_out=Dr,Ut.avail_out=Ze,Ut.next_in=me,Ut.avail_in=Lr,ze.hold=Bt,ze.bits=Hr,(ze.wsize||ja!==Ut.avail_out&&ze.mode<ma&&(ze.mode<Qr||br!==D))&&Ha(Ut,Ut.output,Ut.next_out,ja-Ut.avail_out),Mn-=Ut.avail_in,ja-=Ut.avail_out,Ut.total_in+=Mn,Ut.total_out+=ja,ze.total+=ja,ze.wrap&&ja&&(Ut.adler=ze.check=ze.flags?R(ze.check,hn,ja,Ut.next_out-ja):o(ze.check,hn,ja,Ut.next_out-ja)),Ut.data_type=ze.bits+(ze.last?64:0)+(ze.mode===St?128:0)+(ze.mode===cr||ze.mode===pt?256:0),(Mn===0&&ja===0||br===D)&&De===w&&(De=Te),De}function ar(Ut){if(!Ut||!Ut.state)return ne;var br=Ut.state;return br.window&&(br.window=null),Ut.state=null,w}function ea(Ut,br){var ze;return!Ut||!Ut.state||(ze=Ut.state,(ze.wrap&2)===0)?ne:(ze.head=br,br.done=!1,w)}function Ma(Ut,br){var ze=br.length,Pa,hn,me;return!Ut||!Ut.state||(Pa=Ut.state,Pa.wrap!==0&&Pa.mode!==rt)?ne:Pa.mode===rt&&(hn=1,hn=o(hn,br,ze,0),hn!==Pa.check)?ie:(me=Ha(Ut,br,ze,ze),me?(Pa.mode=va,Re):(Pa.havedict=1,w))}return inflate.inflateReset=yn,inflate.inflateReset2=pe,inflate.inflateResetKeep=Zn,inflate.inflateInit=or,inflate.inflateInit2=$t,inflate.inflate=Fe,inflate.inflateEnd=ar,inflate.inflateGetHeader=ea,inflate.inflateSetDictionary=Ma,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 t(){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=t,gzheader}var hasRequiredInflate;function requireInflate(){if(hasRequiredInflate)return inflate$1;hasRequiredInflate=1;var t=requireInflate$1(),o=requireCommon(),R=requireStrings(),c=requireConstants(),h=requireMessages(),d=requireZstream(),H=requireGzheader(),n=Object.prototype.toString;function D(w){if(!(this instanceof D))return new D(w);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},w||{});var q=this.options;q.raw&&q.windowBits>=0&&q.windowBits<16&&(q.windowBits=-q.windowBits,q.windowBits===0&&(q.windowBits=-15)),q.windowBits>=0&&q.windowBits<16&&!(w&&w.windowBits)&&(q.windowBits+=32),q.windowBits>15&&q.windowBits<48&&(q.windowBits&15)===0&&(q.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var re=t.inflateInit2(this.strm,q.windowBits);if(re!==c.Z_OK)throw new Error(h[re]);if(this.header=new H,t.inflateGetHeader(this.strm,this.header),q.dictionary&&(typeof q.dictionary=="string"?q.dictionary=R.string2buf(q.dictionary):n.call(q.dictionary)==="[object ArrayBuffer]"&&(q.dictionary=new Uint8Array(q.dictionary)),q.raw&&(re=t.inflateSetDictionary(this.strm,q.dictionary),re!==c.Z_OK)))throw new Error(h[re])}D.prototype.push=function(w,q){var re=this.strm,ne=this.options.chunkSize,ie=this.options.dictionary,Re,Te,$,L,ae,W=!1;if(this.ended)return!1;Te=q===~~q?q:q===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof w=="string"?re.input=R.binstring2buf(w):n.call(w)==="[object ArrayBuffer]"?re.input=new Uint8Array(w):re.input=w,re.next_in=0,re.avail_in=re.input.length;do{if(re.avail_out===0&&(re.output=new o.Buf8(ne),re.next_out=0,re.avail_out=ne),Re=t.inflate(re,c.Z_NO_FLUSH),Re===c.Z_NEED_DICT&&ie&&(Re=t.inflateSetDictionary(this.strm,ie)),Re===c.Z_BUF_ERROR&&W===!0&&(Re=c.Z_OK,W=!1),Re!==c.Z_STREAM_END&&Re!==c.Z_OK)return this.onEnd(Re),this.ended=!0,!1;re.next_out&&(re.avail_out===0||Re===c.Z_STREAM_END||re.avail_in===0&&(Te===c.Z_FINISH||Te===c.Z_SYNC_FLUSH))&&(this.options.to==="string"?($=R.utf8border(re.output,re.next_out),L=re.next_out-$,ae=R.buf2string(re.output,$),re.next_out=L,re.avail_out=ne-L,L&&o.arraySet(re.output,re.output,$,L,0),this.onData(ae)):this.onData(o.shrinkBuf(re.output,re.next_out))),re.avail_in===0&&re.avail_out===0&&(W=!0)}while((re.avail_in>0||re.avail_out===0)&&Re!==c.Z_STREAM_END);return Re===c.Z_STREAM_END&&(Te=c.Z_FINISH),Te===c.Z_FINISH?(Re=t.inflateEnd(this.strm),this.onEnd(Re),this.ended=!0,Re===c.Z_OK):(Te===c.Z_SYNC_FLUSH&&(this.onEnd(c.Z_OK),re.avail_out=0),!0)},D.prototype.onData=function(w){this.chunks.push(w)},D.prototype.onEnd=function(w){w===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=w,this.msg=this.strm.msg};function j(w,q){var re=new D(q);if(re.push(w,!0),re.err)throw re.msg||h[re.err];return re.result}function z(w,q){return q=q||{},q.raw=!0,j(w,q)}return inflate$1.Inflate=D,inflate$1.inflate=j,inflate$1.inflateRaw=z,inflate$1.ungzip=j,inflate$1}var pako_1,hasRequiredPako;function requirePako(){if(hasRequiredPako)return pako_1;hasRequiredPako=1;var t=requireCommon().assign,o=requireDeflate(),R=requireInflate(),c=requireConstants(),h={};return t(h,o,R,c),pako_1=h,pako_1}(function(t){(function(){var o={},R;t.exports=o,typeof commonjsRequire=="function"?R=requirePako():R=window.pako,function(c,h){c.toRGBA8=function(d){var H=d.width,n=d.height;if(d.tabs.acTL==null)return[c.toRGBA8.decodeImage(d.data,H,n,d).buffer];var D=[];d.frames[0].data==null&&(d.frames[0].data=d.data);for(var j,z=new Uint8Array(H*n*4),w=0;w<d.frames.length;w++){var q=d.frames[w],re=q.rect.x,ne=q.rect.y,ie=q.rect.width,Re=q.rect.height,Te=c.toRGBA8.decodeImage(q.data,ie,Re,d);if(w==0?j=Te:q.blend==0?c._copyTile(Te,ie,Re,j,H,n,re,ne,0):q.blend==1&&c._copyTile(Te,ie,Re,j,H,n,re,ne,1),D.push(j.buffer),j=j.slice(0),q.dispose!=0){if(q.dispose==1)c._copyTile(z,ie,Re,j,H,n,re,ne,0);else if(q.dispose==2){for(var $=w-1;d.frames[$].dispose==2;)$--;j=new Uint8Array(D[$]).slice(0)}}}return D},c.toRGBA8.decodeImage=function(d,H,n,D){var j=H*n,z=c.decode._getBPP(D),w=Math.ceil(H*z/8),q=new Uint8Array(j*4),re=new Uint32Array(q.buffer),ne=D.ctype,ie=D.depth,Re=c._bin.readUshort;if(ne==6){var Te=j<<2;if(ie==8)for(var $=0;$<Te;$++)q[$]=d[$];if(ie==16)for(var $=0;$<Te;$++)q[$]=d[$<<1]}else if(ne==2){var L=D.tabs.tRNS,ae=-1,W=-1,Pe=-1;if(L&&(ae=L[0],W=L[1],Pe=L[2]),ie==8)for(var $=0;$<j;$++){var Ie=$<<2,Ae=$*3;q[Ie]=d[Ae],q[Ie+1]=d[Ae+1],q[Ie+2]=d[Ae+2],q[Ie+3]=255,ae!=-1&&d[Ae]==ae&&d[Ae+1]==W&&d[Ae+2]==Pe&&(q[Ie+3]=0)}if(ie==16)for(var $=0;$<j;$++){var Ie=$<<2,Ae=$*6;q[Ie]=d[Ae],q[Ie+1]=d[Ae+2],q[Ie+2]=d[Ae+4],q[Ie+3]=255,ae!=-1&&Re(d,Ae)==ae&&Re(d,Ae+2)==W&&Re(d,Ae+4)==Pe&&(q[Ie+3]=0)}}else if(ne==3){var de=D.tabs.PLTE,Ye=D.tabs.tRNS,Ue=Ye?Ye.length:0;if(ie==1)for(var ye=0;ye<n;ye++)for(var rt=ye*w,St=ye*H,$=0;$<H;$++){var Ie=St+$<<2,Yt=d[rt+($>>3)]>>7-(($&7)<<0)&1,Et=3*Yt;q[Ie]=de[Et],q[Ie+1]=de[Et+1],q[Ie+2]=de[Et+2],q[Ie+3]=Yt<Ue?Ye[Yt]:255}if(ie==2)for(var ye=0;ye<n;ye++)for(var rt=ye*w,St=ye*H,$=0;$<H;$++){var Ie=St+$<<2,Yt=d[rt+($>>2)]>>6-(($&3)<<1)&3,Et=3*Yt;q[Ie]=de[Et],q[Ie+1]=de[Et+1],q[Ie+2]=de[Et+2],q[Ie+3]=Yt<Ue?Ye[Yt]:255}if(ie==4)for(var ye=0;ye<n;ye++)for(var rt=ye*w,St=ye*H,$=0;$<H;$++){var Ie=St+$<<2,Yt=d[rt+($>>1)]>>4-(($&1)<<2)&15,Et=3*Yt;q[Ie]=de[Et],q[Ie+1]=de[Et+1],q[Ie+2]=de[Et+2],q[Ie+3]=Yt<Ue?Ye[Yt]:255}if(ie==8)for(var $=0;$<j;$++){var Ie=$<<2,Yt=d[$],Et=3*Yt;q[Ie]=de[Et],q[Ie+1]=de[Et+1],q[Ie+2]=de[Et+2],q[Ie+3]=Yt<Ue?Ye[Yt]:255}}else if(ne==4){if(ie==8)for(var $=0;$<j;$++){var Ie=$<<2,pt=$<<1,Ht=d[pt];q[Ie]=Ht,q[Ie+1]=Ht,q[Ie+2]=Ht,q[Ie+3]=d[pt+1]}if(ie==16)for(var $=0;$<j;$++){var Ie=$<<2,pt=$<<2,Ht=d[pt];q[Ie]=Ht,q[Ie+1]=Ht,q[Ie+2]=Ht,q[Ie+3]=d[pt+2]}}else if(ne==0){var ae=D.tabs.tRNS?D.tabs.tRNS:-1;if(ie==1)for(var $=0;$<j;$++){var Ht=255*(d[$>>3]>>7-($&7)&1),rr=Ht==ae*255?0:255;re[$]=rr<<24|Ht<<16|Ht<<8|Ht}if(ie==2)for(var $=0;$<j;$++){var Ht=85*(d[$>>2]>>6-(($&3)<<1)&3),rr=Ht==ae*85?0:255;re[$]=rr<<24|Ht<<16|Ht<<8|Ht}if(ie==4)for(var $=0;$<j;$++){var Ht=17*(d[$>>1]>>4-(($&1)<<2)&15),rr=Ht==ae*17?0:255;re[$]=rr<<24|Ht<<16|Ht<<8|Ht}if(ie==8)for(var $=0;$<j;$++){var Ht=d[$],rr=Ht==ae?0:255;re[$]=rr<<24|Ht<<16|Ht<<8|Ht}if(ie==16)for(var $=0;$<j;$++){var Ht=d[$<<1],rr=Re(d,$<<1)==ae?0:255;re[$]=rr<<24|Ht<<16|Ht<<8|Ht}}return q},c.decode=function(d){for(var H=new Uint8Array(d),n=8,D=c._bin,j=D.readUshort,z=D.readUint,w={tabs:{},frames:[]},q=new Uint8Array(H.length),re=0,ne,ie=0,Re=[137,80,78,71,13,10,26,10],Te=0;Te<8;Te++)if(H[Te]!=Re[Te])throw"The input is not a PNG file!";for(;n<H.length;){var $=D.readUint(H,n);n+=4;var L=D.readASCII(H,n,4);if(n+=4,L=="IHDR")c.decode._IHDR(H,n,w);else if(L=="IDAT"){for(var Te=0;Te<$;Te++)q[re+Te]=H[n+Te];re+=$}else if(L=="acTL")w.tabs[L]={num_frames:z(H,n),num_plays:z(H,n+4)},ne=new Uint8Array(H.length);else if(L=="fcTL"){if(ie!=0){var ae=w.frames[w.frames.length-1];ae.data=c.decode._decompress(w,ne.slice(0,ie),ae.rect.width,ae.rect.height),ie=0}var W={x:z(H,n+12),y:z(H,n+16),width:z(H,n+4),height:z(H,n+8)},Pe=j(H,n+22);Pe=j(H,n+20)/(Pe==0?100:Pe);var Ie={rect:W,delay:Math.round(Pe*1e3),dispose:H[n+24],blend:H[n+25]};w.frames.push(Ie)}else if(L=="fdAT"){for(var Te=0;Te<$-4;Te++)ne[ie+Te]=H[n+Te+4];ie+=$-4}else if(L=="pHYs")w.tabs[L]=[D.readUint(H,n),D.readUint(H,n+4),H[n+8]];else if(L=="cHRM"){w.tabs[L]=[];for(var Te=0;Te<8;Te++)w.tabs[L].push(D.readUint(H,n+Te*4))}else if(L=="tEXt"){w.tabs[L]==null&&(w.tabs[L]={});var Ae=D.nextZero(H,n),de=D.readASCII(H,n,Ae-n),Ye=D.readASCII(H,Ae+1,n+$-Ae-1);w.tabs[L][de]=Ye}else if(L=="iTXt"){w.tabs[L]==null&&(w.tabs[L]={});var Ae=0,Ue=n;Ae=D.nextZero(H,Ue);var de=D.readASCII(H,Ue,Ae-Ue);Ue=Ae+1,H[Ue],H[Ue+1],Ue+=2,Ae=D.nextZero(H,Ue),D.readASCII(H,Ue,Ae-Ue),Ue=Ae+1,Ae=D.nextZero(H,Ue),D.readUTF8(H,Ue,Ae-Ue),Ue=Ae+1;var Ye=D.readUTF8(H,Ue,$-(Ue-n));w.tabs[L][de]=Ye}else if(L=="PLTE")w.tabs[L]=D.readBytes(H,n,$);else if(L=="hIST"){var ye=w.tabs.PLTE.length/3;w.tabs[L]=[];for(var Te=0;Te<ye;Te++)w.tabs[L].push(j(H,n+Te*2))}else if(L=="tRNS")w.ctype==3?w.tabs[L]=D.readBytes(H,n,$):w.ctype==0?w.tabs[L]=j(H,n):w.ctype==2&&(w.tabs[L]=[j(H,n),j(H,n+2),j(H,n+4)]);else if(L=="gAMA")w.tabs[L]=D.readUint(H,n)/1e5;else if(L=="sRGB")w.tabs[L]=H[n];else if(L=="bKGD")w.ctype==0||w.ctype==4?w.tabs[L]=[j(H,n)]:w.ctype==2||w.ctype==6?w.tabs[L]=[j(H,n),j(H,n+2),j(H,n+4)]:w.ctype==3&&(w.tabs[L]=H[n]);else if(L=="IEND"){if(ie!=0){var ae=w.frames[w.frames.length-1];ae.data=c.decode._decompress(w,ne.slice(0,ie),ae.rect.width,ae.rect.height),ie=0}w.data=c.decode._decompress(w,q,w.width,w.height);break}n+=$,D.readUint(H,n),n+=4}return delete w.compress,delete w.interlace,delete w.filter,w},c.decode._decompress=function(d,H,n,D){return d.compress==0&&(H=c.decode._inflate(H)),d.interlace==0?H=c.decode._filterZero(H,d,0,n,D):d.interlace==1&&(H=c.decode._readInterlace(H,d)),H},c.decode._inflate=function(d){return h.inflate(d)},c.decode._readInterlace=function(d,H){for(var n=H.width,D=H.height,j=c.decode._getBPP(H),z=j>>3,w=Math.ceil(n*j/8),q=new Uint8Array(D*w),re=0,ne=[0,0,4,0,2,0,1],ie=[0,4,0,2,0,1,0],Re=[8,8,8,4,4,2,2],Te=[8,8,4,4,2,2,1],$=0;$<7;){for(var L=Re[$],ae=Te[$],W=0,Pe=0,Ie=ne[$];Ie<D;)Ie+=L,Pe++;for(var Ae=ie[$];Ae<n;)Ae+=ae,W++;var de=Math.ceil(W*j/8);c.decode._filterZero(d,H,re,W,Pe);for(var Ye=0,Ue=ne[$];Ue<D;){for(var ye=ie[$],rt=re+Ye*de<<3;ye<n;){if(j==1){var St=d[rt>>3];St=St>>7-(rt&7)&1,q[Ue*w+(ye>>3)]|=St<<7-((ye&3)<<0)}if(j==2){var St=d[rt>>3];St=St>>6-(rt&7)&3,q[Ue*w+(ye>>2)]|=St<<6-((ye&3)<<1)}if(j==4){var St=d[rt>>3];St=St>>4-(rt&7)&15,q[Ue*w+(ye>>1)]|=St<<4-((ye&1)<<2)}if(j>=8)for(var Yt=Ue*w+ye*z,Et=0;Et<z;Et++)q[Yt+Et]=d[(rt>>3)+Et];rt+=j,ye+=ae}Ye++,Ue+=L}W*Pe!=0&&(re+=Pe*(1+de)),$=$+1}return q},c.decode._getBPP=function(d){var H=[1,null,3,1,2,null,4][d.ctype];return H*d.depth},c.decode._filterZero=function(d,H,n,D,j){var z=c.decode._getBPP(H),w=Math.ceil(D*z/8),q=c.decode._paeth;z=Math.ceil(z/8);for(var re=0;re<j;re++){var ne=n+re*w,ie=ne+re+1,Re=d[ie-1];if(Re==0)for(var Te=0;Te<w;Te++)d[ne+Te]=d[ie+Te];else if(Re==1){for(var Te=0;Te<z;Te++)d[ne+Te]=d[ie+Te];for(var Te=z;Te<w;Te++)d[ne+Te]=d[ie+Te]+d[ne+Te-z]&255}else if(re==0){for(var Te=0;Te<z;Te++)d[ne+Te]=d[ie+Te];if(Re==2)for(var Te=z;Te<w;Te++)d[ne+Te]=d[ie+Te]&255;if(Re==3)for(var Te=z;Te<w;Te++)d[ne+Te]=d[ie+Te]+(d[ne+Te-z]>>1)&255;if(Re==4)for(var Te=z;Te<w;Te++)d[ne+Te]=d[ie+Te]+q(d[ne+Te-z],0,0)&255}else{if(Re==2)for(var Te=0;Te<w;Te++)d[ne+Te]=d[ie+Te]+d[ne+Te-w]&255;if(Re==3){for(var Te=0;Te<z;Te++)d[ne+Te]=d[ie+Te]+(d[ne+Te-w]>>1)&255;for(var Te=z;Te<w;Te++)d[ne+Te]=d[ie+Te]+(d[ne+Te-w]+d[ne+Te-z]>>1)&255}if(Re==4){for(var Te=0;Te<z;Te++)d[ne+Te]=d[ie+Te]+q(0,d[ne+Te-w],0)&255;for(var Te=z;Te<w;Te++)d[ne+Te]=d[ie+Te]+q(d[ne+Te-z],d[ne+Te-w],d[ne+Te-z-w])&255}}}return d},c.decode._paeth=function(d,H,n){var D=d+H-n,j=Math.abs(D-d),z=Math.abs(D-H),w=Math.abs(D-n);return j<=z&&j<=w?d:z<=w?H:n},c.decode._IHDR=function(d,H,n){var D=c._bin;n.width=D.readUint(d,H),H+=4,n.height=D.readUint(d,H),H+=4,n.depth=d[H],H++,n.ctype=d[H],H++,n.compress=d[H],H++,n.filter=d[H],H++,n.interlace=d[H],H++},c._bin={nextZero:function(d,H){for(;d[H]!=0;)H++;return H},readUshort:function(d,H){return d[H]<<8|d[H+1]},writeUshort:function(d,H,n){d[H]=n>>8&255,d[H+1]=n&255},readUint:function(d,H){return d[H]*(256*256*256)+(d[H+1]<<16|d[H+2]<<8|d[H+3])},writeUint:function(d,H,n){d[H]=n>>24&255,d[H+1]=n>>16&255,d[H+2]=n>>8&255,d[H+3]=n&255},readASCII:function(d,H,n){for(var D="",j=0;j<n;j++)D+=String.fromCharCode(d[H+j]);return D},writeASCII:function(d,H,n){for(var D=0;D<n.length;D++)d[H+D]=n.charCodeAt(D)},readBytes:function(d,H,n){for(var D=[],j=0;j<n;j++)D.push(d[H+j]);return D},pad:function(d){return d.length<2?"0"+d:d},readUTF8:function(d,H,n){for(var D="",j,z=0;z<n;z++)D+="%"+c._bin.pad(d[H+z].toString(16));try{j=decodeURIComponent(D)}catch(w){return c._bin.readASCII(d,H,n)}return j}},c._copyTile=function(d,H,n,D,j,z,w,q,re){for(var ne=Math.min(H,j),ie=Math.min(n,z),Re=0,Te=0,$=0;$<ie;$++)for(var L=0;L<ne;L++)if(w>=0&&q>=0?(Re=$*H+L<<2,Te=(q+$)*j+w+L<<2):(Re=(-q+$)*H-w+L<<2,Te=$*j+L<<2),re==0)D[Te]=d[Re],D[Te+1]=d[Re+1],D[Te+2]=d[Re+2],D[Te+3]=d[Re+3];else if(re==1){var ae=d[Re+3]*.00392156862745098,W=d[Re]*ae,Pe=d[Re+1]*ae,Ie=d[Re+2]*ae,Ae=D[Te+3]*(1/255),de=D[Te]*Ae,Ye=D[Te+1]*Ae,Ue=D[Te+2]*Ae,ye=1-ae,rt=ae+Ae*ye,St=rt==0?0:1/rt;D[Te+3]=255*rt,D[Te+0]=(W+de*ye)*St,D[Te+1]=(Pe+Ye*ye)*St,D[Te+2]=(Ie+Ue*ye)*St}else if(re==2){var ae=d[Re+3],W=d[Re],Pe=d[Re+1],Ie=d[Re+2],Ae=D[Te+3],de=D[Te],Ye=D[Te+1],Ue=D[Te+2];ae==Ae&&W==de&&Pe==Ye&&Ie==Ue?(D[Te]=0,D[Te+1]=0,D[Te+2]=0,D[Te+3]=0):(D[Te]=W,D[Te+1]=Pe,D[Te+2]=Ie,D[Te+3]=ae)}else if(re==3){var ae=d[Re+3],W=d[Re],Pe=d[Re+1],Ie=d[Re+2],Ae=D[Te+3],de=D[Te],Ye=D[Te+1],Ue=D[Te+2];if(ae==Ae&&W==de&&Pe==Ye&&Ie==Ue)continue;if(ae<220&&Ae>20)return!1}return!0},c.encode=function(d,H,n,D,j,z){D==null&&(D=0),z==null&&(z=!1);for(var w=new Uint8Array(d[0].byteLength*d.length+100),q=[137,80,78,71,13,10,26,10],re=0;re<8;re++)w[re]=q[re];var ne=8,ie=c._bin,Re=c.crc.crc,Te=ie.writeUint,$=ie.writeUshort,L=ie.writeASCII,ae=c.encode.compressPNG(d,H,n,D,z);Te(w,ne,13),ne+=4,L(w,ne,"IHDR"),ne+=4,Te(w,ne,H),ne+=4,Te(w,ne,n),ne+=4,w[ne]=ae.depth,ne++,w[ne]=ae.ctype,ne++,w[ne]=0,ne++,w[ne]=0,ne++,w[ne]=0,ne++,Te(w,ne,Re(w,ne-17,17)),ne+=4,Te(w,ne,1),ne+=4,L(w,ne,"sRGB"),ne+=4,w[ne]=1,ne++,Te(w,ne,Re(w,ne-5,5)),ne+=4;var W=d.length>1;if(W&&(Te(w,ne,8),ne+=4,L(w,ne,"acTL"),ne+=4,Te(w,ne,d.length),ne+=4,Te(w,ne,0),ne+=4,Te(w,ne,Re(w,ne-12,12)),ne+=4),ae.ctype==3){var Pe=ae.plte.length;Te(w,ne,Pe*3),ne+=4,L(w,ne,"PLTE"),ne+=4;for(var re=0;re<Pe;re++){var Ie=re*3,Ae=ae.plte[re],de=Ae&255,Ye=Ae>>8&255,Ue=Ae>>16&255;w[ne+Ie+0]=de,w[ne+Ie+1]=Ye,w[ne+Ie+2]=Ue}if(ne+=Pe*3,Te(w,ne,Re(w,ne-Pe*3-4,Pe*3+4)),ne+=4,ae.gotAlpha){Te(w,ne,Pe),ne+=4,L(w,ne,"tRNS"),ne+=4;for(var re=0;re<Pe;re++)w[ne+re]=ae.plte[re]>>24&255;ne+=Pe,Te(w,ne,Re(w,ne-Pe-4,Pe+4)),ne+=4}}for(var ye=0,rt=0;rt<ae.frames.length;rt++){var St=ae.frames[rt];W&&(Te(w,ne,26),ne+=4,L(w,ne,"fcTL"),ne+=4,Te(w,ne,ye++),ne+=4,Te(w,ne,St.rect.width),ne+=4,Te(w,ne,St.rect.height),ne+=4,Te(w,ne,St.rect.x),ne+=4,Te(w,ne,St.rect.y),ne+=4,$(w,ne,j[rt]),ne+=2,$(w,ne,1e3),ne+=2,w[ne]=St.dispose,ne++,w[ne]=St.blend,ne++,Te(w,ne,Re(w,ne-30,30)),ne+=4);var Yt=St.cimg,Pe=Yt.length;Te(w,ne,Pe+(rt==0?0:4)),ne+=4;var Et=ne;L(w,ne,rt==0?"IDAT":"fdAT"),ne+=4,rt!=0&&(Te(w,ne,ye++),ne+=4);for(var re=0;re<Pe;re++)w[ne+re]=Yt[re];ne+=Pe,Te(w,ne,Re(w,Et,ne-Et)),ne+=4}return Te(w,ne,0),ne+=4,L(w,ne,"IEND"),ne+=4,Te(w,ne,Re(w,ne-4,4)),ne+=4,w.buffer.slice(0,ne)},c.encode.compressPNG=function(d,H,n,D,j){for(var z=c.encode.compress(d,H,n,D,!1,j),w=0;w<d.length;w++){var q=z.frames[w];q.rect.width;var re=q.rect.height,ne=q.bpl,ie=q.bpp,Re=new Uint8Array(re*ne+re);q.cimg=c.encode._filterZero(q.img,re,ie,ne,Re)}return z},c.encode.compress=function(d,H,n,D,j,z){z==null&&(z=!1);for(var w=6,q=8,re=4,ne=255,ie=0;ie<d.length;ie++)for(var Re=new Uint8Array(d[ie]),Te=Re.length,$=0;$<Te;$+=4)ne&=Re[$+3];var L=ne!=255,ae={},W=[];if(d.length!=0&&(ae[0]=0,W.push(0),D!=0&&D--),D!=0){var Pe=c.quantize(d,D,j);d=Pe.bufs;for(var $=0;$<Pe.plte.length;$++){var Ie=Pe.plte[$].est.rgba;ae[Ie]==null&&(ae[Ie]=W.length,W.push(Ie))}}else for(var ie=0;ie<d.length;ie++)for(var Ae=new Uint32Array(d[ie]),Te=Ae.length,$=0;$<Te;$++){var Ie=Ae[$];if(($<H||Ie!=Ae[$-1]&&Ie!=Ae[$-H])&&ae[Ie]==null&&(ae[Ie]=W.length,W.push(Ie),W.length>=300))break}var de=L?j:!1,Ye=W.length;Ye<=256&&z==!1&&(Ye<=2?q=1:Ye<=4?q=2:Ye<=16?q=4:q=8,j&&(q=8),L=!0);for(var Ue=[],ie=0;ie<d.length;ie++){var ye=new Uint8Array(d[ie]),rt=new Uint32Array(ye.buffer),St=0,Yt=0,Et=H,pt=n,Ht=0;if(ie!=0&&!de){for(var rr=j||ie==1||Ue[Ue.length-2].dispose==2?1:2,mr=0,na=1e9,cr=0;cr<rr;cr++){for(var Nn=new Uint8Array(d[ie-1-cr]),yr=new Uint32Array(d[ie-1-cr]),fa=H,$a=n,Ta=-1,Sa=-1,_r=0;_r<n;_r++)for(var Qr=0;Qr<H;Qr++){var $=_r*H+Qr;rt[$]!=yr[$]&&(Qr<fa&&(fa=Qr),Qr>Ta&&(Ta=Qr),_r<$a&&($a=_r),_r>Sa&&(Sa=_r))}var la=Ta==-1?1:(Ta-fa+1)*(Sa-$a+1);la<na&&(na=la,mr=cr,Ta==-1?(St=Yt=0,Et=pt=1):(St=fa,Yt=$a,Et=Ta-fa+1,pt=Sa-$a+1))}var Nn=new Uint8Array(d[ie-1-mr]);mr==1&&(Ue[Ue.length-1].dispose=2);var ma=new Uint8Array(Et*pt*4);new Uint32Array(ma.buffer),c._copyTile(Nn,H,n,ma,Et,pt,-St,-Yt,0),c._copyTile(ye,H,n,ma,Et,pt,-St,-Yt,3)?(c._copyTile(ye,H,n,ma,Et,pt,-St,-Yt,2),Ht=1):(c._copyTile(ye,H,n,ma,Et,pt,-St,-Yt,0),Ht=0),ye=ma,rt=new Uint32Array(ye.buffer)}var va=4*Et;if(Ye<=256&&z==!1){va=Math.ceil(q*Et/8);for(var ma=new Uint8Array(va*pt),_r=0;_r<pt;_r++){var $=_r*va,Ya=_r*Et;if(q==8)for(var Qr=0;Qr<Et;Qr++)ma[$+Qr]=ae[rt[Ya+Qr]];else if(q==4)for(var Qr=0;Qr<Et;Qr++)ma[$+(Qr>>1)]|=ae[rt[Ya+Qr]]<<4-(Qr&1)*4;else if(q==2)for(var Qr=0;Qr<Et;Qr++)ma[$+(Qr>>2)]|=ae[rt[Ya+Qr]]<<6-(Qr&3)*2;else if(q==1)for(var Qr=0;Qr<Et;Qr++)ma[$+(Qr>>3)]|=ae[rt[Ya+Qr]]<<7-(Qr&7)*1}ye=ma,w=3,re=1}else if(L==!1&&d.length==1){for(var ma=new Uint8Array(Et*pt*3),An=Et*pt,$=0;$<An;$++){var En=$*3,In=$*4;ma[En]=ye[In],ma[En+1]=ye[In+1],ma[En+2]=ye[In+2]}ye=ma,w=2,re=3,va=3*Et}Ue.push({rect:{x:St,y:Yt,width:Et,height:pt},img:ye,bpl:va,bpp:re,blend:Ht,dispose:de?1:0})}return{ctype:w,depth:q,plte:W,gotAlpha:L,frames:Ue}},c.encode._filterZero=function(d,H,n,D,j){for(var z=[],w=0;w<5;w++)if(!(H*D>5e5&&(w==2||w==3||w==4))){for(var q=0;q<H;q++)c.encode._filterLine(j,d,q,D,n,w);if(z.push(h.deflate(j)),n==1)break}for(var re,ne=1e9,ie=0;ie<z.length;ie++)z[ie].length<ne&&(re=ie,ne=z[ie].length);return z[re]},c.encode._filterLine=function(d,H,n,D,j,z){var w=n*D,q=w+n,re=c.decode._paeth;if(d[q]=z,q++,z==0)for(var ne=0;ne<D;ne++)d[q+ne]=H[w+ne];else if(z==1){for(var ne=0;ne<j;ne++)d[q+ne]=H[w+ne];for(var ne=j;ne<D;ne++)d[q+ne]=H[w+ne]-H[w+ne-j]+256&255}else if(n==0){for(var ne=0;ne<j;ne++)d[q+ne]=H[w+ne];if(z==2)for(var ne=j;ne<D;ne++)d[q+ne]=H[w+ne];if(z==3)for(var ne=j;ne<D;ne++)d[q+ne]=H[w+ne]-(H[w+ne-j]>>1)+256&255;if(z==4)for(var ne=j;ne<D;ne++)d[q+ne]=H[w+ne]-re(H[w+ne-j],0,0)+256&255}else{if(z==2)for(var ne=0;ne<D;ne++)d[q+ne]=H[w+ne]+256-H[w+ne-D]&255;if(z==3){for(var ne=0;ne<j;ne++)d[q+ne]=H[w+ne]+256-(H[w+ne-D]>>1)&255;for(var ne=j;ne<D;ne++)d[q+ne]=H[w+ne]+256-(H[w+ne-D]+H[w+ne-j]>>1)&255}if(z==4){for(var ne=0;ne<j;ne++)d[q+ne]=H[w+ne]+256-re(0,H[w+ne-D],0)&255;for(var ne=j;ne<D;ne++)d[q+ne]=H[w+ne]+256-re(H[w+ne-j],H[w+ne-D],H[w+ne-j-D])&255}}},c.crc={table:function(){for(var d=new Uint32Array(256),H=0;H<256;H++){for(var n=H,D=0;D<8;D++)n&1?n=3988292384^n>>>1:n=n>>>1;d[H]=n}return d}(),update:function(d,H,n,D){for(var j=0;j<D;j++)d=c.crc.table[(d^H[n+j])&255]^d>>>8;return d},crc:function(d,H,n){return c.crc.update(4294967295,d,H,n)^4294967295}},c.quantize=function(d,H,n){for(var D=[],j=0,z=0;z<d.length;z++)D.push(c.encode.alphaMul(new Uint8Array(d[z]),n)),j+=d[z].byteLength;for(var w=new Uint8Array(j),q=new Uint32Array(w.buffer),re=0,z=0;z<D.length;z++){for(var ne=D[z],ie=ne.length,Re=0;Re<ie;Re++)w[re+Re]=ne[Re];re+=ie}var Te={i0:0,i1:w.length,bst:null,est:null,tdst:0,left:null,right:null};Te.bst=c.quantize.stats(w,Te.i0,Te.i1),Te.est=c.quantize.estats(Te.bst);for(var $=[Te];$.length<H;){for(var L=0,ae=0,z=0;z<$.length;z++)$[z].est.L>L&&(L=$[z].est.L,ae=z);if(L<.001)break;var W=$[ae],Pe=c.quantize.splitPixels(w,q,W.i0,W.i1,W.est.e,W.est.eMq255),Ie={i0:W.i0,i1:Pe,bst:null,est:null,tdst:0,left:null,right:null};Ie.bst=c.quantize.stats(w,Ie.i0,Ie.i1),Ie.est=c.quantize.estats(Ie.bst);var Ae={i0:Pe,i1:W.i1,bst:null,est:null,tdst:0,left:null,right:null};Ae.bst={R:[],m:[],N:W.bst.N-Ie.bst.N};for(var z=0;z<16;z++)Ae.bst.R[z]=W.bst.R[z]-Ie.bst.R[z];for(var z=0;z<4;z++)Ae.bst.m[z]=W.bst.m[z]-Ie.bst.m[z];Ae.est=c.quantize.estats(Ae.bst),W.left=Ie,W.right=Ae,$[ae]=Ie,$.push(Ae)}$.sort(function(rr,mr){return mr.bst.N-rr.bst.N});for(var de=0;de<D.length;de++){for(var Ye=c.quantize.planeDst,Ue=new Uint8Array(D[de].buffer),ye=new Uint32Array(D[de].buffer),rt=Ue.length,z=0;z<rt;z+=4){for(var St=Ue[z]*.00392156862745098,Yt=Ue[z+1]*(1/255),Et=Ue[z+2]*(1/255),pt=Ue[z+3]*(1/255),Ht=Te;Ht.left;)Ht=Ye(Ht.est,St,Yt,Et,pt)<=0?Ht.left:Ht.right;ye[z>>2]=Ht.est.rgba}D[de]=ye.buffer}return{bufs:D,plte:$}},c.quantize.getNearest=function(d,H,n,D,j){if(d.left==null)return d.tdst=c.quantize.dist(d.est.q,H,n,D,j),d;var z=c.quantize.planeDst(d.est,H,n,D,j),w=d.left,q=d.right;z>0&&(w=d.right,q=d.left);var re=c.quantize.getNearest(w,H,n,D,j);if(re.tdst<=z*z)return re;var ne=c.quantize.getNearest(q,H,n,D,j);return ne.tdst<re.tdst?ne:re},c.quantize.planeDst=function(d,H,n,D,j){var z=d.e;return z[0]*H+z[1]*n+z[2]*D+z[3]*j-d.eMq},c.quantize.dist=function(d,H,n,D,j){var z=H-d[0],w=n-d[1],q=D-d[2],re=j-d[3];return z*z+w*w+q*q+re*re},c.quantize.splitPixels=function(d,H,n,D,j,z){var w=c.quantize.vecDot;for(D-=4;n<D;){for(;w(d,n,j)<=z;)n+=4;for(;w(d,D,j)>z;)D-=4;if(n>=D)break;var q=H[n>>2];H[n>>2]=H[D>>2],H[D>>2]=q,n+=4,D-=4}for(;w(d,n,j)>z;)n-=4;return n+4},c.quantize.vecDot=function(d,H,n){return d[H]*n[0]+d[H+1]*n[1]+d[H+2]*n[2]+d[H+3]*n[3]},c.quantize.stats=function(d,H,n){for(var D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],j=[0,0,0,0],z=n-H>>2,w=H;w<n;w+=4){var q=d[w]*.00392156862745098,re=d[w+1]*(1/255),ne=d[w+2]*(1/255),ie=d[w+3]*(1/255);j[0]+=q,j[1]+=re,j[2]+=ne,j[3]+=ie,D[0]+=q*q,D[1]+=q*re,D[2]+=q*ne,D[3]+=q*ie,D[5]+=re*re,D[6]+=re*ne,D[7]+=re*ie,D[10]+=ne*ne,D[11]+=ne*ie,D[15]+=ie*ie}return D[4]=D[1],D[8]=D[2],D[12]=D[3],D[9]=D[6],D[13]=D[7],D[14]=D[11],{R:D,m:j,N:z}},c.quantize.estats=function(d){var H=d.R,n=d.m,D=d.N,j=n[0],z=n[1],w=n[2],q=n[3],re=D==0?0:1/D,ne=[H[0]-j*j*re,H[1]-j*z*re,H[2]-j*w*re,H[3]-j*q*re,H[4]-z*j*re,H[5]-z*z*re,H[6]-z*w*re,H[7]-z*q*re,H[8]-w*j*re,H[9]-w*z*re,H[10]-w*w*re,H[11]-w*q*re,H[12]-q*j*re,H[13]-q*z*re,H[14]-q*w*re,H[15]-q*q*re],ie=ne,Re=c.M4,Te=[.5,.5,.5,.5],$=0,L=0;if(D!=0)for(var ae=0;ae<10&&(Te=Re.multVec(ie,Te),L=Math.sqrt(Re.dot(Te,Te)),Te=Re.sml(1/L,Te),!(Math.abs(L-$)<1e-9));ae++)$=L;var W=[j*re,z*re,w*re,q*re],Pe=Re.dot(Re.sml(255,W),Te),Ie=W[3]<.001?0:1/W[3];return{Cov:ne,q:W,e:Te,L:$,eMq255:Pe,eMq:Re.dot(Te,W),rgba:(Math.round(255*W[3])<<24|Math.round(255*W[2]*Ie)<<16|Math.round(255*W[1]*Ie)<<8|Math.round(255*W[0]*Ie)<<0)>>>0}},c.M4={multVec:function(d,H){return[d[0]*H[0]+d[1]*H[1]+d[2]*H[2]+d[3]*H[3],d[4]*H[0]+d[5]*H[1]+d[6]*H[2]+d[7]*H[3],d[8]*H[0]+d[9]*H[1]+d[10]*H[2]+d[11]*H[3],d[12]*H[0]+d[13]*H[1]+d[14]*H[2]+d[15]*H[3]]},dot:function(d,H){return d[0]*H[0]+d[1]*H[1]+d[2]*H[2]+d[3]*H[3]},sml:function(d,H){return[d*H[0],d*H[1],d*H[2],d*H[3]]}},c.encode.alphaMul=function(d,H){for(var n=new Uint8Array(d.length),D=d.length>>2,j=0;j<D;j++){var z=j<<2,w=d[z+3];H&&(w=w<128?0:255);var q=w*(1/255);n[z+0]=d[z+0]*q,n[z+1]=d[z+1]*q,n[z+2]=d[z+2]*q,n[z+3]=w}return n}}(o,R)})()})(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 t=new Uint8Array([170,187]);return new Uint16Array(t.buffer)[0]===48042}function range(...t){if(t.length===1){const[o]=t;return new Array(o).fill(void 0).map((R,c)=>c)}else{const[o,R,c=1]=t;if(c===0)throw new Error("Argument step must be nonzero.");const h=[];for(let d=o;c>0?d<R:d>R;d+=c)h.push(d);return h}}function fetchPNGData(t,o,R){return KE(this,null,function*(){return new Promise((c,h)=>{const d=new XMLHttpRequest;d.open("GET",t,!0),d.responseType="arraybuffer",d.addEventListener("load",()=>{c(d.response)}),d.addEventListener("error",h),d.send(null)}).then(c=>{const h=UPNG.exports.decode(c),d=UPNG.exports.toRGBA8(h)[0];return new Uint8Array(d)}).catch(()=>createNoDataTile(o,R))})}function typedArraysAreEqual(t,o){return t.byteLength!==o.byteLength?!1:t.every((R,c)=>R===o[c])}function getTransformMatrix(t,o){const R=2/t,c=-2/o;return[R,0,0,0,0,c,0,0,0,0,1,0,-1,1,0,1]}function getTexCoordVerticesTriangleStripQuad(t){const[{x:o,y:R},{x:c,y:h}]=t;return[[o,R],[c,R],[o,h],[c,h]]}const createNoDataTile=lodash.exports.memoize((t,o=256)=>{const R=new Float32Array(o*o);return R.fill(t),new Uint8Array(R.buffer)});function defineMacros(t,o){return`${Object.keys(o).map(c=>`#define ${c} ${o[c]}
|
|
209
209
|
`).join("")}
|
|
210
210
|
${t}`}const hexToRGB=t=>{const o=t.length===9,R=o?24:16,c=parseInt(t.slice(1),16),h=c>>R&255,d=c>>R-8&255,H=c>>R-16&255,n=o?c>>R-24&255:255;return[h,d,H,n]};function colorStringToInts(t){if(t==="transparent")return[0,0,0,0];const o=t.match(RGB_REGEX),R=t.match(HEX_REGEX);if(o!==null){const[,c,h,d]=o;return[+c,+h,+d,255]}else{if(R!==null)return hexToRGB(t);throw new Error(`'${t}' is not a valid RGB or hex color expression.`)}}const colormapToFlatArray=t=>{const o=[];let R=[];for(let n=0;n<t.length;n++){o.push(t[n].offset);const D=colorStringToInts(t[n].color);R=R.concat(D)}const c=new Float32Array(o),h=new Uint8Array(c.buffer),d=Array.from(h);return R.concat(d)};function createColormapTexture(t,o){const R=colormapToFlatArray(t);let c;return t.length===0?c=o.texture({shape:[2,2]}):c=o.texture({width:t.length,height:2,data:R}),c}var regl={exports:{}};(function(t,o){(function(R,c){t.exports=c()})(commonjsGlobal,function(){var R=function(Ne){return Ne instanceof Uint8Array||Ne instanceof Uint16Array||Ne instanceof Uint32Array||Ne instanceof Int8Array||Ne instanceof Int16Array||Ne instanceof Int32Array||Ne instanceof Float32Array||Ne instanceof Float64Array||Ne instanceof Uint8ClampedArray},c=function(Ne,je){for(var ht=Object.keys(je),Tr=0;Tr<ht.length;++Tr)Ne[ht[Tr]]=je[ht[Tr]];return Ne},h=`
|
|
211
211
|
`;function d(Ne){return typeof atob!="undefined"?atob(Ne):"base64:"+Ne}function H(Ne){var je=new Error("(regl) "+Ne);throw console.error(je),je}function n(Ne,je){Ne||H(je)}function D(Ne){return Ne?": "+Ne:""}function j(Ne,je,ht){Ne in je||H("unknown parameter ("+Ne+")"+D(ht)+". possible values: "+Object.keys(je).join())}function z(Ne,je){R(Ne)||H("invalid parameter type"+D(je)+". must be a typed array")}function w(Ne,je){switch(je){case"number":return typeof Ne=="number";case"object":return typeof Ne=="object";case"string":return typeof Ne=="string";case"boolean":return typeof Ne=="boolean";case"function":return typeof Ne=="function";case"undefined":return typeof Ne=="undefined";case"symbol":return typeof Ne=="symbol"}}function q(Ne,je,ht){w(Ne,je)||H("invalid parameter type"+D(ht)+". expected "+je+", got "+typeof Ne)}function re(Ne,je){Ne>=0&&(Ne|0)===Ne||H("invalid parameter type, ("+Ne+")"+D(je)+". must be a nonnegative integer")}function ne(Ne,je,ht){je.indexOf(Ne)<0&&H("invalid value"+D(ht)+". must be one of: "+je)}var ie=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function Re(Ne){Object.keys(Ne).forEach(function(je){ie.indexOf(je)<0&&H('invalid regl constructor argument "'+je+'". must be one of '+ie)})}function Te(Ne,je){for(Ne=Ne+"";Ne.length<je;)Ne=" "+Ne;return Ne}function $(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function L(Ne,je){this.number=Ne,this.line=je,this.errors=[]}function ae(Ne,je,ht){this.file=Ne,this.line=je,this.message=ht}function W(){var Ne=new Error,je=(Ne.stack||Ne).toString(),ht=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(je);if(ht)return ht[1];var Tr=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(je);return Tr?Tr[1]:"unknown"}function Pe(){var Ne=new Error,je=(Ne.stack||Ne).toString(),ht=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(je);if(ht)return ht[1];var Tr=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(je);return Tr?Tr[1]:"unknown"}function Ie(Ne,je){var ht=Ne.split(`
|