gis-leaflet-helper 2.1.31 → 2.1.32

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.
@@ -6925,6 +6925,18 @@ v.Path.include({
6925
6925
  return l;
6926
6926
  }
6927
6927
  });
6928
+ v.Control.mergeOptions({
6929
+ offset: [0, 0]
6930
+ });
6931
+ v.Control.addInitHook(function() {
6932
+ setTimeout(() => {
6933
+ const i = this.getContainer();
6934
+ if (i) {
6935
+ const s = this.options.offset;
6936
+ i.style.transform = `translate(${s[0]}px, ${s[1]}px)`;
6937
+ }
6938
+ }, 200);
6939
+ });
6928
6940
  var kr = { exports: {} };
6929
6941
  function Nr(i) {
6930
6942
  i("EPSG:4326", "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"), i("EPSG:4269", "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"), i("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"), i.WGS84 = i["EPSG:4326"], i["EPSG:3785"] = i["EPSG:3857"], i.GOOGLE = i["EPSG:3857"], i["EPSG:900913"] = i["EPSG:3857"], i["EPSG:102113"] = i["EPSG:3857"];
@@ -3,7 +3,7 @@
3
3
  * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
4
4
  */var Vs;function Qs(){return Vs||(Vs=1,function(i,s){(function(n,o){o(s)})(no,function(n){var o="1.9.4";function r(t){var e,a,h,f;for(a=1,h=arguments.length;a<h;a++){f=arguments[a];for(e in f)t[e]=f[e]}return t}var l=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function u(t,e){var a=Array.prototype.slice;if(t.bind)return t.bind.apply(t,a.call(arguments,1));var h=a.call(arguments,2);return function(){return t.apply(e,h.length?h.concat(a.call(arguments)):arguments)}}var c=0;function d(t){return"_leaflet_id"in t||(t._leaflet_id=++c),t._leaflet_id}function _(t,e,a){var h,f,m,g;return g=function(){h=!1,f&&(m.apply(a,f),f=!1)},m=function(){h?f=arguments:(t.apply(a,arguments),setTimeout(g,e),h=!0)},m}function y(t,e,a){var h=e[1],f=e[0],m=h-f;return t===h&&a?t:((t-f)%m+m)%m+f}function p(){return!1}function M(t,e){if(e===!1)return t;var a=Math.pow(10,e===void 0?6:e);return Math.round(t*a)/a}function b(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function A(t){return b(t).split(/\s+/)}function P(t,e){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?l(t.options):{});for(var a in e)t.options[a]=e[a];return t.options}function E(t,e,a){var h=[];for(var f in t)h.push(encodeURIComponent(a?f.toUpperCase():f)+"="+encodeURIComponent(t[f]));return(!e||e.indexOf("?")===-1?"?":"&")+h.join("&")}var z=/\{ *([\w_ -]+) *\}/g;function B(t,e){return t.replace(z,function(a,h){var f=e[h];if(f===void 0)throw new Error("No value provided for variable "+a);return typeof f=="function"&&(f=f(e)),f})}var N=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function j(t,e){for(var a=0;a<t.length;a++)if(t[a]===e)return a;return-1}var H="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function W(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var ft=0;function tt(t){var e=+new Date,a=Math.max(0,16-(e-ft));return ft=e+a,window.setTimeout(t,a)}var Pt=window.requestAnimationFrame||W("RequestAnimationFrame")||tt,Ut=window.cancelAnimationFrame||W("CancelAnimationFrame")||W("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function nt(t,e,a){if(a&&Pt===tt)t.call(e);else return Pt.call(window,u(t,e))}function pt(t){t&&Ut.call(window,t)}var ds={__proto__:null,extend:r,create:l,bind:u,get lastId(){return c},stamp:d,throttle:_,wrapNum:y,falseFn:p,formatNum:M,trim:b,splitWords:A,setOptions:P,getParamString:E,template:B,isArray:N,indexOf:j,emptyImageUrl:H,requestFn:Pt,cancelFn:Ut,requestAnimFrame:nt,cancelAnimFrame:pt};function Qt(){}Qt.extend=function(t){var e=function(){P(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},a=e.__super__=this.prototype,h=l(a);h.constructor=e,e.prototype=h;for(var f in this)Object.prototype.hasOwnProperty.call(this,f)&&f!=="prototype"&&f!=="__super__"&&(e[f]=this[f]);return t.statics&&r(e,t.statics),t.includes&&(ac(t.includes),r.apply(null,[h].concat(t.includes))),r(h,t),delete h.statics,delete h.includes,h.options&&(h.options=a.options?l(a.options):{},r(h.options,t.options)),h._initHooks=[],h.callInitHooks=function(){if(!this._initHooksCalled){a.callInitHooks&&a.callInitHooks.call(this),this._initHooksCalled=!0;for(var m=0,g=h._initHooks.length;m<g;m++)h._initHooks[m].call(this)}},e},Qt.include=function(t){var e=this.prototype.options;return r(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},Qt.mergeOptions=function(t){return r(this.prototype.options,t),this},Qt.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),a=typeof t=="function"?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(a),this};function ac(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=N(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var St={on:function(t,e,a){if(typeof t=="object")for(var h in t)this._on(h,t[h],e);else{t=A(t);for(var f=0,m=t.length;f<m;f++)this._on(t[f],e,a)}return this},off:function(t,e,a){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var h in t)this._off(h,t[h],e);else{t=A(t);for(var f=arguments.length===1,m=0,g=t.length;m<g;m++)f?this._off(t[m]):this._off(t[m],e,a)}return this},_on:function(t,e,a,h){if(typeof e!="function"){console.warn("wrong listener type: "+typeof e);return}if(this._listens(t,e,a)===!1){a===this&&(a=void 0);var f={fn:e,ctx:a};h&&(f.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(f)}},_off:function(t,e,a){var h,f,m;if(this._events&&(h=this._events[t],!!h)){if(arguments.length===1){if(this._firingCount)for(f=0,m=h.length;f<m;f++)h[f].fn=p;delete this._events[t];return}if(typeof e!="function"){console.warn("wrong listener type: "+typeof e);return}var g=this._listens(t,e,a);if(g!==!1){var x=h[g];this._firingCount&&(x.fn=p,this._events[t]=h=h.slice()),h.splice(g,1)}}},fire:function(t,e,a){if(!this.listens(t,a))return this;var h=r({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var f=this._events[t];if(f){this._firingCount=this._firingCount+1||1;for(var m=0,g=f.length;m<g;m++){var x=f[m],w=x.fn;x.once&&this.off(t,w,x.ctx),w.call(x.ctx||this,h)}this._firingCount--}}return a&&this._propagateEvent(h),this},listens:function(t,e,a,h){typeof t!="string"&&console.warn('"string" type argument expected');var f=e;typeof e!="function"&&(h=!!e,f=void 0,a=void 0);var m=this._events&&this._events[t];if(m&&m.length&&this._listens(t,f,a)!==!1)return!0;if(h){for(var g in this._eventParents)if(this._eventParents[g].listens(t,e,a,h))return!0}return!1},_listens:function(t,e,a){if(!this._events)return!1;var h=this._events[t]||[];if(!e)return!!h.length;a===this&&(a=void 0);for(var f=0,m=h.length;f<m;f++)if(h[f].fn===e&&h[f].ctx===a)return f;return!1},once:function(t,e,a){if(typeof t=="object")for(var h in t)this._on(h,t[h],e,!0);else{t=A(t);for(var f=0,m=t.length;f<m;f++)this._on(t[f],e,a,!0)}return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[d(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[d(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,r({layer:t.target,propagatedFrom:t.target},t),!0)}};St.addEventListener=St.on,St.removeEventListener=St.clearAllEventListeners=St.off,St.addOneTimeEventListener=St.once,St.fireEvent=St.fire,St.hasEventListeners=St.listens;var Ji=Qt.extend(St);function F(t,e,a){this.x=a?Math.round(t):t,this.y=a?Math.round(e):e}var jn=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};F.prototype={clone:function(){return new F(this.x,this.y)},add:function(t){return this.clone()._add(Z(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(Z(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new F(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new F(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=jn(this.x),this.y=jn(this.y),this},distanceTo:function(t){t=Z(t);var e=t.x-this.x,a=t.y-this.y;return Math.sqrt(e*e+a*a)},equals:function(t){return t=Z(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=Z(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+M(this.x)+", "+M(this.y)+")"}};function Z(t,e,a){return t instanceof F?t:N(t)?new F(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new F(t.x,t.y):new F(t,e,a)}function et(t,e){if(t)for(var a=e?[t,e]:t,h=0,f=a.length;h<f;h++)this.extend(a[h])}et.prototype={extend:function(t){var e,a;if(!t)return this;if(t instanceof F||typeof t[0]=="number"||"x"in t)e=a=Z(t);else if(t=At(t),e=t.min,a=t.max,!e||!a)return this;return!this.min&&!this.max?(this.min=e.clone(),this.max=a.clone()):(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(a.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(a.y,this.max.y)),this},getCenter:function(t){return Z((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return Z(this.min.x,this.max.y)},getTopRight:function(){return Z(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,a;return typeof t[0]=="number"||t instanceof F?t=Z(t):t=At(t),t instanceof et?(e=t.min,a=t.max):e=a=t,e.x>=this.min.x&&a.x<=this.max.x&&e.y>=this.min.y&&a.y<=this.max.y},intersects:function(t){t=At(t);var e=this.min,a=this.max,h=t.min,f=t.max,m=f.x>=e.x&&h.x<=a.x,g=f.y>=e.y&&h.y<=a.y;return m&&g},overlaps:function(t){t=At(t);var e=this.min,a=this.max,h=t.min,f=t.max,m=f.x>e.x&&h.x<a.x,g=f.y>e.y&&h.y<a.y;return m&&g},isValid:function(){return!!(this.min&&this.max)},pad:function(t){var e=this.min,a=this.max,h=Math.abs(e.x-a.x)*t,f=Math.abs(e.y-a.y)*t;return At(Z(e.x-h,e.y-f),Z(a.x+h,a.y+f))},equals:function(t){return t?(t=At(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight())):!1}};function At(t,e){return!t||t instanceof et?t:new et(t,e)}function Ct(t,e){if(t)for(var a=e?[t,e]:t,h=0,f=a.length;h<f;h++)this.extend(a[h])}Ct.prototype={extend:function(t){var e=this._southWest,a=this._northEast,h,f;if(t instanceof Y)h=t,f=t;else if(t instanceof Ct){if(h=t._southWest,f=t._northEast,!h||!f)return this}else return t?this.extend($(t)||rt(t)):this;return!e&&!a?(this._southWest=new Y(h.lat,h.lng),this._northEast=new Y(f.lat,f.lng)):(e.lat=Math.min(h.lat,e.lat),e.lng=Math.min(h.lng,e.lng),a.lat=Math.max(f.lat,a.lat),a.lng=Math.max(f.lng,a.lng)),this},pad:function(t){var e=this._southWest,a=this._northEast,h=Math.abs(e.lat-a.lat)*t,f=Math.abs(e.lng-a.lng)*t;return new Ct(new Y(e.lat-h,e.lng-f),new Y(a.lat+h,a.lng+f))},getCenter:function(){return new Y((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new Y(this.getNorth(),this.getWest())},getSouthEast:function(){return new Y(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){typeof t[0]=="number"||t instanceof Y||"lat"in t?t=$(t):t=rt(t);var e=this._southWest,a=this._northEast,h,f;return t instanceof Ct?(h=t.getSouthWest(),f=t.getNorthEast()):h=f=t,h.lat>=e.lat&&f.lat<=a.lat&&h.lng>=e.lng&&f.lng<=a.lng},intersects:function(t){t=rt(t);var e=this._southWest,a=this._northEast,h=t.getSouthWest(),f=t.getNorthEast(),m=f.lat>=e.lat&&h.lat<=a.lat,g=f.lng>=e.lng&&h.lng<=a.lng;return m&&g},overlaps:function(t){t=rt(t);var e=this._southWest,a=this._northEast,h=t.getSouthWest(),f=t.getNorthEast(),m=f.lat>e.lat&&h.lat<a.lat,g=f.lng>e.lng&&h.lng<a.lng;return m&&g},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return t?(t=rt(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function rt(t,e){return t instanceof Ct?t:new Ct(t,e)}function Y(t,e,a){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,a!==void 0&&(this.alt=+a)}Y.prototype={equals:function(t,e){if(!t)return!1;t=$(t);var a=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return a<=(e===void 0?1e-9:e)},toString:function(t){return"LatLng("+M(this.lat,t)+", "+M(this.lng,t)+")"},distanceTo:function(t){return ai.distance(this,$(t))},wrap:function(){return ai.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,a=e/Math.cos(Math.PI/180*this.lat);return rt([this.lat-e,this.lng-a],[this.lat+e,this.lng+a])},clone:function(){return new Y(this.lat,this.lng,this.alt)}};function $(t,e,a){return t instanceof Y?t:N(t)&&typeof t[0]!="object"?t.length===3?new Y(t[0],t[1],t[2]):t.length===2?new Y(t[0],t[1]):null:t==null?t:typeof t=="object"&&"lat"in t?new Y(t.lat,"lng"in t?t.lng:t.lon,t.alt):e===void 0?null:new Y(t,e,a)}var Xt={latLngToPoint:function(t,e){var a=this.projection.project(t),h=this.scale(e);return this.transformation._transform(a,h)},pointToLatLng:function(t,e){var a=this.scale(e),h=this.transformation.untransform(t,a);return this.projection.unproject(h)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,a=this.scale(t),h=this.transformation.transform(e.min,a),f=this.transformation.transform(e.max,a);return new et(h,f)},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?y(t.lng,this.wrapLng,!0):t.lng,a=this.wrapLat?y(t.lat,this.wrapLat,!0):t.lat,h=t.alt;return new Y(a,e,h)},wrapLatLngBounds:function(t){var e=t.getCenter(),a=this.wrapLatLng(e),h=e.lat-a.lat,f=e.lng-a.lng;if(h===0&&f===0)return t;var m=t.getSouthWest(),g=t.getNorthEast(),x=new Y(m.lat-h,m.lng-f),w=new Y(g.lat-h,g.lng-f);return new Ct(x,w)}},ai=r({},Xt,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var a=Math.PI/180,h=t.lat*a,f=e.lat*a,m=Math.sin((e.lat-t.lat)*a/2),g=Math.sin((e.lng-t.lng)*a/2),x=m*m+Math.cos(h)*Math.cos(f)*g*g,w=2*Math.atan2(Math.sqrt(x),Math.sqrt(1-x));return this.R*w}}),Hn=6378137,ms={R:Hn,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,a=this.MAX_LATITUDE,h=Math.max(Math.min(a,t.lat),-a),f=Math.sin(h*e);return new F(this.R*t.lng*e,this.R*Math.log((1+f)/(1-f))/2)},unproject:function(t){var e=180/Math.PI;return new Y((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=Hn*Math.PI;return new et([-t,-t],[t,t])}()};function _s(t,e,a,h){if(N(t)){this._a=t[0],this._b=t[1],this._c=t[2],this._d=t[3];return}this._a=t,this._b=e,this._c=a,this._d=h}_s.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new F((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};function te(t,e,a,h){return new _s(t,e,a,h)}var ps=r({},ai,{code:"EPSG:3857",projection:ms,transformation:function(){var t=.5/(Math.PI*ms.R);return te(t,.5,-t,.5)}()}),oc=r({},ps,{code:"EPSG:900913"});function Wn(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function $n(t,e){var a="",h,f,m,g,x,w;for(h=0,m=t.length;h<m;h++){for(x=t[h],f=0,g=x.length;f<g;f++)w=x[f],a+=(f?"L":"M")+w.x+" "+w.y;a+=e?k.svg?"z":"x":""}return a||"M0 0"}var gs=document.documentElement.style,Ce="ActiveXObject"in window,rc=Ce&&!document.addEventListener,Vn="msLaunchUri"in navigator&&!("documentMode"in document),vs=jt("webkit"),Qn=jt("android"),Xn=jt("android 2")||jt("android 3"),hc=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),lc=Qn&&jt("Google")&&hc<537&&!("AudioNode"in window),ys=!!window.opera,Kn=!Vn&&jt("chrome"),Yn=jt("gecko")&&!vs&&!ys&&!Ce,uc=!Kn&&jt("safari"),Jn=jt("phantom"),ta="OTransition"in gs,cc=navigator.platform.indexOf("Win")===0,ia=Ce&&"transition"in gs,Ms="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!Xn,ea="MozPerspective"in gs,fc=!window.L_DISABLE_3D&&(ia||Ms||ea)&&!ta&&!Jn,ie=typeof orientation<"u"||jt("mobile"),dc=ie&&vs,mc=ie&&Ms,sa=!window.PointerEvent&&window.MSPointerEvent,na=!!(window.PointerEvent||sa),aa="ontouchstart"in window||!!window.TouchEvent,_c=!window.L_NO_TOUCH&&(aa||na),pc=ie&&ys,gc=ie&&Yn,vc=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,yc=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",p,e),window.removeEventListener("testPassiveEventSupport",p,e)}catch{}return t}(),Mc=function(){return!!document.createElement("canvas").getContext}(),xs=!!(document.createElementNS&&Wn("svg").createSVGRect),xc=!!xs&&function(){var t=document.createElement("div");return t.innerHTML="<svg/>",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),wc=!xs&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&typeof e.adj=="object"}catch{return!1}}(),bc=navigator.platform.indexOf("Mac")===0,Lc=navigator.platform.indexOf("Linux")===0;function jt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var k={ie:Ce,ielt9:rc,edge:Vn,webkit:vs,android:Qn,android23:Xn,androidStock:lc,opera:ys,chrome:Kn,gecko:Yn,safari:uc,phantom:Jn,opera12:ta,win:cc,ie3d:ia,webkit3d:Ms,gecko3d:ea,any3d:fc,mobile:ie,mobileWebkit:dc,mobileWebkit3d:mc,msPointer:sa,pointer:na,touch:_c,touchNative:aa,mobileOpera:pc,mobileGecko:gc,retina:vc,passiveEvents:yc,canvas:Mc,svg:xs,vml:wc,inlineSvg:xc,mac:bc,linux:Lc},oa=k.msPointer?"MSPointerDown":"pointerdown",ra=k.msPointer?"MSPointerMove":"pointermove",ha=k.msPointer?"MSPointerUp":"pointerup",la=k.msPointer?"MSPointerCancel":"pointercancel",ws={touchstart:oa,touchmove:ra,touchend:ha,touchcancel:la},ua={touchstart:Sc,touchmove:Te,touchend:Te,touchcancel:Te},Pi={},ca=!1;function Pc(t,e,a){return e==="touchstart"&&Ec(),ua[e]?(a=ua[e].bind(this,a),t.addEventListener(ws[e],a,!1),a):(console.warn("wrong event specified:",e),p)}function Ac(t,e,a){if(!ws[e]){console.warn("wrong event specified:",e);return}t.removeEventListener(ws[e],a,!1)}function Cc(t){Pi[t.pointerId]=t}function Tc(t){Pi[t.pointerId]&&(Pi[t.pointerId]=t)}function fa(t){delete Pi[t.pointerId]}function Ec(){ca||(document.addEventListener(oa,Cc,!0),document.addEventListener(ra,Tc,!0),document.addEventListener(ha,fa,!0),document.addEventListener(la,fa,!0),ca=!0)}function Te(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){e.touches=[];for(var a in Pi)e.touches.push(Pi[a]);e.changedTouches=[e],t(e)}}function Sc(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&gt(e),Te(t,e)}function Ic(t){var e={},a,h;for(h in t)a=t[h],e[h]=a&&a.bind?a.bind(t):a;return t=e,e.type="dblclick",e.detail=2,e.isTrusted=!1,e._simulated=!0,e}var Oc=200;function zc(t,e){t.addEventListener("dblclick",e);var a=0,h;function f(m){if(m.detail!==1){h=m.detail;return}if(!(m.pointerType==="mouse"||m.sourceCapabilities&&!m.sourceCapabilities.firesTouchEvents)){var g=ga(m);if(!(g.some(function(w){return w instanceof HTMLLabelElement&&w.attributes.for})&&!g.some(function(w){return w instanceof HTMLInputElement||w instanceof HTMLSelectElement}))){var x=Date.now();x-a<=Oc?(h++,h===2&&e(Ic(m))):h=1,a=x}}}return t.addEventListener("click",f),{dblclick:e,simDblclick:f}}function kc(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var bs=Ie(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ee=Ie(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),da=ee==="webkitTransition"||ee==="OTransition"?ee+"End":"transitionend";function ma(t){return typeof t=="string"?document.getElementById(t):t}function se(t,e){var a=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!a||a==="auto")&&document.defaultView){var h=document.defaultView.getComputedStyle(t,null);a=h?h[e]:null}return a==="auto"?null:a}function Q(t,e,a){var h=document.createElement(t);return h.className=e||"",a&&a.appendChild(h),h}function st(t){var e=t.parentNode;e&&e.removeChild(t)}function Ee(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Ai(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function Ci(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function Ls(t,e){if(t.classList!==void 0)return t.classList.contains(e);var a=Se(t);return a.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(a)}function G(t,e){if(t.classList!==void 0)for(var a=A(e),h=0,f=a.length;h<f;h++)t.classList.add(a[h]);else if(!Ls(t,e)){var m=Se(t);Ps(t,(m?m+" ":"")+e)}}function ot(t,e){t.classList!==void 0?t.classList.remove(e):Ps(t,b((" "+Se(t)+" ").replace(" "+e+" "," ")))}function Ps(t,e){t.className.baseVal===void 0?t.className=e:t.className.baseVal=e}function Se(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}function Ot(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&Nc(t,e)}function Nc(t,e){var a=!1,h="DXImageTransform.Microsoft.Alpha";try{a=t.filters.item(h)}catch{if(e===1)return}e=Math.round(e*100),a?(a.Enabled=e!==100,a.Opacity=e):t.style.filter+=" progid:"+h+"(opacity="+e+")"}function Ie(t){for(var e=document.documentElement.style,a=0;a<t.length;a++)if(t[a]in e)return t[a];return!1}function ui(t,e,a){var h=e||new F(0,0);t.style[bs]=(k.ie3d?"translate("+h.x+"px,"+h.y+"px)":"translate3d("+h.x+"px,"+h.y+"px,0)")+(a?" scale("+a+")":"")}function ht(t,e){t._leaflet_pos=e,k.any3d?ui(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function ci(t){return t._leaflet_pos||new F(0,0)}var ne,ae,As;if("onselectstart"in document)ne=function(){q(window,"selectstart",gt)},ae=function(){J(window,"selectstart",gt)};else{var oe=Ie(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ne=function(){if(oe){var t=document.documentElement.style;As=t[oe],t[oe]="none"}},ae=function(){oe&&(document.documentElement.style[oe]=As,As=void 0)}}function Cs(){q(window,"dragstart",gt)}function Ts(){J(window,"dragstart",gt)}var Oe,Es;function Ss(t){for(;t.tabIndex===-1;)t=t.parentNode;t.style&&(ze(),Oe=t,Es=t.style.outlineStyle,t.style.outlineStyle="none",q(window,"keydown",ze))}function ze(){Oe&&(Oe.style.outlineStyle=Es,Oe=void 0,Es=void 0,J(window,"keydown",ze))}function _a(t){do t=t.parentNode;while((!t.offsetWidth||!t.offsetHeight)&&t!==document.body);return t}function Is(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Bc={__proto__:null,TRANSFORM:bs,TRANSITION:ee,TRANSITION_END:da,get:ma,getStyle:se,create:Q,remove:st,empty:Ee,toFront:Ai,toBack:Ci,hasClass:Ls,addClass:G,removeClass:ot,setClass:Ps,getClass:Se,setOpacity:Ot,testProp:Ie,setTransform:ui,setPosition:ht,getPosition:ci,get disableTextSelection(){return ne},get enableTextSelection(){return ae},disableImageDrag:Cs,enableImageDrag:Ts,preventOutline:Ss,restoreOutline:ze,getSizedParentNode:_a,getScale:Is};function q(t,e,a,h){if(e&&typeof e=="object")for(var f in e)zs(t,f,e[f],a);else{e=A(e);for(var m=0,g=e.length;m<g;m++)zs(t,e[m],a,h)}return this}var Ht="_leaflet_events";function J(t,e,a,h){if(arguments.length===1)pa(t),delete t[Ht];else if(e&&typeof e=="object")for(var f in e)ks(t,f,e[f],a);else if(e=A(e),arguments.length===2)pa(t,function(x){return j(e,x)!==-1});else for(var m=0,g=e.length;m<g;m++)ks(t,e[m],a,h);return this}function pa(t,e){for(var a in t[Ht]){var h=a.split(/\d/)[0];(!e||e(h))&&ks(t,h,null,null,a)}}var Os={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function zs(t,e,a,h){var f=e+d(a)+(h?"_"+d(h):"");if(t[Ht]&&t[Ht][f])return this;var m=function(x){return a.call(h||t,x||window.event)},g=m;!k.touchNative&&k.pointer&&e.indexOf("touch")===0?m=Pc(t,e,m):k.touch&&e==="dblclick"?m=zc(t,m):"addEventListener"in t?e==="touchstart"||e==="touchmove"||e==="wheel"||e==="mousewheel"?t.addEventListener(Os[e]||e,m,k.passiveEvents?{passive:!1}:!1):e==="mouseenter"||e==="mouseleave"?(m=function(x){x=x||window.event,Bs(t,x)&&g(x)},t.addEventListener(Os[e],m,!1)):t.addEventListener(e,g,!1):t.attachEvent("on"+e,m),t[Ht]=t[Ht]||{},t[Ht][f]=m}function ks(t,e,a,h,f){f=f||e+d(a)+(h?"_"+d(h):"");var m=t[Ht]&&t[Ht][f];if(!m)return this;!k.touchNative&&k.pointer&&e.indexOf("touch")===0?Ac(t,e,m):k.touch&&e==="dblclick"?kc(t,m):"removeEventListener"in t?t.removeEventListener(Os[e]||e,m,!1):t.detachEvent("on"+e,m),t[Ht][f]=null}function fi(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function Ns(t){return zs(t,"wheel",fi),this}function re(t){return q(t,"mousedown touchstart dblclick contextmenu",fi),t._leaflet_disable_click=!0,this}function gt(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function di(t){return gt(t),fi(t),this}function ga(t){if(t.composedPath)return t.composedPath();for(var e=[],a=t.target;a;)e.push(a),a=a.parentNode;return e}function va(t,e){if(!e)return new F(t.clientX,t.clientY);var a=Is(e),h=a.boundingClientRect;return new F((t.clientX-h.left)/a.x-e.clientLeft,(t.clientY-h.top)/a.y-e.clientTop)}var Dc=k.linux&&k.chrome?window.devicePixelRatio:k.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function ya(t){return k.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/Dc:t.deltaY&&t.deltaMode===1?-t.deltaY*20:t.deltaY&&t.deltaMode===2?-t.deltaY*60:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?-t.detail*20:t.detail?t.detail/-32765*60:0}function Bs(t,e){var a=e.relatedTarget;if(!a)return!0;try{for(;a&&a!==t;)a=a.parentNode}catch{return!1}return a!==t}var Rc={__proto__:null,on:q,off:J,stopPropagation:fi,disableScrollPropagation:Ns,disableClickPropagation:re,preventDefault:gt,stop:di,getPropagationPath:ga,getMousePosition:va,getWheelDelta:ya,isExternalTarget:Bs,addListener:q,removeListener:J},Ma=Ji.extend({run:function(t,e,a,h){this.stop(),this._el=t,this._inProgress=!0,this._duration=a||.25,this._easeOutPower=1/Math.max(h||.5,.2),this._startPos=ci(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=nt(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,a=this._duration*1e3;e<a?this._runFrame(this._easeOut(e/a),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var a=this._startPos.add(this._offset.multiplyBy(t));e&&a._round(),ht(this._el,a),this.fire("step")},_complete:function(){pt(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),V=Ji.extend({options:{crs:ps,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=P(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=u(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.zoom!==void 0&&(this._zoom=this._limitZoom(e.zoom)),e.center&&e.zoom!==void 0&&this.setView($(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ee&&k.any3d&&!k.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),q(this._proxy,da,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,a){if(e=e===void 0?this._zoom:this._limitZoom(e),t=this._limitCenter($(t),e,this.options.maxBounds),a=a||{},this._stop(),this._loaded&&!a.reset&&a!==!0){a.animate!==void 0&&(a.zoom=r({animate:a.animate},a.zoom),a.pan=r({animate:a.animate,duration:a.duration},a.pan));var h=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,a.zoom):this._tryAnimatedPan(t,a.pan);if(h)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e,a.pan&&a.pan.noMoveStart),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(k.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(k.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,a){var h=this.getZoomScale(e),f=this.getSize().divideBy(2),m=t instanceof F?t:this.latLngToContainerPoint(t),g=m.subtract(f).multiplyBy(1-1/h),x=this.containerPointToLatLng(f.add(g));return this.setView(x,e,{zoom:a})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():rt(t);var a=Z(e.paddingTopLeft||e.padding||[0,0]),h=Z(e.paddingBottomRight||e.padding||[0,0]),f=this.getBoundsZoom(t,!1,a.add(h));if(f=typeof e.maxZoom=="number"?Math.min(e.maxZoom,f):f,f===1/0)return{center:t.getCenter(),zoom:f};var m=h.subtract(a).divideBy(2),g=this.project(t.getSouthWest(),f),x=this.project(t.getNorthEast(),f),w=this.unproject(g.add(x).divideBy(2).add(m),f);return{center:w,zoom:f}},fitBounds:function(t,e){if(t=rt(t),!t.isValid())throw new Error("Bounds are not valid.");var a=this._getBoundsCenterZoom(t,e);return this.setView(a.center,a.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(t=Z(t).round(),e=e||{},!t.x&&!t.y)return this.fire("moveend");if(e.animate!==!0&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Ma,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){G(this._mapPane,"leaflet-pan-anim");var a=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,a,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,a){if(a=a||{},a.animate===!1||!k.any3d)return this.setView(t,e,a);this._stop();var h=this.project(this.getCenter()),f=this.project(t),m=this.getSize(),g=this._zoom;t=$(t),e=e===void 0?g:e;var x=Math.max(m.x,m.y),w=x*this.getZoomScale(g,e),C=f.distanceTo(h)||1,O=1.42,D=O*O;function U(lt){var He=lt?-1:1,Cf=lt?w:x,Tf=w*w-x*x+He*D*D*C*C,Ef=2*Cf*D*C,$s=Tf/Ef,to=Math.sqrt($s*$s+1)-$s,Sf=to<1e-9?-18:Math.log(to);return Sf}function xt(lt){return(Math.exp(lt)-Math.exp(-lt))/2}function mt(lt){return(Math.exp(lt)+Math.exp(-lt))/2}function kt(lt){return xt(lt)/mt(lt)}var Tt=U(0);function zi(lt){return x*(mt(Tt)/mt(Tt+O*lt))}function bf(lt){return x*(mt(Tt)*kt(Tt+O*lt)-xt(Tt))/D}function Lf(lt){return 1-Math.pow(1-lt,1.5)}var Pf=Date.now(),Ya=(U(1)-Tt)/O,Af=a.duration?1e3*a.duration:1e3*Ya*.8;function Ja(){var lt=(Date.now()-Pf)/Af,He=Lf(lt)*Ya;lt<=1?(this._flyToFrame=nt(Ja,this),this._move(this.unproject(h.add(f.subtract(h).multiplyBy(bf(He)/C)),g),this.getScaleZoom(x/zi(He),g),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,a.noMoveStart),Ja.call(this),this},flyToBounds:function(t,e){var a=this._getBoundsCenterZoom(t,e);return this.flyTo(a.center,a.zoom,e)},setMaxBounds:function(t){return t=rt(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var a=this.getCenter(),h=this._limitCenter(a,this._zoom,rt(t));return a.equals(h)||this.panTo(h,e),this._enforcingBounds=!1,this},panInside:function(t,e){e=e||{};var a=Z(e.paddingTopLeft||e.padding||[0,0]),h=Z(e.paddingBottomRight||e.padding||[0,0]),f=this.project(this.getCenter()),m=this.project(t),g=this.getPixelBounds(),x=At([g.min.add(a),g.max.subtract(h)]),w=x.getSize();if(!x.contains(m)){this._enforcingBounds=!0;var C=m.subtract(x.getCenter()),O=x.extend(m).getSize().subtract(w);f.x+=C.x<0?-O.x:O.x,f.y+=C.y<0?-O.y:O.y,this.panTo(this.unproject(f),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=r({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var a=this.getSize(),h=e.divideBy(2).round(),f=a.divideBy(2).round(),m=h.subtract(f);return!m.x&&!m.y?this:(t.animate&&t.pan?this.panBy(m):(t.pan&&this._rawPanBy(m),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(u(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:a}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=r({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=u(this._handleGeolocationResponse,this),a=u(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,a,t):navigator.geolocation.getCurrentPosition(e,a,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,a=t.message||(e===1?"permission denied":e===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+a+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=t.coords.latitude,a=t.coords.longitude,h=new Y(e,a),f=h.toBounds(t.coords.accuracy*2),m=this._locateOptions;if(m.setView){var g=this.getBoundsZoom(f);this.setView(h,m.maxZoom?Math.min(g,m.maxZoom):g)}var x={latlng:h,bounds:f,timestamp:t.timestamp};for(var w in t.coords)typeof t.coords[w]=="number"&&(x[w]=t.coords[w]);this.fire("locationfound",x)}},addHandler:function(t,e){if(!e)return this;var a=this[t]=new e(this);return this._handlers.push(a),this.options[t]&&a.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),st(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(pt(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)st(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var a="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),h=Q("div",a,e||this._mapPane);return t&&(this._panes[t]=h),h},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),a=this.unproject(t.getTopRight());return new Ct(e,a)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,a){t=rt(t),a=Z(a||[0,0]);var h=this.getZoom()||0,f=this.getMinZoom(),m=this.getMaxZoom(),g=t.getNorthWest(),x=t.getSouthEast(),w=this.getSize().subtract(a),C=At(this.project(x,h),this.project(g,h)).getSize(),O=k.any3d?this.options.zoomSnap:1,D=w.x/C.x,U=w.y/C.y,xt=e?Math.max(D,U):Math.min(D,U);return h=this.getScaleZoom(xt,h),O&&(h=Math.round(h/(O/100))*(O/100),h=e?Math.ceil(h/O)*O:Math.floor(h/O)*O),Math.max(f,Math.min(m,h))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new F(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var a=this._getTopLeftPoint(t,e);return new et(a,a.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===void 0?this.getZoom():t)},getPane:function(t){return typeof t=="string"?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var a=this.options.crs;return e=e===void 0?this._zoom:e,a.scale(t)/a.scale(e)},getScaleZoom:function(t,e){var a=this.options.crs;e=e===void 0?this._zoom:e;var h=a.zoom(t*a.scale(e));return isNaN(h)?1/0:h},project:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.latLngToPoint($(t),e)},unproject:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.pointToLatLng(Z(t),e)},layerPointToLatLng:function(t){var e=Z(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project($(t))._round();return e._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng($(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(rt(t))},distance:function(t,e){return this.options.crs.distance($(t),$(e))},containerPointToLayerPoint:function(t){return Z(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return Z(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(Z(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint($(t)))},mouseEventToContainerPoint:function(t){return va(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=ma(t);if(e){if(e._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");q(e,"scroll",this._onScroll,this),this._containerId=d(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&k.any3d,G(t,"leaflet-container"+(k.touch?" leaflet-touch":"")+(k.retina?" leaflet-retina":"")+(k.ielt9?" leaflet-oldie":"")+(k.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=se(t,"position");e!=="absolute"&&e!=="relative"&&e!=="fixed"&&e!=="sticky"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ht(this._mapPane,new F(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(G(t.markerPane,"leaflet-zoom-hide"),G(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,a){ht(this._mapPane,new F(0,0));var h=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var f=this._zoom!==e;this._moveStart(f,a)._move(t,e)._moveEnd(f),this.fire("viewreset"),h&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,a,h){e===void 0&&(e=this._zoom);var f=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),h?a&&a.pinch&&this.fire("zoom",a):((f||a&&a.pinch)&&this.fire("zoom",a),this.fire("move",a)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return pt(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){ht(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[d(this._container)]=this;var e=t?J:q;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),k.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){pt(this._resizeRequest),this._resizeRequest=nt(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var a=[],h,f=e==="mouseout"||e==="mouseover",m=t.target||t.srcElement,g=!1;m;){if(h=this._targets[d(m)],h&&(e==="click"||e==="preclick")&&this._draggableMoved(h)){g=!0;break}if(h&&h.listens(e,!0)&&(f&&!Bs(m,t)||(a.push(h),f))||m===this._container)break;m=m.parentNode}return!a.length&&!g&&!f&&this.listens(e,!0)&&(a=[this]),a},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(e))){var a=t.type;a==="mousedown"&&Ss(e),this._fireDOMEvent(t,a)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,a){if(t.type==="click"){var h=r({},t);h.type="preclick",this._fireDOMEvent(h,h.type,a)}var f=this._findEventTargets(t,e);if(a){for(var m=[],g=0;g<a.length;g++)a[g].listens(e,!0)&&m.push(a[g]);f=m.concat(f)}if(f.length){e==="contextmenu"&&gt(t);var x=f[0],w={originalEvent:t};if(t.type!=="keypress"&&t.type!=="keydown"&&t.type!=="keyup"){var C=x.getLatLng&&(!x._radius||x._radius<=10);w.containerPoint=C?this.latLngToContainerPoint(x.getLatLng()):this.mouseEventToContainerPoint(t),w.layerPoint=this.containerPointToLayerPoint(w.containerPoint),w.latlng=C?x.getLatLng():this.layerPointToLatLng(w.layerPoint)}for(g=0;g<f.length;g++)if(f[g].fire(e,w,!0),w.originalEvent._stopped||f[g].options.bubblingMouseEvents===!1&&j(this._mouseEvents,e)!==-1)return}},_draggableMoved:function(t){return t=t.dragging&&t.dragging.enabled()?t:this,t.dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return ci(this._mapPane)||new F(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){var a=t&&e!==void 0?this._getNewPixelOrigin(t,e):this.getPixelOrigin();return a.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var a=this.getSize()._divideBy(2);return this.project(t,e)._subtract(a)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,a){var h=this._getNewPixelOrigin(a,e);return this.project(t,e)._subtract(h)},_latLngBoundsToNewLayerBounds:function(t,e,a){var h=this._getNewPixelOrigin(a,e);return At([this.project(t.getSouthWest(),e)._subtract(h),this.project(t.getNorthWest(),e)._subtract(h),this.project(t.getSouthEast(),e)._subtract(h),this.project(t.getNorthEast(),e)._subtract(h)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,a){if(!a)return t;var h=this.project(t,e),f=this.getSize().divideBy(2),m=new et(h.subtract(f),h.add(f)),g=this._getBoundsOffset(m,a,e);return Math.abs(g.x)<=1&&Math.abs(g.y)<=1?t:this.unproject(h.add(g),e)},_limitOffset:function(t,e){if(!e)return t;var a=this.getPixelBounds(),h=new et(a.min.add(t),a.max.add(t));return t.add(this._getBoundsOffset(h,e))},_getBoundsOffset:function(t,e,a){var h=At(this.project(e.getNorthEast(),a),this.project(e.getSouthWest(),a)),f=h.min.subtract(t.min),m=h.max.subtract(t.max),g=this._rebound(f.x,-m.x),x=this._rebound(f.y,-m.y);return new F(g,x)},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),a=this.getMaxZoom(),h=k.any3d?this.options.zoomSnap:1;return h&&(t=Math.round(t/h)*h),Math.max(e,Math.min(a,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ot(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var a=this._getCenterOffset(t)._trunc();return(e&&e.animate)!==!0&&!this.getSize().contains(a)?!1:(this.panBy(a,e),!0)},_createAnimProxy:function(){var t=this._proxy=Q("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(e){var a=bs,h=this._proxy.style[a];ui(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),h===this._proxy.style[a]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){st(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();ui(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,a){if(this._animatingZoom)return!0;if(a=a||{},!this._zoomAnimated||a.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var h=this.getZoomScale(e),f=this._getCenterOffset(t)._divideBy(1-1/h);return a.animate!==!0&&!this.getSize().contains(f)?!1:(nt(function(){this._moveStart(!0,a.noMoveStart||!1)._animateZoom(t,e,!0)},this),!0)},_animateZoom:function(t,e,a,h){this._mapPane&&(a&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,G(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:h}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(u(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ot(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Zc(t,e){return new V(t,e)}var Bt=Qt.extend({options:{position:"topright"},initialize:function(t){P(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),a=this.getPosition(),h=t._controlCorners[a];return G(e,"leaflet-control"),a.indexOf("bottom")!==-1?h.insertBefore(e,h.firstChild):h.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(st(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),he=function(t){return new Bt(t)};V.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",a=this._controlContainer=Q("div",e+"control-container",this._container);function h(f,m){var g=e+f+" "+e+m;t[f+m]=Q("div",g,a)}h("top","left"),h("top","right"),h("bottom","left"),h("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)st(this._controlCorners[t]);st(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var xa=Bt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,a,h){return a<h?-1:h<a?1:0}},initialize:function(t,e,a){P(this,a),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var h in t)this._addLayer(t[h],h);for(h in e)this._addLayer(e[h],h,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return Bt.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(d(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){G(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(G(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ot(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ot(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=Q("div",t),a=this.options.collapsed;e.setAttribute("aria-haspopup",!0),re(e),Ns(e);var h=this._section=Q("section",t+"-list");a&&(this._map.on("click",this.collapse,this),q(e,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var f=this._layersLink=Q("a",t+"-toggle",e);f.href="#",f.title="Layers",f.setAttribute("role","button"),q(f,{keydown:function(m){m.keyCode===13&&this._expandSafely()},click:function(m){gt(m),this._expandSafely()}},this),a||this.expand(),this._baseLayersList=Q("div",t+"-base",h),this._separator=Q("div",t+"-separator",h),this._overlaysList=Q("div",t+"-overlays",h),e.appendChild(h)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&d(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,a){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:a}),this.options.sortLayers&&this._layers.sort(u(function(h,f){return this.options.sortFunction(h.layer,f.layer,h.name,f.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Ee(this._baseLayersList),Ee(this._overlaysList),this._layerControlInputs=[];var t,e,a,h,f=0;for(a=0;a<this._layers.length;a++)h=this._layers[a],this._addItem(h),e=e||h.overlay,t=t||!h.overlay,f+=h.overlay?0:1;return this.options.hideSingleBase&&(t=t&&f>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(d(t.target)),a=e.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;a&&this._map.fire(a,e)},_createRadioElement:function(t,e){var a='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",h=document.createElement("div");return h.innerHTML=a,h.firstChild},_addItem:function(t){var e=document.createElement("label"),a=this._map.hasLayer(t.layer),h;t.overlay?(h=document.createElement("input"),h.type="checkbox",h.className="leaflet-control-layers-selector",h.defaultChecked=a):h=this._createRadioElement("leaflet-base-layers_"+d(this),a),this._layerControlInputs.push(h),h.layerId=d(t.layer),q(h,"click",this._onInputClick,this);var f=document.createElement("span");f.innerHTML=" "+t.name;var m=document.createElement("span");e.appendChild(m),m.appendChild(h),m.appendChild(f);var g=t.overlay?this._overlaysList:this._baseLayersList;return g.appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){if(!this._preventClick){var t=this._layerControlInputs,e,a,h=[],f=[];this._handlingClick=!0;for(var m=t.length-1;m>=0;m--)e=t[m],a=this._getLayer(e.layerId).layer,e.checked?h.push(a):e.checked||f.push(a);for(m=0;m<f.length;m++)this._map.hasLayer(f[m])&&this._map.removeLayer(f[m]);for(m=0;m<h.length;m++)this._map.hasLayer(h[m])||this._map.addLayer(h[m]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t=this._layerControlInputs,e,a,h=this._map.getZoom(),f=t.length-1;f>=0;f--)e=t[f],a=this._getLayer(e.layerId).layer,e.disabled=a.options.minZoom!==void 0&&h<a.options.minZoom||a.options.maxZoom!==void 0&&h>a.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,q(t,"click",gt),this.expand();var e=this;setTimeout(function(){J(t,"click",gt),e._preventClick=!1})}}),Fc=function(t,e,a){return new xa(t,e,a)},Ds=Bt.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",a=Q("div",e+" leaflet-bar"),h=this.options;return this._zoomInButton=this._createButton(h.zoomInText,h.zoomInTitle,e+"-in",a,this._zoomIn),this._zoomOutButton=this._createButton(h.zoomOutText,h.zoomOutTitle,e+"-out",a,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),a},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,a,h,f){var m=Q("a",a,h);return m.innerHTML=t,m.href="#",m.title=e,m.setAttribute("role","button"),m.setAttribute("aria-label",e),re(m),q(m,"click",di),q(m,"click",f,this),q(m,"click",this._refocusOnMap,this),m},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ot(this._zoomInButton,e),ot(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(G(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(G(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});V.mergeOptions({zoomControl:!0}),V.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ds,this.addControl(this.zoomControl))});var qc=function(t){return new Ds(t)},wa=Bt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",a=Q("div",e),h=this.options;return this._addScales(h,e+"-line",a),t.on(h.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),a},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,a){t.metric&&(this._mScale=Q("div",e,a)),t.imperial&&(this._iScale=Q("div",e,a))},_update:function(){var t=this._map,e=t.getSize().y/2,a=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(a)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),a=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,a,e/t)},_updateImperial:function(t){var e=t*3.2808399,a,h,f;e>5280?(a=e/5280,h=this._getRoundNum(a),this._updateScale(this._iScale,h+" mi",h/a)):(f=this._getRoundNum(e),this._updateScale(this._iScale,f+" ft",f/e))},_updateScale:function(t,e,a){t.style.width=Math.round(this.options.maxWidth*a)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),a=t/e;return a=a>=10?10:a>=5?5:a>=3?3:a>=2?2:1,e*a}}),Gc=function(t){return new wa(t)},Uc='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Rs=Bt.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(k.inlineSvg?Uc+" ":"")+"Leaflet</a>"},initialize:function(t){P(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=Q("div","leaflet-control-attribution"),re(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var a=[];this.options.prefix&&a.push(this.options.prefix),t.length&&a.push(t.join(", ")),this._container.innerHTML=a.join(' <span aria-hidden="true">|</span> ')}}});V.mergeOptions({attributionControl:!0}),V.addInitHook(function(){this.options.attributionControl&&new Rs().addTo(this)});var jc=function(t){return new Rs(t)};Bt.Layers=xa,Bt.Zoom=Ds,Bt.Scale=wa,Bt.Attribution=Rs,he.layers=Fc,he.zoom=qc,he.scale=Gc,he.attribution=jc;var Wt=Qt.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Wt.addTo=function(t,e){return t.addHandler(e,this),this};var Hc={Events:St},ba=k.touch?"touchstart mousedown":"mousedown",oi=Ji.extend({options:{clickTolerance:3},initialize:function(t,e,a,h){P(this,h),this._element=t,this._dragStartTarget=e||t,this._preventOutline=a},enable:function(){this._enabled||(q(this._dragStartTarget,ba,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(oi._dragging===this&&this.finishDrag(!0),J(this._dragStartTarget,ba,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!Ls(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){oi._dragging===this&&this.finishDrag();return}if(!(oi._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(oi._dragging=this,this._preventOutline&&Ss(this._element),Cs(),ne(),!this._moving)){this.fire("down");var e=t.touches?t.touches[0]:t,a=_a(this._element);this._startPoint=new F(e.clientX,e.clientY),this._startPos=ci(this._element),this._parentScale=Is(a);var h=t.type==="mousedown";q(document,h?"mousemove":"touchmove",this._onMove,this),q(document,h?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var e=t.touches&&t.touches.length===1?t.touches[0]:t,a=new F(e.clientX,e.clientY)._subtract(this._startPoint);!a.x&&!a.y||Math.abs(a.x)+Math.abs(a.y)<this.options.clickTolerance||(a.x/=this._parentScale.x,a.y/=this._parentScale.y,gt(t),this._moved||(this.fire("dragstart"),this._moved=!0,G(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),G(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(a),this._moving=!0,this._lastEvent=t,this._updatePosition())}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),ht(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){ot(document.body,"leaflet-dragging"),this._lastTarget&&(ot(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),J(document,"mousemove touchmove",this._onMove,this),J(document,"mouseup touchend touchcancel",this._onUp,this),Ts(),ae();var e=this._moved&&this._moving;this._moving=!1,oi._dragging=!1,e&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function La(t,e,a){var h,f=[1,4,2,8],m,g,x,w,C,O,D,U;for(m=0,O=t.length;m<O;m++)t[m]._code=mi(t[m],e);for(x=0;x<4;x++){for(D=f[x],h=[],m=0,O=t.length,g=O-1;m<O;g=m++)w=t[m],C=t[g],w._code&D?C._code&D||(U=ke(C,w,D,e,a),U._code=mi(U,e),h.push(U)):(C._code&D&&(U=ke(C,w,D,e,a),U._code=mi(U,e),h.push(U)),h.push(w));t=h}return t}function Pa(t,e){var a,h,f,m,g,x,w,C,O;if(!t||t.length===0)throw new Error("latlngs not passed");zt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var D=$([0,0]),U=rt(t),xt=U.getNorthWest().distanceTo(U.getSouthWest())*U.getNorthEast().distanceTo(U.getNorthWest());xt<1700&&(D=Zs(t));var mt=t.length,kt=[];for(a=0;a<mt;a++){var Tt=$(t[a]);kt.push(e.project($([Tt.lat-D.lat,Tt.lng-D.lng])))}for(x=w=C=0,a=0,h=mt-1;a<mt;h=a++)f=kt[a],m=kt[h],g=f.y*m.x-m.y*f.x,w+=(f.x+m.x)*g,C+=(f.y+m.y)*g,x+=g*3;x===0?O=kt[0]:O=[w/x,C/x];var zi=e.unproject(Z(O));return $([zi.lat+D.lat,zi.lng+D.lng])}function Zs(t){for(var e=0,a=0,h=0,f=0;f<t.length;f++){var m=$(t[f]);e+=m.lat,a+=m.lng,h++}return $([e/h,a/h])}var Wc={__proto__:null,clipPolygon:La,polygonCenter:Pa,centroid:Zs};function Aa(t,e){if(!e||!t.length)return t.slice();var a=e*e;return t=Qc(t,a),t=Vc(t,a),t}function Ca(t,e,a){return Math.sqrt(le(t,e,a,!0))}function $c(t,e,a){return le(t,e,a)}function Vc(t,e){var a=t.length,h=typeof Uint8Array<"u"?Uint8Array:Array,f=new h(a);f[0]=f[a-1]=1,Fs(t,f,e,0,a-1);var m,g=[];for(m=0;m<a;m++)f[m]&&g.push(t[m]);return g}function Fs(t,e,a,h,f){var m=0,g,x,w;for(x=h+1;x<=f-1;x++)w=le(t[x],t[h],t[f],!0),w>m&&(g=x,m=w);m>a&&(e[g]=1,Fs(t,e,a,h,g),Fs(t,e,a,g,f))}function Qc(t,e){for(var a=[t[0]],h=1,f=0,m=t.length;h<m;h++)Xc(t[h],t[f])>e&&(a.push(t[h]),f=h);return f<m-1&&a.push(t[m-1]),a}var Ta;function Ea(t,e,a,h,f){var m=h?Ta:mi(t,a),g=mi(e,a),x,w,C;for(Ta=g;;){if(!(m|g))return[t,e];if(m&g)return!1;x=m||g,w=ke(t,e,x,a,f),C=mi(w,a),x===m?(t=w,m=C):(e=w,g=C)}}function ke(t,e,a,h,f){var m=e.x-t.x,g=e.y-t.y,x=h.min,w=h.max,C,O;return a&8?(C=t.x+m*(w.y-t.y)/g,O=w.y):a&4?(C=t.x+m*(x.y-t.y)/g,O=x.y):a&2?(C=w.x,O=t.y+g*(w.x-t.x)/m):a&1&&(C=x.x,O=t.y+g*(x.x-t.x)/m),new F(C,O,f)}function mi(t,e){var a=0;return t.x<e.min.x?a|=1:t.x>e.max.x&&(a|=2),t.y<e.min.y?a|=4:t.y>e.max.y&&(a|=8),a}function Xc(t,e){var a=e.x-t.x,h=e.y-t.y;return a*a+h*h}function le(t,e,a,h){var f=e.x,m=e.y,g=a.x-f,x=a.y-m,w=g*g+x*x,C;return w>0&&(C=((t.x-f)*g+(t.y-m)*x)/w,C>1?(f=a.x,m=a.y):C>0&&(f+=g*C,m+=x*C)),g=t.x-f,x=t.y-m,h?g*g+x*x:new F(f,m)}function zt(t){return!N(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function Sa(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),zt(t)}function Ia(t,e){var a,h,f,m,g,x,w,C;if(!t||t.length===0)throw new Error("latlngs not passed");zt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var O=$([0,0]),D=rt(t),U=D.getNorthWest().distanceTo(D.getSouthWest())*D.getNorthEast().distanceTo(D.getNorthWest());U<1700&&(O=Zs(t));var xt=t.length,mt=[];for(a=0;a<xt;a++){var kt=$(t[a]);mt.push(e.project($([kt.lat-O.lat,kt.lng-O.lng])))}for(a=0,h=0;a<xt-1;a++)h+=mt[a].distanceTo(mt[a+1])/2;if(h===0)C=mt[0];else for(a=0,m=0;a<xt-1;a++)if(g=mt[a],x=mt[a+1],f=g.distanceTo(x),m+=f,m>h){w=(m-h)/f,C=[x.x-w*(x.x-g.x),x.y-w*(x.y-g.y)];break}var Tt=e.unproject(Z(C));return $([Tt.lat+O.lat,Tt.lng+O.lng])}var Kc={__proto__:null,simplify:Aa,pointToSegmentDistance:Ca,closestPointOnSegment:$c,clipSegment:Ea,_getEdgeIntersection:ke,_getBitCode:mi,_sqClosestPointOnSegment:le,isFlat:zt,_flat:Sa,polylineCenter:Ia},qs={project:function(t){return new F(t.lng,t.lat)},unproject:function(t){return new Y(t.y,t.x)},bounds:new et([-180,-90],[180,90])},Gs={R:6378137,R_MINOR:6356752314245179e-9,bounds:new et([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var e=Math.PI/180,a=this.R,h=t.lat*e,f=this.R_MINOR/a,m=Math.sqrt(1-f*f),g=m*Math.sin(h),x=Math.tan(Math.PI/4-h/2)/Math.pow((1-g)/(1+g),m/2);return h=-a*Math.log(Math.max(x,1e-10)),new F(t.lng*e*a,h)},unproject:function(t){for(var e=180/Math.PI,a=this.R,h=this.R_MINOR/a,f=Math.sqrt(1-h*h),m=Math.exp(-t.y/a),g=Math.PI/2-2*Math.atan(m),x=0,w=.1,C;x<15&&Math.abs(w)>1e-7;x++)C=f*Math.sin(g),C=Math.pow((1-C)/(1+C),f/2),w=Math.PI/2-2*Math.atan(m*C)-g,g+=w;return new Y(g*e,t.x*e/a)}},Yc={__proto__:null,LonLat:qs,Mercator:Gs,SphericalMercator:ms},Jc=r({},ai,{code:"EPSG:3395",projection:Gs,transformation:function(){var t=.5/(Math.PI*Gs.R);return te(t,.5,-t,.5)}()}),Oa=r({},ai,{code:"EPSG:4326",projection:qs,transformation:te(1/180,1,-1/180,.5)}),tf=r({},Xt,{projection:qs,transformation:te(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var a=e.lng-t.lng,h=e.lat-t.lat;return Math.sqrt(a*a+h*h)},infinite:!0});Xt.Earth=ai,Xt.EPSG3395=Jc,Xt.EPSG3857=ps,Xt.EPSG900913=oc,Xt.EPSG4326=Oa,Xt.Simple=tf;var Dt=Ji.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[d(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[d(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var a=this.getEvents();e.on(a,this),this.once("remove",function(){e.off(a,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});V.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=d(t);return this._layers[e]?this:(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var e=d(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return d(t)in this._layers},eachLayer:function(t,e){for(var a in this._layers)t.call(e,this._layers[a]);return this},_addLayers:function(t){t=t?N(t)?t:[t]:[];for(var e=0,a=t.length;e<a;e++)this.addLayer(t[e])},_addZoomLimit:function(t){(!isNaN(t.options.maxZoom)||!isNaN(t.options.minZoom))&&(this._zoomBoundLayers[d(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=d(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,a=this._getZoomSpan();for(var h in this._zoomBoundLayers){var f=this._zoomBoundLayers[h].options;t=f.minZoom===void 0?t:Math.min(t,f.minZoom),e=f.maxZoom===void 0?e:Math.max(e,f.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,a!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Ti=Dt.extend({initialize:function(t,e){P(this,e),this._layers={};var a,h;if(t)for(a=0,h=t.length;a<h;a++)this.addLayer(t[a])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){var e=typeof t=="number"?t:this.getLayerId(t);return e in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e=Array.prototype.slice.call(arguments,1),a,h;for(a in this._layers)h=this._layers[a],h[t]&&h[t].apply(h,e);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var a in this._layers)t.call(e,this._layers[a]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return d(t)}}),ef=function(t,e){return new Ti(t,e)},Kt=Ti.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Ti.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Ti.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new Ct;for(var e in this._layers){var a=this._layers[e];t.extend(a.getBounds?a.getBounds():a.getLatLng())}return t}}),sf=function(t,e){return new Kt(t,e)},Ei=Qt.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){P(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var a=this._getIconUrl(t);if(!a){if(t==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var h=this._createImg(a,e&&e.tagName==="IMG"?e:null);return this._setIconStyles(h,t),(this.options.crossOrigin||this.options.crossOrigin==="")&&(h.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),h},_setIconStyles:function(t,e){var a=this.options,h=a[e+"Size"];typeof h=="number"&&(h=[h,h]);var f=Z(h),m=Z(e==="shadow"&&a.shadowAnchor||a.iconAnchor||f&&f.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(a.className||""),m&&(t.style.marginLeft=-m.x+"px",t.style.marginTop=-m.y+"px"),f&&(t.style.width=f.x+"px",t.style.height=f.y+"px")},_createImg:function(t,e){return e=e||document.createElement("img"),e.src=t,e},_getIconUrl:function(t){return k.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function nf(t){return new Ei(t)}var ue=Ei.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return typeof ue.imagePath!="string"&&(ue.imagePath=this._detectIconPath()),(this.options.imagePath||ue.imagePath)+Ei.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){var e=function(a,h,f){var m=h.exec(a);return m&&m[f]};return t=e(t,/^url\((['"])?(.+)\1\)$/,2),t&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=Q("div","leaflet-default-icon-path",document.body),e=se(t,"background-image")||se(t,"backgroundImage");if(document.body.removeChild(t),e=this._stripUrl(e),e)return e;var a=document.querySelector('link[href$="leaflet.css"]');return a?a.href.substring(0,a.href.length-11-1):""}}),za=Wt.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new oi(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),G(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ot(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,a=e._map,h=this._marker.options.autoPanSpeed,f=this._marker.options.autoPanPadding,m=ci(e._icon),g=a.getPixelBounds(),x=a.getPixelOrigin(),w=At(g.min._subtract(x).add(f),g.max._subtract(x).subtract(f));if(!w.contains(m)){var C=Z((Math.max(w.max.x,m.x)-w.max.x)/(g.max.x-w.max.x)-(Math.min(w.min.x,m.x)-w.min.x)/(g.min.x-w.min.x),(Math.max(w.max.y,m.y)-w.max.y)/(g.max.y-w.max.y)-(Math.min(w.min.y,m.y)-w.min.y)/(g.min.y-w.min.y)).multiplyBy(h);a.panBy(C,{animate:!1}),this._draggable._newPos._add(C),this._draggable._startPos._add(C),ht(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=nt(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(pt(this._panRequest),this._panRequest=nt(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,a=e._shadow,h=ci(e._icon),f=e._map.layerPointToLatLng(h);a&&ht(a,h),e._latlng=f,t.latlng=f,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){pt(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Ne=Dt.extend({options:{icon:new ue,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){P(this,e),this._latlng=$(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=$(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),a=t.icon.createIcon(this._icon),h=!1;a!==this._icon&&(this._icon&&this._removeIcon(),h=!0,t.title&&(a.title=t.title),a.tagName==="IMG"&&(a.alt=t.alt||"")),G(a,e),t.keyboard&&(a.tabIndex="0",a.setAttribute("role","button")),this._icon=a,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&q(a,"focus",this._panOnFocus,this);var f=t.icon.createShadow(this._shadow),m=!1;f!==this._shadow&&(this._removeShadow(),m=!0),f&&(G(f,e),f.alt=""),this._shadow=f,t.opacity<1&&this._updateOpacity(),h&&this.getPane().appendChild(this._icon),this._initInteraction(),f&&m&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&J(this._icon,"focus",this._panOnFocus,this),st(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&st(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&ht(this._icon,t),this._shadow&&ht(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(G(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),za)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new za(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&Ot(this._icon,t),this._shadow&&Ot(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t=this._map;if(t){var e=this.options.icon.options,a=e.iconSize?Z(e.iconSize):Z(0,0),h=e.iconAnchor?Z(e.iconAnchor):Z(0,0);t.panInside(this._latlng,{paddingTopLeft:h,paddingBottomRight:a.subtract(h)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function af(t,e){return new Ne(t,e)}var ri=Dt.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return P(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Be=ri.extend({options:{fill:!0,radius:10},initialize:function(t,e){P(this,e),this._latlng=$(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=$(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return ri.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,a=this._clickTolerance(),h=[t+a,e+a];this._pxBounds=new et(this._point.subtract(h),this._point.add(h))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function of(t,e){return new Be(t,e)}var Us=Be.extend({initialize:function(t,e,a){if(typeof e=="number"&&(e=r({},a,{radius:e})),P(this,e),this._latlng=$(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new Ct(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:ri.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,a=this._map,h=a.options.crs;if(h.distance===ai.distance){var f=Math.PI/180,m=this._mRadius/ai.R/f,g=a.project([e+m,t]),x=a.project([e-m,t]),w=g.add(x).divideBy(2),C=a.unproject(w).lat,O=Math.acos((Math.cos(m*f)-Math.sin(e*f)*Math.sin(C*f))/(Math.cos(e*f)*Math.cos(C*f)))/f;(isNaN(O)||O===0)&&(O=m/Math.cos(Math.PI/180*e)),this._point=w.subtract(a.getPixelOrigin()),this._radius=isNaN(O)?0:w.x-a.project([C,t-O]).x,this._radiusY=w.y-g.y}else{var D=h.unproject(h.project(this._latlng).subtract([this._mRadius,0]));this._point=a.latLngToLayerPoint(this._latlng),this._radius=this._point.x-a.latLngToLayerPoint(D).x}this._updateBounds()}});function rf(t,e,a){return new Us(t,e,a)}var Yt=ri.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){P(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e=1/0,a=null,h=le,f,m,g=0,x=this._parts.length;g<x;g++)for(var w=this._parts[g],C=1,O=w.length;C<O;C++){f=w[C-1],m=w[C];var D=h(t,f,m,!0);D<e&&(e=D,a=h(t,f,m))}return a&&(a.distance=Math.sqrt(e)),a},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Ia(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=$(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new Ct,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return zt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],a=zt(t),h=0,f=t.length;h<f;h++)a?(e[h]=$(t[h]),this._bounds.extend(e[h])):e[h]=this._convertLatLngs(t[h]);return e},_project:function(){var t=new et;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new F(t,t);this._rawPxBounds&&(this._pxBounds=new et([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)]))},_projectLatlngs:function(t,e,a){var h=t[0]instanceof Y,f=t.length,m,g;if(h){for(g=[],m=0;m<f;m++)g[m]=this._map.latLngToLayerPoint(t[m]),a.extend(g[m]);e.push(g)}else for(m=0;m<f;m++)this._projectLatlngs(t[m],e,a)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}var e=this._parts,a,h,f,m,g,x,w;for(a=0,f=0,m=this._rings.length;a<m;a++)for(w=this._rings[a],h=0,g=w.length;h<g-1;h++)x=Ea(w[h],w[h+1],t,h,!0),x&&(e[f]=e[f]||[],e[f].push(x[0]),(x[1]!==w[h+1]||h===g-2)&&(e[f].push(x[1]),f++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,a=0,h=t.length;a<h;a++)t[a]=Aa(t[a],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var a,h,f,m,g,x,w=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(a=0,m=this._parts.length;a<m;a++)for(x=this._parts[a],h=0,g=x.length,f=g-1;h<g;f=h++)if(!(!e&&h===0)&&Ca(t,x[f],x[h])<=w)return!0;return!1}});function hf(t,e){return new Yt(t,e)}Yt._flat=Sa;var Si=Yt.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Pa(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(t){var e=Yt.prototype._convertLatLngs.call(this,t),a=e.length;return a>=2&&e[0]instanceof Y&&e[0].equals(e[a-1])&&e.pop(),e},_setLatLngs:function(t){Yt.prototype._setLatLngs.call(this,t),zt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return zt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,a=new F(e,e);if(t=new et(t.min.subtract(a),t.max.add(a)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(var h=0,f=this._rings.length,m;h<f;h++)m=La(this._rings[h],t,!0),m.length&&this._parts.push(m)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e=!1,a,h,f,m,g,x,w,C;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(m=0,w=this._parts.length;m<w;m++)for(a=this._parts[m],g=0,C=a.length,x=C-1;g<C;x=g++)h=a[g],f=a[x],h.y>t.y!=f.y>t.y&&t.x<(f.x-h.x)*(t.y-h.y)/(f.y-h.y)+h.x&&(e=!e);return e||Yt.prototype._containsPoint.call(this,t,!0)}});function lf(t,e){return new Si(t,e)}var Jt=Kt.extend({initialize:function(t,e){P(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e=N(t)?t:t.features,a,h,f;if(e){for(a=0,h=e.length;a<h;a++)f=e[a],(f.geometries||f.geometry||f.features||f.coordinates)&&this.addData(f);return this}var m=this.options;if(m.filter&&!m.filter(t))return this;var g=De(t,m);return g?(g.feature=Fe(t),g.defaultOptions=g.options,this.resetStyle(g),m.onEachFeature&&m.onEachFeature(t,g),this.addLayer(g)):this},resetStyle:function(t){return t===void 0?this.eachLayer(this.resetStyle,this):(t.options=r({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){t.setStyle&&(typeof e=="function"&&(e=e(t.feature)),t.setStyle(e))}});function De(t,e){var a=t.type==="Feature"?t.geometry:t,h=a?a.coordinates:null,f=[],m=e&&e.pointToLayer,g=e&&e.coordsToLatLng||js,x,w,C,O;if(!h&&!a)return null;switch(a.type){case"Point":return x=g(h),ka(m,t,x,e);case"MultiPoint":for(C=0,O=h.length;C<O;C++)x=g(h[C]),f.push(ka(m,t,x,e));return new Kt(f);case"LineString":case"MultiLineString":return w=Re(h,a.type==="LineString"?0:1,g),new Yt(w,e);case"Polygon":case"MultiPolygon":return w=Re(h,a.type==="Polygon"?1:2,g),new Si(w,e);case"GeometryCollection":for(C=0,O=a.geometries.length;C<O;C++){var D=De({geometry:a.geometries[C],type:"Feature",properties:t.properties},e);D&&f.push(D)}return new Kt(f);case"FeatureCollection":for(C=0,O=a.features.length;C<O;C++){var U=De(a.features[C],e);U&&f.push(U)}return new Kt(f);default:throw new Error("Invalid GeoJSON object.")}}function ka(t,e,a,h){return t?t(e,a):new Ne(a,h&&h.markersInheritOptions&&h)}function js(t){return new Y(t[1],t[0],t[2])}function Re(t,e,a){for(var h=[],f=0,m=t.length,g;f<m;f++)g=e?Re(t[f],e-1,a):(a||js)(t[f]),h.push(g);return h}function Hs(t,e){return t=$(t),t.alt!==void 0?[M(t.lng,e),M(t.lat,e),M(t.alt,e)]:[M(t.lng,e),M(t.lat,e)]}function Ze(t,e,a,h){for(var f=[],m=0,g=t.length;m<g;m++)f.push(e?Ze(t[m],zt(t[m])?0:e-1,a,h):Hs(t[m],h));return!e&&a&&f.length>0&&f.push(f[0].slice()),f}function Ii(t,e){return t.feature?r({},t.feature,{geometry:e}):Fe(e)}function Fe(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var Ws={toGeoJSON:function(t){return Ii(this,{type:"Point",coordinates:Hs(this.getLatLng(),t)})}};Ne.include(Ws),Us.include(Ws),Be.include(Ws),Yt.include({toGeoJSON:function(t){var e=!zt(this._latlngs),a=Ze(this._latlngs,e?1:0,!1,t);return Ii(this,{type:(e?"Multi":"")+"LineString",coordinates:a})}}),Si.include({toGeoJSON:function(t){var e=!zt(this._latlngs),a=e&&!zt(this._latlngs[0]),h=Ze(this._latlngs,a?2:e?1:0,!0,t);return e||(h=[h]),Ii(this,{type:(a?"Multi":"")+"Polygon",coordinates:h})}}),Ti.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(a){e.push(a.toGeoJSON(t).geometry.coordinates)}),Ii(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(e==="MultiPoint")return this.toMultiPoint(t);var a=e==="GeometryCollection",h=[];return this.eachLayer(function(f){if(f.toGeoJSON){var m=f.toGeoJSON(t);if(a)h.push(m.geometry);else{var g=Fe(m);g.type==="FeatureCollection"?h.push.apply(h,g.features):h.push(g)}}}),a?Ii(this,{geometries:h,type:"GeometryCollection"}):{type:"FeatureCollection",features:h}}});function Na(t,e){return new Jt(t,e)}var uf=Na,qe=Dt.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,a){this._url=t,this._bounds=rt(e),P(this,a)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(G(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){st(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&Ai(this._image),this},bringToBack:function(){return this._map&&Ci(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=rt(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._url.tagName==="IMG",e=this._image=t?this._url:Q("img");if(G(e,"leaflet-image-layer"),this._zoomAnimated&&G(e,"leaflet-zoom-animated"),this.options.className&&G(e,this.options.className),e.onselectstart=p,e.onmousemove=p,e.onload=u(this.fire,this,"load"),e.onerror=u(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(e.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=e.src;return}e.src=this._url,e.alt=this.options.alt},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),a=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;ui(this._image,a,e)},_reset:function(){var t=this._image,e=new et(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),a=e.getSize();ht(t,e.min),t.style.width=a.x+"px",t.style.height=a.y+"px"},_updateOpacity:function(){Ot(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),cf=function(t,e,a){return new qe(t,e,a)},Ba=qe.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=this._url.tagName==="VIDEO",e=this._image=t?this._url:Q("video");if(G(e,"leaflet-image-layer"),this._zoomAnimated&&G(e,"leaflet-zoom-animated"),this.options.className&&G(e,this.options.className),e.onselectstart=p,e.onmousemove=p,e.onloadeddata=u(this.fire,this,"load"),t){for(var a=e.getElementsByTagName("source"),h=[],f=0;f<a.length;f++)h.push(a[f].src);this._url=a.length>0?h:[e.src];return}N(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var m=0;m<this._url.length;m++){var g=Q("source");g.src=this._url[m],e.appendChild(g)}}});function ff(t,e,a){return new Ba(t,e,a)}var Da=qe.extend({_initImage:function(){var t=this._image=this._url;G(t,"leaflet-image-layer"),this._zoomAnimated&&G(t,"leaflet-zoom-animated"),this.options.className&&G(t,this.options.className),t.onselectstart=p,t.onmousemove=p}});function df(t,e,a){return new Da(t,e,a)}var $t=Dt.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,e){t&&(t instanceof Y||N(t))?(this._latlng=$(t),P(this,e)):(P(this,t),this._source=e),this.options.content&&(this._content=this.options.content)},openOn:function(t){return t=arguments.length?t:this._source._map,t.hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&Ot(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&Ot(this._container,1),this.bringToFront(),this.options.interactive&&(G(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(Ot(this._container,0),this._removeTimeout=setTimeout(u(st,void 0,this._container),200)):st(this._container),this.options.interactive&&(ot(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=$(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Ai(this._container),this},bringToBack:function(){return this._map&&Ci(this._container),this},_prepareOpen:function(t){var e=this._source;if(!e._map)return!1;if(e instanceof Kt){e=null;var a=this._source._layers;for(var h in a)if(a[h]._map){e=a[h];break}if(!e)return!1;this._source=e}if(!t)if(e.getCenter)t=e.getCenter();else if(e.getLatLng)t=e.getLatLng();else if(e.getBounds)t=e.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,e=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof e=="string")t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=Z(this.options.offset),a=this._getAnchor();this._zoomAnimated?ht(this._container,t.add(a)):e=e.add(t).add(a);var h=this._containerBottom=-e.y,f=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=h+"px",this._container.style.left=f+"px"}},_getAnchor:function(){return[0,0]}});V.include({_initOverlay:function(t,e,a,h){var f=e;return f instanceof t||(f=new t(h).setContent(e)),a&&f.setLatLng(a),f}}),Dt.include({_initOverlay:function(t,e,a,h){var f=a;return f instanceof t?(P(f,h),f._source=this):(f=e&&!h?e:new t(h,this),f.setContent(a)),f}});var Ge=$t.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t=arguments.length?t:this._source._map,!t.hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,$t.prototype.openOn.call(this,t)},onAdd:function(t){$t.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof ri||this._source.on("preclick",fi))},onRemove:function(t){$t.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof ri||this._source.off("preclick",fi))},getEvents:function(){var t=$t.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",e=this._container=Q("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),a=this._wrapper=Q("div",t+"-content-wrapper",e);if(this._contentNode=Q("div",t+"-content",a),re(e),Ns(this._contentNode),q(e,"contextmenu",fi),this._tipContainer=Q("div",t+"-tip-container",e),this._tip=Q("div",t+"-tip",this._tipContainer),this.options.closeButton){var h=this._closeButton=Q("a",t+"-close-button",e);h.setAttribute("role","button"),h.setAttribute("aria-label","Close popup"),h.href="#close",h.innerHTML='<span aria-hidden="true">&#215;</span>',q(h,"click",function(f){gt(f),this.close()},this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var a=t.offsetWidth;a=Math.min(a,this.options.maxWidth),a=Math.max(a,this.options.minWidth),e.width=a+1+"px",e.whiteSpace="",e.height="";var h=t.offsetHeight,f=this.options.maxHeight,m="leaflet-popup-scrolled";f&&h>f?(e.height=f+"px",G(t,m)):ot(t,m),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),a=this._getAnchor();ht(this._container,e.add(a))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,e=parseInt(se(this._container,"marginBottom"),10)||0,a=this._container.offsetHeight+e,h=this._containerWidth,f=new F(this._containerLeft,-a-this._containerBottom);f._add(ci(this._container));var m=t.layerPointToContainerPoint(f),g=Z(this.options.autoPanPadding),x=Z(this.options.autoPanPaddingTopLeft||g),w=Z(this.options.autoPanPaddingBottomRight||g),C=t.getSize(),O=0,D=0;m.x+h+w.x>C.x&&(O=m.x+h-C.x+w.x),m.x-O-x.x<0&&(O=m.x-x.x),m.y+a+w.y>C.y&&(D=m.y+a-C.y+w.y),m.y-D-x.y<0&&(D=m.y-x.y),(O||D)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([O,D]))}},_getAnchor:function(){return Z(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),mf=function(t,e){return new Ge(t,e)};V.mergeOptions({closePopupOnClick:!0}),V.include({openPopup:function(t,e,a){return this._initOverlay(Ge,t,e,a).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),Dt.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Ge,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Kt||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(!(!this._popup||!this._map)){di(t);var e=t.layer||t.target;if(this._popup._source===e&&!(e instanceof ri)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=e,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){t.originalEvent.keyCode===13&&this._openPopup(t)}});var Ue=$t.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){$t.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){$t.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=$t.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",e=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Q("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+d(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,a,h=this._map,f=this._container,m=h.latLngToContainerPoint(h.getCenter()),g=h.layerPointToContainerPoint(t),x=this.options.direction,w=f.offsetWidth,C=f.offsetHeight,O=Z(this.options.offset),D=this._getAnchor();x==="top"?(e=w/2,a=C):x==="bottom"?(e=w/2,a=0):x==="center"?(e=w/2,a=C/2):x==="right"?(e=0,a=C/2):x==="left"?(e=w,a=C/2):g.x<m.x?(x="right",e=0,a=C/2):(x="left",e=w+(O.x+D.x)*2,a=C/2),t=t.subtract(Z(e,a,!0)).add(O).add(D),ot(f,"leaflet-tooltip-right"),ot(f,"leaflet-tooltip-left"),ot(f,"leaflet-tooltip-top"),ot(f,"leaflet-tooltip-bottom"),G(f,"leaflet-tooltip-"+x),ht(f,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&Ot(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return Z(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),_f=function(t,e){return new Ue(t,e)};V.include({openTooltip:function(t,e,a){return this._initOverlay(Ue,t,e,a).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),Dt.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ue,this._tooltip,t,e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(!(!t&&this._tooltipHandlersAdded)){var e=t?"off":"on",a={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?a.add=this._openTooltip:(a.mouseover=this._openTooltip,a.mouseout=this.closeTooltip,a.click=this._openTooltip,this._map?this._addFocusListeners():a.add=this._addFocusListeners),this._tooltip.options.sticky&&(a.mousemove=this._moveTooltip),this[e](a),this._tooltipHandlersAdded=!t}},openTooltip:function(t){return this._tooltip&&(this instanceof Kt||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var e=typeof t.getElement=="function"&&t.getElement();e&&(q(e,"focus",function(){this._tooltip._source=t,this.openTooltip()},this),q(e,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){var e=typeof t.getElement=="function"&&t.getElement();e&&e.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var e=this;this._map.once("moveend",function(){e._openOnceFlag=!1,e._openTooltip(t)});return}this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)}},_moveTooltip:function(t){var e=t.latlng,a,h;this._tooltip.options.sticky&&t.originalEvent&&(a=this._map.mouseEventToContainerPoint(t.originalEvent),h=this._map.containerPointToLayerPoint(a),e=this._map.layerPointToLatLng(h)),this._tooltip.setLatLng(e)}});var Ra=Ei.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&t.tagName==="DIV"?t:document.createElement("div"),a=this.options;if(a.html instanceof Element?(Ee(e),e.appendChild(a.html)):e.innerHTML=a.html!==!1?a.html:"",a.bgPos){var h=Z(a.bgPos);e.style.backgroundPosition=-h.x+"px "+-h.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function pf(t){return new Ra(t)}Ei.Default=ue;var ce=Dt.extend({options:{tileSize:256,opacity:1,updateWhenIdle:k.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){P(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),st(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Ai(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Ci(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var t=this._clampZoom(this._map.getZoom());t!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()}return this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=_(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof F?t:new F(t,t)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e=this.getPane().children,a=-t(-1/0,1/0),h=0,f=e.length,m;h<f;h++)m=e[h].style.zIndex,e[h]!==this._container&&m&&(a=t(a,+m));isFinite(a)&&(this.options.zIndex=a+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!k.ielt9){Ot(this._container,this.options.opacity);var t=+new Date,e=!1,a=!1;for(var h in this._tiles){var f=this._tiles[h];if(!(!f.current||!f.loaded)){var m=Math.min(1,(t-f.loaded)/200);Ot(f.el,m),m<1?e=!0:(f.active?a=!0:this._onOpaqueTile(f),f.active=!0)}}a&&!this._noPrune&&this._pruneTiles(),e&&(pt(this._fadeFrame),this._fadeFrame=nt(this._updateOpacity,this))}},_onOpaqueTile:p,_initContainer:function(){this._container||(this._container=Q("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(t!==void 0){for(var a in this._levels)a=Number(a),this._levels[a].el.children.length||a===t?(this._levels[a].el.style.zIndex=e-Math.abs(t-a),this._onUpdateLevel(a)):(st(this._levels[a].el),this._removeTilesAtZoom(a),this._onRemoveLevel(a),delete this._levels[a]);var h=this._levels[t],f=this._map;return h||(h=this._levels[t]={},h.el=Q("div","leaflet-tile-container leaflet-zoom-animated",this._container),h.el.style.zIndex=e,h.origin=f.project(f.unproject(f.getPixelOrigin()),t).round(),h.zoom=t,this._setZoomTransform(h,f.getCenter(),f.getZoom()),p(h.el.offsetWidth),this._onCreateLevel(h)),this._level=h,h}},_onUpdateLevel:p,_onRemoveLevel:p,_onCreateLevel:p,_pruneTiles:function(){if(this._map){var t,e,a=this._map.getZoom();if(a>this.options.maxZoom||a<this.options.minZoom){this._removeAllTiles();return}for(t in this._tiles)e=this._tiles[t],e.retain=e.current;for(t in this._tiles)if(e=this._tiles[t],e.current&&!e.active){var h=e.coords;this._retainParent(h.x,h.y,h.z,h.z-5)||this._retainChildren(h.x,h.y,h.z,h.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)st(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,a,h){var f=Math.floor(t/2),m=Math.floor(e/2),g=a-1,x=new F(+f,+m);x.z=+g;var w=this._tileCoordsToKey(x),C=this._tiles[w];return C&&C.active?(C.retain=!0,!0):(C&&C.loaded&&(C.retain=!0),g>h?this._retainParent(f,m,g,h):!1)},_retainChildren:function(t,e,a,h){for(var f=2*t;f<2*t+2;f++)for(var m=2*e;m<2*e+2;m++){var g=new F(f,m);g.z=a+1;var x=this._tileCoordsToKey(g),w=this._tiles[x];if(w&&w.active){w.retain=!0;continue}else w&&w.loaded&&(w.retain=!0);a+1<h&&this._retainChildren(f,m,a+1,h)}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return e.minNativeZoom!==void 0&&t<e.minNativeZoom?e.minNativeZoom:e.maxNativeZoom!==void 0&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,a,h){var f=Math.round(e);this.options.maxZoom!==void 0&&f>this.options.maxZoom||this.options.minZoom!==void 0&&f<this.options.minZoom?f=void 0:f=this._clampZoom(f);var m=this.options.updateWhenZooming&&f!==this._tileZoom;(!h||m)&&(this._tileZoom=f,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),f!==void 0&&this._update(t),a||this._pruneTiles(),this._noPrune=!!a),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var a in this._levels)this._setZoomTransform(this._levels[a],t,e)},_setZoomTransform:function(t,e,a){var h=this._map.getZoomScale(a,t.zoom),f=t.origin.multiplyBy(h).subtract(this._map._getNewPixelOrigin(e,a)).round();k.any3d?ui(t.el,f,h):ht(t.el,f)},_resetGrid:function(){var t=this._map,e=t.options.crs,a=this._tileSize=this.getTileSize(),h=this._tileZoom,f=this._map.getPixelWorldBounds(this._tileZoom);f&&(this._globalTileRange=this._pxBoundsToTileRange(f)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],h).x/a.x),Math.ceil(t.project([0,e.wrapLng[1]],h).x/a.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],h).y/a.x),Math.ceil(t.project([e.wrapLat[1],0],h).y/a.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(t){var e=this._map,a=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),h=e.getZoomScale(a,this._tileZoom),f=e.project(t,this._tileZoom).floor(),m=e.getSize().divideBy(h*2);return new et(f.subtract(m),f.add(m))},_update:function(t){var e=this._map;if(e){var a=this._clampZoom(e.getZoom());if(t===void 0&&(t=e.getCenter()),this._tileZoom!==void 0){var h=this._getTiledPixelBounds(t),f=this._pxBoundsToTileRange(h),m=f.getCenter(),g=[],x=this.options.keepBuffer,w=new et(f.getBottomLeft().subtract([x,-x]),f.getTopRight().add([x,-x]));if(!(isFinite(f.min.x)&&isFinite(f.min.y)&&isFinite(f.max.x)&&isFinite(f.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var C in this._tiles){var O=this._tiles[C].coords;(O.z!==this._tileZoom||!w.contains(new F(O.x,O.y)))&&(this._tiles[C].current=!1)}if(Math.abs(a-this._tileZoom)>1){this._setView(t,a);return}for(var D=f.min.y;D<=f.max.y;D++)for(var U=f.min.x;U<=f.max.x;U++){var xt=new F(U,D);if(xt.z=this._tileZoom,!!this._isValidTile(xt)){var mt=this._tiles[this._tileCoordsToKey(xt)];mt?mt.current=!0:g.push(xt)}}if(g.sort(function(Tt,zi){return Tt.distanceTo(m)-zi.distanceTo(m)}),g.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var kt=document.createDocumentFragment();for(U=0;U<g.length;U++)this._addTile(g[U],kt);this._level.el.appendChild(kt)}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var a=this._globalTileRange;if(!e.wrapLng&&(t.x<a.min.x||t.x>a.max.x)||!e.wrapLat&&(t.y<a.min.y||t.y>a.max.y))return!1}if(!this.options.bounds)return!0;var h=this._tileCoordsToBounds(t);return rt(this.options.bounds).overlaps(h)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,a=this.getTileSize(),h=t.scaleBy(a),f=h.add(a),m=e.unproject(h,t.z),g=e.unproject(f,t.z);return[m,g]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),a=new Ct(e[0],e[1]);return this.options.noWrap||(a=this._map.wrapLatLngBounds(a)),a},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),a=new F(+e[0],+e[1]);return a.z=+e[2],a},_removeTile:function(t){var e=this._tiles[t];e&&(st(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){G(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=p,t.onmousemove=p,k.ielt9&&this.options.opacity<1&&Ot(t,this.options.opacity)},_addTile:function(t,e){var a=this._getTilePos(t),h=this._tileCoordsToKey(t),f=this.createTile(this._wrapCoords(t),u(this._tileReady,this,t));this._initTile(f),this.createTile.length<2&&nt(u(this._tileReady,this,t,null,f)),ht(f,a),this._tiles[h]={el:f,coords:t,current:!0},e.appendChild(f),this.fire("tileloadstart",{tile:f,coords:t})},_tileReady:function(t,e,a){e&&this.fire("tileerror",{error:e,tile:a,coords:t});var h=this._tileCoordsToKey(t);a=this._tiles[h],a&&(a.loaded=+new Date,this._map._fadeAnimated?(Ot(a.el,0),pt(this._fadeFrame),this._fadeFrame=nt(this._updateOpacity,this)):(a.active=!0,this._pruneTiles()),e||(G(a.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:a.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),k.ielt9||!this._map._fadeAnimated?nt(this._pruneTiles,this):setTimeout(u(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new F(this._wrapX?y(t.x,this._wrapX):t.x,this._wrapY?y(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new et(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function gf(t){return new ce(t)}var Oi=ce.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,e=P(this,e),e.detectRetina&&k.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),typeof e.subdomains=="string"&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&e===void 0&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var a=document.createElement("img");return q(a,"load",u(this._tileOnLoad,this,e,a)),q(a,"error",u(this._tileOnError,this,e,a)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(a.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(a.referrerPolicy=this.options.referrerPolicy),a.alt="",a.src=this.getTileUrl(t),a},getTileUrl:function(t){var e={r:k.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var a=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=a),e["-y"]=a}return B(this._url,r(e,this.options))},_tileOnLoad:function(t,e){k.ielt9?setTimeout(u(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,a){var h=this.options.errorTileUrl;h&&e.getAttribute("src")!==h&&(e.src=h),t(a,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom,a=this.options.zoomReverse,h=this.options.zoomOffset;return a&&(t=e-t),t+h},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(e=this._tiles[t].el,e.onload=p,e.onerror=p,!e.complete)){e.src=H;var a=this._tiles[t].coords;st(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:a})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",H),ce.prototype._removeTile.call(this,t)},_tileReady:function(t,e,a){if(!(!this._map||a&&a.getAttribute("src")===H))return ce.prototype._tileReady.call(this,t,e,a)}});function Za(t,e){return new Oi(t,e)}var Fa=Oi.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var a=r({},this.defaultWmsParams);for(var h in e)h in this.options||(a[h]=e[h]);e=P(this,e);var f=e.detectRetina&&k.retina?2:1,m=this.getTileSize();a.width=m.x*f,a.height=m.y*f,this.wmsParams=a},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,Oi.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),a=this._crs,h=At(a.project(e[0]),a.project(e[1])),f=h.min,m=h.max,g=(this._wmsVersion>=1.3&&this._crs===Oa?[f.y,f.x,m.y,m.x]:[f.x,f.y,m.x,m.y]).join(","),x=Oi.prototype.getTileUrl.call(this,t);return x+E(this.wmsParams,x,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+g},setParams:function(t,e){return r(this.wmsParams,t),e||this.redraw(),this}});function vf(t,e){return new Fa(t,e)}Oi.WMS=Fa,Za.wms=vf;var ti=Dt.extend({options:{padding:.1},initialize:function(t){P(this,t),d(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),G(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var a=this._map.getZoomScale(e,this._zoom),h=this._map.getSize().multiplyBy(.5+this.options.padding),f=this._map.project(this._center,e),m=h.multiplyBy(-a).add(f).subtract(this._map._getNewPixelOrigin(t,e));k.any3d?ui(this._container,m,a):ht(this._container,m)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),a=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new et(a,a.add(e.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),qa=ti.extend({options:{tolerance:0},getEvents:function(){var t=ti.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ti.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");q(t,"mousemove",this._onMouseMove,this),q(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),q(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){pt(this._redrawRequest),delete this._ctx,st(this._container),J(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var e in this._layers)t=this._layers[e],t._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ti.prototype._update.call(this);var t=this._bounds,e=this._container,a=t.getSize(),h=k.retina?2:1;ht(e,t.min),e.width=h*a.x,e.height=h*a.y,e.style.width=a.x+"px",e.style.height=a.y+"px",k.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ti.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[d(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,a=e.next,h=e.prev;a?a.prev=h:this._drawLast=h,h?h.next=a:this._drawFirst=a,delete t._order,delete this._layers[d(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(typeof t.options.dashArray=="string"){var e=t.options.dashArray.split(/[, ]+/),a=[],h,f;for(f=0;f<e.length;f++){if(h=Number(e[f]),isNaN(h))return;a.push(h)}t.options._dashArray=a}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||nt(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new et,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var a=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,a.x,a.y),this._ctx.clip()}this._drawing=!0;for(var h=this._drawFirst;h;h=h.next)t=h.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var a,h,f,m,g=t._parts,x=g.length,w=this._ctx;if(x){for(w.beginPath(),a=0;a<x;a++){for(h=0,f=g[a].length;h<f;h++)m=g[a][h],w[h?"lineTo":"moveTo"](m.x,m.y);e&&w.closePath()}this._fillStroke(w,t)}}},_updateCircle:function(t){if(!(!this._drawing||t._empty())){var e=t._point,a=this._ctx,h=Math.max(Math.round(t._radius),1),f=(Math.max(Math.round(t._radiusY),1)||h)/h;f!==1&&(a.save(),a.scale(1,f)),a.beginPath(),a.arc(e.x,e.y/f,h,0,Math.PI*2,!1),f!==1&&a.restore(),this._fillStroke(a,t)}},_fillStroke:function(t,e){var a=e.options;a.fill&&(t.globalAlpha=a.fillOpacity,t.fillStyle=a.fillColor||a.color,t.fill(a.fillRule||"evenodd")),a.stroke&&a.weight!==0&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=a.opacity,t.lineWidth=a.weight,t.strokeStyle=a.color,t.lineCap=a.lineCap,t.lineJoin=a.lineJoin,t.stroke())},_onClick:function(t){for(var e=this._map.mouseEventToLayerPoint(t),a,h,f=this._drawFirst;f;f=f.next)a=f.layer,a.options.interactive&&a._containsPoint(e)&&(!(t.type==="click"||t.type==="preclick")||!this._map._draggableMoved(a))&&(h=a);this._fireEvent(h?[h]:!1,t)},_onMouseMove:function(t){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ot(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var a,h,f=this._drawFirst;f;f=f.next)a=f.layer,a.options.interactive&&a._containsPoint(e)&&(h=a);h!==this._hoveredLayer&&(this._handleMouseOut(t),h&&(G(this._container,"leaflet-interactive"),this._fireEvent([h],t,"mouseover"),this._hoveredLayer=h)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,t),this._mouseHoverThrottled=!0,setTimeout(u(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,e,a){this._map._fireDOMEvent(e,a||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var a=e.next,h=e.prev;if(a)a.prev=h;else return;h?h.next=a:a&&(this._drawFirst=a),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t)}},_bringToBack:function(t){var e=t._order;if(e){var a=e.next,h=e.prev;if(h)h.next=a;else return;a?a.prev=h:h&&(this._drawLast=h),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t)}}});function Ga(t){return k.canvas?new qa(t):null}var fe=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),yf={_initContainer:function(){this._container=Q("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ti.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=fe("shape");G(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=fe("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[d(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;st(e),t.removeInteractiveTarget(e),delete this._layers[d(t)]},_updateStyle:function(t){var e=t._stroke,a=t._fill,h=t.options,f=t._container;f.stroked=!!h.stroke,f.filled=!!h.fill,h.stroke?(e||(e=t._stroke=fe("stroke")),f.appendChild(e),e.weight=h.weight+"px",e.color=h.color,e.opacity=h.opacity,h.dashArray?e.dashStyle=N(h.dashArray)?h.dashArray.join(" "):h.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=h.lineCap.replace("butt","flat"),e.joinstyle=h.lineJoin):e&&(f.removeChild(e),t._stroke=null),h.fill?(a||(a=t._fill=fe("fill")),f.appendChild(a),a.color=h.fillColor||h.color,a.opacity=h.fillOpacity):a&&(f.removeChild(a),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),a=Math.round(t._radius),h=Math.round(t._radiusY||a);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+a+","+h+" 0,"+65535*360)},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){Ai(t._container)},_bringToBack:function(t){Ci(t._container)}},je=k.vml?fe:Wn,de=ti.extend({_initContainer:function(){this._container=je("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=je("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){st(this._container),J(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ti.prototype._update.call(this);var t=this._bounds,e=t.getSize(),a=this._container;(!this._svgSize||!this._svgSize.equals(e))&&(this._svgSize=e,a.setAttribute("width",e.x),a.setAttribute("height",e.y)),ht(a,t.min),a.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=je("path");t.options.className&&G(e,t.options.className),t.options.interactive&&G(e,"leaflet-interactive"),this._updateStyle(t),this._layers[d(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){st(t._path),t.removeInteractiveTarget(t._path),delete this._layers[d(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,a=t.options;e&&(a.stroke?(e.setAttribute("stroke",a.color),e.setAttribute("stroke-opacity",a.opacity),e.setAttribute("stroke-width",a.weight),e.setAttribute("stroke-linecap",a.lineCap),e.setAttribute("stroke-linejoin",a.lineJoin),a.dashArray?e.setAttribute("stroke-dasharray",a.dashArray):e.removeAttribute("stroke-dasharray"),a.dashOffset?e.setAttribute("stroke-dashoffset",a.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),a.fill?(e.setAttribute("fill",a.fillColor||a.color),e.setAttribute("fill-opacity",a.fillOpacity),e.setAttribute("fill-rule",a.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,$n(t._parts,e))},_updateCircle:function(t){var e=t._point,a=Math.max(Math.round(t._radius),1),h=Math.max(Math.round(t._radiusY),1)||a,f="a"+a+","+h+" 0 1,0 ",m=t._empty()?"M0 0":"M"+(e.x-a)+","+e.y+f+a*2+",0 "+f+-a*2+",0 ";this._setPath(t,m)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){Ai(t._path)},_bringToBack:function(t){Ci(t._path)}});k.vml&&de.include(yf);function Ua(t){return k.svg||k.vml?new de(t):null}V.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if(t==="overlayPane"||t===void 0)return!1;var e=this._paneRenderers[t];return e===void 0&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Ga(t)||Ua(t)}});var ja=Si.extend({initialize:function(t,e){Si.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=rt(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Mf(t,e){return new ja(t,e)}de.create=je,de.pointsToPath=$n,Jt.geometryToLayer=De,Jt.coordsToLatLng=js,Jt.coordsToLatLngs=Re,Jt.latLngToCoords=Hs,Jt.latLngsToCoords=Ze,Jt.getFeature=Ii,Jt.asFeature=Fe,V.mergeOptions({boxZoom:!0});var Ha=Wt.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){q(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){J(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){st(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||t.which!==1&&t.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),ne(),Cs(),this._startPoint=this._map.mouseEventToContainerPoint(t),q(document,{contextmenu:di,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=Q("div","leaflet-zoom-box",this._container),G(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new et(this._point,this._startPoint),a=e.getSize();ht(this._box,e.min),this._box.style.width=a.x+"px",this._box.style.height=a.y+"px"},_finish:function(){this._moved&&(st(this._box),ot(this._container,"leaflet-crosshair")),ae(),Ts(),J(document,{contextmenu:di,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if(!(t.which!==1&&t.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(u(this._resetState,this),0);var e=new Ct(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){t.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});V.addInitHook("addHandler","boxZoom",Ha),V.mergeOptions({doubleClickZoom:!0});var Wa=Wt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,a=e.getZoom(),h=e.options.zoomDelta,f=t.originalEvent.shiftKey?a-h:a+h;e.options.doubleClickZoom==="center"?e.setZoom(f):e.setZoomAround(t.containerPoint,f)}});V.addInitHook("addHandler","doubleClickZoom",Wa),V.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var $a=Wt.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new oi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}G(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ot(this._map._container,"leaflet-grab"),ot(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=rt(this._map.options.maxBounds);this._offsetLimit=At(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,a=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(a),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),a=this._initialWorldOffset,h=this._draggable._newPos.x,f=(h-e+a)%t+e-a,m=(h+e+a)%t-e-a,g=Math.abs(f+a)<Math.abs(m+a)?f:m;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=g},_onDragEnd:function(t){var e=this._map,a=e.options,h=!a.inertia||t.noInertia||this._times.length<2;if(e.fire("dragend",t),h)e.fire("moveend");else{this._prunePositions(+new Date);var f=this._lastPos.subtract(this._positions[0]),m=(this._lastTime-this._times[0])/1e3,g=a.easeLinearity,x=f.multiplyBy(g/m),w=x.distanceTo([0,0]),C=Math.min(a.inertiaMaxSpeed,w),O=x.multiplyBy(C/w),D=C/(a.inertiaDeceleration*g),U=O.multiplyBy(-D/2).round();!U.x&&!U.y?e.fire("moveend"):(U=e._limitOffset(U,e.options.maxBounds),nt(function(){e.panBy(U,{duration:D,easeLinearity:g,noMoveStart:!0,animate:!0})}))}}});V.addInitHook("addHandler","dragging",$a),V.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Va=Wt.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),q(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),J(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,a=t.scrollTop||e.scrollTop,h=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(h,a)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e=this._panKeys={},a=this.keyCodes,h,f;for(h=0,f=a.left.length;h<f;h++)e[a.left[h]]=[-1*t,0];for(h=0,f=a.right.length;h<f;h++)e[a.right[h]]=[t,0];for(h=0,f=a.down.length;h<f;h++)e[a.down[h]]=[0,t];for(h=0,f=a.up.length;h<f;h++)e[a.up[h]]=[0,-1*t]},_setZoomDelta:function(t){var e=this._zoomKeys={},a=this.keyCodes,h,f;for(h=0,f=a.zoomIn.length;h<f;h++)e[a.zoomIn[h]]=t;for(h=0,f=a.zoomOut.length;h<f;h++)e[a.zoomOut[h]]=-t},_addHooks:function(){q(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){J(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=t.keyCode,a=this._map,h;if(e in this._panKeys){if(!a._panAnim||!a._panAnim._inProgress)if(h=this._panKeys[e],t.shiftKey&&(h=Z(h).multiplyBy(3)),a.options.maxBounds&&(h=a._limitOffset(Z(h),a.options.maxBounds)),a.options.worldCopyJump){var f=a.wrapLatLng(a.unproject(a.project(a.getCenter()).add(h)));a.panTo(f)}else a.panBy(h)}else if(e in this._zoomKeys)a.setZoom(a.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[e]);else if(e===27&&a._popup&&a._popup.options.closeOnEscapeKey)a.closePopup();else return;di(t)}}});V.addInitHook("addHandler","keyboard",Va),V.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Qa=Wt.extend({addHooks:function(){q(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){J(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=ya(t),a=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var h=Math.max(a-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(u(this._performZoom,this),h),di(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),a=this._map.options.zoomSnap||0;t._stop();var h=this._delta/(this._map.options.wheelPxPerZoomLevel*4),f=4*Math.log(2/(1+Math.exp(-Math.abs(h))))/Math.LN2,m=a?Math.ceil(f/a)*a:f,g=t._limitZoom(e+(this._delta>0?m:-m))-e;this._delta=0,this._startTime=null,g&&(t.options.scrollWheelZoom==="center"?t.setZoom(e+g):t.setZoomAround(this._lastMousePos,e+g))}});V.addInitHook("addHandler","scrollWheelZoom",Qa);var xf=600;V.mergeOptions({tapHold:k.touchNative&&k.safari&&k.mobile,tapTolerance:15});var Xa=Wt.extend({addHooks:function(){q(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){J(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),t.touches.length===1){var e=t.touches[0];this._startPos=this._newPos=new F(e.clientX,e.clientY),this._holdTimeout=setTimeout(u(function(){this._cancel(),this._isTapValid()&&(q(document,"touchend",gt),q(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),xf),q(document,"touchend touchcancel contextmenu",this._cancel,this),q(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){J(document,"touchend",gt),J(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),J(document,"touchend touchcancel contextmenu",this._cancel,this),J(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new F(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var a=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});a._simulated=!0,e.target.dispatchEvent(a)}});V.addInitHook("addHandler","tapHold",Xa),V.mergeOptions({touchZoom:k.touch,bounceAtZoomLimits:!0});var Ka=Wt.extend({addHooks:function(){G(this._map._container,"leaflet-touch-zoom"),q(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ot(this._map._container,"leaflet-touch-zoom"),J(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(!(!t.touches||t.touches.length!==2||e._animatingZoom||this._zooming)){var a=e.mouseEventToContainerPoint(t.touches[0]),h=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),e.options.touchZoom!=="center"&&(this._pinchStartLatLng=e.containerPointToLatLng(a.add(h)._divideBy(2))),this._startDist=a.distanceTo(h),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),q(document,"touchmove",this._onTouchMove,this),q(document,"touchend touchcancel",this._onTouchEnd,this),gt(t)}},_onTouchMove:function(t){if(!(!t.touches||t.touches.length!==2||!this._zooming)){var e=this._map,a=e.mouseEventToContainerPoint(t.touches[0]),h=e.mouseEventToContainerPoint(t.touches[1]),f=a.distanceTo(h)/this._startDist;if(this._zoom=e.getScaleZoom(f,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&f<1||this._zoom>e.getMaxZoom()&&f>1)&&(this._zoom=e._limitZoom(this._zoom)),e.options.touchZoom==="center"){if(this._center=this._startLatLng,f===1)return}else{var m=a._add(h)._divideBy(2)._subtract(this._centerPoint);if(f===1&&m.x===0&&m.y===0)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(m),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),pt(this._animRequest);var g=u(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=nt(g,this,!0),gt(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,pt(this._animRequest),J(document,"touchmove",this._onTouchMove,this),J(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});V.addInitHook("addHandler","touchZoom",Ka),V.BoxZoom=Ha,V.DoubleClickZoom=Wa,V.Drag=$a,V.Keyboard=Va,V.ScrollWheelZoom=Qa,V.TapHold=Xa,V.TouchZoom=Ka,n.Bounds=et,n.Browser=k,n.CRS=Xt,n.Canvas=qa,n.Circle=Us,n.CircleMarker=Be,n.Class=Qt,n.Control=Bt,n.DivIcon=Ra,n.DivOverlay=$t,n.DomEvent=Rc,n.DomUtil=Bc,n.Draggable=oi,n.Evented=Ji,n.FeatureGroup=Kt,n.GeoJSON=Jt,n.GridLayer=ce,n.Handler=Wt,n.Icon=Ei,n.ImageOverlay=qe,n.LatLng=Y,n.LatLngBounds=Ct,n.Layer=Dt,n.LayerGroup=Ti,n.LineUtil=Kc,n.Map=V,n.Marker=Ne,n.Mixin=Hc,n.Path=ri,n.Point=F,n.PolyUtil=Wc,n.Polygon=Si,n.Polyline=Yt,n.Popup=Ge,n.PosAnimation=Ma,n.Projection=Yc,n.Rectangle=ja,n.Renderer=ti,n.SVG=de,n.SVGOverlay=Da,n.TileLayer=Oi,n.Tooltip=Ue,n.Transformation=_s,n.Util=ds,n.VideoOverlay=Ba,n.bind=u,n.bounds=At,n.canvas=Ga,n.circle=rf,n.circleMarker=of,n.control=he,n.divIcon=pf,n.extend=r,n.featureGroup=sf,n.geoJSON=Na,n.geoJson=uf,n.gridLayer=gf,n.icon=nf,n.imageOverlay=cf,n.latLng=$,n.latLngBounds=rt,n.layerGroup=ef,n.map=Zc,n.marker=af,n.point=Z,n.polygon=lf,n.polyline=hf,n.popup=mf,n.rectangle=Mf,n.setOptions=P,n.stamp=d,n.svg=Ua,n.svgOverlay=df,n.tileLayer=Za,n.tooltip=_f,n.transformation=te,n.version=o,n.videoOverlay=ff;var wf=window.L;n.noConflict=function(){return window.L=wf,this},window.L=n})}(me,me.exports)),me.exports}var v=Qs();const ro=eo({__proto__:null,default:ao(v)},[v]),ho={en_US:{showEagle:"Show Eagle Map",hideEagle:"Hide Eagle Map"},zh_CN:{showEagle:"显示鹰眼图",hideEagle:"隐藏鹰眼图"}},lo={en_US:{coordinate:"Coordinate",zoomLevel:"Zoom Level",FPS:"FPS"},zh_CN:{coordinate:"坐标",zoomLevel:"层级",FPS:"每秒帧数"}},We={en_US:{home:"Go Home",capture:"Screen Capture",center:"View Full",north:"Move North",south:"Move South",east:"Move East",west:"Move West",zoomIn:"Zoom In",zoomOut:"Zoom Out",zoom:"Zoom to this level",dragZoom:"Drag to zoom",more:"More",draw:"Plot",layer:"Layer Manager",lng:"Longitude",lat:"Latitude"},zh_CN:{home:"回到初始位置",capture:"截屏",center:"查看全图",north:"向上平移",south:"向下平移",east:"向右平移",west:"向左平移",zoomIn:"放大一级",zoomOut:"缩小一级",zoom:"缩放到此级别",dragZoom:"拖动缩放",more:"更多",draw:"标绘",layer:"图层管理",lng:"经度",lat:"纬度"}},$e=v.Control.extend({options:{position:"bottomleft",coordinateUnit:"decimal",showCoordinate:!0,showLevel:!0,showFPS:!0},initialize(i){v.setOptions(this,i),this.lastTime=+new Date,this.frames=0,v.Control.prototype.initialize.call(this,this.options)},onAdd(i){this.map=i,this.lang=i.lang,this.langDic=lo,this._container=v.DomUtil.create("div",`${i.clsPrefix}-statusbar`),this.zoom=i.getZoom();const s=i.getCenter();return this.lng=s.lng,this.lat=s.lat,this.options.showCoordinate&&(this._latlngContainer=v.DomUtil.create("div",`${i.clsPrefix}-statusbar-item coordinate`,this._container),this._latlngContainer.innerHTML=`<b>${this.langDic[this.lang].coordinate}:</b>${this.getCoordinate(this.lng)},${this.getCoordinate(this.lat)}`),this.options.showLevel&&(this._levelContainer=v.DomUtil.create("div",`${i.clsPrefix}-statusbar-item level`,this._container),this._levelContainer.innerHTML=`<b>${this.langDic[this.lang].zoomLevel}:</b>${this.zoom+1}`),this.options.showFPS&&(this._fpsContainer=v.DomUtil.create("div",`${i.clsPrefix}-statusbar-item fps`,this._container),this._fpsContainer.innerHTML=`<b>${this.langDic[this.lang].FPS}:</b>60`),this.initEvt(),this._container},initEvt(){this.map.on("mousemove",i=>{this.lat=i.latlng.lat,this.lng=i.latlng.lng,this._latlngContainer&&(this._latlngContainer.innerHTML=`<b>${this.langDic[this.lang].coordinate}:</b>${this.getCoordinate(this.lng,"lng")},${this.getCoordinate(this.lat,"lat")}`)}),this.map.on("zoomend",()=>{this.zoom=this.map.getZoom(),this._levelContainer&&(this._levelContainer.innerHTML=`<b>${this.langDic[this.lang].zoomLevel}:</b>${this.zoom+1}`)}),this.options.showFPS&&this.calcFPS()},getCoordinate(i,s="lng"){switch(this.options.coordinateUnit){case"decimal":return i.toFixed(6);case"radian":return(i*Math.PI/180).toFixed(10);case"degrees":return this._formatDeg(i,s)}},_formatDeg(i,s){const n=parseFloat(i),o=parseInt(n);let r="";s==="lng"?r=o>0?"E":"W":s==="lat"&&(r=o>0?"N":"S");let l=parseInt((n-o)*60),u=(n-o)*3600-l*60;return o+"°"+l+"′"+u.toFixed(2)+"″"+r},calcFPS(){if(this.frames++,this.frames>=30){const i=Date.now()-this.lastTime,s=Math.round(1e3/(i/this.frames));this._fpsContainer&&(this.frames=0,this.lastTime=Date.now(),this._fpsContainer.innerHTML=`<b>${this.langDic[this.lang].FPS}:</b><span>${s}</span>`)}requestAnimationFrame(this.calcFPS.bind(this))}}),Ve=v.Control.extend({includes:v.Evented?v.Evented.prototype:v.Mixin.Events,options:{position:"bottomright",toggleDisplay:!0,zoomLevelOffset:5,zoomLevelFixed:!1,centerFixed:!1,zoomAnimation:!1,autoToggleDisplay:!1,minimized:!1,width:100,height:100,collapsedWidth:22,collapsedHeight:22,aimingRectOptions:{color:"#ff7800",weight:1,interactive:!1},shadowRectOptions:{color:"#000000",weight:1,interactive:!1,opacity:0,fillOpacity:0},strings:{},mapOptions:{}},initialize(i,s){v.Util.setOptions(this,s),this.options.aimingRectOptions.interactive=!1,this.options.shadowRectOptions.interactive=!1,this._layer=i},onAdd(i){this._mainMap=i,this.lang=i.options.lang??this.options.lang??"zh_CN",this.langDic=ho,this.options.strings={hideText:this.langDic[this.lang].hideEagle,showText:this.langDic[this.lang].showEagle},this._container=v.DomUtil.create("div",`${i.clsPrefix}-eaglemap`),this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",v.DomEvent.disableClickPropagation(this._container),v.DomEvent.on(this._container,"mousewheel",v.DomEvent.stopPropagation);let s={attributionControl:!1,dragging:!this.options.centerFixed,zoomControl:!1,zoomAnimation:this.options.zoomAnimation,autoToggleDisplay:this.options.autoToggleDisplay,touchZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),scrollWheelZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),doubleClickZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),boxZoom:!this._isZoomLevelFixed(),crs:i.options.crs};return s=v.Util.extend(this.options.mapOptions,s),this._eagleMap=new v.Map(this._container,s),this._layer instanceof v.Layer&&this._eagleMap.addLayer(this._layer),this._mainMapMoving=!1,this._eagleMapMoving=!1,this._userToggledDisplay=!1,this._minimized=!1,this.options.toggleDisplay&&this._addToggleButton(),this._eagleMap.whenReady(v.Util.bind(function(){this._aimingRect=new v.Rectangle(this._mainMap.getBounds(),this.options.aimingRectOptions).addTo(this._eagleMap),this._shadowRect=new v.Rectangle(this._mainMap.getBounds(),this.options.shadowRectOptions).addTo(this._eagleMap),this._mainMap.on("moveend",this._onMainMapMoved,this),this._mainMap.on("move",this._onMainMapMoving,this),this._eagleMap.on("movestart",this._onEagleMapMoveStarted,this),this._eagleMap.on("move",this._onEagleMapMoving,this),this._eagleMap.on("moveend",this._onEagleMapMoved,this)},this)),this._container},addTo(i){v.Control.prototype.addTo.call(this,i);const s=this.options.centerFixed||this._mainMap.getCenter();return this._eagleMap.setView(s,this._decideZoom(!0)),this._setDisplay(this.options.minimized),this},onRemove(i){this._mainMap.off("moveend",this._onMainMapMoved,this),this._mainMap.off("move",this._onMainMapMoving,this),this._eagleMap.off("moveend",this._onEagleMapMoved,this),this._eagleMap.removeLayer(this._layer)},changeLayer(i){this._eagleMap.removeLayer(this._layer),this._layer=i,this._eagleMap.addLayer(this._layer)},_addToggleButton(){this._toggleDisplayButton=this.options.toggleDisplay?this._createButton("",this._toggleButtonInitialTitleText(),`${this._mainMap.clsPrefix}-eaglemap-toggle-display ${this._mainMap.clsPrefix}-eaglemap-toggle-display-`+this.options.position,this._container,this._toggleDisplayButtonClicked,this):void 0,this._toggleDisplayButton.style.width=this.options.collapsedWidth+"px",this._toggleDisplayButton.style.height=this.options.collapsedHeight+"px"},_toggleButtonInitialTitleText(){return this.options.minimized?this.langDic[this.lang].showEagle:this.langDic[this.lang].hideEagle},_createButton(i,s,n,o,r,l){const u=v.DomUtil.create("a",n,o);u.innerHTML=i,u.href="#",u.title=s;const c=v.DomEvent.stopPropagation;return v.DomEvent.on(u,"click",c).on(u,"mousedown",c).on(u,"dblclick",c).on(u,"click",v.DomEvent.preventDefault).on(u,"click",r,l),u},_toggleDisplayButtonClicked(){this._userToggledDisplay=!0,this._minimized?this._restore():this._minimize()},_setDisplay(i){i!==this._minimized&&(this._minimized?this._restore():this._minimize())},_minimize(){this.options.toggleDisplay?(this._container.style.width=this.options.collapsedWidth+"px",this._container.style.height=this.options.collapsedHeight+"px",this._toggleDisplayButton.className+=" minimized-"+this.options.position,this._toggleDisplayButton.title=this.options.strings.showText):this._container.style.display="none",this._minimized=!0,this._onToggle()},_restore(){this.options.toggleDisplay?(this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",this._toggleDisplayButton.className=this._toggleDisplayButton.className.replace("minimized-"+this.options.position,""),this._toggleDisplayButton.title=this.options.strings.hideText):this._container.style.display="block",this._minimized=!1,this._onToggle()},_onMainMapMoved(i){if(this._eagleMapMoving)this._eagleMapMoving=!1;else{const s=this.options.centerFixed||this._mainMap.getCenter();this._mainMapMoving=!0,this._eagleMap.setView(s,this._decideZoom(!0)),this._setDisplay(this._decideMinimized())}this._aimingRect.setBounds(this._mainMap.getBounds())},_onMainMapMoving(i){this._aimingRect.setBounds(this._mainMap.getBounds())},_onEagleMapMoveStarted(i){if(!this.options.centerFixed){const s=this._aimingRect.getBounds(),n=this._eagleMap.latLngToContainerPoint(s.getSouthWest()),o=this._eagleMap.latLngToContainerPoint(s.getNorthEast());this._lastAimingRectPosition={sw:n,ne:o}}},_onEagleMapMoving(i){this.options.centerFixed||!this._mainMapMoving&&this._lastAimingRectPosition&&(this._shadowRect.setBounds(new v.LatLngBounds(this._eagleMap.containerPointToLatLng(this._lastAimingRectPosition.sw),this._eagleMap.containerPointToLatLng(this._lastAimingRectPosition.ne))),this._shadowRect.setStyle({opacity:1,fillOpacity:.3}))},_onEagleMapMoved(i){this._mainMapMoving?this._mainMapMoving=!1:(this._eagleMapMoving=!0,this._mainMap.setView(this._eagleMap.getCenter(),this._decideZoom(!1)),this._shadowRect.setStyle({opacity:0,fillOpacity:0}))},_isZoomLevelFixed(){const i=this.options.zoomLevelFixed;return this._isDefined(i)&&this._isInteger(i)},_decideZoom(i){if(this._isZoomLevelFixed())return i?this.options.zoomLevelFixed:this._mainMap.getZoom();if(i)return this._mainMap.getZoom()-this.options.zoomLevelOffset;{const s=this._eagleMap.getZoom()-this._mainMap.getZoom(),n=this._eagleMap.getZoom()+this.options.zoomLevelOffset;let o;return s<this.options.zoomLevelOffset&&this._mainMap.getZoom()<this._eagleMap.getMinZoom()+this.options.zoomLevelOffset?this._eagleMap.getZoom()>this._lastEagleMapZoom?(o=this._mainMap.getZoom()+1,this._eagleMap.setZoom(this._eagleMap.getZoom()-1)):o=this._mainMap.getZoom():o=n,this._lastEagleMapZoom=this._eagleMap.getZoom(),o}},_decideMinimized(){return this._userToggledDisplay?this._minimized:this.options.autoToggleDisplay?!!this._mainMap.getBounds().contains(this._eagleMap.getBounds()):this._minimized},_isInteger(i){return typeof i=="number"},_isDefined(i){return typeof i<"u"},_onToggle(){v.Util.requestAnimFrame(function(){v.DomEvent.on(this._container,"transitionend",this._fireToggleEvents,this),v.Browser.any3d||v.Util.requestAnimFrame(this._fireToggleEvents,this)},this)},_fireToggleEvents(){v.DomEvent.off(this._container,"transitionend",this._fireToggleEvents,this);const i={minimized:this._minimized};this.fire(this._minimized?"minimize":"restore",i),this.fire("toggle",i)}}),Qe=L.FeatureGroup.extend({initialize(i,s){this.markers=[],L.Util.setOptions(this,s);const n=typeof this.options.cssClass=="string"?this.options.cssClass:"vertex-marker",o=this.options.iconSize!==void 0?this.options.iconSize:[24,24],r=this.options.iconAnchor!==void 0?this.options.iconAnchor:[12,12],l=this.options.textFn,u=typeof this.options.firstVertex=="boolean"?this.options.firstVertex:!0,c=typeof this.options.lastVertex=="boolean"?this.options.lastVertex:!0;this.dragable=this.options.dragable||!1;let d=i;typeof i.getLatLngs=="function"&&(d=i.getLatLngs());for(let M=u?0:1,b=d.length-(c?0:1);M<b;M++){const A=d[M];var _=typeof l=="function"?l.call(this,M,d):l||"",y=L.divIcon({className:n,html:_,iconSize:o,iconAnchor:r}),p=L.marker(A,{icon:y,pmIgnore:!0,index:M});this.markers.push(p)}L.FeatureGroup.prototype.initialize.call(this,this.markers)},onAdd(i){this.markers.forEach(s=>{L.FeatureGroup.prototype.addLayer.call(this,s)}),L.FeatureGroup.prototype.onAdd.call(this,i)},onRemove(i){this.markers.forEach(s=>{L.FeatureGroup.prototype.removeLayer.call(this,s)}),L.FeatureGroup.prototype.onRemove.call(this,i)}});class ki extends L[L.Layer?"Layer":"Class"]{constructor(s,n,o,r,l){super(),L.setOptions(this,l),this._latlng=s,this._measurement=n,this._title=o,this._rotation=r,this.MEASUREDDATA=null,this.tempAcCurrDrawPoints=null}addTo(s){return s.addLayer(this),this}onAdd(s){this._map=s;const n=this.getPane?this.getPane():s.getPanes().markerPane,o=this._element=L.DomUtil.create("div","leaflet-zoom-animated leaflet-measure-path-measurement",n),r=L.DomUtil.create("div","",o);r.title=this._title,r.innerHTML=this._measurement,s.on("zoomanim",this._animateZoom,this),this._setPosition()}onRemove(s){s.off("zoomanim",this._animateZoom,this),(this.getPane?this.getPane():s.getPanes().markerPane).removeChild(this._element),this._map=null}_setPosition(){L.DomUtil.setPosition(this._element,this._map.latLngToLayerPoint(this._latlng)),this._element.style.transform+=" rotate("+this._rotation+"rad)"}_animateZoom(s){const n=this._map._latLngToNewLayerPoint(this._latlng,s.zoom,s.center).round();L.DomUtil.setPosition(this._element,n),this._element.style.transform+=" rotate("+this._rotation+"rad)"}}function Xs(i,s,n){i._leaflet_pos=s,v.DomUtil.setTransform(i,s,n)}v.Map.addInitHook(function(){var i,s,n;(i=this.options.eagleMapControl)!=null&&i.show&&(this.eagleMapControl=new Ve(this.options.eagleMapControl),this.addControl(this.eagleMapControl)),(s=this.options.statusBarControl)!=null&&s.show&&(this.statusBarControl=new $e(this.options.statusBarControl),this.addControl(this.statusBarControl)),(n=this.options.scaleControl)!=null&&n.show&&(this.scaleControl=new v.Control.Scale(Object.assign({position:"bottomleft",maxWidth:100,metric:!0,imperial:!1},this.options.scaleControl)),this.addControl(this.scaleControl))}),v.TileLayer.mergeOptions({errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAoNSURBVHhe7drLgquqFoXh8/5PtdvVTz/t9Ku9DsgEQSdEczGxxv+1Vikiwhxeqtb//gHCCACkEQBIIwCQRgAgjQBAGgGANAIAaQQA0ggApBEASCMAkEYAII0AQBoBgDQCAGkEANIIAKQRAEgjAJBGACCNAEAaAYA0AgBpBADSCACkEQBIIwCQRgAgjQBAGgGANAIAaQQA0ggApBEASCMAkEYAII0AQBoBgDQCAGkEANIIAKQRAEgjAJBGACCNAEAaAYA0AgBpBADSCACkEQBIIwCQRgAgjQBAGgGANAIAaQQA0ggApBEASCMAkEYAII0AQBoBgDQCAGkEANIIAKQRAEgjAJBGACCNAEAaAYA0AgBpBADSCACkEQBIIwCQRgAgjQBAGgGANAIAaQQA0ggApBEASCMAkEYAII0AQBoBgDQCAGkEANIIAKQRAEgjAJBGACCNAEAaAYA0AgBpBADSCACkEQBIIwCQRgAgjQBAGgGANAIAaQQA0ggApBEASCMAkEYAII0AQBoBgDQCAGkEANIIAKR9aQB+J/ZD7fd2vUQ3b+fQ783vcaV77s/5/b1FG8f/8BQp+sYA/F5//osuN9swG+waywf+XMdlsbXdoW6XaUzbLnrPFKVcvZJ1fB5fGABbbq8EH63/zWUtVf+56QtdrOvz+L4AvKH+rcv7x+2u/9zzK/RG9/b6/3le6mj3wnyBrwvA6+t/c/mfq/5v16n02lf9/fXfu9bb9brxmyPYldHv8m0BeLj+e9+t+0tie/3fe4e+pP7+u1xtw0jnnN369ybqVfWfR77xQ/rE9f/JAHi/rXis/n+nBRsd9BNvZx5rF+2v/zsGF7PZi+o/JDXe0e2noF//uZOt1X/u+v9gALzV2l//qfbNcgnKWnZVR+TGr6r/l/T3VP3Hqr+U9/OmrTVdjq2ZzTvKsaeu/88FYLla0b76j0+QslyLd+EoHzJQ92atvZM/wru+3R6q/5/LXPWzpq01bbeFj4qp5fCjOLUIyrHnrv+PBcCrj+31f6/2g1IOV3vZqcyvuNa4ad79nNjDrmV/Xdh7YWJjCiWd2FvMaqLCJVUTUoTj8uZmHKv6Hz5Hi7lVtUQnr/9PBWBQ/yuxhOfmzVr5tR/U9bziBG1unyrGPW674emHepOQpOnK47+EwVaTYUJcwjd3Pq9Xnza6NLg5OjFm6V9ONZdpD73X1+T1fyqfCUBV0EVv6cM65eaVuMrd4spdufXnnds5wTMZyOffXxahzgp73yi3/3A7j0+n+gaQ+S/6wZ36n2/pdifxZq668a/uN17/5/KRAAzqf7p9NcKit+XZve2bvIjtMmb5PPWufIKwMaz29M9JOJO1yDb934H5Xmkbtli9di1rqx6Yia846cCqqCvePLdNww/+LX26+Fj6qYd4McsBBssxntAnAuCti02lV7K5+bQK49qvGwfrhfFOXTbmk9el1g7IKcIXWQ11WVvNhS3b206//t1L8CY6W1xl/4azHOMZfSAAXhEOlsVr3rNYuuUhfld5a3Xy9jmQt+eGb7C6uFVthXf1+DB0a84Gtpg9d+tgonuf0lG49dizpuKO5WyOD4BXhYNl8Zr7Sn2GxXKWvtdT3txpPdm6xp2+9uvV1ovqfz4+Fn2o+upawyHxnh+O6uThJ/5WKsThT9T/8QHINVLP2yvq3/qYOvHWPne0PMngBKnLe58cs94p9uvVlrvdu9rOnJbjf53STnd5a1lxHgyx194YT+boAHj15q5VMijPhdQytVsf1e1nfILwzbu5lu0q8mVMH5DxZrm9h6JXW+52u4Jm9sorXNu0Or6MNn9HxydB/PXp6I8g9rSYOu2N8WwODoC3WjaVz9V/EFbHelge5pdDtOsEI6WgbAy5Y++q7unVlru9zGj6Q27MXPx5suihPn5Z6Hn8RcxufCTESFibWm+Mp3NsAMpqVXNqU/l0/dfqPnMnXi8Pn6C1PsUzHafBr+fDrTk7UWhtu4tVB+7xSXzJiQ+sqcGKszSDvk7m0ADMq2UbAptKZ5Lzrs40h0Xrvl2UI6/5X17/r6n/Uv3p1WByWP3bxtB6qmGz/oVN4B7vCbf8+H9H81/iBivz1Lx9iSMD8Fj9e7uC4d5SlElVmrUX1P98orqTLR0v30GydF3ry3JrbjQJ076f+P/A5x8Xw0x/gBu89He4YzmpAwPwyvrPJebvnfdHvXXaUqZD80naYWzpuHN1dui0OX1yWnrdmhtNke3LR6yPzw2y+PUweusvnp63r3JcAOq1zZwVjM/fuACjxS1r4O+NtTOvbm+dnlvH+Eue6fDYQTuILR13ri4fWovd+F0Opmg5QdZ0Pj7+HnR9rlaVCDsqsq57U382hwXAm7e8gmGWy//9CmKbweKW4zoltqoit5lfU5tUxe/8lnNDx7nJfHXpd+2LcYf6Sy8wnS7tPyY5M7ScoFX918INP7/zLwaQ1atgY/EX5oSOCkCet1AwzSeW4179r8tnlvfFM9nfg6N1nXZq6q6q+Mej21D/ocmmP0jtHeuq/bD+V1Ig5gVqLtP6di/9lN4eAJvO1TK30tO2vH7mJXTmOe9aL2fZU46rtgRT+KaWUThTZD9tUdd+twIGI8/qcNdj9n95E4zuBmvrEeyr/yHrfONQzuC9AWgrsOa+Xha2ZFFoN5ufGu1q9u/LTdWa9LkXhPMP1Glpan/92jMrI/drZO4oXUB4AnTrPpsnMWZkZPpotqbz6echPc86+jv1f1wAxhW/0A/OpF6A6eXZtocdXm02TbayhMWKnY/NL+V9VXQHQoas/Rbb+qw03e8++q6/VP/vDkC4LW2q+JXp7zp225ktbpf1G3SozXsnmr/17sYhVVBdO/drP/EeObVwEZv6aXifCq6p96Z7u4bmQfqoNIY/Vf+HfQS/R34lfaCmjH0KLNhO6/+B7q2fJdt7IKv/XU+cjjzZf6r+Tx6AsCrhEWP/fIePFC0OdPYAAE8hAJBGACCNAEAaAYA0AgBpBADSCACkEQBIIwCQRgAgjQBAGgGANAIAaQQA0ggApBEASCMAkEYAII0AQBoBgDQCAGkEANIIAKQRAEgjAJBGACCNAEAaAYA0AgBpBADSCACkEQBIIwCQRgAgjQBAGgGANAIAaQQA0ggApBEASCMAkEYAII0AQBoBgDQCAGkEANIIAKQRAEgjAJBGACCNAEAaAYA0AgBpBADSCACkEQBIIwCQRgAgjQBAGgGANAIAaQQA0ggApBEASCMAkEYAII0AQBoBgDQCAGkEANIIAKQRAEgjAJBGACCNAEAaAYA0AgBpBADSCACkEQBIIwCQRgAgjQBAGgGANAIAaQQA0ggApBEASCMAkEYAII0AQBoBgDQCAGkEANIIAKQRAEgjAJBGACCNAEAaAYA0AgBpBADSCACkEQBIIwCQRgAgjQBAGgGANAIAYf/+/R9s8HzCwqXCjgAAAABJRU5ErkJggg=="}),v.Marker.addInitHook(function(){let s=this.options.icon&&this.options.icon.options&&this.options.icon.options.iconAnchor;s&&(s=s[0]+"px "+s[1]+"px"),this.options.rotationOrigin=this.options.rotationOrigin||s||"center bottom",this.options.rotationAngle=this.options.rotationAngle||0,this.on("drag",n=>{n.target._applyRotation()})}),v.Marker.mergeOptions({minZoom:0,maxZoom:16,hideOnMinZoom:!0,minificationScale:.6}),v.Marker.include({_setPos(i){this._icon.style.display="initial";let s;const{minZoom:n,maxZoom:o,hideOnMinZoom:r,minificationScale:l}=this.options;if(n&&o&&o-n>0){const u=parseFloat(((1-l)/(o-n)).toFixed(2)),{iconAnchor:c,iconSize:d}=this.getIcon().options;c?this._map._zoom>=o?(this._icon.style.marginLeft=-c[0],this._icon.style.marginTop=-c[1]):this._map._zoom>n&this._map._zoom<o?(s=1-(o-this._map._zoom)*u,this._icon.style.marginLeft=-c[0]*s,this._icon.style.marginTop=-c[1]*s):this._map._zoom<=n&&r?this._icon.style.display="none":this._map._zoom<=n&&!r&&(s=l,this._icon.style.marginLeft=-c[0],this._icon.style.marginTop=-c[1]):d&&(this._map._zoom>=o?(this._icon.style.marginLeft=-d[0]/2,this._icon.style.marginTop=-d[1]/2):this._map._zoom>n&this._map._zoom<o?(s=1-(o-this._map._zoom)*u,this._icon.style.marginLeft=-d[0]/2*s,this._icon.style.marginTop=-d[1]/2*s):this._map._zoom<=n&&r?this._icon.style.display="none":this._map._zoom<=n&&!r&&(s=l,this._icon.style.marginLeft=-d[0]/2*s,this._icon.style.marginTop=-d[1]/2*s))}this._icon&&Xs(this._icon,i,s||1),this._shadow&&Xs(this._shadow,i,s||1),this._zIndex=i.y+this.options.zIndexOffset,this._resetZIndex(),this._applyRotation()},_applyRotation(){this.options.rotationAngle&&(this._icon.style[v.DomUtil.TRANSFORM+"Origin"]=this.options.rotationOrigin,v.DomUtil.TRANSFORM==="msTransform"?this._icon.style[v.DomUtil.TRANSFORM]="rotate("+this.options.rotationAngle+"deg)":this._icon.style[v.DomUtil.TRANSFORM]+=" rotateZ("+this.options.rotationAngle+"deg)")},setRotationAngle(i){return this.options.rotationAngle=i,this.update(),this},setRotationOrigin(i){return this.options.rotationOrigin=i,this.update(),this},twinkle(i,s){let n=!1,o=0;const r=()=>{o++,o>Math.floor(s/i)?this.setOpacity(1):(n?(this.setOpacity(0),n=!1):(this.setOpacity(1),n=!0),setTimeout(r,i))};r()}}),v.Map.include({hasLayer:function(i){return i&&v.Util.stamp(i)in this._layers}}),v.Path.addInitHook(function(){this.options.color&&(this.color=dt.Color.from(this.options.color)),this.options.fillColor&&(this.fillColor=dt.Color.from(this.options.fillColor))}),v.Polyline.addInitHook(function(){this.options.showMeasurements&&this.showMeasurements()}),v.Circle.include({toGeoJSON(){return{type:"Feature",properties:{},geometry:{type:"Circle",radius:this.getRadius(),coordinates:[this._latlng.lng,this._latlng.lat]}}}}),v.Layer.addInitHook(function(){this._leaflet_id=this.options.id||v.stamp({})}),v.LayerGroup.include({getLayerId(i){return i._leaflet_id},hasLayer(i){return i?(["number","string"].includes(typeof i)?i:this.getLayerId(i))in this._layers:!1}}),v.GridLayer.include({_setZoomTransform:function(i,o,n){var r=o,o=(r!=null&&this.options&&(this.options.corrdType=="gcj02"?r=dt.CoordsUtil.gcjEncrypt(o.lat,o.lng):this.options.corrdType=="bd09"&&(o=dt.CoordsUtil.gcjEncrypt(o.lat,o.lng),r=dt.CoordsUtil.bdEncrypt(o.lat,o.lng))),this._map.getZoomScale(n,i.zoom)),r=i.origin.multiplyBy(o).subtract(this._map._getNewPixelOrigin(r,n)).round();v.Browser.any3d?v.DomUtil.setTransform(i.el,r,o):v.DomUtil.setPosition(i.el,r)},_getTiledPixelBounds:function(o){var n=o,o=(n!=null&&this.options&&(this.options.corrdType=="gcj02"?n=dt.CoordsUtil.gcjEncrypt(o.lat,o.lng):this.options.corrdType=="bd09"&&(o=dt.CoordsUtil.gcjEncrypt(o.lat,o.lng),n=dt.CoordsUtil.bdEncrypt(o.lat,o.lng))),this._map),s=o._animatingZoom?Math.max(o._animateToZoom,o.getZoom()):o.getZoom(),s=o.getZoomScale(s,this._tileZoom),n=o.project(n,this._tileZoom).floor(),o=o.getSize().divideBy(2*s);return new v.Bounds(n.subtract(o),n.add(o))}}),v.TileLayer.addInitHook(function(){this.on("add",function(i){this._container.style.filter=Object.keys(this.options.style||{}).map(s=>`${s}(${this.options.style[s]})`).join(" ")})}),v.Polyline.include({_originalOnAdd:v.Polyline.prototype.onAdd,_originalOnRemove:v.Polyline.prototype.onRemove,_originalSetLatLngs:v.Polyline.prototype.setLatLngs,_originalAddLatLng:v.Polyline.prototype.addLatLng,setLatLngs:function(i){var s=this._map&&this._vertexMarkers&&this._latlngs.length!==i.length;this._originalSetLatLngs(i),s&&(this.removeVertexMarkers(),this.destroyVertexMarkers(),this.createVertexMarkers()),this.options.showMeasurements&&this.updateMeasurements()},removeVertexMarkers:function(){this._map&&this._vertexMarkers&&(this._map.removeLayer(this._vertexMarkers),this._vertexMarkers=void 0)},onAdd:function(i){this._originalOnAdd(i),this.createVertexMarkers(),this.options.showMeasurements&&this.showMeasurements(this.options.measurementOptions)},createVertexMarkers:function(){if(this._map){var i=this.options.vertexMarkers||{};this._vertexMarkers===void 0&&this.options.vertexMarkers&&(this._vertexMarkers=new Qe(this,i).addTo(this._map))}},destroyVertexMarkers:function(){this._vertexMarkers&&(this._vertexMarkers=void 0)},onRemove:function(i){this.removeVertexMarkers(),this._originalOnRemove(i),this.options.showMeasurements&&this.hideMeasurements()},showMeasurements(i){return!this._map||this._measurementLayer?this:(this._measurementOptions=v.extend({showOnHover:!1,minPixelDistance:30,showDistances:!0,showArea:!0,showAggregate:!0,lang:{totalLength:"Total length",totalArea:"Total area",segmentLength:"Segment length"},map:this._map},i||{}),this._measurementLayer=new v.LayerGroup().addTo(this._map),this.updateMeasurements(),this._map.on("zoomend",this.updateMeasurements,this),this)},hideMeasurements(){return this._map.off("zoomend",this.updateMeasurements,this),this._measurementLayer?(this._map.removeLayer(this._measurementLayer),this._measurementLayer=null,this):this},tempFormatDistance(i){const s=this._map.options.crs,n=new Array;for(let b=0;b<i.length;b++){const A=s.project(i[b]);n.push(A)}const o=n.length;let r=0,l,u,c,d,_,y;for(let b=0;b<o-1;b++)l=n[b],c=l.x,d=l.y,u=n[b+1],_=u.x,y=u.y,r+=Math.sqrt((c-_)*(c-_)+(d-y)*(d-y));const p=r;let M="";return p>1e3?M="总长:"+Number(p/1e3).toFixed(1)+"公里":M="总长:"+Math.round(p)+"米",M},tempMoveFormatDistance(i,s){const n=this._map.options.crs;i=n.project(i),i=new Array(i),s=n.project(s),i.push(s);const o=i.length;let r=0,l,u,c,d,_,y;for(let b=0;b<o-1;b++)l=i[b],c=l.x,d=l.y,u=i[b+1],_=u.x,y=u.y,r+=Math.sqrt((c-_)*(c-_)+(d-y)*(d-y));const p=r;let M="";return p>1e3?M=Number(p/1e3).toFixed(1)+"公里":M=Math.round(p)+"米",M},tempFormatArea(i){const s=this._map.options.crs,n=new Array;for(let P=0;P<i.length;P++){const E=s.project(i[P]);n.push(E)}let o=!0;for(var r=0;r<n.length-1;r++){n[r].x>180?o=!0:o=!1;break}const l=n.length;let u=0,c,d,_=0,y=0,p=0,M=0;if(n!=null){let P;if(o)for(var r=0;r<l;r++)P=(r+1)%l,c=n[r],d=n[P],u+=c.x*d.y,u-=c.y*d.x;else{let z,B=0,N=0;for(var r=0;r<l;r++)c=n[r],z=c.x,r==0?(B=z,N=z):(z<B&&(B=z),z>N&&(N=z));const j=parseInt(((B+N)/2+3)/6);for(var r=0;r<l;r++)P=(r+1)%l,r==0?(c=n[r],_=widget.LonLatToXA80N(j,c.x,c.y)[0],y=widget.LonLatToXA80N(j,c.x,c.y)[1]):(_=p,y=M),d=n[P],p=widget.LonLatToXA80N(j,d.x,d.y)[0],M=widget.LonLatToXA80N(j,d.x,d.y)[1],u+=_*M,u-=p*y}}const b=Math.abs(u/2);let A="";return b>1e6?A="总面积:"+Number(b/1e6).toFixed(4)+`平方公里
5
5
  (约:`+Number(b*.0015).toFixed(3)+"亩)":A="总面积:"+b.toFixed(0)+`平方米
6
- (约:`+Number(b*.0015).toFixed(3)+"亩)",A},updateMeasurements(){if(!this._measurementLayer)return this;const i=this.getLatLngs();new Array().push(i);let n=this.getLatLngs();const o=this instanceof v.Polygon,r=this._measurementOptions;let l,u,c,d,_;if(n&&n.length&&v.Util.isArray(n[0])&&(n=n[0]),this._measurementLayer.clearLayers(),this._measurementOptions.showDistances&&n.length>1){i.length-1;for(let y=1,p=n.length;o&&y<=p||y<p;y++)if(l=n[y-1],u=n[y%p],l.distanceTo(u),c=this._map.latLngToLayerPoint(l),d=this._map.latLngToLayerPoint(u),_=c.distanceTo(d),_>=r.minPixelDistance){const M=this.tempMoveFormatDistance(l,u);new ki(this._map.layerPointToLatLng([(c.x+d.x)/2,(c.y+d.y)/2]),M,r.lang.segmentLength,this._getRotation(l,u),r).addTo(this._measurementLayer)}!o&&this._measurementOptions.showAggregate&&(new ki(u,this.tempFormatDistance(i),r.lang.totalLength,0,r).addTo(this._measurementLayer),this.MEASUREDDATA=this.tempFormatDistance(i))}return o&&r.showArea&&n.length>2&&(new ki(this.getBounds().getCenter(),this.tempFormatArea(i[0]),r.lang.totalArea,0,r).addTo(this._measurementLayer),this.MEASUREDDATA=this.tempFormatArea(i[0])),this},_getRotation(i,s){const n=this._map.project(i),o=this._map.project(s);return Math.atan((o.y-n.y)/(o.x-n.x))}}),v.LatLng.prototype.toArray=function(){return[this.lat,this.lng]},v.Path.include({getArea(i){var s,n=this._latlngs[0],o=(i||this._map).options.crs,r=n.length;let l=0,u,c;if(n!=null)for(let d=0;d<r;d++)s=(d+1)%r,u=180<n[d].lng&&90<n[d].lat?{x:n[d].lat,y:n[d].lng}:o.project(n[d]),c=180<n[s].lng&&90<n[s].lat?{x:n[s].lat,y:n[s].lng}:o.project(n[s]),l=(l+=u.x*c.y)-u.y*c.x;return Math.abs(l/2)},getLength(i){for(var s=[],n=(i||this._map).options.crs,o=this._latlngs,r=0;r<o.length;r++)this instanceof v.Polygon?s.push(...o[r]):this instanceof v.Polyline&&s.push(o[r]);let l=0,u,c;for(let M=0,b=s.length-1;M<b;M++){u=180<s[M][0]&&90<s[M][1]?{x:s[M].lat,y:s[M].lng}:n.project(s[M]),c=180<s[M+1][0]&&90<s[M+1][1]?{x:s[M+1].lat,y:s[M+1].lng}:n.project(s[M+1]);var d=u.x,_=u.y,y=c.x,p=c.y;l+=Math.sqrt((d-y)*(d-y)+(_-p)*(_-p))}return l}});var uo={exports:{}};function co(i){i("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),i("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),i("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"),i.WGS84=i["EPSG:4326"],i["EPSG:3785"]=i["EPSG:3857"],i.GOOGLE=i["EPSG:3857"],i["EPSG:900913"]=i["EPSG:3857"],i["EPSG:102113"]=i["EPSG:3857"]}var hi=1,li=2,_i=3,fo=4,Xe=5,Ks=6378137,mo=6356752314e-3,Ys=.0066943799901413165,Ni=484813681109536e-20,T=Math.PI/2,_o=.16666666666666666,po=.04722222222222222,go=.022156084656084655,S=1e-10,_t=.017453292519943295,Rt=57.29577951308232,X=Math.PI/4,Bi=Math.PI*2,at=3.14159265359,wt={};wt.greenwich=0,wt.lisbon=-9.131906111111,wt.paris=2.337229166667,wt.bogota=-74.080916666667,wt.madrid=-3.687938888889,wt.rome=12.452333333333,wt.bern=7.439583333333,wt.jakarta=106.807719444444,wt.ferro=-17.666666666667,wt.brussels=4.367975,wt.stockholm=18.058277777778,wt.athens=23.7163375,wt.oslo=10.722916666667;const vo={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var Js=/[\s_\-\/\(\)]/g;function ii(i,s){if(i[s])return i[s];for(var n=Object.keys(i),o=s.toLowerCase().replace(Js,""),r=-1,l,u;++r<n.length;)if(l=n[r],u=l.toLowerCase().replace(Js,""),u===o)return i[l]}function Ke(i){var s={},n=i.split("+").map(function(c){return c.trim()}).filter(function(c){return c}).reduce(function(c,d){var _=d.split("=");return _.push(!0),c[_[0].toLowerCase()]=_[1],c},{}),o,r,l,u={proj:"projName",datum:"datumCode",rf:function(c){s.rf=parseFloat(c)},lat_0:function(c){s.lat0=c*_t},lat_1:function(c){s.lat1=c*_t},lat_2:function(c){s.lat2=c*_t},lat_ts:function(c){s.lat_ts=c*_t},lon_0:function(c){s.long0=c*_t},lon_1:function(c){s.long1=c*_t},lon_2:function(c){s.long2=c*_t},alpha:function(c){s.alpha=parseFloat(c)*_t},gamma:function(c){s.rectified_grid_angle=parseFloat(c)},lonc:function(c){s.longc=c*_t},x_0:function(c){s.x0=parseFloat(c)},y_0:function(c){s.y0=parseFloat(c)},k_0:function(c){s.k0=parseFloat(c)},k:function(c){s.k0=parseFloat(c)},a:function(c){s.a=parseFloat(c)},b:function(c){s.b=parseFloat(c)},r:function(c){s.a=s.b=parseFloat(c)},r_a:function(){s.R_A=!0},zone:function(c){s.zone=parseInt(c,10)},south:function(){s.utmSouth=!0},towgs84:function(c){s.datum_params=c.split(",").map(function(d){return parseFloat(d)})},to_meter:function(c){s.to_meter=parseFloat(c)},units:function(c){s.units=c;var d=ii(vo,c);d&&(s.to_meter=d.to_meter)},from_greenwich:function(c){s.from_greenwich=c*_t},pm:function(c){var d=ii(wt,c);s.from_greenwich=(d||parseFloat(c))*_t},nadgrids:function(c){c==="@null"?s.datumCode="none":s.nadgrids=c},axis:function(c){var d="ewnsud";c.length===3&&d.indexOf(c.substr(0,1))!==-1&&d.indexOf(c.substr(1,1))!==-1&&d.indexOf(c.substr(2,1))!==-1&&(s.axis=c)},approx:function(){s.approx=!0}};for(o in n)r=n[o],o in u?(l=u[o],typeof l=="function"?l(r):s[l]=r):s[o]=r;return typeof s.datumCode=="string"&&s.datumCode!=="WGS84"&&(s.datumCode=s.datumCode.toLowerCase()),s}var Di=1,tn=2,en=3,_e=4,sn=5,Ye=-1,yo=/\s/,Mo=/[A-Za-z]/,xo=/[A-Za-z84_]/,pe=/[,\]]/,nn=/[\d\.E\-\+]/;function Vt(i){if(typeof i!="string")throw new Error("not a string");this.text=i.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Di}Vt.prototype.readCharicter=function(){var i=this.text[this.place++];if(this.state!==_e)for(;yo.test(i);){if(this.place>=this.text.length)return;i=this.text[this.place++]}switch(this.state){case Di:return this.neutral(i);case tn:return this.keyword(i);case _e:return this.quoted(i);case sn:return this.afterquote(i);case en:return this.number(i);case Ye:return}},Vt.prototype.afterquote=function(i){if(i==='"'){this.word+='"',this.state=_e;return}if(pe.test(i)){this.word=this.word.trim(),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)},Vt.prototype.afterItem=function(i){if(i===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Di;return}if(i==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Di,this.currentObject=this.stack.pop(),this.currentObject||(this.state=Ye);return}},Vt.prototype.number=function(i){if(nn.test(i)){this.word+=i;return}if(pe.test(i)){this.word=parseFloat(this.word),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)},Vt.prototype.quoted=function(i){if(i==='"'){this.state=sn;return}this.word+=i},Vt.prototype.keyword=function(i){if(xo.test(i)){this.word+=i;return}if(i==="["){var s=[];s.push(this.word),this.level++,this.root===null?this.root=s:this.currentObject.push(s),this.stack.push(this.currentObject),this.currentObject=s,this.state=Di;return}if(pe.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place)},Vt.prototype.neutral=function(i){if(Mo.test(i)){this.word=i,this.state=tn;return}if(i==='"'){this.word="",this.state=_e;return}if(nn.test(i)){this.word=i,this.state=en;return}if(pe.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place)},Vt.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===Ye)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function wo(i){var s=new Vt(i);return s.output()}function an(i,s,n){Array.isArray(s)&&(n.unshift(s),s=null);var o=s?{}:i,r=n.reduce(function(l,u){return pi(u,l),l},o);s&&(i[s]=r)}function pi(i,s){if(!Array.isArray(i)){s[i]=!0;return}var n=i.shift();if(n==="PARAMETER"&&(n=i.shift()),i.length===1){if(Array.isArray(i[0])){s[n]={},pi(i[0],s[n]);return}s[n]=i[0];return}if(!i.length){s[n]=!0;return}if(n==="TOWGS84"){s[n]=i;return}if(n==="AXIS"){n in s||(s[n]=[]),s[n].push(i);return}Array.isArray(n)||(s[n]={});var o;switch(n){case"UNIT":case"PRIMEM":case"VERT_DATUM":s[n]={name:i[0].toLowerCase(),convert:i[1]},i.length===3&&pi(i[2],s[n]);return;case"SPHEROID":case"ELLIPSOID":s[n]={name:i[0],a:i[1],rf:i[2]},i.length===4&&pi(i[3],s[n]);return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":i[0]=["name",i[0]],an(s,n,i);return;default:for(o=-1;++o<i.length;)if(!Array.isArray(i[o]))return pi(i,s[n]);return an(s,n,i)}}var bo=.017453292519943295;function Lo(i,s){var n=s[0],o=s[1];!(n in i)&&o in i&&(i[n]=i[o],s.length===3&&(i[n]=s[2](i[n])))}function Zt(i){return i*bo}function Po(i){if(i.type==="GEOGCS"?i.projName="longlat":i.type==="LOCAL_CS"?(i.projName="identity",i.local=!0):typeof i.PROJECTION=="object"?i.projName=Object.keys(i.PROJECTION)[0]:i.projName=i.PROJECTION,i.AXIS){for(var s="",n=0,o=i.AXIS.length;n<o;++n){var r=[i.AXIS[n][0].toLowerCase(),i.AXIS[n][1].toLowerCase()];r[0].indexOf("north")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="north"?s+="n":r[0].indexOf("south")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="south"?s+="s":r[0].indexOf("east")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="east"?s+="e":(r[0].indexOf("west")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="west")&&(s+="w")}s.length===2&&(s+="u"),s.length===3&&(i.axis=s)}i.UNIT&&(i.units=i.UNIT.name.toLowerCase(),i.units==="metre"&&(i.units="meter"),i.UNIT.convert&&(i.type==="GEOGCS"?i.DATUM&&i.DATUM.SPHEROID&&(i.to_meter=i.UNIT.convert*i.DATUM.SPHEROID.a):i.to_meter=i.UNIT.convert));var l=i.GEOGCS;i.type==="GEOGCS"&&(l=i),l&&(l.DATUM?i.datumCode=l.DATUM.name.toLowerCase():i.datumCode=l.name.toLowerCase(),i.datumCode.slice(0,2)==="d_"&&(i.datumCode=i.datumCode.slice(2)),(i.datumCode==="new_zealand_geodetic_datum_1949"||i.datumCode==="new_zealand_1949")&&(i.datumCode="nzgd49"),(i.datumCode==="wgs_1984"||i.datumCode==="world_geodetic_system_1984")&&(i.PROJECTION==="Mercator_Auxiliary_Sphere"&&(i.sphere=!0),i.datumCode="wgs84"),i.datumCode.slice(-6)==="_ferro"&&(i.datumCode=i.datumCode.slice(0,-6)),i.datumCode.slice(-8)==="_jakarta"&&(i.datumCode=i.datumCode.slice(0,-8)),~i.datumCode.indexOf("belge")&&(i.datumCode="rnb72"),l.DATUM&&l.DATUM.SPHEROID&&(i.ellps=l.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),i.ellps.toLowerCase().slice(0,13)==="international"&&(i.ellps="intl"),i.a=l.DATUM.SPHEROID.a,i.rf=parseFloat(l.DATUM.SPHEROID.rf,10)),l.DATUM&&l.DATUM.TOWGS84&&(i.datum_params=l.DATUM.TOWGS84),~i.datumCode.indexOf("osgb_1936")&&(i.datumCode="osgb36"),~i.datumCode.indexOf("osni_1952")&&(i.datumCode="osni52"),(~i.datumCode.indexOf("tm65")||~i.datumCode.indexOf("geodetic_datum_of_1965"))&&(i.datumCode="ire65"),i.datumCode==="ch1903+"&&(i.datumCode="ch1903"),~i.datumCode.indexOf("israel")&&(i.datumCode="isr93")),i.b&&!isFinite(i.b)&&(i.b=i.a);function u(_){var y=i.to_meter||1;return _*y}var c=function(_){return Lo(i,_)},d=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",Zt],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Zt],["x0","false_easting",u],["y0","false_northing",u],["long0","central_meridian",Zt],["lat0","latitude_of_origin",Zt],["lat0","standard_parallel_1",Zt],["lat1","standard_parallel_1",Zt],["lat2","standard_parallel_2",Zt],["azimuth","Azimuth"],["alpha","azimuth",Zt],["srsCode","name"]];d.forEach(c),!i.long0&&i.longc&&(i.projName==="Albers_Conic_Equal_Area"||i.projName==="Lambert_Azimuthal_Equal_Area")&&(i.long0=i.longc),!i.lat_ts&&i.lat1&&(i.projName==="Stereographic_South_Pole"||i.projName==="Polar Stereographic (variant B)")?(i.lat0=Zt(i.lat1>0?90:-90),i.lat_ts=i.lat1):!i.lat_ts&&i.lat0&&i.projName==="Polar_Stereographic"&&(i.lat_ts=i.lat0,i.lat0=Zt(i.lat0>0?90:-90))}function on(i){var s=wo(i),n=s.shift(),o=s.shift();s.unshift(["name",o]),s.unshift(["type",n]);var r={};return pi(s,r),Po(r),r}function yt(i){var s=this;if(arguments.length===2){var n=arguments[1];typeof n=="string"?n.charAt(0)==="+"?yt[i]=Ke(arguments[1]):yt[i]=on(arguments[1]):yt[i]=n}else if(arguments.length===1){if(Array.isArray(i))return i.map(function(o){Array.isArray(o)?yt.apply(s,o):yt(o)});if(typeof i=="string"){if(i in yt)return yt[i]}else"EPSG"in i?yt["EPSG:"+i.EPSG]=i:"ESRI"in i?yt["ESRI:"+i.ESRI]=i:"IAU2000"in i?yt["IAU2000:"+i.IAU2000]=i:console.log(i);return}}co(yt);function Ao(i){return typeof i=="string"}function Co(i){return i in yt}var To=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function Eo(i){return To.some(function(s){return i.indexOf(s)>-1})}var So=["3857","900913","3785","102113"];function Io(i){var s=ii(i,"authority");if(s){var n=ii(s,"epsg");return n&&So.indexOf(n)>-1}}function Oo(i){var s=ii(i,"extension");if(s)return ii(s,"proj4")}function zo(i){return i[0]==="+"}function ko(i){if(Ao(i)){if(Co(i))return yt[i];if(Eo(i)){var s=on(i);if(Io(s))return yt["EPSG:3857"];var n=Oo(s);return n?Ke(n):s}if(zo(i))return Ke(i)}else return i}function rn(i,s){i=i||{};var n,o;if(!s)return i;for(o in s)n=s[o],n!==void 0&&(i[o]=n);return i}function Ft(i,s,n){var o=i*s;return n/Math.sqrt(1-o*o)}function Ri(i){return i<0?-1:1}function I(i){return Math.abs(i)<=at?i:i-Ri(i)*Bi}function Nt(i,s,n){var o=i*n,r=.5*i;return o=Math.pow((1-o)/(1+o),r),Math.tan(.5*(T-s))/o}function Zi(i,s){for(var n=.5*i,o,r,l=T-2*Math.atan(s),u=0;u<=15;u++)if(o=i*Math.sin(l),r=T-2*Math.atan(s*Math.pow((1-o)/(1+o),n))-l,l+=r,Math.abs(r)<=1e-10)return l;return-9999}function No(){var i=this.b/this.a;this.es=1-i*i,"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=Ft(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Bo(i){var s=i.x,n=i.y;if(n*Rt>90&&n*Rt<-90&&s*Rt>180&&s*Rt<-180)return null;var o,r;if(Math.abs(Math.abs(n)-T)<=S)return null;if(this.sphere)o=this.x0+this.a*this.k0*I(s-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(X+.5*n));else{var l=Math.sin(n),u=Nt(this.e,n,l);o=this.x0+this.a*this.k0*I(s-this.long0),r=this.y0-this.a*this.k0*Math.log(u)}return i.x=o,i.y=r,i}function Do(i){var s=i.x-this.x0,n=i.y-this.y0,o,r;if(this.sphere)r=T-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var l=Math.exp(-n/(this.a*this.k0));if(r=Zi(this.e,l),r===-9999)return null}return o=I(this.long0+s/(this.a*this.k0)),i.x=o,i.y=r,i}var Ro=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const Zo={init:No,forward:Bo,inverse:Do,names:Ro};function Fo(){}function hn(i){return i}var qo=["longlat","identity"],Go=[Zo,{init:Fo,forward:hn,inverse:hn,names:qo}],ge={},ve=[];function ln(i,s){var n=ve.length;return i.names?(ve[n]=i,i.names.forEach(function(o){ge[o.toLowerCase()]=n}),this):(console.log(s),!0)}function Uo(i){if(!i)return!1;var s=i.toLowerCase();if(typeof ge[s]<"u"&&ve[ge[s]])return ve[ge[s]]}function jo(){Go.forEach(ln)}const Ho={start:jo,add:ln,get:Uo};var R={};R.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},R.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},R.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},R.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},R.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},R.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},R.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},R.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},R.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},R.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},R.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},R.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},R.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},R.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},R.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},R.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},R.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},R.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},R.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},R.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},R.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},R.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},R.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},R.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},R.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},R.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},R.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},R.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},R.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},R.hough={a:6378270,rf:297,ellipseName:"Hough"},R.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},R.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},R.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},R.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},R.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},R.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},R.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},R.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},R.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},R.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},R.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},R.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var Wo=R.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};R.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function $o(i,s,n,o){var r=i*i,l=s*s,u=(r-l)/r,c=0;o?(i*=1-u*(_o+u*(po+u*go)),r=i*i,u=0):c=Math.sqrt(u);var d=(r-l)/l;return{es:u,e:c,ep2:d}}function Vo(i,s,n,o,r){if(!i){var l=ii(R,o);l||(l=Wo),i=l.a,s=l.b,n=l.rf}return n&&!s&&(s=(1-1/n)*i),(n===0||Math.abs(i-s)<S)&&(r=!0,s=i),{a:i,b:s,rf:n,sphere:r}}var ct={};ct.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ct.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ct.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},ct.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},ct.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},ct.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},ct.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},ct.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},ct.militargeographische_institut={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},ct.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ct.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},ct.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},ct.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},ct.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},ct.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},ct.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},ct.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},ct.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function Qo(i,s,n,o,r,l,u){var c={};return i===void 0||i==="none"?c.datum_type=Xe:c.datum_type=fo,s&&(c.datum_params=s.map(parseFloat),(c.datum_params[0]!==0||c.datum_params[1]!==0||c.datum_params[2]!==0)&&(c.datum_type=hi),c.datum_params.length>3&&(c.datum_params[3]!==0||c.datum_params[4]!==0||c.datum_params[5]!==0||c.datum_params[6]!==0)&&(c.datum_type=li,c.datum_params[3]*=Ni,c.datum_params[4]*=Ni,c.datum_params[5]*=Ni,c.datum_params[6]=c.datum_params[6]/1e6+1)),u&&(c.datum_type=_i,c.grids=u),c.a=n,c.b=o,c.es=r,c.ep2=l,c}var un={};function Xo(i,s){var n=new DataView(s),o=Jo(n),r=tr(n,o),l=ir(n,r,o),u={header:r,subgrids:l};return un[i]=u,u}function Ko(i){if(i===void 0)return null;var s=i.split(",");return s.map(Yo)}function Yo(i){if(i.length===0)return null;var s=i[0]==="@";return s&&(i=i.slice(1)),i==="null"?{name:"null",mandatory:!s,grid:null,isNull:!0}:{name:i,mandatory:!s,grid:un[i]||null,isNull:!1}}function gi(i){return i/3600*Math.PI/180}function Jo(i){var s=i.getInt32(8,!1);return s===11?!1:(s=i.getInt32(8,!0),s!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function tr(i,s){return{nFields:i.getInt32(8,s),nSubgridFields:i.getInt32(24,s),nSubgrids:i.getInt32(40,s),shiftType:Je(i,56,64).trim(),fromSemiMajorAxis:i.getFloat64(120,s),fromSemiMinorAxis:i.getFloat64(136,s),toSemiMajorAxis:i.getFloat64(152,s),toSemiMinorAxis:i.getFloat64(168,s)}}function Je(i,s,n){return String.fromCharCode.apply(null,new Uint8Array(i.buffer.slice(s,n)))}function ir(i,s,n){for(var o=176,r=[],l=0;l<s.nSubgrids;l++){var u=sr(i,o,n),c=nr(i,o,u,n),d=Math.round(1+(u.upperLongitude-u.lowerLongitude)/u.longitudeInterval),_=Math.round(1+(u.upperLatitude-u.lowerLatitude)/u.latitudeInterval);r.push({ll:[gi(u.lowerLongitude),gi(u.lowerLatitude)],del:[gi(u.longitudeInterval),gi(u.latitudeInterval)],lim:[d,_],count:u.gridNodeCount,cvs:er(c)}),o+=176+u.gridNodeCount*16}return r}function er(i){return i.map(function(s){return[gi(s.longitudeShift),gi(s.latitudeShift)]})}function sr(i,s,n){return{name:Je(i,s+8,s+16).trim(),parent:Je(i,s+24,s+24+8).trim(),lowerLatitude:i.getFloat64(s+72,n),upperLatitude:i.getFloat64(s+88,n),lowerLongitude:i.getFloat64(s+104,n),upperLongitude:i.getFloat64(s+120,n),latitudeInterval:i.getFloat64(s+136,n),longitudeInterval:i.getFloat64(s+152,n),gridNodeCount:i.getInt32(s+168,n)}}function nr(i,s,n,o){for(var r=s+176,l=16,u=[],c=0;c<n.gridNodeCount;c++){var d={latitudeShift:i.getFloat32(r+c*l,o),longitudeShift:i.getFloat32(r+c*l+4,o),latitudeAccuracy:i.getFloat32(r+c*l+8,o),longitudeAccuracy:i.getFloat32(r+c*l+12,o)};u.push(d)}return u}function qt(i,s){if(!(this instanceof qt))return new qt(i);s=s||function(_){if(_)throw _};var n=ko(i);if(typeof n!="object"){s("Could not parse to valid json: "+i);return}var o=qt.projections.get(n.projName);if(!o){s("Could not get projection name from: "+i);return}if(n.datumCode&&n.datumCode!=="none"){var r=ii(ct,n.datumCode);r&&(n.datum_params=n.datum_params||(r.towgs84?r.towgs84.split(","):null),n.ellps=r.ellipse,n.datumName=r.datumName?r.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu",n.ellps=n.ellps||"wgs84",n.lat1=n.lat1||n.lat0;var l=Vo(n.a,n.b,n.rf,n.ellps,n.sphere),u=$o(l.a,l.b,l.rf,n.R_A),c=Ko(n.nadgrids),d=n.datum||Qo(n.datumCode,n.datum_params,l.a,l.b,u.es,u.ep2,c);rn(this,n),rn(this,o),this.a=l.a,this.b=l.b,this.rf=l.rf,this.sphere=l.sphere,this.es=u.es,this.e=u.e,this.ep2=u.ep2,this.datum=d,this.init(),s(null,this)}qt.projections=Ho,qt.projections.start();function ar(i,s){return i.datum_type!==s.datum_type||i.a!==s.a||Math.abs(i.es-s.es)>5e-11?!1:i.datum_type===hi?i.datum_params[0]===s.datum_params[0]&&i.datum_params[1]===s.datum_params[1]&&i.datum_params[2]===s.datum_params[2]:i.datum_type===li?i.datum_params[0]===s.datum_params[0]&&i.datum_params[1]===s.datum_params[1]&&i.datum_params[2]===s.datum_params[2]&&i.datum_params[3]===s.datum_params[3]&&i.datum_params[4]===s.datum_params[4]&&i.datum_params[5]===s.datum_params[5]&&i.datum_params[6]===s.datum_params[6]:!0}function cn(i,s,n){var o=i.x,r=i.y,l=i.z?i.z:0,u,c,d,_;if(r<-T&&r>-1.001*T)r=-T;else if(r>T&&r<1.001*T)r=T;else{if(r<-T)return{x:-1/0,y:-1/0,z:i.z};if(r>T)return{x:1/0,y:1/0,z:i.z}}return o>Math.PI&&(o-=2*Math.PI),c=Math.sin(r),_=Math.cos(r),d=c*c,u=n/Math.sqrt(1-s*d),{x:(u+l)*_*Math.cos(o),y:(u+l)*_*Math.sin(o),z:(u*(1-s)+l)*c}}function fn(i,s,n,o){var r=1e-12,l=r*r,u=30,c,d,_,y,p,M,b,A,P,E,z,B,N,j=i.x,H=i.y,W=i.z?i.z:0,ft,tt,Pt;if(c=Math.sqrt(j*j+H*H),d=Math.sqrt(j*j+H*H+W*W),c/n<r){if(ft=0,d/n<r)return tt=T,Pt=-o,{x:i.x,y:i.y,z:i.z}}else ft=Math.atan2(H,j);_=W/d,y=c/d,p=1/Math.sqrt(1-s*(2-s)*y*y),A=y*(1-s)*p,P=_*p,N=0;do N++,b=n/Math.sqrt(1-s*P*P),Pt=c*A+W*P-b*(1-s*P*P),M=s*b/(b+Pt),p=1/Math.sqrt(1-M*(2-M)*y*y),E=y*(1-M)*p,z=_*p,B=z*A-E*P,A=E,P=z;while(B*B>l&&N<u);return tt=Math.atan(z/Math.abs(E)),{x:ft,y:tt,z:Pt}}function or(i,s,n){if(s===hi)return{x:i.x+n[0],y:i.y+n[1],z:i.z+n[2]};if(s===li){var o=n[0],r=n[1],l=n[2],u=n[3],c=n[4],d=n[5],_=n[6];return{x:_*(i.x-d*i.y+c*i.z)+o,y:_*(d*i.x+i.y-u*i.z)+r,z:_*(-c*i.x+u*i.y+i.z)+l}}}function rr(i,s,n){if(s===hi)return{x:i.x-n[0],y:i.y-n[1],z:i.z-n[2]};if(s===li){var o=n[0],r=n[1],l=n[2],u=n[3],c=n[4],d=n[5],_=n[6],y=(i.x-o)/_,p=(i.y-r)/_,M=(i.z-l)/_;return{x:y+d*p-c*M,y:-d*y+p+u*M,z:c*y-u*p+M}}}function ye(i){return i===hi||i===li}function hr(i,s,n){if(ar(i,s)||i.datum_type===Xe||s.datum_type===Xe)return n;var o=i.a,r=i.es;if(i.datum_type===_i){var l=dn(i,!1,n);if(l!==0)return;o=Ks,r=Ys}var u=s.a,c=s.b,d=s.es;if(s.datum_type===_i&&(u=Ks,c=mo,d=Ys),r===d&&o===u&&!ye(i.datum_type)&&!ye(s.datum_type))return n;if(n=cn(n,r,o),ye(i.datum_type)&&(n=or(n,i.datum_type,i.datum_params)),ye(s.datum_type)&&(n=rr(n,s.datum_type,s.datum_params)),n=fn(n,d,u,c),s.datum_type===_i){var _=dn(s,!0,n);if(_!==0)return}return n}function dn(i,s,n){if(i.grids===null||i.grids.length===0)return console.log("Grid shift grids not found"),-1;var o={x:-n.x,y:n.y},r={x:Number.NaN,y:Number.NaN},l=[];t:for(var u=0;u<i.grids.length;u++){var c=i.grids[u];if(l.push(c.name),c.isNull){r=o;break}if(c.mandatory,c.grid===null){if(c.mandatory)return console.log("Unable to find mandatory grid '"+c.name+"'"),-1;continue}for(var d=c.grid.subgrids,_=0,y=d.length;_<y;_++){var p=d[_],M=(Math.abs(p.del[1])+Math.abs(p.del[0]))/1e4,b=p.ll[0]-M,A=p.ll[1]-M,P=p.ll[0]+(p.lim[0]-1)*p.del[0]+M,E=p.ll[1]+(p.lim[1]-1)*p.del[1]+M;if(!(A>o.y||b>o.x||E<o.y||P<o.x)&&(r=lr(o,s,p),!isNaN(r.x)))break t}}return isNaN(r.x)?(console.log("Failed to find a grid shift table for location '"+-o.x*Rt+" "+o.y*Rt+" tried: '"+l+"'"),-1):(n.x=-r.x,n.y=r.y,0)}function lr(i,s,n){var o={x:Number.NaN,y:Number.NaN};if(isNaN(i.x))return o;var r={x:i.x,y:i.y};r.x-=n.ll[0],r.y-=n.ll[1],r.x=I(r.x-Math.PI)+Math.PI;var l=mn(r,n);if(s){if(isNaN(l.x))return o;l.x=r.x-l.x,l.y=r.y-l.y;var u=9,c=1e-12,d,_;do{if(_=mn(l,n),isNaN(_.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}d={x:r.x-(_.x+l.x),y:r.y-(_.y+l.y)},l.x+=d.x,l.y+=d.y}while(u--&&Math.abs(d.x)>c&&Math.abs(d.y)>c);if(u<0)return console.log("Inverse grid shift iterator failed to converge."),o;o.x=I(l.x+n.ll[0]),o.y=l.y+n.ll[1]}else isNaN(l.x)||(o.x=i.x+l.x,o.y=i.y+l.y);return o}function mn(i,s){var n={x:i.x/s.del[0],y:i.y/s.del[1]},o={x:Math.floor(n.x),y:Math.floor(n.y)},r={x:n.x-1*o.x,y:n.y-1*o.y},l={x:Number.NaN,y:Number.NaN},u;if(o.x<0||o.x>=s.lim[0]||o.y<0||o.y>=s.lim[1])return l;u=o.y*s.lim[0]+o.x;var c={x:s.cvs[u][0],y:s.cvs[u][1]};u++;var d={x:s.cvs[u][0],y:s.cvs[u][1]};u+=s.lim[0];var _={x:s.cvs[u][0],y:s.cvs[u][1]};u--;var y={x:s.cvs[u][0],y:s.cvs[u][1]},p=r.x*r.y,M=r.x*(1-r.y),b=(1-r.x)*(1-r.y),A=(1-r.x)*r.y;return l.x=b*c.x+M*d.x+A*y.x+p*_.x,l.y=b*c.y+M*d.y+A*y.y+p*_.y,l}function _n(i,s,n){var o=n.x,r=n.y,l=n.z||0,u,c,d,_={};for(d=0;d<3;d++)if(!(s&&d===2&&n.z===void 0))switch(d===0?(u=o,"ew".indexOf(i.axis[d])!==-1?c="x":c="y"):d===1?(u=r,"ns".indexOf(i.axis[d])!==-1?c="y":c="x"):(u=l,c="z"),i.axis[d]){case"e":_[c]=u;break;case"w":_[c]=-u;break;case"n":_[c]=u;break;case"s":_[c]=-u;break;case"u":n[c]!==void 0&&(_.z=u);break;case"d":n[c]!==void 0&&(_.z=-u);break;default:return null}return _}function pn(i){var s={x:i[0],y:i[1]};return i.length>2&&(s.z=i[2]),i.length>3&&(s.m=i[3]),s}function ur(i){gn(i.x),gn(i.y)}function gn(i){if(typeof Number.isFinite=="function"){if(Number.isFinite(i))return;throw new TypeError("coordinates must be finite numbers")}if(typeof i!="number"||i!==i||!isFinite(i))throw new TypeError("coordinates must be finite numbers")}function cr(i,s){return(i.datum.datum_type===hi||i.datum.datum_type===li||i.datum.datum_type===_i)&&s.datumCode!=="WGS84"||(s.datum.datum_type===hi||s.datum.datum_type===li||s.datum.datum_type===_i)&&i.datumCode!=="WGS84"}function Me(i,s,n,o){var r;Array.isArray(n)?n=pn(n):n={x:n.x,y:n.y,z:n.z,m:n.m};var l=n.z!==void 0;if(ur(n),i.datum&&s.datum&&cr(i,s)&&(r=new qt("WGS84"),n=Me(i,r,n,o),i=r),o&&i.axis!=="enu"&&(n=_n(i,!1,n)),i.projName==="longlat")n={x:n.x*_t,y:n.y*_t,z:n.z||0};else if(i.to_meter&&(n={x:n.x*i.to_meter,y:n.y*i.to_meter,z:n.z||0}),n=i.inverse(n),!n)return;if(i.from_greenwich&&(n.x+=i.from_greenwich),n=hr(i.datum,s.datum,n),!!n)return s.from_greenwich&&(n={x:n.x-s.from_greenwich,y:n.y,z:n.z||0}),s.projName==="longlat"?n={x:n.x*Rt,y:n.y*Rt,z:n.z||0}:(n=s.forward(n),s.to_meter&&(n={x:n.x/s.to_meter,y:n.y/s.to_meter,z:n.z||0})),o&&s.axis!=="enu"?_n(s,!0,n):(n&&!l&&delete n.z,n)}var vn=qt("WGS84");function ts(i,s,n,o){var r,l,u;return Array.isArray(n)?(r=Me(i,s,n,o)||{x:NaN,y:NaN},n.length>2?typeof i.name<"u"&&i.name==="geocent"||typeof s.name<"u"&&s.name==="geocent"?typeof r.z=="number"?[r.x,r.y,r.z].concat(n.slice(3)):[r.x,r.y,n[2]].concat(n.slice(3)):[r.x,r.y].concat(n.slice(2)):[r.x,r.y]):(l=Me(i,s,n,o),u=Object.keys(n),u.length===2||u.forEach(function(c){if(typeof i.name<"u"&&i.name==="geocent"||typeof s.name<"u"&&s.name==="geocent"){if(c==="x"||c==="y"||c==="z")return}else if(c==="x"||c==="y")return;l[c]=n[c]}),l)}function yn(i){return i instanceof qt?i:i.oProj?i.oProj:qt(i)}function Et(i,s,n){i=yn(i);var o=!1,r;return typeof s>"u"?(s=i,i=vn,o=!0):(typeof s.x<"u"||Array.isArray(s))&&(n=s,s=i,i=vn,o=!0),s=yn(s),n?ts(i,s,n):(r={forward:function(l,u){return ts(i,s,l,u)},inverse:function(l,u){return ts(s,i,l,u)}},o&&(r.oProj=s),r)}var Mn=6,xn="AJSAJS",wn="AFAFAF",vi=65,bt=73,It=79,Fi=86,qi=90;const fr={forward:bn,inverse:dr,toPoint:Ln};function bn(i,s){return s=s||5,pr(mr({lat:i[1],lon:i[0]}),s)}function dr(i){var s=es(Cn(i.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat,s.lon,s.lat]:[s.left,s.bottom,s.right,s.top]}function Ln(i){var s=es(Cn(i.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat]:[(s.left+s.right)/2,(s.top+s.bottom)/2]}function is(i){return i*(Math.PI/180)}function Pn(i){return 180*(i/Math.PI)}function mr(i){var s=i.lat,n=i.lon,o=6378137,r=.00669438,l=.9996,u,c,d,_,y,p,M,b=is(s),A=is(n),P,E;E=Math.floor((n+180)/6)+1,n===180&&(E=60),s>=56&&s<64&&n>=3&&n<12&&(E=32),s>=72&&s<84&&(n>=0&&n<9?E=31:n>=9&&n<21?E=33:n>=21&&n<33?E=35:n>=33&&n<42&&(E=37)),u=(E-1)*6-180+3,P=is(u),c=r/(1-r),d=o/Math.sqrt(1-r*Math.sin(b)*Math.sin(b)),_=Math.tan(b)*Math.tan(b),y=c*Math.cos(b)*Math.cos(b),p=Math.cos(b)*(A-P),M=o*((1-r/4-3*r*r/64-5*r*r*r/256)*b-(3*r/8+3*r*r/32+45*r*r*r/1024)*Math.sin(2*b)+(15*r*r/256+45*r*r*r/1024)*Math.sin(4*b)-35*r*r*r/3072*Math.sin(6*b));var z=l*d*(p+(1-_+y)*p*p*p/6+(5-18*_+_*_+72*y-58*c)*p*p*p*p*p/120)+5e5,B=l*(M+d*Math.tan(b)*(p*p/2+(5-_+9*y+4*y*y)*p*p*p*p/24+(61-58*_+_*_+600*y-330*c)*p*p*p*p*p*p/720));return s<0&&(B+=1e7),{northing:Math.round(B),easting:Math.round(z),zoneNumber:E,zoneLetter:_r(s)}}function es(i){var s=i.northing,n=i.easting,o=i.zoneLetter,r=i.zoneNumber;if(r<0||r>60)return null;var l=.9996,u=6378137,c=.00669438,d,_=(1-Math.sqrt(1-c))/(1+Math.sqrt(1-c)),y,p,M,b,A,P,E,z,B,N=n-5e5,j=s;o<"N"&&(j-=1e7),E=(r-1)*6-180+3,d=c/(1-c),P=j/l,z=P/(u*(1-c/4-3*c*c/64-5*c*c*c/256)),B=z+(3*_/2-27*_*_*_/32)*Math.sin(2*z)+(21*_*_/16-55*_*_*_*_/32)*Math.sin(4*z)+151*_*_*_/96*Math.sin(6*z),y=u/Math.sqrt(1-c*Math.sin(B)*Math.sin(B)),p=Math.tan(B)*Math.tan(B),M=d*Math.cos(B)*Math.cos(B),b=u*(1-c)/Math.pow(1-c*Math.sin(B)*Math.sin(B),1.5),A=N/(y*l);var H=B-y*Math.tan(B)/b*(A*A/2-(5+3*p+10*M-4*M*M-9*d)*A*A*A*A/24+(61+90*p+298*M+45*p*p-252*d-3*M*M)*A*A*A*A*A*A/720);H=Pn(H);var W=(A-(1+2*p+M)*A*A*A/6+(5-2*M+28*p-3*M*M+8*d+24*p*p)*A*A*A*A*A/120)/Math.cos(B);W=E+Pn(W);var ft;if(i.accuracy){var tt=es({northing:i.northing+i.accuracy,easting:i.easting+i.accuracy,zoneLetter:i.zoneLetter,zoneNumber:i.zoneNumber});ft={top:tt.lat,right:tt.lon,bottom:H,left:W}}else ft={lat:H,lon:W};return ft}function _r(i){var s="Z";return 84>=i&&i>=72?s="X":72>i&&i>=64?s="W":64>i&&i>=56?s="V":56>i&&i>=48?s="U":48>i&&i>=40?s="T":40>i&&i>=32?s="S":32>i&&i>=24?s="R":24>i&&i>=16?s="Q":16>i&&i>=8?s="P":8>i&&i>=0?s="N":0>i&&i>=-8?s="M":-8>i&&i>=-16?s="L":-16>i&&i>=-24?s="K":-24>i&&i>=-32?s="J":-32>i&&i>=-40?s="H":-40>i&&i>=-48?s="G":-48>i&&i>=-56?s="F":-56>i&&i>=-64?s="E":-64>i&&i>=-72?s="D":-72>i&&i>=-80&&(s="C"),s}function pr(i,s){var n="00000"+i.easting,o="00000"+i.northing;return i.zoneNumber+i.zoneLetter+gr(i.easting,i.northing,i.zoneNumber)+n.substr(n.length-5,s)+o.substr(o.length-5,s)}function gr(i,s,n){var o=An(n),r=Math.floor(i/1e5),l=Math.floor(s/1e5)%20;return vr(r,l,o)}function An(i){var s=i%Mn;return s===0&&(s=Mn),s}function vr(i,s,n){var o=n-1,r=xn.charCodeAt(o),l=wn.charCodeAt(o),u=r+i-1,c=l+s,d=!1;u>qi&&(u=u-qi+vi-1,d=!0),(u===bt||r<bt&&u>bt||(u>bt||r<bt)&&d)&&u++,(u===It||r<It&&u>It||(u>It||r<It)&&d)&&(u++,u===bt&&u++),u>qi&&(u=u-qi+vi-1),c>Fi?(c=c-Fi+vi-1,d=!0):d=!1,(c===bt||l<bt&&c>bt||(c>bt||l<bt)&&d)&&c++,(c===It||l<It&&c>It||(c>It||l<It)&&d)&&(c++,c===bt&&c++),c>Fi&&(c=c-Fi+vi-1);var _=String.fromCharCode(u)+String.fromCharCode(c);return _}function Cn(i){if(i&&i.length===0)throw"MGRSPoint coverting from nothing";for(var s=i.length,n=null,o="",r,l=0;!/[A-Z]/.test(r=i.charAt(l));){if(l>=2)throw"MGRSPoint bad conversion from: "+i;o+=r,l++}var u=parseInt(o,10);if(l===0||l+3>s)throw"MGRSPoint bad conversion from: "+i;var c=i.charAt(l++);if(c<="A"||c==="B"||c==="Y"||c>="Z"||c==="I"||c==="O")throw"MGRSPoint zone letter "+c+" not handled: "+i;n=i.substring(l,l+=2);for(var d=An(u),_=yr(n.charAt(0),d),y=Mr(n.charAt(1),d);y<xr(c);)y+=2e6;var p=s-l;if(p%2!==0)throw`MGRSPoint has to have an even number
6
+ (约:`+Number(b*.0015).toFixed(3)+"亩)",A},updateMeasurements(){if(!this._measurementLayer)return this;const i=this.getLatLngs();new Array().push(i);let n=this.getLatLngs();const o=this instanceof v.Polygon,r=this._measurementOptions;let l,u,c,d,_;if(n&&n.length&&v.Util.isArray(n[0])&&(n=n[0]),this._measurementLayer.clearLayers(),this._measurementOptions.showDistances&&n.length>1){i.length-1;for(let y=1,p=n.length;o&&y<=p||y<p;y++)if(l=n[y-1],u=n[y%p],l.distanceTo(u),c=this._map.latLngToLayerPoint(l),d=this._map.latLngToLayerPoint(u),_=c.distanceTo(d),_>=r.minPixelDistance){const M=this.tempMoveFormatDistance(l,u);new ki(this._map.layerPointToLatLng([(c.x+d.x)/2,(c.y+d.y)/2]),M,r.lang.segmentLength,this._getRotation(l,u),r).addTo(this._measurementLayer)}!o&&this._measurementOptions.showAggregate&&(new ki(u,this.tempFormatDistance(i),r.lang.totalLength,0,r).addTo(this._measurementLayer),this.MEASUREDDATA=this.tempFormatDistance(i))}return o&&r.showArea&&n.length>2&&(new ki(this.getBounds().getCenter(),this.tempFormatArea(i[0]),r.lang.totalArea,0,r).addTo(this._measurementLayer),this.MEASUREDDATA=this.tempFormatArea(i[0])),this},_getRotation(i,s){const n=this._map.project(i),o=this._map.project(s);return Math.atan((o.y-n.y)/(o.x-n.x))}}),v.LatLng.prototype.toArray=function(){return[this.lat,this.lng]},v.Path.include({getArea(i){var s,n=this._latlngs[0],o=(i||this._map).options.crs,r=n.length;let l=0,u,c;if(n!=null)for(let d=0;d<r;d++)s=(d+1)%r,u=180<n[d].lng&&90<n[d].lat?{x:n[d].lat,y:n[d].lng}:o.project(n[d]),c=180<n[s].lng&&90<n[s].lat?{x:n[s].lat,y:n[s].lng}:o.project(n[s]),l=(l+=u.x*c.y)-u.y*c.x;return Math.abs(l/2)},getLength(i){for(var s=[],n=(i||this._map).options.crs,o=this._latlngs,r=0;r<o.length;r++)this instanceof v.Polygon?s.push(...o[r]):this instanceof v.Polyline&&s.push(o[r]);let l=0,u,c;for(let M=0,b=s.length-1;M<b;M++){u=180<s[M][0]&&90<s[M][1]?{x:s[M].lat,y:s[M].lng}:n.project(s[M]),c=180<s[M+1][0]&&90<s[M+1][1]?{x:s[M+1].lat,y:s[M+1].lng}:n.project(s[M+1]);var d=u.x,_=u.y,y=c.x,p=c.y;l+=Math.sqrt((d-y)*(d-y)+(_-p)*(_-p))}return l}}),v.Control.mergeOptions({offset:[0,0]}),v.Control.addInitHook(function(){setTimeout(()=>{const i=this.getContainer();if(i){const s=this.options.offset;i.style.transform=`translate(${s[0]}px, ${s[1]}px)`}},200)});var uo={exports:{}};function co(i){i("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),i("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),i("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"),i.WGS84=i["EPSG:4326"],i["EPSG:3785"]=i["EPSG:3857"],i.GOOGLE=i["EPSG:3857"],i["EPSG:900913"]=i["EPSG:3857"],i["EPSG:102113"]=i["EPSG:3857"]}var hi=1,li=2,_i=3,fo=4,Xe=5,Ks=6378137,mo=6356752314e-3,Ys=.0066943799901413165,Ni=484813681109536e-20,T=Math.PI/2,_o=.16666666666666666,po=.04722222222222222,go=.022156084656084655,S=1e-10,_t=.017453292519943295,Rt=57.29577951308232,X=Math.PI/4,Bi=Math.PI*2,at=3.14159265359,wt={};wt.greenwich=0,wt.lisbon=-9.131906111111,wt.paris=2.337229166667,wt.bogota=-74.080916666667,wt.madrid=-3.687938888889,wt.rome=12.452333333333,wt.bern=7.439583333333,wt.jakarta=106.807719444444,wt.ferro=-17.666666666667,wt.brussels=4.367975,wt.stockholm=18.058277777778,wt.athens=23.7163375,wt.oslo=10.722916666667;const vo={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var Js=/[\s_\-\/\(\)]/g;function ii(i,s){if(i[s])return i[s];for(var n=Object.keys(i),o=s.toLowerCase().replace(Js,""),r=-1,l,u;++r<n.length;)if(l=n[r],u=l.toLowerCase().replace(Js,""),u===o)return i[l]}function Ke(i){var s={},n=i.split("+").map(function(c){return c.trim()}).filter(function(c){return c}).reduce(function(c,d){var _=d.split("=");return _.push(!0),c[_[0].toLowerCase()]=_[1],c},{}),o,r,l,u={proj:"projName",datum:"datumCode",rf:function(c){s.rf=parseFloat(c)},lat_0:function(c){s.lat0=c*_t},lat_1:function(c){s.lat1=c*_t},lat_2:function(c){s.lat2=c*_t},lat_ts:function(c){s.lat_ts=c*_t},lon_0:function(c){s.long0=c*_t},lon_1:function(c){s.long1=c*_t},lon_2:function(c){s.long2=c*_t},alpha:function(c){s.alpha=parseFloat(c)*_t},gamma:function(c){s.rectified_grid_angle=parseFloat(c)},lonc:function(c){s.longc=c*_t},x_0:function(c){s.x0=parseFloat(c)},y_0:function(c){s.y0=parseFloat(c)},k_0:function(c){s.k0=parseFloat(c)},k:function(c){s.k0=parseFloat(c)},a:function(c){s.a=parseFloat(c)},b:function(c){s.b=parseFloat(c)},r:function(c){s.a=s.b=parseFloat(c)},r_a:function(){s.R_A=!0},zone:function(c){s.zone=parseInt(c,10)},south:function(){s.utmSouth=!0},towgs84:function(c){s.datum_params=c.split(",").map(function(d){return parseFloat(d)})},to_meter:function(c){s.to_meter=parseFloat(c)},units:function(c){s.units=c;var d=ii(vo,c);d&&(s.to_meter=d.to_meter)},from_greenwich:function(c){s.from_greenwich=c*_t},pm:function(c){var d=ii(wt,c);s.from_greenwich=(d||parseFloat(c))*_t},nadgrids:function(c){c==="@null"?s.datumCode="none":s.nadgrids=c},axis:function(c){var d="ewnsud";c.length===3&&d.indexOf(c.substr(0,1))!==-1&&d.indexOf(c.substr(1,1))!==-1&&d.indexOf(c.substr(2,1))!==-1&&(s.axis=c)},approx:function(){s.approx=!0}};for(o in n)r=n[o],o in u?(l=u[o],typeof l=="function"?l(r):s[l]=r):s[o]=r;return typeof s.datumCode=="string"&&s.datumCode!=="WGS84"&&(s.datumCode=s.datumCode.toLowerCase()),s}var Di=1,tn=2,en=3,_e=4,sn=5,Ye=-1,yo=/\s/,Mo=/[A-Za-z]/,xo=/[A-Za-z84_]/,pe=/[,\]]/,nn=/[\d\.E\-\+]/;function Vt(i){if(typeof i!="string")throw new Error("not a string");this.text=i.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Di}Vt.prototype.readCharicter=function(){var i=this.text[this.place++];if(this.state!==_e)for(;yo.test(i);){if(this.place>=this.text.length)return;i=this.text[this.place++]}switch(this.state){case Di:return this.neutral(i);case tn:return this.keyword(i);case _e:return this.quoted(i);case sn:return this.afterquote(i);case en:return this.number(i);case Ye:return}},Vt.prototype.afterquote=function(i){if(i==='"'){this.word+='"',this.state=_e;return}if(pe.test(i)){this.word=this.word.trim(),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)},Vt.prototype.afterItem=function(i){if(i===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Di;return}if(i==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Di,this.currentObject=this.stack.pop(),this.currentObject||(this.state=Ye);return}},Vt.prototype.number=function(i){if(nn.test(i)){this.word+=i;return}if(pe.test(i)){this.word=parseFloat(this.word),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)},Vt.prototype.quoted=function(i){if(i==='"'){this.state=sn;return}this.word+=i},Vt.prototype.keyword=function(i){if(xo.test(i)){this.word+=i;return}if(i==="["){var s=[];s.push(this.word),this.level++,this.root===null?this.root=s:this.currentObject.push(s),this.stack.push(this.currentObject),this.currentObject=s,this.state=Di;return}if(pe.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place)},Vt.prototype.neutral=function(i){if(Mo.test(i)){this.word=i,this.state=tn;return}if(i==='"'){this.word="",this.state=_e;return}if(nn.test(i)){this.word=i,this.state=en;return}if(pe.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place)},Vt.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===Ye)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function wo(i){var s=new Vt(i);return s.output()}function an(i,s,n){Array.isArray(s)&&(n.unshift(s),s=null);var o=s?{}:i,r=n.reduce(function(l,u){return pi(u,l),l},o);s&&(i[s]=r)}function pi(i,s){if(!Array.isArray(i)){s[i]=!0;return}var n=i.shift();if(n==="PARAMETER"&&(n=i.shift()),i.length===1){if(Array.isArray(i[0])){s[n]={},pi(i[0],s[n]);return}s[n]=i[0];return}if(!i.length){s[n]=!0;return}if(n==="TOWGS84"){s[n]=i;return}if(n==="AXIS"){n in s||(s[n]=[]),s[n].push(i);return}Array.isArray(n)||(s[n]={});var o;switch(n){case"UNIT":case"PRIMEM":case"VERT_DATUM":s[n]={name:i[0].toLowerCase(),convert:i[1]},i.length===3&&pi(i[2],s[n]);return;case"SPHEROID":case"ELLIPSOID":s[n]={name:i[0],a:i[1],rf:i[2]},i.length===4&&pi(i[3],s[n]);return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":i[0]=["name",i[0]],an(s,n,i);return;default:for(o=-1;++o<i.length;)if(!Array.isArray(i[o]))return pi(i,s[n]);return an(s,n,i)}}var bo=.017453292519943295;function Lo(i,s){var n=s[0],o=s[1];!(n in i)&&o in i&&(i[n]=i[o],s.length===3&&(i[n]=s[2](i[n])))}function Zt(i){return i*bo}function Po(i){if(i.type==="GEOGCS"?i.projName="longlat":i.type==="LOCAL_CS"?(i.projName="identity",i.local=!0):typeof i.PROJECTION=="object"?i.projName=Object.keys(i.PROJECTION)[0]:i.projName=i.PROJECTION,i.AXIS){for(var s="",n=0,o=i.AXIS.length;n<o;++n){var r=[i.AXIS[n][0].toLowerCase(),i.AXIS[n][1].toLowerCase()];r[0].indexOf("north")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="north"?s+="n":r[0].indexOf("south")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="south"?s+="s":r[0].indexOf("east")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="east"?s+="e":(r[0].indexOf("west")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="west")&&(s+="w")}s.length===2&&(s+="u"),s.length===3&&(i.axis=s)}i.UNIT&&(i.units=i.UNIT.name.toLowerCase(),i.units==="metre"&&(i.units="meter"),i.UNIT.convert&&(i.type==="GEOGCS"?i.DATUM&&i.DATUM.SPHEROID&&(i.to_meter=i.UNIT.convert*i.DATUM.SPHEROID.a):i.to_meter=i.UNIT.convert));var l=i.GEOGCS;i.type==="GEOGCS"&&(l=i),l&&(l.DATUM?i.datumCode=l.DATUM.name.toLowerCase():i.datumCode=l.name.toLowerCase(),i.datumCode.slice(0,2)==="d_"&&(i.datumCode=i.datumCode.slice(2)),(i.datumCode==="new_zealand_geodetic_datum_1949"||i.datumCode==="new_zealand_1949")&&(i.datumCode="nzgd49"),(i.datumCode==="wgs_1984"||i.datumCode==="world_geodetic_system_1984")&&(i.PROJECTION==="Mercator_Auxiliary_Sphere"&&(i.sphere=!0),i.datumCode="wgs84"),i.datumCode.slice(-6)==="_ferro"&&(i.datumCode=i.datumCode.slice(0,-6)),i.datumCode.slice(-8)==="_jakarta"&&(i.datumCode=i.datumCode.slice(0,-8)),~i.datumCode.indexOf("belge")&&(i.datumCode="rnb72"),l.DATUM&&l.DATUM.SPHEROID&&(i.ellps=l.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),i.ellps.toLowerCase().slice(0,13)==="international"&&(i.ellps="intl"),i.a=l.DATUM.SPHEROID.a,i.rf=parseFloat(l.DATUM.SPHEROID.rf,10)),l.DATUM&&l.DATUM.TOWGS84&&(i.datum_params=l.DATUM.TOWGS84),~i.datumCode.indexOf("osgb_1936")&&(i.datumCode="osgb36"),~i.datumCode.indexOf("osni_1952")&&(i.datumCode="osni52"),(~i.datumCode.indexOf("tm65")||~i.datumCode.indexOf("geodetic_datum_of_1965"))&&(i.datumCode="ire65"),i.datumCode==="ch1903+"&&(i.datumCode="ch1903"),~i.datumCode.indexOf("israel")&&(i.datumCode="isr93")),i.b&&!isFinite(i.b)&&(i.b=i.a);function u(_){var y=i.to_meter||1;return _*y}var c=function(_){return Lo(i,_)},d=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",Zt],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Zt],["x0","false_easting",u],["y0","false_northing",u],["long0","central_meridian",Zt],["lat0","latitude_of_origin",Zt],["lat0","standard_parallel_1",Zt],["lat1","standard_parallel_1",Zt],["lat2","standard_parallel_2",Zt],["azimuth","Azimuth"],["alpha","azimuth",Zt],["srsCode","name"]];d.forEach(c),!i.long0&&i.longc&&(i.projName==="Albers_Conic_Equal_Area"||i.projName==="Lambert_Azimuthal_Equal_Area")&&(i.long0=i.longc),!i.lat_ts&&i.lat1&&(i.projName==="Stereographic_South_Pole"||i.projName==="Polar Stereographic (variant B)")?(i.lat0=Zt(i.lat1>0?90:-90),i.lat_ts=i.lat1):!i.lat_ts&&i.lat0&&i.projName==="Polar_Stereographic"&&(i.lat_ts=i.lat0,i.lat0=Zt(i.lat0>0?90:-90))}function on(i){var s=wo(i),n=s.shift(),o=s.shift();s.unshift(["name",o]),s.unshift(["type",n]);var r={};return pi(s,r),Po(r),r}function yt(i){var s=this;if(arguments.length===2){var n=arguments[1];typeof n=="string"?n.charAt(0)==="+"?yt[i]=Ke(arguments[1]):yt[i]=on(arguments[1]):yt[i]=n}else if(arguments.length===1){if(Array.isArray(i))return i.map(function(o){Array.isArray(o)?yt.apply(s,o):yt(o)});if(typeof i=="string"){if(i in yt)return yt[i]}else"EPSG"in i?yt["EPSG:"+i.EPSG]=i:"ESRI"in i?yt["ESRI:"+i.ESRI]=i:"IAU2000"in i?yt["IAU2000:"+i.IAU2000]=i:console.log(i);return}}co(yt);function Ao(i){return typeof i=="string"}function Co(i){return i in yt}var To=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function Eo(i){return To.some(function(s){return i.indexOf(s)>-1})}var So=["3857","900913","3785","102113"];function Io(i){var s=ii(i,"authority");if(s){var n=ii(s,"epsg");return n&&So.indexOf(n)>-1}}function Oo(i){var s=ii(i,"extension");if(s)return ii(s,"proj4")}function zo(i){return i[0]==="+"}function ko(i){if(Ao(i)){if(Co(i))return yt[i];if(Eo(i)){var s=on(i);if(Io(s))return yt["EPSG:3857"];var n=Oo(s);return n?Ke(n):s}if(zo(i))return Ke(i)}else return i}function rn(i,s){i=i||{};var n,o;if(!s)return i;for(o in s)n=s[o],n!==void 0&&(i[o]=n);return i}function Ft(i,s,n){var o=i*s;return n/Math.sqrt(1-o*o)}function Ri(i){return i<0?-1:1}function I(i){return Math.abs(i)<=at?i:i-Ri(i)*Bi}function Nt(i,s,n){var o=i*n,r=.5*i;return o=Math.pow((1-o)/(1+o),r),Math.tan(.5*(T-s))/o}function Zi(i,s){for(var n=.5*i,o,r,l=T-2*Math.atan(s),u=0;u<=15;u++)if(o=i*Math.sin(l),r=T-2*Math.atan(s*Math.pow((1-o)/(1+o),n))-l,l+=r,Math.abs(r)<=1e-10)return l;return-9999}function No(){var i=this.b/this.a;this.es=1-i*i,"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=Ft(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Bo(i){var s=i.x,n=i.y;if(n*Rt>90&&n*Rt<-90&&s*Rt>180&&s*Rt<-180)return null;var o,r;if(Math.abs(Math.abs(n)-T)<=S)return null;if(this.sphere)o=this.x0+this.a*this.k0*I(s-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(X+.5*n));else{var l=Math.sin(n),u=Nt(this.e,n,l);o=this.x0+this.a*this.k0*I(s-this.long0),r=this.y0-this.a*this.k0*Math.log(u)}return i.x=o,i.y=r,i}function Do(i){var s=i.x-this.x0,n=i.y-this.y0,o,r;if(this.sphere)r=T-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var l=Math.exp(-n/(this.a*this.k0));if(r=Zi(this.e,l),r===-9999)return null}return o=I(this.long0+s/(this.a*this.k0)),i.x=o,i.y=r,i}var Ro=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const Zo={init:No,forward:Bo,inverse:Do,names:Ro};function Fo(){}function hn(i){return i}var qo=["longlat","identity"],Go=[Zo,{init:Fo,forward:hn,inverse:hn,names:qo}],ge={},ve=[];function ln(i,s){var n=ve.length;return i.names?(ve[n]=i,i.names.forEach(function(o){ge[o.toLowerCase()]=n}),this):(console.log(s),!0)}function Uo(i){if(!i)return!1;var s=i.toLowerCase();if(typeof ge[s]<"u"&&ve[ge[s]])return ve[ge[s]]}function jo(){Go.forEach(ln)}const Ho={start:jo,add:ln,get:Uo};var R={};R.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},R.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},R.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},R.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},R.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},R.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},R.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},R.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},R.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},R.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},R.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},R.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},R.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},R.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},R.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},R.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},R.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},R.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},R.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},R.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},R.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},R.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},R.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},R.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},R.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},R.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},R.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},R.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},R.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},R.hough={a:6378270,rf:297,ellipseName:"Hough"},R.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},R.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},R.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},R.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},R.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},R.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},R.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},R.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},R.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},R.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},R.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},R.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var Wo=R.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};R.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function $o(i,s,n,o){var r=i*i,l=s*s,u=(r-l)/r,c=0;o?(i*=1-u*(_o+u*(po+u*go)),r=i*i,u=0):c=Math.sqrt(u);var d=(r-l)/l;return{es:u,e:c,ep2:d}}function Vo(i,s,n,o,r){if(!i){var l=ii(R,o);l||(l=Wo),i=l.a,s=l.b,n=l.rf}return n&&!s&&(s=(1-1/n)*i),(n===0||Math.abs(i-s)<S)&&(r=!0,s=i),{a:i,b:s,rf:n,sphere:r}}var ct={};ct.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ct.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ct.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},ct.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},ct.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},ct.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},ct.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},ct.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},ct.militargeographische_institut={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},ct.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ct.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},ct.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},ct.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},ct.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},ct.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},ct.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},ct.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},ct.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function Qo(i,s,n,o,r,l,u){var c={};return i===void 0||i==="none"?c.datum_type=Xe:c.datum_type=fo,s&&(c.datum_params=s.map(parseFloat),(c.datum_params[0]!==0||c.datum_params[1]!==0||c.datum_params[2]!==0)&&(c.datum_type=hi),c.datum_params.length>3&&(c.datum_params[3]!==0||c.datum_params[4]!==0||c.datum_params[5]!==0||c.datum_params[6]!==0)&&(c.datum_type=li,c.datum_params[3]*=Ni,c.datum_params[4]*=Ni,c.datum_params[5]*=Ni,c.datum_params[6]=c.datum_params[6]/1e6+1)),u&&(c.datum_type=_i,c.grids=u),c.a=n,c.b=o,c.es=r,c.ep2=l,c}var un={};function Xo(i,s){var n=new DataView(s),o=Jo(n),r=tr(n,o),l=ir(n,r,o),u={header:r,subgrids:l};return un[i]=u,u}function Ko(i){if(i===void 0)return null;var s=i.split(",");return s.map(Yo)}function Yo(i){if(i.length===0)return null;var s=i[0]==="@";return s&&(i=i.slice(1)),i==="null"?{name:"null",mandatory:!s,grid:null,isNull:!0}:{name:i,mandatory:!s,grid:un[i]||null,isNull:!1}}function gi(i){return i/3600*Math.PI/180}function Jo(i){var s=i.getInt32(8,!1);return s===11?!1:(s=i.getInt32(8,!0),s!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function tr(i,s){return{nFields:i.getInt32(8,s),nSubgridFields:i.getInt32(24,s),nSubgrids:i.getInt32(40,s),shiftType:Je(i,56,64).trim(),fromSemiMajorAxis:i.getFloat64(120,s),fromSemiMinorAxis:i.getFloat64(136,s),toSemiMajorAxis:i.getFloat64(152,s),toSemiMinorAxis:i.getFloat64(168,s)}}function Je(i,s,n){return String.fromCharCode.apply(null,new Uint8Array(i.buffer.slice(s,n)))}function ir(i,s,n){for(var o=176,r=[],l=0;l<s.nSubgrids;l++){var u=sr(i,o,n),c=nr(i,o,u,n),d=Math.round(1+(u.upperLongitude-u.lowerLongitude)/u.longitudeInterval),_=Math.round(1+(u.upperLatitude-u.lowerLatitude)/u.latitudeInterval);r.push({ll:[gi(u.lowerLongitude),gi(u.lowerLatitude)],del:[gi(u.longitudeInterval),gi(u.latitudeInterval)],lim:[d,_],count:u.gridNodeCount,cvs:er(c)}),o+=176+u.gridNodeCount*16}return r}function er(i){return i.map(function(s){return[gi(s.longitudeShift),gi(s.latitudeShift)]})}function sr(i,s,n){return{name:Je(i,s+8,s+16).trim(),parent:Je(i,s+24,s+24+8).trim(),lowerLatitude:i.getFloat64(s+72,n),upperLatitude:i.getFloat64(s+88,n),lowerLongitude:i.getFloat64(s+104,n),upperLongitude:i.getFloat64(s+120,n),latitudeInterval:i.getFloat64(s+136,n),longitudeInterval:i.getFloat64(s+152,n),gridNodeCount:i.getInt32(s+168,n)}}function nr(i,s,n,o){for(var r=s+176,l=16,u=[],c=0;c<n.gridNodeCount;c++){var d={latitudeShift:i.getFloat32(r+c*l,o),longitudeShift:i.getFloat32(r+c*l+4,o),latitudeAccuracy:i.getFloat32(r+c*l+8,o),longitudeAccuracy:i.getFloat32(r+c*l+12,o)};u.push(d)}return u}function qt(i,s){if(!(this instanceof qt))return new qt(i);s=s||function(_){if(_)throw _};var n=ko(i);if(typeof n!="object"){s("Could not parse to valid json: "+i);return}var o=qt.projections.get(n.projName);if(!o){s("Could not get projection name from: "+i);return}if(n.datumCode&&n.datumCode!=="none"){var r=ii(ct,n.datumCode);r&&(n.datum_params=n.datum_params||(r.towgs84?r.towgs84.split(","):null),n.ellps=r.ellipse,n.datumName=r.datumName?r.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu",n.ellps=n.ellps||"wgs84",n.lat1=n.lat1||n.lat0;var l=Vo(n.a,n.b,n.rf,n.ellps,n.sphere),u=$o(l.a,l.b,l.rf,n.R_A),c=Ko(n.nadgrids),d=n.datum||Qo(n.datumCode,n.datum_params,l.a,l.b,u.es,u.ep2,c);rn(this,n),rn(this,o),this.a=l.a,this.b=l.b,this.rf=l.rf,this.sphere=l.sphere,this.es=u.es,this.e=u.e,this.ep2=u.ep2,this.datum=d,this.init(),s(null,this)}qt.projections=Ho,qt.projections.start();function ar(i,s){return i.datum_type!==s.datum_type||i.a!==s.a||Math.abs(i.es-s.es)>5e-11?!1:i.datum_type===hi?i.datum_params[0]===s.datum_params[0]&&i.datum_params[1]===s.datum_params[1]&&i.datum_params[2]===s.datum_params[2]:i.datum_type===li?i.datum_params[0]===s.datum_params[0]&&i.datum_params[1]===s.datum_params[1]&&i.datum_params[2]===s.datum_params[2]&&i.datum_params[3]===s.datum_params[3]&&i.datum_params[4]===s.datum_params[4]&&i.datum_params[5]===s.datum_params[5]&&i.datum_params[6]===s.datum_params[6]:!0}function cn(i,s,n){var o=i.x,r=i.y,l=i.z?i.z:0,u,c,d,_;if(r<-T&&r>-1.001*T)r=-T;else if(r>T&&r<1.001*T)r=T;else{if(r<-T)return{x:-1/0,y:-1/0,z:i.z};if(r>T)return{x:1/0,y:1/0,z:i.z}}return o>Math.PI&&(o-=2*Math.PI),c=Math.sin(r),_=Math.cos(r),d=c*c,u=n/Math.sqrt(1-s*d),{x:(u+l)*_*Math.cos(o),y:(u+l)*_*Math.sin(o),z:(u*(1-s)+l)*c}}function fn(i,s,n,o){var r=1e-12,l=r*r,u=30,c,d,_,y,p,M,b,A,P,E,z,B,N,j=i.x,H=i.y,W=i.z?i.z:0,ft,tt,Pt;if(c=Math.sqrt(j*j+H*H),d=Math.sqrt(j*j+H*H+W*W),c/n<r){if(ft=0,d/n<r)return tt=T,Pt=-o,{x:i.x,y:i.y,z:i.z}}else ft=Math.atan2(H,j);_=W/d,y=c/d,p=1/Math.sqrt(1-s*(2-s)*y*y),A=y*(1-s)*p,P=_*p,N=0;do N++,b=n/Math.sqrt(1-s*P*P),Pt=c*A+W*P-b*(1-s*P*P),M=s*b/(b+Pt),p=1/Math.sqrt(1-M*(2-M)*y*y),E=y*(1-M)*p,z=_*p,B=z*A-E*P,A=E,P=z;while(B*B>l&&N<u);return tt=Math.atan(z/Math.abs(E)),{x:ft,y:tt,z:Pt}}function or(i,s,n){if(s===hi)return{x:i.x+n[0],y:i.y+n[1],z:i.z+n[2]};if(s===li){var o=n[0],r=n[1],l=n[2],u=n[3],c=n[4],d=n[5],_=n[6];return{x:_*(i.x-d*i.y+c*i.z)+o,y:_*(d*i.x+i.y-u*i.z)+r,z:_*(-c*i.x+u*i.y+i.z)+l}}}function rr(i,s,n){if(s===hi)return{x:i.x-n[0],y:i.y-n[1],z:i.z-n[2]};if(s===li){var o=n[0],r=n[1],l=n[2],u=n[3],c=n[4],d=n[5],_=n[6],y=(i.x-o)/_,p=(i.y-r)/_,M=(i.z-l)/_;return{x:y+d*p-c*M,y:-d*y+p+u*M,z:c*y-u*p+M}}}function ye(i){return i===hi||i===li}function hr(i,s,n){if(ar(i,s)||i.datum_type===Xe||s.datum_type===Xe)return n;var o=i.a,r=i.es;if(i.datum_type===_i){var l=dn(i,!1,n);if(l!==0)return;o=Ks,r=Ys}var u=s.a,c=s.b,d=s.es;if(s.datum_type===_i&&(u=Ks,c=mo,d=Ys),r===d&&o===u&&!ye(i.datum_type)&&!ye(s.datum_type))return n;if(n=cn(n,r,o),ye(i.datum_type)&&(n=or(n,i.datum_type,i.datum_params)),ye(s.datum_type)&&(n=rr(n,s.datum_type,s.datum_params)),n=fn(n,d,u,c),s.datum_type===_i){var _=dn(s,!0,n);if(_!==0)return}return n}function dn(i,s,n){if(i.grids===null||i.grids.length===0)return console.log("Grid shift grids not found"),-1;var o={x:-n.x,y:n.y},r={x:Number.NaN,y:Number.NaN},l=[];t:for(var u=0;u<i.grids.length;u++){var c=i.grids[u];if(l.push(c.name),c.isNull){r=o;break}if(c.mandatory,c.grid===null){if(c.mandatory)return console.log("Unable to find mandatory grid '"+c.name+"'"),-1;continue}for(var d=c.grid.subgrids,_=0,y=d.length;_<y;_++){var p=d[_],M=(Math.abs(p.del[1])+Math.abs(p.del[0]))/1e4,b=p.ll[0]-M,A=p.ll[1]-M,P=p.ll[0]+(p.lim[0]-1)*p.del[0]+M,E=p.ll[1]+(p.lim[1]-1)*p.del[1]+M;if(!(A>o.y||b>o.x||E<o.y||P<o.x)&&(r=lr(o,s,p),!isNaN(r.x)))break t}}return isNaN(r.x)?(console.log("Failed to find a grid shift table for location '"+-o.x*Rt+" "+o.y*Rt+" tried: '"+l+"'"),-1):(n.x=-r.x,n.y=r.y,0)}function lr(i,s,n){var o={x:Number.NaN,y:Number.NaN};if(isNaN(i.x))return o;var r={x:i.x,y:i.y};r.x-=n.ll[0],r.y-=n.ll[1],r.x=I(r.x-Math.PI)+Math.PI;var l=mn(r,n);if(s){if(isNaN(l.x))return o;l.x=r.x-l.x,l.y=r.y-l.y;var u=9,c=1e-12,d,_;do{if(_=mn(l,n),isNaN(_.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}d={x:r.x-(_.x+l.x),y:r.y-(_.y+l.y)},l.x+=d.x,l.y+=d.y}while(u--&&Math.abs(d.x)>c&&Math.abs(d.y)>c);if(u<0)return console.log("Inverse grid shift iterator failed to converge."),o;o.x=I(l.x+n.ll[0]),o.y=l.y+n.ll[1]}else isNaN(l.x)||(o.x=i.x+l.x,o.y=i.y+l.y);return o}function mn(i,s){var n={x:i.x/s.del[0],y:i.y/s.del[1]},o={x:Math.floor(n.x),y:Math.floor(n.y)},r={x:n.x-1*o.x,y:n.y-1*o.y},l={x:Number.NaN,y:Number.NaN},u;if(o.x<0||o.x>=s.lim[0]||o.y<0||o.y>=s.lim[1])return l;u=o.y*s.lim[0]+o.x;var c={x:s.cvs[u][0],y:s.cvs[u][1]};u++;var d={x:s.cvs[u][0],y:s.cvs[u][1]};u+=s.lim[0];var _={x:s.cvs[u][0],y:s.cvs[u][1]};u--;var y={x:s.cvs[u][0],y:s.cvs[u][1]},p=r.x*r.y,M=r.x*(1-r.y),b=(1-r.x)*(1-r.y),A=(1-r.x)*r.y;return l.x=b*c.x+M*d.x+A*y.x+p*_.x,l.y=b*c.y+M*d.y+A*y.y+p*_.y,l}function _n(i,s,n){var o=n.x,r=n.y,l=n.z||0,u,c,d,_={};for(d=0;d<3;d++)if(!(s&&d===2&&n.z===void 0))switch(d===0?(u=o,"ew".indexOf(i.axis[d])!==-1?c="x":c="y"):d===1?(u=r,"ns".indexOf(i.axis[d])!==-1?c="y":c="x"):(u=l,c="z"),i.axis[d]){case"e":_[c]=u;break;case"w":_[c]=-u;break;case"n":_[c]=u;break;case"s":_[c]=-u;break;case"u":n[c]!==void 0&&(_.z=u);break;case"d":n[c]!==void 0&&(_.z=-u);break;default:return null}return _}function pn(i){var s={x:i[0],y:i[1]};return i.length>2&&(s.z=i[2]),i.length>3&&(s.m=i[3]),s}function ur(i){gn(i.x),gn(i.y)}function gn(i){if(typeof Number.isFinite=="function"){if(Number.isFinite(i))return;throw new TypeError("coordinates must be finite numbers")}if(typeof i!="number"||i!==i||!isFinite(i))throw new TypeError("coordinates must be finite numbers")}function cr(i,s){return(i.datum.datum_type===hi||i.datum.datum_type===li||i.datum.datum_type===_i)&&s.datumCode!=="WGS84"||(s.datum.datum_type===hi||s.datum.datum_type===li||s.datum.datum_type===_i)&&i.datumCode!=="WGS84"}function Me(i,s,n,o){var r;Array.isArray(n)?n=pn(n):n={x:n.x,y:n.y,z:n.z,m:n.m};var l=n.z!==void 0;if(ur(n),i.datum&&s.datum&&cr(i,s)&&(r=new qt("WGS84"),n=Me(i,r,n,o),i=r),o&&i.axis!=="enu"&&(n=_n(i,!1,n)),i.projName==="longlat")n={x:n.x*_t,y:n.y*_t,z:n.z||0};else if(i.to_meter&&(n={x:n.x*i.to_meter,y:n.y*i.to_meter,z:n.z||0}),n=i.inverse(n),!n)return;if(i.from_greenwich&&(n.x+=i.from_greenwich),n=hr(i.datum,s.datum,n),!!n)return s.from_greenwich&&(n={x:n.x-s.from_greenwich,y:n.y,z:n.z||0}),s.projName==="longlat"?n={x:n.x*Rt,y:n.y*Rt,z:n.z||0}:(n=s.forward(n),s.to_meter&&(n={x:n.x/s.to_meter,y:n.y/s.to_meter,z:n.z||0})),o&&s.axis!=="enu"?_n(s,!0,n):(n&&!l&&delete n.z,n)}var vn=qt("WGS84");function ts(i,s,n,o){var r,l,u;return Array.isArray(n)?(r=Me(i,s,n,o)||{x:NaN,y:NaN},n.length>2?typeof i.name<"u"&&i.name==="geocent"||typeof s.name<"u"&&s.name==="geocent"?typeof r.z=="number"?[r.x,r.y,r.z].concat(n.slice(3)):[r.x,r.y,n[2]].concat(n.slice(3)):[r.x,r.y].concat(n.slice(2)):[r.x,r.y]):(l=Me(i,s,n,o),u=Object.keys(n),u.length===2||u.forEach(function(c){if(typeof i.name<"u"&&i.name==="geocent"||typeof s.name<"u"&&s.name==="geocent"){if(c==="x"||c==="y"||c==="z")return}else if(c==="x"||c==="y")return;l[c]=n[c]}),l)}function yn(i){return i instanceof qt?i:i.oProj?i.oProj:qt(i)}function Et(i,s,n){i=yn(i);var o=!1,r;return typeof s>"u"?(s=i,i=vn,o=!0):(typeof s.x<"u"||Array.isArray(s))&&(n=s,s=i,i=vn,o=!0),s=yn(s),n?ts(i,s,n):(r={forward:function(l,u){return ts(i,s,l,u)},inverse:function(l,u){return ts(s,i,l,u)}},o&&(r.oProj=s),r)}var Mn=6,xn="AJSAJS",wn="AFAFAF",vi=65,bt=73,It=79,Fi=86,qi=90;const fr={forward:bn,inverse:dr,toPoint:Ln};function bn(i,s){return s=s||5,pr(mr({lat:i[1],lon:i[0]}),s)}function dr(i){var s=es(Cn(i.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat,s.lon,s.lat]:[s.left,s.bottom,s.right,s.top]}function Ln(i){var s=es(Cn(i.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat]:[(s.left+s.right)/2,(s.top+s.bottom)/2]}function is(i){return i*(Math.PI/180)}function Pn(i){return 180*(i/Math.PI)}function mr(i){var s=i.lat,n=i.lon,o=6378137,r=.00669438,l=.9996,u,c,d,_,y,p,M,b=is(s),A=is(n),P,E;E=Math.floor((n+180)/6)+1,n===180&&(E=60),s>=56&&s<64&&n>=3&&n<12&&(E=32),s>=72&&s<84&&(n>=0&&n<9?E=31:n>=9&&n<21?E=33:n>=21&&n<33?E=35:n>=33&&n<42&&(E=37)),u=(E-1)*6-180+3,P=is(u),c=r/(1-r),d=o/Math.sqrt(1-r*Math.sin(b)*Math.sin(b)),_=Math.tan(b)*Math.tan(b),y=c*Math.cos(b)*Math.cos(b),p=Math.cos(b)*(A-P),M=o*((1-r/4-3*r*r/64-5*r*r*r/256)*b-(3*r/8+3*r*r/32+45*r*r*r/1024)*Math.sin(2*b)+(15*r*r/256+45*r*r*r/1024)*Math.sin(4*b)-35*r*r*r/3072*Math.sin(6*b));var z=l*d*(p+(1-_+y)*p*p*p/6+(5-18*_+_*_+72*y-58*c)*p*p*p*p*p/120)+5e5,B=l*(M+d*Math.tan(b)*(p*p/2+(5-_+9*y+4*y*y)*p*p*p*p/24+(61-58*_+_*_+600*y-330*c)*p*p*p*p*p*p/720));return s<0&&(B+=1e7),{northing:Math.round(B),easting:Math.round(z),zoneNumber:E,zoneLetter:_r(s)}}function es(i){var s=i.northing,n=i.easting,o=i.zoneLetter,r=i.zoneNumber;if(r<0||r>60)return null;var l=.9996,u=6378137,c=.00669438,d,_=(1-Math.sqrt(1-c))/(1+Math.sqrt(1-c)),y,p,M,b,A,P,E,z,B,N=n-5e5,j=s;o<"N"&&(j-=1e7),E=(r-1)*6-180+3,d=c/(1-c),P=j/l,z=P/(u*(1-c/4-3*c*c/64-5*c*c*c/256)),B=z+(3*_/2-27*_*_*_/32)*Math.sin(2*z)+(21*_*_/16-55*_*_*_*_/32)*Math.sin(4*z)+151*_*_*_/96*Math.sin(6*z),y=u/Math.sqrt(1-c*Math.sin(B)*Math.sin(B)),p=Math.tan(B)*Math.tan(B),M=d*Math.cos(B)*Math.cos(B),b=u*(1-c)/Math.pow(1-c*Math.sin(B)*Math.sin(B),1.5),A=N/(y*l);var H=B-y*Math.tan(B)/b*(A*A/2-(5+3*p+10*M-4*M*M-9*d)*A*A*A*A/24+(61+90*p+298*M+45*p*p-252*d-3*M*M)*A*A*A*A*A*A/720);H=Pn(H);var W=(A-(1+2*p+M)*A*A*A/6+(5-2*M+28*p-3*M*M+8*d+24*p*p)*A*A*A*A*A/120)/Math.cos(B);W=E+Pn(W);var ft;if(i.accuracy){var tt=es({northing:i.northing+i.accuracy,easting:i.easting+i.accuracy,zoneLetter:i.zoneLetter,zoneNumber:i.zoneNumber});ft={top:tt.lat,right:tt.lon,bottom:H,left:W}}else ft={lat:H,lon:W};return ft}function _r(i){var s="Z";return 84>=i&&i>=72?s="X":72>i&&i>=64?s="W":64>i&&i>=56?s="V":56>i&&i>=48?s="U":48>i&&i>=40?s="T":40>i&&i>=32?s="S":32>i&&i>=24?s="R":24>i&&i>=16?s="Q":16>i&&i>=8?s="P":8>i&&i>=0?s="N":0>i&&i>=-8?s="M":-8>i&&i>=-16?s="L":-16>i&&i>=-24?s="K":-24>i&&i>=-32?s="J":-32>i&&i>=-40?s="H":-40>i&&i>=-48?s="G":-48>i&&i>=-56?s="F":-56>i&&i>=-64?s="E":-64>i&&i>=-72?s="D":-72>i&&i>=-80&&(s="C"),s}function pr(i,s){var n="00000"+i.easting,o="00000"+i.northing;return i.zoneNumber+i.zoneLetter+gr(i.easting,i.northing,i.zoneNumber)+n.substr(n.length-5,s)+o.substr(o.length-5,s)}function gr(i,s,n){var o=An(n),r=Math.floor(i/1e5),l=Math.floor(s/1e5)%20;return vr(r,l,o)}function An(i){var s=i%Mn;return s===0&&(s=Mn),s}function vr(i,s,n){var o=n-1,r=xn.charCodeAt(o),l=wn.charCodeAt(o),u=r+i-1,c=l+s,d=!1;u>qi&&(u=u-qi+vi-1,d=!0),(u===bt||r<bt&&u>bt||(u>bt||r<bt)&&d)&&u++,(u===It||r<It&&u>It||(u>It||r<It)&&d)&&(u++,u===bt&&u++),u>qi&&(u=u-qi+vi-1),c>Fi?(c=c-Fi+vi-1,d=!0):d=!1,(c===bt||l<bt&&c>bt||(c>bt||l<bt)&&d)&&c++,(c===It||l<It&&c>It||(c>It||l<It)&&d)&&(c++,c===bt&&c++),c>Fi&&(c=c-Fi+vi-1);var _=String.fromCharCode(u)+String.fromCharCode(c);return _}function Cn(i){if(i&&i.length===0)throw"MGRSPoint coverting from nothing";for(var s=i.length,n=null,o="",r,l=0;!/[A-Z]/.test(r=i.charAt(l));){if(l>=2)throw"MGRSPoint bad conversion from: "+i;o+=r,l++}var u=parseInt(o,10);if(l===0||l+3>s)throw"MGRSPoint bad conversion from: "+i;var c=i.charAt(l++);if(c<="A"||c==="B"||c==="Y"||c>="Z"||c==="I"||c==="O")throw"MGRSPoint zone letter "+c+" not handled: "+i;n=i.substring(l,l+=2);for(var d=An(u),_=yr(n.charAt(0),d),y=Mr(n.charAt(1),d);y<xr(c);)y+=2e6;var p=s-l;if(p%2!==0)throw`MGRSPoint has to have an even number
7
7
  of digits after the zone letter and two 100km letters - front
8
8
  half for easting meters, second half for
9
9
  northing meters`+i;var M=p/2,b=0,A=0,P,E,z,B,N;return M>0&&(P=1e5/Math.pow(10,M),E=i.substring(l,l+M),b=parseFloat(E)*P,z=i.substring(l+M),A=parseFloat(z)*P),B=b+_,N=A+y,{easting:B,northing:N,zoneLetter:c,zoneNumber:u,accuracy:P}}function yr(i,s){for(var n=xn.charCodeAt(s-1),o=1e5,r=!1;n!==i.charCodeAt(0);){if(n++,n===bt&&n++,n===It&&n++,n>qi){if(r)throw"Bad character: "+i;n=vi,r=!0}o+=1e5}return o}function Mr(i,s){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var n=wn.charCodeAt(s-1),o=0,r=!1;n!==i.charCodeAt(0);){if(n++,n===bt&&n++,n===It&&n++,n>Fi){if(r)throw"Bad character: "+i;n=vi,r=!0}o+=1e5}return o}function xr(i){var s;switch(i){case"C":s=11e5;break;case"D":s=2e6;break;case"E":s=28e5;break;case"F":s=37e5;break;case"G":s=46e5;break;case"H":s=55e5;break;case"J":s=64e5;break;case"K":s=73e5;break;case"L":s=82e5;break;case"M":s=91e5;break;case"N":s=0;break;case"P":s=8e5;break;case"Q":s=17e5;break;case"R":s=26e5;break;case"S":s=35e5;break;case"T":s=44e5;break;case"U":s=53e5;break;case"V":s=62e5;break;case"W":s=7e6;break;case"X":s=79e5;break;default:s=-1}if(s>=0)return s;throw"Invalid zone letter: "+i}function yi(i,s,n){if(!(this instanceof yi))return new yi(i,s,n);if(Array.isArray(i))this.x=i[0],this.y=i[1],this.z=i[2]||0;else if(typeof i=="object")this.x=i.x,this.y=i.y,this.z=i.z||0;else if(typeof i=="string"&&typeof s>"u"){var o=i.split(",");this.x=parseFloat(o[0],10),this.y=parseFloat(o[1],10),this.z=parseFloat(o[2],10)||0}else this.x=i,this.y=s,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}yi.fromMGRS=function(i){return new yi(Ln(i))},yi.prototype.toMGRS=function(i){return bn([this.x,this.y],i)};var wr=1,br=.25,Tn=.046875,En=.01953125,Sn=.01068115234375,Lr=.75,Pr=.46875,Ar=.013020833333333334,Cr=.007120768229166667,Tr=.3645833333333333,Er=.005696614583333333,Sr=.3076171875;function ss(i){var s=[];s[0]=wr-i*(br+i*(Tn+i*(En+i*Sn))),s[1]=i*(Lr-i*(Tn+i*(En+i*Sn)));var n=i*i;return s[2]=n*(Pr-i*(Ar+i*Cr)),n*=i,s[3]=n*(Tr-i*Er),s[4]=n*i*Sr,s}function Mi(i,s,n,o){return n*=s,s*=s,o[0]*i-n*(o[1]+s*(o[2]+s*(o[3]+s*o[4])))}var Ir=20;function ns(i,s,n){for(var o=1/(1-s),r=i,l=Ir;l;--l){var u=Math.sin(r),c=1-s*u*u;if(c=(Mi(r,u,Math.cos(r),n)-i)*(c*Math.sqrt(c))*o,r-=c,Math.abs(c)<S)return r}return r}function Or(){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=ss(this.es),this.ml0=Mi(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function zr(i){var s=i.x,n=i.y,o=I(s-this.long0),r,l,u,c=Math.sin(n),d=Math.cos(n);if(this.es){var y=d*o,p=Math.pow(y,2),M=this.ep2*Math.pow(d,2),b=Math.pow(M,2),A=Math.abs(d)>S?Math.tan(n):0,P=Math.pow(A,2),E=Math.pow(P,2);r=1-this.es*Math.pow(c,2),y=y/Math.sqrt(r);var z=Mi(n,c,d,this.en);l=this.a*(this.k0*y*(1+p/6*(1-P+M+p/20*(5-18*P+E+14*M-58*P*M+p/42*(61+179*E-E*P-479*P)))))+this.x0,u=this.a*(this.k0*(z-this.ml0+c*o*y/2*(1+p/12*(5-P+9*M+4*b+p/30*(61+E-58*P+270*M-330*P*M+p/56*(1385+543*E-E*P-3111*P))))))+this.y0}else{var _=d*Math.sin(o);if(Math.abs(Math.abs(_)-1)<S)return 93;if(l=.5*this.a*this.k0*Math.log((1+_)/(1-_))+this.x0,u=d*Math.cos(o)/Math.sqrt(1-Math.pow(_,2)),_=Math.abs(u),_>=1){if(_-1>S)return 93;u=0}else u=Math.acos(u);n<0&&(u=-u),u=this.a*this.k0*(u-this.lat0)+this.y0}return i.x=l,i.y=u,i}function kr(i){var s,n,o,r,l=(i.x-this.x0)*(1/this.a),u=(i.y-this.y0)*(1/this.a);if(this.es)if(s=this.ml0+u/this.k0,n=ns(s,this.es,this.en),Math.abs(n)<T){var p=Math.sin(n),M=Math.cos(n),b=Math.abs(M)>S?Math.tan(n):0,A=this.ep2*Math.pow(M,2),P=Math.pow(A,2),E=Math.pow(b,2),z=Math.pow(E,2);s=1-this.es*Math.pow(p,2);var B=l*Math.sqrt(s)/this.k0,N=Math.pow(B,2);s=s*b,o=n-s*N/(1-this.es)*.5*(1-N/12*(5+3*E-9*A*E+A-4*P-N/30*(61+90*E-252*A*E+45*z+46*A-N/56*(1385+3633*E+4095*z+1574*z*E)))),r=I(this.long0+B*(1-N/6*(1+2*E+A-N/20*(5+28*E+24*z+8*A*E+6*A-N/42*(61+662*E+1320*z+720*z*E))))/M)}else o=T*Ri(u),r=0;else{var c=Math.exp(l/this.k0),d=.5*(c-1/c),_=this.lat0+u/this.k0,y=Math.cos(_);s=Math.sqrt((1-Math.pow(y,2))/(1+Math.pow(d,2))),o=Math.asin(s),u<0&&(o=-o),d===0&&y===0?r=0:r=I(Math.atan2(d,y)+this.long0)}return i.x=r,i.y=o,i}var Nr=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const xe={init:Or,forward:zr,inverse:kr,names:Nr};function In(i){var s=Math.exp(i);return s=(s-1/s)/2,s}function Lt(i,s){i=Math.abs(i),s=Math.abs(s);var n=Math.max(i,s),o=Math.min(i,s)/(n||1);return n*Math.sqrt(1+Math.pow(o,2))}function Br(i){var s=1+i,n=s-1;return n===0?i:i*Math.log(s)/n}function Dr(i){var s=Math.abs(i);return s=Br(s*(1+s/(Lt(1,s)+1))),i<0?-s:s}function as(i,s){for(var n=2*Math.cos(2*s),o=i.length-1,r=i[o],l=0,u;--o>=0;)u=-l+n*r+i[o],l=r,r=u;return s+u*Math.sin(2*s)}function Rr(i,s){for(var n=2*Math.cos(s),o=i.length-1,r=i[o],l=0,u;--o>=0;)u=-l+n*r+i[o],l=r,r=u;return Math.sin(s)*u}function Zr(i){var s=Math.exp(i);return s=(s+1/s)/2,s}function On(i,s,n){for(var o=Math.sin(s),r=Math.cos(s),l=In(n),u=Zr(n),c=2*r*u,d=-2*o*l,_=i.length-1,y=i[_],p=0,M=0,b=0,A,P;--_>=0;)A=M,P=p,M=y,p=b,y=-A+c*M-d*p+i[_],b=-P+d*M+c*p;return c=o*u,d=r*l,[c*y-d*b,c*b+d*y]}function Fr(){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&&(xe.init.apply(this),this.forward=xe.forward,this.inverse=xe.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 i=this.es/(1+Math.sqrt(1-this.es)),s=i/(2-i),n=s;this.cgb[0]=s*(2+s*(-2/3+s*(-2+s*(116/45+s*(26/45+s*(-2854/675)))))),this.cbg[0]=s*(-2+s*(2/3+s*(4/3+s*(-82/45+s*(32/45+s*(4642/4725)))))),n=n*s,this.cgb[1]=n*(7/3+s*(-8/5+s*(-227/45+s*(2704/315+s*(2323/945))))),this.cbg[1]=n*(5/3+s*(-16/15+s*(-13/9+s*(904/315+s*(-1522/945))))),n=n*s,this.cgb[2]=n*(56/15+s*(-136/35+s*(-1262/105+s*(73814/2835)))),this.cbg[2]=n*(-26/15+s*(34/21+s*(8/5+s*(-12686/2835)))),n=n*s,this.cgb[3]=n*(4279/630+s*(-332/35+s*(-399572/14175))),this.cbg[3]=n*(1237/630+s*(-12/5+s*(-24832/14175))),n=n*s,this.cgb[4]=n*(4174/315+s*(-144838/6237)),this.cbg[4]=n*(-734/315+s*(109598/31185)),n=n*s,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(s,2),this.Qn=this.k0/(1+s)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=s*(-.5+s*(2/3+s*(-37/96+s*(1/360+s*(81/512+s*(-96199/604800)))))),this.gtu[0]=s*(.5+s*(-2/3+s*(5/16+s*(41/180+s*(-127/288+s*(7891/37800)))))),this.utg[1]=n*(-1/48+s*(-1/15+s*(437/1440+s*(-46/105+s*(1118711/3870720))))),this.gtu[1]=n*(13/48+s*(-3/5+s*(557/1440+s*(281/630+s*(-1983433/1935360))))),n=n*s,this.utg[2]=n*(-17/480+s*(37/840+s*(209/4480+s*(-5569/90720)))),this.gtu[2]=n*(61/240+s*(-103/140+s*(15061/26880+s*(167603/181440)))),n=n*s,this.utg[3]=n*(-4397/161280+s*(11/504+s*(830251/7257600))),this.gtu[3]=n*(49561/161280+s*(-179/168+s*(6601661/7257600))),n=n*s,this.utg[4]=n*(-4583/161280+s*(108847/3991680)),this.gtu[4]=n*(34729/80640+s*(-3418889/1995840)),n=n*s,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=n*(212378941/319334400);var o=as(this.cbg,this.lat0);this.Zb=-this.Qn*(o+Rr(this.gtu,2*o))}function qr(i){var s=I(i.x-this.long0),n=i.y;n=as(this.cbg,n);var o=Math.sin(n),r=Math.cos(n),l=Math.sin(s),u=Math.cos(s);n=Math.atan2(o,u*r),s=Math.atan2(l*r,Lt(o,r*u)),s=Dr(Math.tan(s));var c=On(this.gtu,2*n,2*s);n=n+c[0],s=s+c[1];var d,_;return Math.abs(s)<=2.623395162778?(d=this.a*(this.Qn*s)+this.x0,_=this.a*(this.Qn*n+this.Zb)+this.y0):(d=1/0,_=1/0),i.x=d,i.y=_,i}function Gr(i){var s=(i.x-this.x0)*(1/this.a),n=(i.y-this.y0)*(1/this.a);n=(n-this.Zb)/this.Qn,s=s/this.Qn;var o,r;if(Math.abs(s)<=2.623395162778){var l=On(this.utg,2*n,2*s);n=n+l[0],s=s+l[1],s=Math.atan(In(s));var u=Math.sin(n),c=Math.cos(n),d=Math.sin(s),_=Math.cos(s);n=Math.atan2(u*_,Lt(d,_*c)),s=Math.atan2(d,_*c),o=I(s+this.long0),r=as(this.cgb,n)}else o=1/0,r=1/0;return i.x=o,i.y=r,i}var Ur=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const we={init:Fr,forward:qr,inverse:Gr,names:Ur};function jr(i,s){if(i===void 0){if(i=Math.floor((I(s)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var Hr="etmerc";function Wr(){var i=jr(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*_t,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,we.init.apply(this),this.forward=we.forward,this.inverse=we.inverse}var $r=["Universal Transverse Mercator System","utm"];const Vr={init:Wr,names:$r,dependsOn:Hr};function os(i,s){return Math.pow((1-i)/(1+i),s)}var Qr=20;function Xr(){var i=Math.sin(this.lat0),s=Math.cos(this.lat0);s*=s,this.rc=Math.sqrt(1-this.es)/(1-this.es*i*i),this.C=Math.sqrt(1+this.es*s*s/(1-this.es)),this.phic0=Math.asin(i/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+X)/(Math.pow(Math.tan(.5*this.lat0+X),this.C)*os(this.e*i,this.ratexp))}function Kr(i){var s=i.x,n=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+X),this.C)*os(this.e*Math.sin(n),this.ratexp))-T,i.x=this.C*s,i}function Yr(i){for(var s=1e-14,n=i.x/this.C,o=i.y,r=Math.pow(Math.tan(.5*o+X)/this.K,1/this.C),l=Qr;l>0&&(o=2*Math.atan(r*os(this.e*Math.sin(i.y),-.5*this.e))-T,!(Math.abs(o-i.y)<s));--l)i.y=o;return l?(i.x=n,i.y=o,i):null}var Jr=["gauss"];const rs={init:Xr,forward:Kr,inverse:Yr,names:Jr};function th(){rs.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 ih(i){var s,n,o,r;return i.x=I(i.x-this.long0),rs.forward.apply(this,[i]),s=Math.sin(i.y),n=Math.cos(i.y),o=Math.cos(i.x),r=this.k0*this.R2/(1+this.sinc0*s+this.cosc0*n*o),i.x=r*n*Math.sin(i.x),i.y=r*(this.cosc0*s-this.sinc0*n*o),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function eh(i){var s,n,o,r,l;if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,l=Lt(i.x,i.y)){var u=2*Math.atan2(l,this.R2);s=Math.sin(u),n=Math.cos(u),r=Math.asin(n*this.sinc0+i.y*s*this.cosc0/l),o=Math.atan2(i.x*s,l*this.cosc0*n-i.y*this.sinc0*s)}else r=this.phic0,o=0;return i.x=o,i.y=r,rs.inverse.apply(this,[i]),i.x=I(i.x+this.long0),i}var sh=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const nh={init:th,forward:ih,inverse:eh,names:sh};function ah(i,s,n){return s*=n,Math.tan(.5*(T+i))*Math.pow((1-s)/(1+s),.5*n)}function oh(){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)<=S&&(this.k0=.5*(1+Ri(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=S&&(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)<=S&&Math.abs(Math.cos(this.lat_ts))>S&&(this.k0=.5*this.cons*Ft(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Nt(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Ft(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-T,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function rh(i){var s=i.x,n=i.y,o=Math.sin(n),r=Math.cos(n),l,u,c,d,_,y,p=I(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=S&&Math.abs(n+this.lat0)<=S?(i.x=NaN,i.y=NaN,i):this.sphere?(l=2*this.k0/(1+this.sinlat0*o+this.coslat0*r*Math.cos(p)),i.x=this.a*l*r*Math.sin(p)+this.x0,i.y=this.a*l*(this.coslat0*o-this.sinlat0*r*Math.cos(p))+this.y0,i):(u=2*Math.atan(this.ssfn_(n,o,this.e))-T,d=Math.cos(u),c=Math.sin(u),Math.abs(this.coslat0)<=S?(_=Nt(this.e,n*this.con,this.con*o),y=2*this.a*this.k0*_/this.cons,i.x=this.x0+y*Math.sin(s-this.long0),i.y=this.y0-this.con*y*Math.cos(s-this.long0),i):(Math.abs(this.sinlat0)<S?(l=2*this.a*this.k0/(1+d*Math.cos(p)),i.y=l*c):(l=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*c+this.cosX0*d*Math.cos(p))),i.y=l*(this.cosX0*c-this.sinX0*d*Math.cos(p))+this.y0),i.x=l*d*Math.sin(p)+this.x0,i))}function hh(i){i.x-=this.x0,i.y-=this.y0;var s,n,o,r,l,u=Math.sqrt(i.x*i.x+i.y*i.y);if(this.sphere){var c=2*Math.atan(u/(2*this.a*this.k0));return s=this.long0,n=this.lat0,u<=S?(i.x=s,i.y=n,i):(n=Math.asin(Math.cos(c)*this.sinlat0+i.y*Math.sin(c)*this.coslat0/u),Math.abs(this.coslat0)<S?this.lat0>0?s=I(this.long0+Math.atan2(i.x,-1*i.y)):s=I(this.long0+Math.atan2(i.x,i.y)):s=I(this.long0+Math.atan2(i.x*Math.sin(c),u*this.coslat0*Math.cos(c)-i.y*this.sinlat0*Math.sin(c))),i.x=s,i.y=n,i)}else if(Math.abs(this.coslat0)<=S){if(u<=S)return n=this.lat0,s=this.long0,i.x=s,i.y=n,i;i.x*=this.con,i.y*=this.con,o=u*this.cons/(2*this.a*this.k0),n=this.con*Zi(this.e,o),s=this.con*I(this.con*this.long0+Math.atan2(i.x,-1*i.y))}else r=2*Math.atan(u*this.cosX0/(2*this.a*this.k0*this.ms1)),s=this.long0,u<=S?l=this.X0:(l=Math.asin(Math.cos(r)*this.sinX0+i.y*Math.sin(r)*this.cosX0/u),s=I(this.long0+Math.atan2(i.x*Math.sin(r),u*this.cosX0*Math.cos(r)-i.y*this.sinX0*Math.sin(r)))),n=-1*Zi(this.e,Math.tan(.5*(T+l)));return i.x=s,i.y=n,i}var lh=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const uh={init:oh,forward:rh,inverse:hh,names:lh,ssfn_:ah};function ch(){var i=this.lat0;this.lambda0=this.long0;var s=Math.sin(i),n=this.a,o=this.rf,r=1/o,l=2*r-Math.pow(r,2),u=this.e=Math.sqrt(l);this.R=this.k0*n*Math.sqrt(1-l)/(1-l*Math.pow(s,2)),this.alpha=Math.sqrt(1+l/(1-l)*Math.pow(Math.cos(i),4)),this.b0=Math.asin(s/this.alpha);var c=Math.log(Math.tan(Math.PI/4+this.b0/2)),d=Math.log(Math.tan(Math.PI/4+i/2)),_=Math.log((1+u*s)/(1-u*s));this.K=c-this.alpha*d+this.alpha*u/2*_}function fh(i){var s=Math.log(Math.tan(Math.PI/4-i.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(i.y))/(1-this.e*Math.sin(i.y))),o=-this.alpha*(s+n)+this.K,r=2*(Math.atan(Math.exp(o))-Math.PI/4),l=this.alpha*(i.x-this.lambda0),u=Math.atan(Math.sin(l)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(l))),c=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(l));return i.y=this.R/2*Math.log((1+Math.sin(c))/(1-Math.sin(c)))+this.y0,i.x=this.R*u+this.x0,i}function dh(i){for(var s=i.x-this.x0,n=i.y-this.y0,o=s/this.R,r=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),l=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(o)),u=Math.atan(Math.sin(o)/(Math.cos(this.b0)*Math.cos(o)-Math.sin(this.b0)*Math.tan(r))),c=this.lambda0+u/this.alpha,d=0,_=l,y=-1e3,p=0;Math.abs(_-y)>1e-7;){if(++p>20)return;d=1/this.alpha*(Math.log(Math.tan(Math.PI/4+l/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(_))/2)),y=_,_=2*Math.atan(Math.exp(d))-Math.PI/2}return i.x=c,i.y=_,i}var mh=["somerc"];const _h={init:ch,forward:fh,inverse:dh,names:mh};var xi=1e-7;function ph(i){var s=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],n=typeof i.PROJECTION=="object"?Object.keys(i.PROJECTION)[0]:i.PROJECTION;return"no_uoff"in i||"no_off"in i||s.indexOf(n)!==-1}function gh(){var i,s,n,o,r,l,u,c,d,_,y=0,p,M=0,b=0,A=0,P=0,E=0,z=0;this.no_off=ph(this),this.no_rot="no_rot"in this;var B=!1;"alpha"in this&&(B=!0);var N=!1;if("rectified_grid_angle"in this&&(N=!0),B&&(z=this.alpha),N&&(y=this.rectified_grid_angle*_t),B||N)M=this.longc;else if(b=this.long1,P=this.lat1,A=this.long2,E=this.lat2,Math.abs(P-E)<=xi||(i=Math.abs(P))<=xi||Math.abs(i-T)<=xi||Math.abs(Math.abs(this.lat0)-T)<=xi||Math.abs(Math.abs(E)-T)<=xi)throw new Error;var j=1-this.es;s=Math.sqrt(j),Math.abs(this.lat0)>S?(c=Math.sin(this.lat0),n=Math.cos(this.lat0),i=1-this.es*c*c,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/j),this.A=this.B*this.k0*s/i,o=this.B*s/(n*Math.sqrt(i)),r=o*o-1,r<=0?r=0:(r=Math.sqrt(r),this.lat0<0&&(r=-r)),this.E=r+=o,this.E*=Math.pow(Nt(this.e,this.lat0,c),this.B)):(this.B=1/s,this.A=this.k0,this.E=o=r=1),B||N?(B?(p=Math.asin(Math.sin(z)/o),N||(y=z)):(p=y,z=Math.asin(o*Math.sin(p))),this.lam0=M-Math.asin(.5*(r-1/r)*Math.tan(p))/this.B):(l=Math.pow(Nt(this.e,P,Math.sin(P)),this.B),u=Math.pow(Nt(this.e,E,Math.sin(E)),this.B),r=this.E/l,d=(u-l)/(u+l),_=this.E*this.E,_=(_-u*l)/(_+u*l),i=b-A,i<-Math.pi?A-=Bi:i>Math.pi&&(A+=Bi),this.lam0=I(.5*(b+A)-Math.atan(_*Math.tan(.5*this.B*(b-A))/d)/this.B),p=Math.atan(2*Math.sin(this.B*I(b-this.lam0))/(r-1/r)),y=z=Math.asin(o*Math.sin(p))),this.singam=Math.sin(p),this.cosgam=Math.cos(p),this.sinrot=Math.sin(y),this.cosrot=Math.cos(y),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(o*o-1)/Math.cos(z))),this.lat0<0&&(this.u_0=-this.u_0)),r=.5*p,this.v_pole_n=this.ArB*Math.log(Math.tan(X-r)),this.v_pole_s=this.ArB*Math.log(Math.tan(X+r))}function vh(i){var s={},n,o,r,l,u,c,d,_;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-T)>S){if(u=this.E/Math.pow(Nt(this.e,i.y,Math.sin(i.y)),this.B),c=1/u,n=.5*(u-c),o=.5*(u+c),l=Math.sin(this.B*i.x),r=(n*this.singam-l*this.cosgam)/o,Math.abs(Math.abs(r)-1)<S)throw new Error;_=.5*this.ArB*Math.log((1-r)/(1+r)),c=Math.cos(this.B*i.x),Math.abs(c)<xi?d=this.A*i.x:d=this.ArB*Math.atan2(n*this.cosgam+l*this.singam,c)}else _=i.y>0?this.v_pole_n:this.v_pole_s,d=this.ArB*i.y;return this.no_rot?(s.x=d,s.y=_):(d-=this.u_0,s.x=_*this.cosrot+d*this.sinrot,s.y=d*this.cosrot-_*this.sinrot),s.x=this.a*s.x+this.x0,s.y=this.a*s.y+this.y0,s}function yh(i){var s,n,o,r,l,u,c,d={};if(i.x=(i.x-this.x0)*(1/this.a),i.y=(i.y-this.y0)*(1/this.a),this.no_rot?(n=i.y,s=i.x):(n=i.x*this.cosrot-i.y*this.sinrot,s=i.y*this.cosrot+i.x*this.sinrot+this.u_0),o=Math.exp(-this.BrA*n),r=.5*(o-1/o),l=.5*(o+1/o),u=Math.sin(this.BrA*s),c=(u*this.cosgam+r*this.singam)/l,Math.abs(Math.abs(c)-1)<S)d.x=0,d.y=c<0?-T:T;else{if(d.y=this.E/Math.sqrt((1+c)/(1-c)),d.y=Zi(this.e,Math.pow(d.y,1/this.B)),d.y===1/0)throw new Error;d.x=-this.rB*Math.atan2(r*this.cosgam-u*this.singam,Math.cos(this.BrA*s))}return d.x+=this.lam0,d}var Mh=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const xh={init:gh,forward:vh,inverse:yh,names:Mh};function wh(){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)<S)){var i=this.b/this.a;this.e=Math.sqrt(1-i*i);var s=Math.sin(this.lat1),n=Math.cos(this.lat1),o=Ft(this.e,s,n),r=Nt(this.e,this.lat1,s),l=Math.sin(this.lat2),u=Math.cos(this.lat2),c=Ft(this.e,l,u),d=Nt(this.e,this.lat2,l),_=Nt(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>S?this.ns=Math.log(o/c)/Math.log(r/d):this.ns=s,isNaN(this.ns)&&(this.ns=s),this.f0=o/(this.ns*Math.pow(r,this.ns)),this.rh=this.a*this.f0*Math.pow(_,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function bh(i){var s=i.x,n=i.y;Math.abs(2*Math.abs(n)-Math.PI)<=S&&(n=Ri(n)*(T-2*S));var o=Math.abs(Math.abs(n)-T),r,l;if(o>S)r=Nt(this.e,n,Math.sin(n)),l=this.a*this.f0*Math.pow(r,this.ns);else{if(o=n*this.ns,o<=0)return null;l=0}var u=this.ns*I(s-this.long0);return i.x=this.k0*(l*Math.sin(u))+this.x0,i.y=this.k0*(this.rh-l*Math.cos(u))+this.y0,i}function Lh(i){var s,n,o,r,l,u=(i.x-this.x0)/this.k0,c=this.rh-(i.y-this.y0)/this.k0;this.ns>0?(s=Math.sqrt(u*u+c*c),n=1):(s=-Math.sqrt(u*u+c*c),n=-1);var d=0;if(s!==0&&(d=Math.atan2(n*u,n*c)),s!==0||this.ns>0){if(n=1/this.ns,o=Math.pow(s/(this.a*this.f0),n),r=Zi(this.e,o),r===-9999)return null}else r=-T;return l=I(d/this.ns+this.long0),i.x=l,i.y=r,i}var Ph=["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 Ah={init:wh,forward:bh,inverse:Lh,names:Ph};function Ch(){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 Th(i){var s,n,o,r,l,u,c,d=i.x,_=i.y,y=I(d-this.long0);return s=Math.pow((1+this.e*Math.sin(_))/(1-this.e*Math.sin(_)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(_/2+this.s45),this.alfa)/s)-this.s45),o=-y*this.alfa,r=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(o)),l=Math.asin(Math.cos(n)*Math.sin(o)/Math.cos(r)),u=this.n*l,c=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n),i.y=c*Math.cos(u)/1,i.x=c*Math.sin(u)/1,this.czech||(i.y*=-1,i.x*=-1),i}function Eh(i){var s,n,o,r,l,u,c,d,_=i.x;i.x=i.y,i.y=_,this.czech||(i.y*=-1,i.x*=-1),u=Math.sqrt(i.x*i.x+i.y*i.y),l=Math.atan2(i.y,i.x),r=l/Math.sin(this.s0),o=2*(Math.atan(Math.pow(this.ro0/u,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),s=Math.asin(Math.cos(this.ad)*Math.sin(o)-Math.sin(this.ad)*Math.cos(o)*Math.cos(r)),n=Math.asin(Math.cos(o)*Math.sin(r)/Math.cos(s)),i.x=this.long0-n/this.alfa,c=s,d=0;var y=0;do i.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(s/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.e/2))-this.s45),Math.abs(c-i.y)<1e-10&&(d=1),c=i.y,y+=1;while(d===0&&y<15);return y>=15?null:i}var Sh=["Krovak","krovak"];const Ih={init:Ch,forward:Th,inverse:Eh,names:Sh};function Mt(i,s,n,o,r){return i*r-s*Math.sin(2*r)+n*Math.sin(4*r)-o*Math.sin(6*r)}function Gi(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function Ui(i){return .375*i*(1+.25*i*(1+.46875*i))}function ji(i){return .05859375*i*i*(1+.75*i)}function Hi(i){return i*i*i*(35/3072)}function wi(i,s,n){var o=s*n;return i/Math.sqrt(1-o*o)}function ei(i){return Math.abs(i)<T?i:i-Ri(i)*Math.PI}function be(i,s,n,o,r){var l,u;l=i/s;for(var c=0;c<15;c++)if(u=(i-(s*l-n*Math.sin(2*l)+o*Math.sin(4*l)-r*Math.sin(6*l)))/(s-2*n*Math.cos(2*l)+4*o*Math.cos(4*l)-6*r*Math.cos(6*l)),l+=u,Math.abs(u)<=1e-10)return l;return NaN}function Oh(){this.sphere||(this.e0=Gi(this.es),this.e1=Ui(this.es),this.e2=ji(this.es),this.e3=Hi(this.es),this.ml0=this.a*Mt(this.e0,this.e1,this.e2,this.e3,this.lat0))}function zh(i){var s,n,o=i.x,r=i.y;if(o=I(o-this.long0),this.sphere)s=this.a*Math.asin(Math.cos(r)*Math.sin(o)),n=this.a*(Math.atan2(Math.tan(r),Math.cos(o))-this.lat0);else{var l=Math.sin(r),u=Math.cos(r),c=wi(this.a,this.e,l),d=Math.tan(r)*Math.tan(r),_=o*Math.cos(r),y=_*_,p=this.es*u*u/(1-this.es),M=this.a*Mt(this.e0,this.e1,this.e2,this.e3,r);s=c*_*(1-y*d*(1/6-(8-d+8*p)*y/120)),n=M-this.ml0+c*l/u*y*(.5+(5-d+6*p)*y/24)}return i.x=s+this.x0,i.y=n+this.y0,i}function kh(i){i.x-=this.x0,i.y-=this.y0;var s=i.x/this.a,n=i.y/this.a,o,r;if(this.sphere){var l=n+this.lat0;o=Math.asin(Math.sin(l)*Math.cos(s)),r=Math.atan2(Math.tan(s),Math.cos(l))}else{var u=this.ml0/this.a+n,c=be(u,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(c)-T)<=S)return i.x=this.long0,i.y=T,n<0&&(i.y*=-1),i;var d=wi(this.a,this.e,Math.sin(c)),_=d*d*d/this.a/this.a*(1-this.es),y=Math.pow(Math.tan(c),2),p=s*this.a/d,M=p*p;o=c-d*Math.tan(c)/_*p*p*(.5-(1+3*y)*p*p/24),r=p*(1-M*(y/3+(1+3*y)*y*M/15))/Math.cos(c)}return i.x=I(r+this.long0),i.y=ei(o),i}var Nh=["Cassini","Cassini_Soldner","cass"];const Bh={init:Oh,forward:zh,inverse:kh,names:Nh};function si(i,s){var n;return i>1e-7?(n=i*s,(1-i*i)*(s/(1-n*n)-.5/i*Math.log((1-n)/(1+n)))):2*s}var Dh=1,Rh=2,Zh=3,Fh=4;function qh(){var i=Math.abs(this.lat0);if(Math.abs(i-T)<S?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(i)<S?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var s;switch(this.qp=si(this.e,1),this.mmf=.5/(1-this.es),this.apa=Xh(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),s=Math.sin(this.lat0),this.sinb1=si(this.e,s)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*s*s)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Gh(i){var s,n,o,r,l,u,c,d,_,y,p=i.x,M=i.y;if(p=I(p-this.long0),this.sphere){if(l=Math.sin(M),y=Math.cos(M),o=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(n=this.mode===this.EQUIT?1+y*o:1+this.sinph0*l+this.cosph0*y*o,n<=S)return null;n=Math.sqrt(2/n),s=n*y*Math.sin(p),n*=this.mode===this.EQUIT?l:this.cosph0*l-this.sinph0*y*o}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(o=-o),Math.abs(M+this.lat0)<S)return null;n=X-M*.5,n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)),s=n*Math.sin(p),n*=o}}else{switch(c=0,d=0,_=0,o=Math.cos(p),r=Math.sin(p),l=Math.sin(M),u=si(this.e,l),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(c=u/this.qp,d=Math.sqrt(1-c*c)),this.mode){case this.OBLIQ:_=1+this.sinb1*c+this.cosb1*d*o;break;case this.EQUIT:_=1+d*o;break;case this.N_POLE:_=T+M,u=this.qp-u;break;case this.S_POLE:_=M-T,u=this.qp+u;break}if(Math.abs(_)<S)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:_=Math.sqrt(2/_),this.mode===this.OBLIQ?n=this.ymf*_*(this.cosb1*c-this.sinb1*d*o):n=(_=Math.sqrt(2/(1+d*o)))*c*this.ymf,s=this.xmf*_*d*r;break;case this.N_POLE:case this.S_POLE:u>=0?(s=(_=Math.sqrt(u))*r,n=o*(this.mode===this.S_POLE?_:-_)):s=n=0;break}}return i.x=this.a*s+this.x0,i.y=this.a*n+this.y0,i}function Uh(i){i.x-=this.x0,i.y-=this.y0;var s=i.x/this.a,n=i.y/this.a,o,r,l,u,c,d,_;if(this.sphere){var y=0,p,M=0;if(p=Math.sqrt(s*s+n*n),r=p*.5,r>1)return null;switch(r=2*Math.asin(r),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(M=Math.sin(r),y=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(p)<=S?0:Math.asin(n*M/p),s*=M,n=y*p;break;case this.OBLIQ:r=Math.abs(p)<=S?this.lat0:Math.asin(y*this.sinph0+n*M*this.cosph0/p),s*=M*this.cosph0,n=(y-Math.sin(r)*this.sinph0)*p;break;case this.N_POLE:n=-n,r=T-r;break;case this.S_POLE:r-=T;break}o=n===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(s,n)}else{if(_=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(s/=this.dd,n*=this.dd,d=Math.sqrt(s*s+n*n),d<S)return i.x=this.long0,i.y=this.lat0,i;u=2*Math.asin(.5*d/this.rq),l=Math.cos(u),s*=u=Math.sin(u),this.mode===this.OBLIQ?(_=l*this.sinb1+n*u*this.cosb1/d,c=this.qp*_,n=d*this.cosb1*l-n*this.sinb1*u):(_=n*u/d,c=this.qp*_,n=d*l)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),c=s*s+n*n,!c)return i.x=this.long0,i.y=this.lat0,i;_=1-c/this.qp,this.mode===this.S_POLE&&(_=-_)}o=Math.atan2(s,n),r=Kh(Math.asin(_),this.apa)}return i.x=I(this.long0+o),i.y=r,i}var jh=.3333333333333333,Hh=.17222222222222222,Wh=.10257936507936508,$h=.06388888888888888,Vh=.0664021164021164,Qh=.016415012942191543;function Xh(i){var s,n=[];return n[0]=i*jh,s=i*i,n[0]+=s*Hh,n[1]=s*$h,s*=i,n[0]+=s*Wh,n[1]+=s*Vh,n[2]=s*Qh,n}function Kh(i,s){var n=i+i;return i+s[0]*Math.sin(n)+s[1]*Math.sin(n+n)+s[2]*Math.sin(n+n+n)}var Yh=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const Jh={init:qh,forward:Gh,inverse:Uh,names:Yh,S_POLE:Dh,N_POLE:Rh,EQUIT:Zh,OBLIQ:Fh};function ni(i){return Math.abs(i)>1&&(i=i>1?1:-1),Math.asin(i)}function tl(){Math.abs(this.lat1+this.lat2)<S||(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=Ft(this.e3,this.sin_po,this.cos_po),this.qs1=si(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=Ft(this.e3,this.sin_po,this.cos_po),this.qs2=si(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=si(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>S?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 il(i){var s=i.x,n=i.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var o=si(this.e3,this.sin_phi),r=this.a*Math.sqrt(this.c-this.ns0*o)/this.ns0,l=this.ns0*I(s-this.long0),u=r*Math.sin(l)+this.x0,c=this.rh-r*Math.cos(l)+this.y0;return i.x=u,i.y=c,i}function el(i){var s,n,o,r,l,u;return i.x-=this.x0,i.y=this.rh-i.y+this.y0,this.ns0>=0?(s=Math.sqrt(i.x*i.x+i.y*i.y),o=1):(s=-Math.sqrt(i.x*i.x+i.y*i.y),o=-1),r=0,s!==0&&(r=Math.atan2(o*i.x,o*i.y)),o=s*this.ns0/this.a,this.sphere?u=Math.asin((this.c-o*o)/(2*this.ns0)):(n=(this.c-o*o)/this.ns0,u=this.phi1z(this.e3,n)),l=I(r/this.ns0+this.long0),i.x=l,i.y=u,i}function sl(i,s){var n,o,r,l,u,c=ni(.5*s);if(i<S)return c;for(var d=i*i,_=1;_<=25;_++)if(n=Math.sin(c),o=Math.cos(c),r=i*n,l=1-r*r,u=.5*l*l/o*(s/(1-d)-n/l+.5/i*Math.log((1-r)/(1+r))),c=c+u,Math.abs(u)<=1e-7)return c;return null}var nl=["Albers_Conic_Equal_Area","Albers","aea"];const al={init:tl,forward:il,inverse:el,names:nl,phi1z:sl};function ol(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function rl(i){var s,n,o,r,l,u,c,d,_=i.x,y=i.y;return o=I(_-this.long0),s=Math.sin(y),n=Math.cos(y),r=Math.cos(o),u=this.sin_p14*s+this.cos_p14*n*r,l=1,u>0||Math.abs(u)<=S?(c=this.x0+this.a*l*n*Math.sin(o)/u,d=this.y0+this.a*l*(this.cos_p14*s-this.sin_p14*n*r)/u):(c=this.x0+this.infinity_dist*n*Math.sin(o),d=this.y0+this.infinity_dist*(this.cos_p14*s-this.sin_p14*n*r)),i.x=c,i.y=d,i}function hl(i){var s,n,o,r,l,u;return i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,(s=Math.sqrt(i.x*i.x+i.y*i.y))?(r=Math.atan2(s,this.rc),n=Math.sin(r),o=Math.cos(r),u=ni(o*this.sin_p14+i.y*n*this.cos_p14/s),l=Math.atan2(i.x*n,s*this.cos_p14*o-i.y*this.sin_p14*n),l=I(this.long0+l)):(u=this.phic0,l=0),i.x=l,i.y=u,i}var ll=["gnom"];const ul={init:ol,forward:rl,inverse:hl,names:ll};function cl(i,s){var n=1-(1-i*i)/(2*i)*Math.log((1-i)/(1+i));if(Math.abs(Math.abs(s)-n)<1e-6)return s<0?-1*T:T;for(var o=Math.asin(.5*s),r,l,u,c,d=0;d<30;d++)if(l=Math.sin(o),u=Math.cos(o),c=i*l,r=Math.pow(1-c*c,2)/(2*u)*(s/(1-i*i)-l/(1-c*c)+.5/i*Math.log((1-c)/(1+c))),o+=r,Math.abs(r)<=1e-10)return o;return NaN}function fl(){this.sphere||(this.k0=Ft(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function dl(i){var s=i.x,n=i.y,o,r,l=I(s-this.long0);if(this.sphere)o=this.x0+this.a*l*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var u=si(this.e,Math.sin(n));o=this.x0+this.a*this.k0*l,r=this.y0+this.a*u*.5/this.k0}return i.x=o,i.y=r,i}function ml(i){i.x-=this.x0,i.y-=this.y0;var s,n;return this.sphere?(s=I(this.long0+i.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(i.y/this.a*Math.cos(this.lat_ts))):(n=cl(this.e,2*i.y*this.k0/this.a),s=I(this.long0+i.x/(this.a*this.k0))),i.x=s,i.y=n,i}var _l=["cea"];const pl={init:fl,forward:dl,inverse:ml,names:_l};function gl(){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 vl(i){var s=i.x,n=i.y,o=I(s-this.long0),r=ei(n-this.lat0);return i.x=this.x0+this.a*o*this.rc,i.y=this.y0+this.a*r,i}function yl(i){var s=i.x,n=i.y;return i.x=I(this.long0+(s-this.x0)/(this.a*this.rc)),i.y=ei(this.lat0+(n-this.y0)/this.a),i}var Ml=["Equirectangular","Equidistant_Cylindrical","eqc"];const xl={init:gl,forward:vl,inverse:yl,names:Ml};var zn=20;function wl(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Gi(this.es),this.e1=Ui(this.es),this.e2=ji(this.es),this.e3=Hi(this.es),this.ml0=this.a*Mt(this.e0,this.e1,this.e2,this.e3,this.lat0)}function bl(i){var s=i.x,n=i.y,o,r,l,u=I(s-this.long0);if(l=u*Math.sin(n),this.sphere)Math.abs(n)<=S?(o=this.a*u,r=-1*this.a*this.lat0):(o=this.a*Math.sin(l)/Math.tan(n),r=this.a*(ei(n-this.lat0)+(1-Math.cos(l))/Math.tan(n)));else if(Math.abs(n)<=S)o=this.a*u,r=-1*this.ml0;else{var c=wi(this.a,this.e,Math.sin(n))/Math.tan(n);o=c*Math.sin(l),r=this.a*Mt(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+c*(1-Math.cos(l))}return i.x=o+this.x0,i.y=r+this.y0,i}function Ll(i){var s,n,o,r,l,u,c,d,_;if(o=i.x-this.x0,r=i.y-this.y0,this.sphere)if(Math.abs(r+this.a*this.lat0)<=S)s=I(o/this.a+this.long0),n=0;else{u=this.lat0+r/this.a,c=o*o/this.a/this.a+u*u,d=u;var y;for(l=zn;l;--l)if(y=Math.tan(d),_=-1*(u*(d*y+1)-d-.5*(d*d+c)*y)/((d-u)/y-1),d+=_,Math.abs(_)<=S){n=d;break}s=I(this.long0+Math.asin(o*Math.tan(d)/this.a)/Math.sin(n))}else if(Math.abs(r+this.ml0)<=S)n=0,s=I(this.long0+o/this.a);else{u=(this.ml0+r)/this.a,c=o*o/this.a/this.a+u*u,d=u;var p,M,b,A,P;for(l=zn;l;--l)if(P=this.e*Math.sin(d),p=Math.sqrt(1-P*P)*Math.tan(d),M=this.a*Mt(this.e0,this.e1,this.e2,this.e3,d),b=this.e0-2*this.e1*Math.cos(2*d)+4*this.e2*Math.cos(4*d)-6*this.e3*Math.cos(6*d),A=M/this.a,_=(u*(p*A+1)-A-.5*p*(A*A+c))/(this.es*Math.sin(2*d)*(A*A+c-2*u*A)/(4*p)+(u-A)*(p*b-2/Math.sin(2*d))-b),d-=_,Math.abs(_)<=S){n=d;break}p=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),s=I(this.long0+Math.asin(o*p/this.a)/Math.sin(n))}return i.x=s,i.y=n,i}var Pl=["Polyconic","poly"];const Al={init:wl,forward:bl,inverse:Ll,names:Pl};function Cl(){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 Tl(i){var s,n=i.x,o=i.y,r=o-this.lat0,l=n-this.long0,u=r/Ni*1e-5,c=l,d=1,_=0;for(s=1;s<=10;s++)d=d*u,_=_+this.A[s]*d;var y=_,p=c,M=1,b=0,A,P,E=0,z=0;for(s=1;s<=6;s++)A=M*y-b*p,P=b*y+M*p,M=A,b=P,E=E+this.B_re[s]*M-this.B_im[s]*b,z=z+this.B_im[s]*M+this.B_re[s]*b;return i.x=z*this.a+this.x0,i.y=E*this.a+this.y0,i}function El(i){var s,n=i.x,o=i.y,r=n-this.x0,l=o-this.y0,u=l/this.a,c=r/this.a,d=1,_=0,y,p,M=0,b=0;for(s=1;s<=6;s++)y=d*u-_*c,p=_*u+d*c,d=y,_=p,M=M+this.C_re[s]*d-this.C_im[s]*_,b=b+this.C_im[s]*d+this.C_re[s]*_;for(var A=0;A<this.iterations;A++){var P=M,E=b,z,B,N=u,j=c;for(s=2;s<=6;s++)z=P*M-E*b,B=E*M+P*b,P=z,E=B,N=N+(s-1)*(this.B_re[s]*P-this.B_im[s]*E),j=j+(s-1)*(this.B_im[s]*P+this.B_re[s]*E);P=1,E=0;var H=this.B_re[1],W=this.B_im[1];for(s=2;s<=6;s++)z=P*M-E*b,B=E*M+P*b,P=z,E=B,H=H+s*(this.B_re[s]*P-this.B_im[s]*E),W=W+s*(this.B_im[s]*P+this.B_re[s]*E);var ft=H*H+W*W;M=(N*H+j*W)/ft,b=(j*H-N*W)/ft}var tt=M,Pt=b,Ut=1,nt=0;for(s=1;s<=9;s++)Ut=Ut*tt,nt=nt+this.D[s]*Ut;var pt=this.lat0+nt*Ni*1e5,ds=this.long0+Pt;return i.x=ds,i.y=pt,i}var Sl=["New_Zealand_Map_Grid","nzmg"];const Il={init:Cl,forward:Tl,inverse:El,names:Sl};function Ol(){}function zl(i){var s=i.x,n=i.y,o=I(s-this.long0),r=this.x0+this.a*o,l=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return i.x=r,i.y=l,i}function kl(i){i.x-=this.x0,i.y-=this.y0;var s=I(this.long0+i.x/this.a),n=2.5*(Math.atan(Math.exp(.8*i.y/this.a))-Math.PI/4);return i.x=s,i.y=n,i}var Nl=["Miller_Cylindrical","mill"];const Bl={init:Ol,forward:zl,inverse:kl,names:Nl};var Dl=20;function Rl(){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=ss(this.es)}function Zl(i){var s,n,o=i.x,r=i.y;if(o=I(o-this.long0),this.sphere){if(!this.m)r=this.n!==1?Math.asin(this.n*Math.sin(r)):r;else for(var l=this.n*Math.sin(r),u=Dl;u;--u){var c=(this.m*r+Math.sin(r)-l)/(this.m+Math.cos(r));if(r-=c,Math.abs(c)<S)break}s=this.a*this.C_x*o*(this.m+Math.cos(r)),n=this.a*this.C_y*r}else{var d=Math.sin(r),_=Math.cos(r);n=this.a*Mi(r,d,_,this.en),s=this.a*o*_/Math.sqrt(1-this.es*d*d)}return i.x=s,i.y=n,i}function Fl(i){var s,n,o,r;return i.x-=this.x0,o=i.x/this.a,i.y-=this.y0,s=i.y/this.a,this.sphere?(s/=this.C_y,o=o/(this.C_x*(this.m+Math.cos(s))),this.m?s=ni((this.m*s+Math.sin(s))/this.n):this.n!==1&&(s=ni(Math.sin(s)/this.n)),o=I(o+this.long0),s=ei(s)):(s=ns(i.y/this.a,this.es,this.en),r=Math.abs(s),r<T?(r=Math.sin(s),n=this.long0+i.x*Math.sqrt(1-this.es*r*r)/(this.a*Math.cos(s)),o=I(n)):r-S<T&&(o=this.long0)),i.x=o,i.y=s,i}var ql=["Sinusoidal","sinu"];const Gl={init:Rl,forward:Zl,inverse:Fl,names:ql};function Ul(){}function jl(i){for(var s=i.x,n=i.y,o=I(s-this.long0),r=n,l=Math.PI*Math.sin(n);;){var u=-(r+Math.sin(r)-l)/(1+Math.cos(r));if(r+=u,Math.abs(u)<S)break}r/=2,Math.PI/2-Math.abs(n)<S&&(o=0);var c=.900316316158*this.a*o*Math.cos(r)+this.x0,d=1.4142135623731*this.a*Math.sin(r)+this.y0;return i.x=c,i.y=d,i}function Hl(i){var s,n;i.x-=this.x0,i.y-=this.y0,n=i.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),s=Math.asin(n);var o=I(this.long0+i.x/(.900316316158*this.a*Math.cos(s)));o<-Math.PI&&(o=-Math.PI),o>Math.PI&&(o=Math.PI),n=(2*s+Math.sin(2*s))/Math.PI,Math.abs(n)>1&&(n=1);var r=Math.asin(n);return i.x=o,i.y=r,i}var Wl=["Mollweide","moll"];const $l={init:Ul,forward:jl,inverse:Hl,names:Wl};function Vl(){Math.abs(this.lat1+this.lat2)<S||(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=Gi(this.es),this.e1=Ui(this.es),this.e2=ji(this.es),this.e3=Hi(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Ft(this.e,this.sinphi,this.cosphi),this.ml1=Mt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<S?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Ft(this.e,this.sinphi,this.cosphi),this.ml2=Mt(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=Mt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function Ql(i){var s=i.x,n=i.y,o;if(this.sphere)o=this.a*(this.g-n);else{var r=Mt(this.e0,this.e1,this.e2,this.e3,n);o=this.a*(this.g-r)}var l=this.ns*I(s-this.long0),u=this.x0+o*Math.sin(l),c=this.y0+this.rh-o*Math.cos(l);return i.x=u,i.y=c,i}function Xl(i){i.x-=this.x0,i.y=this.rh-i.y+this.y0;var s,n,o,r;this.ns>=0?(n=Math.sqrt(i.x*i.x+i.y*i.y),s=1):(n=-Math.sqrt(i.x*i.x+i.y*i.y),s=-1);var l=0;if(n!==0&&(l=Math.atan2(s*i.x,s*i.y)),this.sphere)return r=I(this.long0+l/this.ns),o=ei(this.g-n/this.a),i.x=r,i.y=o,i;var u=this.g-n/this.a;return o=be(u,this.e0,this.e1,this.e2,this.e3),r=I(this.long0+l/this.ns),i.x=r,i.y=o,i}var Kl=["Equidistant_Conic","eqdc"];const Yl={init:Vl,forward:Ql,inverse:Xl,names:Kl};function Jl(){this.R=this.a}function tu(i){var s=i.x,n=i.y,o=I(s-this.long0),r,l;Math.abs(n)<=S&&(r=this.x0+this.R*o,l=this.y0);var u=ni(2*Math.abs(n/Math.PI));(Math.abs(o)<=S||Math.abs(Math.abs(n)-T)<=S)&&(r=this.x0,n>=0?l=this.y0+Math.PI*this.R*Math.tan(.5*u):l=this.y0+Math.PI*this.R*-Math.tan(.5*u));var c=.5*Math.abs(Math.PI/o-o/Math.PI),d=c*c,_=Math.sin(u),y=Math.cos(u),p=y/(_+y-1),M=p*p,b=p*(2/_-1),A=b*b,P=Math.PI*this.R*(c*(p-A)+Math.sqrt(d*(p-A)*(p-A)-(A+d)*(M-A)))/(A+d);o<0&&(P=-P),r=this.x0+P;var E=d+p;return P=Math.PI*this.R*(b*E-c*Math.sqrt((A+d)*(d+1)-E*E))/(A+d),n>=0?l=this.y0+P:l=this.y0-P,i.x=r,i.y=l,i}function iu(i){var s,n,o,r,l,u,c,d,_,y,p,M,b;return i.x-=this.x0,i.y-=this.y0,p=Math.PI*this.R,o=i.x/p,r=i.y/p,l=o*o+r*r,u=-Math.abs(r)*(1+l),c=u-2*r*r+o*o,d=-2*u+1+2*r*r+l*l,b=r*r/d+(2*c*c*c/d/d/d-9*u*c/d/d)/27,_=(u-c*c/3/d)/d,y=2*Math.sqrt(-_/3),p=3*b/_/y,Math.abs(p)>1&&(p>=0?p=1:p=-1),M=Math.acos(p)/3,i.y>=0?n=(-y*Math.cos(M+Math.PI/3)-c/3/d)*Math.PI:n=-(-y*Math.cos(M+Math.PI/3)-c/3/d)*Math.PI,Math.abs(o)<S?s=this.long0:s=I(this.long0+Math.PI*(l-1+Math.sqrt(1+2*(o*o-r*r)+l*l))/2/o),i.x=s,i.y=n,i}var eu=["Van_der_Grinten_I","VanDerGrinten","vandg"];const su={init:Jl,forward:tu,inverse:iu,names:eu};function nu(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function au(i){var s=i.x,n=i.y,o=Math.sin(i.y),r=Math.cos(i.y),l=I(s-this.long0),u,c,d,_,y,p,M,b,A,P,E,z,B,N,j,H,W,ft,tt,Pt,Ut,nt,pt;return this.sphere?Math.abs(this.sin_p12-1)<=S?(i.x=this.x0+this.a*(T-n)*Math.sin(l),i.y=this.y0-this.a*(T-n)*Math.cos(l),i):Math.abs(this.sin_p12+1)<=S?(i.x=this.x0+this.a*(T+n)*Math.sin(l),i.y=this.y0+this.a*(T+n)*Math.cos(l),i):(ft=this.sin_p12*o+this.cos_p12*r*Math.cos(l),H=Math.acos(ft),W=H?H/Math.sin(H):1,i.x=this.x0+this.a*W*r*Math.sin(l),i.y=this.y0+this.a*W*(this.cos_p12*o-this.sin_p12*r*Math.cos(l)),i):(u=Gi(this.es),c=Ui(this.es),d=ji(this.es),_=Hi(this.es),Math.abs(this.sin_p12-1)<=S?(y=this.a*Mt(u,c,d,_,T),p=this.a*Mt(u,c,d,_,n),i.x=this.x0+(y-p)*Math.sin(l),i.y=this.y0-(y-p)*Math.cos(l),i):Math.abs(this.sin_p12+1)<=S?(y=this.a*Mt(u,c,d,_,T),p=this.a*Mt(u,c,d,_,n),i.x=this.x0+(y+p)*Math.sin(l),i.y=this.y0+(y+p)*Math.cos(l),i):(M=o/r,b=wi(this.a,this.e,this.sin_p12),A=wi(this.a,this.e,o),P=Math.atan((1-this.es)*M+this.es*b*this.sin_p12/(A*r)),E=Math.atan2(Math.sin(l),this.cos_p12*Math.tan(P)-this.sin_p12*Math.cos(l)),E===0?tt=Math.asin(this.cos_p12*Math.sin(P)-this.sin_p12*Math.cos(P)):Math.abs(Math.abs(E)-Math.PI)<=S?tt=-Math.asin(this.cos_p12*Math.sin(P)-this.sin_p12*Math.cos(P)):tt=Math.asin(Math.sin(l)*Math.cos(P)/Math.sin(E)),z=this.e*this.sin_p12/Math.sqrt(1-this.es),B=this.e*this.cos_p12*Math.cos(E)/Math.sqrt(1-this.es),N=z*B,j=B*B,Pt=tt*tt,Ut=Pt*tt,nt=Ut*tt,pt=nt*tt,H=b*tt*(1-Pt*j*(1-j)/6+Ut/8*N*(1-2*j)+nt/120*(j*(4-7*j)-3*z*z*(1-7*j))-pt/48*N),i.x=this.x0+H*Math.sin(E),i.y=this.y0+H*Math.cos(E),i))}function ou(i){i.x-=this.x0,i.y-=this.y0;var s,n,o,r,l,u,c,d,_,y,p,M,b,A,P,E,z,B,N,j,H,W,ft,tt;return this.sphere?(s=Math.sqrt(i.x*i.x+i.y*i.y),s>2*T*this.a?void 0:(n=s/this.a,o=Math.sin(n),r=Math.cos(n),l=this.long0,Math.abs(s)<=S?u=this.lat0:(u=ni(r*this.sin_p12+i.y*o*this.cos_p12/s),c=Math.abs(this.lat0)-T,Math.abs(c)<=S?this.lat0>=0?l=I(this.long0+Math.atan2(i.x,-i.y)):l=I(this.long0-Math.atan2(-i.x,i.y)):l=I(this.long0+Math.atan2(i.x*o,s*this.cos_p12*r-i.y*this.sin_p12*o))),i.x=l,i.y=u,i)):(d=Gi(this.es),_=Ui(this.es),y=ji(this.es),p=Hi(this.es),Math.abs(this.sin_p12-1)<=S?(M=this.a*Mt(d,_,y,p,T),s=Math.sqrt(i.x*i.x+i.y*i.y),b=M-s,u=be(b/this.a,d,_,y,p),l=I(this.long0+Math.atan2(i.x,-1*i.y)),i.x=l,i.y=u,i):Math.abs(this.sin_p12+1)<=S?(M=this.a*Mt(d,_,y,p,T),s=Math.sqrt(i.x*i.x+i.y*i.y),b=s-M,u=be(b/this.a,d,_,y,p),l=I(this.long0+Math.atan2(i.x,i.y)),i.x=l,i.y=u,i):(s=Math.sqrt(i.x*i.x+i.y*i.y),E=Math.atan2(i.x,i.y),A=wi(this.a,this.e,this.sin_p12),z=Math.cos(E),B=this.e*this.cos_p12*z,N=-B*B/(1-this.es),j=3*this.es*(1-N)*this.sin_p12*this.cos_p12*z/(1-this.es),H=s/A,W=H-N*(1+N)*Math.pow(H,3)/6-j*(1+3*N)*Math.pow(H,4)/24,ft=1-N*W*W/2-H*W*W*W/6,P=Math.asin(this.sin_p12*Math.cos(W)+this.cos_p12*Math.sin(W)*z),l=I(this.long0+Math.asin(Math.sin(E)*Math.sin(W)/Math.cos(P))),tt=Math.sin(P),u=Math.atan2((tt-this.es*ft*this.sin_p12)*Math.tan(P),tt*(1-this.es)),i.x=l,i.y=u,i))}var ru=["Azimuthal_Equidistant","aeqd"];const hu={init:nu,forward:au,inverse:ou,names:ru};function lu(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function uu(i){var s,n,o,r,l,u,c,d,_=i.x,y=i.y;return o=I(_-this.long0),s=Math.sin(y),n=Math.cos(y),r=Math.cos(o),u=this.sin_p14*s+this.cos_p14*n*r,l=1,(u>0||Math.abs(u)<=S)&&(c=this.a*l*n*Math.sin(o),d=this.y0+this.a*l*(this.cos_p14*s-this.sin_p14*n*r)),i.x=c,i.y=d,i}function cu(i){var s,n,o,r,l,u,c;return i.x-=this.x0,i.y-=this.y0,s=Math.sqrt(i.x*i.x+i.y*i.y),n=ni(s/this.a),o=Math.sin(n),r=Math.cos(n),u=this.long0,Math.abs(s)<=S?(c=this.lat0,i.x=u,i.y=c,i):(c=ni(r*this.sin_p14+i.y*o*this.cos_p14/s),l=Math.abs(this.lat0)-T,Math.abs(l)<=S?(this.lat0>=0?u=I(this.long0+Math.atan2(i.x,-i.y)):u=I(this.long0-Math.atan2(-i.x,i.y)),i.x=u,i.y=c,i):(u=I(this.long0+Math.atan2(i.x*o,s*this.cos_p14*r-i.y*this.sin_p14*o)),i.x=u,i.y=c,i))}var fu=["ortho"];const du={init:lu,forward:uu,inverse:cu,names:fu};var it={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},K={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function mu(){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>=T-X/2?this.face=it.TOP:this.lat0<=-(T-X/2)?this.face=it.BOTTOM:Math.abs(this.long0)<=X?this.face=it.FRONT:Math.abs(this.long0)<=T+X?this.face=this.long0>0?it.RIGHT:it.LEFT:this.face=it.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 _u(i){var s={x:0,y:0},n,o,r,l,u,c,d={value:0};if(i.x-=this.long0,this.es!==0?n=Math.atan(this.one_minus_f_squared*Math.tan(i.y)):n=i.y,o=i.x,this.face===it.TOP)l=T-n,o>=X&&o<=T+X?(d.value=K.AREA_0,r=o-T):o>T+X||o<=-(T+X)?(d.value=K.AREA_1,r=o>0?o-at:o+at):o>-(T+X)&&o<=-X?(d.value=K.AREA_2,r=o+T):(d.value=K.AREA_3,r=o);else if(this.face===it.BOTTOM)l=T+n,o>=X&&o<=T+X?(d.value=K.AREA_0,r=-o+T):o<X&&o>=-X?(d.value=K.AREA_1,r=-o):o<-X&&o>=-(T+X)?(d.value=K.AREA_2,r=-o-T):(d.value=K.AREA_3,r=o>0?-o+at:-o-at);else{var _,y,p,M,b,A,P;this.face===it.RIGHT?o=bi(o,+T):this.face===it.BACK?o=bi(o,+at):this.face===it.LEFT&&(o=bi(o,-T)),M=Math.sin(n),b=Math.cos(n),A=Math.sin(o),P=Math.cos(o),_=b*P,y=b*A,p=M,this.face===it.FRONT?(l=Math.acos(_),r=Le(l,p,y,d)):this.face===it.RIGHT?(l=Math.acos(y),r=Le(l,p,-_,d)):this.face===it.BACK?(l=Math.acos(-_),r=Le(l,p,-y,d)):this.face===it.LEFT?(l=Math.acos(-y),r=Le(l,p,_,d)):(l=r=0,d.value=K.AREA_0)}return c=Math.atan(12/at*(r+Math.acos(Math.sin(r)*Math.cos(X))-T)),u=Math.sqrt((1-Math.cos(l))/(Math.cos(c)*Math.cos(c))/(1-Math.cos(Math.atan(1/Math.cos(r))))),d.value===K.AREA_1?c+=T:d.value===K.AREA_2?c+=at:d.value===K.AREA_3&&(c+=1.5*at),s.x=u*Math.cos(c),s.y=u*Math.sin(c),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,i.x=s.x,i.y=s.y,i}function pu(i){var s={lam:0,phi:0},n,o,r,l,u,c,d,_,y,p={value:0};if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,o=Math.atan(Math.sqrt(i.x*i.x+i.y*i.y)),n=Math.atan2(i.y,i.x),i.x>=0&&i.x>=Math.abs(i.y)?p.value=K.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(p.value=K.AREA_1,n-=T):i.x<0&&-i.x>=Math.abs(i.y)?(p.value=K.AREA_2,n=n<0?n+at:n-at):(p.value=K.AREA_3,n+=T),y=at/12*Math.tan(n),u=Math.sin(y)/(Math.cos(y)-1/Math.sqrt(2)),c=Math.atan(u),r=Math.cos(n),l=Math.tan(o),d=1-r*r*l*l*(1-Math.cos(Math.atan(1/Math.cos(c)))),d<-1?d=-1:d>1&&(d=1),this.face===it.TOP)_=Math.acos(d),s.phi=T-_,p.value===K.AREA_0?s.lam=c+T:p.value===K.AREA_1?s.lam=c<0?c+at:c-at:p.value===K.AREA_2?s.lam=c-T:s.lam=c;else if(this.face===it.BOTTOM)_=Math.acos(d),s.phi=_-T,p.value===K.AREA_0?s.lam=-c+T:p.value===K.AREA_1?s.lam=-c:p.value===K.AREA_2?s.lam=-c-T:s.lam=c<0?-c-at:-c+at;else{var M,b,A;M=d,y=M*M,y>=1?A=0:A=Math.sqrt(1-y)*Math.sin(c),y+=A*A,y>=1?b=0:b=Math.sqrt(1-y),p.value===K.AREA_1?(y=b,b=-A,A=y):p.value===K.AREA_2?(b=-b,A=-A):p.value===K.AREA_3&&(y=b,b=A,A=-y),this.face===it.RIGHT?(y=M,M=-b,b=y):this.face===it.BACK?(M=-M,b=-b):this.face===it.LEFT&&(y=M,M=b,b=-y),s.phi=Math.acos(-A)-T,s.lam=Math.atan2(b,M),this.face===it.RIGHT?s.lam=bi(s.lam,-T):this.face===it.BACK?s.lam=bi(s.lam,-at):this.face===it.LEFT&&(s.lam=bi(s.lam,+T))}if(this.es!==0){var P,E,z;P=s.phi<0?1:0,E=Math.tan(s.phi),z=this.b/Math.sqrt(E*E+this.one_minus_f_squared),s.phi=Math.atan(Math.sqrt(this.a*this.a-z*z)/(this.one_minus_f*z)),P&&(s.phi=-s.phi)}return s.lam+=this.long0,i.x=s.lam,i.y=s.phi,i}function Le(i,s,n,o){var r;return i<S?(o.value=K.AREA_0,r=0):(r=Math.atan2(s,n),Math.abs(r)<=X?o.value=K.AREA_0:r>X&&r<=T+X?(o.value=K.AREA_1,r-=T):r>T+X||r<=-(T+X)?(o.value=K.AREA_2,r=r>=0?r-at:r+at):(o.value=K.AREA_3,r+=T)),r}function bi(i,s){var n=i+s;return n<-at?n+=Bi:n>+at&&(n-=Bi),n}var gu=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const vu={init:mu,forward:_u,inverse:pu,names:gu};var hs=[[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]],Wi=[[-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]],kn=.8487,Nn=1.3523,Bn=Rt/5,yu=1/Bn,Li=18,Pe=function(i,s){return i[0]+s*(i[1]+s*(i[2]+s*i[3]))},Mu=function(i,s){return i[1]+s*(2*i[2]+s*3*i[3])};function xu(i,s,n,o){for(var r=s;o;--o){var l=i(r);if(r-=l,Math.abs(l)<n)break}return r}function wu(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function bu(i){var s=I(i.x-this.long0),n=Math.abs(i.y),o=Math.floor(n*Bn);o<0?o=0:o>=Li&&(o=Li-1),n=Rt*(n-yu*o);var r={x:Pe(hs[o],n)*s,y:Pe(Wi[o],n)};return i.y<0&&(r.y=-r.y),r.x=r.x*this.a*kn+this.x0,r.y=r.y*this.a*Nn+this.y0,r}function Lu(i){var s={x:(i.x-this.x0)/(this.a*kn),y:Math.abs(i.y-this.y0)/(this.a*Nn)};if(s.y>=1)s.x/=hs[Li][0],s.y=i.y<0?-T:T;else{var n=Math.floor(s.y*Li);for(n<0?n=0:n>=Li&&(n=Li-1);;)if(Wi[n][0]>s.y)--n;else if(Wi[n+1][0]<=s.y)++n;else break;var o=Wi[n],r=5*(s.y-o[0])/(Wi[n+1][0]-o[0]);r=xu(function(l){return(Pe(o,l)-s.y)/Mu(o,l)},r,S,100),s.x/=Pe(hs[n],r),s.y=(5*n+r)*_t,i.y<0&&(s.y=-s.y)}return s.x=I(s.x+this.long0),s}var Pu=["Robinson","robin"];const Au={init:wu,forward:bu,inverse:Lu,names:Pu};function Cu(){this.name="geocent"}function Tu(i){var s=cn(i,this.es,this.a);return s}function Eu(i){var s=fn(i,this.es,this.a,this.b);return s}var Su=["Geocentric","geocentric","geocent","Geocent"];const Iu={init:Cu,forward:Tu,inverse:Eu,names:Su};var vt={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},$i={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 Ou(){if(Object.keys($i).forEach((function(n){if(typeof this[n]>"u")this[n]=$i[n].def;else{if($i[n].num&&isNaN(this[n]))throw new Error("Invalid parameter value, must be numeric "+n+" = "+this[n]);$i[n].num&&(this[n]=parseFloat(this[n]))}$i[n].degrees&&(this[n]=this[n]*_t)}).bind(this)),Math.abs(Math.abs(this.lat0)-T)<S?this.mode=this.lat0<0?vt.S_POLE:vt.N_POLE:Math.abs(this.lat0)<S?this.mode=vt.EQUIT:(this.mode=vt.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 i=this.tilt,s=this.azi;this.cg=Math.cos(s),this.sg=Math.sin(s),this.cw=Math.cos(i),this.sw=Math.sin(i)}function zu(i){i.x-=this.long0;var s=Math.sin(i.y),n=Math.cos(i.y),o=Math.cos(i.x),r,l;switch(this.mode){case vt.OBLIQ:l=this.sinph0*s+this.cosph0*n*o;break;case vt.EQUIT:l=n*o;break;case vt.S_POLE:l=-s;break;case vt.N_POLE:l=s;break}switch(l=this.pn1/(this.p-l),r=l*n*Math.sin(i.x),this.mode){case vt.OBLIQ:l*=this.cosph0*s-this.sinph0*n*o;break;case vt.EQUIT:l*=s;break;case vt.N_POLE:l*=-(n*o);break;case vt.S_POLE:l*=n*o;break}var u,c;return u=l*this.cg+r*this.sg,c=1/(u*this.sw*this.h1+this.cw),r=(r*this.cg-l*this.sg)*this.cw*c,l=u*c,i.x=r*this.a,i.y=l*this.a,i}function ku(i){i.x/=this.a,i.y/=this.a;var s={x:i.x,y:i.y},n,o,r;r=1/(this.pn1-i.y*this.sw),n=this.pn1*i.x*r,o=this.pn1*i.y*this.cw*r,i.x=n*this.cg+o*this.sg,i.y=o*this.cg-n*this.sg;var l=Lt(i.x,i.y);if(Math.abs(l)<S)s.x=0,s.y=i.y;else{var u,c;switch(c=1-l*l*this.pfact,c=(this.p-Math.sqrt(c))/(this.pn1/l+l/this.pn1),u=Math.sqrt(1-c*c),this.mode){case vt.OBLIQ:s.y=Math.asin(u*this.sinph0+i.y*c*this.cosph0/l),i.y=(u-this.sinph0*Math.sin(s.y))*l,i.x*=c*this.cosph0;break;case vt.EQUIT:s.y=Math.asin(i.y*c/l),i.y=u*l,i.x*=c;break;case vt.N_POLE:s.y=Math.asin(u),i.y=-i.y;break;case vt.S_POLE:s.y=-Math.asin(u);break}s.x=Math.atan2(i.x,i.y)}return i.x=s.x+this.long0,i.y=s.y,i}var Nu=["Tilted_Perspective","tpers"];const Bu={init:Ou,forward:zu,inverse:ku,names:Nu};function Du(){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 i=1-this.es,s=1/i;this.radius_p=Math.sqrt(i),this.radius_p2=i,this.radius_p_inv2=s,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 Ru(i){var s=i.x,n=i.y,o,r,l,u;if(s=s-this.long0,this.shape==="ellipse"){n=Math.atan(this.radius_p2*Math.tan(n));var c=this.radius_p/Lt(this.radius_p*Math.cos(n),Math.sin(n));if(r=c*Math.cos(s)*Math.cos(n),l=c*Math.sin(s)*Math.cos(n),u=c*Math.sin(n),(this.radius_g-r)*r-l*l-u*u*this.radius_p_inv2<0)return i.x=Number.NaN,i.y=Number.NaN,i;o=this.radius_g-r,this.flip_axis?(i.x=this.radius_g_1*Math.atan(l/Lt(u,o)),i.y=this.radius_g_1*Math.atan(u/o)):(i.x=this.radius_g_1*Math.atan(l/o),i.y=this.radius_g_1*Math.atan(u/Lt(l,o)))}else this.shape==="sphere"&&(o=Math.cos(n),r=Math.cos(s)*o,l=Math.sin(s)*o,u=Math.sin(n),o=this.radius_g-r,this.flip_axis?(i.x=this.radius_g_1*Math.atan(l/Lt(u,o)),i.y=this.radius_g_1*Math.atan(u/o)):(i.x=this.radius_g_1*Math.atan(l/o),i.y=this.radius_g_1*Math.atan(u/Lt(l,o))));return i.x=i.x*this.a,i.y=i.y*this.a,i}function Zu(i){var s=-1,n=0,o=0,r,l,u,c;if(i.x=i.x/this.a,i.y=i.y/this.a,this.shape==="ellipse"){this.flip_axis?(o=Math.tan(i.y/this.radius_g_1),n=Math.tan(i.x/this.radius_g_1)*Lt(1,o)):(n=Math.tan(i.x/this.radius_g_1),o=Math.tan(i.y/this.radius_g_1)*Lt(1,n));var d=o/this.radius_p;if(r=n*n+d*d+s*s,l=2*this.radius_g*s,u=l*l-4*r*this.C,u<0)return i.x=Number.NaN,i.y=Number.NaN,i;c=(-l-Math.sqrt(u))/(2*r),s=this.radius_g+c*s,n*=c,o*=c,i.x=Math.atan2(n,s),i.y=Math.atan(o*Math.cos(i.x)/s),i.y=Math.atan(this.radius_p_inv2*Math.tan(i.y))}else if(this.shape==="sphere"){if(this.flip_axis?(o=Math.tan(i.y/this.radius_g_1),n=Math.tan(i.x/this.radius_g_1)*Math.sqrt(1+o*o)):(n=Math.tan(i.x/this.radius_g_1),o=Math.tan(i.y/this.radius_g_1)*Math.sqrt(1+n*n)),r=n*n+o*o+s*s,l=2*this.radius_g*s,u=l*l-4*r*this.C,u<0)return i.x=Number.NaN,i.y=Number.NaN,i;c=(-l-Math.sqrt(u))/(2*r),s=this.radius_g+c*s,n*=c,o*=c,i.x=Math.atan2(n,s),i.y=Math.atan(o*Math.cos(i.x)/s)}return i.x=i.x+this.long0,i}var Fu=["Geostationary Satellite View","Geostationary_Satellite","geos"];const qu={init:Du,forward:Ru,inverse:Zu,names:Fu};var Vi=1.340264,Qi=-.081106,Xi=893e-6,Ki=.003796,Ae=Math.sqrt(3)/2;function Gu(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function Uu(i){var s=I(i.x-this.long0),n=i.y,o=Math.asin(Ae*Math.sin(n)),r=o*o,l=r*r*r;return i.x=s*Math.cos(o)/(Ae*(Vi+3*Qi*r+l*(7*Xi+9*Ki*r))),i.y=o*(Vi+Qi*r+l*(Xi+Ki*r)),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function ju(i){i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a;var s=1e-9,n=12,o=i.y,r,l,u,c,d,_;for(_=0;_<n&&(r=o*o,l=r*r*r,u=o*(Vi+Qi*r+l*(Xi+Ki*r))-i.y,c=Vi+3*Qi*r+l*(7*Xi+9*Ki*r),o-=d=u/c,!(Math.abs(d)<s));++_);return r=o*o,l=r*r*r,i.x=Ae*i.x*(Vi+3*Qi*r+l*(7*Xi+9*Ki*r))/Math.cos(o),i.y=Math.asin(Math.sin(o)/Ae),i.x=I(i.x+this.long0),i}var Hu=["eqearth","Equal Earth","Equal_Earth"];const Wu={init:Gu,forward:Uu,inverse:ju,names:Hu};var Yi=1e-10;function $u(){var i;if(this.phi1=this.lat1,Math.abs(this.phi1)<Yi)throw new Error;this.es?(this.en=ss(this.es),this.m1=Mi(this.phi1,this.am1=Math.sin(this.phi1),i=Math.cos(this.phi1),this.en),this.am1=i/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=Qu,this.forward=Vu):(Math.abs(this.phi1)+Yi>=T?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Ku,this.forward=Xu)}function Vu(i){var s=I(i.x-(this.long0||0)),n=i.y,o,r,l;return o=this.am1+this.m1-Mi(n,r=Math.sin(n),l=Math.cos(n),this.en),r=l*s/(o*Math.sqrt(1-this.es*r*r)),i.x=o*Math.sin(r),i.y=this.am1-o*Math.cos(r),i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function Qu(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var s,n,o,r;if(n=Lt(i.x,i.y=this.am1-i.y),r=ns(this.am1+this.m1-n,this.es,this.en),(s=Math.abs(r))<T)s=Math.sin(r),o=n*Math.atan2(i.x,i.y)*Math.sqrt(1-this.es*s*s)/Math.cos(r);else if(Math.abs(s-T)<=Yi)o=0;else throw new Error;return i.x=I(o+(this.long0||0)),i.y=ei(r),i}function Xu(i){var s=I(i.x-(this.long0||0)),n=i.y,o,r;return r=this.cphi1+this.phi1-n,Math.abs(r)>Yi?(i.x=r*Math.sin(o=s*Math.cos(n)/r),i.y=this.cphi1-r*Math.cos(o)):i.x=i.y=0,i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function Ku(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var s,n,o=Lt(i.x,i.y=this.cphi1-i.y);if(n=this.cphi1+this.phi1-o,Math.abs(n)>T)throw new Error;return Math.abs(Math.abs(n)-T)<=Yi?s=0:s=o*Math.atan2(i.x,i.y)/Math.cos(n),i.x=I(s+(this.long0||0)),i.y=ei(n),i}var Yu=["bonne","Bonne (Werner lat_1=90)"];const Ju={init:$u,names:Yu};function tc(i){i.Proj.projections.add(xe),i.Proj.projections.add(we),i.Proj.projections.add(Vr),i.Proj.projections.add(nh),i.Proj.projections.add(uh),i.Proj.projections.add(_h),i.Proj.projections.add(xh),i.Proj.projections.add(Ah),i.Proj.projections.add(Ih),i.Proj.projections.add(Bh),i.Proj.projections.add(Jh),i.Proj.projections.add(al),i.Proj.projections.add(ul),i.Proj.projections.add(pl),i.Proj.projections.add(xl),i.Proj.projections.add(Al),i.Proj.projections.add(Il),i.Proj.projections.add(Bl),i.Proj.projections.add(Gl),i.Proj.projections.add($l),i.Proj.projections.add(Yl),i.Proj.projections.add(su),i.Proj.projections.add(hu),i.Proj.projections.add(du),i.Proj.projections.add(vu),i.Proj.projections.add(Au),i.Proj.projections.add(Iu),i.Proj.projections.add(Bu),i.Proj.projections.add(qu),i.Proj.projections.add(Wu),i.Proj.projections.add(Ju)}Et.defaultDatum="WGS84",Et.Proj=qt,Et.WGS84=new Et.Proj("WGS84"),Et.Point=yi,Et.toPoint=pn,Et.defs=yt,Et.nadgrid=Xo,Et.transform=Me,Et.mgrs=fr,Et.version="__VERSION__",tc(Et);const ic=oo(Object.freeze(Object.defineProperty({__proto__:null,default:Et},Symbol.toStringTag,{value:"Module"})));(function(i){(function(s){var n,o;n=Qs(),o=ic,i.exports=s(n,o)})(function(s,n){return n.__esModule&&n.default&&(n=n.default),s.Proj={},s.Proj._isProj4Obj=function(o){return typeof o.inverse<"u"&&typeof o.forward<"u"},s.Proj.Projection=s.Class.extend({initialize:function(o,r,l){var u=s.Proj._isProj4Obj(o);this._proj=u?o:this._projFromCodeDef(o,r),this.bounds=u?r:l},project:function(o){var r=this._proj.forward([o.lng,o.lat]);return new s.Point(r[0],r[1])},unproject:function(o,r){var l=this._proj.inverse([o.x,o.y]);return new s.LatLng(l[1],l[0],r)},_projFromCodeDef:function(o,r){if(r)n.defs(o,r);else if(n.defs[o]===void 0){var l=o.split(":");if(l.length>3&&(o=l[l.length-3]+":"+l[l.length-1]),n.defs[o]===void 0)throw"No projection definition for code "+o}return n(o)}}),s.Proj.CRS=s.Class.extend({includes:s.CRS,options:{transformation:new s.Transformation(1,0,-1,0)},initialize:function(o,r,l){var u,c,d,_;if(s.Proj._isProj4Obj(o)?(c=o,u=c.srsCode,_=r||{},this.projection=new s.Proj.Projection(c,_.bounds)):(u=o,d=r,_=l||{},this.projection=new s.Proj.Projection(u,d,_.bounds)),s.Util.setOptions(this,_),this.code=u,this.transformation=this.options.transformation,this.options.origin&&(this.transformation=new s.Transformation(1,-this.options.origin[0],-1,this.options.origin[1])),this.options.scales)this._scales=this.options.scales;else if(this.options.resolutions){this._scales=[];for(var y=this.options.resolutions.length-1;y>=0;y--)this.options.resolutions[y]&&(this._scales[y]=1/this.options.resolutions[y])}this.infinite=!this.options.bounds},scale:function(o){var r=Math.floor(o),l,u,c,d;return o===r?this._scales[o]:(l=this._scales[r],u=this._scales[r+1],c=u-l,d=o-r,l+c*d)},zoom:function(o){var r=this._closestElement(this._scales,o),l=this._scales.indexOf(r),u,c,d;return o===r?l:r===void 0?-1/0:(c=l+1,u=this._scales[c],u===void 0?1/0:(d=u-r,(o-r)/d+l))},distance:s.CRS.Earth.distance,R:s.CRS.Earth.R,_closestElement:function(o,r){for(var l,u=o.length;u--;)o[u]<=r&&(l===void 0||l<o[u])&&(l=o[u]);return l}}),s.Proj.GeoJSON=s.GeoJSON.extend({initialize:function(o,r){this._callLevel=0,s.GeoJSON.prototype.initialize.call(this,o,r)},addData:function(o){var r;o&&(o.crs&&o.crs.type==="name"?r=new s.Proj.CRS(o.crs.properties.name):o.crs&&o.crs.type&&(r=new s.Proj.CRS(o.crs.type+":"+o.crs.properties.code)),r!==void 0&&(this.options.coordsToLatLng=function(l){var u=s.point(l[0],l[1]);return r.projection.unproject(u)})),this._callLevel++;try{s.GeoJSON.prototype.addData.call(this,o)}finally{this._callLevel--,this._callLevel===0&&delete this.options.coordsToLatLng}}}),s.Proj.geoJson=function(o,r){return new s.Proj.GeoJSON(o,r)},s.Proj.ImageOverlay=s.ImageOverlay.extend({initialize:function(o,r,l){s.ImageOverlay.prototype.initialize.call(this,o,null,l),this._projectedBounds=r},_animateZoom:function(o){var r=this._map.getZoomScale(o.zoom),l=s.point(this._projectedBounds.min.x,this._projectedBounds.max.y),u=this._projectedToNewLayerPoint(l,o.zoom,o.center);s.DomUtil.setTransform(this._image,u,r)},_reset:function(){var o=this._map.getZoom(),r=this._map.getPixelOrigin(),l=s.bounds(this._transform(this._projectedBounds.min,o)._subtract(r),this._transform(this._projectedBounds.max,o)._subtract(r)),u=l.getSize();s.DomUtil.setPosition(this._image,l.min),this._image.style.width=u.x+"px",this._image.style.height=u.y+"px"},_projectedToNewLayerPoint:function(o,r,l){var u=this._map.getSize()._divideBy(2),c=this._map.project(l,r)._subtract(u)._round(),d=c.add(this._map._getMapPanePos());return this._transform(o,r)._subtract(d)},_transform:function(o,r){var l=this._map.options.crs,u=l.transformation,c=l.scale(r);return u.transform(o,c)}}),s.Proj.imageOverlay=function(o,r,l){return new s.Proj.ImageOverlay(o,r,l)},s.Proj})})(uo);const ls=new v.Proj.CRS("EPSG:900913","+proj=merc +a=6378206 +b=6356584.314245179 +lat_ts=0.0 +lon_0=0.0 +x_0=0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs",{resolutions:function(){var i=[];i[0]=Math.pow(2,18);for(var s=1;s<21;s++)i[s]=Math.pow(2,18-s);return i}(),origin:[0,0],bounds:v.bounds([20037508342789244e-9,0],[0,20037508342789244e-9])}),Dn=v.Layer.extend({provide:{TDT:"tdt",BAIDU:"bd",GAODE:"gd",YANDEX:"yandex"},source:{VECTOR:"vec",SATELITE:"img",ANNO:"cia",VEC_NO_ANNO:"vec_no_anno",SATELITE_NO_ANNO:"img_no_anno"},style:{NORMAL:"normal",GRAY:"gray",DARK:"dark",BROWN:"brown",BLUR:"blur"},options:{provide:"tdt",source:"img",style:"normal",accessToken:"016b31f15f25e1365e85aec7e7b0464e"},initialize(i){i=dt.Util.deleteEmptyProperty(i),v.Util.setOptions(this,i)},onAdd(i){this.map=i,this.replaceProjection(),this.tileLayers=this.getLayerGroup(),i.addLayer(this.tileLayers)},onRemove(i){const s=this.getLayerGroup();i.removeLayer(s)},replaceProjection(){const i=this.map.getCenter(),s=this.map.getZoom();this.options.provide===this.provide.BAIDU?this.map.options.crs=ls:this.options.provide===this.provide.YANDEX?this.map.options.crs=v.CRS.EPSG3395:this.map.options.crs=v.CRS.EPSG3857,this._resetMapStatus(i,s)},_resetMapStatus(i,s){this.map.setView(i),this.map._resetView(i,s,!0)},getLayerGroup(){let i={},s={};switch(this.options.style&&this.options.style.split(",").forEach(n=>{switch(n){case this.style.DARK:i.invert=1;break;case this.style.GRAY:i.grayscale=1;break;case this.style.BROWN:i.sepia=1;break;case this.style.BLUR:i.blur="1px";break}}),this.options.provide){case this.provide.TDT:s={subdomains:dt.ArrayUtil.create(8),maxNativeZoom:18,minZoom:0,maxZoom:this.map.getMaxZoom()};break;case this.provide.BAIDU:s={subdomains:dt.ArrayUtil.create(10),tms:!0,corrdType:"bd09",maxNativeZoom:19,minZoom:0,maxZoom:this.map.getMaxZoom()};break;case this.provide.GAODE:s={subdomains:dt.ArrayUtil.create(4).map(n=>n+1),corrdType:"gcj02",maxNativeZoom:18,minZoom:0,maxZoom:this.map.getMaxZoom()};break;case this.provide.YANDEX:s={maxNativeZoom:18,minZoom:0,maxZoom:this.map.getMaxZoom()};break}if(this.options.opacity>=0&&(i.opacity=this.options.opacity),this.options.url)return new v.TileLayer(this.options.url,{...s,style:i});switch(this.options.provide){case this.provide.TDT:let n;switch(s.maxNativeZoom=18,this.options.source){case this.source.VECTOR:n=["vec_w","cva_w"];break;case this.source.SATELITE:n=["img_w","cia_w"];break;case this.source.ANNO:n=["cva_w"];break;case this.source.VEC_NO_ANNO:n=["vec_w"];break;case this.source.SATELITE_NO_ANNO:n=["img_w"];break}return new v.LayerGroup(n.map(o=>new v.TileLayer(`http://t{s}.tianditu.gov.cn/DataServer?T=${o}&x={x}&y={y}&l={z}&tk=${this.options.accessToken}`,{...s,style:i})));case this.provide.BAIDU:switch(this.options.source){case this.source.VECTOR:return s.maxNativeZoom=19,new v.TileLayer("http://online{s}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles=pl&scaler=1&p=1",{...s,style:i});case this.source.ANNO:return s.maxNativeZoom=19,new v.TileLayer("http://online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl",{...s,style:i});case this.source.SATELITE:return s.maxNativeZoom=17,new v.LayerGroup([new v.TileLayer("http://shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46",{...s,style:i}),new v.TileLayer("http://online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl",{...s,style:i})]);case this.source.SATELITE_NO_ANNO:return s.maxNativeZoom=19,new v.TileLayer("http://shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46",{...s,style:i})}break;case this.provide.GAODE:switch(this.options.source){case this.source.VECTOR:return s.maxNativeZoom=18,new v.TileLayer("http://webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",{...s,style:i});case this.source.ANNO:return s.maxNativeZoom=18,new v.TileLayer("http://webst0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",{...s,style:i});case this.source.SATELITE:return s.maxNativeZoom=16,new v.LayerGroup([new v.TileLayer("http://webst0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=6",{...s,style:i}),new v.TileLayer("http://webst0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",{...s,style:i})]);case this.source.SATELITE_NO_ANNO:return s.maxNativeZoom=18,new v.TileLayer("http://webst0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=6",{...s,style:i})}break;case this.provide.YANDEX:switch(this.options.source){case this.source.ANNO:return new v.TileLayer("https://core-renderer-tiles.maps.yandex.net/tiles?l=skl&v=24.05.19-0-b240515214430&x={x}&y={y}&z={z}&scale=1&lang=en_US&client_id=yandex-web-maps&experimental_ranking_mode_name=default-web-ranking&experimental_data_hd=vegetation_model_exp",{...s,style:i});case this.source.SATELITE:return new v.LayerGroup([new v.TileLayer("https://sat{s}.maps.yandex.net/tiles?l=sat&v=3.1238.0&x={x}&y={y}&z={z}&scale=1&lang=en_US&client_id=yandex-web-maps",{...s,subdomains:["01","02","03","04"],style:i}),new v.TileLayer("https://core-renderer-tiles.maps.yandex.net/tiles?l=skl&v=24.05.19-0-b240515214430&x={x}&y={y}&z={z}&scale=1&lang=en_US&client_id=yandex-web-maps&experimental_ranking_mode_name=default-web-ranking&experimental_data_hd=vegetation_model_exp",{...s,style:i})]);case this.source.SATELITE_NO_ANNO:return new v.TileLayer("https://sat{s}.maps.yandex.net/tiles?l=sat&v=3.1238.0&x={x}&y={y}&z={z}&scale=1&lang=en_US&client_id=yandex-web-maps",{...s,subdomains:["01","02","03","04"],style:i})}break}},setOptions(i){v.Util.setOptions(this,i);const s=this.getLayerGroup();this.map.removeLayer(this.tileLayers),setTimeout(()=>{this.replaceProjection(),this.tileLayers=s.addTo(this.map)},500)}}),Rn=v.ImageOverlay.extend({initialize(i,s,n,o){typeof i=="string"?this._url=i:this._rawImage=i,this.topRightMarker=s,this.bottomLeftMarker=n,this.angle=0,v.setOptions(this,o),this._topLeft=new v.LatLng(o.corners[0]),this._topRight=new v.LatLng(o.corners[1]),this._bottomLeft=new v.LatLng(o.corners[3]),s.on("drag dragend",this.reposition,this),n.on("drag dragend",this.reposition,this)},onAdd(i){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(v.DomUtil.addClass(this._rawImage,"leaflet-interactive"),this.addInteractiveTarget(this._rawImage)),i.on("zoomend resetview",this._reset,this),this.getPane().appendChild(this._image),this._reset()},onRemove(i){i.off("zoomend resetview",this._reset,this),v.ImageOverlay.prototype.onRemove.call(this,i)},_initImage(){let i=this._rawImage;this._url&&(i=v.DomUtil.create("img"),i.style.display="none",this.options.crossOrigin&&(i.crossOrigin=""),i.src=this._url,this._rawImage=i),v.DomUtil.addClass(i,"leaflet-image-layer");const s=this._image=v.DomUtil.create("div","leaflet-image-layer "+(this._zoomAnimated?"leaflet-zoom-animated":""));this._updateZIndex&&this._updateZIndex(),s.appendChild(i),s.onselectstart=v.Util.falseFn,s.onmousemove=v.Util.falseFn,i.onload=(function(){this._reset(),i.style.display="block",this.options.w=this._rawImage.width,this.options.h=this._rawImage.height,this.boundsRectBottomLeft=new v.Point(0,0),this.boundsRectTopRight=new v.Point(this.options.w,this.options.h),this.diagonalVector=this.boundsRectTopRight.subtract(this.boundsRectBottomLeft),this.fire("load")}).bind(this),i.alt=this.options.alt},_reset(){const i=this._image,s=this._map.latLngToLayerPoint(this._topLeft),n=this._map.latLngToLayerPoint(this._topRight),o=this._map.latLngToLayerPoint(this._bottomLeft),r=n.subtract(s).add(o),l=new v.Bounds([s,n,o,r]),u=l.getSize(),c=s.subtract(l.min),d=n.subtract(s),_=o.subtract(s),y=Math.atan2(d.y,d.x),p=Math.atan2(_.x,_.y);this.angle=((Math.abs(y)+Math.abs(p))/2*180).toFixed(2),this._bounds=new v.LatLngBounds(this._map.layerPointToLatLng(l.min),this._map.layerPointToLatLng(l.max)),v.DomUtil.setPosition(i,l.min),i.pxBounds=l,i.style.width=u.x+"px",i.style.height=u.y+"px";const M=this._rawImage.width,b=this._rawImage.height;if(!M||!b)return;const A=s.distanceTo(n)/M*Math.cos(y),P=s.distanceTo(o)/b*Math.cos(p);this._rawImage.style.transformOrigin="0 0",this._rawImage.style.transform="translate("+c.x+"px, "+c.y+"px)skew("+p+"rad, "+y+"rad) scale("+A+", "+P+") "},_animateZoom(i){const s=this._map.getZoomScale(i.zoom),o=this._map._latLngBoundsToNewLayerBounds(this._bounds,i.zoom,i.center).min;v.DomUtil.setTransform(this._image,o,s)},reposition(){const i=this.topRightMarker.getLatLng(),s=this.bottomLeftMarker.getLatLng(),n=this.options.w,o=this.options.h,r=this.getCornerLatLng(new v.Point(0,o),s,i),l=this.getCornerLatLng(new v.Point(n,o),s,i),u=this.getCornerLatLng(new v.Point(0,0),s,i),c=this.getCornerLatLng(new v.Point(n,0),s,i);this.options.corners=[r,l,c,u],this._topLeft=new v.LatLng(r),this._topRight=new v.LatLng(l),this._bottomLeft=new v.LatLng(u),this._reset()},getCornerLatLng(i,s,n){const o=this.boundsRectBottomLeft,r=this.diagonalVector,l=i.subtract(o),u=this.getClockWiseRotate90DegreePoint(r),c=this.getDotProduction(r,l)/this.getDotProduction(r,r),d=-this.getDotProduction(u,l)/this.getDotProduction(u,u),_=new v.Projection.SphericalMercator.project(s),y=new v.Projection.SphericalMercator.project(n),p=_.add(y.subtract(_).multiplyBy(c)),M=this.getClockWiseRotate90DegreePoint(_.subtract(y)).multiplyBy(d),b=p.add(M);return new v.Projection.SphericalMercator.unproject(b)},setUrl(i){return this._url=i,this._rawImage&&(this._rawImage.src=i),this},getDotProduction(i,s){return i.x*s.x+i.y*s.y},getClockWiseRotate90DegreePoint(i){return new v.Point([i.y,-i.x])}}),Zn=v.Marker.extend({options:{fontSize:"12px",color:"#f00",fontShadowColor:"none",fontWeight:"normal",background:"rgba(0, 0, 0, 0)",minZoom:void 0,maxZoom:void 0},initialize(i,s,n={}){this._latlng=i,this._enabled=!1,this.options.id=n.id||"text_"+Utils.guid(),this.options.text=s||"",n=Object.assign(this.options,n),v.setOptions(this,n);const{id:o,fontSize:r,color:l,fontWeight:u,background:c,fontShadowColor:d}=this.options;this.options.icon=new v.DivIcon({html:`<span id=${o} style="padding:2px 4px;white-space:nowrap;font-weight:${u};font-size:${r};color:${l};background:${c};text-shadow:${d} 1px 0px 2px">${s||""}</span>`,className:"leaflet-text"})},setStyle(i){const s=document.getElementById(this.options.id),{text:n,color:o,fontSize:r,fontShadowColor:l,fontWeight:u}=i,c=i.background||"none";return s&&(o&&(this.options.color=o,s.style.color=o),u&&(this.options.fontWeight=u,s.style.fontWeight=u),r&&(this.options.fontSize=r,s.style.fontSize=r),c&&(this.options.background=c,s.style.background=c),n&&(this.options.text=n,s.textContent=n),l?(this.options.fontShadowColor=l,s.style["text-shadow"]=l+" 1px 0px 2px"):(this.options.fontShadowColor="none",s.style["text-shadow"]="none")),this},enableEdit(i){const{fontSize:s,color:n,text:o}=this.options;if(!this._enabled){this._enabled=!0;const r=new v.DivIcon({html:`<input type="text" id="text-input-icon" style="font-size:${s};color:${n};" value=${o}></input>`,className:"leaflet-text"});return this.setIcon(r),document.getElementById("text-input-icon").onblur=l=>{this.options.text=l.target.value,setTimeout(()=>{this.disableEdit(),i&&i(this)},100)},document.getElementById("text-input-icon").onkeydown=function(l){l.keyCode===13&&(this.options.text=l.target.value,this.blur(l))},this}},disableEdit(i){if(this._enabled){this._enabled=!1;const{id:s,color:n,fontSize:o,fontWeight:r,fontShadowColor:l}=this.options,u=new v.DivIcon({html:`<span id=${s} style="padding:2px 4px;white-space:nowrap;font-weight:${r};font-size:${o};color:${n};text-shadow:${l} 1px 2px 3px">${this.options.text}</span>`,className:"leaflet-text"});return this.setIcon(u),i&&i(this),this}}}),Fn=v.Draggable.extend({initialize(i,s,n){v.Draggable.prototype.initialize.call(this,i,i),this._element=i,this._stepHeight=s??5.45,this._knobHeight=n??10,this.on("predrag",function(){this._newPos.x=0,this._newPos.y=this._adjust(this._newPos.y)},this)},_adjust(i){let s=Math.round(this._toValue(i));return s=Math.max(0,Math.min(this._maxValue,s)),this._toY(s)},_toY(i){return this._k*i+this._m},_toValue(i){return(i-this._m)/this._k},setSteps(i){this._maxValue=i-1,this._k=-this._stepHeight,this._m=0},setPosition(i){v.DomUtil.setPosition(this._element,L.point(0,this._adjust(i)))},setValue(i){this.setPosition(this._toY(i))},getValue(){return this._toValue(v.DomUtil.getPosition(this._element).y)}}),us=v.Handler.extend({options:{color:"#f00",weight:1,fillColor:"#ff0",fillOpacity:.7,radius:5},PointEvents:{_mouseMove(i){this.tooltip.setLatLng(i.latlng),this.tempPoint.setLatLng(i.latlng),this._map.openTooltip(this.tooltip),this.geometry&&this._map.hasLayer(this.geometry)?this.geometry.setLatLng(i.latlng):(this.tooltip.setContent("点击开始绘制"),this.geometry=new v.CircleMarker(i.latlng,this.options).addTo(this._map)),this.onDrawing&&this.onDrawing(this.geometry)},_mouseClick(i){this.onFinish&&this.geometry&&this.onFinish(this.geometry),this.geometry=null,!this.options.continue&&this.disable()}},PolylineEvents:{_mouseMove(i){this.tooltip.setLatLng(i.latlng),this.tempPoint.setLatLng(i.latlng),this._map.openTooltip(this.tooltip),this.geometry&&this._map.hasLayer(this.geometry)?(this.geometry.setLatLngs([...this.latlngs,i.latlng]),this.latlngs.length?this.tooltip.setContent("点击继续绘制,双击完成绘制"):this.tooltip.setContent("点击开始绘制")):this.geometry=new v.Polyline([i.latlng],this.options).addTo(this._map),this.onDrawing&&this.onDrawing(this.geometry)},_mouseClick(i){this.latlngs.push(i.latlng),String(this.latlngs.at(-1))===String(this.latlngs.at(-2))&&(this.latlngs=this.latlngs.slice(0,this.latlngs.length-1)),this.geometry.setLatLngs(this.latlngs),this.onVertexAdd&&this.onVertexAdd(this.geometry)},_mouseDblClick(i){this.onFinish&&this.geometry&&this.onFinish(this.geometry),this.latlngs=[],this.geometry=null,!this.options.continue&&this.disable()}},RectangleEvents:{_mouseMove(i){this.tooltip.setLatLng(i.latlng),this.tempPoint.setLatLng(i.latlng),this._map.openTooltip(this.tooltip),this.geometry&&this._map.hasLayer(this.geometry)?(this.geometry.setBounds([...this.latlngs,i.latlng]),this.latlngs.length?this.tooltip.setContent("继续点击完成绘制"):this.tooltip.setContent("点击开始绘制")):this.geometry=new v.Rectangle([i.latlng,i.latlng],this.options).addTo(this._map),this.onDrawing&&this.onDrawing(this.geometry)},_mouseClick(i){this.latlngs.push(i.latlng),String(this.latlngs.at(-1))===String(this.latlngs.at(-2))&&(this.latlngs=this.latlngs.slice(0,this.latlngs.length-1)),this.geometry.setBounds(this.latlngs),this.onVertexAdd&&this.onVertexAdd(this.geometry),this.latlngs.length===2&&(this.onFinish&&this.geometry&&this.onFinish(this.geometry),this.latlngs=[],this.geometry=null,!this.options.continue&&this.disable())},_mouseDblClick(i){}},PolygonEvents:{_mouseMove(i){this.tooltip.setLatLng(i.latlng),this.tempPoint.setLatLng(i.latlng),this._map.openTooltip(this.tooltip),this.geometry&&this._map.hasLayer(this.geometry)?(this.geometry.setLatLngs([...this.latlngs,i.latlng]),this.latlngs.length?this.tooltip.setContent("点击继续绘制,双击完成绘制"):this.tooltip.setContent("点击开始绘制")):this.geometry=new v.Polygon([i.latlng],this.options).addTo(this._map),this.onDrawing&&this.onDrawing(this.geometry)},_mouseClick(i){this.latlngs.push(i.latlng),String(this.latlngs.at(-1))===String(this.latlngs.at(-2))&&(this.latlngs=this.latlngs.slice(0,this.latlngs.length-1)),this.geometry.setLatLngs(this.latlngs),this.onVertexAdd&&this.onVertexAdd(this.geometry)},_mouseDblClick(i){this.onFinish&&this.geometry&&this.onFinish(this.geometry),this.latlngs=[],this.geometry=null,!this.options.continue&&this.disable()}},addHooks(){if(!this[this.drawType+"Events"])throw Error("未知的绘制类型");this[this.drawType+"Events"]._mouseMove&&this._map.on("mousemove",this[this.drawType+"Events"]._mouseMove,this),this[this.drawType+"Events"]._mouseClick&&this._map.on("click",this[this.drawType+"Events"]._mouseClick,this),this[this.drawType+"Events"]._mouseDblClick&&this._map.on("dblclick",this[this.drawType+"Events"]._mouseDblClick,this)},removeHooks(){this[this.drawType+"Events"]._mouseMove&&this._map.off("mousemove",this[this.drawType+"Events"]._mouseMove,this),this[this.drawType+"Events"]._mouseClick&&this._map.off("click",this[this.drawType+"Events"]._mouseClick,this),this[this.drawType+"Events"]._mouseDblClick&&this._map.off("dblclick",this[this.drawType+"Events"]._mouseDblClick,this)},setOptions(i){return v.Util.setOptions(this,i),this},enable(i,s={}){return v.Util.setOptions(this,s),this.onFinish=s.onFinish||new Function,this.onDrawing=s.onDrawing||new Function,this.onVertexAdd=s.onVertexAdd||new Function,this.drawType=dt.StringUtil.changeCase(i,1),this.latlngs=s.latlngs||[],this._map.setCursor("draw"),this.tempPoint=new v.CircleMarker([0,0],{weight:1,radius:5,color:"#3388ff",fillColor:"#fff",fillOpacity:1}).addTo(this._map),this.tooltip=new v.Tooltip({offset:[10,-10]}).setContent("点击开始绘制"),v.Handler.prototype.enable.call(this),this},disable(){return this._map.setCursor(),this.removeHooks(),this._map.closeTooltip(this.tooltip),this._map.removeLayer(this.tempPoint),v.Handler.prototype.disable.call(this),this}});v.Map.addInitHook("addHandler","drawHandler",us);const Gt=v.Handler.extend({_touchstart:v.Browser.msPointer?"MSPointerDown":v.Browser.pointer?"pointerdown":"touchstart",initialize(i){v.Handler.prototype.initialize.call(this,i),this._items=[],this._visible=!1,Gt.BASE_CLS=`${i.clsPrefix}-contextmenu`;const s=this._container=v.DomUtil.create("div",`${i.clsPrefix}-contextmenu`,i._container);s.style.zIndex=1e4,s.style.position="absolute",i.options.contextmenuWidth&&(s.style.width=i.options.contextmenuWidth+"px"),this._createItems(),v.DomEvent.on(s,"click",v.DomEvent.stop).on(s,"mousedown",v.DomEvent.stop).on(s,"dblclick",v.DomEvent.stop).on(s,"contextmenu",v.DomEvent.stop)},addHooks(){const i=this._map.getContainer();v.DomEvent.on(i,"mouseleave",this._hide,this).on(document,"keydown",this._onKeyDown,this),v.Browser.touch&&v.DomEvent.on(document,this._touchstart,this._hide,this),this._map.on({contextmenu:this._show,mousedown:this._hide,zoomstart:this._hide},this)},removeHooks(){const i=this._map.getContainer();v.DomEvent.off(i,"mouseleave",this._hide,this).off(document,"keydown",this._onKeyDown,this),v.Browser.touch&&v.DomEvent.off(document,this._touchstart,this._hide,this),this._map.off({contextmenu:this._show,mousedown:this._hide,zoomstart:this._hide},this)},showAt(i,s){i instanceof v.LatLng&&(i=this._map.latLngToContainerPoint(i)),this._showAtPoint(i,s)},hide(){this._hide()},addItem(i){return this.insertItem(i)},insertItem(i,s){s=s!==void 0?s:this._items.length;const n=this._createItem(this._container,i,s);return this._items.push(n),this._sizeChanged=!0,this._map.fire("contextmenu.additem",{contextmenu:this,el:n.el,index:s}),n.el},removeItem(i){const s=this._container;return isNaN(i)||(i=s.children[i]),i?(this._removeItem(v.Util.stamp(i)),this._sizeChanged=!0,this._map.fire("contextmenu.removeitem",{contextmenu:this,el:i}),i):null},removeAllItems(){const i=this._container.children;let s;for(;i.length;)s=i[0],this._removeItem(v.Util.stamp(s));return i},hideAllItems(){let i,s,n;for(s=0,n=this._items.length;s<n;s++)i=this._items[s],i.el.style.display="none"},showAllItems(){let i,s,n;for(s=0,n=this._items.length;s<n;s++)i=this._items[s],i.el.style.display=""},setDisabled(i,s){const n=this._container,o=Gt.BASE_CLS+"-item";isNaN(i)||(i=n.children[i]),i&&v.DomUtil.hasClass(i,o)&&(s?(v.DomUtil.addClass(i,o+"-disabled"),this._map.fire("contextmenu.disableitem",{contextmenu:this,el:i})):(v.DomUtil.removeClass(i,o+"-disabled"),this._map.fire("contextmenu.enableitem",{contextmenu:this,el:i})))},isVisible(){return this._visible},_createItems(){const i=this._map.options.contextmenuItems;let s,n;for(s=0,n=i.length;s<n;s++)this._items.push(this._createItem(this._container,i[s]))},_createItem(i,s,n){if(s.separator||s==="-")return this._createSeparator(i,n);const o=Gt.BASE_CLS+"-item",r=s.disabled?o+" "+o+"-disabled":o,l=this._insertElementAt("a",r,i,n),u=this._createEventHandler(l,s.callback,s.context,s.hideOnSelect),c=this._getIcon(s),d=this._getIconCls(s);let _="";return c?_='<img class="'+Gt.BASE_CLS+'-icon" src="'+c+'"/>':d&&(_='<span class="'+Gt.BASE_CLS+"-icon "+d+'"></span>'),l.innerHTML=_+s.text,l.href="#",v.DomEvent.on(l,"mouseover",this._onItemMouseOver,this).on(l,"mouseout",this._onItemMouseOut,this).on(l,"mousedown",v.DomEvent.stopPropagation).on(l,"click",u),v.Browser.touch&&v.DomEvent.on(l,this._touchstart,v.DomEvent.stopPropagation),v.Browser.pointer||v.DomEvent.on(l,"click",this._onItemMouseOut,this),{id:v.Util.stamp(l),el:l,callback:u}},_removeItem(i){let s,n,o,r,l;for(o=0,r=this._items.length;o<r;o++)if(s=this._items[o],s.id===i)return n=s.el,l=s.callback,l&&(v.DomEvent.off(n,"mouseover",this._onItemMouseOver,this).off(n,"mouseover",this._onItemMouseOut,this).off(n,"mousedown",v.DomEvent.stopPropagation).off(n,"click",l),v.Browser.touch&&v.DomEvent.off(n,this._touchstart,v.DomEvent.stopPropagation),v.Browser.pointer||v.DomEvent.on(n,"click",this._onItemMouseOut,this)),this._container.removeChild(n),this._items.splice(o,1),s;return null},_createSeparator(i,s){const n=this._insertElementAt("div",Gt.BASE_CLS+"-separator",i,s);return{id:v.Util.stamp(n),el:n}},_createEventHandler(i,s,n,u){const r=this;this._map;const l=Gt.BASE_CLS+"-item-disabled";var u=u!==void 0?u:!0;return function(c){if(v.DomUtil.hasClass(i,l))return;const d=r._map,_=r._showLocation.containerPoint,y=d.containerPointToLayerPoint(_),p=d.layerPointToLatLng(y),M=r._showLocation.relatedTarget,b={containerPoint:_,layerPoint:y,latlng:p,relatedTarget:M};u&&r._hide(),s&&s.call(n||d,b),r._map.fire("contextmenu.select",{contextmenu:r,el:i})}},_insertElementAt(i,s,n,o){let r;const l=document.createElement(i);return l.className=s,o!==void 0&&(r=n.children[o]),r?n.insertBefore(l,r):n.appendChild(l),l},_show(i){this._showAtPoint(i.containerPoint,i)},_showAtPoint(i,s){if(this._items.length){this._map;const n=v.extend(s||{},{contextmenu:this});this._showLocation={containerPoint:i},s&&s.relatedTarget&&(this._showLocation.relatedTarget=s.relatedTarget),this._setPosition(i),this._visible||(this._container.style.display="block",this._visible=!0),this._map.fire("contextmenu.show",n)}},_hide(){this._visible&&(this._visible=!1,this._container.style.display="none",this._map.fire("contextmenu.hide",{contextmenu:this}))},_getIcon(i){return v.Browser.retina&&i.retinaIcon||i.icon},_getIconCls(i){return v.Browser.retina&&i.retinaIconCls||i.iconCls},_setPosition(i){const s=this._map.getSize(),n=this._container,o=this._getElementSize(n);let r;this._map.options.contextmenuAnchor&&(r=new v.Point(this._map.options.contextmenuAnchor),i=i.add(r)),n._leaflet_pos=i,i.x+o.x>s.x?(n.style.left="auto",n.style.right=Math.min(Math.max(s.x-i.x,0),s.x-o.x-1)+"px"):(n.style.left=Math.max(i.x,0)+"px",n.style.right="auto"),i.y+o.y>s.y?(n.style.top="auto",n.style.bottom=Math.min(Math.max(s.y-i.y,0),s.y-o.y-1)+"px"):(n.style.top=Math.max(i.y,0)+"px",n.style.bottom="auto")},_getElementSize(i){let s=this._size;const n=i.style.display;return(!s||this._sizeChanged)&&(s={},i.style.left="-999999px",i.style.right="auto",i.style.display="block",s.x=i.offsetWidth,s.y=i.offsetHeight,i.style.left="auto",i.style.display=n,this._sizeChanged=!1),s},_onKeyDown(i){i.keyCode===27&&this._hide()},_onItemMouseOver(i){v.DomUtil.addClass(i.target||i.srcElement,"over")},_onItemMouseOut(i){v.DomUtil.removeClass(i.target||i.srcElement,"over")}});v.Map.mergeOptions({contextmenuItems:[]}),v.Map.addInitHook("addHandler","contextmenu",Gt);const ec={bindContextMenu(i){return L.setOptions(this,i),this._initContextMenu(),this},unbindContextMenu(){return this.off("contextmenu",this._showContextMenu,this),this},addContextMenuItem(i){this.options.contextmenuItems.push(i)},removeContextMenuItemWithIndex(i){const s=[];for(let o=0;o<this.options.contextmenuItems.length;o++)this.options.contextmenuItems[o].index==i&&s.push(o);let n=s.pop();for(;n!==void 0;)this.options.contextmenuItems.splice(n,1),n=s.pop()},replaceContextMenuItem(i){this.removeContextMenuItemWithIndex(i.index),this.addContextMenuItem(i)},_initContextMenu(){this._items=[],this.on("contextmenu",this._showContextMenu,this)},_showContextMenu(i){let s,n,o,r,l;if(this._items=[],this._contextmenu){for(n=L.extend({relatedTarget:this},i),o=this._map.mouseEventToContainerPoint(i.originalEvent),this.options.contextmenuInheritItems||this._contextmenu.hideAllItems(),r=0,l=this.options.contextmenuItems.length;r<l;r++)s=this.options.contextmenuItems[r],this._items.push(this._contextmenu.insertItem(s,s.index));this._map.once("contextmenu.hide",this._hideContextMenu,this),this._contextmenu.showAt(o,n)}},_hideContextMenu(){let i,s;if(this._items){for(i=0,s=this._items.length;i<s;i++)this._contextmenu.removeItem(this._items[i]);this._items.length=0,this.options.contextmenuInheritItems||this._contextmenu.showAllItems()}}},qn=[v.Marker,v.Path],Gn={contextmenu:!1,contextmenuItems:[],contextmenuInheritItems:!1};for(let i=0,s=qn.length;i<s;i++){const n=qn[i];n.prototype.options?n.mergeOptions(Gn):n.prototype.options=Gn,n.addInitHook(function(){this.options.contextmenu&&this._initContextMenu()}),n.include(ec)}const Un=v.LayerGroup.extend({initialize(i){v.Util.setOptions(this,i),v.LayerGroup.prototype.initialize.call(this,i)},getRasterLayers(){const i={},s=n=>{if(n._layers&&n.getLayer)for(const o in n._layers){const r=n._layers[o];r._layers&&r.getLayer?s(r):i[r._leaflet_id]=r}else i[n._leaflet_id]=n};return s(this),i},removeRasterLayer(i){const s=function(n){if(n._layers&&n.getLayer&&n.getLayer(i)){const o=n.getLayer(i);n.removeLayer(o)}else if(n._layers)for(const o in n._layers){const r=n._layers[o];if(r._layers&&r.getLayer&&r.getLayer(i)){const l=r.getLayer(i);r.removeLayer(l)}else r._layers&&s(r)}};s(this)},getRasterTop(){const i=Object.values(this.getRasterLayers());return i.length?Math.max(...i.map(s=>s.options.zIndex))+1:null}});function sc(i){const s=document.createElement("style"),n=document.head||document.documentElement;s.innerHTML=`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gis-leaflet-helper",
3
- "version": "2.1.31",
3
+ "version": "2.1.32",
4
4
  "author": "Guo.Yan <luv02@vip.qq.com>",
5
5
  "license": "MIT",
6
6
  "private": false,