@gisfun/maplibre-gl-components 0.15.0-alpha.0

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.
Files changed (196) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1960 -0
  3. package/dist/ControlGrid-DN5md8hp.cjs +19636 -0
  4. package/dist/ControlGrid-rVNG7B9O.js +170422 -0
  5. package/dist/DuckDBConverter-B98M0DFs.cjs +23 -0
  6. package/dist/DuckDBConverter-RPq48-t0.js +434 -0
  7. package/dist/ShapefileConverter-AjbEjEyq.cjs +1 -0
  8. package/dist/ShapefileConverter-trvt8J3z.js +125 -0
  9. package/dist/decoder-CLokFc0V.js +8 -0
  10. package/dist/decoder-D9LU4bUo.cjs +1 -0
  11. package/dist/deflate-BA1jZeSX.js +10 -0
  12. package/dist/deflate-DEdCz12a.cjs +1 -0
  13. package/dist/geojson-BQSVgKFt.cjs +1 -0
  14. package/dist/geojson-BSUuDj5k.js +2551 -0
  15. package/dist/geotiff-De1w1lBy.cjs +8 -0
  16. package/dist/geotiff-o_Fq1Na4.js +3108 -0
  17. package/dist/index-8ZZtuDTp.js +705 -0
  18. package/dist/index-B-Nr9y7J.cjs +84 -0
  19. package/dist/index-B5NoFrpY.js +8892 -0
  20. package/dist/index-Bi1MMPUx.js +4163 -0
  21. package/dist/index-C9fk_HKR.js +167 -0
  22. package/dist/index-CBBRBJvR.cjs +274 -0
  23. package/dist/index-CZxPF1qt.js +4 -0
  24. package/dist/index-CiDPSJ9T.cjs +1 -0
  25. package/dist/index-CjM_nbxd.cjs +107 -0
  26. package/dist/index-DQXdX5y1.js +4666 -0
  27. package/dist/index-Dh1kpCb6.cjs +1 -0
  28. package/dist/index-IrsIiQNM.cjs +4 -0
  29. package/dist/index.cjs +3819 -0
  30. package/dist/index.mjs +19580 -0
  31. package/dist/jpeg-CF9OGQg_.js +533 -0
  32. package/dist/jpeg-JSQOxGHy.cjs +1 -0
  33. package/dist/lerc-7LlQoT6u.js +1032 -0
  34. package/dist/lerc-BIsodce9.cjs +1 -0
  35. package/dist/lzw-BZniWIYG.js +84 -0
  36. package/dist/lzw-BhML-BvT.cjs +1 -0
  37. package/dist/main-dist-Bymiy5aM.cjs +2 -0
  38. package/dist/main-dist-Cv8AKwrY.js +629 -0
  39. package/dist/maplibre-geoman.es-Bxdg-2EU.cjs +129 -0
  40. package/dist/maplibre-geoman.es-CFgM2ajb.js +22827 -0
  41. package/dist/maplibre-gl-components.css +1 -0
  42. package/dist/packbits-B9b7gX2c.cjs +1 -0
  43. package/dist/packbits-DWY5O-FG.js +24 -0
  44. package/dist/pako.esm-Bx5X36Wo.js +1074 -0
  45. package/dist/pako.esm-DZC2QrbJ.cjs +1 -0
  46. package/dist/raw-C3ARbSFo.cjs +1 -0
  47. package/dist/raw-DUslI1gr.js +9 -0
  48. package/dist/react.cjs +1 -0
  49. package/dist/react.mjs +1306 -0
  50. package/dist/types/index.d.ts +44 -0
  51. package/dist/types/index.d.ts.map +1 -0
  52. package/dist/types/lib/adapters/AddVectorAdapter.d.ts +66 -0
  53. package/dist/types/lib/adapters/AddVectorAdapter.d.ts.map +1 -0
  54. package/dist/types/lib/adapters/CogLayerAdapter.d.ts +126 -0
  55. package/dist/types/lib/adapters/CogLayerAdapter.d.ts.map +1 -0
  56. package/dist/types/lib/adapters/PMTilesLayerAdapter.d.ts +78 -0
  57. package/dist/types/lib/adapters/PMTilesLayerAdapter.d.ts.map +1 -0
  58. package/dist/types/lib/adapters/StacLayerAdapter.d.ts +71 -0
  59. package/dist/types/lib/adapters/StacLayerAdapter.d.ts.map +1 -0
  60. package/dist/types/lib/adapters/ZarrLayerAdapter.d.ts +72 -0
  61. package/dist/types/lib/adapters/ZarrLayerAdapter.d.ts.map +1 -0
  62. package/dist/types/lib/adapters/index.d.ts +7 -0
  63. package/dist/types/lib/adapters/index.d.ts.map +1 -0
  64. package/dist/types/lib/addControlGrid.d.ts +80 -0
  65. package/dist/types/lib/addControlGrid.d.ts.map +1 -0
  66. package/dist/types/lib/colormaps/diverging.d.ts +30 -0
  67. package/dist/types/lib/colormaps/diverging.d.ts.map +1 -0
  68. package/dist/types/lib/colormaps/index.d.ts +32 -0
  69. package/dist/types/lib/colormaps/index.d.ts.map +1 -0
  70. package/dist/types/lib/colormaps/misc.d.ts +38 -0
  71. package/dist/types/lib/colormaps/misc.d.ts.map +1 -0
  72. package/dist/types/lib/colormaps/sequential.d.ts +22 -0
  73. package/dist/types/lib/colormaps/sequential.d.ts.map +1 -0
  74. package/dist/types/lib/converters/DuckDBConverter.d.ts +112 -0
  75. package/dist/types/lib/converters/DuckDBConverter.d.ts.map +1 -0
  76. package/dist/types/lib/converters/ShapefileConverter.d.ts +56 -0
  77. package/dist/types/lib/converters/ShapefileConverter.d.ts.map +1 -0
  78. package/dist/types/lib/converters/index.d.ts +8 -0
  79. package/dist/types/lib/converters/index.d.ts.map +1 -0
  80. package/dist/types/lib/converters/types.d.ts +75 -0
  81. package/dist/types/lib/converters/types.d.ts.map +1 -0
  82. package/dist/types/lib/core/AddVector.d.ts +116 -0
  83. package/dist/types/lib/core/AddVector.d.ts.map +1 -0
  84. package/dist/types/lib/core/Basemap.d.ts +206 -0
  85. package/dist/types/lib/core/Basemap.d.ts.map +1 -0
  86. package/dist/types/lib/core/BasemapReact.d.ts +32 -0
  87. package/dist/types/lib/core/BasemapReact.d.ts.map +1 -0
  88. package/dist/types/lib/core/BookmarkControl.d.ts +180 -0
  89. package/dist/types/lib/core/BookmarkControl.d.ts.map +1 -0
  90. package/dist/types/lib/core/ChoroplethControl.d.ts +105 -0
  91. package/dist/types/lib/core/ChoroplethControl.d.ts.map +1 -0
  92. package/dist/types/lib/core/CogLayer.d.ts +139 -0
  93. package/dist/types/lib/core/CogLayer.d.ts.map +1 -0
  94. package/dist/types/lib/core/CogLayerReact.d.ts +32 -0
  95. package/dist/types/lib/core/CogLayerReact.d.ts.map +1 -0
  96. package/dist/types/lib/core/Colorbar.d.ts +133 -0
  97. package/dist/types/lib/core/Colorbar.d.ts.map +1 -0
  98. package/dist/types/lib/core/ColorbarGuiControl.d.ts +79 -0
  99. package/dist/types/lib/core/ColorbarGuiControl.d.ts.map +1 -0
  100. package/dist/types/lib/core/ColorbarReact.d.ts +34 -0
  101. package/dist/types/lib/core/ColorbarReact.d.ts.map +1 -0
  102. package/dist/types/lib/core/ControlGrid.d.ts +125 -0
  103. package/dist/types/lib/core/ControlGrid.d.ts.map +1 -0
  104. package/dist/types/lib/core/ControlGridReact.d.ts +32 -0
  105. package/dist/types/lib/core/ControlGridReact.d.ts.map +1 -0
  106. package/dist/types/lib/core/HtmlControl.d.ts +140 -0
  107. package/dist/types/lib/core/HtmlControl.d.ts.map +1 -0
  108. package/dist/types/lib/core/HtmlControlReact.d.ts +32 -0
  109. package/dist/types/lib/core/HtmlControlReact.d.ts.map +1 -0
  110. package/dist/types/lib/core/HtmlGuiControl.d.ts +68 -0
  111. package/dist/types/lib/core/HtmlGuiControl.d.ts.map +1 -0
  112. package/dist/types/lib/core/InspectControl.d.ts +202 -0
  113. package/dist/types/lib/core/InspectControl.d.ts.map +1 -0
  114. package/dist/types/lib/core/InspectControlReact.d.ts +32 -0
  115. package/dist/types/lib/core/InspectControlReact.d.ts.map +1 -0
  116. package/dist/types/lib/core/Legend.d.ts +142 -0
  117. package/dist/types/lib/core/Legend.d.ts.map +1 -0
  118. package/dist/types/lib/core/LegendGuiControl.d.ts +69 -0
  119. package/dist/types/lib/core/LegendGuiControl.d.ts.map +1 -0
  120. package/dist/types/lib/core/LegendReact.d.ts +34 -0
  121. package/dist/types/lib/core/LegendReact.d.ts.map +1 -0
  122. package/dist/types/lib/core/MeasureControl.d.ts +211 -0
  123. package/dist/types/lib/core/MeasureControl.d.ts.map +1 -0
  124. package/dist/types/lib/core/MinimapControl.d.ts +77 -0
  125. package/dist/types/lib/core/MinimapControl.d.ts.map +1 -0
  126. package/dist/types/lib/core/MinimapControlReact.d.ts +32 -0
  127. package/dist/types/lib/core/MinimapControlReact.d.ts.map +1 -0
  128. package/dist/types/lib/core/PMTilesLayer.d.ts +119 -0
  129. package/dist/types/lib/core/PMTilesLayer.d.ts.map +1 -0
  130. package/dist/types/lib/core/PrintControl.d.ts +226 -0
  131. package/dist/types/lib/core/PrintControl.d.ts.map +1 -0
  132. package/dist/types/lib/core/SearchControl.d.ts +172 -0
  133. package/dist/types/lib/core/SearchControl.d.ts.map +1 -0
  134. package/dist/types/lib/core/SearchControlReact.d.ts +32 -0
  135. package/dist/types/lib/core/SearchControlReact.d.ts.map +1 -0
  136. package/dist/types/lib/core/StacLayer.d.ts +107 -0
  137. package/dist/types/lib/core/StacLayer.d.ts.map +1 -0
  138. package/dist/types/lib/core/StacSearch.d.ts +109 -0
  139. package/dist/types/lib/core/StacSearch.d.ts.map +1 -0
  140. package/dist/types/lib/core/Terrain.d.ts +165 -0
  141. package/dist/types/lib/core/Terrain.d.ts.map +1 -0
  142. package/dist/types/lib/core/TerrainReact.d.ts +32 -0
  143. package/dist/types/lib/core/TerrainReact.d.ts.map +1 -0
  144. package/dist/types/lib/core/VectorDataset.d.ts +228 -0
  145. package/dist/types/lib/core/VectorDataset.d.ts.map +1 -0
  146. package/dist/types/lib/core/VectorDatasetReact.d.ts +31 -0
  147. package/dist/types/lib/core/VectorDatasetReact.d.ts.map +1 -0
  148. package/dist/types/lib/core/ViewStateControl.d.ts +205 -0
  149. package/dist/types/lib/core/ViewStateControl.d.ts.map +1 -0
  150. package/dist/types/lib/core/ViewStateControlReact.d.ts +32 -0
  151. package/dist/types/lib/core/ViewStateControlReact.d.ts.map +1 -0
  152. package/dist/types/lib/core/ZarrLayer.d.ts +110 -0
  153. package/dist/types/lib/core/ZarrLayer.d.ts.map +1 -0
  154. package/dist/types/lib/core/types.d.ts +2793 -0
  155. package/dist/types/lib/core/types.d.ts.map +1 -0
  156. package/dist/types/lib/hooks/index.d.ts +13 -0
  157. package/dist/types/lib/hooks/index.d.ts.map +1 -0
  158. package/dist/types/lib/hooks/useBasemap.d.ts +43 -0
  159. package/dist/types/lib/hooks/useBasemap.d.ts.map +1 -0
  160. package/dist/types/lib/hooks/useCogLayer.d.ts +44 -0
  161. package/dist/types/lib/hooks/useCogLayer.d.ts.map +1 -0
  162. package/dist/types/lib/hooks/useColorbar.d.ts +36 -0
  163. package/dist/types/lib/hooks/useColorbar.d.ts.map +1 -0
  164. package/dist/types/lib/hooks/useControlGrid.d.ts +41 -0
  165. package/dist/types/lib/hooks/useControlGrid.d.ts.map +1 -0
  166. package/dist/types/lib/hooks/useHtmlControl.d.ts +39 -0
  167. package/dist/types/lib/hooks/useHtmlControl.d.ts.map +1 -0
  168. package/dist/types/lib/hooks/useInspectControl.d.ts +49 -0
  169. package/dist/types/lib/hooks/useInspectControl.d.ts.map +1 -0
  170. package/dist/types/lib/hooks/useLegend.d.ts +41 -0
  171. package/dist/types/lib/hooks/useLegend.d.ts.map +1 -0
  172. package/dist/types/lib/hooks/useMinimapControl.d.ts +35 -0
  173. package/dist/types/lib/hooks/useMinimapControl.d.ts.map +1 -0
  174. package/dist/types/lib/hooks/useSearchControl.d.ts +43 -0
  175. package/dist/types/lib/hooks/useSearchControl.d.ts.map +1 -0
  176. package/dist/types/lib/hooks/useTerrain.d.ts +43 -0
  177. package/dist/types/lib/hooks/useTerrain.d.ts.map +1 -0
  178. package/dist/types/lib/hooks/useVectorDataset.d.ts +35 -0
  179. package/dist/types/lib/hooks/useVectorDataset.d.ts.map +1 -0
  180. package/dist/types/lib/hooks/useViewState.d.ts +43 -0
  181. package/dist/types/lib/hooks/useViewState.d.ts.map +1 -0
  182. package/dist/types/lib/utils/color.d.ts +47 -0
  183. package/dist/types/lib/utils/color.d.ts.map +1 -0
  184. package/dist/types/lib/utils/fileHelpers.d.ts +207 -0
  185. package/dist/types/lib/utils/fileHelpers.d.ts.map +1 -0
  186. package/dist/types/lib/utils/helpers.d.ts +48 -0
  187. package/dist/types/lib/utils/helpers.d.ts.map +1 -0
  188. package/dist/types/lib/utils/index.d.ts +4 -0
  189. package/dist/types/lib/utils/index.d.ts.map +1 -0
  190. package/dist/types/lib/utils/providers.d.ts +46 -0
  191. package/dist/types/lib/utils/providers.d.ts.map +1 -0
  192. package/dist/types/react.d.ts +15 -0
  193. package/dist/types/react.d.ts.map +1 -0
  194. package/dist/webimage-CBRffWZD.cjs +1 -0
  195. package/dist/webimage-ibSPOLHJ.js +19 -0
  196. package/package.json +137 -0
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var x=Uint8Array,P=Uint16Array,Ve=Int32Array,we=new x([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,0,0,0]),xe=new x([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,0,0]),_e=new x([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),be=function(r,e){for(var t=new P(31),i=0;i<31;++i)t[i]=e+=1<<r[i-1];for(var n=new Ve(t[30]),i=1;i<30;++i)for(var a=t[i];a<t[i+1];++a)n[a]=a-t[i]<<5|i;return{b:t,r:n}},Te=be(we,2),Ce=Te.b,Ne=Te.r;Ce[28]=258,Ne[258]=28;var Je=be(xe,0),Ge=Je.b,Q=new P(32768);for(var g=0;g<32768;++g){var M=(g&43690)>>1|(g&21845)<<1;M=(M&52428)>>2|(M&13107)<<2,M=(M&61680)>>4|(M&3855)<<4,Q[g]=((M&65280)>>8|(M&255)<<8)>>1}var Z=(function(r,e,t){for(var i=r.length,n=0,a=new P(e);n<i;++n)r[n]&&++a[r[n]-1];var s=new P(e);for(n=1;n<e;++n)s[n]=s[n-1]+a[n-1]<<1;var o;if(t){o=new P(1<<e);var u=15-e;for(n=0;n<i;++n)if(r[n])for(var h=n<<4|r[n],f=e-r[n],l=s[r[n]-1]++<<f,c=l|(1<<f)-1;l<=c;++l)o[Q[l]>>u]=h}else for(o=new P(i),n=0;n<i;++n)r[n]&&(o[n]=Q[s[r[n]-1]++]>>15-r[n]);return o}),I=new x(288);for(var g=0;g<144;++g)I[g]=8;for(var g=144;g<256;++g)I[g]=9;for(var g=256;g<280;++g)I[g]=7;for(var g=280;g<288;++g)I[g]=8;var Ee=new x(32);for(var g=0;g<32;++g)Ee[g]=5;var qe=Z(I,9,1),Qe=Z(Ee,5,1),G=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},T=function(r,e,t){var i=e/8|0;return(r[i]|r[i+1]<<8)>>(e&7)&t},q=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(e&7)},Xe=function(r){return(r+7)/8|0},Ye=function(r,e,t){return(t==null||t>r.length)&&(t=r.length),new x(r.subarray(e,t))},et=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],w=function(r,e,t){var i=new Error(e||et[r]);if(i.code=r,Error.captureStackTrace&&Error.captureStackTrace(i,w),!t)throw i;return i},Y=function(r,e,t,i){var n=r.length,a=0;if(!n||e.f&&!e.l)return t||new x(0);var s=!t,o=s||e.i!=2,u=e.i;s&&(t=new x(n*3));var h=function(me){var ye=t.length;if(me>ye){var pe=new x(Math.max(ye*2,me));pe.set(t),t=pe}},f=e.f||0,l=e.p||0,c=e.b||0,y=e.l,C=e.d,v=e.m,A=e.n,B=n*8;do{if(!y){f=T(r,l,1);var F=T(r,l+1,3);if(l+=3,F)if(F==1)y=qe,C=Qe,v=9,A=5;else if(F==2){var j=T(r,l,31)+257,le=T(r,l+10,15)+4,ce=j+T(r,l+5,31)+1;l+=14;for(var S=new x(ce),V=new x(19),b=0;b<le;++b)V[_e[b]]=T(r,l+b*3,7);l+=le*3;for(var he=G(V),Be=(1<<he)-1,Fe=Z(V,he,1),b=0;b<ce;){var ue=Fe[T(r,l,Be)];l+=ue&15;var E=ue>>4;if(E<16)S[b++]=E;else{var D=0,R=0;for(E==16?(R=3+T(r,l,3),l+=2,D=S[b-1]):E==17?(R=3+T(r,l,7),l+=3):E==18&&(R=11+T(r,l,127),l+=7);R--;)S[b++]=D}}var fe=S.subarray(0,j),U=S.subarray(j);v=G(fe),A=G(U),y=Z(fe,v,1),C=Z(U,A,1)}else w(1);else{var E=Xe(l)+4,K=r[E-4]|r[E-3]<<8,W=E+K;if(W>n){u&&w(0);break}o&&h(c+K),t.set(r.subarray(E,W),c),e.b=c+=K,e.p=l=W*8,e.f=f;continue}if(l>B){u&&w(0);break}}o&&h(c+131072);for(var Ke=(1<<v)-1,We=(1<<A)-1,_=l;;_=l){var D=y[q(r,l)&Ke],H=D>>4;if(l+=D&15,l>B){u&&w(0);break}if(D||w(2),H<256)t[c++]=H;else if(H==256){_=l,y=null;break}else{var de=H-254;if(H>264){var b=H-257,O=we[b];de=T(r,l,(1<<O)-1)+Ce[b],l+=O}var N=C[q(r,l)&We],J=N>>4;N||w(3),l+=N&15;var U=Ge[J];if(J>3){var O=xe[J];U+=q(r,l)&(1<<O)-1,l+=O}if(l>B){u&&w(0);break}o&&h(c+131072);var ge=c+de;if(c<U){var ve=a-U,je=Math.min(U,ge);for(ve+c<0&&w(3);c<je;++c)t[c]=i[ve+c]}for(;c<ge;++c)t[c]=t[c-U]}}e.l=y,e.p=_,e.b=c,e.f=f,y&&(f=1,e.m=v,e.d=C,e.n=A)}while(!f);return c!=t.length&&s?Ye(t,0,c):t.subarray(0,c)},tt=new x(0),rt=function(r){(r[0]!=31||r[1]!=139||r[2]!=8)&&w(6,"invalid gzip data");var e=r[3],t=10;e&4&&(t+=(r[10]|r[11]<<8)+2);for(var i=(e>>3&1)+(e>>4&1);i>0;i-=!r[t++]);return t+(e&2)},it=function(r){var e=r.length;return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0},nt=function(r,e){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&w(6,"invalid zlib data"),(r[1]>>5&1)==1&&w(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function at(r,e){return Y(r,{i:2},e,e)}function st(r,e){var t=rt(r);return t+8>r.length&&w(6,"invalid gzip data"),Y(r.subarray(t,-8),{i:2},new x(it(r)),e)}function ot(r,e){return Y(r.subarray(nt(r),-4),{i:2},e,e)}function lt(r,e){return r[0]==31&&r[1]==139&&r[2]==8?st(r,e):(r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31?at(r,e):ot(r,e)}var ct=typeof TextDecoder<"u"&&new TextDecoder,ht=0;try{ct.decode(tt,{stream:!0}),ht=1}catch{}var ut=Object.defineProperty,ft=Math.pow,d=(r,e)=>ut(r,"name",{value:e,configurable:!0}),m=(r,e,t)=>new Promise((i,n)=>{var a=u=>{try{o(t.next(u))}catch(h){n(h)}},s=u=>{try{o(t.throw(u))}catch(h){n(h)}},o=u=>u.done?i(u.value):Promise.resolve(u.value).then(a,s);o((t=t.apply(r,e)).next())}),dt=d((r,e)=>{let t=!1,i="",n=L.GridLayer.extend({createTile:d((a,s)=>{let o=document.createElement("img"),u=new AbortController,h=u.signal;return o.cancel=()=>{u.abort()},t||(r.getHeader().then(f=>{f.tileType===1?console.error("Error: archive contains MVT vector tiles, but leafletRasterLayer is for displaying raster tiles. See https://github.com/protomaps/PMTiles/tree/main/js for details."):f.tileType===2?i="image/png":f.tileType===3?i="image/jpeg":f.tileType===4?i="image/webp":f.tileType===5&&(i="image/avif")}),t=!0),r.getZxy(a.z,a.x,a.y,h).then(f=>{if(f){let l=new Blob([f.data],{type:i}),c=window.URL.createObjectURL(l);o.src=c}else o.style.display="none";o.cancel=void 0,s(void 0,o)}).catch(f=>{if(f.name!=="AbortError")throw f}),o},"createTile"),_removeTile:d(function(a){let s=this._tiles[a];s&&(s.el.cancel&&s.el.cancel(),s.el.width=0,s.el.height=0,s.el.deleted=!0,L.DomUtil.remove(s.el),delete this._tiles[a],this.fire("tileunload",{tile:s.el,coords:this._keyToTileCoords(a)}))},"_removeTile")});return new n(e)},"leafletRasterLayer"),gt=d(r=>(e,t)=>{if(t instanceof AbortController)return r(e,t);let i=new AbortController;return r(e,i).then(n=>t(void 0,n.data,n.cacheControl||"",n.expires||""),n=>t(n)).catch(n=>t(n)),{cancel:d(()=>i.abort(),"cancel")}},"v3compat"),Le=class{constructor(e){this.tilev4=d((t,i)=>m(this,null,function*(){if(t.type==="json"){let y=t.url.substr(10),C=this.tiles.get(y);if(C||(C=new X(y),this.tiles.set(y,C)),this.metadata){let A=yield C.getTileJson(t.url);return i.signal.throwIfAborted(),{data:A}}let v=yield C.getHeader();return i.signal.throwIfAborted(),(v.minLon>=v.maxLon||v.minLat>=v.maxLat)&&console.error(`Bounds of PMTiles archive ${v.minLon},${v.minLat},${v.maxLon},${v.maxLat} are not valid.`),{data:{tiles:[`${t.url}/{z}/{x}/{y}`],minzoom:v.minZoom,maxzoom:v.maxZoom,bounds:[v.minLon,v.minLat,v.maxLon,v.maxLat]}}}let n=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),a=t.url.match(n);if(!a)throw new Error("Invalid PMTiles protocol URL");let s=a[1],o=this.tiles.get(s);o||(o=new X(s),this.tiles.set(s,o));let u=a[2],h=a[3],f=a[4],l=yield o.getHeader(),c=yield o?.getZxy(+u,+h,+f,i.signal);if(i.signal.throwIfAborted(),c)return{data:new Uint8Array(c.data),cacheControl:c.cacheControl,expires:c.expires};if(l.tileType===1){if(this.errorOnMissingTile)throw new Error("Tile not found.");return{data:new Uint8Array}}return{data:null}}),"tilev4"),this.tile=gt(this.tilev4),this.tiles=new Map,this.metadata=e?.metadata||!1,this.errorOnMissingTile=e?.errorOnMissingTile||!1}add(e){this.tiles.set(e.source.getKey(),e)}get(e){return this.tiles.get(e)}};d(Le,"Protocol");var vt=Le;function Ue(r,e){return(e>>>0)*4294967296+(r>>>0)}d(Ue,"toNum");function Me(r,e){let t=e.buf,i=t[e.pos++],n=(i&112)>>4;if(i<128||(i=t[e.pos++],n|=(i&127)<<3,i<128)||(i=t[e.pos++],n|=(i&127)<<10,i<128)||(i=t[e.pos++],n|=(i&127)<<17,i<128)||(i=t[e.pos++],n|=(i&127)<<24,i<128)||(i=t[e.pos++],n|=(i&1)<<31,i<128))return Ue(r,n);throw new Error("Expected varint not more than 10 bytes")}d(Me,"readVarintRemainder");function z(r){let e=r.buf,t=e[r.pos++],i=t&127;return t<128||(t=e[r.pos++],i|=(t&127)<<7,t<128)||(t=e[r.pos++],i|=(t&127)<<14,t<128)||(t=e[r.pos++],i|=(t&127)<<21,t<128)?i:(t=e[r.pos],i|=(t&15)<<28,Me(i,r))}d(z,"readVarint");function ee(r,e,t,i,n){return n===0?i!==0?[r-1-t,r-1-e]:[t,e]:[e,t]}d(ee,"rotate");function te(r,e,t){if(r>26)throw new Error("Tile zoom level exceeds max safe number limit (26)");if(e>=1<<r||t>=1<<r)throw new Error("tile x/y outside zoom level bounds");let i=((1<<r)*(1<<r)-1)/3,n=r-1,[a,s]=[e,t];for(let o=1<<n;o>0;o>>=1){let u=a&o,h=s&o;i+=(3*u^h)*(1<<n),[a,s]=ee(o,a,s,u,h),n--}return i}d(te,"zxyToTileId");function Ae(r){let e=3*r+1;return e<4294967296?31-Math.clz32(e):63-Math.clz32(e/4294967296)}d(Ae,"tileIdToZ");function ze(r){let e=Ae(r)>>1;if(e>26)throw new Error("Tile zoom level exceeds max safe number limit (26)");let t=((1<<e)*(1<<e)-1)/3,i=r-t,n=0,a=0,s=1<<e;for(let o=1;o<s;o<<=1){let u=o&i/2,h=o&(i^u);[n,a]=ee(o,n,a,u,h),i=i/2,n+=u,a+=h}return[e,n,a]}d(ze,"tileIdToZxy");var De=(r=>(r[r.Unknown=0]="Unknown",r[r.None=1]="None",r[r.Gzip=2]="Gzip",r[r.Brotli=3]="Brotli",r[r.Zstd=4]="Zstd",r))(De||{});function k(r,e){return m(this,null,function*(){if(e===1||e===0)return r;if(e===2){if(typeof globalThis.DecompressionStream>"u")return lt(new Uint8Array(r));let t=new Response(r).body;if(!t)throw new Error("Failed to read response stream");let i=t.pipeThrough(new globalThis.DecompressionStream("gzip"));return new Response(i).arrayBuffer()}throw new Error("Compression method not supported")})}d(k,"defaultDecompress");var He=(r=>(r[r.Unknown=0]="Unknown",r[r.Mvt=1]="Mvt",r[r.Png=2]="Png",r[r.Jpeg=3]="Jpeg",r[r.Webp=4]="Webp",r[r.Avif=5]="Avif",r[r.Mlt=6]="Mlt",r))(He||{});function re(r){return r===1?".mvt":r===2?".png":r===3?".jpg":r===4?".webp":r===5?".avif":r===6?".mlt":""}d(re,"tileTypeExt");var mt=127;function ie(r,e){let t=0,i=r.length-1;for(;t<=i;){let n=i+t>>1,a=e-r[n].tileId;if(a>0)t=n+1;else if(a<0)i=n-1;else return r[n]}return i>=0&&(r[i].runLength===0||e-r[i].tileId<r[i].runLength)?r[i]:null}d(ie,"findTile");var Pe=class{constructor(e){this.file=e}getKey(){return this.file.name}getBytes(e,t){return m(this,null,function*(){return{data:yield this.file.slice(e,e+t).arrayBuffer()}})}};d(Pe,"FileSource");var yt=Pe,Se=class{constructor(e,t=new Headers){var i,n;this.url=e,this.customHeaders=t,this.mustReload=!1;let a="";"navigator"in globalThis&&(a=(n=(i=globalThis.navigator)==null?void 0:i.userAgent)!=null?n:"");let s=a.indexOf("Windows")>-1,o=/Chrome|Chromium|Edg|OPR|Brave/.test(a);this.chromeWindowsNoCache=!1,s&&o&&(this.chromeWindowsNoCache=!0)}getKey(){return this.url}setHeaders(e){this.customHeaders=e}getBytes(e,t,i,n){return m(this,null,function*(){let a,s;i?s=i:(a=new AbortController,s=a.signal);let o=new Headers(this.customHeaders);o.set("range",`bytes=${e}-${e+t-1}`);let u;this.mustReload?u="reload":this.chromeWindowsNoCache&&(u="no-store");let h=yield fetch(this.url,{signal:s,cache:u,headers:o});if(e===0&&h.status===416){let c=h.headers.get("Content-Range");if(!c||!c.startsWith("bytes */"))throw new Error("Missing content-length on 416 response");let y=+c.substr(8);h=yield fetch(this.url,{signal:s,cache:"reload",headers:{range:`bytes=0-${y-1}`}})}let f=h.headers.get("Etag");if(f!=null&&f.startsWith("W/")&&(f=null),h.status===416||n&&f&&f!==n)throw this.mustReload=!0,new $(`Server returned non-matching ETag ${n} after one retry. Check browser extensions and servers for issues that may affect correct ETag headers.`);if(h.status>=300)throw new Error(`Bad response code: ${h.status}`);let l=h.headers.get("Content-Length");if(h.status===200&&(!l||+l>t))throw a&&a.abort(),new Error("Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.");return{data:yield h.arrayBuffer(),etag:f||void 0,cacheControl:h.headers.get("Cache-Control")||void 0,expires:h.headers.get("Expires")||void 0}})}};d(Se,"FetchSource");var Oe=Se;function p(r,e){let t=r.getUint32(e+4,!0),i=r.getUint32(e+0,!0);return t*ft(2,32)+i}d(p,"getUint64");function ne(r,e){let t=new DataView(r),i=t.getUint8(7);if(i>3)throw new Error(`Archive is spec version ${i} but this library supports up to spec version 3`);return{specVersion:i,rootDirectoryOffset:p(t,8),rootDirectoryLength:p(t,16),jsonMetadataOffset:p(t,24),jsonMetadataLength:p(t,32),leafDirectoryOffset:p(t,40),leafDirectoryLength:p(t,48),tileDataOffset:p(t,56),tileDataLength:p(t,64),numAddressedTiles:p(t,72),numTileEntries:p(t,80),numTileContents:p(t,88),clustered:t.getUint8(96)===1,internalCompression:t.getUint8(97),tileCompression:t.getUint8(98),tileType:t.getUint8(99),minZoom:t.getUint8(100),maxZoom:t.getUint8(101),minLon:t.getInt32(102,!0)/1e7,minLat:t.getInt32(106,!0)/1e7,maxLon:t.getInt32(110,!0)/1e7,maxLat:t.getInt32(114,!0)/1e7,centerZoom:t.getUint8(118),centerLon:t.getInt32(119,!0)/1e7,centerLat:t.getInt32(123,!0)/1e7,etag:e}}d(ne,"bytesToHeader");function ae(r){let e={buf:new Uint8Array(r),pos:0},t=z(e),i=[],n=0;for(let a=0;a<t;a++){let s=z(e);i.push({tileId:n+s,offset:0,length:0,runLength:1}),n+=s}for(let a=0;a<t;a++)i[a].runLength=z(e);for(let a=0;a<t;a++)i[a].length=z(e);for(let a=0;a<t;a++){let s=z(e);s===0&&a>0?i[a].offset=i[a-1].offset+i[a-1].length:i[a].offset=s-1}return i}d(ae,"deserializeIndex");var Ze=class extends Error{};d(Ze,"EtagMismatch");var $=Ze;function se(r,e){return m(this,null,function*(){let t=yield r.getBytes(0,16384);if(new DataView(t.data).getUint16(0,!0)!==19792)throw new Error("Wrong magic number for PMTiles archive");let i=t.data.slice(0,mt),n=ne(i,t.etag),a=t.data.slice(n.rootDirectoryOffset,n.rootDirectoryOffset+n.rootDirectoryLength),s=`${r.getKey()}|${n.etag||""}|${n.rootDirectoryOffset}|${n.rootDirectoryLength}`,o=ae(yield e(a,n.internalCompression));return[n,[s,o.length,o]]})}d(se,"getHeaderAndRoot");function oe(r,e,t,i,n){return m(this,null,function*(){let a=yield r.getBytes(t,i,void 0,n.etag),s=yield e(a.data,n.internalCompression),o=ae(s);if(o.length===0)throw new Error("Empty directory is invalid");return o})}d(oe,"getDirectory");var Ie=class{constructor(e=100,t=!0,i=k){this.cache=new Map,this.maxCacheEntries=e,this.counter=1,this.decompress=i}getHeader(e){return m(this,null,function*(){let t=e.getKey(),i=this.cache.get(t);if(i)return i.lastUsed=this.counter++,i.data;let n=yield se(e,this.decompress);return n[1]&&this.cache.set(n[1][0],{lastUsed:this.counter++,data:n[1][2]}),this.cache.set(t,{lastUsed:this.counter++,data:n[0]}),this.prune(),n[0]})}getDirectory(e,t,i,n){return m(this,null,function*(){let a=`${e.getKey()}|${n.etag||""}|${t}|${i}`,s=this.cache.get(a);if(s)return s.lastUsed=this.counter++,s.data;let o=yield oe(e,this.decompress,t,i,n);return this.cache.set(a,{lastUsed:this.counter++,data:o}),this.prune(),o})}prune(){if(this.cache.size>this.maxCacheEntries){let e=1/0,t;this.cache.forEach((i,n)=>{i.lastUsed<e&&(e=i.lastUsed,t=n)}),t&&this.cache.delete(t)}}invalidate(e){return m(this,null,function*(){this.cache.delete(e.getKey())})}};d(Ie,"ResolvedValueCache");var pt=Ie,Re=class{constructor(e=100,t=!0,i=k){this.cache=new Map,this.invalidations=new Map,this.maxCacheEntries=e,this.counter=1,this.decompress=i}getHeader(e){return m(this,null,function*(){let t=e.getKey(),i=this.cache.get(t);if(i)return i.lastUsed=this.counter++,yield i.data;let n=new Promise((a,s)=>{se(e,this.decompress).then(o=>{o[1]&&this.cache.set(o[1][0],{lastUsed:this.counter++,data:Promise.resolve(o[1][2])}),a(o[0]),this.prune()}).catch(o=>{s(o)})});return this.cache.set(t,{lastUsed:this.counter++,data:n}),n})}getDirectory(e,t,i,n){return m(this,null,function*(){let a=`${e.getKey()}|${n.etag||""}|${t}|${i}`,s=this.cache.get(a);if(s)return s.lastUsed=this.counter++,yield s.data;let o=new Promise((u,h)=>{oe(e,this.decompress,t,i,n).then(f=>{u(f),this.prune()}).catch(f=>{h(f)})});return this.cache.set(a,{lastUsed:this.counter++,data:o}),o})}prune(){if(this.cache.size>=this.maxCacheEntries){let e=1/0,t;this.cache.forEach((i,n)=>{i.lastUsed<e&&(e=i.lastUsed,t=n)}),t&&this.cache.delete(t)}}invalidate(e){return m(this,null,function*(){let t=e.getKey();if(this.invalidations.get(t))return yield this.invalidations.get(t);this.cache.delete(e.getKey());let i=new Promise((n,a)=>{this.getHeader(e).then(s=>{n(),this.invalidations.delete(t)}).catch(s=>{a(s)})});this.invalidations.set(t,i)})}};d(Re,"SharedPromiseCache");var $e=Re,ke=class{constructor(e,t,i){typeof e=="string"?this.source=new Oe(e):this.source=e,i?this.decompress=i:this.decompress=k,t?this.cache=t:this.cache=new $e}getHeader(){return m(this,null,function*(){return yield this.cache.getHeader(this.source)})}getZxyAttempt(e,t,i,n){return m(this,null,function*(){let a=te(e,t,i),s=yield this.cache.getHeader(this.source);if(e<s.minZoom||e>s.maxZoom)return;let o=s.rootDirectoryOffset,u=s.rootDirectoryLength;for(let h=0;h<=3;h++){let f=yield this.cache.getDirectory(this.source,o,u,s),l=ie(f,a);if(l){if(l.runLength>0){let c=yield this.source.getBytes(s.tileDataOffset+l.offset,l.length,n,s.etag);return{data:yield this.decompress(c.data,s.tileCompression),cacheControl:c.cacheControl,expires:c.expires}}o=s.leafDirectoryOffset+l.offset,u=l.length}else return}throw new Error("Maximum directory depth exceeded")})}getZxy(e,t,i,n){return m(this,null,function*(){try{return yield this.getZxyAttempt(e,t,i,n)}catch(a){if(a instanceof $)return this.cache.invalidate(this.source),yield this.getZxyAttempt(e,t,i,n);throw a}})}getMetadataAttempt(){return m(this,null,function*(){let e=yield this.cache.getHeader(this.source),t=yield this.source.getBytes(e.jsonMetadataOffset,e.jsonMetadataLength,void 0,e.etag),i=yield this.decompress(t.data,e.internalCompression),n=new TextDecoder("utf-8");return JSON.parse(n.decode(i))})}getMetadata(){return m(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(e){if(e instanceof $)return this.cache.invalidate(this.source),yield this.getMetadataAttempt();throw e}})}getTileJson(e){return m(this,null,function*(){let t=yield this.getHeader(),i=yield this.getMetadata(),n=re(t.tileType);return{tilejson:"3.0.0",scheme:"xyz",tiles:[`${e}/{z}/{x}/{y}${n}`],vector_layers:i.vector_layers,attribution:i.attribution,description:i.description,name:i.name,version:i.version,bounds:[t.minLon,t.minLat,t.maxLon,t.maxLat],center:[t.centerLon,t.centerLat,t.centerZoom],minzoom:t.minZoom,maxzoom:t.maxZoom}})}};d(ke,"PMTiles");var X=ke;exports.Compression=De;exports.EtagMismatch=$;exports.FetchSource=Oe;exports.FileSource=yt;exports.PMTiles=X;exports.Protocol=vt;exports.ResolvedValueCache=pt;exports.SharedPromiseCache=$e;exports.TileType=He;exports.bytesToHeader=ne;exports.findTile=ie;exports.getUint64=p;exports.leafletRasterLayer=dt;exports.readVarint=z;exports.tileIdToZxy=ze;exports.tileTypeExt=re;exports.zxyToTileId=te;
@@ -0,0 +1,4 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function oa(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");for(var i=1;i<=60;++i)t("EPSG:"+(32600+i),"+proj=utm +zone="+i+" +datum=WGS84 +units=m"),t("EPSG:"+(32700+i),"+proj=utm +zone="+i+" +south +datum=WGS84 +units=m");t("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),t("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),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 it=1,at=2,ft=3,la=4,Zt=5,vi=6378137,fa=6356752314e-3,gi=.0066943799901413165,mt=484813681109536e-20,v=Math.PI/2,ca=.16666666666666666,_a=.04722222222222222,ua=.022156084656084655,m=1e-10,C=.017453292519943295,$=57.29577951308232,b=Math.PI/4,Pt=Math.PI*2,R=3.14159265359,F={};F.greenwich=0;F.lisbon=-9.131906111111;F.paris=2.337229166667;F.bogota=-74.080916666667;F.madrid=-3.687938888889;F.rome=12.452333333333;F.bern=7.439583333333;F.jakarta=106.807719444444;F.ferro=-17.666666666667;F.brussels=4.367975;F.stockholm=18.058277777778;F.athens=23.7163375;F.oslo=10.722916666667;const Ma={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var di=/[\s_\-\/\(\)]/g;function V(t,i){if(t[i])return t[i];for(var a=Object.keys(t),s=i.toLowerCase().replace(di,""),e=-1,r,n;++e<a.length;)if(r=a[e],n=r.toLowerCase().replace(di,""),n===s)return t[r]}function Yt(t){var i={},a=t.split("+").map(function(h){return h.trim()}).filter(function(h){return h}).reduce(function(h,o){var l=o.split("=");return l.push(!0),h[l[0].toLowerCase()]=l[1],h},{}),s,e,r,n={proj:"projName",datum:"datumCode",rf:function(h){i.rf=parseFloat(h)},lat_0:function(h){i.lat0=h*C},lat_1:function(h){i.lat1=h*C},lat_2:function(h){i.lat2=h*C},lat_ts:function(h){i.lat_ts=h*C},lon_0:function(h){i.long0=h*C},lon_1:function(h){i.long1=h*C},lon_2:function(h){i.long2=h*C},alpha:function(h){i.alpha=parseFloat(h)*C},gamma:function(h){i.rectified_grid_angle=parseFloat(h)*C},lonc:function(h){i.longc=h*C},x_0:function(h){i.x0=parseFloat(h)},y_0:function(h){i.y0=parseFloat(h)},k_0:function(h){i.k0=parseFloat(h)},k:function(h){i.k0=parseFloat(h)},a:function(h){i.a=parseFloat(h)},b:function(h){i.b=parseFloat(h)},r:function(h){i.a=i.b=parseFloat(h)},r_a:function(){i.R_A=!0},zone:function(h){i.zone=parseInt(h,10)},south:function(){i.utmSouth=!0},towgs84:function(h){i.datum_params=h.split(",").map(function(o){return parseFloat(o)})},to_meter:function(h){i.to_meter=parseFloat(h)},units:function(h){i.units=h;var o=V(Ma,h);o&&(i.to_meter=o.to_meter)},from_greenwich:function(h){i.from_greenwich=h*C},pm:function(h){var o=V(F,h);i.from_greenwich=(o||parseFloat(h))*C},nadgrids:function(h){h==="@null"?i.datumCode="none":i.nadgrids=h},axis:function(h){var o="ewnsud";h.length===3&&o.indexOf(h.substr(0,1))!==-1&&o.indexOf(h.substr(1,1))!==-1&&o.indexOf(h.substr(2,1))!==-1&&(i.axis=h)},approx:function(){i.approx=!0},over:function(){i.over=!0}};for(s in a)e=a[s],s in n?(r=n[s],typeof r=="function"?r(e):i[r]=e):i[s]=e;return typeof i.datumCode=="string"&&i.datumCode!=="WGS84"&&(i.datumCode=i.datumCode.toLowerCase()),i.projStr=t,i}class qi{static getId(i){const a=i.find(s=>Array.isArray(s)&&s[0]==="ID");return a&&a.length>=3?{authority:a[1],code:parseInt(a[2],10)}:null}static convertUnit(i,a="unit"){if(!i||i.length<3)return{type:a,name:"unknown",conversion_factor:null};const s=i[1],e=parseFloat(i[2])||null,r=i.find(h=>Array.isArray(h)&&h[0]==="ID"),n=r?{authority:r[1],code:parseInt(r[2],10)}:null;return{type:a,name:s,conversion_factor:e,id:n}}static convertAxis(i){const a=i[1]||"Unknown";let s;const e=a.match(/^\((.)\)$/);if(e){const l=e[1].toUpperCase();if(l==="E")s="east";else if(l==="N")s="north";else if(l==="U")s="up";else throw new Error(`Unknown axis abbreviation: ${l}`)}else s=i[2]?i[2].toLowerCase():"unknown";const r=i.find(l=>Array.isArray(l)&&l[0]==="ORDER"),n=r?parseInt(r[1],10):null,h=i.find(l=>Array.isArray(l)&&(l[0]==="LENGTHUNIT"||l[0]==="ANGLEUNIT"||l[0]==="SCALEUNIT")),o=this.convertUnit(h);return{name:a,direction:s,unit:o,order:n}}static extractAxes(i){return i.filter(a=>Array.isArray(a)&&a[0]==="AXIS").map(a=>this.convertAxis(a)).sort((a,s)=>(a.order||0)-(s.order||0))}static convert(i,a={}){switch(i[0]){case"PROJCRS":a.type="ProjectedCRS",a.name=i[1],a.base_crs=i.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")?this.convert(i.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")):null,a.conversion=i.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")?this.convert(i.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")):null;const s=i.find(f=>Array.isArray(f)&&f[0]==="CS");s&&(a.coordinate_system={type:s[1],axis:this.extractAxes(i)});const e=i.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT");if(e){const f=this.convertUnit(e);a.coordinate_system.unit=f}a.id=this.getId(i);break;case"BASEGEOGCRS":case"GEOGCRS":a.type="GeographicCRS",a.name=i[1];const r=i.find(f=>Array.isArray(f)&&(f[0]==="DATUM"||f[0]==="ENSEMBLE"));if(r){const f=this.convert(r);r[0]==="ENSEMBLE"?a.datum_ensemble=f:a.datum=f;const u=i.find(M=>Array.isArray(M)&&M[0]==="PRIMEM");u&&u[1]!=="Greenwich"&&(f.prime_meridian={name:u[1],longitude:parseFloat(u[2])})}a.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(i)},a.id=this.getId(i);break;case"DATUM":a.type="GeodeticReferenceFrame",a.name=i[1],a.ellipsoid=i.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")?this.convert(i.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":a.type="DatumEnsemble",a.name=i[1],a.members=i.filter(f=>Array.isArray(f)&&f[0]==="MEMBER").map(f=>({type:"DatumEnsembleMember",name:f[1],id:this.getId(f)}));const n=i.find(f=>Array.isArray(f)&&f[0]==="ENSEMBLEACCURACY");n&&(a.accuracy=parseFloat(n[1]));const h=i.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID");h&&(a.ellipsoid=this.convert(h)),a.id=this.getId(i);break;case"ELLIPSOID":a.type="Ellipsoid",a.name=i[1],a.semi_major_axis=parseFloat(i[2]),a.inverse_flattening=parseFloat(i[3]),i.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT")&&this.convert(i.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT"),a);break;case"CONVERSION":a.type="Conversion",a.name=i[1],a.method=i.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(i.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,a.parameters=i.filter(f=>Array.isArray(f)&&f[0]==="PARAMETER").map(f=>this.convert(f));break;case"METHOD":a.type="Method",a.name=i[1],a.id=this.getId(i);break;case"PARAMETER":a.type="Parameter",a.name=i[1],a.value=parseFloat(i[2]),a.unit=this.convertUnit(i.find(f=>Array.isArray(f)&&(f[0]==="LENGTHUNIT"||f[0]==="ANGLEUNIT"||f[0]==="SCALEUNIT"))),a.id=this.getId(i);break;case"BOUNDCRS":a.type="BoundCRS";const o=i.find(f=>Array.isArray(f)&&f[0]==="SOURCECRS");if(o){const f=o.find(u=>Array.isArray(u));a.source_crs=f?this.convert(f):null}const l=i.find(f=>Array.isArray(f)&&f[0]==="TARGETCRS");if(l){const f=l.find(u=>Array.isArray(u));a.target_crs=f?this.convert(f):null}const _=i.find(f=>Array.isArray(f)&&f[0]==="ABRIDGEDTRANSFORMATION");_?a.transformation=this.convert(_):a.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(a.type="Transformation",a.name=i[1],a.method=i.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(i.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,a.parameters=i.filter(f=>Array.isArray(f)&&(f[0]==="PARAMETER"||f[0]==="PARAMETERFILE")).map(f=>{if(f[0]==="PARAMETER")return this.convert(f);if(f[0]==="PARAMETERFILE")return{name:f[1],value:f[2],id:{authority:"EPSG",code:8656}}}),a.parameters.length===7){const f=a.parameters[6];f.name==="Scale difference"&&(f.value=Math.round((f.value-1)*1e12)/1e6)}a.id=this.getId(i);break;case"AXIS":a.coordinate_system||(a.coordinate_system={type:"unspecified",axis:[]}),a.coordinate_system.axis.push(this.convertAxis(i));break;case"LENGTHUNIT":const c=this.convertUnit(i,"LinearUnit");a.coordinate_system&&a.coordinate_system.axis&&a.coordinate_system.axis.forEach(f=>{f.unit||(f.unit=c)}),c.conversion_factor&&c.conversion_factor!==1&&a.semi_major_axis&&(a.semi_major_axis={value:a.semi_major_axis,unit:c});break;default:a.keyword=i[0];break}return a}}class va extends qi{static convert(i,a={}){return super.convert(i,a),a.coordinate_system&&a.coordinate_system.subtype==="Cartesian"&&delete a.coordinate_system,a.usage&&delete a.usage,a}}class ga extends qi{static convert(i,a={}){super.convert(i,a);const s=i.find(r=>Array.isArray(r)&&r[0]==="CS");s&&(a.coordinate_system={subtype:s[1],axis:this.extractAxes(i)});const e=i.find(r=>Array.isArray(r)&&r[0]==="USAGE");if(e){const r=e.find(o=>Array.isArray(o)&&o[0]==="SCOPE"),n=e.find(o=>Array.isArray(o)&&o[0]==="AREA"),h=e.find(o=>Array.isArray(o)&&o[0]==="BBOX");a.usage={},r&&(a.usage.scope=r[1]),n&&(a.usage.area=n[1]),h&&(a.usage.bbox=h.slice(1))}return a}}function da(t){return t.find(i=>Array.isArray(i)&&i[0]==="USAGE")?"2019":(t.find(i=>Array.isArray(i)&&i[0]==="CS")||t[0]==="BOUNDCRS"||t[0]==="PROJCRS"||t[0]==="GEOGCRS","2015")}function ma(t){return(da(t)==="2019"?ga:va).convert(t)}function ya(t){const i=t.toUpperCase();return i.includes("PROJCRS")||i.includes("GEOGCRS")||i.includes("BOUNDCRS")||i.includes("VERTCRS")||i.includes("LENGTHUNIT")||i.includes("ANGLEUNIT")||i.includes("SCALEUNIT")?"WKT2":(i.includes("PROJCS")||i.includes("GEOGCS")||i.includes("LOCAL_CS")||i.includes("VERT_CS")||i.includes("UNIT"),"WKT1")}var xt=1,Ui=2,ki=3,$t=4,$i=5,ri=-1,Ea=/\s/,Sa=/[A-Za-z]/,wa=/[A-Za-z84_]/,Qt=/[,\]]/,Fi=/[\d\.E\-\+]/;function Q(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=xt}Q.prototype.readCharicter=function(){var t=this.text[this.place++];if(this.state!==$t)for(;Ea.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case xt:return this.neutral(t);case Ui:return this.keyword(t);case $t:return this.quoted(t);case $i:return this.afterquote(t);case ki:return this.number(t);case ri:return}};Q.prototype.afterquote=function(t){if(t==='"'){this.word+='"',this.state=$t;return}if(Qt.test(t)){this.word=this.word.trim(),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in afterquote yet, index '+this.place)};Q.prototype.afterItem=function(t){if(t===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=xt;return}if(t==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=xt,this.currentObject=this.stack.pop(),this.currentObject||(this.state=ri);return}};Q.prototype.number=function(t){if(Fi.test(t)){this.word+=t;return}if(Qt.test(t)){this.word=parseFloat(this.word),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in number yet, index '+this.place)};Q.prototype.quoted=function(t){if(t==='"'){this.state=$i;return}this.word+=t};Q.prototype.keyword=function(t){if(wa.test(t)){this.word+=t;return}if(t==="["){var i=[];i.push(this.word),this.level++,this.root===null?this.root=i:this.currentObject.push(i),this.stack.push(this.currentObject),this.currentObject=i,this.state=xt;return}if(Qt.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in keyword yet, index '+this.place)};Q.prototype.neutral=function(t){if(Sa.test(t)){this.word=t,this.state=Ui;return}if(t==='"'){this.word="",this.state=$t;return}if(Fi.test(t)){this.word=t,this.state=ki;return}if(Qt.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in neutral yet, index '+this.place)};Q.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===ri)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function Pa(t){var i=new Q(t);return i.output()}function Xt(t,i,a){Array.isArray(i)&&(a.unshift(i),i=null);var s=i?{}:t,e=a.reduce(function(r,n){return ht(n,r),r},s);i&&(t[i]=e)}function ht(t,i){if(!Array.isArray(t)){i[t]=!0;return}var a=t.shift();if(a==="PARAMETER"&&(a=t.shift()),t.length===1){if(Array.isArray(t[0])){i[a]={},ht(t[0],i[a]);return}i[a]=t[0];return}if(!t.length){i[a]=!0;return}if(a==="TOWGS84"){i[a]=t;return}if(a==="AXIS"){a in i||(i[a]=[]),i[a].push(t);return}Array.isArray(a)||(i[a]={});var s;switch(a){case"UNIT":case"PRIMEM":case"VERT_DATUM":i[a]={name:t[0].toLowerCase(),convert:t[1]},t.length===3&&ht(t[2],i[a]);return;case"SPHEROID":case"ELLIPSOID":i[a]={name:t[0],a:t[1],rf:t[2]},t.length===4&&ht(t[3],i[a]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":t[0]=["name",t[0]],Xt(i,a,t);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":t[0]=["name",t[0]],Xt(i,a,t),i[a].type=a;return;default:for(s=-1;++s<t.length;)if(!Array.isArray(t[s]))return ht(t,i[a]);return Xt(i,a,t)}}var xa=.017453292519943295;function z(t){return t*xa}function Di(t){const i=(t.projName||"").toLowerCase().replace(/_/g," ");!t.long0&&t.longc&&(i==="albers conic equal area"||i==="lambert azimuthal equal area")&&(t.long0=t.longc),!t.lat_ts&&t.lat1&&(i==="stereographic south pole"||i==="polar stereographic (variant b)")?(t.lat0=z(t.lat1>0?90:-90),t.lat_ts=t.lat1,delete t.lat1):!t.lat_ts&&t.lat0&&(i==="polar stereographic"||i==="polar stereographic (variant a)")&&(t.lat_ts=t.lat0,t.lat0=z(t.lat0>0?90:-90),delete t.lat1)}function mi(t){let i={units:null,to_meter:void 0};return typeof t=="string"?(i.units=t.toLowerCase(),i.units==="metre"&&(i.units="meter"),i.units==="meter"&&(i.to_meter=1)):t&&t.name&&(i.units=t.name.toLowerCase(),i.units==="metre"&&(i.units="meter"),i.to_meter=t.conversion_factor),i}function yi(t){return typeof t=="object"?t.value*t.unit.conversion_factor:t}function Ei(t,i){t.ellipsoid.radius?(i.a=t.ellipsoid.radius,i.rf=0):(i.a=yi(t.ellipsoid.semi_major_axis),t.ellipsoid.inverse_flattening!==void 0?i.rf=t.ellipsoid.inverse_flattening:t.ellipsoid.semi_major_axis!==void 0&&t.ellipsoid.semi_minor_axis!==void 0&&(i.rf=i.a/(i.a-yi(t.ellipsoid.semi_minor_axis))))}function Ft(t,i={}){return!t||typeof t!="object"?t:t.type==="BoundCRS"?(Ft(t.source_crs,i),t.transformation&&(t.transformation.method&&t.transformation.method.name==="NTv2"?i.nadgrids=t.transformation.parameters[0].value:i.datum_params=t.transformation.parameters.map(a=>a.value)),i):(Object.keys(t).forEach(a=>{const s=t[a];if(s!==null)switch(a){case"name":if(i.srsCode)break;i.name=s,i.srsCode=s;break;case"type":s==="GeographicCRS"?i.projName="longlat":s==="ProjectedCRS"&&t.conversion&&t.conversion.method&&(i.projName=t.conversion.method.name);break;case"datum":case"datum_ensemble":s.ellipsoid&&(i.ellps=s.ellipsoid.name,Ei(s,i)),s.prime_meridian&&(i.from_greenwich=s.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":i.ellps=s.name,Ei(s,i);break;case"prime_meridian":i.long0=(s.longitude||0)*Math.PI/180;break;case"coordinate_system":if(s.axis){if(i.axis=s.axis.map(e=>{const r=e.direction;if(r==="east")return"e";if(r==="north")return"n";if(r==="west")return"w";if(r==="south")return"s";throw new Error(`Unknown axis direction: ${r}`)}).join("")+"u",s.unit){const{units:e,to_meter:r}=mi(s.unit);i.units=e,i.to_meter=r}else if(s.axis[0]&&s.axis[0].unit){const{units:e,to_meter:r}=mi(s.axis[0].unit);i.units=e,i.to_meter=r}}break;case"id":s.authority&&s.code&&(i.title=s.authority+":"+s.code);break;case"conversion":s.method&&s.method.name&&(i.projName=s.method.name),s.parameters&&s.parameters.forEach(e=>{const r=e.name.toLowerCase().replace(/\s+/g,"_"),n=e.value;e.unit&&e.unit.conversion_factor?i[r]=n*e.unit.conversion_factor:e.unit==="degree"?i[r]=n*Math.PI/180:i[r]=n});break;case"unit":s.name&&(i.units=s.name.toLowerCase(),i.units==="metre"&&(i.units="meter")),s.conversion_factor&&(i.to_meter=s.conversion_factor);break;case"base_crs":Ft(s,i),i.datumCode=s.id?s.id.authority+"_"+s.id.code:s.name;break}}),i.latitude_of_false_origin!==void 0&&(i.lat0=i.latitude_of_false_origin),i.longitude_of_false_origin!==void 0&&(i.long0=i.longitude_of_false_origin),i.latitude_of_standard_parallel!==void 0&&(i.lat0=i.latitude_of_standard_parallel,i.lat1=i.latitude_of_standard_parallel),i.latitude_of_1st_standard_parallel!==void 0&&(i.lat1=i.latitude_of_1st_standard_parallel),i.latitude_of_2nd_standard_parallel!==void 0&&(i.lat2=i.latitude_of_2nd_standard_parallel),i.latitude_of_projection_centre!==void 0&&(i.lat0=i.latitude_of_projection_centre),i.longitude_of_projection_centre!==void 0&&(i.longc=i.longitude_of_projection_centre),i.easting_at_false_origin!==void 0&&(i.x0=i.easting_at_false_origin),i.northing_at_false_origin!==void 0&&(i.y0=i.northing_at_false_origin),i.latitude_of_natural_origin!==void 0&&(i.lat0=i.latitude_of_natural_origin),i.longitude_of_natural_origin!==void 0&&(i.long0=i.longitude_of_natural_origin),i.longitude_of_origin!==void 0&&(i.long0=i.longitude_of_origin),i.false_easting!==void 0&&(i.x0=i.false_easting),i.easting_at_projection_centre&&(i.x0=i.easting_at_projection_centre),i.false_northing!==void 0&&(i.y0=i.false_northing),i.northing_at_projection_centre&&(i.y0=i.northing_at_projection_centre),i.standard_parallel_1!==void 0&&(i.lat1=i.standard_parallel_1),i.standard_parallel_2!==void 0&&(i.lat2=i.standard_parallel_2),i.scale_factor_at_natural_origin!==void 0&&(i.k0=i.scale_factor_at_natural_origin),i.scale_factor_at_projection_centre!==void 0&&(i.k0=i.scale_factor_at_projection_centre),i.scale_factor_on_pseudo_standard_parallel!==void 0&&(i.k0=i.scale_factor_on_pseudo_standard_parallel),i.azimuth!==void 0&&(i.alpha=i.azimuth),i.azimuth_at_projection_centre!==void 0&&(i.alpha=i.azimuth_at_projection_centre),i.angle_from_rectified_to_skew_grid&&(i.rectified_grid_angle=i.angle_from_rectified_to_skew_grid),Di(i),i)}var Ga=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function ba(t,i){var a=i[0],s=i[1];!(a in t)&&s in t&&(t[a]=t[s],i.length===3&&(t[a]=i[2](t[a])))}function ji(t){for(var i=Object.keys(t),a=0,s=i.length;a<s;++a){var e=i[a];Ga.indexOf(e)!==-1&&Aa(t[e]),typeof t[e]=="object"&&ji(t[e])}}function Aa(t){if(t.AUTHORITY){var i=Object.keys(t.AUTHORITY)[0];i&&i in t.AUTHORITY&&(t.title=i+":"+t.AUTHORITY[i])}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 a="",s=0,e=t.AXIS.length;s<e;++s){var r=[t.AXIS[s][0].toLowerCase(),t.AXIS[s][1].toLowerCase()];r[0].indexOf("north")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="north"?a+="n":r[0].indexOf("south")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="south"?a+="s":r[0].indexOf("east")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="east"?a+="e":(r[0].indexOf("west")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="west")&&(a+="w")}a.length===2&&(a+="u"),a.length===3&&(t.axis=a)}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 n=t.GEOGCS;t.type==="GEOGCS"&&(n=t),n&&(n.DATUM?t.datumCode=n.DATUM.name.toLowerCase():t.datumCode=n.name.toLowerCase(),t.datumCode.slice(0,2)==="d_"&&(t.datumCode=t.datumCode.slice(2)),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==="belge_1972"&&(t.datumCode="rnb72"),n.DATUM&&n.DATUM.SPHEROID&&(t.ellps=n.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),t.ellps.toLowerCase().slice(0,13)==="international"&&(t.ellps="intl"),t.a=n.DATUM.SPHEROID.a,t.rf=parseFloat(n.DATUM.SPHEROID.rf,10)),n.DATUM&&n.DATUM.TOWGS84&&(t.datum_params=n.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),t.rectified_grid_angle&&(t.rectified_grid_angle=z(t.rectified_grid_angle));function h(_){var c=t.to_meter||1;return _*c}var o=function(_){return ba(t,_)},l=[["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",z],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",z],["x0","false_easting",h],["y0","false_northing",h],["long0","central_meridian",z],["lat0","latitude_of_origin",z],["lat0","standard_parallel_1",z],["lat1","standard_parallel_1",z],["lat2","standard_parallel_2",z],["azimuth","Azimuth"],["alpha","azimuth",z],["srsCode","name"]];l.forEach(o),Di(t)}function Dt(t){if(typeof t=="object")return Ft(t);const i=ya(t);var a=Pa(t);if(i==="WKT2"){const r=ma(a);return Ft(r)}var s=a[0],e={};return ht(a,e),ji(e),e[s]}function T(t){var i=this;if(arguments.length===2){var a=arguments[1];typeof a=="string"?a.charAt(0)==="+"?T[t]=Yt(arguments[1]):T[t]=Dt(arguments[1]):a&&typeof a=="object"&&!("projName"in a)?T[t]=Dt(arguments[1]):(T[t]=a,a||delete T[t])}else if(arguments.length===1){if(Array.isArray(t))return t.map(function(s){return Array.isArray(s)?T.apply(i,s):T(s)});if(typeof t=="string"){if(t in T)return T[t]}else"EPSG"in t?T["EPSG:"+t.EPSG]=t:"ESRI"in t?T["ESRI:"+t.ESRI]=t:"IAU2000"in t?T["IAU2000:"+t.IAU2000]=t:console.log(t);return}}oa(T);function Na(t){return typeof t=="string"}function Ia(t){return t in T}function Ca(t){return t.indexOf("+")!==0&&t.indexOf("[")!==-1||typeof t=="object"&&!("srsCode"in t)}var Ra=["3857","900913","3785","102113"];function Oa(t){var i=V(t,"authority");if(i){var a=V(i,"epsg");return a&&Ra.indexOf(a)>-1}}function Ta(t){var i=V(t,"extension");if(i)return V(i,"proj4")}function pa(t){return t[0]==="+"}function La(t){if(Na(t)){if(Ia(t))return T[t];if(Ca(t)){var i=Dt(t);if(Oa(i))return T["EPSG:3857"];var a=Ta(i);return a?Yt(a):i}if(pa(t))return Yt(t)}else return"projName"in t?t:Dt(t)}function Si(t,i){t=t||{};var a,s;if(!i)return t;for(s in i)a=i[s],a!==void 0&&(t[s]=a);return t}function H(t,i,a){var s=t*i;return a/Math.sqrt(1-s*s)}function At(t){return t<0?-1:1}function y(t,i){return i||Math.abs(t)<=R?t:t-At(t)*Pt}function W(t,i,a){var s=t*a,e=.5*t;return s=Math.pow((1-s)/(1+s),e),Math.tan(.5*(v-i))/s}function Gt(t,i){for(var a=.5*t,s,e,r=v-2*Math.atan(i),n=0;n<=15;n++)if(s=t*Math.sin(r),e=v-2*Math.atan(i*Math.pow((1-s)/(1+s),a))-r,r+=e,Math.abs(e)<=1e-10)return r;return-9999}function qa(){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=H(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Ua(t){var i=t.x,a=t.y;if(a*$>90&&a*$<-90&&i*$>180&&i*$<-180)return null;var s,e;if(Math.abs(Math.abs(a)-v)<=m)return null;if(this.sphere)s=this.x0+this.a*this.k0*y(i-this.long0,this.over),e=this.y0+this.a*this.k0*Math.log(Math.tan(b+.5*a));else{var r=Math.sin(a),n=W(this.e,a,r);s=this.x0+this.a*this.k0*y(i-this.long0,this.over),e=this.y0-this.a*this.k0*Math.log(n)}return t.x=s,t.y=e,t}function ka(t){var i=t.x-this.x0,a=t.y-this.y0,s,e;if(this.sphere)e=v-2*Math.atan(Math.exp(-a/(this.a*this.k0)));else{var r=Math.exp(-a/(this.a*this.k0));if(e=Gt(this.e,r),e===-9999)return null}return s=y(this.long0+i/(this.a*this.k0),this.over),t.x=s,t.y=e,t}var $a=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const Fa={init:qa,forward:Ua,inverse:ka,names:$a};function Da(){}function wi(t){return t}var Bi=["longlat","identity"];const ja={init:Da,forward:wi,inverse:wi,names:Bi};var Ba=[Fa,ja],tt={},nt=[];function zi(t,i){var a=nt.length;return t.names?(nt[a]=t,t.names.forEach(function(s){tt[s.toLowerCase()]=a}),this):(console.log(i),!0)}function Wi(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function za(t){if(!t)return!1;var i=t.toLowerCase();if(typeof tt[i]<"u"&&nt[tt[i]]||(i=Wi(i),i in tt&&nt[tt[i]]))return nt[tt[i]]}function Wa(){Ba.forEach(zi)}const Ha={start:Wa,add:zi,get:za};var Hi={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const Qa=Hi.WGS84;function Xa(t,i,a,s){var e=t*t,r=i*i,n=(e-r)/e,h=0;s?(t*=1-n*(ca+n*(_a+n*ua)),e=t*t,n=0):h=Math.sqrt(n);var o=(e-r)/r;return{es:n,e:h,ep2:o}}function Ka(t,i,a,s,e){if(!t){var r=V(Hi,s);r||(r=Qa),t=r.a,i=r.b,a=r.rf}return a&&!i&&(i=(1-1/a)*t),(a===0||Math.abs(t-i)<m)&&(e=!0,i=t),{a:t,b:i,rf:a,sphere:e}}var Lt={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var Ja in Lt){var Kt=Lt[Ja];Kt.datumName&&(Lt[Kt.datumName]=Kt)}function Va(t,i,a,s,e,r,n){var h={};return t===void 0||t==="none"?h.datum_type=Zt:h.datum_type=la,i&&(h.datum_params=i.map(parseFloat),(h.datum_params[0]!==0||h.datum_params[1]!==0||h.datum_params[2]!==0)&&(h.datum_type=it),h.datum_params.length>3&&(h.datum_params[3]!==0||h.datum_params[4]!==0||h.datum_params[5]!==0||h.datum_params[6]!==0)&&(h.datum_type=at,h.datum_params[3]*=mt,h.datum_params[4]*=mt,h.datum_params[5]*=mt,h.datum_params[6]=h.datum_params[6]/1e6+1)),n&&(h.datum_type=ft,h.grids=n),h.a=a,h.b=s,h.es=e,h.ep2=r,h}var hi={};function Za(t,i,a){return i instanceof ArrayBuffer?Ya(t,i,a):{ready:ts(t,i)}}function Ya(t,i,a){var s=!0;a!==void 0&&a.includeErrorFields===!1&&(s=!1);var e=new DataView(i),r=ss(e),n=es(e,r),h=rs(e,n,r,s),o={header:n,subgrids:h};return hi[t]=o,o}async function ts(t,i){for(var a=[],s=await i.getImageCount(),e=s-1;e>=0;e--){var r=await i.getImage(e),n=await r.readRasters(),h=n,o=[r.getWidth(),r.getHeight()],l=r.getBoundingBox().map(Pi),_=[r.fileDirectory.ModelPixelScale[0],r.fileDirectory.ModelPixelScale[1]].map(Pi),c=l[0]+(o[0]-1)*_[0],f=l[3]-(o[1]-1)*_[1],u=h[0],M=h[1],g=[];for(let S=o[1]-1;S>=0;S--)for(let w=o[0]-1;w>=0;w--){var d=S*o[0]+w;g.push([-K(M[d]),K(u[d])])}a.push({del:_,lim:o,ll:[-c,f],cvs:g})}var E={header:{nSubgrids:s},subgrids:a};return hi[t]=E,E}function is(t){if(t===void 0)return null;var i=t.split(",");return i.map(as)}function as(t){if(t.length===0)return null;var i=t[0]==="@";return i&&(t=t.slice(1)),t==="null"?{name:"null",mandatory:!i,grid:null,isNull:!0}:{name:t,mandatory:!i,grid:hi[t]||null,isNull:!1}}function Pi(t){return t*Math.PI/180}function K(t){return t/3600*Math.PI/180}function ss(t){var i=t.getInt32(8,!1);return i===11?!1:(i=t.getInt32(8,!0),i!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function es(t,i){return{nFields:t.getInt32(8,i),nSubgridFields:t.getInt32(24,i),nSubgrids:t.getInt32(40,i),shiftType:ti(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,i),fromSemiMinorAxis:t.getFloat64(136,i),toSemiMajorAxis:t.getFloat64(152,i),toSemiMinorAxis:t.getFloat64(168,i)}}function ti(t,i,a){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(i,a)))}function rs(t,i,a,s){for(var e=176,r=[],n=0;n<i.nSubgrids;n++){var h=ns(t,e,a),o=os(t,e,h,a,s),l=Math.round(1+(h.upperLongitude-h.lowerLongitude)/h.longitudeInterval),_=Math.round(1+(h.upperLatitude-h.lowerLatitude)/h.latitudeInterval);r.push({ll:[K(h.lowerLongitude),K(h.lowerLatitude)],del:[K(h.longitudeInterval),K(h.latitudeInterval)],lim:[l,_],count:h.gridNodeCount,cvs:hs(o)});var c=16;s===!1&&(c=8),e+=176+h.gridNodeCount*c}return r}function hs(t){return t.map(function(i){return[K(i.longitudeShift),K(i.latitudeShift)]})}function ns(t,i,a){return{name:ti(t,i+8,i+16).trim(),parent:ti(t,i+24,i+24+8).trim(),lowerLatitude:t.getFloat64(i+72,a),upperLatitude:t.getFloat64(i+88,a),lowerLongitude:t.getFloat64(i+104,a),upperLongitude:t.getFloat64(i+120,a),latitudeInterval:t.getFloat64(i+136,a),longitudeInterval:t.getFloat64(i+152,a),gridNodeCount:t.getInt32(i+168,a)}}function os(t,i,a,s,e){var r=i+176,n=16;e===!1&&(n=8);for(var h=[],o=0;o<a.gridNodeCount;o++){var l={latitudeShift:t.getFloat32(r+o*n,s),longitudeShift:t.getFloat32(r+o*n+4,s)};e!==!1&&(l.latitudeAccuracy=t.getFloat32(r+o*n+8,s),l.longitudeAccuracy=t.getFloat32(r+o*n+12,s)),h.push(l)}return h}function B(t,i){if(!(this instanceof B))return new B(t);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,i=i||function(l){if(l)throw l};var a=La(t);if(typeof a!="object"){i("Could not parse to valid json: "+t);return}var s=B.projections.get(a.projName);if(!s){i("Could not get projection name from: "+t);return}if(a.datumCode&&a.datumCode!=="none"){var e=V(Lt,a.datumCode);e&&(a.datum_params=a.datum_params||(e.towgs84?e.towgs84.split(","):null),a.ellps=e.ellipse,a.datumName=e.datumName?e.datumName:a.datumCode)}a.k0=a.k0||1,a.axis=a.axis||"enu",a.ellps=a.ellps||"wgs84",a.lat1=a.lat1||a.lat0;var r=Ka(a.a,a.b,a.rf,a.ellps,a.sphere),n=Xa(r.a,r.b,r.rf,a.R_A),h=is(a.nadgrids),o=a.datum||Va(a.datumCode,a.datum_params,r.a,r.b,n.es,n.ep2,h);Si(this,a),Si(this,s),this.a=r.a,this.b=r.b,this.rf=r.rf,this.sphere=r.sphere,this.es=n.es,this.e=n.e,this.ep2=n.ep2,this.datum=o,"init"in this&&typeof this.init=="function"&&this.init(),i(null,this)}B.projections=Ha;B.projections.start();function ls(t,i){return t.datum_type!==i.datum_type||t.a!==i.a||Math.abs(t.es-i.es)>5e-11?!1:t.datum_type===it?t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]:t.datum_type===at?t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]&&t.datum_params[3]===i.datum_params[3]&&t.datum_params[4]===i.datum_params[4]&&t.datum_params[5]===i.datum_params[5]&&t.datum_params[6]===i.datum_params[6]:!0}function Qi(t,i,a){var s=t.x,e=t.y,r=t.z?t.z:0,n,h,o,l;if(e<-v&&e>-1.001*v)e=-v;else if(e>v&&e<1.001*v)e=v;else{if(e<-v)return{x:-1/0,y:-1/0,z:t.z};if(e>v)return{x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),h=Math.sin(e),l=Math.cos(e),o=h*h,n=a/Math.sqrt(1-i*o),{x:(n+r)*l*Math.cos(s),y:(n+r)*l*Math.sin(s),z:(n*(1-i)+r)*h}}function Xi(t,i,a,s){var e=1e-12,r=e*e,n=30,h,o,l,_,c,f,u,M,g,d,E,S,w,x=t.x,P=t.y,G=t.z?t.z:0,N,p,O;if(h=Math.sqrt(x*x+P*P),o=Math.sqrt(x*x+P*P+G*G),h/a<e){if(N=0,o/a<e)return p=v,O=-s,{x:t.x,y:t.y,z:t.z}}else N=Math.atan2(P,x);l=G/o,_=h/o,c=1/Math.sqrt(1-i*(2-i)*_*_),M=_*(1-i)*c,g=l*c,w=0;do w++,u=a/Math.sqrt(1-i*g*g),O=h*M+G*g-u*(1-i*g*g),f=i*u/(u+O),c=1/Math.sqrt(1-f*(2-f)*_*_),d=_*(1-f)*c,E=l*c,S=E*M-d*g,M=d,g=E;while(S*S>r&&w<n);return p=Math.atan(E/Math.abs(d)),{x:N,y:p,z:O}}function fs(t,i,a){if(i===it)return{x:t.x+a[0],y:t.y+a[1],z:t.z+a[2]};if(i===at){var s=a[0],e=a[1],r=a[2],n=a[3],h=a[4],o=a[5],l=a[6];return{x:l*(t.x-o*t.y+h*t.z)+s,y:l*(o*t.x+t.y-n*t.z)+e,z:l*(-h*t.x+n*t.y+t.z)+r}}}function cs(t,i,a){if(i===it)return{x:t.x-a[0],y:t.y-a[1],z:t.z-a[2]};if(i===at){var s=a[0],e=a[1],r=a[2],n=a[3],h=a[4],o=a[5],l=a[6],_=(t.x-s)/l,c=(t.y-e)/l,f=(t.z-r)/l;return{x:_+o*c-h*f,y:-o*_+c+n*f,z:h*_-n*c+f}}}function Ot(t){return t===it||t===at}function _s(t,i,a){if(ls(t,i)||t.datum_type===Zt||i.datum_type===Zt)return a;var s=t.a,e=t.es;if(t.datum_type===ft){var r=xi(t,!1,a);if(r!==0)return;s=vi,e=gi}var n=i.a,h=i.b,o=i.es;if(i.datum_type===ft&&(n=vi,h=fa,o=gi),e===o&&s===n&&!Ot(t.datum_type)&&!Ot(i.datum_type))return a;if(a=Qi(a,e,s),Ot(t.datum_type)&&(a=fs(a,t.datum_type,t.datum_params)),Ot(i.datum_type)&&(a=cs(a,i.datum_type,i.datum_params)),a=Xi(a,o,n,h),i.datum_type===ft){var l=xi(i,!0,a);if(l!==0)return}return a}function xi(t,i,a){if(t.grids===null||t.grids.length===0)return console.log("Grid shift grids not found"),-1;var s={x:-a.x,y:a.y},e={x:Number.NaN,y:Number.NaN},r=[];t:for(var n=0;n<t.grids.length;n++){var h=t.grids[n];if(r.push(h.name),h.isNull){e=s;break}if(h.grid===null){if(h.mandatory)return console.log("Unable to find mandatory grid '"+h.name+"'"),-1;continue}for(var o=h.grid.subgrids,l=0,_=o.length;l<_;l++){var c=o[l],f=(Math.abs(c.del[1])+Math.abs(c.del[0]))/1e4,u=c.ll[0]-f,M=c.ll[1]-f,g=c.ll[0]+(c.lim[0]-1)*c.del[0]+f,d=c.ll[1]+(c.lim[1]-1)*c.del[1]+f;if(!(M>s.y||u>s.x||d<s.y||g<s.x)&&(e=us(s,i,c),!isNaN(e.x)))break t}}return isNaN(e.x)?(console.log("Failed to find a grid shift table for location '"+-s.x*$+" "+s.y*$+" tried: '"+r+"'"),-1):(a.x=-e.x,a.y=e.y,0)}function us(t,i,a){var s={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return s;var e={x:t.x,y:t.y};e.x-=a.ll[0],e.y-=a.ll[1],e.x=y(e.x-Math.PI)+Math.PI;var r=Gi(e,a);if(i){if(isNaN(r.x))return s;r.x=e.x-r.x,r.y=e.y-r.y;var n=9,h=1e-12,o,l;do{if(l=Gi(r,a),isNaN(l.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}o={x:e.x-(l.x+r.x),y:e.y-(l.y+r.y)},r.x+=o.x,r.y+=o.y}while(n--&&Math.abs(o.x)>h&&Math.abs(o.y)>h);if(n<0)return console.log("Inverse grid shift iterator failed to converge."),s;s.x=y(r.x+a.ll[0]),s.y=r.y+a.ll[1]}else isNaN(r.x)||(s.x=t.x+r.x,s.y=t.y+r.y);return s}function Gi(t,i){var a={x:t.x/i.del[0],y:t.y/i.del[1]},s={x:Math.floor(a.x),y:Math.floor(a.y)},e={x:a.x-1*s.x,y:a.y-1*s.y},r={x:Number.NaN,y:Number.NaN},n;if(s.x<0||s.x>=i.lim[0]||s.y<0||s.y>=i.lim[1])return r;n=s.y*i.lim[0]+s.x;var h={x:i.cvs[n][0],y:i.cvs[n][1]};n++;var o={x:i.cvs[n][0],y:i.cvs[n][1]};n+=i.lim[0];var l={x:i.cvs[n][0],y:i.cvs[n][1]};n--;var _={x:i.cvs[n][0],y:i.cvs[n][1]},c=e.x*e.y,f=e.x*(1-e.y),u=(1-e.x)*(1-e.y),M=(1-e.x)*e.y;return r.x=u*h.x+f*o.x+M*_.x+c*l.x,r.y=u*h.y+f*o.y+M*_.y+c*l.y,r}function bi(t,i,a){var s=a.x,e=a.y,r=a.z||0,n,h,o,l={};for(o=0;o<3;o++)if(!(i&&o===2&&a.z===void 0))switch(o===0?(n=s,"ew".indexOf(t.axis[o])!==-1?h="x":h="y"):o===1?(n=e,"ns".indexOf(t.axis[o])!==-1?h="y":h="x"):(n=r,h="z"),t.axis[o]){case"e":l[h]=n;break;case"w":l[h]=-n;break;case"n":l[h]=n;break;case"s":l[h]=-n;break;case"u":a[h]!==void 0&&(l.z=n);break;case"d":a[h]!==void 0&&(l.z=-n);break;default:return null}return l}function Ki(t){var i={x:t[0],y:t[1]};return t.length>2&&(i.z=t[2]),t.length>3&&(i.m=t[3]),i}function Ms(t){Ai(t.x),Ai(t.y)}function Ai(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 vs(t,i){return(t.datum.datum_type===it||t.datum.datum_type===at||t.datum.datum_type===ft)&&i.datumCode!=="WGS84"||(i.datum.datum_type===it||i.datum.datum_type===at||i.datum.datum_type===ft)&&t.datumCode!=="WGS84"}function jt(t,i,a,s){var e;Array.isArray(a)?a=Ki(a):a={x:a.x,y:a.y,z:a.z,m:a.m};var r=a.z!==void 0;if(Ms(a),t.datum&&i.datum&&vs(t,i)&&(e=new B("WGS84"),a=jt(t,e,a,s),t=e),s&&t.axis!=="enu"&&(a=bi(t,!1,a)),t.projName==="longlat")a={x:a.x*C,y:a.y*C,z:a.z||0};else if(t.to_meter&&(a={x:a.x*t.to_meter,y:a.y*t.to_meter,z:a.z||0}),a=t.inverse(a),!a)return;if(t.from_greenwich&&(a.x+=t.from_greenwich),a=_s(t.datum,i.datum,a),!!a)return a=a,i.from_greenwich&&(a={x:a.x-i.from_greenwich,y:a.y,z:a.z||0}),i.projName==="longlat"?a={x:a.x*$,y:a.y*$,z:a.z||0}:(a=i.forward(a),i.to_meter&&(a={x:a.x/i.to_meter,y:a.y/i.to_meter,z:a.z||0})),s&&i.axis!=="enu"?bi(i,!0,a):(a&&!r&&delete a.z,a)}var Ni=B("WGS84");function Jt(t,i,a,s){var e,r,n;return Array.isArray(a)?(e=jt(t,i,a,s)||{x:NaN,y:NaN},a.length>2?typeof t.name<"u"&&t.name==="geocent"||typeof i.name<"u"&&i.name==="geocent"?typeof e.z=="number"?[e.x,e.y,e.z].concat(a.slice(3)):[e.x,e.y,a[2]].concat(a.slice(3)):[e.x,e.y].concat(a.slice(2)):[e.x,e.y]):(r=jt(t,i,a,s),n=Object.keys(a),n.length===2||n.forEach(function(h){if(typeof t.name<"u"&&t.name==="geocent"||typeof i.name<"u"&&i.name==="geocent"){if(h==="x"||h==="y"||h==="z")return}else if(h==="x"||h==="y")return;r[h]=a[h]}),r)}function Tt(t){return t instanceof B?t:typeof t=="object"&&"oProj"in t?t.oProj:B(t)}function gs(t,i,a){var s,e,r=!1,n;return typeof i>"u"?(e=Tt(t),s=Ni,r=!0):(typeof i.x<"u"||Array.isArray(i))&&(a=i,e=Tt(t),s=Ni,r=!0),s||(s=Tt(t)),e||(e=Tt(i)),a?Jt(s,e,a):(n={forward:function(h,o){return Jt(s,e,h,o)},inverse:function(h,o){return Jt(e,s,h,o)}},r&&(n.oProj=e),n)}var Ii=6,Ji="AJSAJS",Vi="AFAFAF",ot=65,U=73,j=79,vt=86,gt=90;const ds={forward:Zi,inverse:ms,toPoint:Yi};function Zi(t,i){return i=i||5,Ss(ys({lat:t[1],lon:t[0]}),i)}function ms(t){var i=ni(ia(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat,i.lon,i.lat]:[i.left,i.bottom,i.right,i.top]}function Yi(t){var i=ni(ia(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat]:[(i.left+i.right)/2,(i.top+i.bottom)/2]}function Vt(t){return t*(Math.PI/180)}function Ci(t){return 180*(t/Math.PI)}function ys(t){var i=t.lat,a=t.lon,s=6378137,e=.00669438,r=.9996,n,h,o,l,_,c,f,u=Vt(i),M=Vt(a),g,d;d=Math.floor((a+180)/6)+1,a===180&&(d=60),i>=56&&i<64&&a>=3&&a<12&&(d=32),i>=72&&i<84&&(a>=0&&a<9?d=31:a>=9&&a<21?d=33:a>=21&&a<33?d=35:a>=33&&a<42&&(d=37)),n=(d-1)*6-180+3,g=Vt(n),h=e/(1-e),o=s/Math.sqrt(1-e*Math.sin(u)*Math.sin(u)),l=Math.tan(u)*Math.tan(u),_=h*Math.cos(u)*Math.cos(u),c=Math.cos(u)*(M-g),f=s*((1-e/4-3*e*e/64-5*e*e*e/256)*u-(3*e/8+3*e*e/32+45*e*e*e/1024)*Math.sin(2*u)+(15*e*e/256+45*e*e*e/1024)*Math.sin(4*u)-35*e*e*e/3072*Math.sin(6*u));var E=r*o*(c+(1-l+_)*c*c*c/6+(5-18*l+l*l+72*_-58*h)*c*c*c*c*c/120)+5e5,S=r*(f+o*Math.tan(u)*(c*c/2+(5-l+9*_+4*_*_)*c*c*c*c/24+(61-58*l+l*l+600*_-330*h)*c*c*c*c*c*c/720));return i<0&&(S+=1e7),{northing:Math.round(S),easting:Math.round(E),zoneNumber:d,zoneLetter:Es(i)}}function ni(t){var i=t.northing,a=t.easting,s=t.zoneLetter,e=t.zoneNumber;if(e<0||e>60)return null;var r=.9996,n=6378137,h=.00669438,o,l=(1-Math.sqrt(1-h))/(1+Math.sqrt(1-h)),_,c,f,u,M,g,d,E,S,w=a-5e5,x=i;s<"N"&&(x-=1e7),d=(e-1)*6-180+3,o=h/(1-h),g=x/r,E=g/(n*(1-h/4-3*h*h/64-5*h*h*h/256)),S=E+(3*l/2-27*l*l*l/32)*Math.sin(2*E)+(21*l*l/16-55*l*l*l*l/32)*Math.sin(4*E)+151*l*l*l/96*Math.sin(6*E),_=n/Math.sqrt(1-h*Math.sin(S)*Math.sin(S)),c=Math.tan(S)*Math.tan(S),f=o*Math.cos(S)*Math.cos(S),u=n*(1-h)/Math.pow(1-h*Math.sin(S)*Math.sin(S),1.5),M=w/(_*r);var P=S-_*Math.tan(S)/u*(M*M/2-(5+3*c+10*f-4*f*f-9*o)*M*M*M*M/24+(61+90*c+298*f+45*c*c-252*o-3*f*f)*M*M*M*M*M*M/720);P=Ci(P);var G=(M-(1+2*c+f)*M*M*M/6+(5-2*f+28*c-3*f*f+8*o+24*c*c)*M*M*M*M*M/120)/Math.cos(S);G=d+Ci(G);var N;if(t.accuracy){var p=ni({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});N={top:p.lat,right:p.lon,bottom:P,left:G}}else N={lat:P,lon:G};return N}function Es(t){var i="Z";return 84>=t&&t>=72?i="X":72>t&&t>=64?i="W":64>t&&t>=56?i="V":56>t&&t>=48?i="U":48>t&&t>=40?i="T":40>t&&t>=32?i="S":32>t&&t>=24?i="R":24>t&&t>=16?i="Q":16>t&&t>=8?i="P":8>t&&t>=0?i="N":0>t&&t>=-8?i="M":-8>t&&t>=-16?i="L":-16>t&&t>=-24?i="K":-24>t&&t>=-32?i="J":-32>t&&t>=-40?i="H":-40>t&&t>=-48?i="G":-48>t&&t>=-56?i="F":-56>t&&t>=-64?i="E":-64>t&&t>=-72?i="D":-72>t&&t>=-80&&(i="C"),i}function Ss(t,i){var a="00000"+t.easting,s="00000"+t.northing;return t.zoneNumber+t.zoneLetter+ws(t.easting,t.northing,t.zoneNumber)+a.substr(a.length-5,i)+s.substr(s.length-5,i)}function ws(t,i,a){var s=ta(a),e=Math.floor(t/1e5),r=Math.floor(i/1e5)%20;return Ps(e,r,s)}function ta(t){var i=t%Ii;return i===0&&(i=Ii),i}function Ps(t,i,a){var s=a-1,e=Ji.charCodeAt(s),r=Vi.charCodeAt(s),n=e+t-1,h=r+i,o=!1;n>gt&&(n=n-gt+ot-1,o=!0),(n===U||e<U&&n>U||(n>U||e<U)&&o)&&n++,(n===j||e<j&&n>j||(n>j||e<j)&&o)&&(n++,n===U&&n++),n>gt&&(n=n-gt+ot-1),h>vt?(h=h-vt+ot-1,o=!0):o=!1,(h===U||r<U&&h>U||(h>U||r<U)&&o)&&h++,(h===j||r<j&&h>j||(h>j||r<j)&&o)&&(h++,h===U&&h++),h>vt&&(h=h-vt+ot-1);var l=String.fromCharCode(n)+String.fromCharCode(h);return l}function ia(t){if(t&&t.length===0)throw"MGRSPoint coverting from nothing";for(var i=t.length,a=null,s="",e,r=0;!/[A-Z]/.test(e=t.charAt(r));){if(r>=2)throw"MGRSPoint bad conversion from: "+t;s+=e,r++}var n=parseInt(s,10);if(r===0||r+3>i)throw"MGRSPoint bad conversion from: "+t;var h=t.charAt(r++);if(h<="A"||h==="B"||h==="Y"||h>="Z"||h==="I"||h==="O")throw"MGRSPoint zone letter "+h+" not handled: "+t;a=t.substring(r,r+=2);for(var o=ta(n),l=xs(a.charAt(0),o),_=Gs(a.charAt(1),o);_<bs(h);)_+=2e6;var c=i-r;if(c%2!==0)throw`MGRSPoint has to have an even number
2
+ of digits after the zone letter and two 100km letters - front
3
+ half for easting meters, second half for
4
+ northing meters`+t;var f=c/2,u=0,M=0,g,d,E,S,w;return f>0&&(g=1e5/Math.pow(10,f),d=t.substring(r,r+f),u=parseFloat(d)*g,E=t.substring(r+f),M=parseFloat(E)*g),S=u+l,w=M+_,{easting:S,northing:w,zoneLetter:h,zoneNumber:n,accuracy:g}}function xs(t,i){for(var a=Ji.charCodeAt(i-1),s=1e5,e=!1;a!==t.charCodeAt(0);){if(a++,a===U&&a++,a===j&&a++,a>gt){if(e)throw"Bad character: "+t;a=ot,e=!0}s+=1e5}return s}function Gs(t,i){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var a=Vi.charCodeAt(i-1),s=0,e=!1;a!==t.charCodeAt(0);){if(a++,a===U&&a++,a===j&&a++,a>vt){if(e)throw"Bad character: "+t;a=ot,e=!0}s+=1e5}return s}function bs(t){var i;switch(t){case"C":i=11e5;break;case"D":i=2e6;break;case"E":i=28e5;break;case"F":i=37e5;break;case"G":i=46e5;break;case"H":i=55e5;break;case"J":i=64e5;break;case"K":i=73e5;break;case"L":i=82e5;break;case"M":i=91e5;break;case"N":i=0;break;case"P":i=8e5;break;case"Q":i=17e5;break;case"R":i=26e5;break;case"S":i=35e5;break;case"T":i=44e5;break;case"U":i=53e5;break;case"V":i=62e5;break;case"W":i=7e6;break;case"X":i=79e5;break;default:i=-1}if(i>=0)return i;throw"Invalid zone letter: "+t}function _t(t,i,a){if(!(this instanceof _t))return new _t(t,i,a);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 i>"u"){var s=t.split(",");this.x=parseFloat(s[0]),this.y=parseFloat(s[1]),this.z=parseFloat(s[2])||0}else this.x=t,this.y=i,this.z=a||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}_t.fromMGRS=function(t){return new _t(Yi(t))};_t.prototype.toMGRS=function(t){return Zi([this.x,this.y],t)};var As=1,Ns=.25,Ri=.046875,Oi=.01953125,Ti=.01068115234375,Is=.75,Cs=.46875,Rs=.013020833333333334,Os=.007120768229166667,Ts=.3645833333333333,ps=.005696614583333333,Ls=.3076171875;function oi(t){var i=[];i[0]=As-t*(Ns+t*(Ri+t*(Oi+t*Ti))),i[1]=t*(Is-t*(Ri+t*(Oi+t*Ti)));var a=t*t;return i[2]=a*(Cs-t*(Rs+t*Os)),a*=t,i[3]=a*(Ts-t*ps),i[4]=a*t*Ls,i}function ut(t,i,a,s){return a*=i,i*=i,s[0]*t-a*(s[1]+i*(s[2]+i*(s[3]+i*s[4])))}var qs=20;function li(t,i,a){for(var s=1/(1-i),e=t,r=qs;r;--r){var n=Math.sin(e),h=1-i*n*n;if(h=(ut(e,n,Math.cos(e),a)-t)*(h*Math.sqrt(h))*s,e-=h,Math.abs(h)<m)return e}return e}function Us(){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=oi(this.es),this.ml0=ut(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function ks(t){var i=t.x,a=t.y,s=y(i-this.long0,this.over),e,r,n,h=Math.sin(a),o=Math.cos(a);if(this.es){var _=o*s,c=Math.pow(_,2),f=this.ep2*Math.pow(o,2),u=Math.pow(f,2),M=Math.abs(o)>m?Math.tan(a):0,g=Math.pow(M,2),d=Math.pow(g,2);e=1-this.es*Math.pow(h,2),_=_/Math.sqrt(e);var E=ut(a,h,o,this.en);r=this.a*(this.k0*_*(1+c/6*(1-g+f+c/20*(5-18*g+d+14*f-58*g*f+c/42*(61+179*d-d*g-479*g)))))+this.x0,n=this.a*(this.k0*(E-this.ml0+h*s*_/2*(1+c/12*(5-g+9*f+4*u+c/30*(61+d-58*g+270*f-330*g*f+c/56*(1385+543*d-d*g-3111*g))))))+this.y0}else{var l=o*Math.sin(s);if(Math.abs(Math.abs(l)-1)<m)return 93;if(r=.5*this.a*this.k0*Math.log((1+l)/(1-l))+this.x0,n=o*Math.cos(s)/Math.sqrt(1-Math.pow(l,2)),l=Math.abs(n),l>=1){if(l-1>m)return 93;n=0}else n=Math.acos(n);a<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return t.x=r,t.y=n,t}function $s(t){var i,a,s,e,r=(t.x-this.x0)*(1/this.a),n=(t.y-this.y0)*(1/this.a);if(this.es)if(i=this.ml0+n/this.k0,a=li(i,this.es,this.en),Math.abs(a)<v){var c=Math.sin(a),f=Math.cos(a),u=Math.abs(f)>m?Math.tan(a):0,M=this.ep2*Math.pow(f,2),g=Math.pow(M,2),d=Math.pow(u,2),E=Math.pow(d,2);i=1-this.es*Math.pow(c,2);var S=r*Math.sqrt(i)/this.k0,w=Math.pow(S,2);i=i*u,s=a-i*w/(1-this.es)*.5*(1-w/12*(5+3*d-9*M*d+M-4*g-w/30*(61+90*d-252*M*d+45*E+46*M-w/56*(1385+3633*d+4095*E+1574*E*d)))),e=y(this.long0+S*(1-w/6*(1+2*d+M-w/20*(5+28*d+24*E+8*M*d+6*M-w/42*(61+662*d+1320*E+720*E*d))))/f,this.over)}else s=v*At(n),e=0;else{var h=Math.exp(r/this.k0),o=.5*(h-1/h),l=this.lat0+n/this.k0,_=Math.cos(l);i=Math.sqrt((1-Math.pow(_,2))/(1+Math.pow(o,2))),s=Math.asin(i),n<0&&(s=-s),o===0&&_===0?e=0:e=y(Math.atan2(o,_)+this.long0,this.over)}return t.x=e,t.y=s,t}var Fs=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const qt={init:Us,forward:ks,inverse:$s,names:Fs};function aa(t){var i=Math.exp(t);return i=(i-1/i)/2,i}function k(t,i){t=Math.abs(t),i=Math.abs(i);var a=Math.max(t,i),s=Math.min(t,i)/(a||1);return a*Math.sqrt(1+Math.pow(s,2))}function Ds(t){var i=1+t,a=i-1;return a===0?t:t*Math.log(i)/a}function js(t){var i=Math.abs(t);return i=Ds(i*(1+i/(k(1,i)+1))),t<0?-i:i}function fi(t,i){for(var a=2*Math.cos(2*i),s=t.length-1,e=t[s],r=0,n;--s>=0;)n=-r+a*e+t[s],r=e,e=n;return i+n*Math.sin(2*i)}function Bs(t,i){for(var a=2*Math.cos(i),s=t.length-1,e=t[s],r=0,n;--s>=0;)n=-r+a*e+t[s],r=e,e=n;return Math.sin(i)*n}function zs(t){var i=Math.exp(t);return i=(i+1/i)/2,i}function sa(t,i,a){for(var s=Math.sin(i),e=Math.cos(i),r=aa(a),n=zs(a),h=2*e*n,o=-2*s*r,l=t.length-1,_=t[l],c=0,f=0,u=0,M,g;--l>=0;)M=f,g=c,f=_,c=u,_=-M+h*f-o*c+t[l],u=-g+o*f+h*c;return h=s*n,o=e*r,[h*_-o*u,h*u+o*_]}function Ws(){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&&(qt.init.apply(this),this.forward=qt.forward,this.inverse=qt.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)),i=t/(2-t),a=i;this.cgb[0]=i*(2+i*(-2/3+i*(-2+i*(116/45+i*(26/45+i*(-2854/675)))))),this.cbg[0]=i*(-2+i*(2/3+i*(4/3+i*(-82/45+i*(32/45+i*(4642/4725)))))),a=a*i,this.cgb[1]=a*(7/3+i*(-8/5+i*(-227/45+i*(2704/315+i*(2323/945))))),this.cbg[1]=a*(5/3+i*(-16/15+i*(-13/9+i*(904/315+i*(-1522/945))))),a=a*i,this.cgb[2]=a*(56/15+i*(-136/35+i*(-1262/105+i*(73814/2835)))),this.cbg[2]=a*(-26/15+i*(34/21+i*(8/5+i*(-12686/2835)))),a=a*i,this.cgb[3]=a*(4279/630+i*(-332/35+i*(-399572/14175))),this.cbg[3]=a*(1237/630+i*(-12/5+i*(-24832/14175))),a=a*i,this.cgb[4]=a*(4174/315+i*(-144838/6237)),this.cbg[4]=a*(-734/315+i*(109598/31185)),a=a*i,this.cgb[5]=a*(601676/22275),this.cbg[5]=a*(444337/155925),a=Math.pow(i,2),this.Qn=this.k0/(1+i)*(1+a*(1/4+a*(1/64+a/256))),this.utg[0]=i*(-.5+i*(2/3+i*(-37/96+i*(1/360+i*(81/512+i*(-96199/604800)))))),this.gtu[0]=i*(.5+i*(-2/3+i*(5/16+i*(41/180+i*(-127/288+i*(7891/37800)))))),this.utg[1]=a*(-1/48+i*(-1/15+i*(437/1440+i*(-46/105+i*(1118711/3870720))))),this.gtu[1]=a*(13/48+i*(-3/5+i*(557/1440+i*(281/630+i*(-1983433/1935360))))),a=a*i,this.utg[2]=a*(-17/480+i*(37/840+i*(209/4480+i*(-5569/90720)))),this.gtu[2]=a*(61/240+i*(-103/140+i*(15061/26880+i*(167603/181440)))),a=a*i,this.utg[3]=a*(-4397/161280+i*(11/504+i*(830251/7257600))),this.gtu[3]=a*(49561/161280+i*(-179/168+i*(6601661/7257600))),a=a*i,this.utg[4]=a*(-4583/161280+i*(108847/3991680)),this.gtu[4]=a*(34729/80640+i*(-3418889/1995840)),a=a*i,this.utg[5]=a*(-20648693/638668800),this.gtu[5]=a*(212378941/319334400);var s=fi(this.cbg,this.lat0);this.Zb=-this.Qn*(s+Bs(this.gtu,2*s))}function Hs(t){var i=y(t.x-this.long0,this.over),a=t.y;a=fi(this.cbg,a);var s=Math.sin(a),e=Math.cos(a),r=Math.sin(i),n=Math.cos(i);a=Math.atan2(s,n*e),i=Math.atan2(r*e,k(s,e*n)),i=js(Math.tan(i));var h=sa(this.gtu,2*a,2*i);a=a+h[0],i=i+h[1];var o,l;return Math.abs(i)<=2.623395162778?(o=this.a*(this.Qn*i)+this.x0,l=this.a*(this.Qn*a+this.Zb)+this.y0):(o=1/0,l=1/0),t.x=o,t.y=l,t}function Qs(t){var i=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);a=(a-this.Zb)/this.Qn,i=i/this.Qn;var s,e;if(Math.abs(i)<=2.623395162778){var r=sa(this.utg,2*a,2*i);a=a+r[0],i=i+r[1],i=Math.atan(aa(i));var n=Math.sin(a),h=Math.cos(a),o=Math.sin(i),l=Math.cos(i);a=Math.atan2(n*l,k(o,l*h)),i=Math.atan2(o,l*h),s=y(i+this.long0,this.over),e=fi(this.cgb,a)}else s=1/0,e=1/0;return t.x=s,t.y=e,t}var Xs=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Ut={init:Ws,forward:Hs,inverse:Qs,names:Xs};function Ks(t,i){if(t===void 0){if(t=Math.floor((y(i)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var Js="etmerc";function Vs(){var t=Ks(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*C,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Ut.init.apply(this),this.forward=Ut.forward,this.inverse=Ut.inverse}var Zs=["Universal Transverse Mercator System","utm"];const Ys={init:Vs,names:Zs,dependsOn:Js};function ci(t,i){return Math.pow((1-t)/(1+t),i)}var te=20;function ie(){var t=Math.sin(this.lat0),i=Math.cos(this.lat0);i*=i,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*i*i/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+b)/(Math.pow(Math.tan(.5*this.lat0+b),this.C)*ci(this.e*t,this.ratexp))}function ae(t){var i=t.x,a=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*a+b),this.C)*ci(this.e*Math.sin(a),this.ratexp))-v,t.x=this.C*i,t}function se(t){for(var i=1e-14,a=t.x/this.C,s=t.y,e=Math.pow(Math.tan(.5*s+b)/this.K,1/this.C),r=te;r>0&&(s=2*Math.atan(e*ci(this.e*Math.sin(t.y),-.5*this.e))-v,!(Math.abs(s-t.y)<i));--r)t.y=s;return r?(t.x=a,t.y=s,t):null}const _i={init:ie,forward:ae,inverse:se};function ee(){_i.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 re(t){var i,a,s,e;return t.x=y(t.x-this.long0,this.over),_i.forward.apply(this,[t]),i=Math.sin(t.y),a=Math.cos(t.y),s=Math.cos(t.x),e=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*a*s),t.x=e*a*Math.sin(t.x),t.y=e*(this.cosc0*i-this.sinc0*a*s),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function he(t){var i,a,s,e,r;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,r=k(t.x,t.y)){var n=2*Math.atan2(r,this.R2);i=Math.sin(n),a=Math.cos(n),e=Math.asin(a*this.sinc0+t.y*i*this.cosc0/r),s=Math.atan2(t.x*i,r*this.cosc0*a-t.y*this.sinc0*i)}else e=this.phic0,s=0;return t.x=s,t.y=e,_i.inverse.apply(this,[t]),t.x=y(t.x+this.long0,this.over),t}var ne=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const oe={init:ee,forward:re,inverse:he,names:ne};function ui(t,i,a){return i*=a,Math.tan(.5*(v+t))*Math.pow((1-i)/(1+i),.5*a)}function le(){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)<=m&&(this.k0=.5*(1+At(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=m&&(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)<=m&&Math.abs(Math.cos(this.lat_ts))>m&&(this.k0=.5*this.cons*H(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/W(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=H(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(ui(this.lat0,this.sinlat0,this.e))-v,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function fe(t){var i=t.x,a=t.y,s=Math.sin(a),e=Math.cos(a),r,n,h,o,l,_,c=y(i-this.long0,this.over);return Math.abs(Math.abs(i-this.long0)-Math.PI)<=m&&Math.abs(a+this.lat0)<=m?(t.x=NaN,t.y=NaN,t):this.sphere?(r=2*this.k0/(1+this.sinlat0*s+this.coslat0*e*Math.cos(c)),t.x=this.a*r*e*Math.sin(c)+this.x0,t.y=this.a*r*(this.coslat0*s-this.sinlat0*e*Math.cos(c))+this.y0,t):(n=2*Math.atan(ui(a,s,this.e))-v,o=Math.cos(n),h=Math.sin(n),Math.abs(this.coslat0)<=m?(l=W(this.e,a*this.con,this.con*s),_=2*this.a*this.k0*l/this.cons,t.x=this.x0+_*Math.sin(i-this.long0),t.y=this.y0-this.con*_*Math.cos(i-this.long0),t):(Math.abs(this.sinlat0)<m?(r=2*this.a*this.k0/(1+o*Math.cos(c)),t.y=r*h):(r=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*h+this.cosX0*o*Math.cos(c))),t.y=r*(this.cosX0*h-this.sinX0*o*Math.cos(c))+this.y0),t.x=r*o*Math.sin(c)+this.x0,t))}function ce(t){t.x-=this.x0,t.y-=this.y0;var i,a,s,e,r,n=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var h=2*Math.atan(n/(2*this.a*this.k0));return i=this.long0,a=this.lat0,n<=m?(t.x=i,t.y=a,t):(a=Math.asin(Math.cos(h)*this.sinlat0+t.y*Math.sin(h)*this.coslat0/n),Math.abs(this.coslat0)<m?this.lat0>0?i=y(this.long0+Math.atan2(t.x,-1*t.y),this.over):i=y(this.long0+Math.atan2(t.x,t.y),this.over):i=y(this.long0+Math.atan2(t.x*Math.sin(h),n*this.coslat0*Math.cos(h)-t.y*this.sinlat0*Math.sin(h)),this.over),t.x=i,t.y=a,t)}else if(Math.abs(this.coslat0)<=m){if(n<=m)return a=this.lat0,i=this.long0,t.x=i,t.y=a,t;t.x*=this.con,t.y*=this.con,s=n*this.cons/(2*this.a*this.k0),a=this.con*Gt(this.e,s),i=this.con*y(this.con*this.long0+Math.atan2(t.x,-1*t.y),this.over)}else e=2*Math.atan(n*this.cosX0/(2*this.a*this.k0*this.ms1)),i=this.long0,n<=m?r=this.X0:(r=Math.asin(Math.cos(e)*this.sinX0+t.y*Math.sin(e)*this.cosX0/n),i=y(this.long0+Math.atan2(t.x*Math.sin(e),n*this.cosX0*Math.cos(e)-t.y*this.sinX0*Math.sin(e)),this.over)),a=-1*Gt(this.e,Math.tan(.5*(v+r)));return t.x=i,t.y=a,t}var _e=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const ue={init:le,forward:fe,inverse:ce,names:_e,ssfn_:ui};function Me(){var t=this.lat0;this.lambda0=this.long0;var i=Math.sin(t),a=this.a,s=this.rf,e=1/s,r=2*e-Math.pow(e,2),n=this.e=Math.sqrt(r);this.R=this.k0*a*Math.sqrt(1-r)/(1-r*Math.pow(i,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(i/this.alpha);var h=Math.log(Math.tan(Math.PI/4+this.b0/2)),o=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+n*i)/(1-n*i));this.K=h-this.alpha*o+this.alpha*n/2*l}function ve(t){var i=Math.log(Math.tan(Math.PI/4-t.y/2)),a=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),s=-this.alpha*(i+a)+this.K,e=2*(Math.atan(Math.exp(s))-Math.PI/4),r=this.alpha*(t.x-this.lambda0),n=Math.atan(Math.sin(r)/(Math.sin(this.b0)*Math.tan(e)+Math.cos(this.b0)*Math.cos(r))),h=Math.asin(Math.cos(this.b0)*Math.sin(e)-Math.sin(this.b0)*Math.cos(e)*Math.cos(r));return t.y=this.R/2*Math.log((1+Math.sin(h))/(1-Math.sin(h)))+this.y0,t.x=this.R*n+this.x0,t}function ge(t){for(var i=t.x-this.x0,a=t.y-this.y0,s=i/this.R,e=2*(Math.atan(Math.exp(a/this.R))-Math.PI/4),r=Math.asin(Math.cos(this.b0)*Math.sin(e)+Math.sin(this.b0)*Math.cos(e)*Math.cos(s)),n=Math.atan(Math.sin(s)/(Math.cos(this.b0)*Math.cos(s)-Math.sin(this.b0)*Math.tan(e))),h=this.lambda0+n/this.alpha,o=0,l=r,_=-1e3,c=0;Math.abs(l-_)>1e-7;){if(++c>20)return;o=1/this.alpha*(Math.log(Math.tan(Math.PI/4+r/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),_=l,l=2*Math.atan(Math.exp(o))-Math.PI/2}return t.x=h,t.y=l,t}var de=["somerc"];const me={init:Me,forward:ve,inverse:ge,names:de};var rt=1e-7;function ye(t){var i=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],a=typeof t.projName=="object"?Object.keys(t.projName)[0]:t.projName;return"no_uoff"in t||"no_off"in t||i.indexOf(a)!==-1||i.indexOf(Wi(a))!==-1}function Ee(){var t,i,a,s,e,r,n,h,o,l,_=0,c,f=0,u=0,M=0,g=0,d=0,E=0;this.no_off=ye(this),this.no_rot="no_rot"in this;var S=!1;"alpha"in this&&(S=!0);var w=!1;if("rectified_grid_angle"in this&&(w=!0),S&&(E=this.alpha),w&&(_=this.rectified_grid_angle),S||w)f=this.longc;else if(u=this.long1,g=this.lat1,M=this.long2,d=this.lat2,Math.abs(g-d)<=rt||(t=Math.abs(g))<=rt||Math.abs(t-v)<=rt||Math.abs(Math.abs(this.lat0)-v)<=rt||Math.abs(Math.abs(d)-v)<=rt)throw new Error;var x=1-this.es;i=Math.sqrt(x),Math.abs(this.lat0)>m?(h=Math.sin(this.lat0),a=Math.cos(this.lat0),t=1-this.es*h*h,this.B=a*a,this.B=Math.sqrt(1+this.es*this.B*this.B/x),this.A=this.B*this.k0*i/t,s=this.B*i/(a*Math.sqrt(t)),e=s*s-1,e<=0?e=0:(e=Math.sqrt(e),this.lat0<0&&(e=-e)),this.E=e+=s,this.E*=Math.pow(W(this.e,this.lat0,h),this.B)):(this.B=1/i,this.A=this.k0,this.E=s=e=1),S||w?(S?(c=Math.asin(Math.sin(E)/s),w||(_=E)):(c=_,E=Math.asin(s*Math.sin(c))),this.lam0=f-Math.asin(.5*(e-1/e)*Math.tan(c))/this.B):(r=Math.pow(W(this.e,g,Math.sin(g)),this.B),n=Math.pow(W(this.e,d,Math.sin(d)),this.B),e=this.E/r,o=(n-r)/(n+r),l=this.E*this.E,l=(l-n*r)/(l+n*r),t=u-M,t<-Math.PI?M-=Pt:t>Math.PI&&(M+=Pt),this.lam0=y(.5*(u+M)-Math.atan(l*Math.tan(.5*this.B*(u-M))/o)/this.B,this.over),c=Math.atan(2*Math.sin(this.B*y(u-this.lam0,this.over))/(e-1/e)),_=E=Math.asin(s*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(_),this.cosrot=Math.cos(_),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(s*s-1)/Math.cos(E))),this.lat0<0&&(this.u_0=-this.u_0)),e=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(b-e)),this.v_pole_s=this.ArB*Math.log(Math.tan(b+e))}function Se(t){var i={},a,s,e,r,n,h,o,l;if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-v)>m){if(n=this.E/Math.pow(W(this.e,t.y,Math.sin(t.y)),this.B),h=1/n,a=.5*(n-h),s=.5*(n+h),r=Math.sin(this.B*t.x),e=(a*this.singam-r*this.cosgam)/s,Math.abs(Math.abs(e)-1)<m)throw new Error;l=.5*this.ArB*Math.log((1-e)/(1+e)),h=Math.cos(this.B*t.x),Math.abs(h)<rt?o=this.A*t.x:o=this.ArB*Math.atan2(a*this.cosgam+r*this.singam,h)}else l=t.y>0?this.v_pole_n:this.v_pole_s,o=this.ArB*t.y;return this.no_rot?(i.x=o,i.y=l):(o-=this.u_0,i.x=l*this.cosrot+o*this.sinrot,i.y=o*this.cosrot-l*this.sinrot),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function we(t){var i,a,s,e,r,n,h,o={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(a=t.y,i=t.x):(a=t.x*this.cosrot-t.y*this.sinrot,i=t.y*this.cosrot+t.x*this.sinrot+this.u_0),s=Math.exp(-this.BrA*a),e=.5*(s-1/s),r=.5*(s+1/s),n=Math.sin(this.BrA*i),h=(n*this.cosgam+e*this.singam)/r,Math.abs(Math.abs(h)-1)<m)o.x=0,o.y=h<0?-v:v;else{if(o.y=this.E/Math.sqrt((1+h)/(1-h)),o.y=Gt(this.e,Math.pow(o.y,1/this.B)),o.y===1/0)throw new Error;o.x=-this.rB*Math.atan2(e*this.cosgam-n*this.singam,Math.cos(this.BrA*i))}return o.x+=this.lam0,o}var Pe=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const xe={init:Ee,forward:Se,inverse:we,names:Pe};function Ge(){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)<m)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var i=Math.sin(this.lat1),a=Math.cos(this.lat1),s=H(this.e,i,a),e=W(this.e,this.lat1,i),r=Math.sin(this.lat2),n=Math.cos(this.lat2),h=H(this.e,r,n),o=W(this.e,this.lat2,r),l=Math.abs(Math.abs(this.lat0)-v)<m?0:W(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>m?this.ns=Math.log(s/h)/Math.log(e/o):this.ns=i,isNaN(this.ns)&&(this.ns=i),this.f0=s/(this.ns*Math.pow(e,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function be(t){var i=t.x,a=t.y;Math.abs(2*Math.abs(a)-Math.PI)<=m&&(a=At(a)*(v-2*m));var s=Math.abs(Math.abs(a)-v),e,r;if(s>m)e=W(this.e,a,Math.sin(a)),r=this.a*this.f0*Math.pow(e,this.ns);else{if(s=a*this.ns,s<=0)return null;r=0}var n=this.ns*y(i-this.long0,this.over);return t.x=this.k0*(r*Math.sin(n))+this.x0,t.y=this.k0*(this.rh-r*Math.cos(n))+this.y0,t}function Ae(t){var i,a,s,e,r,n=(t.x-this.x0)/this.k0,h=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(i=Math.sqrt(n*n+h*h),a=1):(i=-Math.sqrt(n*n+h*h),a=-1);var o=0;if(i!==0&&(o=Math.atan2(a*n,a*h)),i!==0||this.ns>0){if(a=1/this.ns,s=Math.pow(i/(this.a*this.f0),a),e=Gt(this.e,s),e===-9999)return null}else e=-v;return r=y(o/this.ns+this.long0,this.over),t.x=r,t.y=e,t}var Ne=["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 Ie={init:Ge,forward:be,inverse:Ae,names:Ne};function Ce(){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 Re(t){var i,a,s,e,r,n,h,o=t.x,l=t.y,_=y(o-this.long0,this.over);return i=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),a=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/i)-this.s45),s=-_*this.alfa,e=Math.asin(Math.cos(this.ad)*Math.sin(a)+Math.sin(this.ad)*Math.cos(a)*Math.cos(s)),r=Math.asin(Math.cos(a)*Math.sin(s)/Math.cos(e)),n=this.n*r,h=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(e/2+this.s45),this.n),t.y=h*Math.cos(n)/1,t.x=h*Math.sin(n)/1,this.czech||(t.y*=-1,t.x*=-1),t}function Oe(t){var i,a,s,e,r,n,h,o,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),n=Math.sqrt(t.x*t.x+t.y*t.y),r=Math.atan2(t.y,t.x),e=r/Math.sin(this.s0),s=2*(Math.atan(Math.pow(this.ro0/n,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),i=Math.asin(Math.cos(this.ad)*Math.sin(s)-Math.sin(this.ad)*Math.cos(s)*Math.cos(e)),a=Math.asin(Math.cos(s)*Math.sin(e)/Math.cos(i)),t.x=this.long0-a/this.alfa,h=i,o=0;var _=0;do t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.e/2))-this.s45),Math.abs(h-t.y)<1e-10&&(o=1),h=t.y,_+=1;while(o===0&&_<15);return _>=15?null:t}var Te=["Krovak","krovak"];const pe={init:Ce,forward:Re,inverse:Oe,names:Te};function q(t,i,a,s,e){return t*e-i*Math.sin(2*e)+a*Math.sin(4*e)-s*Math.sin(6*e)}function Nt(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function It(t){return .375*t*(1+.25*t*(1+.46875*t))}function Ct(t){return .05859375*t*t*(1+.75*t)}function Rt(t){return t*t*t*(35/3072)}function Mi(t,i,a){var s=i*a;return t/Math.sqrt(1-s*s)}function Y(t){return Math.abs(t)<v?t:t-At(t)*Math.PI}function Bt(t,i,a,s,e){var r,n;r=t/i;for(var h=0;h<15;h++)if(n=(t-(i*r-a*Math.sin(2*r)+s*Math.sin(4*r)-e*Math.sin(6*r)))/(i-2*a*Math.cos(2*r)+4*s*Math.cos(4*r)-6*e*Math.cos(6*r)),r+=n,Math.abs(n)<=1e-10)return r;return NaN}function Le(){this.sphere||(this.e0=Nt(this.es),this.e1=It(this.es),this.e2=Ct(this.es),this.e3=Rt(this.es),this.ml0=this.a*q(this.e0,this.e1,this.e2,this.e3,this.lat0))}function qe(t){var i,a,s=t.x,e=t.y;if(s=y(s-this.long0,this.over),this.sphere)i=this.a*Math.asin(Math.cos(e)*Math.sin(s)),a=this.a*(Math.atan2(Math.tan(e),Math.cos(s))-this.lat0);else{var r=Math.sin(e),n=Math.cos(e),h=Mi(this.a,this.e,r),o=Math.tan(e)*Math.tan(e),l=s*Math.cos(e),_=l*l,c=this.es*n*n/(1-this.es),f=this.a*q(this.e0,this.e1,this.e2,this.e3,e);i=h*l*(1-_*o*(1/6-(8-o+8*c)*_/120)),a=f-this.ml0+h*r/n*_*(.5+(5-o+6*c)*_/24)}return t.x=i+this.x0,t.y=a+this.y0,t}function Ue(t){t.x-=this.x0,t.y-=this.y0;var i=t.x/this.a,a=t.y/this.a,s,e;if(this.sphere){var r=a+this.lat0;s=Math.asin(Math.sin(r)*Math.cos(i)),e=Math.atan2(Math.tan(i),Math.cos(r))}else{var n=this.ml0/this.a+a,h=Bt(n,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(h)-v)<=m)return t.x=this.long0,t.y=v,a<0&&(t.y*=-1),t;var o=Mi(this.a,this.e,Math.sin(h)),l=o*o*o/this.a/this.a*(1-this.es),_=Math.pow(Math.tan(h),2),c=i*this.a/o,f=c*c;s=h-o*Math.tan(h)/l*c*c*(.5-(1+3*_)*c*c/24),e=c*(1-f*(_/3+(1+3*_)*_*f/15))/Math.cos(h)}return t.x=y(e+this.long0,this.over),t.y=Y(s),t}var ke=["Cassini","Cassini_Soldner","cass"];const $e={init:Le,forward:qe,inverse:Ue,names:ke};function J(t,i){var a;return t>1e-7?(a=t*i,(1-t*t)*(i/(1-a*a)-.5/t*Math.log((1-a)/(1+a)))):2*i}var ii=1,ai=2,si=3,kt=4;function Fe(){var t=Math.abs(this.lat0);if(Math.abs(t-v)<m?this.mode=this.lat0<0?ii:ai:Math.abs(t)<m?this.mode=si:this.mode=kt,this.es>0){var i;switch(this.qp=J(this.e,1),this.mmf=.5/(1-this.es),this.apa=Ke(this.es),this.mode){case ai:this.dd=1;break;case ii:this.dd=1;break;case si:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case kt:this.rq=Math.sqrt(.5*this.qp),i=Math.sin(this.lat0),this.sinb1=J(this.e,i)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*i*i)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===kt&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function De(t){var i,a,s,e,r,n,h,o,l,_,c=t.x,f=t.y;if(c=y(c-this.long0,this.over),this.sphere){if(r=Math.sin(f),_=Math.cos(f),s=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(a=this.mode===this.EQUIT?1+_*s:1+this.sinph0*r+this.cosph0*_*s,a<=m)return null;a=Math.sqrt(2/a),i=a*_*Math.sin(c),a*=this.mode===this.EQUIT?r:this.cosph0*r-this.sinph0*_*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(f+this.lat0)<m)return null;a=b-f*.5,a=2*(this.mode===this.S_POLE?Math.cos(a):Math.sin(a)),i=a*Math.sin(c),a*=s}}else{switch(h=0,o=0,l=0,s=Math.cos(c),e=Math.sin(c),r=Math.sin(f),n=J(this.e,r),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(h=n/this.qp,o=Math.sqrt(1-h*h)),this.mode){case this.OBLIQ:l=1+this.sinb1*h+this.cosb1*o*s;break;case this.EQUIT:l=1+o*s;break;case this.N_POLE:l=v+f,n=this.qp-n;break;case this.S_POLE:l=f-v,n=this.qp+n;break}if(Math.abs(l)<m)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),this.mode===this.OBLIQ?a=this.ymf*l*(this.cosb1*h-this.sinb1*o*s):a=(l=Math.sqrt(2/(1+o*s)))*h*this.ymf,i=this.xmf*l*o*e;break;case this.N_POLE:case this.S_POLE:n>=0?(i=(l=Math.sqrt(n))*e,a=s*(this.mode===this.S_POLE?l:-l)):i=a=0;break}}return t.x=this.a*i+this.x0,t.y=this.a*a+this.y0,t}function je(t){t.x-=this.x0,t.y-=this.y0;var i=t.x/this.a,a=t.y/this.a,s,e,r,n,h,o,l;if(this.sphere){var _=0,c,f=0;if(c=Math.sqrt(i*i+a*a),e=c*.5,e>1)return null;switch(e=2*Math.asin(e),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(e),_=Math.cos(e)),this.mode){case this.EQUIT:e=Math.abs(c)<=m?0:Math.asin(a*f/c),i*=f,a=_*c;break;case this.OBLIQ:e=Math.abs(c)<=m?this.lat0:Math.asin(_*this.sinph0+a*f*this.cosph0/c),i*=f*this.cosph0,a=(_-Math.sin(e)*this.sinph0)*c;break;case this.N_POLE:a=-a,e=v-e;break;case this.S_POLE:e-=v;break}s=a===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(i,a)}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(i/=this.dd,a*=this.dd,o=Math.sqrt(i*i+a*a),o<m)return t.x=this.long0,t.y=this.lat0,t;n=2*Math.asin(.5*o/this.rq),r=Math.cos(n),i*=n=Math.sin(n),this.mode===this.OBLIQ?(l=r*this.sinb1+a*n*this.cosb1/o,h=this.qp*l,a=o*this.cosb1*r-a*this.sinb1*n):(l=a*n/o,h=this.qp*l,a=o*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(a=-a),h=i*i+a*a,!h)return t.x=this.long0,t.y=this.lat0,t;l=1-h/this.qp,this.mode===this.S_POLE&&(l=-l)}s=Math.atan2(i,a),e=Je(Math.asin(l),this.apa)}return t.x=y(this.long0+s,this.over),t.y=e,t}var Be=.3333333333333333,ze=.17222222222222222,We=.10257936507936508,He=.06388888888888888,Qe=.0664021164021164,Xe=.016415012942191543;function Ke(t){var i,a=[];return a[0]=t*Be,i=t*t,a[0]+=i*ze,a[1]=i*He,i*=t,a[0]+=i*We,a[1]+=i*Qe,a[2]=i*Xe,a}function Je(t,i){var a=t+t;return t+i[0]*Math.sin(a)+i[1]*Math.sin(a+a)+i[2]*Math.sin(a+a+a)}var Ve=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const Ze={init:Fe,forward:De,inverse:je,names:Ve,S_POLE:ii,N_POLE:ai,EQUIT:si,OBLIQ:kt};function Z(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}function Ye(){Math.abs(this.lat1+this.lat2)<m||(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=H(this.e3,this.sin_po,this.cos_po),this.qs1=J(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=H(this.e3,this.sin_po,this.cos_po),this.qs2=J(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=J(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>m?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 tr(t){var i=t.x,a=t.y;this.sin_phi=Math.sin(a),this.cos_phi=Math.cos(a);var s=J(this.e3,this.sin_phi),e=this.a*Math.sqrt(this.c-this.ns0*s)/this.ns0,r=this.ns0*y(i-this.long0,this.over),n=e*Math.sin(r)+this.x0,h=this.rh-e*Math.cos(r)+this.y0;return t.x=n,t.y=h,t}function ir(t){var i,a,s,e,r,n;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1),e=0,i!==0&&(e=Math.atan2(s*t.x,s*t.y)),s=i*this.ns0/this.a,this.sphere?n=Math.asin((this.c-s*s)/(2*this.ns0)):(a=(this.c-s*s)/this.ns0,n=this.phi1z(this.e3,a)),r=y(e/this.ns0+this.long0,this.over),t.x=r,t.y=n,t}function ar(t,i){var a,s,e,r,n,h=Z(.5*i);if(t<m)return h;for(var o=t*t,l=1;l<=25;l++)if(a=Math.sin(h),s=Math.cos(h),e=t*a,r=1-e*e,n=.5*r*r/s*(i/(1-o)-a/r+.5/t*Math.log((1-e)/(1+e))),h=h+n,Math.abs(n)<=1e-7)return h;return null}var sr=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const er={init:Ye,forward:tr,inverse:ir,names:sr,phi1z:ar};function rr(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function hr(t){var i,a,s,e,r,n,h,o,l=t.x,_=t.y;return s=y(l-this.long0,this.over),i=Math.sin(_),a=Math.cos(_),e=Math.cos(s),n=this.sin_p14*i+this.cos_p14*a*e,r=1,n>0||Math.abs(n)<=m?(h=this.x0+this.a*r*a*Math.sin(s)/n,o=this.y0+this.a*r*(this.cos_p14*i-this.sin_p14*a*e)/n):(h=this.x0+this.infinity_dist*a*Math.sin(s),o=this.y0+this.infinity_dist*(this.cos_p14*i-this.sin_p14*a*e)),t.x=h,t.y=o,t}function nr(t){var i,a,s,e,r,n;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,(i=Math.sqrt(t.x*t.x+t.y*t.y))?(e=Math.atan2(i,this.rc),a=Math.sin(e),s=Math.cos(e),n=Z(s*this.sin_p14+t.y*a*this.cos_p14/i),r=Math.atan2(t.x*a,i*this.cos_p14*s-t.y*this.sin_p14*a),r=y(this.long0+r,this.over)):(n=this.phic0,r=0),t.x=r,t.y=n,t}var or=["gnom"];const lr={init:rr,forward:hr,inverse:nr,names:or};function fr(t,i){var a=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-a)<1e-6)return i<0?-1*v:v;for(var s=Math.asin(.5*i),e,r,n,h,o=0;o<30;o++)if(r=Math.sin(s),n=Math.cos(s),h=t*r,e=Math.pow(1-h*h,2)/(2*n)*(i/(1-t*t)-r/(1-h*h)+.5/t*Math.log((1-h)/(1+h))),s+=e,Math.abs(e)<=1e-10)return s;return NaN}function cr(){this.sphere||(this.k0=H(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function _r(t){var i=t.x,a=t.y,s,e,r=y(i-this.long0,this.over);if(this.sphere)s=this.x0+this.a*r*Math.cos(this.lat_ts),e=this.y0+this.a*Math.sin(a)/Math.cos(this.lat_ts);else{var n=J(this.e,Math.sin(a));s=this.x0+this.a*this.k0*r,e=this.y0+this.a*n*.5/this.k0}return t.x=s,t.y=e,t}function ur(t){t.x-=this.x0,t.y-=this.y0;var i,a;return this.sphere?(i=y(this.long0+t.x/this.a/Math.cos(this.lat_ts),this.over),a=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(a=fr(this.e,2*t.y*this.k0/this.a),i=y(this.long0+t.x/(this.a*this.k0),this.over)),t.x=i,t.y=a,t}var Mr=["cea"];const vr={init:cr,forward:_r,inverse:ur,names:Mr};function gr(){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 dr(t){var i=t.x,a=t.y,s=y(i-this.long0,this.over),e=Y(a-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*e,t}function mr(t){var i=t.x,a=t.y;return t.x=y(this.long0+(i-this.x0)/(this.a*this.rc),this.over),t.y=Y(this.lat0+(a-this.y0)/this.a),t}var yr=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const Er={init:gr,forward:dr,inverse:mr,names:yr};var pi=20;function Sr(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Nt(this.es),this.e1=It(this.es),this.e2=Ct(this.es),this.e3=Rt(this.es),this.ml0=this.a*q(this.e0,this.e1,this.e2,this.e3,this.lat0)}function wr(t){var i=t.x,a=t.y,s,e,r,n=y(i-this.long0,this.over);if(r=n*Math.sin(a),this.sphere)Math.abs(a)<=m?(s=this.a*n,e=-1*this.a*this.lat0):(s=this.a*Math.sin(r)/Math.tan(a),e=this.a*(Y(a-this.lat0)+(1-Math.cos(r))/Math.tan(a)));else if(Math.abs(a)<=m)s=this.a*n,e=-1*this.ml0;else{var h=Mi(this.a,this.e,Math.sin(a))/Math.tan(a);s=h*Math.sin(r),e=this.a*q(this.e0,this.e1,this.e2,this.e3,a)-this.ml0+h*(1-Math.cos(r))}return t.x=s+this.x0,t.y=e+this.y0,t}function Pr(t){var i,a,s,e,r,n,h,o,l;if(s=t.x-this.x0,e=t.y-this.y0,this.sphere)if(Math.abs(e+this.a*this.lat0)<=m)i=y(s/this.a+this.long0,this.over),a=0;else{n=this.lat0+e/this.a,h=s*s/this.a/this.a+n*n,o=n;var _;for(r=pi;r;--r)if(_=Math.tan(o),l=-1*(n*(o*_+1)-o-.5*(o*o+h)*_)/((o-n)/_-1),o+=l,Math.abs(l)<=m){a=o;break}i=y(this.long0+Math.asin(s*Math.tan(o)/this.a)/Math.sin(a),this.over)}else if(Math.abs(e+this.ml0)<=m)a=0,i=y(this.long0+s/this.a,this.over);else{n=(this.ml0+e)/this.a,h=s*s/this.a/this.a+n*n,o=n;var c,f,u,M,g;for(r=pi;r;--r)if(g=this.e*Math.sin(o),c=Math.sqrt(1-g*g)*Math.tan(o),f=this.a*q(this.e0,this.e1,this.e2,this.e3,o),u=this.e0-2*this.e1*Math.cos(2*o)+4*this.e2*Math.cos(4*o)-6*this.e3*Math.cos(6*o),M=f/this.a,l=(n*(c*M+1)-M-.5*c*(M*M+h))/(this.es*Math.sin(2*o)*(M*M+h-2*n*M)/(4*c)+(n-M)*(c*u-2/Math.sin(2*o))-u),o-=l,Math.abs(l)<=m){a=o;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(a),2))*Math.tan(a),i=y(this.long0+Math.asin(s*c/this.a)/Math.sin(a),this.over)}return t.x=i,t.y=a,t}var xr=["Polyconic","American_Polyconic","poly"];const Gr={init:Sr,forward:wr,inverse:Pr,names:xr};function br(){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 Ar(t){var i,a=t.x,s=t.y,e=s-this.lat0,r=a-this.long0,n=e/mt*1e-5,h=r,o=1,l=0;for(i=1;i<=10;i++)o=o*n,l=l+this.A[i]*o;var _=l,c=h,f=1,u=0,M,g,d=0,E=0;for(i=1;i<=6;i++)M=f*_-u*c,g=u*_+f*c,f=M,u=g,d=d+this.B_re[i]*f-this.B_im[i]*u,E=E+this.B_im[i]*f+this.B_re[i]*u;return t.x=E*this.a+this.x0,t.y=d*this.a+this.y0,t}function Nr(t){var i,a=t.x,s=t.y,e=a-this.x0,r=s-this.y0,n=r/this.a,h=e/this.a,o=1,l=0,_,c,f=0,u=0;for(i=1;i<=6;i++)_=o*n-l*h,c=l*n+o*h,o=_,l=c,f=f+this.C_re[i]*o-this.C_im[i]*l,u=u+this.C_im[i]*o+this.C_re[i]*l;for(var M=0;M<this.iterations;M++){var g=f,d=u,E,S,w=n,x=h;for(i=2;i<=6;i++)E=g*f-d*u,S=d*f+g*u,g=E,d=S,w=w+(i-1)*(this.B_re[i]*g-this.B_im[i]*d),x=x+(i-1)*(this.B_im[i]*g+this.B_re[i]*d);g=1,d=0;var P=this.B_re[1],G=this.B_im[1];for(i=2;i<=6;i++)E=g*f-d*u,S=d*f+g*u,g=E,d=S,P=P+i*(this.B_re[i]*g-this.B_im[i]*d),G=G+i*(this.B_im[i]*g+this.B_re[i]*d);var N=P*P+G*G;f=(w*P+x*G)/N,u=(x*P-w*G)/N}var p=f,O=u,X=1,D=0;for(i=1;i<=9;i++)X=X*p,D=D+this.D[i]*X;var st=this.lat0+D*mt*1e5,et=this.long0+O;return t.x=et,t.y=st,t}var Ir=["New_Zealand_Map_Grid","nzmg"];const Cr={init:br,forward:Ar,inverse:Nr,names:Ir};function Rr(){}function Or(t){var i=t.x,a=t.y,s=y(i-this.long0,this.over),e=this.x0+this.a*s,r=this.y0+this.a*Math.log(Math.tan(Math.PI/4+a/2.5))*1.25;return t.x=e,t.y=r,t}function Tr(t){t.x-=this.x0,t.y-=this.y0;var i=y(this.long0+t.x/this.a,this.over),a=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=i,t.y=a,t}var pr=["Miller_Cylindrical","mill"];const Lr={init:Rr,forward:Or,inverse:Tr,names:pr};var qr=20;function Ur(){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=oi(this.es)}function kr(t){var i,a,s=t.x,e=t.y;if(s=y(s-this.long0,this.over),this.sphere){if(!this.m)e=this.n!==1?Math.asin(this.n*Math.sin(e)):e;else for(var r=this.n*Math.sin(e),n=qr;n;--n){var h=(this.m*e+Math.sin(e)-r)/(this.m+Math.cos(e));if(e-=h,Math.abs(h)<m)break}i=this.a*this.C_x*s*(this.m+Math.cos(e)),a=this.a*this.C_y*e}else{var o=Math.sin(e),l=Math.cos(e);a=this.a*ut(e,o,l,this.en),i=this.a*s*l/Math.sqrt(1-this.es*o*o)}return t.x=i,t.y=a,t}function $r(t){var i,a,s,e;return t.x-=this.x0,s=t.x/this.a,t.y-=this.y0,i=t.y/this.a,this.sphere?(i/=this.C_y,s=s/(this.C_x*(this.m+Math.cos(i))),this.m?i=Z((this.m*i+Math.sin(i))/this.n):this.n!==1&&(i=Z(Math.sin(i)/this.n)),s=y(s+this.long0,this.over),i=Y(i)):(i=li(t.y/this.a,this.es,this.en),e=Math.abs(i),e<v?(e=Math.sin(i),a=this.long0+t.x*Math.sqrt(1-this.es*e*e)/(this.a*Math.cos(i)),s=y(a,this.over)):e-m<v&&(s=this.long0)),t.x=s,t.y=i,t}var Fr=["Sinusoidal","sinu"];const Dr={init:Ur,forward:kr,inverse:$r,names:Fr};function jr(){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}function Br(t){for(var i=t.x,a=t.y,s=y(i-this.long0,this.over),e=a,r=Math.PI*Math.sin(a);;){var n=-(e+Math.sin(e)-r)/(1+Math.cos(e));if(e+=n,Math.abs(n)<m)break}e/=2,Math.PI/2-Math.abs(a)<m&&(s=0);var h=.900316316158*this.a*s*Math.cos(e)+this.x0,o=1.4142135623731*this.a*Math.sin(e)+this.y0;return t.x=h,t.y=o,t}function zr(t){var i,a;t.x-=this.x0,t.y-=this.y0,a=t.y/(1.4142135623731*this.a),Math.abs(a)>.999999999999&&(a=.999999999999),i=Math.asin(a);var s=y(this.long0+t.x/(.900316316158*this.a*Math.cos(i)),this.over);s<-Math.PI&&(s=-Math.PI),s>Math.PI&&(s=Math.PI),a=(2*i+Math.sin(2*i))/Math.PI,Math.abs(a)>1&&(a=1);var e=Math.asin(a);return t.x=s,t.y=e,t}var Wr=["Mollweide","moll"];const Hr={init:jr,forward:Br,inverse:zr,names:Wr};function Qr(){Math.abs(this.lat1+this.lat2)<m||(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=Nt(this.es),this.e1=It(this.es),this.e2=Ct(this.es),this.e3=Rt(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=H(this.e,this.sin_phi,this.cos_phi),this.ml1=q(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<m?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=H(this.e,this.sin_phi,this.cos_phi),this.ml2=q(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=q(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function Xr(t){var i=t.x,a=t.y,s;if(this.sphere)s=this.a*(this.g-a);else{var e=q(this.e0,this.e1,this.e2,this.e3,a);s=this.a*(this.g-e)}var r=this.ns*y(i-this.long0,this.over),n=this.x0+s*Math.sin(r),h=this.y0+this.rh-s*Math.cos(r);return t.x=n,t.y=h,t}function Kr(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var i,a,s,e;this.ns>=0?(a=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(a=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1);var r=0;if(a!==0&&(r=Math.atan2(i*t.x,i*t.y)),this.sphere)return e=y(this.long0+r/this.ns,this.over),s=Y(this.g-a/this.a),t.x=e,t.y=s,t;var n=this.g-a/this.a;return s=Bt(n,this.e0,this.e1,this.e2,this.e3),e=y(this.long0+r/this.ns,this.over),t.x=e,t.y=s,t}var Jr=["Equidistant_Conic","eqdc"];const Vr={init:Qr,forward:Xr,inverse:Kr,names:Jr};function Zr(){this.R=this.a}function Yr(t){var i=t.x,a=t.y,s=y(i-this.long0,this.over),e,r;Math.abs(a)<=m&&(e=this.x0+this.R*s,r=this.y0);var n=Z(2*Math.abs(a/Math.PI));(Math.abs(s)<=m||Math.abs(Math.abs(a)-v)<=m)&&(e=this.x0,a>=0?r=this.y0+Math.PI*this.R*Math.tan(.5*n):r=this.y0+Math.PI*this.R*-Math.tan(.5*n));var h=.5*Math.abs(Math.PI/s-s/Math.PI),o=h*h,l=Math.sin(n),_=Math.cos(n),c=_/(l+_-1),f=c*c,u=c*(2/l-1),M=u*u,g=Math.PI*this.R*(h*(c-M)+Math.sqrt(o*(c-M)*(c-M)-(M+o)*(f-M)))/(M+o);s<0&&(g=-g),e=this.x0+g;var d=o+c;return g=Math.PI*this.R*(u*d-h*Math.sqrt((M+o)*(o+1)-d*d))/(M+o),a>=0?r=this.y0+g:r=this.y0-g,t.x=e,t.y=r,t}function th(t){var i,a,s,e,r,n,h,o,l,_,c,f,u;return t.x-=this.x0,t.y-=this.y0,c=Math.PI*this.R,s=t.x/c,e=t.y/c,r=s*s+e*e,n=-Math.abs(e)*(1+r),h=n-2*e*e+s*s,o=-2*n+1+2*e*e+r*r,u=e*e/o+(2*h*h*h/o/o/o-9*n*h/o/o)/27,l=(n-h*h/3/o)/o,_=2*Math.sqrt(-l/3),c=3*u/l/_,Math.abs(c)>1&&(c>=0?c=1:c=-1),f=Math.acos(c)/3,t.y>=0?a=(-_*Math.cos(f+Math.PI/3)-h/3/o)*Math.PI:a=-(-_*Math.cos(f+Math.PI/3)-h/3/o)*Math.PI,Math.abs(s)<m?i=this.long0:i=y(this.long0+Math.PI*(r-1+Math.sqrt(1+2*(s*s-e*e)+r*r))/2/s,this.over),t.x=i,t.y=a,t}var ih=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const ah={init:Zr,forward:Yr,inverse:th,names:ih};function sh(t,i,a,s,e,r){const n=s-i,h=Math.atan((1-r)*Math.tan(t)),o=Math.atan((1-r)*Math.tan(a)),l=Math.sin(h),_=Math.cos(h),c=Math.sin(o),f=Math.cos(o);let u=n,M,g=100,d,E,S,w,x,P,G,N,p,O,X,D,st,et;do{if(d=Math.sin(u),E=Math.cos(u),S=Math.sqrt(f*d*(f*d)+(_*c-l*f*E)*(_*c-l*f*E)),S===0)return{azi1:0,s12:0};w=l*c+_*f*E,x=Math.atan2(S,w),P=_*f*d/S,G=1-P*P,N=G!==0?w-2*l*c/G:0,p=r/16*G*(4+r*(4-3*G)),M=u,u=n+(1-p)*r*P*(x+p*S*(N+p*w*(-1+2*N*N)))}while(Math.abs(u-M)>1e-12&&--g>0);return g===0?{azi1:NaN,s12:NaN}:(O=G*(e*e-e*(1-r)*(e*(1-r)))/(e*(1-r)*(e*(1-r))),X=1+O/16384*(4096+O*(-768+O*(320-175*O))),D=O/1024*(256+O*(-128+O*(74-47*O))),st=D*S*(N+D/4*(w*(-1+2*N*N)-D/6*N*(-3+4*S*S)*(-3+4*N*N))),et=e*(1-r)*X*(x-st),{azi1:Math.atan2(f*d,_*c-l*f*E),s12:et})}function eh(t,i,a,s,e,r){const n=Math.atan((1-r)*Math.tan(t)),h=Math.sin(n),o=Math.cos(n),l=Math.sin(a),_=Math.cos(a),c=Math.atan2(h,o*_),f=o*l,u=1-f*f,M=u*(e*e-e*(1-r)*(e*(1-r)))/(e*(1-r)*(e*(1-r))),g=1+M/16384*(4096+M*(-768+M*(320-175*M))),d=M/1024*(256+M*(-128+M*(74-47*M)));let E=s/(e*(1-r)*g),S,w=100,x,P,G,N;do x=Math.cos(2*c+E),P=Math.sin(E),G=Math.cos(E),N=d*P*(x+d/4*(G*(-1+2*x*x)-d/6*x*(-3+4*P*P)*(-3+4*x*x))),S=E,E=s/(e*(1-r)*g)+N;while(Math.abs(E-S)>1e-12&&--w>0);if(w===0)return{lat2:NaN,lon2:NaN};const p=h*P-o*G*_,O=Math.atan2(h*G+o*P*_,(1-r)*Math.sqrt(f*f+p*p)),X=Math.atan2(P*l,o*G-h*P*_),D=r/16*u*(4+r*(4-3*u)),st=X-(1-D)*r*f*(E+D*P*(x+D*G*(-1+2*x*x))),et=i+st;return{lat2:O,lon2:et}}function rh(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function hh(t){var i=t.x,a=t.y,s=Math.sin(t.y),e=Math.cos(t.y),r=y(i-this.long0,this.over),n,h,o,l,_,c,f,u,M,g,d;return this.sphere?Math.abs(this.sin_p12-1)<=m?(t.x=this.x0+this.a*(v-a)*Math.sin(r),t.y=this.y0-this.a*(v-a)*Math.cos(r),t):Math.abs(this.sin_p12+1)<=m?(t.x=this.x0+this.a*(v+a)*Math.sin(r),t.y=this.y0+this.a*(v+a)*Math.cos(r),t):(M=this.sin_p12*s+this.cos_p12*e*Math.cos(r),f=Math.acos(M),u=f?f/Math.sin(f):1,t.x=this.x0+this.a*u*e*Math.sin(r),t.y=this.y0+this.a*u*(this.cos_p12*s-this.sin_p12*e*Math.cos(r)),t):(n=Nt(this.es),h=It(this.es),o=Ct(this.es),l=Rt(this.es),Math.abs(this.sin_p12-1)<=m?(_=this.a*q(n,h,o,l,v),c=this.a*q(n,h,o,l,a),t.x=this.x0+(_-c)*Math.sin(r),t.y=this.y0-(_-c)*Math.cos(r),t):Math.abs(this.sin_p12+1)<=m?(_=this.a*q(n,h,o,l,v),c=this.a*q(n,h,o,l,a),t.x=this.x0+(_+c)*Math.sin(r),t.y=this.y0+(_+c)*Math.cos(r),t):Math.abs(i)<m&&Math.abs(a-this.lat0)<m?(t.x=t.y=0,t):(g=sh(this.lat0,this.long0,a,i,this.a,this.f),d=g.azi1,t.x=g.s12*Math.sin(d),t.y=g.s12*Math.cos(d),t))}function nh(t){t.x-=this.x0,t.y-=this.y0;var i,a,s,e,r,n,h,o,l,_,c,f,u,M,g,d;return this.sphere?(i=Math.sqrt(t.x*t.x+t.y*t.y),i>2*v*this.a?void 0:(a=i/this.a,s=Math.sin(a),e=Math.cos(a),r=this.long0,Math.abs(i)<=m?n=this.lat0:(n=Z(e*this.sin_p12+t.y*s*this.cos_p12/i),h=Math.abs(this.lat0)-v,Math.abs(h)<=m?this.lat0>=0?r=y(this.long0+Math.atan2(t.x,-t.y),this.over):r=y(this.long0-Math.atan2(-t.x,t.y),this.over):r=y(this.long0+Math.atan2(t.x*s,i*this.cos_p12*e-t.y*this.sin_p12*s),this.over)),t.x=r,t.y=n,t)):(o=Nt(this.es),l=It(this.es),_=Ct(this.es),c=Rt(this.es),Math.abs(this.sin_p12-1)<=m?(f=this.a*q(o,l,_,c,v),i=Math.sqrt(t.x*t.x+t.y*t.y),u=f-i,n=Bt(u/this.a,o,l,_,c),r=y(this.long0+Math.atan2(t.x,-1*t.y),this.over),t.x=r,t.y=n,t):Math.abs(this.sin_p12+1)<=m?(f=this.a*q(o,l,_,c,v),i=Math.sqrt(t.x*t.x+t.y*t.y),u=i-f,n=Bt(u/this.a,o,l,_,c),r=y(this.long0+Math.atan2(t.x,t.y),this.over),t.x=r,t.y=n,t):(M=Math.atan2(t.x,t.y),g=Math.sqrt(t.x*t.x+t.y*t.y),d=eh(this.lat0,this.long0,M,g,this.a,this.f),t.x=d.lon2,t.y=d.lat2,t))}var oh=["Azimuthal_Equidistant","aeqd"];const lh={init:rh,forward:hh,inverse:nh,names:oh};function fh(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function ch(t){var i,a,s,e,r,n,h,o,l=t.x,_=t.y;return s=y(l-this.long0,this.over),i=Math.sin(_),a=Math.cos(_),e=Math.cos(s),n=this.sin_p14*i+this.cos_p14*a*e,r=1,(n>0||Math.abs(n)<=m)&&(h=this.a*r*a*Math.sin(s),o=this.y0+this.a*r*(this.cos_p14*i-this.sin_p14*a*e)),t.x=h,t.y=o,t}function _h(t){var i,a,s,e,r,n,h;return t.x-=this.x0,t.y-=this.y0,i=Math.sqrt(t.x*t.x+t.y*t.y),a=Z(i/this.a),s=Math.sin(a),e=Math.cos(a),n=this.long0,Math.abs(i)<=m?(h=this.lat0,t.x=n,t.y=h,t):(h=Z(e*this.sin_p14+t.y*s*this.cos_p14/i),r=Math.abs(this.lat0)-v,Math.abs(r)<=m?(this.lat0>=0?n=y(this.long0+Math.atan2(t.x,-t.y),this.over):n=y(this.long0-Math.atan2(-t.x,t.y),this.over),t.x=n,t.y=h,t):(n=y(this.long0+Math.atan2(t.x*s,i*this.cos_p14*e-t.y*this.sin_p14*s),this.over),t.x=n,t.y=h,t))}var uh=["ortho"];const Mh={init:fh,forward:ch,inverse:_h,names:uh};var I={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},A={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function vh(){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>=v-b/2?this.face=I.TOP:this.lat0<=-(v-b/2)?this.face=I.BOTTOM:Math.abs(this.long0)<=b?this.face=I.FRONT:Math.abs(this.long0)<=v+b?this.face=this.long0>0?I.RIGHT:I.LEFT:this.face=I.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 gh(t){var i={x:0,y:0},a,s,e,r,n,h,o={value:0};if(t.x-=this.long0,this.es!==0?a=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):a=t.y,s=t.x,this.face===I.TOP)r=v-a,s>=b&&s<=v+b?(o.value=A.AREA_0,e=s-v):s>v+b||s<=-(v+b)?(o.value=A.AREA_1,e=s>0?s-R:s+R):s>-(v+b)&&s<=-b?(o.value=A.AREA_2,e=s+v):(o.value=A.AREA_3,e=s);else if(this.face===I.BOTTOM)r=v+a,s>=b&&s<=v+b?(o.value=A.AREA_0,e=-s+v):s<b&&s>=-b?(o.value=A.AREA_1,e=-s):s<-b&&s>=-(v+b)?(o.value=A.AREA_2,e=-s-v):(o.value=A.AREA_3,e=s>0?-s+R:-s-R);else{var l,_,c,f,u,M,g;this.face===I.RIGHT?s=ct(s,+v):this.face===I.BACK?s=ct(s,+R):this.face===I.LEFT&&(s=ct(s,-v)),f=Math.sin(a),u=Math.cos(a),M=Math.sin(s),g=Math.cos(s),l=u*g,_=u*M,c=f,this.face===I.FRONT?(r=Math.acos(l),e=pt(r,c,_,o)):this.face===I.RIGHT?(r=Math.acos(_),e=pt(r,c,-l,o)):this.face===I.BACK?(r=Math.acos(-l),e=pt(r,c,-_,o)):this.face===I.LEFT?(r=Math.acos(-_),e=pt(r,c,l,o)):(r=e=0,o.value=A.AREA_0)}return h=Math.atan(12/R*(e+Math.acos(Math.sin(e)*Math.cos(b))-v)),n=Math.sqrt((1-Math.cos(r))/(Math.cos(h)*Math.cos(h))/(1-Math.cos(Math.atan(1/Math.cos(e))))),o.value===A.AREA_1?h+=v:o.value===A.AREA_2?h+=R:o.value===A.AREA_3&&(h+=1.5*R),i.x=n*Math.cos(h),i.y=n*Math.sin(h),i.x=i.x*this.a+this.x0,i.y=i.y*this.a+this.y0,t.x=i.x,t.y=i.y,t}function dh(t){var i={lam:0,phi:0},a,s,e,r,n,h,o,l,_,c={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,s=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),a=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?c.value=A.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(c.value=A.AREA_1,a-=v):t.x<0&&-t.x>=Math.abs(t.y)?(c.value=A.AREA_2,a=a<0?a+R:a-R):(c.value=A.AREA_3,a+=v),_=R/12*Math.tan(a),n=Math.sin(_)/(Math.cos(_)-1/Math.sqrt(2)),h=Math.atan(n),e=Math.cos(a),r=Math.tan(s),o=1-e*e*r*r*(1-Math.cos(Math.atan(1/Math.cos(h)))),o<-1?o=-1:o>1&&(o=1),this.face===I.TOP)l=Math.acos(o),i.phi=v-l,c.value===A.AREA_0?i.lam=h+v:c.value===A.AREA_1?i.lam=h<0?h+R:h-R:c.value===A.AREA_2?i.lam=h-v:i.lam=h;else if(this.face===I.BOTTOM)l=Math.acos(o),i.phi=l-v,c.value===A.AREA_0?i.lam=-h+v:c.value===A.AREA_1?i.lam=-h:c.value===A.AREA_2?i.lam=-h-v:i.lam=h<0?-h-R:-h+R;else{var f,u,M;f=o,_=f*f,_>=1?M=0:M=Math.sqrt(1-_)*Math.sin(h),_+=M*M,_>=1?u=0:u=Math.sqrt(1-_),c.value===A.AREA_1?(_=u,u=-M,M=_):c.value===A.AREA_2?(u=-u,M=-M):c.value===A.AREA_3&&(_=u,u=M,M=-_),this.face===I.RIGHT?(_=f,f=-u,u=_):this.face===I.BACK?(f=-f,u=-u):this.face===I.LEFT&&(_=f,f=u,u=-_),i.phi=Math.acos(-M)-v,i.lam=Math.atan2(u,f),this.face===I.RIGHT?i.lam=ct(i.lam,-v):this.face===I.BACK?i.lam=ct(i.lam,-R):this.face===I.LEFT&&(i.lam=ct(i.lam,+v))}if(this.es!==0){var g,d,E;g=i.phi<0?1:0,d=Math.tan(i.phi),E=this.b/Math.sqrt(d*d+this.one_minus_f_squared),i.phi=Math.atan(Math.sqrt(this.a*this.a-E*E)/(this.one_minus_f*E)),g&&(i.phi=-i.phi)}return i.lam+=this.long0,t.x=i.lam,t.y=i.phi,t}function pt(t,i,a,s){var e;return t<m?(s.value=A.AREA_0,e=0):(e=Math.atan2(i,a),Math.abs(e)<=b?s.value=A.AREA_0:e>b&&e<=v+b?(s.value=A.AREA_1,e-=v):e>v+b||e<=-(v+b)?(s.value=A.AREA_2,e=e>=0?e-R:e+R):(s.value=A.AREA_3,e+=v)),e}function ct(t,i){var a=t+i;return a<-R?a+=Pt:a>+R&&(a-=Pt),a}var mh=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const yh={init:vh,forward:gh,inverse:dh,names:mh};var ei=[[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]],dt=[[-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]],ea=.8487,ra=1.3523,ha=$/5,Eh=1/ha,lt=18,zt=function(t,i){return t[0]+i*(t[1]+i*(t[2]+i*t[3]))},Sh=function(t,i){return t[1]+i*(2*t[2]+i*3*t[3])};function wh(t,i,a,s){for(var e=i;s;--s){var r=t(e);if(e-=r,Math.abs(r)<a)break}return e}function Ph(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function xh(t){var i=y(t.x-this.long0,this.over),a=Math.abs(t.y),s=Math.floor(a*ha);s<0?s=0:s>=lt&&(s=lt-1),a=$*(a-Eh*s);var e={x:zt(ei[s],a)*i,y:zt(dt[s],a)};return t.y<0&&(e.y=-e.y),e.x=e.x*this.a*ea+this.x0,e.y=e.y*this.a*ra+this.y0,e}function Gh(t){var i={x:(t.x-this.x0)/(this.a*ea),y:Math.abs(t.y-this.y0)/(this.a*ra)};if(i.y>=1)i.x/=ei[lt][0],i.y=t.y<0?-v:v;else{var a=Math.floor(i.y*lt);for(a<0?a=0:a>=lt&&(a=lt-1);;)if(dt[a][0]>i.y)--a;else if(dt[a+1][0]<=i.y)++a;else break;var s=dt[a],e=5*(i.y-s[0])/(dt[a+1][0]-s[0]);e=wh(function(r){return(zt(s,r)-i.y)/Sh(s,r)},e,m,100),i.x/=zt(ei[a],e),i.y=(5*a+e)*C,t.y<0&&(i.y=-i.y)}return i.x=y(i.x+this.long0,this.over),i}var bh=["Robinson","robin"];const Ah={init:Ph,forward:xh,inverse:Gh,names:bh};function Nh(){this.name="geocent"}function Ih(t){var i=Qi(t,this.es,this.a);return i}function Ch(t){var i=Xi(t,this.es,this.a,this.b);return i}var Rh=["Geocentric","geocentric","geocent","Geocent"];const Oh={init:Nh,forward:Ih,inverse:Ch,names:Rh};var L={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Mt={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 Th(){if(Object.keys(Mt).forEach((function(a){if(typeof this[a]>"u")this[a]=Mt[a].def;else{if(Mt[a].num&&isNaN(this[a]))throw new Error("Invalid parameter value, must be numeric "+a+" = "+this[a]);Mt[a].num&&(this[a]=parseFloat(this[a]))}Mt[a].degrees&&(this[a]=this[a]*C)}).bind(this)),Math.abs(Math.abs(this.lat0)-v)<m?this.mode=this.lat0<0?L.S_POLE:L.N_POLE:Math.abs(this.lat0)<m?this.mode=L.EQUIT:(this.mode=L.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,i=this.azi;this.cg=Math.cos(i),this.sg=Math.sin(i),this.cw=Math.cos(t),this.sw=Math.sin(t)}function ph(t){t.x-=this.long0;var i=Math.sin(t.y),a=Math.cos(t.y),s=Math.cos(t.x),e,r;switch(this.mode){case L.OBLIQ:r=this.sinph0*i+this.cosph0*a*s;break;case L.EQUIT:r=a*s;break;case L.S_POLE:r=-i;break;case L.N_POLE:r=i;break}switch(r=this.pn1/(this.p-r),e=r*a*Math.sin(t.x),this.mode){case L.OBLIQ:r*=this.cosph0*i-this.sinph0*a*s;break;case L.EQUIT:r*=i;break;case L.N_POLE:r*=-(a*s);break;case L.S_POLE:r*=a*s;break}var n,h;return n=r*this.cg+e*this.sg,h=1/(n*this.sw*this.h1+this.cw),e=(e*this.cg-r*this.sg)*this.cw*h,r=n*h,t.x=e*this.a,t.y=r*this.a,t}function Lh(t){t.x/=this.a,t.y/=this.a;var i={x:t.x,y:t.y},a,s,e;e=1/(this.pn1-t.y*this.sw),a=this.pn1*t.x*e,s=this.pn1*t.y*this.cw*e,t.x=a*this.cg+s*this.sg,t.y=s*this.cg-a*this.sg;var r=k(t.x,t.y);if(Math.abs(r)<m)i.x=0,i.y=t.y;else{var n,h;switch(h=1-r*r*this.pfact,h=(this.p-Math.sqrt(h))/(this.pn1/r+r/this.pn1),n=Math.sqrt(1-h*h),this.mode){case L.OBLIQ:i.y=Math.asin(n*this.sinph0+t.y*h*this.cosph0/r),t.y=(n-this.sinph0*Math.sin(i.y))*r,t.x*=h*this.cosph0;break;case L.EQUIT:i.y=Math.asin(t.y*h/r),t.y=n*r,t.x*=h;break;case L.N_POLE:i.y=Math.asin(n),t.y=-t.y;break;case L.S_POLE:i.y=-Math.asin(n);break}i.x=Math.atan2(t.x,t.y)}return t.x=i.x+this.long0,t.y=i.y,t}var qh=["Tilted_Perspective","tpers"];const Uh={init:Th,forward:ph,inverse:Lh,names:qh};function kh(){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,i=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=i,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 $h(t){var i=t.x,a=t.y,s,e,r,n;if(i=i-this.long0,this.shape==="ellipse"){a=Math.atan(this.radius_p2*Math.tan(a));var h=this.radius_p/k(this.radius_p*Math.cos(a),Math.sin(a));if(e=h*Math.cos(i)*Math.cos(a),r=h*Math.sin(i)*Math.cos(a),n=h*Math.sin(a),(this.radius_g-e)*e-r*r-n*n*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;s=this.radius_g-e,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/k(n,s)),t.y=this.radius_g_1*Math.atan(n/s)):(t.x=this.radius_g_1*Math.atan(r/s),t.y=this.radius_g_1*Math.atan(n/k(r,s)))}else this.shape==="sphere"&&(s=Math.cos(a),e=Math.cos(i)*s,r=Math.sin(i)*s,n=Math.sin(a),s=this.radius_g-e,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/k(n,s)),t.y=this.radius_g_1*Math.atan(n/s)):(t.x=this.radius_g_1*Math.atan(r/s),t.y=this.radius_g_1*Math.atan(n/k(r,s))));return t.x=t.x*this.a,t.y=t.y*this.a,t}function Fh(t){var i=-1,a=0,s=0,e,r,n,h;if(t.x=t.x/this.a,t.y=t.y/this.a,this.shape==="ellipse"){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*k(1,s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*k(1,a));var o=s/this.radius_p;if(e=a*a+o*o+i*i,r=2*this.radius_g*i,n=r*r-4*e*this.C,n<0)return t.x=Number.NaN,t.y=Number.NaN,t;h=(-r-Math.sqrt(n))/(2*e),i=this.radius_g+h*i,a*=h,s*=h,t.x=Math.atan2(a,i),t.y=Math.atan(s*Math.cos(t.x)/i),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if(this.shape==="sphere"){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+a*a)),e=a*a+s*s+i*i,r=2*this.radius_g*i,n=r*r-4*e*this.C,n<0)return t.x=Number.NaN,t.y=Number.NaN,t;h=(-r-Math.sqrt(n))/(2*e),i=this.radius_g+h*i,a*=h,s*=h,t.x=Math.atan2(a,i),t.y=Math.atan(s*Math.cos(t.x)/i)}return t.x=t.x+this.long0,t}var Dh=["Geostationary Satellite View","Geostationary_Satellite","geos"];const jh={init:kh,forward:$h,inverse:Fh,names:Dh};var yt=1.340264,Et=-.081106,St=893e-6,wt=.003796,Wt=Math.sqrt(3)/2;function Bh(){this.es=0,this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0}function zh(t){var i=y(t.x-this.long0,this.over),a=t.y,s=Math.asin(Wt*Math.sin(a)),e=s*s,r=e*e*e;return t.x=i*Math.cos(s)/(Wt*(yt+3*Et*e+r*(7*St+9*wt*e))),t.y=s*(yt+Et*e+r*(St+wt*e)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function Wh(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var i=1e-9,a=12,s=t.y,e,r,n,h,o,l;for(l=0;l<a&&(e=s*s,r=e*e*e,n=s*(yt+Et*e+r*(St+wt*e))-t.y,h=yt+3*Et*e+r*(7*St+9*wt*e),s-=o=n/h,!(Math.abs(o)<i));++l);return e=s*s,r=e*e*e,t.x=Wt*t.x*(yt+3*Et*e+r*(7*St+9*wt*e))/Math.cos(s),t.y=Math.asin(Math.sin(s)/Wt),t.x=y(t.x+this.long0,this.over),t}var Hh=["eqearth","Equal Earth","Equal_Earth"];const Qh={init:Bh,forward:zh,inverse:Wh,names:Hh};var bt=1e-10;function Xh(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<bt)throw new Error;this.es?(this.en=oi(this.es),this.m1=ut(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=Jh,this.forward=Kh):(Math.abs(this.phi1)+bt>=v?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Zh,this.forward=Vh)}function Kh(t){var i=y(t.x-(this.long0||0),this.over),a=t.y,s,e,r;return s=this.am1+this.m1-ut(a,e=Math.sin(a),r=Math.cos(a),this.en),e=r*i/(s*Math.sqrt(1-this.es*e*e)),t.x=s*Math.sin(e),t.y=this.am1-s*Math.cos(e),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Jh(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var i,a,s,e;if(a=k(t.x,t.y=this.am1-t.y),e=li(this.am1+this.m1-a,this.es,this.en),(i=Math.abs(e))<v)i=Math.sin(e),s=a*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*i*i)/Math.cos(e);else if(Math.abs(i-v)<=bt)s=0;else throw new Error;return t.x=y(s+(this.long0||0),this.over),t.y=Y(e),t}function Vh(t){var i=y(t.x-(this.long0||0),this.over),a=t.y,s,e;return e=this.cphi1+this.phi1-a,Math.abs(e)>bt?(t.x=e*Math.sin(s=i*Math.cos(a)/e),t.y=this.cphi1-e*Math.cos(s)):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 Zh(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var i,a,s=k(t.x,t.y=this.cphi1-t.y);if(a=this.cphi1+this.phi1-s,Math.abs(a)>v)throw new Error;return Math.abs(Math.abs(a)-v)<=bt?i=0:i=s*Math.atan2(t.x,t.y)/Math.cos(a),t.x=y(i+(this.long0||0),this.over),t.y=Y(a),t}var Yh=["bonne","Bonne (Werner lat_1=90)"];const tn={init:Xh,names:Yh},Li={OBLIQUE:{forward:hn,inverse:on},TRANSVERSE:{forward:nn,inverse:ln}},Ht={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};function an(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=Bi.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const t=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),i=B(t);if(!i)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);i.long0=0,this.obliqueProjection=i;let a;const s=Object.keys(Ht),e=h=>{if(typeof this[h]>"u")return;const o=parseFloat(this[h])*C;if(isNaN(o))throw new Error("Invalid value for "+h+": "+this[h]);return o};for(let h=0;h<s.length;h++){const o=s[h],l=Ht[o],_=Object.entries(l);if(_.some(([f])=>typeof this[f]<"u")){a=l;for(let f=0;f<_.length;f++){const[u,M]=_[f],g=e(u);if(typeof g>"u")throw new Error("Missing parameter: "+u+".");this[M]=g}break}}if(!a)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:r,phip:n}=rn(this,a);this.lamp=r,Math.abs(n)>m?(this.cphip=Math.cos(n),this.sphip=Math.sin(n),this.projectionType=Li.OBLIQUE):this.projectionType=Li.TRANSVERSE}function sn(t){return this.projectionType.forward(this,t)}function en(t){return this.projectionType.inverse(this,t)}function rn(t,i){let a,s;if(i===Ht.ROTATE){let e=t.oLongC,r=t.oLatC,n=t.oAlpha;if(Math.abs(Math.abs(r)-v)<=m)throw new Error("Invalid value for o_lat_c: "+t.o_lat_c+" should be < 90°");s=e+Math.atan2(-1*Math.cos(n),-1*Math.sin(n)*Math.sin(r)),a=Math.asin(Math.cos(r)*Math.sin(n))}else if(i===Ht.NEW_POLE)s=t.oLongP,a=t.oLatP;else{let e=t.oLong1,r=t.oLat1,n=t.oLong2,h=t.oLat2,o=Math.abs(r);if(Math.abs(r)>v-m)throw new Error("Invalid value for o_lat_1: "+t.o_lat_1+" should be < 90°");if(Math.abs(h)>v-m)throw new Error("Invalid value for o_lat_2: "+t.o_lat_2+" should be < 90°");if(Math.abs(r-h)<m)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(o<m)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");s=Math.atan2(Math.cos(r)*Math.sin(h)*Math.cos(e)-Math.sin(r)*Math.cos(h)*Math.cos(n),Math.sin(r)*Math.cos(h)*Math.sin(n)-Math.cos(r)*Math.sin(h)*Math.sin(e)),a=Math.atan(-1*Math.cos(s-e)/Math.tan(r))}return{lamp:s,phip:a}}function hn(t,i){let{x:a,y:s}=i;a+=t.long0;const e=Math.cos(a),r=Math.sin(s),n=Math.cos(s);i.x=y(Math.atan2(n*Math.sin(a),t.sphip*n*e+t.cphip*r)+t.lamp),i.y=Math.asin(t.sphip*r-t.cphip*n*e);const h=t.obliqueProjection.forward(i);return t.isIdentity&&(h.x*=$,h.y*=$),h}function nn(t,i){let{x:a,y:s}=i;a+=t.long0;const e=Math.cos(s),r=Math.cos(a);i.x=y(Math.atan2(e*Math.sin(a),Math.sin(s))+t.lamp),i.y=Math.asin(-1*e*r);const n=t.obliqueProjection.forward(i);return t.isIdentity&&(n.x*=$,n.y*=$),n}function on(t,i){t.isIdentity&&(i.x*=C,i.y*=C);const a=t.obliqueProjection.inverse(i);let{x:s,y:e}=a;if(s<Number.MAX_VALUE){s-=t.lamp;const r=Math.cos(s),n=Math.sin(e),h=Math.cos(e);i.x=Math.atan2(h*Math.sin(s),t.sphip*h*r-t.cphip*n),i.y=Math.asin(t.sphip*n+t.cphip*h*r)}return i.x=y(i.x+t.long0),i}function ln(t,i){t.isIdentity&&(i.x*=C,i.y*=C);const a=t.obliqueProjection.inverse(i);let{x:s,y:e}=a;if(s<Number.MAX_VALUE){const r=Math.cos(e);s-=t.lamp,i.x=Math.atan2(r*Math.sin(s),-1*Math.sin(e)),i.y=Math.asin(r*Math.cos(s))}return i.x=y(i.x+t.long0),i}var fn=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const cn={init:an,forward:sn,inverse:en,names:fn};function _n(t){t.Proj.projections.add(qt),t.Proj.projections.add(Ut),t.Proj.projections.add(Ys),t.Proj.projections.add(oe),t.Proj.projections.add(ue),t.Proj.projections.add(me),t.Proj.projections.add(xe),t.Proj.projections.add(Ie),t.Proj.projections.add(pe),t.Proj.projections.add($e),t.Proj.projections.add(Ze),t.Proj.projections.add(er),t.Proj.projections.add(lr),t.Proj.projections.add(vr),t.Proj.projections.add(Er),t.Proj.projections.add(Gr),t.Proj.projections.add(Cr),t.Proj.projections.add(Lr),t.Proj.projections.add(Dr),t.Proj.projections.add(Hr),t.Proj.projections.add(Vr),t.Proj.projections.add(ah),t.Proj.projections.add(lh),t.Proj.projections.add(Mh),t.Proj.projections.add(yh),t.Proj.projections.add(Ah),t.Proj.projections.add(Oh),t.Proj.projections.add(Uh),t.Proj.projections.add(jh),t.Proj.projections.add(Qh),t.Proj.projections.add(tn),t.Proj.projections.add(cn)}const na=Object.assign(gs,{defaultDatum:"WGS84",Proj:B,WGS84:new B("WGS84"),Point:_t,toPoint:Ki,defs:T,nadgrid:Za,transform:jt,mgrs:ds,version:"__VERSION__"});_n(na);exports.default=na;