!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.L={})}(this,function(n){"use strict";function s(n){for(var i,u,t=1,r=arguments.length;t<r;t++)for(i in u=arguments[t])n[i]=u[i];return n}function hs(){}function c(n,t){var i=Array.prototype.slice,r;return n.bind?n.bind.apply(n,i.call(arguments,1)):(r=i.call(arguments,2),function(){return n.apply(t,r.length?r.concat(i.call(arguments)):arguments)})}function o(n){return n._leaflet_id=n._leaflet_id||++vf,n._leaflet_id}function yf(n,t,i){var u,r,f,e;return e=function(){u=!1;r&&(f.apply(i,r),r=!1)},f=function(){u?r=arguments:(n.apply(i,arguments),setTimeout(e,t),u=!0)}}function lr(n,t,i){var f=t[1],r=t[0],u=f-r;return n===f&&i?n:((n-r)%u+u)%u+r}function d(){return!1}function yt(n,t){return t=void 0===t?6:t,+(Math.round(n+"e+"+t)+"e-"+t)}function pf(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function pi(n){return pf(n).split(/\s+/)}function l(n,t){for(var i in n.hasOwnProperty("options")||(n.options=n.options?cr(n.options):{}),t)n.options[i]=t[i];return n.options}function cs(n,t,i){var u=[];for(var r in n)u.push(encodeURIComponent(i?r.toUpperCase():r)+"="+encodeURIComponent(n[r]));return(t&&-1!==t.indexOf("?")?"&":"?")+u.join("&")}function as(n,t){return n.replace(ls,function(n,i){var r=t[i];if(void 0===r)throw new Error("No value provided for variable "+n);return"function"==typeof r&&(r=r(t)),r})}function vs(n,t){for(var i=0;i<n.length;i++)if(n[i]===t)return i;return-1}function wf(n){return window["webkit"+n]||window["moz"+n]||window["ms"+n]}function ys(n){var t=+new Date,i=Math.max(0,16-(t-bf));return bf=t+i,window.setTimeout(n,i)}function g(n,t,i){if(!i||su!==ys)return su.call(window,c(n,t));n.call(t)}function nt(n){n&&kf.call(window,n)}function dt(){}function t(n,t,i){this.x=i?Math.round(n):n;this.y=i?Math.round(t):t}function r(n,i,r){return n instanceof t?n:ht(n)?new t(n[0],n[1]):null==n?n:"object"==typeof n&&"x"in n&&"y"in n?new t(n.x,n.y):new t(n,i,r)}function a(n,t){if(n)for(var r=t?[n,t]:n,i=0,u=r.length;i<u;i++)this.extend(r[i])}function ct(n,t){return!n||n instanceof a?n:new a(n,t)}function it(n,t){if(n)for(var r=t?[n,t]:n,i=0,u=r.length;i<u;i++)this.extend(r[i])}function k(n,t){return n instanceof it?n:new it(n,t)}function h(n,t,i){if(isNaN(n)||isNaN(t))throw new Error("Invalid LatLng object: ("+n+", "+t+")");this.lat=+n;this.lng=+t;void 0!==i&&(this.alt=+i)}function y(n,t,i){return n instanceof h?n:ht(n)&&"object"!=typeof n[0]?3===n.length?new h(n[0],n[1],n[2]):2===n.length?new h(n[0],n[1]):null:null==n?n:"object"==typeof n&&"lat"in n?new h(n.lat,"lng"in n?n.lng:n.lon,n.alt):void 0===t?null:new h(n,t,i)}function ne(n,t,i,r){if(ht(n))return this._a=n[0],this._b=n[1],this._c=n[2],void(this._d=n[3]);this._a=n;this._b=t;this._c=i;this._d=r}function yr(n,t,i,r){return new ne(n,t,i,r)}function ks(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function ds(n,t){for(var i,e,o,s,u="",r=0,f=n.length;r<f;r++){for(i=0,e=(o=n[r]).length;i<e;i++)u+=(i?"L":"M")+(s=o[i]).x+" "+s.y;u+=t?lu?"z":"x":""}return u||"M0 0"}function wt(n){return 0<=navigator.userAgent.toLowerCase().indexOf(n)}function gc(n,t,i,r){return"touchstart"===t?function(n,t,i){var r=c(function(n){if("mouse"!==n.pointerType&&n.MSPOINTER_TYPE_MOUSE&&n.pointerType!==n.MSPOINTER_TYPE_MOUSE){if(!(dc.indexOf(n.target.tagName)<0))return;et(n)}ve(n,t)});n["_leaflet_touchstart"+i]=r;n.addEventListener(se,r,!1);oh||(document.documentElement.addEventListener(se,nl,!0),document.documentElement.addEventListener(he,tl,!0),document.documentElement.addEventListener(ce,sh,!0),document.documentElement.addEventListener(le,sh,!0),oh=!0)}(n,i,r):"touchmove"===t?function(n,t,i){var r=function(n){(n.pointerType!==n.MSPOINTER_TYPE_MOUSE&&"mouse"!==n.pointerType||0!==n.buttons)&&ve(n,t)};n["_leaflet_touchmove"+i]=r;n.addEventListener(he,r,!1)}(n,i,r):"touchend"===t&&function(n,t,i){var r=function(n){ve(n,t)};n["_leaflet_touchend"+i]=r;n.addEventListener(ce,r,!1);n.addEventListener(le,r,!1)}(n,i,r),this}function nl(n){gi[n.pointerId]=n;ae++}function tl(n){gi[n.pointerId]&&(gi[n.pointerId]=n)}function sh(n){delete gi[n.pointerId];ae--}function ve(n,t){for(var i in n.touches=[],gi)n.touches.push(gi[i]);n.changedTouches=[n];t(n)}function il(n,t,i){function e(n){var i,t,e;if(lt){if(!pr||"mouse"===n.pointerType)return;i=ae}else i=n.touches.length;1<i||(t=Date.now(),e=t-(u||t),r=n.touches?n.touches[0]:n,f=0<e&&e<=250,u=t)}function o(n){if(f&&!r.cancelBubble){if(lt){if(!pr||"mouse"===n.pointerType)return;var i,e,o={};for(e in r)i=r[e],o[e]=i&&i.bind?i.bind(r):i;r=o}r.type="dblclick";r.button=0;t(r);u=null}}var u,r,f=!1;return n[nr+vu+i]=e,n[nr+yu+i]=o,n[nr+"dblclick"+i]=t,n.addEventListener(vu,e,!1),n.addEventListener(yu,o,!1),n.addEventListener("dblclick",t,!1),this}function rl(n,t){var i=n[nr+vu+t],r=n[nr+yu+t],u=n[nr+"dblclick"+t];return n.removeEventListener(vu,i,!1),n.removeEventListener(yu,r,!1),pr||n.removeEventListener("dblclick",u,!1),this}function ch(n){return"string"==typeof n?document.getElementById(n):n}function nu(n,t){var i=n.style[t]||n.currentStyle&&n.currentStyle[t],r;return(!i||"auto"===i)&&document.defaultView&&(r=document.defaultView.getComputedStyle(n,null),i=r?r[t]:null),"auto"===i?null:i}function e(n,t,i){var r=document.createElement(n);return r.className=t||"",i&&i.appendChild(r),r}function v(n){var t=n.parentNode;t&&t.removeChild(n)}function wu(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function tr(n){var t=n.parentNode;t&&t.lastChild!==n&&t.appendChild(n)}function ir(n){var t=n.parentNode;t&&t.firstChild!==n&&t.insertBefore(n,t.firstChild)}function be(n,t){if(void 0!==n.classList)return n.classList.contains(t);var i=bu(n);return 0<i.length&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(i)}function i(n,t){var r;if(void 0!==n.classList)for(var u=pi(t),i=0,f=u.length;i<f;i++)n.classList.add(u[i]);else be(n,t)||(r=bu(n),ke(n,(r?r+" ":"")+t))}function p(n,t){void 0!==n.classList?n.classList.remove(t):ke(n,pf((" "+bu(n)+" ").replace(" "+t+" "," ")))}function ke(n,t){void 0===n.className.baseVal?n.className=t:n.className.baseVal=t}function bu(n){return n.correspondingElement&&(n=n.correspondingElement),void 0===n.className.baseVal?n.className:n.className.baseVal}function ut(n,t){"opacity"in n.style?n.style.opacity=t:"filter"in n.style&&function(n,t){var i=!1,r="DXImageTransform.Microsoft.Alpha";try{i=n.filters.item(r)}catch(n){if(1===t)return}t=Math.round(100*t);i?(i.Enabled=100!==t,i.Opacity=t):n.style.filter+=" progid:"+r+"(opacity="+t+")"}(n,t)}function ku(n){for(var i=document.documentElement.style,t=0;t<n.length;t++)if(n[t]in i)return n[t];return!1}function si(n,i,r){var u=i||new t(0,0);n.style[we]=(ee?"translate("+u.x+"px,"+u.y+"px)":"translate3d("+u.x+"px,"+u.y+"px,0)")+(r?" scale("+r+")":"")}function b(n,t){n._leaflet_pos=t;rt?si(n,t):(n.style.left=t.x+"px",n.style.top=t.y+"px")}function ei(n){return n._leaflet_pos||new t(0,0)}function de(){u(window,"dragstart",et)}function ge(){w(window,"dragstart",et)}function no(n){for(;-1===n.tabIndex;)n=n.parentNode;n.style&&(du(),pe=(pu=n).style.outline,n.style.outline="none",u(window,"keydown",du))}function du(){pu&&(pu.style.outline=pe,pe=pu=void 0,w(window,"keydown",du))}function lh(n){for(;!((n=n.parentNode).offsetWidth&&n.offsetHeight||n===document.body););return n}function to(n){var t=n.getBoundingClientRect();return{x:t.width/n.offsetWidth||1,y:t.height/n.offsetHeight||1,boundingClientRect:t}}function u(n,t,i,r){var f,u,e;if("object"==typeof t)for(f in t)gu(n,f,t[f],i);else for(u=0,e=(t=pi(t)).length;u<e;u++)gu(n,t[u],i,r);return this}function w(n,t,i,r){var f,u,o,e;if("object"==typeof t)for(f in t)io(n,f,t[f],i);else if(t)for(u=0,o=(t=pi(t)).length;u<o;u++)io(n,t[u],i,r);else{for(e in n[ft])io(n,e,n[ft][e]);delete n[ft]}return this}function gu(n,t,i,r){var f=t+o(i)+(r?"_"+o(r):""),u,e;if(n[ft]&&n[ft][f])return this;u=function(t){return i.call(r||n,t||window.event)};e=u;lt&&0===t.indexOf("touch")?gc(n,t,u,f):!pt||"dblclick"!==t||lt&&br?"addEventListener"in n?"mousewheel"===t?n.addEventListener("onwheel"in n?"wheel":"mousewheel",u,!1):"mouseenter"===t||"mouseleave"===t?(u=function(t){t=t||window.event;tf(n,t)&&e(t)},n.addEventListener("mouseenter"===t?"mouseover":"mouseout",u,!1)):("click"===t&&ki&&(u=function(n){!function(n,t){var r=n.timeStamp||n.originalEvent&&n.originalEvent.timeStamp,i=uo&&r-uo;if(i&&100<i&&i<500||n.target._simulatedClick&&!n._simulated)return bt(n);uo=r;t(n)}(n,e)}),n.addEventListener(t,u,!1)):"attachEvent"in n&&n.attachEvent("on"+t,u):il(n,u,f);n[ft]=n[ft]||{};n[ft][f]=u}function io(n,t,i,r){var u=t+o(i)+(r?"_"+o(r):""),f=n[ft]&&n[ft][u];if(!f)return this;lt&&0===t.indexOf("touch")?function(n,t,i){var r=n["_leaflet_"+t+i];"touchstart"===t?n.removeEventListener(se,r,!1):"touchmove"===t?n.removeEventListener(he,r,!1):"touchend"===t&&(n.removeEventListener(ce,r,!1),n.removeEventListener(le,r,!1))}(n,t,u):!pt||"dblclick"!==t||lt&&br?"removeEventListener"in n?"mousewheel"===t?n.removeEventListener("onwheel"in n?"wheel":"mousewheel",f,!1):n.removeEventListener("mouseenter"===t?"mouseover":"mouseleave"===t?"mouseout":t,f,!1):"detachEvent"in n&&n.detachEvent("on"+t,f):rl(n,u);n[ft][u]=null}function hi(n){return n.stopPropagation?n.stopPropagation():n.originalEvent?n.originalEvent._stopped=!0:n.cancelBubble=!0,eo(n),this}function ro(n){return gu(n,"mousewheel",hi),this}function tu(n){return u(n,"mousedown touchstart dblclick",hi),gu(n,"click",fo),this}function et(n){return n.preventDefault?n.preventDefault():n.returnValue=!1,this}function bt(n){return et(n),hi(n),this}function vh(n,i){if(!i)return new t(n.clientX,n.clientY);var r=to(i),u=r.boundingClientRect;return new t((n.clientX-u.left)/r.x-i.clientLeft,(n.clientY-u.top)/r.y-i.clientTop)}function ph(n){return pr?n.wheelDeltaY/2:n.deltaY&&0===n.deltaMode?-n.deltaY/yh:n.deltaY&&1===n.deltaMode?20*-n.deltaY:n.deltaY&&2===n.deltaMode?60*-n.deltaY:n.deltaX||n.deltaZ?0:n.wheelDelta?(n.wheelDeltaY||n.wheelDelta)/2:n.detail&&Math.abs(n.detail)<32765?20*-n.detail:n.detail?n.detail/-32765*60:0}function fo(n){nf[n.type]=!0}function eo(n){var t=nf[n.type];return nf[n.type]=!1,t}function tf(n,t){var i=t.relatedTarget;if(!i)return!0;try{for(;i&&i!==n;)i=i.parentNode}catch(n){return!1}return i!==n}function iu(n){return new ot(n)}function gh(n,t){if(!t||!n.length)return n.slice();var i=t*t;return function(n,t){var r=n.length,u=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(r),i,f;for(u[0]=u[r-1]=1,function n(t,i,r,u,f){for(var o,s,h=0,e=u+1;e<=f-1;e++)s=ru(t[e],t[u],t[f],!0),h<s&&(o=e,h=s);r<h&&(i[o]=1,n(t,i,r,u,o),n(t,i,r,o,f))}(n,u,t,0,r-1),f=[],i=0;i<r;i++)u[i]&&f.push(n[i]);return f}(n=function(n,t){for(var e,o,s,h,r=[n[0]],i=1,u=0,f=n.length;i<f;i++)e=n[i],o=n[u],void 0,s=o.x-e.x,h=o.y-e.y,t<s*s+h*h&&(r.push(n[i]),u=i);return u<f-1&&r.push(n[f-1]),r}(n,i),i)}function nc(n,t,i){return Math.sqrt(ru(n,t,i,!0))}function tc(n,t,i,r,u){var h,o,s,f=r?bh:li(n,i),e=li(t,i);for(bh=e;;){if(!(f|e))return[n,t];if(f&e)return!1;s=li(o=ff(n,t,h=f||e,i,u),i);h===f?(n=o,f=s):(t=o,e=s)}}function ff(n,i,r,u,f){var e,o,s=i.x-n.x,h=i.y-n.y,c=u.min,l=u.max;return 8&r?(e=n.x+s*(l.y-n.y)/h,o=l.y):4&r?(e=n.x+s*(c.y-n.y)/h,o=c.y):2&r?(e=l.x,o=n.y+h*(l.x-n.x)/s):1&r&&(e=c.x,o=n.y+h*(c.x-n.x)/s),new t(e,o,f)}function li(n,t){var i=0;return n.x<t.min.x?i|=1:n.x>t.max.x&&(i|=2),n.y<t.min.y?i|=4:n.y>t.max.y&&(i|=8),i}function ru(n,i,r,u){var h,o=i.x,s=i.y,f=r.x-o,e=r.y-s,c=f*f+e*e;return 0<c&&(1<(h=((n.x-o)*f+(n.y-s)*e)/c)?(o=r.x,s=r.y):0<h&&(o+=f*h,s+=e*h)),f=n.x-o,e=n.y-s,u?f*f+e*e:new t(o,s)}function ni(n){return!ht(n[0])||"object"!=typeof n[0][0]&&void 0!==n[0][0]}function ic(n){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),ni(n)}function uc(n,t,i){for(var e,l,h,o,s,u,f,a=[1,4,2,8],r=0,c=n.length;r<c;r++)n[r]._code=li(n[r],t);for(h=0;h<4;h++){for(u=a[h],e=[],r=0,l=(c=n.length)-1;r<c;l=r++)o=n[r],s=n[l],o._code&u?s._code&u||((f=ff(s,o,u,t,i))._code=li(f,t),e.push(f)):(s._code&u&&((f=ff(s,o,u,t,i))._code=li(f,t),e.push(f)),e.push(o));n=e}return n}function yo(n,t){var u,e,i,o,r="Feature"===n.type?n.geometry:n,f=r?r.coordinates:null,s=[],h=t&&t.pointToLayer,c=t&&t.coordsToLatLng||po,l;if(!f&&!r)return null;switch(r.type){case"Point":return u=c(f),h?h(n,u):new fu(u);case"MultiPoint":for(i=0,o=f.length;i<o;i++)u=c(f[i]),s.push(h?h(n,u):new fu(u));return new fr(s);case"LineString":case"MultiLineString":return e=of(f,"LineString"===r.type?0:1,c),new ti(e,t);case"Polygon":case"MultiPolygon":return e=of(f,"Polygon"===r.type?1:2,c),new ai(e,t);case"GeometryCollection":for(i=0,o=r.geometries.length;i<o;i++)l=yo({geometry:r.geometries[i],type:"Feature",properties:n.properties},t),l&&s.push(l);return new fr(s);default:throw new Error("Invalid GeoJSON object.");}}function po(n){return new h(n[1],n[0],n[2])}function of(n,t,i){for(var u,f=[],r=0,e=n.length;r<e;r++)u=t?of(n[r],t-1,i):(i||po)(n[r]),f.push(u);return f}function wo(n,t){return t="number"==typeof t?t:6,void 0!==n.alt?[yt(n.lng,t),yt(n.lat,t),yt(n.alt,t)]:[yt(n.lng,t),yt(n.lat,t)]}function sf(n,t,i,r){for(var u=[],f=0,e=n.length;f<e;f++)u.push(t?sf(n[f],t-1,i,r):wo(n[f],r));return!t&&i&&u.push(u[0]),u}function or(n,t){return n.feature?s({},n.feature,{geometry:t}):hf(t)}function hf(n){return"Feature"===n.type||"FeatureCollection"===n.type?n:{type:"Feature",properties:{},geometry:n}}function oc(n,t){return new kt(n,t)}function cc(n,t){return new yi(n,t)}function lc(n){return eh?new go(n):null}function ac(n){return lu||au?new ou(n):null}var ss=Object.freeze,cr,vf,ls,ht,ar,bf,su,kf,ps,tt,wi,df,te,hu,bs,rr,ah,ft,yh,uo,nf,ot,oo,rf,so,uf,at,rc,st,ai,kt,cf,vi,bo,hr,yi,ko,vt,go,ns,ts,is,rs,us,fs,es,os,vc;Object.freeze=function(n){return n};cr=Object.create||function(n){return hs.prototype=n,new hs};vf=0;ls=/\{ *([\w_-]+) *\}/g;ht=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};ar="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";bf=0;su=window.requestAnimationFrame||wf("RequestAnimationFrame")||ys;kf=window.cancelAnimationFrame||wf("CancelAnimationFrame")||wf("CancelRequestAnimationFrame")||function(n){window.clearTimeout(n)};ps=(Object.freeze||Object)({freeze:ss,extend:s,create:cr,bind:c,lastId:vf,stamp:o,throttle:yf,wrapNum:lr,falseFn:d,formatNum:yt,trim:pf,splitWords:pi,setOptions:l,getParamString:cs,template:as,isArray:ht,indexOf:vs,emptyImageUrl:ar,requestFn:su,cancelFn:kf,requestAnimFrame:g,cancelAnimFrame:nt});dt.extend=function(n){function i(){this.initialize&&this.initialize.apply(this,arguments);this.callInitHooks()}var u=i.__super__=this.prototype,t=cr(u);for(var r in(t.constructor=i).prototype=t,this)this.hasOwnProperty(r)&&"prototype"!==r&&"__super__"!==r&&(i[r]=this[r]);return n.statics&&(s(i,n.statics),delete n.statics),n.includes&&(function(n){if("undefined"!=typeof L&&L&&L.Mixin){n=ht(n)?n:[n];for(var t=0;t<n.length;t++)n[t]===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)}}(n.includes),s.apply(null,[t].concat(n.includes)),delete n.includes),t.options&&(n.options=s(cr(t.options),n.options)),s(t,n),t._initHooks=[],t.callInitHooks=function(){if(!this._initHooksCalled){u.callInitHooks&&u.callInitHooks.call(this);this._initHooksCalled=!0;for(var n=0,i=t._initHooks.length;n<i;n++)t._initHooks[n].call(this)}},i};dt.include=function(n){return s(this.prototype,n),this};dt.mergeOptions=function(n){return s(this.prototype.options,n),this};dt.addInitHook=function(n){var t=Array.prototype.slice.call(arguments,1),i="function"==typeof n?n:function(){this[n].apply(this,t)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};tt={on:function(n,t,i){var u,r,f;if("object"==typeof n)for(u in n)this._on(u,n[u],t);else for(r=0,f=(n=pi(n)).length;r<f;r++)this._on(n[r],t,i);return this},off:function(n,t,i){var u,r,f;if(n)if("object"==typeof n)for(u in n)this._off(u,n[u],t);else for(r=0,f=(n=pi(n)).length;r<f;r++)this._off(n[r],t,i);else delete this._events;return this},_on:function(n,t,i){var r;this._events=this._events||{};r=this._events[n];r||(r=[],this._events[n]=r);i===this&&(i=void 0);for(var e={fn:t,ctx:i},u=r,f=0,o=u.length;f<o;f++)if(u[f].fn===t&&u[f].ctx===i)return;u.push(e)},_off:function(n,t,i){var r,u,f,e;if(this._events&&(r=this._events[n]))if(t){if(i===this&&(i=void 0),r)for(u=0,f=r.length;u<f;u++)if(e=r[u],e.ctx===i&&e.fn===t)return e.fn=d,this._firingCount&&(this._events[n]=r=r.slice()),void r.splice(u,1)}else{for(u=0,f=r.length;u<f;u++)r[u].fn=d;delete this._events[n]}},fire:function(n,t,i){var f,r,u,o,e;if(!this.listens(n,i))return this;if(f=s({},t,{type:n,target:this,sourceTarget:t&&t.sourceTarget||this}),this._events&&(r=this._events[n],r)){for(this._firingCount=this._firingCount+1||1,u=0,o=r.length;u<o;u++)e=r[u],e.fn.call(e.ctx||this,f);this._firingCount--}return i&&this._propagateEvent(f),this},listens:function(n,t){var i=this._events&&this._events[n],r;if(i&&i.length)return!0;if(t)for(r in this._eventParents)if(this._eventParents[r].listens(n,t))return!0;return!1},once:function(n,t,i){var r,u;if("object"==typeof n){for(r in n)this.once(r,n[r],t);return this}u=c(function(){this.off(n,t,i).off(n,u,i)},this);return this.on(n,t,i).on(n,u,i)},addEventParent:function(n){return this._eventParents=this._eventParents||{},this._eventParents[o(n)]=n,this},removeEventParent:function(n){return this._eventParents&&delete this._eventParents[o(n)],this},_propagateEvent:function(n){for(var t in this._eventParents)this._eventParents[t].fire(n.type,s({layer:n.target,propagatedFrom:n.target},n),!0)}};tt.addEventListener=tt.on;tt.removeEventListener=tt.clearAllEventListeners=tt.off;tt.addOneTimeEventListener=tt.once;tt.fireEvent=tt.fire;tt.hasEventListeners=tt.listens;wi=dt.extend(tt);df=Math.trunc||function(n){return 0<n?Math.floor(n):Math.ceil(n)};t.prototype={clone:function(){return new t(this.x,this.y)},add:function(n){return this.clone()._add(r(n))},_add:function(n){return this.x+=n.x,this.y+=n.y,this},subtract:function(n){return this.clone()._subtract(r(n))},_subtract:function(n){return this.x-=n.x,this.y-=n.y,this},divideBy:function(n){return this.clone()._divideBy(n)},_divideBy:function(n){return this.x/=n,this.y/=n,this},multiplyBy:function(n){return this.clone()._multiplyBy(n)},_multiplyBy:function(n){return this.x*=n,this.y*=n,this},scaleBy:function(n){return new t(this.x*n.x,this.y*n.y)},unscaleBy:function(n){return new t(this.x/n.x,this.y/n.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=df(this.x),this.y=df(this.y),this},distanceTo:function(n){var t=(n=r(n)).x-this.x,i=n.y-this.y;return Math.sqrt(t*t+i*i)},equals:function(n){return(n=r(n)).x===this.x&&n.y===this.y},contains:function(n){return n=r(n),Math.abs(n.x)<=Math.abs(this.x)&&Math.abs(n.y)<=Math.abs(this.y)},toString:function(){return"Point("+yt(this.x)+", "+yt(this.y)+")"}};a.prototype={extend:function(n){return n=r(n),this.min||this.max?(this.min.x=Math.min(n.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(n.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)):(this.min=n.clone(),this.max=n.clone()),this},getCenter:function(n){return new t((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,n)},getBottomLeft:function(){return new t(this.min.x,this.max.y)},getTopRight:function(){return new t(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(n){var i,u;return(n="number"==typeof n[0]||n instanceof t?r(n):ct(n))instanceof a?(i=n.min,u=n.max):i=u=n,i.x>=this.min.x&&u.x<=this.max.x&&i.y>=this.min.y&&u.y<=this.max.y},intersects:function(n){n=ct(n);var t=this.min,i=this.max,r=n.min,u=n.max,f=u.x>=t.x&&r.x<=i.x,e=u.y>=t.y&&r.y<=i.y;return f&&e},overlaps:function(n){n=ct(n);var t=this.min,i=this.max,r=n.min,u=n.max,f=u.x>t.x&&r.x<i.x,e=u.y>t.y&&r.y<i.y;return f&&e},isValid:function(){return!(!this.min||!this.max)}};it.prototype={extend:function(n){var t,i,r=this._southWest,u=this._northEast;if(n instanceof h)i=t=n;else{if(!(n instanceof it))return n?this.extend(y(n)||k(n)):this;if(t=n._southWest,i=n._northEast,!t||!i)return this}return r||u?(r.lat=Math.min(t.lat,r.lat),r.lng=Math.min(t.lng,r.lng),u.lat=Math.max(i.lat,u.lat),u.lng=Math.max(i.lng,u.lng)):(this._southWest=new h(t.lat,t.lng),this._northEast=new h(i.lat,i.lng)),this},pad:function(n){var t=this._southWest,i=this._northEast,r=Math.abs(t.lat-i.lat)*n,u=Math.abs(t.lng-i.lng)*n;return new it(new h(t.lat-r,t.lng-u),new h(i.lat+r,i.lng+u))},getCenter:function(){return new h((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 h(this.getNorth(),this.getWest())},getSouthEast:function(){return new h(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(n){n="number"==typeof n[0]||n instanceof h||"lat"in n?y(n):k(n);var t,i,r=this._southWest,u=this._northEast;return n instanceof it?(t=n.getSouthWest(),i=n.getNorthEast()):t=i=n,t.lat>=r.lat&&i.lat<=u.lat&&t.lng>=r.lng&&i.lng<=u.lng},intersects:function(n){n=k(n);var t=this._southWest,i=this._northEast,r=n.getSouthWest(),u=n.getNorthEast(),f=u.lat>=t.lat&&r.lat<=i.lat,e=u.lng>=t.lng&&r.lng<=i.lng;return f&&e},overlaps:function(n){n=k(n);var t=this._southWest,i=this._northEast,r=n.getSouthWest(),u=n.getNorthEast(),f=u.lat>t.lat&&r.lat<i.lat,e=u.lng>t.lng&&r.lng<i.lng;return f&&e},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(n,t){return!!n&&(n=k(n),this._southWest.equals(n.getSouthWest(),t)&&this._northEast.equals(n.getNorthEast(),t))},isValid:function(){return!(!this._southWest||!this._northEast)}};var vr,gt={latLngToPoint:function(n,t){var i=this.projection.project(n),r=this.scale(t);return this.transformation._transform(i,r)},pointToLatLng:function(n,t){var i=this.scale(t),r=this.transformation.untransform(n,i);return this.projection.unproject(r)},project:function(n){return this.projection.project(n)},unproject:function(n){return this.projection.unproject(n)},scale:function(n){return 256*Math.pow(2,n)},zoom:function(n){return Math.log(n/256)/Math.LN2},getProjectedBounds:function(n){if(this.infinite)return null;var t=this.projection.bounds,i=this.scale(n);return new a(this.transformation.transform(t.min,i),this.transformation.transform(t.max,i))},infinite:!(h.prototype={equals:function(n,t){return!!n&&(n=y(n),Math.max(Math.abs(this.lat-n.lat),Math.abs(this.lng-n.lng))<=(void 0===t?1e-9:t))},toString:function(n){return"LatLng("+yt(this.lat,n)+", "+yt(this.lng,n)+")"},distanceTo:function(n){return ri.distance(this,y(n))},wrap:function(){return ri.wrapLatLng(this)},toBounds:function(n){var t=180*n/40075017,i=t/Math.cos(Math.PI/180*this.lat);return k([this.lat-t,this.lng-i],[this.lat+t,this.lng+i])},clone:function(){return new h(this.lat,this.lng,this.alt)}}),wrapLatLng:function(n){var t=this.wrapLng?lr(n.lng,this.wrapLng,!0):n.lng;return new h(this.wrapLat?lr(n.lat,this.wrapLat,!0):n.lat,t,n.alt)},wrapLatLngBounds:function(n){var t=n.getCenter(),e=this.wrapLatLng(t),i=t.lat-e.lat,r=t.lng-e.lng,u,f;return 0==i&&0==r?n:(u=n.getSouthWest(),f=n.getNorthEast(),new it(new h(u.lat-i,u.lng-r),new h(f.lat-i,f.lng-r)))}},ri=s({},gt,{wrapLng:[-180,180],R:6371e3,distance:function(n,t){var i=Math.PI/180,e=n.lat*i,o=t.lat*i,r=Math.sin((t.lat-n.lat)*i/2),u=Math.sin((t.lng-n.lng)*i/2),f=r*r+Math.cos(e)*Math.cos(o)*u*u,s=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f));return this.R*s}}),ws=6378137,gf={R:ws,MAX_LATITUDE:85.0511287798,project:function(n){var i=Math.PI/180,r=this.MAX_LATITUDE,f=Math.max(Math.min(r,n.lat),-r),u=Math.sin(f*i);return new t(this.R*n.lng*i,this.R*Math.log((1+u)/(1-u))/2)},unproject:function(n){var t=180/Math.PI;return new h((2*Math.atan(Math.exp(n.y/this.R))-Math.PI/2)*t,n.x*t/this.R)},bounds:(vr=ws*Math.PI,new a([-vr,-vr],[vr,vr]))};ne.prototype={transform:function(n,t){return this._transform(n.clone(),t)},_transform:function(n,t){return t=t||1,n.x=t*(this._a*n.x+this._b),n.y=t*(this._c*n.y+this._d),n},untransform:function(n,i){return i=i||1,new t((n.x/i-this._b)/this._a,(n.y/i-this._d)/this._c)}};hu=s({},ri,{code:"EPSG:3857",projection:gf,transformation:(te=.5/(Math.PI*gf.R),yr(te,.5,-te,.5))});bs=s({},hu,{code:"EPSG:900913"});var ie=document.documentElement.style,cu="ActiveXObject"in window,bi=cu&&!document.addEventListener,pr="msLaunchUri"in navigator&&!("documentMode"in document),re=wt("webkit"),ki=wt("android"),wr=wt("android 2")||wt("android 3"),yc=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),gs=ki&&wt("Google")&&yc<537&&!("AudioNode"in window),ue=!!window.opera,br=wt("chrome"),fe=wt("gecko")&&!re&&!ue&&!cu,nh=!br&&wt("safari"),th=wt("phantom"),ih="OTransition"in ie,rh=0===navigator.platform.indexOf("Win"),ee=cu&&"transition"in ie,oe="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!wr,uh="MozPerspective"in ie,rt=!window.L_DISABLE_3D&&(ee||oe||uh)&&!ih&&!th,di="undefined"!=typeof orientation||wt("mobile"),pc=di&&re,wc=di&&oe,ui=!window.PointerEvent&&window.MSPointerEvent,lt=!(!window.PointerEvent&&!ui),pt=!window.L_NO_TOUCH&&(lt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),fh=di&&ue,bc=di&&fe,fi=1<(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI),eh=!!document.createElement("canvas").getContext,lu=!(!document.createElementNS||!ks("svg").createSVGRect),au=!lu&&function(){var t,n;try{return t=document.createElement("div"),t.innerHTML='<v:shape adj="1"/>',n=t.firstChild,n.style.behavior="url(#default#VML)",n&&"object"==typeof n.adj}catch(t){return!1}}();var kc=(Object.freeze||Object)({ie:cu,ielt9:bi,edge:pr,webkit:re,android:ki,android23:wr,androidStock:gs,opera:ue,chrome:br,gecko:fe,safari:nh,phantom:th,opera12:ih,win:rh,ie3d:ee,webkit3d:oe,gecko3d:uh,any3d:rt,mobile:di,mobileWebkit:pc,mobileWebkit3d:wc,msPointer:ui,pointer:lt,touch:pt,mobileOpera:fh,mobileGecko:bc,retina:fi,canvas:eh,svg:lu,vml:au}),se=ui?"MSPointerDown":"pointerdown",he=ui?"MSPointerMove":"pointermove",ce=ui?"MSPointerUp":"pointerup",le=ui?"MSPointerCancel":"pointercancel",dc=["INPUT","SELECT","OPTION"],gi={},oh=!1,ae=0;var vu=ui?"MSPointerDown":lt?"pointerdown":"touchstart",yu=ui?"MSPointerUp":lt?"pointerup":"touchend",nr="_leaflet_";var kr,dr,ye,pu,pe,we=ku(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),gr=ku(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),hh="webkitTransition"===gr||"OTransition"===gr?gr+"End":"transitionend";"onselectstart"in document?(kr=function(){u(window,"selectstart",et)},dr=function(){w(window,"selectstart",et)}):(rr=ku(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]),kr=function(){if(rr){var n=document.documentElement.style;ye=n[rr];n[rr]="none"}},dr=function(){rr&&(document.documentElement.style[rr]=ye,ye=void 0)});ah=(Object.freeze||Object)({TRANSFORM:we,TRANSITION:gr,TRANSITION_END:hh,get:ch,getStyle:nu,create:e,remove:v,empty:wu,toFront:tr,toBack:ir,hasClass:be,addClass:i,removeClass:p,setClass:ke,getClass:bu,setOpacity:ut,testProp:ku,setTransform:si,setPosition:b,getPosition:ei,disableTextSelection:kr,enableTextSelection:dr,disableImageDrag:de,enableImageDrag:ge,preventOutline:no,restoreOutline:du,getSizedParentNode:lh,getScale:to});ft="_leaflet_events";yh=rh&&br?2*window.devicePixelRatio:fe?window.devicePixelRatio:1;nf={};var ul=(Object.freeze||Object)({on:u,off:w,stopPropagation:hi,disableScrollPropagation:ro,disableClickPropagation:tu,preventDefault:et,stop:bt,getMousePosition:vh,getWheelDelta:ph,fakeStop:fo,skipped:eo,isExternalTarget:tf,addListener:u,removeListener:w}),wh=wi.extend({run:function(n,t,i,r){this.stop();this._el=n;this._inProgress=!0;this._duration=i||.25;this._easeOutPower=1/Math.max(r||.5,.2);this._startPos=ei(n);this._offset=t.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=g(this._animate,this);this._step()},_step:function(n){var t=+new Date-this._startTime,i=1e3*this._duration;t<i?this._runFrame(this._easeOut(t/i),n):(this._runFrame(1),this._complete())},_runFrame:function(n,t){var i=this._startPos.add(this._offset.multiplyBy(n));t&&i._round();b(this._el,i);this.fire("step")},_complete:function(){nt(this._animId);this._inProgress=!1;this.fire("end")},_easeOut:function(n){return 1-Math.pow(1-n,this._easeOutPower)}}),f=wi.extend({options:{crs:hu,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(n,t){t=l(this,t);this._handlers=[];this._layers={};this._zoomBoundLayers={};this._sizeChanged=!0;this._initContainer(n);this._initLayout();this._onResize=c(this._onResize,this);this._initEvents();t.maxBounds&&this.setMaxBounds(t.maxBounds);void 0!==t.zoom&&(this._zoom=this._limitZoom(t.zoom));t.center&&void 0!==t.zoom&&this.setView(y(t.center),t.zoom,{reset:!0});this.callInitHooks();this._zoomAnimated=gr&&rt&&!fh&&this.options.zoomAnimation;this._zoomAnimated&&(this._createAnimProxy(),u(this._proxy,hh,this._catchTransitionEnd,this));this._addLayers(this.options.layers)},setView:function(n,t,i){return(t=void 0===t?this._zoom:this._limitZoom(t),n=this._limitCenter(y(n),t,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i)&&(void 0!==i.animate&&(i.zoom=s({animate:i.animate},i.zoom),i.pan=s({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==t?this._tryAnimatedZoom&&this._tryAnimatedZoom(n,t,i.zoom):this._tryAnimatedPan(n,i.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(n,t),this)},setZoom:function(n,t){return this._loaded?this.setView(this.getCenter(),n,{zoom:t}):(this._zoom=n,this)},zoomIn:function(n,t){return n=n||(rt?this.options.zoomDelta:1),this.setZoom(this._zoom+n,t)},zoomOut:function(n,t){return n=n||(rt?this.options.zoomDelta:1),this.setZoom(this._zoom-n,t)},setZoomAround:function(n,i,r){var f=this.getZoomScale(i),u=this.getSize().divideBy(2),e=(n instanceof t?n:this.latLngToContainerPoint(n)).subtract(u).multiplyBy(1-1/f),o=this.containerPointToLatLng(u.add(e));return this.setView(o,i,{zoom:r})},_getBoundsCenterZoom:function(n,t){t=t||{};n=n.getBounds?n.getBounds():k(n);var u=r(t.paddingTopLeft||t.padding||[0,0]),f=r(t.paddingBottomRight||t.padding||[0,0]),i=this.getBoundsZoom(n,!1,u.add(f));if((i="number"==typeof t.maxZoom?Math.min(t.maxZoom,i):i)===1/0)return{center:n.getCenter(),zoom:i};var e=f.subtract(u).divideBy(2),o=this.project(n.getSouthWest(),i),s=this.project(n.getNorthEast(),i);return{center:this.unproject(o.add(s).divideBy(2).add(e),i),zoom:i}},fitBounds:function(n,t){if(!(n=k(n)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(n,t);return this.setView(i.center,i.zoom,t)},fitWorld:function(n){return this.fitBounds([[-90,-180],[90,180]],n)},panTo:function(n,t){return this.setView(n,this._zoom,{pan:t})},panBy:function(n,t){if(t=t||{},!(n=r(n).round()).x&&!n.y)return this.fire("moveend");if(!0!==t.animate&&!this.getSize().contains(n))return this._resetView(this.unproject(this.project(this.getCenter()).add(n)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new wh,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),t.noMoveStart||this.fire("movestart"),!1!==t.animate){i(this._mapPane,"leaflet-pan-anim");var u=this._getMapPanePos().subtract(n).round();this._panAnim.run(this._mapPane,u,t.duration||.25,t.easeLinearity)}else this._rawPanBy(n),this.fire("move").fire("moveend");return this},flyTo:function(n,t,i){function p(n){var t=(l*l-r*r+(n?-1:1)*s*s*o*o)/(2*(n?l:r)*s*o),i=Math.sqrt(t*t+1)-t;return i<1e-9?-18:Math.log(i)}function w(n){return(Math.exp(n)-Math.exp(-n))/2}function h(n){return(Math.exp(n)+Math.exp(-n))/2}function k(n){return r*(h(u)*function(n){return w(n)/h(n)}(u+f*n)-w(u))/s}var u;if(!1===(i=i||{}).animate||!rt)return this.setView(n,t,i);this._stop();var c=this.project(this.getCenter()),a=this.project(n),v=this.getSize(),e=this._zoom;n=y(n);t=void 0===t?e:t;var r=Math.max(v.x,v.y),l=r*this.getZoomScale(e,t),o=a.distanceTo(c)||1,f=1.42,s=f*f;u=p(0);var d=Date.now(),b=(p(1)-u)/f,nt=i.duration?1e3*i.duration:1e3*b*.8;return this._moveStart(!0,i.noMoveStart),function i(){var s=(Date.now()-d)/nt,l=function(n){return 1-Math.pow(1-n,1.5)}(s)*b;s<=1?(this._flyToFrame=g(i,this),this._move(this.unproject(c.add(a.subtract(c).multiplyBy(k(l)/o)),e),this.getScaleZoom(r/function(n){return r*(h(u)/h(u+f*n))}(l),e),{flyTo:!0})):this._move(n,t)._moveEnd(!0)}.call(this),this},flyToBounds:function(n,t){var i=this._getBoundsCenterZoom(n,t);return this.flyTo(i.center,i.zoom,t)},setMaxBounds:function(n){return(n=k(n)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=n,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(n){var t=this.options.minZoom;return this.options.minZoom=n,this._loaded&&t!==n&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(n):this},setMaxZoom:function(n){var t=this.options.maxZoom;return this.options.maxZoom=n,this._loaded&&t!==n&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(n):this},panInsideBounds:function(n,t){this._enforcingBounds=!0;var i=this.getCenter(),r=this._limitCenter(i,this._zoom,k(n));return i.equals(r)||this.panTo(r,t),this._enforcingBounds=!1,this},panInside:function(n,t){var s=r((t=t||{}).paddingTopLeft||t.padding||[0,0]),h=r(t.paddingBottomRight||t.padding||[0,0]),a=this.getCenter(),c=this.project(a),i=this.project(n),l=this.getPixelBounds(),o=l.getSize().divideBy(2),e=ct([l.min.add(s),l.max.subtract(h)]),f,u;return e.contains(i)||(this._enforcingBounds=!0,f=c.subtract(i),u=r(i.x+f.x,i.y+f.y),(i.x<e.min.x||i.x>e.max.x)&&(u.x=c.x-f.x,0<f.x?u.x+=o.x-s.x:u.x-=o.x-h.x),(i.y<e.min.y||i.y>e.max.y)&&(u.y=c.y-f.y,0<f.y?u.y+=o.y-s.y:u.y-=o.y-h.y),this.panTo(this.unproject(u),t),this._enforcingBounds=!1),this},invalidateSize:function(n){var i;if(!this._loaded)return this;n=s({animate:!1,pan:!0},!0===n?{animate:!0}:n);i=this.getSize();this._sizeChanged=!0;this._lastCenter=null;var r=this.getSize(),u=i.divideBy(2).round(),f=r.divideBy(2).round(),t=u.subtract(f);return t.x||t.y?(n.animate&&n.pan?this.panBy(t):(n.pan&&this._rawPanBy(t),this.fire("move"),n.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(c(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:i,newSize:r})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(n){if(n=this._locateOptions=s({timeout:1e4,watch:!1},n),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var t=c(this._handleGeolocationResponse,this),i=c(this._handleGeolocationError,this);return n.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,i,n):navigator.geolocation.getCurrentPosition(t,i,n),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(n){var t=n.code,i=n.message||(1===t?"permission denied":2===t?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld();this.fire("locationerror",{code:t,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(n){var i=new h(n.coords.latitude,n.coords.longitude),e=i.toBounds(2*n.coords.accuracy),r=this._locateOptions,u,f,t;r.setView&&(u=this.getBoundsZoom(e),this.setView(i,r.maxZoom?Math.min(u,r.maxZoom):u));f={latlng:i,bounds:e,timestamp:n.timestamp};for(t in n.coords)"number"==typeof n.coords[t]&&(f[t]=n.coords[t]);this.fire("locationfound",f)},addHandler:function(n,t){if(!t)return this;var i=this[n]=new t(this);return this._handlers.push(i),this.options[n]&&i.enable(),this},remove:function(){if(this._initEvents(!0),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(n){this._container._leaflet_id=void 0;this._containerId=void 0}for(var n in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),v(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(nt(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[n].remove();for(n in this._panes)v(this._panes[n]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(n,t){var i=e("div","leaflet-pane"+(n?" leaflet-"+n.replace("Pane","")+"-pane":""),t||this._mapPane);return n&&(this._panes[n]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var n=this.getPixelBounds();return new it(this.unproject(n.getBottomLeft()),this.unproject(n.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(n,t,i){n=k(n);i=r(i||[0,0]);var u=this.getZoom()||0,c=this.getMinZoom(),l=this.getMaxZoom(),a=n.getNorthWest(),v=n.getSouthEast(),e=this.getSize().subtract(i),o=ct(this.project(v,u),this.project(a,u)).getSize(),f=rt?this.options.zoomSnap:1,s=e.x/o.x,h=e.y/o.y,y=t?Math.max(s,h):Math.min(s,h);return u=this.getScaleZoom(y,u),f&&(u=Math.round(u/(f/100))*(f/100),u=t?Math.ceil(u/f)*f:Math.floor(u/f)*f),Math.max(c,Math.min(l,u))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new t(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(n,t){var i=this._getTopLeftPoint(n,t);return new a(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(n){return this.options.crs.getProjectedBounds(void 0===n?this.getZoom():n)},getPane:function(n){return"string"==typeof n?this._panes[n]:n},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(n,t){var i=this.options.crs;return t=void 0===t?this._zoom:t,i.scale(n)/i.scale(t)},getScaleZoom:function(n,t){var r=this.options.crs,i;return t=void 0===t?this._zoom:t,i=r.zoom(n*r.scale(t)),isNaN(i)?1/0:i},project:function(n,t){return t=void 0===t?this._zoom:t,this.options.crs.latLngToPoint(y(n),t)},unproject:function(n,t){return t=void 0===t?this._zoom:t,this.options.crs.pointToLatLng(r(n),t)},layerPointToLatLng:function(n){var t=r(n).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(n){return this.project(y(n))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(n){return this.options.crs.wrapLatLng(y(n))},wrapLatLngBounds:function(n){return this.options.crs.wrapLatLngBounds(k(n))},distance:function(n,t){return this.options.crs.distance(y(n),y(t))},containerPointToLayerPoint:function(n){return r(n).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(n){return r(n).add(this._getMapPanePos())},containerPointToLatLng:function(n){var t=this.containerPointToLayerPoint(r(n));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(n){return this.layerPointToContainerPoint(this.latLngToLayerPoint(y(n)))},mouseEventToContainerPoint:function(n){return vh(n,this._container)},mouseEventToLayerPoint:function(n){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(n))},mouseEventToLatLng:function(n){return this.layerPointToLatLng(this.mouseEventToLayerPoint(n))},_initContainer:function(n){var t=this._container=ch(n);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");u(t,"scroll",this._onScroll,this);this._containerId=o(t)},_initLayout:function(){var t=this._container,n;this._fadeAnimated=this.options.fadeAnimation&&rt;i(t,"leaflet-container"+(pt?" leaflet-touch":"")+(fi?" leaflet-retina":"")+(bi?" leaflet-oldie":"")+(nh?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));n=nu(t,"position");"absolute"!==n&&"relative"!==n&&"fixed"!==n&&(t.style.position="relative");this._initPanes();this._initControlPos&&this._initControlPos()},_initPanes:function(){var n=this._panes={};this._paneRenderers={};this._mapPane=this.createPane("mapPane",this._container);b(this._mapPane,new t(0,0));this.createPane("tilePane");this.createPane("shadowPane");this.createPane("overlayPane");this.createPane("markerPane");this.createPane("tooltipPane");this.createPane("popupPane");this.options.markerZoomAnimation||(i(n.markerPane,"leaflet-zoom-hide"),i(n.shadowPane,"leaflet-zoom-hide"))},_resetView:function(n,i){var u,r;b(this._mapPane,new t(0,0));u=!this._loaded;this._loaded=!0;i=this._limitZoom(i);this.fire("viewprereset");r=this._zoom!==i;this._moveStart(r,!1)._move(n,i)._moveEnd(r);this.fire("viewreset");u&&this.fire("load")},_moveStart:function(n,t){return n&&this.fire("zoomstart"),t||this.fire("movestart"),this},_move:function(n,t,i){void 0===t&&(t=this._zoom);var r=this._zoom!==t;return this._zoom=t,this._lastCenter=n,this._pixelOrigin=this._getNewPixelOrigin(n),(r||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(n){return n&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return nt(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(n){b(this._mapPane,this._getMapPanePos().subtract(n))},_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(n){this._targets={};var t=n?w:u;t((this._targets[o(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this);this.options.trackResize&&t(window,"resize",this._onResize,this);rt&&this.options.transform3DLimit&&(n?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){nt(this._resizeRequest);this._resizeRequest=g(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0;this._container.scrollLeft=0},_onMoveEnd:function(){var n=this._getMapPanePos();Math.max(Math.abs(n.x),Math.abs(n.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(n,t){for(var r,u=[],f="mouseout"===t||"mouseover"===t,i=n.target||n.srcElement,e=!1;i;){if((r=this._targets[o(i)])&&("click"===t||"preclick"===t)&&!n._simulated&&this._draggableMoved(r)){e=!0;break}if(r&&r.listens(t,!0)){if(f&&!tf(i,n))break;if(u.push(r),f)break}if(i===this._container)break;i=i.parentNode}return u.length||e||f||!tf(i,n)||(u=[this]),u},_handleDOMEvent:function(n){if(this._loaded&&!eo(n)){var t=n.type;"mousedown"!==t&&"keypress"!==t&&"keyup"!==t&&"keydown"!==t||no(n.target||n.srcElement);this._fireDOMEvent(n,t)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(n,t,i){var e,u,r,o,f;if("click"===n.type&&(e=s({},n),e.type="preclick",this._fireDOMEvent(e,e.type,i)),!n._stopped&&(i=(i||[]).concat(this._findEventTargets(n,t))).length)for(u=i[0],"contextmenu"===t&&u.listens(t,!0)&&et(n),r={originalEvent:n},"keypress"!==n.type&&"keydown"!==n.type&&"keyup"!==n.type&&(o=u.getLatLng&&(!u._radius||u._radius<=10),r.containerPoint=o?this.latLngToContainerPoint(u.getLatLng()):this.mouseEventToContainerPoint(n),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=o?u.getLatLng():this.layerPointToLatLng(r.layerPoint)),f=0;f<i.length;f++)if(i[f].fire(t,r,!0),r.originalEvent._stopped||!1===i[f].options.bubblingMouseEvents&&-1!==vs(this._mouseEvents,t))return},_draggableMoved:function(n){return(n=n.dragging&&n.dragging.enabled()?n:this).dragging&&n.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var n=0,t=this._handlers.length;n<t;n++)this._handlers[n].disable()},whenReady:function(n,t){return this._loaded?n.call(t||this,{target:this}):this.on("load",n,t),this},_getMapPanePos:function(){return ei(this._mapPane)||new t(0,0)},_moved:function(){var n=this._getMapPanePos();return n&&!n.equals([0,0])},_getTopLeftPoint:function(n,t){return(n&&void 0!==t?this._getNewPixelOrigin(n,t):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(n,t){var i=this.getSize()._divideBy(2);return this.project(n,t)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(n,t,i){var r=this._getNewPixelOrigin(i,t);return this.project(n,t)._subtract(r)},_latLngBoundsToNewLayerBounds:function(n,t,i){var r=this._getNewPixelOrigin(i,t);return ct([this.project(n.getSouthWest(),t)._subtract(r),this.project(n.getNorthWest(),t)._subtract(r),this.project(n.getSouthEast(),t)._subtract(r),this.project(n.getNorthEast(),t)._subtract(r)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(n){return this.latLngToLayerPoint(n).subtract(this._getCenterLayerPoint())},_limitCenter:function(n,t,i){if(!i)return n;var r=this.project(n,t),u=this.getSize().divideBy(2),e=new a(r.subtract(u),r.add(u)),f=this._getBoundsOffset(e,i,t);return f.round().equals([0,0])?n:this.unproject(r.add(f),t)},_limitOffset:function(n,t){if(!t)return n;var i=this.getPixelBounds(),r=new a(i.min.add(n),i.max.add(n));return n.add(this._getBoundsOffset(r,t))},_getBoundsOffset:function(n,i,r){var u=ct(this.project(i.getNorthEast(),r),this.project(i.getSouthWest(),r)),f=u.min.subtract(n.min),e=u.max.subtract(n.max);return new t(this._rebound(f.x,-e.x),this._rebound(f.y,-e.y))},_rebound:function(n,t){return 0<n+t?Math.round(n-t)/2:Math.max(0,Math.ceil(n))-Math.max(0,Math.floor(t))},_limitZoom:function(n){var i=this.getMinZoom(),r=this.getMaxZoom(),t=rt?this.options.zoomSnap:1;return t&&(n=Math.round(n/t)*t),Math.max(i,Math.min(r,n))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){p(this._mapPane,"leaflet-pan-anim");this.fire("moveend")},_tryAnimatedPan:function(n,t){var i=this._getCenterOffset(n)._trunc();return!(!0!==(t&&t.animate)&&!this.getSize().contains(i))&&(this.panBy(i,t),!0)},_createAnimProxy:function(){var n=this._proxy=e("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(n);this.on("zoomanim",function(n){var t=we,i=this._proxy.style[t];si(this._proxy,this.project(n.center,n.zoom),this.getZoomScale(n.zoom,1));i===this._proxy.style[t]&&this._animatingZoom&&this._onZoomTransitionEnd()},this);this.on("load moveend",function(){var t=this.getCenter(),n=this.getZoom();si(this._proxy,this.project(t,n),this.getZoomScale(n,1))},this);this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){v(this._proxy);delete this._proxy},_catchTransitionEnd:function(n){this._animatingZoom&&0<=n.propertyName.indexOf("transform")&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(n,t,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),u=this._getCenterOffset(n)._divideBy(1-1/r);return!(!0!==i.animate&&!this.getSize().contains(u))&&(g(function(){this._moveStart(!0,!1)._animateZoom(n,t,!0)},this),!0)},_animateZoom:function(n,t,r,u){this._mapPane&&(r&&(this._animatingZoom=!0,this._animateToCenter=n,this._animateToZoom=t,i(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:n,zoom:t,noUpdate:u}),setTimeout(c(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&p(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),g(function(){this._moveEnd(!0)},this))}});ot=dt.extend({options:{position:"topright"},initialize:function(n){l(this,n)},getPosition:function(){return this.options.position},setPosition:function(n){var t=this._map;return t&&t.removeControl(this),this.options.position=n,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(n){this.remove();this._map=n;var t=this._container=this.onAdd(n),u=this.getPosition(),r=n._controlCorners[u];return i(t,"leaflet-control"),-1!==u.indexOf("bottom")?r.insertBefore(t,r.firstChild):r.appendChild(t),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(v(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(n){this._map&&n&&0<n.screenX&&0<n.screenY&&this._map.getContainer().focus()}});f.include({addControl:function(n){return n.addTo(this),this},removeControl:function(n){return n.remove(),this},_initControlPos:function(){function n(n,u){var f=t+n+" "+t+u;i[n+u]=e("div",f,r)}var i=this._controlCorners={},t="leaflet-",r=this._controlContainer=e("div",t+"control-container",this._container);n("top","left");n("top","right");n("bottom","left");n("bottom","right")},_clearControlPos:function(){for(var n in this._controlCorners)v(this._controlCorners[n]);v(this._controlContainer);delete this._controlCorners;delete this._controlContainer}});oo=ot.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(n,t,i,r){return i<r?-1:r<i?1:0}},initialize:function(n,t,i){for(var r in l(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,n)this._addLayer(n[r],r);for(r in t)this._addLayer(t[r],r,!0)},onAdd:function(n){this._initLayout();this._update();(this._map=n).on("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(n){return ot.prototype.addTo.call(this,n),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var n=0;n<this._layers.length;n++)this._layers[n].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(n,t){return this._addLayer(n,t),this._map?this._update():this},addOverlay:function(n,t){return this._addLayer(n,t,!0),this._map?this._update():this},removeLayer:function(n){n.off("add remove",this._onLayerChange,this);var t=this._getLayer(o(n));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){i(this._container,"leaflet-control-layers-expanded");this._section.style.height=null;var n=this._map.getSize().y-(this._container.offsetTop+50);return n<this._section.clientHeight?(i(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=n+"px"):p(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return p(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var n="leaflet-control-layers",t=this._container=e("div",n),f=this.options.collapsed,r,i;t.setAttribute("aria-haspopup",!0);tu(t);ro(t);r=this._section=e("section",n+"-list");f&&(this._map.on("click",this.collapse,this),ki||u(t,{mouseenter:this.expand,mouseleave:this.collapse},this));i=this._layersLink=e("a",n+"-toggle",t);i.href="#";i.title="Layers";pt?(u(i,"click",bt),u(i,"click",this.expand,this)):u(i,"focus",this.expand,this);f||this.expand();this._baseLayersList=e("div",n+"-base",r);this._separator=e("div",n+"-separator",r);this._overlaysList=e("div",n+"-overlays",r);t.appendChild(r)},_getLayer:function(n){for(var t=0;t<this._layers.length;t++)if(this._layers[t]&&o(this._layers[t].layer)===n)return this._layers[t]},_addLayer:function(n,t,i){this._map&&n.on("add remove",this._onLayerChange,this);this._layers.push({layer:n,name:t,overlay:i});this.options.sortLayers&&this._layers.sort(c(function(n,t){return this.options.sortFunction(n.layer,t.layer,n.name,t.name)},this));this.options.autoZIndex&&n.setZIndex&&(this._lastZIndex++,n.setZIndex(this._lastZIndex));this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;wu(this._baseLayersList);wu(this._overlaysList);this._layerControlInputs=[];for(var n,r,t,u=0,i=0;i<this._layers.length;i++)t=this._layers[i],this._addItem(t),r=r||t.overlay,n=n||!t.overlay,u+=t.overlay?0:1;return this.options.hideSingleBase&&(n=n&&1<u,this._baseLayersList.style.display=n?"":"none"),this._separator.style.display=r&&n?"":"none",this},_onLayerChange:function(n){this._handlingClick||this._update();var t=this._getLayer(o(n.target)),i=t.overlay?"add"===n.type?"overlayadd":"overlayremove":"add"===n.type?"baselayerchange":null;i&&this._map.fire(i,t)},_createRadioElement:function(n,t){var r='<input type="radio" class="leaflet-control-layers-selector" name="'+n+'"'+(t?' checked="checked"':"")+"/>",i=document.createElement("div");return i.innerHTML=r,i.firstChild},_addItem:function(n){var t,r=document.createElement("label"),e=this._map.hasLayer(n.layer),f,i;return n.overlay?((t=document.createElement("input")).type="checkbox",t.className="leaflet-control-layers-selector",t.defaultChecked=e):t=this._createRadioElement("leaflet-base-layers_"+o(this),e),this._layerControlInputs.push(t),t.layerId=o(n.layer),u(t,"click",this._onInputClick,this),f=document.createElement("span"),f.innerHTML=" "+n.name,i=document.createElement("div"),r.appendChild(i),i.appendChild(t),i.appendChild(f),(n.overlay?this._overlaysList:this._baseLayersList).appendChild(r),this._checkDisabledLayers(),r},_onInputClick:function(){var t,u,f=this._layerControlInputs,i=[],r=[],n;for(this._handlingClick=!0,n=f.length-1;0<=n;n--)t=f[n],u=this._getLayer(t.layerId).layer,t.checked?i.push(u):t.checked||r.push(u);for(n=0;n<r.length;n++)this._map.hasLayer(r[n])&&this._map.removeLayer(r[n]);for(n=0;n<i.length;n++)this._map.hasLayer(i[n])||this._map.addLayer(i[n]);this._handlingClick=!1;this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,n,r=this._layerControlInputs,u=this._map.getZoom(),i=r.length-1;0<=i;i--)t=r[i],n=this._getLayer(t.layerId).layer,t.disabled=void 0!==n.options.minZoom&&u<n.options.minZoom||void 0!==n.options.maxZoom&&u>n.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}});rf=ot.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(n){var i="leaflet-control-zoom",r=e("div",i+" leaflet-bar"),t=this.options;return this._zoomInButton=this._createButton(t.zoomInText,t.zoomInTitle,i+"-in",r,this._zoomIn),this._zoomOutButton=this._createButton(t.zoomOutText,t.zoomOutTitle,i+"-out",r,this._zoomOut),this._updateDisabled(),n.on("zoomend zoomlevelschange",this._updateDisabled,this),r},onRemove:function(n){n.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(n){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(n.shiftKey?3:1))},_zoomOut:function(n){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(n.shiftKey?3:1))},_createButton:function(n,t,i,r,f){var o=e("a",i,r);return o.innerHTML=n,o.href="#",o.title=t,o.setAttribute("role","button"),o.setAttribute("aria-label",t),tu(o),u(o,"click",bt),u(o,"click",f,this),u(o,"click",this._refocusOnMap,this),o},_updateDisabled:function(){var n=this._map,t="leaflet-disabled";p(this._zoomInButton,t);p(this._zoomOutButton,t);!this._disabled&&n._zoom!==n.getMinZoom()||i(this._zoomOutButton,t);!this._disabled&&n._zoom!==n.getMaxZoom()||i(this._zoomInButton,t)}});f.mergeOptions({zoomControl:!0});f.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new rf,this.addControl(this.zoomControl))});so=ot.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(n){var t="leaflet-control-scale",i=e("div",t),r=this.options;return this._addScales(r,t+"-line",i),n.on(r.updateWhenIdle?"moveend":"move",this._update,this),n.whenReady(this._update,this),i},onRemove:function(n){n.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(n,t,i){n.metric&&(this._mScale=e("div",t,i));n.imperial&&(this._iScale=e("div",t,i))},_update:function(){var n=this._map,t=n.getSize().y/2,i=n.distance(n.containerPointToLatLng([0,t]),n.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(i)},_updateScales:function(n){this.options.metric&&n&&this._updateMetric(n);this.options.imperial&&n&&this._updateImperial(n)},_updateMetric:function(n){var t=this._getRoundNum(n),i=t<1e3?t+" m":t/1e3+" km";this._updateScale(this._mScale,i,t/n)},_updateImperial:function(n){var i,r,u,t=3.2808399*n;5280<t?(i=t/5280,r=this._getRoundNum(i),this._updateScale(this._iScale,r+" mi",r/i)):(u=this._getRoundNum(t),this._updateScale(this._iScale,u+" ft",u/t))},_updateScale:function(n,t,i){n.style.width=Math.round(this.options.maxWidth*i)+"px";n.innerHTML=t},_getRoundNum:function(n){var i=Math.pow(10,(Math.floor(n)+"").length-1),t=n/i;return i*(t=10<=t?10:5<=t?5:3<=t?3:2<=t?2:1)}});uf=ot.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet<\/a>'},initialize:function(n){l(this,n);this._attributions={}},onAdd:function(n){for(var t in(n.attributionControl=this)._container=e("div","leaflet-control-attribution"),tu(this._container),n._layers)n._layers[t].getAttribution&&this.addAttribution(n._layers[t].getAttribution());return this._update(),this._container},setPrefix:function(n){return this.options.prefix=n,this._update(),this},addAttribution:function(n){return n&&(this._attributions[n]||(this._attributions[n]=0),this._attributions[n]++,this._update()),this},removeAttribution:function(n){return n&&this._attributions[n]&&(this._attributions[n]--,this._update()),this},_update:function(){var n,i,t;if(this._map){n=[];for(i in this._attributions)this._attributions[i]&&n.push(i);t=[];this.options.prefix&&t.push(this.options.prefix);n.length&&t.push(n.join(", "));this._container.innerHTML=t.join(" | ")}}});f.mergeOptions({attributionControl:!0});f.addInitHook(function(){this.options.attributionControl&&(new uf).addTo(this)});ot.Layers=oo;ot.Zoom=rf;ot.Scale=so;ot.Attribution=uf;iu.layers=function(n,t,i){return new oo(n,t,i)};iu.zoom=function(n){return new rf(n)};iu.scale=function(n){return new so(n)};iu.attribution=function(n){return new uf(n)};at=dt.extend({initialize:function(n){this._map=n},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}});at.addTo=function(n,t){return n.addHandler(t,this),this};var bh,fl={Events:tt},kh=pt?"touchstart mousedown":"mousedown",dh={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},ho={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},ci=wi.extend({options:{clickTolerance:3},initialize:function(n,t,i,r){l(this,r);this._element=n;this._dragStartTarget=t||n;this._preventOutline=i},enable:function(){this._enabled||(u(this._dragStartTarget,kh,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ci._dragging===this&&this.finishDrag(),w(this._dragStartTarget,kh,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(n){if(!n._simulated&&this._enabled&&(this._moved=!1,!be(this._element,"leaflet-zoom-anim")&&!(ci._dragging||n.shiftKey||1!==n.which&&1!==n.button&&!n.touches||((ci._dragging=this)._preventOutline&&no(this._element),de(),kr(),this._moving)))){this.fire("down");var i=n.touches?n.touches[0]:n,r=lh(this._element);this._startPoint=new t(i.clientX,i.clientY);this._parentScale=to(r);u(document,ho[n.type],this._onMove,this);u(document,dh[n.type],this._onUp,this)}},_onMove:function(n){if(!n._simulated&&this._enabled)if(n.touches&&1<n.touches.length)this._moved=!0;else{var u=n.touches&&1===n.touches.length?n.touches[0]:n,r=new t(u.clientX,u.clientY)._subtract(this._startPoint);(r.x||r.y)&&(Math.abs(r.x)+Math.abs(r.y)<this.options.clickTolerance||(r.x/=this._parentScale.x,r.y/=this._parentScale.y,et(n),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=ei(this._element).subtract(r),i(document.body,"leaflet-dragging"),this._lastTarget=n.target||n.srcElement,window.SVGElementInstance&&this._lastTarget instanceof SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),i(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(r),this._moving=!0,nt(this._animRequest),this._lastEvent=n,this._animRequest=g(this._updatePosition,this,!0)))}},_updatePosition:function(){var n={originalEvent:this._lastEvent};this.fire("predrag",n);b(this._element,this._newPos);this.fire("drag",n)},_onUp:function(n){!n._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var n in p(document.body,"leaflet-dragging"),this._lastTarget&&(p(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),ho)w(document,ho[n],this._onMove,this),w(document,dh[n],this._onUp,this);ge();dr();this._moved&&this._moving&&(nt(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)}));this._moving=!1;ci._dragging=!1}});rc=(Object.freeze||Object)({simplify:gh,pointToSegmentDistance:nc,closestPointOnSegment:function(n,t,i){return ru(n,t,i)},clipSegment:tc,_getEdgeIntersection:ff,_getBitCode:li,_sqClosestPointOnSegment:ru,isFlat:ni,_flat:ic});var co,el=(Object.freeze||Object)({clipPolygon:uc}),lo={project:function(n){return new t(n.lng,n.lat)},unproject:function(n){return new h(n.y,n.x)},bounds:new a([-180,-90],[180,90])},ao={R:6378137,R_MINOR:6356752.3142451793,bounds:new a([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(n){var u=Math.PI/180,r=this.R,i=n.lat*u,f=this.R_MINOR/r,e=Math.sqrt(1-f*f),o=e*Math.sin(i),s=Math.tan(Math.PI/4-i/2)/Math.pow((1-o)/(1+o),e/2);return i=-r*Math.log(Math.max(s,1e-10)),new t(n.lng*u*r,i)},unproject:function(n){for(var t,u=180/Math.PI,r=this.R,f=this.R_MINOR/r,e=Math.sqrt(1-f*f),o=Math.exp(-n.y/r),i=Math.PI/2-2*Math.atan(o),s=0,c=.1;s<15&&1e-7<Math.abs(c);s++)t=e*Math.sin(i),t=Math.pow((1-t)/(1+t),e/2),i+=c=Math.PI/2-2*Math.atan(o*t)-i;return new h(i*u,n.x*u/r)}},ol=(Object.freeze||Object)({LonLat:lo,Mercator:ao,SphericalMercator:gf}),sl=s({},ri,{code:"EPSG:3395",projection:ao,transformation:(co=.5/(Math.PI*ao.R),yr(co,.5,-co,.5))}),fc=s({},ri,{code:"EPSG:4326",projection:lo,transformation:yr(1/180,1,-1/180,.5)}),hl=s({},gt,{projection:lo,transformation:yr(1,0,-1,0),scale:function(n){return Math.pow(2,n)},zoom:function(n){return Math.log(n)/Math.LN2},distance:function(n,t){var i=t.lng-n.lng,r=t.lat-n.lat;return Math.sqrt(i*i+r*r)},infinite:!0});gt.Earth=ri;gt.EPSG3395=sl;gt.EPSG3857=hu;gt.EPSG900913=bs;gt.EPSG4326=fc;gt.Simple=hl;st=wi.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(n){return n.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(n){return n&&n.removeLayer(this),this},getPane:function(n){return this._map.getPane(n?this.options[n]||n:this.options.pane)},addInteractiveTarget:function(n){return this._map._targets[o(n)]=this},removeInteractiveTarget:function(n){return delete this._map._targets[o(n)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(n){var t=n.target,i;t.hasLayer(this)&&((this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents)&&(i=this.getEvents(),t.on(i,this),this.once("remove",function(){t.off(i,this)},this)),this.onAdd(t),this.getAttribution&&t.attributionControl&&t.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),t.fire("layeradd",{layer:this}))}});f.include({addLayer:function(n){if(!n._layerAdd)throw new Error("The provided object is not a Layer.");var t=o(n);return this._layers[t]||((this._layers[t]=n)._mapToAdd=this,n.beforeAdd&&n.beforeAdd(this),this.whenReady(n._layerAdd,n)),this},removeLayer:function(n){var t=o(n);return this._layers[t]&&(this._loaded&&n.onRemove(this),n.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(n.getAttribution()),delete this._layers[t],this._loaded&&(this.fire("layerremove",{layer:n}),n.fire("remove")),n._map=n._mapToAdd=null),this},hasLayer:function(n){return!!n&&o(n)in this._layers},eachLayer:function(n,t){for(var i in this._layers)n.call(t,this._layers[i]);return this},_addLayers:function(n){for(var t=0,i=(n=n?ht(n)?n:[n]:[]).length;t<i;t++)this.addLayer(n[t])},_addZoomLimit:function(n){!isNaN(n.options.maxZoom)&&isNaN(n.options.minZoom)||(this._zoomBoundLayers[o(n)]=n,this._updateZoomLevels())},_removeZoomLimit:function(n){var t=o(n);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var n=1/0,t=-1/0,u=this._getZoomSpan(),r,i;for(r in this._zoomBoundLayers)i=this._zoomBoundLayers[r].options,n=void 0===i.minZoom?n:Math.min(n,i.minZoom),t=void 0===i.maxZoom?t:Math.max(t,i.maxZoom);this._layersMaxZoom=t===-1/0?void 0:t;this._layersMinZoom=n===1/0?void 0:n;u!==this._getZoomSpan()&&this.fire("zoomlevelschange");void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom);void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var ur=st.extend({initialize:function(n,t){var i,r;if(l(this,t),this._layers={},n)for(i=0,r=n.length;i<r;i++)this.addLayer(n[i])},addLayer:function(n){var t=this.getLayerId(n);return this._layers[t]=n,this._map&&this._map.addLayer(n),this},removeLayer:function(n){var t=n in this._layers?n:this.getLayerId(n);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(n){return!!n&&(n in this._layers||this.getLayerId(n)in this._layers)},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(n){var i,t,r=Array.prototype.slice.call(arguments,1);for(i in this._layers)(t=this._layers[i])[n]&&t[n].apply(t,r);return this},onAdd:function(n){this.eachLayer(n.addLayer,n)},onRemove:function(n){this.eachLayer(n.removeLayer,n)},eachLayer:function(n,t){for(var i in this._layers)n.call(t,this._layers[i]);return this},getLayer:function(n){return this._layers[n]},getLayers:function(){var n=[];return this.eachLayer(n.push,n),n},setZIndex:function(n){return this.invoke("setZIndex",n)},getLayerId:function(n){return o(n)}}),fr=ur.extend({addLayer:function(n){return this.hasLayer(n)?this:(n.addEventParent(this),ur.prototype.addLayer.call(this,n),this.fire("layeradd",{layer:n}))},removeLayer:function(n){return this.hasLayer(n)?(n in this._layers&&(n=this._layers[n]),n.removeEventParent(this),ur.prototype.removeLayer.call(this,n),this.fire("layerremove",{layer:n})):this},setStyle:function(n){return this.invoke("setStyle",n)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new it,i,n;for(i in this._layers)n=this._layers[i],t.extend(n.getBounds?n.getBounds():n.getLatLng());return t}}),er=dt.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(n){l(this,n)},createIcon:function(n){return this._createIcon("icon",n)},createShadow:function(n){return this._createIcon("shadow",n)},_createIcon:function(n,t){var r=this._getIconUrl(n),i;if(!r){if("icon"===n)throw new Error("iconUrl not set in Icon options (see the docs).");return null}return i=this._createImg(r,t&&"IMG"===t.tagName?t:null),this._setIconStyles(i,n),i},_setIconStyles:function(n,t){var f=this.options,u=f[t+"Size"],i,e;"number"==typeof u&&(u=[u,u]);i=r(u);e=r("shadow"===t&&f.shadowAnchor||f.iconAnchor||i&&i.divideBy(2,!0));n.className="leaflet-marker-"+t+" "+(f.className||"");e&&(n.style.marginLeft=-e.x+"px",n.style.marginTop=-e.y+"px");i&&(n.style.width=i.x+"px",n.style.height=i.y+"px")},_createImg:function(n,t){return(t=t||document.createElement("img")).src=n,t},_getIconUrl:function(n){return fi&&this.options[n+"RetinaUrl"]||this.options[n+"Url"]}}),uu=er.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(n){return uu.imagePath||(uu.imagePath=this._detectIconPath()),(this.options.imagePath||uu.imagePath)+er.prototype._getIconUrl.call(this,n)},_detectIconPath:function(){var t=e("div","leaflet-default-icon-path",document.body),n=nu(t,"background-image")||nu(t,"backgroundImage");return document.body.removeChild(t),n=null===n||0!==n.indexOf("url")?"":n.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),ec=at.extend({initialize:function(n){this._marker=n},addHooks:function(){var n=this._marker._icon;this._draggable||(this._draggable=new ci(n,n,!0));this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable();i(n,"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&&p(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(n){var e=this._marker,o=e._map,c=this._marker.options.autoPanSpeed,s=this._marker.options.autoPanPadding,u=ei(e._icon),i=o.getPixelBounds(),h=o.getPixelOrigin(),t=ct(i.min._subtract(h).add(s),i.max._subtract(h).subtract(s)),f;t.contains(u)||(f=r((Math.max(t.max.x,u.x)-t.max.x)/(i.max.x-t.max.x)-(Math.min(t.min.x,u.x)-t.min.x)/(i.min.x-t.min.x),(Math.max(t.max.y,u.y)-t.max.y)/(i.max.y-t.max.y)-(Math.min(t.min.y,u.y)-t.min.y)/(i.min.y-t.min.y)).multiplyBy(c),o.panBy(f,{animate:!1}),this._draggable._newPos._add(f),this._draggable._startPos._add(f),b(e._icon,this._draggable._newPos),this._onDrag(n),this._panRequest=g(this._adjustPan.bind(this,n)))},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng();this._marker.closePopup().fire("movestart").fire("dragstart")},_onPreDrag:function(n){this._marker.options.autoPan&&(nt(this._panRequest),this._panRequest=g(this._adjustPan.bind(this,n)))},_onDrag:function(n){var t=this._marker,i=t._shadow,r=ei(t._icon),u=t._map.layerPointToLatLng(r);i&&b(i,r);t._latlng=u;n.latlng=u;n.oldLatLng=this._oldLatLng;t.fire("move",n).fire("drag",n)},_onDragEnd:function(n){nt(this._panRequest);delete this._oldLatLng;this._marker.fire("moveend").fire("dragend",n)}}),fu=st.extend({options:{icon:new uu,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(n,t){l(this,t);this._latlng=y(n)},onAdd:function(n){this._zoomAnimated=this._zoomAnimated&&n.options.markerZoomAnimation;this._zoomAnimated&&n.on("zoomanim",this._animateZoom,this);this._initIcon();this.update()},onRemove:function(n){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks());delete this.dragging;this._zoomAnimated&&n.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(n){var t=this._latlng;return this._latlng=y(n),this.update(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},setZIndexOffset:function(n){return this.options.zIndexOffset=n,this.update()},getIcon:function(){return this.options.icon},setIcon:function(n){return this.options.icon=n,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 n=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(n)}return this},_initIcon:function(){var n=this.options,f="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),t=n.icon.createIcon(this._icon),e=!1,r,u;t!==this._icon&&(this._icon&&this._removeIcon(),e=!0,n.title&&(t.title=n.title),"IMG"===t.tagName&&(t.alt=n.alt||""));i(t,f);n.keyboard&&(t.tabIndex="0");this._icon=t;n.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});r=n.icon.createShadow(this._shadow);u=!1;r!==this._shadow&&(this._removeShadow(),u=!0);r&&(i(r,f),r.alt="");this._shadow=r;n.opacity<1&&this._updateOpacity();e&&this.getPane().appendChild(this._icon);this._initInteraction();r&&u&&this.getPane(n.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex});v(this._icon);this.removeInteractiveTarget(this._icon);this._icon=null},_removeShadow:function(){this._shadow&&v(this._shadow);this._shadow=null},_setPos:function(n){b(this._icon,n);this._shadow&&b(this._shadow,n);this._zIndex=n.y+this.options.zIndexOffset;this._resetZIndex()},_updateZIndex:function(n){this._icon.style.zIndex=this._zIndex+n},_animateZoom:function(n){var t=this._map._latLngToNewLayerPoint(this._latlng,n.zoom,n.center).round();this._setPos(t)},_initInteraction:function(){if(this.options.interactive&&(i(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),ec)){var n=this.options.draggable;this.dragging&&(n=this.dragging.enabled(),this.dragging.disable());this.dragging=new ec(this);n&&this.dragging.enable()}},setOpacity:function(n){return this.options.opacity=n,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var n=this.options.opacity;this._icon&&ut(this._icon,n);this._shadow&&ut(this._shadow,n)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}}),oi=st.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(n){this._renderer=n.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(n){return l(this,n),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&n.hasOwnProperty("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}}),ef=oi.extend({options:{fill:!0,radius:10},initialize:function(n,t){l(this,t);this._latlng=y(n);this._radius=this.options.radius},setLatLng:function(n){return this._latlng=y(n),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(n){return this.options.radius=this._radius=n,this.redraw()},getRadius:function(){return this._radius},setStyle:function(n){var t=n&&n.radius||this._radius;return oi.prototype.setStyle.call(this,n),this.setRadius(t),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng);this._updateBounds()},_updateBounds:function(){var n=this._radius,r=this._radiusY||n,t=this._clickTolerance(),i=[n+t,r+t];this._pxBounds=new a(this._point.subtract(i),this._point.add(i))},_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(n){return n.distanceTo(this._point)<=this._radius+this._clickTolerance()}}),vo=ef.extend({initialize:function(n,t,i){if("number"==typeof t&&(t=s({},i,{radius:t})),l(this,t),this._latlng=y(n),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(n){return this._mRadius=n,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var n=[this._radius,this._radiusY||this._radius];return new it(this._map.layerPointToLatLng(this._point.subtract(n)),this._map.layerPointToLatLng(this._point.add(n)))},setStyle:oi.prototype.setStyle,_project:function(){var e=this._latlng.lng,i=this._latlng.lat,n=this._map,o=n.options.crs,c;if(o.distance===ri.distance){var t=Math.PI/180,u=this._mRadius/ri.R/t,h=n.project([i+u,e]),l=n.project([i-u,e]),f=h.add(l).divideBy(2),s=n.unproject(f).lat,r=Math.acos((Math.cos(u*t)-Math.sin(i*t)*Math.sin(s*t))/(Math.cos(i*t)*Math.cos(s*t)))/t;(isNaN(r)||0===r)&&(r=u/Math.cos(Math.PI/180*i));this._point=f.subtract(n.getPixelOrigin());this._radius=isNaN(r)?0:f.x-n.project([s,e-r]).x;this._radiusY=f.y-h.y}else c=o.unproject(o.project(this._latlng).subtract([this._mRadius,0])),this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(c).x;this._updateBounds()}}),ti=oi.extend({options:{smoothFactor:1,noClip:!1},initialize:function(n,t){l(this,t);this._setLatLngs(n)},getLatLngs:function(){return this._latlngs},setLatLngs:function(n){return this._setLatLngs(n),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(n){for(var e,o,s,r=1/0,t=null,h=ru,u=0,c=this._parts.length;u<c;u++)for(var f=this._parts[u],i=1,l=f.length;i<l;i++)e=h(n,o=f[i-1],s=f[i],!0),e<r&&(r=e,t=h(n,o,s));return t&&(t.distance=Math.sqrt(r)),t},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var n,r,s,f,u,t,e,i=this._rings[0],o=i.length;if(!o)return null;for(r=n=0;n<o-1;n++)r+=i[n].distanceTo(i[n+1])/2;if(0===r)return this._map.layerPointToLatLng(i[0]);for(f=n=0;n<o-1;n++)if(u=i[n],t=i[n+1],r<(f+=s=u.distanceTo(t)))return e=(f-r)/s,this._map.layerPointToLatLng([t.x-e*(t.x-u.x),t.y-e*(t.y-u.y)])},getBounds:function(){return this._bounds},addLatLng:function(n,t){return t=t||this._defaultShape(),n=y(n),t.push(n),this._bounds.extend(n),this.redraw()},_setLatLngs:function(n){this._bounds=new it;this._latlngs=this._convertLatLngs(n)},_defaultShape:function(){return ni(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(n){for(var i=[],r=ni(n),t=0,u=n.length;t<u;t++)r?(i[t]=y(n[t]),this._bounds.extend(i[t])):i[t]=this._convertLatLngs(n[t]);return i},_project:function(){var n=new a;this._rings=[];this._projectLatlngs(this._latlngs,this._rings,n);this._bounds.isValid()&&n.isValid()&&(this._rawPxBounds=n,this._updateBounds())},_updateBounds:function(){var n=this._clickTolerance(),i=new t(n,n);this._pxBounds=new a([this._rawPxBounds.min.subtract(i),this._rawPxBounds.max.add(i)])},_projectLatlngs:function(n,t,i){var r,u,e=n[0]instanceof h,f=n.length;if(e){for(u=[],r=0;r<f;r++)u[r]=this._map.latLngToLayerPoint(n[r]),i.extend(u[r]);t.push(u)}else for(r=0;r<f;r++)this._projectLatlngs(n[r],t,i)},_clipPoints:function(){var o=this._renderer._bounds,r,n,t,s,e,u,f,i;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(o))if(this.options.noClip)this._parts=this._rings;else for(i=this._parts,t=r=0,s=this._rings.length;r<s;r++)for(n=0,e=(f=this._rings[r]).length;n<e-1;n++)(u=tc(f[n],f[n+1],o,n,!0))&&(i[t]=i[t]||[],i[t].push(u[0]),u[1]===f[n+1]&&n!==e-2||(i[t].push(u[1]),t++))},_simplifyPoints:function(){for(var t=this._parts,i=this.options.smoothFactor,n=0,r=t.length;n<r;n++)t[n]=gh(t[n],i)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(n,t){var r,i,u,e,o,f,s=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(n))return!1;for(r=0,e=this._parts.length;r<e;r++)for(i=0,u=(o=(f=this._parts[r]).length)-1;i<o;u=i++)if((t||0!==i)&&nc(n,f[u],f[i])<=s)return!0;return!1}});ti._flat=ic;ai=ti.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()");var r,e,n,t,u,i,o,s,c,f=this._rings[0],h=f.length;if(!h)return null;for(i=o=s=0,r=0,e=h-1;r<h;e=r++)n=f[r],t=f[e],u=n.y*t.x-t.y*n.x,o+=(n.x+t.x)*u,s+=(n.y+t.y)*u,i+=3*u;return c=0===i?f[0]:[o/i,s/i],this._map.layerPointToLatLng(c)},_convertLatLngs:function(n){var t=ti.prototype._convertLatLngs.call(this,n),i=t.length;return 2<=i&&t[0]instanceof h&&t[0].equals(t[i-1])&&t.pop(),t},_setLatLngs:function(n){ti.prototype._setLatLngs.call(this,n);ni(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return ni(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var n=this._renderer._bounds,r=this.options.weight,u=new t(r,r),f,i,e;if(n=new a(n.min.subtract(u),n.max.add(u)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(n))if(this.options.noClip)this._parts=this._rings;else for(i=0,e=this._rings.length;i<e;i++)(f=uc(this._rings[i],n,!0)).length&&this._parts.push(f)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(n){var f,t,i,r,u,e,s,h,o=!1;if(!this._pxBounds||!this._pxBounds.contains(n))return!1;for(r=0,s=this._parts.length;r<s;r++)for(u=0,e=(h=(f=this._parts[r]).length)-1;u<h;e=u++)t=f[u],i=f[e],t.y>n.y!=i.y>n.y&&n.x<(i.x-t.x)*(n.y-t.y)/(i.y-t.y)+t.x&&(o=!o);return o||ti.prototype._containsPoint.call(this,n,!0)}});kt=fr.extend({initialize:function(n,t){l(this,t);this._layers={};n&&this.addData(n)},addData:function(n){var u,e,r,f=ht(n)?n:n.features,i,t;if(f){for(u=0,e=f.length;u<e;u++)((r=f[u]).geometries||r.geometry||r.features||r.coordinates)&&this.addData(r);return this}return(i=this.options,i.filter&&!i.filter(n))?this:(t=yo(n,i),t?(t.feature=hf(n),t.defaultOptions=t.options,this.resetStyle(t),i.onEachFeature&&i.onEachFeature(n,t),this.addLayer(t)):this)},resetStyle:function(n){return n.options=s({},n.defaultOptions),this._setLayerStyle(n,this.options.style),this},setStyle:function(n){return this.eachLayer(function(t){this._setLayerStyle(t,n)},this)},_setLayerStyle:function(n,t){n.setStyle&&("function"==typeof t&&(t=t(n.feature)),n.setStyle(t))}});cf={toGeoJSON:function(n){return or(this,{type:"Point",coordinates:wo(this.getLatLng(),n)})}};fu.include(cf);vo.include(cf);ef.include(cf);ti.include({toGeoJSON:function(n){var t=!ni(this._latlngs);return or(this,{type:(t?"Multi":"")+"LineString",coordinates:sf(this._latlngs,t?1:0,!1,n)})}});ai.include({toGeoJSON:function(n){var t=!ni(this._latlngs),r=t&&!ni(this._latlngs[0]),i=sf(this._latlngs,r?2:t?1:0,!0,n);return t||(i=[i]),or(this,{type:(r?"Multi":"")+"Polygon",coordinates:i})}});ur.include({toMultiPoint:function(n){var t=[];return this.eachLayer(function(i){t.push(i.toGeoJSON(n).geometry.coordinates)}),or(this,{type:"MultiPoint",coordinates:t})},toGeoJSON:function(n){var r=this.feature&&this.feature.geometry&&this.feature.geometry.type,i,t;return"MultiPoint"===r?this.toMultiPoint(n):(i="GeometryCollection"===r,t=[],this.eachLayer(function(r){var f,u;r.toGeoJSON&&(f=r.toGeoJSON(n),i?t.push(f.geometry):(u=hf(f),"FeatureCollection"===u.type?t.push.apply(t,u.features):t.push(u)))}),i?or(this,{geometries:t,type:"GeometryCollection"}):{type:"FeatureCollection",features:t})}});var cl=oc,lf=st.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(n,t,i){this._url=n;this._bounds=k(t);l(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity());this.options.interactive&&(i(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image));this.getPane().appendChild(this._image);this._reset()},onRemove:function(){v(this._image);this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(n){return this.options.opacity=n,this._image&&this._updateOpacity(),this},setStyle:function(n){return n.opacity&&this.setOpacity(n.opacity),this},bringToFront:function(){return this._map&&tr(this._image),this},bringToBack:function(){return this._map&&ir(this._image),this},setUrl:function(n){return this._url=n,this._image&&(this._image.src=n),this},setBounds:function(n){return this._bounds=k(n),this._map&&this._reset(),this},getEvents:function(){var n={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(n.zoomanim=this._animateZoom),n},setZIndex:function(n){return this.options.zIndex=n,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,n=this._image=t?this._url:e("img");i(n,"leaflet-image-layer");this._zoomAnimated&&i(n,"leaflet-zoom-animated");this.options.className&&i(n,this.options.className);n.onselectstart=d;n.onmousemove=d;n.onload=c(this.fire,this,"load");n.onerror=c(this._overlayOnError,this,"error");!this.options.crossOrigin&&""!==this.options.crossOrigin||(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin);this.options.zIndex&&this._updateZIndex();t?this._url=n.src:(n.src=this._url,n.alt=this.options.alt)},_animateZoom:function(n){var t=this._map.getZoomScale(n.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,n.zoom,n.center).min;si(this._image,i,t)},_reset:function(){var n=this._image,t=new a(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=t.getSize();b(n,t.min);n.style.width=i.x+"px";n.style.height=i.y+"px"},_updateOpacity:function(){ut(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var n=this.options.errorOverlayUrl;n&&this._url!==n&&(this._url=n,this._image.src=n)}}),sc=lf.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0},_initImage:function(){var o="VIDEO"===this._url.tagName,n=this._image=o?this._url:e("video"),t,f;if(i(n,"leaflet-image-layer"),this._zoomAnimated&&i(n,"leaflet-zoom-animated"),n.onselectstart=d,n.onmousemove=d,n.onloadeddata=c(this.fire,this,"load"),o){for(var r=n.getElementsByTagName("source"),s=[],u=0;u<r.length;u++)s.push(r[u].src);this._url=0<r.length?s:[n.src]}else for(ht(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&n.style.hasOwnProperty("objectFit")&&(n.style.objectFit="fill"),n.autoplay=!!this.options.autoplay,n.loop=!!this.options.loop,t=0;t<this._url.length;t++)f=e("source"),f.src=this._url[t],n.appendChild(f)}}),hc=lf.extend({_initImage:function(){var n=this._image=this._url;i(n,"leaflet-image-layer");this._zoomAnimated&&i(n,"leaflet-zoom-animated");n.onselectstart=d;n.onmousemove=d}}),ii=st.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(n,t){l(this,n);this._source=t},onAdd:function(n){this._zoomAnimated=n._zoomAnimated;this._container||this._initLayout();n._fadeAnimated&&ut(this._container,0);clearTimeout(this._removeTimeout);this.getPane().appendChild(this._container);this.update();n._fadeAnimated&&ut(this._container,1);this.bringToFront()},onRemove:function(n){n._fadeAnimated?(ut(this._container,0),this._removeTimeout=setTimeout(c(v,void 0,this._container),200)):v(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(n){return this._latlng=y(n),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(n){return this._content=n,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 n={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(n.zoomanim=this._animateZoom),n},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&tr(this._container),this},bringToBack:function(){return this._map&&ir(this._container),this},_prepareOpen:function(n,t,i){if(t instanceof st||(i=t,t=n),t instanceof fr)for(var r in n._layers){t=n._layers[r];break}if(!i)if(t.getCenter)i=t.getCenter();else{if(!t.getLatLng)throw new Error("Unable to get source layer LatLng.");i=t.getLatLng()}return this._source=t,this.update(),i},_updateContent:function(){if(this._content){var n=this._contentNode,t="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof t)n.innerHTML=t;else{for(;n.hasChildNodes();)n.removeChild(n.firstChild);n.appendChild(t)}this.fire("contentupdate")}},_updatePosition:function(){var u,f;if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),n=r(this.options.offset),i=this._getAnchor();this._zoomAnimated?b(this._container,t.add(i)):n=n.add(t).add(i);u=this._containerBottom=-n.y;f=this._containerLeft=-Math.round(this._containerWidth/2)+n.x;this._container.style.bottom=u+"px";this._container.style.left=f+"px"}},_getAnchor:function(){return[0,0]}}),sr=ii.extend({options:{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(n){return n.openPopup(this),this},onAdd:function(n){ii.prototype.onAdd.call(this,n);n.fire("popupopen",{popup:this});this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof oi||this._source.on("preclick",hi))},onRemove:function(n){ii.prototype.onRemove.call(this,n);n.fire("popupclose",{popup:this});this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof oi||this._source.off("preclick",hi))},getEvents:function(){var n=ii.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(n.preclick=this._close),this.options.keepInView&&(n.moveend=this._adjustPan),n},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var n="leaflet-popup",i=this._container=e("div",n+" "+(this.options.className||"")+" leaflet-zoom-animated"),r=this._wrapper=e("div",n+"-content-wrapper",i),t;(this._contentNode=e("div",n+"-content",r),tu(r),ro(this._contentNode),u(r,"contextmenu",hi),this._tipContainer=e("div",n+"-tip-container",i),this._tip=e("div",n+"-tip",this._tipContainer),this.options.closeButton)&&(t=this._closeButton=e("a",n+"-close-button",i),t.href="#close",t.innerHTML="&#215;",u(t,"click",this._onCloseButtonClick,this))},_updateLayout:function(){var r=this._contentNode,n=r.style,t;n.width="";n.whiteSpace="nowrap";t=r.offsetWidth;t=Math.min(t,this.options.maxWidth);t=Math.max(t,this.options.minWidth);n.width=t+1+"px";n.whiteSpace="";n.height="";var e=r.offsetHeight,u=this.options.maxHeight,f="leaflet-popup-scrolled";u&&u<e?(n.height=u+"px",i(r,f)):p(r,f);this._containerWidth=this._container.offsetWidth},_animateZoom:function(n){var t=this._map._latLngToNewLayerPoint(this._latlng,n.zoom,n.center),i=this._getAnchor();b(this._container,t.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var s=this._map,v=parseInt(nu(this._container,"marginBottom"),10)||0,h=this._container.offsetHeight+v,c=this._containerWidth,l=new t(this._containerLeft,-h-this._containerBottom);l._add(ei(this._container));var n=s.layerPointToContainerPoint(l),a=r(this.options.autoPanPadding),f=r(this.options.autoPanPaddingTopLeft||a),e=r(this.options.autoPanPaddingBottomRight||a),o=s.getSize(),i=0,u=0;n.x+c+e.x>o.x&&(i=n.x+c-o.x+e.x);n.x-i-f.x<0&&(i=n.x-f.x);n.y+h+e.y>o.y&&(u=n.y+h-o.y+e.y);n.y-u-f.y<0&&(u=n.y-f.y);(i||u)&&s.fire("autopanstart").panBy([i,u])}},_onCloseButtonClick:function(n){this._close();bt(n)},_getAnchor:function(){return r(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});f.mergeOptions({closePopupOnClick:!0});f.include({openPopup:function(n,t,i){return n instanceof sr||(n=new sr(i).setContent(n)),t&&n.setLatLng(t),this.hasLayer(n)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=n,this.addLayer(n))},closePopup:function(n){return n&&n!==this._popup||(n=this._popup,this._popup=null),n&&this.removeLayer(n),this}});st.include({bindPopup:function(n,t){return n instanceof sr?(l(n,t),(this._popup=n)._source=this):(this._popup&&!t||(this._popup=new sr(t,this)),this._popup.setContent(n)),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(n,t){return this._popup&&this._map&&(t=this._popup._prepareOpen(this,n,t),this._map.openPopup(this._popup,t)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(n){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(n)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(n){return this._popup&&this._popup.setContent(n),this},getPopup:function(){return this._popup},_openPopup:function(n){var t=n.layer||n.target;this._popup&&this._map&&(bt(n),t instanceof oi?this.openPopup(n.layer||n.target,n.latlng):this._map.hasLayer(this._popup)&&this._popup._source===t?this.closePopup():this.openPopup(t,n.latlng))},_movePopup:function(n){this._popup.setLatLng(n.latlng)},_onKeyPress:function(n){13===n.originalEvent.keyCode&&this._openPopup(n)}});vi=ii.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(n){ii.prototype.onAdd.call(this,n);this.setOpacity(this.options.opacity);n.fire("tooltipopen",{tooltip:this});this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(n){ii.prototype.onRemove.call(this,n);n.fire("tooltipclose",{tooltip:this});this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var n=ii.prototype.getEvents.call(this);return pt&&!this.options.permanent&&(n.preclick=this._close),n},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var n="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=e("div",n)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(n){var h=this._map,u=this._container,c=h.latLngToContainerPoint(h.getCenter()),l=h.layerPointToContainerPoint(n),f=this.options.direction,o=u.offsetWidth,s=u.offsetHeight,t=r(this.options.offset),e=this._getAnchor();n="top"===f?n.add(r(-o/2+t.x,-s+t.y+e.y,!0)):"bottom"===f?n.subtract(r(o/2-t.x,-t.y,!0)):"center"===f?n.subtract(r(o/2+t.x,s/2-e.y+t.y,!0)):"right"===f||"auto"===f&&l.x<c.x?(f="right",n.add(r(t.x+e.x,e.y-s/2+t.y,!0))):(f="left",n.subtract(r(o+e.x-t.x,s/2-e.y-t.y,!0)));p(u,"leaflet-tooltip-right");p(u,"leaflet-tooltip-left");p(u,"leaflet-tooltip-top");p(u,"leaflet-tooltip-bottom");i(u,"leaflet-tooltip-"+f);b(u,n)},_updatePosition:function(){var n=this._map.latLngToLayerPoint(this._latlng);this._setPosition(n)},setOpacity:function(n){this.options.opacity=n;this._container&&ut(this._container,n)},_animateZoom:function(n){var t=this._map._latLngToNewLayerPoint(this._latlng,n.zoom,n.center);this._setPosition(t)},_getAnchor:function(){return r(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}});f.include({openTooltip:function(n,t,i){return n instanceof vi||(n=new vi(i).setContent(n)),t&&n.setLatLng(t),this.hasLayer(n)?this:this.addLayer(n)},closeTooltip:function(n){return n&&this.removeLayer(n),this}});st.include({bindTooltip:function(n,t){return n instanceof vi?(l(n,t),(this._tooltip=n)._source=this):(this._tooltip&&!t||(this._tooltip=new vi(t,this)),this._tooltip.setContent(n)),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(n){if(n||!this._tooltipHandlersAdded){var i=n?"off":"on",t={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?t.add=this._openTooltip:(t.mouseover=this._openTooltip,t.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(t.mousemove=this._moveTooltip),pt&&(t.click=this._openTooltip));this[i](t);this._tooltipHandlersAdded=!n}},openTooltip:function(n,t){return this._tooltip&&this._map&&(t=this._tooltip._prepareOpen(this,n,t),this._map.openTooltip(this._tooltip,t),this._tooltip.options.interactive&&this._tooltip._container&&(i(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(p(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(n){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(n)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(n){return this._tooltip&&this._tooltip.setContent(n),this},getTooltip:function(){return this._tooltip},_openTooltip:function(n){var t=n.layer||n.target;this._tooltip&&this._map&&this.openTooltip(t,this._tooltip.options.sticky?n.latlng:void 0)},_moveTooltip:function(n){var t,i,r=n.latlng;this._tooltip.options.sticky&&n.originalEvent&&(t=this._map.mouseEventToContainerPoint(n.originalEvent),i=this._map.containerPointToLayerPoint(t),r=this._map.layerPointToLatLng(i));this._tooltip.setLatLng(r)}});bo=er.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(n){var t=n&&"DIV"===n.tagName?n:document.createElement("div"),i=this.options,u;return(i.html instanceof Element?(wu(t),t.appendChild(i.html)):t.innerHTML=!1!==i.html?i.html:"",i.bgPos)&&(u=r(i.bgPos),t.style.backgroundPosition=-u.x+"px "+-u.y+"px"),this._setIconStyles(t,"icon"),t},createShadow:function(){return null}});er.Default=uu;hr=st.extend({options:{tileSize:256,opacity:1,updateWhenIdle:di,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(n){l(this,n)},onAdd:function(){this._initContainer();this._levels={};this._tiles={};this._resetView();this._update()},beforeAdd:function(n){n._addZoomLimit(this)},onRemove:function(n){this._removeAllTiles();v(this._container);n._removeZoomLimit(this);this._container=null;this._tileZoom=void 0},bringToFront:function(){return this._map&&(tr(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(ir(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(n){return this.options.opacity=n,this._updateOpacity(),this},setZIndex:function(n){return this.options.zIndex=n,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var n={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=yf(this._onMoveEnd,this.options.updateInterval,this)),n.move=this._onMove),this._zoomAnimated&&(n.zoomanim=this._animateZoom),n},createTile:function(){return document.createElement("div")},getTileSize:function(){var n=this.options.tileSize;return n instanceof t?n:new t(n,n)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(n){for(var r,u=this.getPane().children,t=-n(-1/0,1/0),i=0,f=u.length;i<f;i++)r=u[i].style.zIndex,u[i]!==this._container&&r&&(t=n(t,+r));isFinite(t)&&(this.options.zIndex=t+n(-1,1),this._updateZIndex())},_updateOpacity:function(){var u,n,t;if(this._map&&!bi){ut(this._container,this.options.opacity);var f=+new Date,i=!1,r=!1;for(u in this._tiles)n=this._tiles[u],n.current&&n.loaded&&(t=Math.min(1,(f-n.loaded)/200),ut(n.el,t),t<1?i=!0:(n.active?r=!0:this._onOpaqueTile(n),n.active=!0));r&&!this._noPrune&&this._pruneTiles();i&&(nt(this._fadeFrame),this._fadeFrame=g(this._updateOpacity,this))}},_onOpaqueTile:d,_initContainer:function(){this._container||(this._container=e("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var i=this._tileZoom,u=this.options.maxZoom,n,t,r;if(void 0!==i){for(n in this._levels)this._levels[n].el.children.length||n===i?(this._levels[n].el.style.zIndex=u-Math.abs(i-n),this._onUpdateLevel(n)):(v(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);return t=this._levels[i],r=this._map,t||((t=this._levels[i]={}).el=e("div","leaflet-tile-container leaflet-zoom-animated",this._container),t.el.style.zIndex=u,t.origin=r.project(r.unproject(r.getPixelOrigin()),i).round(),t.zoom=i,this._setZoomTransform(t,r.getCenter(),r.getZoom()),t.el.offsetWidth,this._onCreateLevel(t)),this._level=t}},_onUpdateLevel:d,_onRemoveLevel:d,_onCreateLevel:d,_pruneTiles:function(){var t,i,r,n;if(this._map)if(r=this._map.getZoom(),r>this.options.maxZoom||r<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(i=this._tiles[t]).retain=i.current;for(t in this._tiles)(i=this._tiles[t]).current&&!i.active&&(n=i.coords,this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2));for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}},_removeTilesAtZoom:function(n){for(var t in this._tiles)this._tiles[t].coords.z===n&&this._removeTile(t)},_removeAllTiles:function(){for(var n in this._tiles)this._removeTile(n)},_invalidateAll:function(){for(var n in this._levels)v(this._levels[n].el),this._onRemoveLevel(n),delete this._levels[n];this._removeAllTiles();this._tileZoom=void 0},_retainParent:function(n,i,r,u){var o=Math.floor(n/2),s=Math.floor(i/2),e=r-1,h=new t(+o,+s),c,f;return h.z=+e,c=this._tileCoordsToKey(h),f=this._tiles[c],f&&f.active?f.retain=!0:(f&&f.loaded&&(f.retain=!0),u<e&&this._retainParent(o,s,e,u))},_retainChildren:function(n,i,r,u){for(var o,s,h,f,e=2*n;e<2*n+2;e++)for(o=2*i;o<2*i+2;o++)s=new t(e,o),s.z=r+1,h=this._tileCoordsToKey(s),f=this._tiles[h],f&&f.active?f.retain=!0:(f&&f.loaded&&(f.retain=!0),r+1<u&&this._retainChildren(e,o,r+1,u))},_resetView:function(n){var t=n&&(n.pinch||n.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(n){this._setView(n.center,n.zoom,!0,n.noUpdate)},_clampZoom:function(n){var t=this.options;return void 0!==t.minNativeZoom&&n<t.minNativeZoom?t.minNativeZoom:void 0!==t.maxNativeZoom&&t.maxNativeZoom<n?t.maxNativeZoom:n},_setView:function(n,t,i,r){var u=this._clampZoom(Math.round(t)),f;(void 0!==this.options.maxZoom&&u>this.options.maxZoom||void 0!==this.options.minZoom&&u<this.options.minZoom)&&(u=void 0);f=this.options.updateWhenZooming&&u!==this._tileZoom;r&&!f||(this._tileZoom=u,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==u&&this._update(n),i||this._pruneTiles(),this._noPrune=!!i);this._setZoomTransforms(n,t)},_setZoomTransforms:function(n,t){for(var i in this._levels)this._setZoomTransform(this._levels[i],n,t)},_setZoomTransform:function(n,t,i){var r=this._map.getZoomScale(i,n.zoom),u=n.origin.multiplyBy(r).subtract(this._map._getNewPixelOrigin(t,i)).round();rt?si(n.el,u,r):b(n.el,u)},_resetGrid:function(){var t=this._map,n=t.options.crs,i=this._tileSize=this.getTileSize(),r=this._tileZoom,u=this._map.getPixelWorldBounds(this._tileZoom);u&&(this._globalTileRange=this._pxBoundsToTileRange(u));this._wrapX=n.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,n.wrapLng[0]],r).x/i.x),Math.ceil(t.project([0,n.wrapLng[1]],r).x/i.y)];this._wrapY=n.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([n.wrapLat[0],0],r).y/i.x),Math.ceil(t.project([n.wrapLat[1],0],r).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(n){var t=this._map,u=t._animatingZoom?Math.max(t._animateToZoom,t.getZoom()):t.getZoom(),f=t.getZoomScale(u,this._tileZoom),i=t.project(n,this._tileZoom).floor(),r=t.getSize().divideBy(2*f);return new a(i.subtract(r),i.add(r))},_update:function(n){var h=this._map,c,l,o,s,r,f,v,y;if(h&&(c=this._clampZoom(h.getZoom()),void 0===n&&(n=h.getCenter()),void 0!==this._tileZoom)){var w=this._getTiledPixelBounds(n),i=this._pxBoundsToTileRange(w),p=i.getCenter(),u=[],e=this.options.keepBuffer,b=new a(i.getBottomLeft().subtract([e,-e]),i.getTopRight().add([e,-e]));if(!(isFinite(i.min.x)&&isFinite(i.min.y)&&isFinite(i.max.x)&&isFinite(i.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(l in this._tiles)o=this._tiles[l].coords,o.z===this._tileZoom&&b.contains(new t(o.x,o.y))||(this._tiles[l].current=!1);if(1<Math.abs(c-this._tileZoom))this._setView(n,c);else{for(s=i.min.y;s<=i.max.y;s++)for(r=i.min.x;r<=i.max.x;r++)f=new t(r,s),(f.z=this._tileZoom,this._isValidTile(f))&&(v=this._tiles[this._tileCoordsToKey(f)],v?v.current=!0:u.push(f));if(u.sort(function(n,t){return n.distanceTo(p)-t.distanceTo(p)}),0!==u.length){for(this._loading||(this._loading=!0,this.fire("loading")),y=document.createDocumentFragment(),r=0;r<u.length;r++)this._addTile(u[r],y);this._level.el.appendChild(y)}}}},_isValidTile:function(n){var i=this._map.options.crs,t,r;return!i.infinite&&(t=this._globalTileRange,!i.wrapLng&&(n.x<t.min.x||n.x>t.max.x)||!i.wrapLat&&(n.y<t.min.y||n.y>t.max.y))?!1:this.options.bounds?(r=this._tileCoordsToBounds(n),k(this.options.bounds).overlaps(r)):!0},_keyToBounds:function(n){return this._tileCoordsToBounds(this._keyToTileCoords(n))},_tileCoordsToNwSe:function(n){var t=this._map,i=this.getTileSize(),r=n.scaleBy(i),u=r.add(i);return[t.unproject(r,n.z),t.unproject(u,n.z)]},_tileCoordsToBounds:function(n){var i=this._tileCoordsToNwSe(n),t=new it(i[0],i[1]);return this.options.noWrap||(t=this._map.wrapLatLngBounds(t)),t},_tileCoordsToKey:function(n){return n.x+":"+n.y+":"+n.z},_keyToTileCoords:function(n){var i=n.split(":"),r=new t(+i[0],+i[1]);return r.z=+i[2],r},_removeTile:function(n){var t=this._tiles[n];t&&(v(t.el),delete this._tiles[n],this.fire("tileunload",{tile:t.el,coords:this._keyToTileCoords(n)}))},_initTile:function(n){i(n,"leaflet-tile");var t=this.getTileSize();n.style.width=t.x+"px";n.style.height=t.y+"px";n.onselectstart=d;n.onmousemove=d;bi&&this.options.opacity<1&&ut(n,this.options.opacity);ki&&!wr&&(n.style.WebkitBackfaceVisibility="hidden")},_addTile:function(n,t){var r=this._getTilePos(n),u=this._tileCoordsToKey(n),i=this.createTile(this._wrapCoords(n),c(this._tileReady,this,n));this._initTile(i);this.createTile.length<2&&g(c(this._tileReady,this,n,null,i));b(i,r);this._tiles[u]={el:i,coords:n,current:!0};t.appendChild(i);this.fire("tileloadstart",{tile:i,coords:n})},_tileReady:function(n,t,r){t&&this.fire("tileerror",{error:t,tile:r,coords:n});var u=this._tileCoordsToKey(n);(r=this._tiles[u])&&(r.loaded=+new Date,this._map._fadeAnimated?(ut(r.el,0),nt(this._fadeFrame),this._fadeFrame=g(this._updateOpacity,this)):(r.active=!0,this._pruneTiles()),t||(i(r.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:r.el,coords:n})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),bi||!this._map._fadeAnimated?g(this._pruneTiles,this):setTimeout(c(this._pruneTiles,this),250)))},_getTilePos:function(n){return n.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(n){var i=new t(this._wrapX?lr(n.x,this._wrapX):n.x,this._wrapY?lr(n.y,this._wrapY):n.y);return i.z=n.z,i},_pxBoundsToTileRange:function(n){var t=this.getTileSize();return new a(n.min.unscaleBy(t).floor(),n.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var n in this._tiles)if(!this._tiles[n].loaded)return!1;return!0}});yi=hr.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(n,t){this._url=n;(t=l(this,t)).detectRetina&&fi&&0<t.maxZoom&&(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom++):(t.zoomOffset++,t.maxZoom--),t.minZoom=Math.max(0,t.minZoom));"string"==typeof t.subdomains&&(t.subdomains=t.subdomains.split(""));ki||this.on("tileunload",this._onTileRemove)},setUrl:function(n,t){return this._url===n&&void 0===t&&(t=!0),this._url=n,t||this.redraw(),this},createTile:function(n,t){var i=document.createElement("img");return u(i,"load",c(this._tileOnLoad,this,t,i)),u(i,"error",c(this._tileOnError,this,t,i)),!this.options.crossOrigin&&""!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(n),i},getTileUrl:function(n){var t={r:fi?"@2x":"",s:this._getSubdomain(n),x:n.x,y:n.y,z:this._getZoomForUrl()},i;return this._map&&!this._map.options.crs.infinite&&(i=this._globalTileRange.max.y-n.y,this.options.tms&&(t.y=i),t["-y"]=i),as(this._url,s(t,this.options))},_tileOnLoad:function(n,t){bi?setTimeout(c(n,this,null,t),0):n(null,t)},_tileOnError:function(n,t,i){var r=this.options.errorTileUrl;r&&t.getAttribute("src")!==r&&(t.src=r);n(i,t)},_onTileRemove:function(n){n.tile.onload=null},_getZoomForUrl:function(){var n=this._tileZoom,t=this.options.maxZoom;return this.options.zoomReverse&&(n=t-n),n+this.options.zoomOffset},_getSubdomain:function(n){var t=Math.abs(n.x+n.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var t,n;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((n=this._tiles[t].el).onload=d,n.onerror=d,n.complete||(n.src=ar,v(n),delete this._tiles[t]))},_removeTile:function(n){var t=this._tiles[n];if(t)return gs||t.el.setAttribute("src",ar),hr.prototype._removeTile.call(this,n)},_tileReady:function(n,t,i){if(this._map&&(!i||i.getAttribute("src")!==ar))return hr.prototype._tileReady.call(this,n,t,i)}});ko=yi.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(n,t){var i,r,u,f;this._url=n;i=s({},this.defaultWmsParams);for(r in t)r in this.options||(i[r]=t[r]);u=(t=l(this,t)).detectRetina&&fi?2:1;f=this.getTileSize();i.width=f.x*u;i.height=f.y*u;this.wmsParams=i},onAdd:function(n){this._crs=this.options.crs||n.options.crs;this._wmsVersion=parseFloat(this.wmsParams.version);var t=1.3<=this._wmsVersion?"crs":"srs";this.wmsParams[t]=this._crs.code;yi.prototype.onAdd.call(this,n)},getTileUrl:function(n){var r=this._tileCoordsToNwSe(n),u=this._crs,f=ct(u.project(r[0]),u.project(r[1])),t=f.min,i=f.max,o=(1.3<=this._wmsVersion&&this._crs===fc?[t.y,t.x,i.y,i.x]:[t.x,t.y,i.x,i.y]).join(","),e=yi.prototype.getTileUrl.call(this,n);return e+cs(this.wmsParams,e,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+o},setParams:function(n,t){return s(this.wmsParams,n),t||this.redraw(),this}});yi.WMS=ko;cc.wms=function(n,t){return new ko(n,t)};vt=st.extend({options:{padding:.1,tolerance:0},initialize:function(n){l(this,n);o(this);this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&i(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 n={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(n.zoomanim=this._onAnimZoom),n},_onAnimZoom:function(n){this._updateTransform(n.center,n.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(n,t){var i=this._map.getZoomScale(t,this._zoom),f=ei(this._container),r=this._map.getSize().multiplyBy(.5+this.options.padding),e=this._map.project(this._center,t),o=this._map.project(n,t).subtract(e),u=r.multiplyBy(-i).add(f).add(r).subtract(o);rt?si(this._container,u,i):b(this._container,u)},_reset:function(){for(var n in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[n]._reset()},_onZoomEnd:function(){for(var n in this._layers)this._layers[n]._project()},_updatePaths:function(){for(var n in this._layers)this._layers[n]._update()},_update:function(){var n=this.options.padding,t=this._map.getSize(),i=this._map.containerPointToLayerPoint(t.multiplyBy(-n)).round();this._bounds=new a(i,i.add(t.multiplyBy(1+2*n)).round());this._center=this._map.getCenter();this._zoom=this._map.getZoom()}});go=vt.extend({getEvents:function(){var n=vt.prototype.getEvents.call(this);return n.viewprereset=this._onViewPreReset,n},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){vt.prototype.onAdd.call(this);this._draw()},_initContainer:function(){var n=this._container=document.createElement("canvas");u(n,"mousemove",yf(this._onMouseMove,32,this),this);u(n,"click dblclick mousedown mouseup contextmenu",this._onClick,this);u(n,"mouseout",this._handleMouseOut,this);this._ctx=n.getContext("2d")},_destroyContainer:function(){nt(this._redrawRequest);delete this._ctx;v(this._container);w(this._container);delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var n in this._redrawBounds=null,this._layers)this._layers[n]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){vt.prototype._update.call(this);var t=this._bounds,n=this._container,i=t.getSize(),r=fi?2:1;b(n,t.min);n.width=r*i.x;n.height=r*i.y;n.style.width=i.x+"px";n.style.height=i.y+"px";fi&&this._ctx.scale(2,2);this._ctx.translate(-t.min.x,-t.min.y);this.fire("update")}},_reset:function(){vt.prototype._reset.call(this);this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(n){this._updateDashArray(n);var t=(this._layers[o(n)]=n)._order={layer:n,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t);this._drawLast=t;this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(n){this._requestRedraw(n)},_removePath:function(n){var r=n._order,t=r.next,i=r.prev;t?t.prev=i:this._drawLast=i;i?i.next=t:this._drawFirst=t;delete n._order;delete this._layers[o(n)];this._requestRedraw(n)},_updatePath:function(n){this._extendRedrawBounds(n);n._project();n._update();this._requestRedraw(n)},_updateStyle:function(n){this._updateDashArray(n);this._requestRedraw(n)},_updateDashArray:function(n){if("string"==typeof n.options.dashArray){for(var i,r=n.options.dashArray.split(/[, ]+/),u=[],t=0;t<r.length;t++){if(i=Number(r[t]),isNaN(i))return;u.push(i)}n.options._dashArray=u}else n.options._dashArray=n.options.dashArray},_requestRedraw:function(n){this._map&&(this._extendRedrawBounds(n),this._redrawRequest=this._redrawRequest||g(this._redraw,this))},_extendRedrawBounds:function(n){if(n._pxBounds){var t=(n.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new a;this._redrawBounds.extend(n._pxBounds.min.subtract([t,t]));this._redrawBounds.extend(n._pxBounds.max.add([t,t]))}},_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 n=this._redrawBounds,t;n?(t=n.getSize(),this._ctx.clearRect(n.min.x,n.min.y,t.x,t.y)):this._ctx.clearRect(0,0,this._container.width,this._container.height)},_draw:function(){var i,n=this._redrawBounds,r,t;for((this._ctx.save(),n)&&(r=n.getSize(),this._ctx.beginPath(),this._ctx.rect(n.min.x,n.min.y,r.x,r.y),this._ctx.clip()),this._drawing=!0,t=this._drawFirst;t;t=t.next)i=t.layer,(!n||i._pxBounds&&i._pxBounds.intersects(n))&&i._updatePath();this._drawing=!1;this._ctx.restore()},_updatePoly:function(n,t){if(this._drawing){var i,r,o,f,e=n._parts,s=e.length,u=this._ctx;if(s){for(u.beginPath(),i=0;i<s;i++){for(r=0,o=e[i].length;r<o;r++)f=e[i][r],u[r?"lineTo":"moveTo"](f.x,f.y);t&&u.closePath()}this._fillStroke(u,n)}}},_updateCircle:function(n){if(this._drawing&&!n._empty()){var u=n._point,t=this._ctx,r=Math.max(Math.round(n._radius),1),i=(Math.max(Math.round(n._radiusY),1)||r)/r;1!=i&&(t.save(),t.scale(1,i));t.beginPath();t.arc(u.x,u.y/i,r,0,2*Math.PI,!1);1!=i&&t.restore();this._fillStroke(t,n)}},_fillStroke:function(n,t){var i=t.options;i.fill&&(n.globalAlpha=i.fillOpacity,n.fillStyle=i.fillColor||i.color,n.fill(i.fillRule||"evenodd"));i.stroke&&0!==i.weight&&(n.setLineDash&&n.setLineDash(t.options&&t.options._dashArray||[]),n.globalAlpha=i.opacity,n.lineWidth=i.weight,n.strokeStyle=i.color,n.lineCap=i.lineCap,n.lineJoin=i.lineJoin,n.stroke())},_onClick:function(n){for(var t,r,u=this._map.mouseEventToLayerPoint(n),i=this._drawFirst;i;i=i.next)(t=i.layer).options.interactive&&t._containsPoint(u)&&!this._map._draggableMoved(t)&&(r=t);r&&(fo(n),this._fireEvent([r],n))},_onMouseMove:function(n){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var t=this._map.mouseEventToLayerPoint(n);this._handleMouseHover(n,t)}},_handleMouseOut:function(n){var t=this._hoveredLayer;t&&(p(this._container,"leaflet-interactive"),this._fireEvent([t],n,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(n,t){for(var f,r,u=this._drawFirst;u;u=u.next)(f=u.layer).options.interactive&&f._containsPoint(t)&&(r=f);r!==this._hoveredLayer&&(this._handleMouseOut(n),r&&(i(this._container,"leaflet-interactive"),this._fireEvent([r],n,"mouseover"),this._hoveredLayer=r));this._hoveredLayer&&this._fireEvent([this._hoveredLayer],n)},_fireEvent:function(n,t,i){this._map._fireDOMEvent(t,i||t.type,n)},_bringToFront:function(n){var t=n._order,i,r;t&&(i=t.next,r=t.prev,i&&((i.prev=r)?r.next=i:i&&(this._drawFirst=i),t.prev=this._drawLast,(this._drawLast.next=t).next=null,this._drawLast=t,this._requestRedraw(n)))},_bringToBack:function(n){var t=n._order,r,i;t&&(r=t.next,i=t.prev,i&&((i.next=r)?r.prev=i:i&&(this._drawLast=i),t.prev=null,t.next=this._drawFirst,this._drawFirst.prev=t,this._drawFirst=t,this._requestRedraw(n)))}});var eu=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(n){return document.createElement("<lvml:"+n+' class="lvml">')}}catch(n){return function(n){return document.createElement("<"+n+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),ll={_initContainer:function(){this._container=e("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(vt.prototype._update.call(this),this.fire("update"))},_initPath:function(n){var t=n._container=eu("shape");i(t,"leaflet-vml-shape "+(this.options.className||""));t.coordsize="1 1";n._path=eu("path");t.appendChild(n._path);this._updateStyle(n);this._layers[o(n)]=n},_addPath:function(n){var t=n._container;this._container.appendChild(t);n.options.interactive&&n.addInteractiveTarget(t)},_removePath:function(n){var t=n._container;v(t);n.removeInteractiveTarget(t);delete this._layers[o(n)]},_updateStyle:function(n){var i=n._stroke,r=n._fill,t=n.options,u=n._container;u.stroked=!!t.stroke;u.filled=!!t.fill;t.stroke?(i||(i=n._stroke=eu("stroke")),u.appendChild(i),i.weight=t.weight+"px",i.color=t.color,i.opacity=t.opacity,i.dashStyle=t.dashArray?ht(t.dashArray)?t.dashArray.join(" "):t.dashArray.replace(/( *, *)/g," "):"",i.endcap=t.lineCap.replace("butt","flat"),i.joinstyle=t.lineJoin):i&&(u.removeChild(i),n._stroke=null);t.fill?(r||(r=n._fill=eu("fill")),u.appendChild(r),r.color=t.fillColor||t.color,r.opacity=t.fillOpacity):r&&(u.removeChild(r),n._fill=null)},_updateCircle:function(n){var t=n._point.round(),i=Math.round(n._radius),r=Math.round(n._radiusY||i);this._setPath(n,n._empty()?"M0 0":"AL "+t.x+","+t.y+" "+i+","+r+" 0,23592600")},_setPath:function(n,t){n._path.v=t},_bringToFront:function(n){tr(n._container)},_bringToBack:function(n){ir(n._container)}},af=au?eu:ks,ou=vt.extend({getEvents:function(){var n=vt.prototype.getEvents.call(this);return n.zoomstart=this._onZoomStart,n},_initContainer:function(){this._container=af("svg");this._container.setAttribute("pointer-events","none");this._rootGroup=af("g");this._container.appendChild(this._rootGroup)},_destroyContainer:function(){v(this._container);w(this._container);delete this._container;delete this._rootGroup;delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){vt.prototype._update.call(this);var t=this._bounds,n=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(n)||(this._svgSize=n,i.setAttribute("width",n.x),i.setAttribute("height",n.y));b(i,t.min);i.setAttribute("viewBox",[t.min.x,t.min.y,n.x,n.y].join(" "));this.fire("update")}},_initPath:function(n){var t=n._path=af("path");n.options.className&&i(t,n.options.className);n.options.interactive&&i(t,"leaflet-interactive");this._updateStyle(n);this._layers[o(n)]=n},_addPath:function(n){this._rootGroup||this._initContainer();this._rootGroup.appendChild(n._path);n.addInteractiveTarget(n._path)},_removePath:function(n){v(n._path);n.removeInteractiveTarget(n._path);delete this._layers[o(n)]},_updatePath:function(n){n._project();n._update()},_updateStyle:function(n){var t=n._path,i=n.options;t&&(i.stroke?(t.setAttribute("stroke",i.color),t.setAttribute("stroke-opacity",i.opacity),t.setAttribute("stroke-width",i.weight),t.setAttribute("stroke-linecap",i.lineCap),t.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?t.setAttribute("stroke-dasharray",i.dashArray):t.removeAttribute("stroke-dasharray"),i.dashOffset?t.setAttribute("stroke-dashoffset",i.dashOffset):t.removeAttribute("stroke-dashoffset")):t.setAttribute("stroke","none"),i.fill?(t.setAttribute("fill",i.fillColor||i.color),t.setAttribute("fill-opacity",i.fillOpacity),t.setAttribute("fill-rule",i.fillRule||"evenodd")):t.setAttribute("fill","none"))},_updatePoly:function(n,t){this._setPath(n,ds(n._parts,t))},_updateCircle:function(n){var i=n._point,t=Math.max(Math.round(n._radius),1),r="a"+t+","+(Math.max(Math.round(n._radiusY),1)||t)+" 0 1,0 ",u=n._empty()?"M0 0":"M"+(i.x-t)+","+i.y+r+2*t+",0 "+r+2*-t+",0 ";this._setPath(n,u)},_setPath:function(n,t){n._path.setAttribute("d",t)},_bringToFront:function(n){tr(n._path)},_bringToBack:function(n){ir(n._path)}});au&&ou.include(ll);f.include({getRenderer:function(n){var t=n.options.renderer||this._getPaneRenderer(n.options.pane)||this.options.renderer||this._renderer;return t||(t=this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(n){if("overlayPane"===n||void 0===n)return!1;var t=this._paneRenderers[n];return void 0===t&&(t=this._createRenderer({pane:n}),this._paneRenderers[n]=t),t},_createRenderer:function(n){return this.options.preferCanvas&&lc(n)||ac(n)}});ns=ai.extend({initialize:function(n,t){ai.prototype.initialize.call(this,this._boundsToLatLngs(n),t)},setBounds:function(n){return this.setLatLngs(this._boundsToLatLngs(n))},_boundsToLatLngs:function(n){return[(n=k(n)).getSouthWest(),n.getNorthWest(),n.getNorthEast(),n.getSouthEast()]}});ou.create=af;ou.pointsToPath=ds;kt.geometryToLayer=yo;kt.coordsToLatLng=po;kt.coordsToLatLngs=of;kt.latLngToCoords=wo;kt.latLngsToCoords=sf;kt.getFeature=or;kt.asFeature=hf;f.mergeOptions({boxZoom:!0});ts=at.extend({initialize:function(n){this._map=n;this._container=n._container;this._pane=n._panes.overlayPane;this._resetStateTimeout=0;n.on("unload",this._destroy,this)},addHooks:function(){u(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){w(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){v(this._pane);delete this._pane},_resetState:function(){this._resetStateTimeout=0;this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(n){if(!n.shiftKey||1!==n.which&&1!==n.button)return!1;this._clearDeferredResetState();this._resetState();kr();de();this._startPoint=this._map.mouseEventToContainerPoint(n);u(document,{contextmenu:bt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(n){this._moved||(this._moved=!0,this._box=e("div","leaflet-zoom-box",this._container),i(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart"));this._point=this._map.mouseEventToContainerPoint(n);var t=new a(this._point,this._startPoint),r=t.getSize();b(this._box,t.min);this._box.style.width=r.x+"px";this._box.style.height=r.y+"px"},_finish:function(){this._moved&&(v(this._box),p(this._container,"leaflet-crosshair"));dr();ge();w(document,{contextmenu:bt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(n){if((1===n.which||1===n.button)&&(this._finish(),this._moved)){this._clearDeferredResetState();this._resetStateTimeout=setTimeout(c(this._resetState,this),0);var t=new it(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})}},_onKeyDown:function(n){27===n.keyCode&&this._finish()}});f.addInitHook("addHandler","boxZoom",ts);f.mergeOptions({doubleClickZoom:!0});is=at.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(n){var t=this._map,i=t.getZoom(),r=t.options.zoomDelta,u=n.originalEvent.shiftKey?i-r:i+r;"center"===t.options.doubleClickZoom?t.setZoom(u):t.setZoomAround(n.containerPoint,u)}});f.addInitHook("addHandler","doubleClickZoom",is);f.mergeOptions({dragging:!0,inertia:!wr,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});rs=at.extend({addHooks:function(){if(!this._draggable){var n=this._map;this._draggable=new ci(n._mapPane,n._container);this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this);this._draggable.on("predrag",this._onPreDragLimit,this);n.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),n.on("zoomend",this._onZoomEnd,this),n.whenReady(this._onZoomEnd,this))}i(this._map._container,"leaflet-grab leaflet-touch-drag");this._draggable.enable();this._positions=[];this._times=[]},removeHooks:function(){p(this._map._container,"leaflet-grab");p(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 n=this._map,t;(n._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity)?(t=k(this._map.options.maxBounds),this._offsetLimit=ct(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null;n.fire("movestart").fire("dragstart");n.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(n){if(this._map.options.inertia){var t=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i);this._times.push(t);this._prunePositions(t)}this._map.fire("move",n).fire("drag",n)},_prunePositions:function(n){for(;1<this._positions.length&&50<n-this._times[0];)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var n=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(n).x;this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(n,t){return n-(n-t)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var n=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;n.x<t.min.x&&(n.x=this._viscousLimit(n.x,t.min.x));n.y<t.min.y&&(n.y=this._viscousLimit(n.y,t.min.y));n.x>t.max.x&&(n.x=this._viscousLimit(n.x,t.max.x));n.y>t.max.y&&(n.y=this._viscousLimit(n.y,t.max.y));this._draggable._newPos=this._draggable._startPos.add(n)}},_onPreDragWrap:function(){var i=this._worldWidth,t=Math.round(i/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,u=(r-t+n)%i+t-n,f=(r+t+n)%i-t-n,e=Math.abs(u+n)<Math.abs(f+n)?u:f;this._draggable._absPos=this._draggable._newPos.clone();this._draggable._newPos.x=e},_onDragEnd:function(n){var t=this._map,r=t.options,h=!r.inertia||this._times.length<2;if(t.fire("dragend",n),h)t.fire("moveend");else{this._prunePositions(+new Date);var c=this._lastPos.subtract(this._positions[0]),l=(this._lastTime-this._times[0])/1e3,u=r.easeLinearity,f=c.multiplyBy(u/l),e=f.distanceTo([0,0]),o=Math.min(r.inertiaMaxSpeed,e),a=f.multiplyBy(o/e),s=o/(r.inertiaDeceleration*u),i=a.multiplyBy(-s/2).round();i.x||i.y?(i=t._limitOffset(i,t.options.maxBounds),g(function(){t.panBy(i,{duration:s,easeLinearity:u,noMoveStart:!0,animate:!0})})):t.fire("moveend")}}});f.addInitHook("addHandler","dragging",rs);f.mergeOptions({keyboard:!0,keyboardPanDelta:80});us=at.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(n){this._map=n;this._setPanDelta(n.options.keyboardPanDelta);this._setZoomDelta(n.options.zoomDelta)},addHooks:function(){var n=this._map._container;n.tabIndex<=0&&(n.tabIndex="0");u(n,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this);this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks();w(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 n=document.body,t=document.documentElement,i=n.scrollTop||t.scrollTop,r=n.scrollLeft||t.scrollLeft;this._map._container.focus();window.scrollTo(r,i)}},_onFocus:function(){this._focused=!0;this._map.fire("focus")},_onBlur:function(){this._focused=!1;this._map.fire("blur")},_setPanDelta:function(n){for(var u=this._panKeys={},r=this.keyCodes,t=0,i=r.left.length;t<i;t++)u[r.left[t]]=[-1*n,0];for(t=0,i=r.right.length;t<i;t++)u[r.right[t]]=[n,0];for(t=0,i=r.down.length;t<i;t++)u[r.down[t]]=[0,n];for(t=0,i=r.up.length;t<i;t++)u[r.up[t]]=[0,-1*n]},_setZoomDelta:function(n){for(var u=this._zoomKeys={},r=this.keyCodes,t=0,i=r.zoomIn.length;t<i;t++)u[r.zoomIn[t]]=n;for(t=0,i=r.zoomOut.length;t<i;t++)u[r.zoomOut[t]]=-n},_addHooks:function(){u(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){w(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(n){if(!(n.altKey||n.ctrlKey||n.metaKey)){var u,i=n.keyCode,t=this._map;if(i in this._panKeys)t._panAnim&&t._panAnim._inProgress||(u=this._panKeys[i],n.shiftKey&&(u=r(u).multiplyBy(3)),t.panBy(u),t.options.maxBounds&&t.panInsideBounds(t.options.maxBounds));else if(i in this._zoomKeys)t.setZoom(t.getZoom()+(n.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!t._popup||!t._popup.options.closeOnEscapeKey)return;t.closePopup()}bt(n)}}});f.addInitHook("addHandler","keyboard",us);f.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});fs=at.extend({addHooks:function(){u(this._map._container,"mousewheel",this._onWheelScroll,this);this._delta=0},removeHooks:function(){w(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(n){var i=ph(n),r=this._map.options.wheelDebounceTime,t;this._delta+=i;this._lastMousePos=this._map.mouseEventToContainerPoint(n);this._startTime||(this._startTime=+new Date);t=Math.max(r-(+new Date-this._startTime),0);clearTimeout(this._timer);this._timer=setTimeout(c(this._performZoom,this),t);bt(n)},_performZoom:function(){var n=this._map,t=n.getZoom(),i=this._map.options.zoomSnap||0;n._stop();var e=this._delta/(4*this._map.options.wheelPxPerZoomLevel),u=4*Math.log(2/(1+Math.exp(-Math.abs(e))))/Math.LN2,f=i?Math.ceil(u/i)*i:u,r=n._limitZoom(t+(0<this._delta?f:-f))-t;this._delta=0;this._startTime=null;r&&("center"===n.options.scrollWheelZoom?n.setZoom(t+r):n.setZoomAround(this._lastMousePos,t+r))}});f.addInitHook("addHandler","scrollWheelZoom",fs);f.mergeOptions({tap:!0,tapTolerance:15});es=at.extend({addHooks:function(){u(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){w(this._map._container,"touchstart",this._onDown,this)},_onDown:function(n){if(n.touches){if(et(n),this._fireClick=!0,1<n.touches.length)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var r=n.touches[0],f=r.target;this._startPos=this._newPos=new t(r.clientX,r.clientY);f.tagName&&"a"===f.tagName.toLowerCase()&&i(f,"leaflet-active");this._holdTimeout=setTimeout(c(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",r))},this),1e3);this._simulateEvent("mousedown",r);u(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(n){if(clearTimeout(this._holdTimeout),w(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&n&&n.changedTouches){var i=n.changedTouches[0],t=i.target;t&&t.tagName&&"a"===t.tagName.toLowerCase()&&p(t,"leaflet-active");this._simulateEvent("mouseup",i);this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(n){var i=n.touches[0];this._newPos=new t(i.clientX,i.clientY);this._simulateEvent("mousemove",i)},_simulateEvent:function(n,t){var i=document.createEvent("MouseEvents");i._simulated=!0;t.target._simulatedClick=!0;i.initMouseEvent(n,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null);t.target.dispatchEvent(i)}});pt&&!lt&&f.addInitHook("addHandler","tap",es);f.mergeOptions({touchZoom:pt&&!wr,bounceAtZoomLimits:!0});os=at.extend({addHooks:function(){i(this._map._container,"leaflet-touch-zoom");u(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){p(this._map._container,"leaflet-touch-zoom");w(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(n){var t=this._map,i,r;!n.touches||2!==n.touches.length||t._animatingZoom||this._zooming||(i=t.mouseEventToContainerPoint(n.touches[0]),r=t.mouseEventToContainerPoint(n.touches[1]),this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),"center"!==t.options.touchZoom&&(this._pinchStartLatLng=t.containerPointToLatLng(i.add(r)._divideBy(2))),this._startDist=i.distanceTo(r),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),u(document,"touchmove",this._onTouchMove,this),u(document,"touchend",this._onTouchEnd,this),et(n))},_onTouchMove:function(n){var r,e;if(n.touches&&2===n.touches.length&&this._zooming){var t=this._map,u=t.mouseEventToContainerPoint(n.touches[0]),f=t.mouseEventToContainerPoint(n.touches[1]),i=u.distanceTo(f)/this._startDist;if(this._zoom=t.getScaleZoom(i,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoom<t.getMinZoom()&&i<1||this._zoom>t.getMaxZoom()&&1<i)&&(this._zoom=t._limitZoom(this._zoom)),"center"===t.options.touchZoom){if(this._center=this._startLatLng,1==i)return}else{if(r=u._add(f)._divideBy(2)._subtract(this._centerPoint),1==i&&0===r.x&&0===r.y)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(t._moveStart(!0,!1),this._moved=!0);nt(this._animRequest);e=c(t._move,t,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=g(e,this,!0);et(n)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,nt(this._animRequest),w(document,"touchmove",this._onTouchMove),w(document,"touchend",this._onTouchEnd),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))):this._zooming=!1}});f.addInitHook("addHandler","touchZoom",os);f.BoxZoom=ts;f.DoubleClickZoom=is;f.Drag=rs;f.Keyboard=us;f.ScrollWheelZoom=fs;f.Tap=es;f.TouchZoom=os;Object.freeze=ss;n.version="1.5.1+HEAD.2e3e0ff";n.Control=ot;n.control=iu;n.Browser=kc;n.Evented=wi;n.Mixin=fl;n.Util=ps;n.Class=dt;n.Handler=at;n.extend=s;n.bind=c;n.stamp=o;n.setOptions=l;n.DomEvent=ul;n.DomUtil=ah;n.PosAnimation=wh;n.Draggable=ci;n.LineUtil=rc;n.PolyUtil=el;n.Point=t;n.point=r;n.Bounds=a;n.bounds=ct;n.Transformation=ne;n.transformation=yr;n.Projection=ol;n.LatLng=h;n.latLng=y;n.LatLngBounds=it;n.latLngBounds=k;n.CRS=gt;n.GeoJSON=kt;n.geoJSON=oc;n.geoJson=cl;n.Layer=st;n.LayerGroup=ur;n.layerGroup=function(n,t){return new ur(n,t)};n.FeatureGroup=fr;n.featureGroup=function(n){return new fr(n)};n.ImageOverlay=lf;n.imageOverlay=function(n,t,i){return new lf(n,t,i)};n.VideoOverlay=sc;n.videoOverlay=function(n,t,i){return new sc(n,t,i)};n.SVGOverlay=hc;n.svgOverlay=function(n,t,i){return new hc(n,t,i)};n.DivOverlay=ii;n.Popup=sr;n.popup=function(n,t){return new sr(n,t)};n.Tooltip=vi;n.tooltip=function(n,t){return new vi(n,t)};n.Icon=er;n.icon=function(n){return new er(n)};n.DivIcon=bo;n.divIcon=function(n){return new bo(n)};n.Marker=fu;n.marker=function(n,t){return new fu(n,t)};n.TileLayer=yi;n.tileLayer=cc;n.GridLayer=hr;n.gridLayer=function(n){return new hr(n)};n.SVG=ou;n.svg=ac;n.Renderer=vt;n.Canvas=go;n.canvas=lc;n.Path=oi;n.CircleMarker=ef;n.circleMarker=function(n,t){return new ef(n,t)};n.Circle=vo;n.circle=function(n,t,i){return new vo(n,t,i)};n.Polyline=ti;n.polyline=function(n,t){return new ti(n,t)};n.Polygon=ai;n.polygon=function(n,t){return new ai(n,t)};n.Rectangle=ns;n.rectangle=function(n,t){return new ns(n,t)};n.Map=f;n.map=function(n,t){return new f(n,t)};vc=window.L;n.noConflict=function(){return window.L=vc,this};window.L=n});!function e(n,t,i){function r(u,e){var s,h,o;if(!t[u]){if(!n[u]){if(s="function"==typeof require&&require,!e&&s)return s(u,!0);if(f)return f(u,!0);h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h;}o=t[u]={exports:{}};n[u][0].call(o.exports,function(t){var i=n[u][1][t];return r(i?i:t)},o,o.exports,e,n,t,i)}return t[u].exports}for(var f="function"==typeof require&&require,u=0;u<i.length;u++)r(i[u]);return r}({1:[function(n,t,i){"use strict";function u(){}function e(n){if("function"!=typeof n)throw new TypeError("resolver must be a function");this.state=a;this.queue=[];this.outcome=void 0;n!==u&&h(this,n)}function f(n,t,i){this.promise=n;"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled);"function"==typeof i&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}function o(n,t,i){k(function(){var u;try{u=t(i)}catch(f){return r.reject(n,f)}u===n?r.reject(n,new TypeError("Cannot resolve promise with itself")):r.resolve(n,u)})}function v(n){var t=n&&n.then;if(n&&"object"==typeof n&&"function"==typeof t)return function(){t.apply(n,arguments)}}function h(n,t){function u(t){i||(i=!0,r.reject(n,t))}function e(t){i||(i=!0,r.resolve(n,t))}function o(){t(e,u)}var i=!1,f=c(o);"error"===f.status&&u(f.value)}function c(n,t){var i={};try{i.value=n(t);i.status="success"}catch(r){i.status="error";i.value=r}return i}function y(n){return n instanceof this?n:r.resolve(new this(u),n)}function p(n){var t=new this(u);return r.reject(t,n)}function w(n){function s(n,u){function f(n){o[u]=n;++c!==t||i||(i=!0,r.resolve(e,o))}h.resolve(n).then(f,function(n){i||(i=!0,r.reject(e,n))})}var h=this,t,i;if("[object Array]"!==Object.prototype.toString.call(n))return this.reject(new TypeError("must be an array"));if(t=n.length,i=!1,!t)return this.resolve([]);for(var o=new Array(t),c=0,f=-1,e=new this(u);++f<t;)s(n[f],f);return e}function b(n){function o(n){s.resolve(n).then(function(n){t||(t=!0,r.resolve(i,n))},function(n){t||(t=!0,r.reject(i,n))})}var s=this,f,t,e,i;if("[object Array]"!==Object.prototype.toString.call(n))return this.reject(new TypeError("must be an array"));if(f=n.length,t=!1,!f)return this.resolve([]);for(e=-1,i=new this(u);++e<f;)o(n[e]);return i}var k=n("immediate"),r={},l=["REJECTED"],s=["FULFILLED"],a=["PENDING"];t.exports=i=e;e.prototype["catch"]=function(n){return this.then(null,n)};e.prototype.then=function(n,t){var i,r;return"function"!=typeof n&&this.state===s||"function"!=typeof t&&this.state===l?this:(i=new this.constructor(u),this.state!==a?(r=this.state===s?n:t,o(i,r,this.outcome)):this.queue.push(new f(i,n,t)),i)};f.prototype.callFulfilled=function(n){r.resolve(this.promise,n)};f.prototype.otherCallFulfilled=function(n){o(this.promise,this.onFulfilled,n)};f.prototype.callRejected=function(n){r.reject(this.promise,n)};f.prototype.otherCallRejected=function(n){o(this.promise,this.onRejected,n)};r.resolve=function(n,t){var i=c(v,t),u,f,e;if("error"===i.status)return r.reject(n,i.value);if(u=i.value,u)h(n,u);else for(n.state=s,n.outcome=t,f=-1,e=n.queue.length;++f<e;)n.queue[f].callFulfilled(t);return n};r.reject=function(n,t){n.state=l;n.outcome=t;for(var i=-1,r=n.queue.length;++i<r;)n.queue[i].callRejected(t);return n};i.resolve=y;i.reject=p;i.all=w;i.race=b},{immediate:2}],2:[function(n,t){(function(n){"use strict";function r(){e=!0;for(var n,r,t=i.length;t;){for(r=i,i=[],n=-1;++n<t;)r[n]();t=i.length}e=!1}function c(n){1!==i.push(n)||e||u()}var u,o=n.MutationObserver||n.WebKitMutationObserver,f,e,i;if(o){var s=0,l=new o(r),h=n.document.createTextNode("");l.observe(h,{characterData:!0});u=function(){h.data=s=++s%2}}else n.setImmediate||"undefined"==typeof n.MessageChannel?u="document"in n&&"onreadystatechange"in n.document.createElement("script")?function(){var t=n.document.createElement("script");t.onreadystatechange=function(){r();t.onreadystatechange=null;t.parentNode.removeChild(t);t=null};n.document.documentElement.appendChild(t)}:function(){setTimeout(r,0)}:(f=new n.MessageChannel,f.port1.onmessage=r,u=function(){f.port2.postMessage(0)});i=[];t.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(n,t){(function(i){"use strict";var r=n("./jsonp"),u=n("lie");t.exports=function(n,t){if(t=t||{},t.jsonp)return r(n,t);var f,o,e=new u(function(r,u){o=u;void 0===i.XMLHttpRequest&&u("XMLHttpRequest is not supported");var e;f=new i.XMLHttpRequest;f.open("GET",n);t.headers&&Object.keys(t.headers).forEach(function(n){f.setRequestHeader(n,t.headers[n])});f.onreadystatechange=function(){4===f.readyState&&(f.status<400&&t.local||200===f.status?(i.JSON?e=JSON.parse(f.responseText):u(new Error("JSON is not supported")),r(e)):u(f.status?f.statusText:"Attempted cross origin request without CORS enabled"))};f.send()});return e["catch"](function(n){return f.abort(),n}),e.abort=o,e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./jsonp":5,lie:1}],4:[function(n){(function(t){"use strict";var i=t.L||n("leaflet"),r=n("lie"),u=n("./ajax");i.GeoJSON.AJAX=i.GeoJSON.extend({defaultAJAXparams:{dataType:"json",callbackParam:"callback",local:!1,middleware:function(n){return n}},initialize:function(n,t){var f,u,e;this.urls=[];n&&("string"==typeof n?this.urls.push(n):"function"==typeof n.pop?this.urls=this.urls.concat(n):(t=n,n=void 0));f=i.Util.extend({},this.defaultAJAXparams);for(u in t)this.defaultAJAXparams.hasOwnProperty(u)&&(f[u]=t[u]);this.ajaxParams=f;this._layers={};i.Util.setOptions(this,t);this.on("data:loaded",function(){this.filter&&this.refilter(this.filter)},this);e=this;this.urls.length>0&&new r(function(n){n()}).then(function(){e.addUrl()})},clearLayers:function(){return this.urls=[],i.GeoJSON.prototype.clearLayers.call(this),this},addUrl:function(n){var t=this,r,f;n&&("string"==typeof n?t.urls.push(n):"function"==typeof n.pop&&(t.urls=t.urls.concat(n)));r=t.urls.length;f=0;t.fire("data:loading");t.urls.forEach(function(n){"json"===t.ajaxParams.dataType.toLowerCase()?u(n,t.ajaxParams).then(function(n){var i=t.ajaxParams.middleware(n);t.addData(i);t.fire("data:progress",i)},function(n){t.fire("data:progress",{error:n})}):"jsonp"===t.ajaxParams.dataType.toLowerCase()&&i.Util.jsonp(n,t.ajaxParams).then(function(n){var i=t.ajaxParams.middleware(n);t.addData(i);t.fire("data:progress",i)},function(n){t.fire("data:progress",{error:n})})});t.on("data:progress",function(){++f===r&&t.fire("data:loaded")})},refresh:function(n){n=n||this.urls;this.clearLayers();this.addUrl(n)},refilter:function(n){"function"!=typeof n?(this.filter=!1,this.eachLayer(function(n){n.setStyle({stroke:!0,clickable:!0})})):(this.filter=n,this.eachLayer(function(t){n(t.feature)?t.setStyle({stroke:!0,clickable:!0}):t.setStyle({stroke:!1,clickable:!1})}))}});i.Util.Promise=r;i.Util.ajax=u;i.Util.jsonp=n("./jsonp");i.geoJson.ajax=function(n,t){return new i.GeoJSON.AJAX(n,t)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./ajax":3,"./jsonp":5,leaflet:void 0,lie:1}],5:[function(n,t){(function(i){"use strict";var r=i.L||n("leaflet"),u=n("lie");t.exports=function(n,t){t=t||{};var e,h,f,c,s=document.getElementsByTagName("head")[0],o=r.DomUtil.create("script","",s),l=new u(function(r,u){c=u;var l=t.cbParam||"callback";t.callbackName?e=t.callbackName:(f="_"+(""+Math.random()).slice(2),e="_leafletJSONPcallbacks."+f);o.type="text/javascript";f&&(i._leafletJSONPcallbacks||(i._leafletJSONPcallbacks={length:0}),i._leafletJSONPcallbacks.length++,i._leafletJSONPcallbacks[f]=function(n){s.removeChild(o);delete i._leafletJSONPcallbacks[f];i._leafletJSONPcallbacks.length--;i._leafletJSONPcallbacks.length||delete i._leafletJSONPcallbacks;r(n)});h=-1===n.indexOf("?")?n+"?"+l+"="+e:n+"&"+l+"="+e;o.src=h}).then(null,function(n){return s.removeChild(o),delete r.Util.ajax.cb[f],n});return l.abort=c,l}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{leaflet:void 0,lie:1}]},{},[4]),function(){L.Icon.Pulse=L.DivIcon.extend({options:{className:"",iconSize:[12,12],fillColor:"red",color:"red",animate:!0,heartbeat:1},initialize:function(n){var u,t;L.setOptions(this,n);var i="lpi-"+(new Date).getTime()+"-"+Math.round(Math.random()*1e5),f=["background-color: "+this.options.fillColor],r=["box-shadow: 0 0 6px 2px "+this.options.color,"animation: pulsate "+this.options.heartbeat+"s ease-out","animation-iteration-count: infinite","animation-delay: "+(this.options.heartbeat+.1)+"s"];this.options.animate||(r.push("animation: none"),r.push("box-shadow:none"));u=["."+i+"{"+f.join(";")+";}","."+i+":after{"+r.join(";")+";}"].join("");t=document.createElement("style");t.styleSheet?t.styleSheet.cssText=u:t.appendChild(document.createTextNode(u));document.getElementsByTagName("head")[0].appendChild(t);this.options.className=this.options.className+" leaflet-pulsing-icon "+i;L.DivIcon.prototype.initialize.call(this,n)}});L.icon.pulse=function(n){return new L.Icon.Pulse(n)};L.Marker.Pulse=L.Marker.extend({initialize:function(n,t){t.icon=L.icon.pulse(t);L.Marker.prototype.initialize.call(this,n,t)}});L.marker.pulse=function(n,t){return new L.Marker.Pulse(n,t)}}(window),function(){"use strict";L.CanvasIcon=L.Icon.extend({options:{iconSize:[24,24],iconAnchor:[12,12],drawIcon:null,className:"leaflet-canvas-icon"},createIcon:function(n){var t=L.point(this.options.iconSize);return n&&n.tagName=="CANVAS"||(n=document.createElement("canvas")),n.width=t.x,n.height=t.y,this._setIconStyles(n,"icon"),n},createShadow:function(){return null},_setIconStyles:function(){typeof this.options.drawIcon=="function"&&this.options.drawIcon.apply(this,arguments);L.Icon.prototype._setIconStyles.apply(this,arguments)}});L.canvasIcon=function(n){return new L.CanvasIcon(n)};typeof define=="function"&&define.amd&&define(L.CanvasIcon)}(),function(){"use strict";L.PiechartIcon=L.CanvasIcon.extend({options:{iconSize:[48,48],iconAnchor:[24,24],popupAnchor:[24,24],className:"leaflet-piechart-icon",valueField:"value",nameField:"name"},_setIconStyles:function(n,t){var r=this.options.data,u,l;if(t=="icon"&&r&&L.Util.isArray(r)&&n.getContext){var i=n.getContext("2d"),f=L.point(this.options.iconSize),a=f.divideBy(2);i.clearRect(0,0,f.x,f.y);var v=this.options.valueField,y=this._getTotal(r,v),e=a.x,o=a.y;if(y){var p=Math.min(e,o),w=Math.PI/y*2,s=-Math.PI/2,h,c;for(u=0,l=r.length;u<l;u++)i.beginPath(),c=r[u].style||this._getStyle(u,l),this._applyStyle(i,c),h=w*r[u][v]+s,i.arc(e,o,p-Math.ceil((c.lineWidth||0)/2),s,h),i.stroke(),i.lineTo(e,o),s=h,i.fill(),i.closePath()}}L.CanvasIcon.prototype._setIconStyles.apply(this,arguments)},_getTotal:function(n,t){for(var r=0,i=0,u=n.length;i<u;i++)r+=+n[i][t];return r},_applyStyle:function(n,t){for(var i in t)n[i]=t[i]},_getStyle:function(n,t){var r=function(n,t,i){var u,f,e;if(t==0)u=f=e=i;else{var o=function(n,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?n+(t-n)*6*i:i<1/2?t:i<2/3?n+(t-n)*(2/3-i)*6:n},r=i<.5?i*(1+t):i+t-i*t,s=2*i-r;u=o(s,r,n+1/3);f=o(s,r,n);e=o(s,r,n-1/3)}return Math.round(u*255)+","+Math.round(f*255)+","+Math.round(e*255)},u=360/(t*2.5),f=n%2*t,e=u*(f+(n-n%2))/360,i=r(e,.7,.5);return{fillStyle:"rgba("+i+",.6)",strokeStyle:"rgba("+i+",.7)",lineWidth:1}}});L.piechartIcon=function(n){return new L.PiechartIcon(n)};L.PiechartMarker=L.Marker.extend({options:{icon:null,radius:20,riseOnHover:!0},initialize:function(n,t){var i={},r;L.Util.extend(i,t);i.radius&&(r=i.radius*2,i.iconSize=[r,r],i.iconAnchor=[i.radius,i.radius]);i.icon=L.piechartIcon(i);L.Marker.prototype.initialize.apply(this,[n,i])}});L.piechartMarker=function(n,t){return new L.PiechartMarker(n,t)}}();!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("leaflet")):"function"==typeof define&&define.amd?define(["exports","leaflet"],t):t((n.L=n.L||{},n.L.esri={}),n.L)}(this,function(n,t){"use strict";function b(n){var i="",r,f,t,u;for(r in n.f=n.f||"json",n)n.hasOwnProperty(r)&&(t=n[r],u=Object.prototype.toString.call(t),i.length&&(i+="&"),f="[object Array]"===u?"[object Object]"===Object.prototype.toString.call(t[0])?JSON.stringify(t):t.join(","):"[object Object]"===u?JSON.stringify(t):"[object Date]"===u?t.valueOf():t,i+=encodeURIComponent(r)+"="+encodeURIComponent(f));return i}function ft(n,i){var r=new window.XMLHttpRequest;return r.onerror=function(){r.onreadystatechange=t.Util.falseFn;n.call(i,{error:{code:500,message:"XMLHttpRequest error"}},null)},r.onreadystatechange=function(){var u,f;if(4===r.readyState){try{u=JSON.parse(r.responseText)}catch(n){u=null;f={code:500,message:"Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."}}!f&&u.error&&(f=u.error,u=null);r.onerror=t.Util.falseFn;n.call(i,f,u)}},r.ontimeout=function(){this.onerror()},r}function oi(n,t,i,r){var u=ft(i,r);return u.open("POST",n),void 0!==r&&null!==r&&void 0!==r.options&&(u.timeout=r.options.timeout),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),u.send(b(t)),u}function si(n,t,i,r){var u=ft(i,r);return u.open("GET",n+"?"+b(t),!0),void 0!==r&&null!==r&&void 0!==r.options&&(u.timeout=r.options.timeout),u.send(null),u}function et(n,t,i,r){var s=b(t),u=ft(i,r),e=(n+"?"+s).length;if(e<=2e3&&f.cors?u.open("GET",n+"?"+s):e>2e3&&f.cors&&(u.open("POST",n),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8")),void 0!==r&&null!==r&&void 0!==r.options&&(u.timeout=r.options.timeout),e<=2e3&&f.cors)u.send(null);else{if(!(e>2e3&&f.cors))return e<=2e3&&!f.cors?ot(n,t,i,r):void o("a request to "+n+" was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html");u.send(s)}return u}function ot(n,i,r,u){var f,e;return window._EsriLeafletCallbacks=window._EsriLeafletCallbacks||{},f="c"+ei,i.callback="window._EsriLeafletCallbacks."+f,window._EsriLeafletCallbacks[f]=function(n){if(!0!==window._EsriLeafletCallbacks[f]){var t,i=Object.prototype.toString.call(n);"[object Object]"!==i&&"[object Array]"!==i&&(t={error:{code:500,message:"Expected array or object as JSONP response"}},n=null);!t&&n.error&&(t=n,n=null);r.call(u,t,n);window._EsriLeafletCallbacks[f]=!0}},e=t.DomUtil.create("script",null,document.body),e.type="text/javascript",e.src=n+"?"+b(i),e.id=f,e.onerror=function(n){n&&!0!==window._EsriLeafletCallbacks[f]&&(r.call(u,{error:{code:500,message:"An unknown error occurred"}}),window._EsriLeafletCallbacks[f]=!0)},t.DomUtil.addClass(e,"esri-leaflet-jsonp"),ei++,{id:f,url:e.src,abort:function(){window._EsriLeafletCallbacks._callback[f]({code:0,message:"Request aborted."})}}}function st(n){return function(n,t){for(var i=0;i<n.length;i++)if(n[i]!==t[i])return!1;return!0}(n[0],n[n.length-1])||n.push(n[0]),n}function ht(n){for(var i,u=0,t=0,f=n.length,r=n[t];t<f-1;t++)u+=((i=n[t+1])[0]-r[0])*(i[1]+r[1]),r=i;return u>=0}function ur(n,t,i,r){var o=(r[0]-i[0])*(n[1]-i[1])-(r[1]-i[1])*(n[0]-i[0]),s=(t[0]-n[0])*(n[1]-i[1])-(t[1]-n[1])*(n[0]-i[0]),u=(r[1]-i[1])*(t[0]-n[0])-(r[0]-i[0])*(t[1]-n[1]),f,e;return 0!==u&&(f=o/u,e=s/u,f>=0&&f<=1&&e>=0&&e<=1)?!0:!1}function hi(n,t){for(var r,i=0;i<n.length-1;i++)for(r=0;r<t.length-1;r++)if(ur(n[i],n[i+1],t[r],t[r+1]))return!0;return!1}function fr(n,t){var i=hi(n,t),r=function(n,t){for(var u=!1,i=-1,f=n.length,r=f-1;++i<f;r=i)(n[i][1]<=t[1]&&t[1]<n[r][1]||n[r][1]<=t[1]&&t[1]<n[i][1])&&t[0]<(n[r][0]-n[i][0])*(t[1]-n[i][1])/(n[r][1]-n[i][1])+n[i][0]&&(u=!u);return u}(n,t[0]);return!(i||!r)}function ci(n){var u=[],f=n.slice(0),i=st(f.shift().slice(0)),r,t;if(i.length>=4)for(ht(i)||i.reverse(),u.push(i),r=0;r<f.length;r++)t=st(f[r].slice(0)),t.length>=4&&(ht(t)&&t.reverse(),u.push(t));return u}function li(n){var i={};for(var t in n)n.hasOwnProperty(t)&&(i[t]=n[t]);return i}function ct(n,t){var i={},r;if(n.features)for(i.type="FeatureCollection",i.features=[],r=0;r<n.features.length;r++)i.features.push(ct(n.features[r],t));if("number"==typeof n.x&&"number"==typeof n.y&&(i.type="Point",i.coordinates=[n.x,n.y],"number"==typeof n.z&&i.coordinates.push(n.z)),n.points&&(i.type="MultiPoint",i.coordinates=n.points.slice(0)),n.paths&&(1===n.paths.length?(i.type="LineString",i.coordinates=n.paths[0].slice(0)):(i.type="MultiLineString",i.coordinates=n.paths.slice(0))),n.rings&&(i=function(n){for(var u,c,f,s,h,i,r,t=[],e=[],o=0;o<n.length;o++)u=st(n[o].slice(0)),u.length<4||(ht(u)?(c=[u.slice().reverse()],t.push(c)):e.push(u.slice().reverse()));for(f=[];e.length;){for(r=e.pop(),s=!1,i=t.length-1;i>=0;i--)if(fr(t[i][0],r)){t[i].push(r);s=!0;break}s||f.push(r)}for(;f.length;){for(r=f.pop(),h=!1,i=t.length-1;i>=0;i--)if(hi(t[i][0],r)){t[i].push(r);h=!0;break}h||t.push([r.reverse()])}return 1===t.length?{type:"Polygon",coordinates:t[0]}:{type:"MultiPolygon",coordinates:t}}(n.rings.slice(0))),"number"==typeof n.xmin&&"number"==typeof n.ymin&&"number"==typeof n.xmax&&"number"==typeof n.ymax&&(i.type="Polygon",i.coordinates=[[[n.xmax,n.ymax],[n.xmin,n.ymax],[n.xmin,n.ymin],[n.xmax,n.ymin],[n.xmax,n.ymax]]]),(n.geometry||n.attributes)&&(i.type="Feature",i.geometry=n.geometry?ct(n.geometry):null,i.properties=n.attributes?li(n.attributes):null,n.attributes))try{i.id=function(n,t){for(var i,u=t?[t,"OBJECTID","FID"]:["OBJECTID","FID"],r=0;r<u.length;r++)if(i=u[r],i in n&&("string"==typeof n[i]||"number"==typeof n[i]))return n[i];throw Error("No valid id attribute found");}(n.attributes,t)}catch(n){}return JSON.stringify(i.geometry)===JSON.stringify({})&&(i.geometry=null),n.spatialReference&&n.spatialReference.wkid&&4326!==n.spatialReference.wkid&&console.warn("Object converted in non-standard crs - "+JSON.stringify(n.spatialReference)),i}function d(n,t){t=t||"OBJECTID";var r,u={wkid:4326},i={};switch(n.type){case"Point":i.x=n.coordinates[0];i.y=n.coordinates[1];i.spatialReference=u;break;case"MultiPoint":i.points=n.coordinates.slice(0);i.spatialReference=u;break;case"LineString":i.paths=[n.coordinates.slice(0)];i.spatialReference=u;break;case"MultiLineString":i.paths=n.coordinates.slice(0);i.spatialReference=u;break;case"Polygon":i.rings=ci(n.coordinates.slice(0));i.spatialReference=u;break;case"MultiPolygon":i.rings=function(n){for(var u,i,f,r=[],t=0;t<n.length;t++)for(u=ci(n[t]),i=u.length-1;i>=0;i--)f=u[i].slice(0),r.push(f);return r}(n.coordinates.slice(0));i.spatialReference=u;break;case"Feature":n.geometry&&(i.geometry=d(n.geometry,t));i.attributes=n.properties?li(n.properties):{};n.id&&(i.attributes[t]=n.id);break;case"FeatureCollection":for(i=[],r=0;r<n.features.length;r++)i.push(d(n.features[r],t));break;case"GeometryCollection":for(i=[],r=0;r<n.geometries.length;r++)i.push(d(n.geometries[r],t))}return i}function c(n,t){return d(n,t)}function ai(n,t){return ct(n,t)}function lt(n){if("NaN"!==n.xmin&&"NaN"!==n.ymin&&"NaN"!==n.xmax&&"NaN"!==n.ymax){var i=t.latLng(n.ymin,n.xmin),r=t.latLng(n.ymax,n.xmax);return t.latLngBounds(i,r)}return null}function at(n){return{xmin:(n=t.latLngBounds(n)).getSouthWest().lng,ymin:n.getSouthWest().lat,xmax:n.getNorthEast().lng,ymax:n.getNorthEast().lat,spatialReference:{wkid:4326}}}function vi(n){var i,t;if(n.objectIdFieldName)i=n.objectIdFieldName;else if(n.fields){for(t=0;t<=n.fields.length-1;t++)if("esriFieldTypeOID"===n.fields[t].type){i=n.fields[t].name;break}if(!i)for(t=0;t<=n.fields.length-1;t++)if(n.fields[t].name.match(vt)){i=n.fields[t].name;break}}return i}function yi(n){for(var t in n.attributes)if(t.match(vt))return t}function l(n,t){var f,r=n.features||n.results,o=r.length,u,i,e;if(f=t||vi(n),u={type:"FeatureCollection",features:[]},o)for(i=r.length-1;i>=0;i--)e=ai(r[i],f||yi(r[i])),u.features.push(e);return u}function g(n){return"/"!==(n=t.Util.trim(n))[n.length-1]&&(n+="/"),n}function e(n){if(-1!==n.url.indexOf("?")){n.requestParams=n.requestParams||{};var t=n.url.substring(n.url.indexOf("?")+1);n.url=n.url.split("?")[0];n.requestParams=JSON.parse('{"'+decodeURI(t).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')}return n.url=g(n.url.split("?")[0]),n}function pi(n){return/^(?!.*utility\.arcgis\.com).*\.arcgis\.com.*FeatureServer/i.test(n)}function yt(n){var t;switch(n){case"Point":t="esriGeometryPoint";break;case"MultiPoint":t="esriGeometryMultipoint";break;case"LineString":case"MultiLineString":t="esriGeometryPolyline";break;case"Polygon":case"MultiPolygon":t="esriGeometryPolygon"}return t}function o(){console&&console.warn&&console.warn.apply(console,arguments)}function nt(n){return n.getSize().x-fi.attributionWidthOffset+"px"}function a(n){var i,r;n.attributionControl&&!n.attributionControl._esriAttributionAdded&&(n.attributionControl.setPrefix('<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet<\/a> | Powered by <a href="https://www.esri.com">Esri<\/a>'),i=document.createElement("style"),i.type="text/css",i.innerHTML=".esri-truncated-attribution:hover {white-space: normal;}",document.getElementsByTagName("head")[0].appendChild(i),t.DomUtil.addClass(n.attributionControl._container,"esri-truncated-attribution:hover"),r=document.createElement("style"),r.type="text/css",r.innerHTML=".esri-truncated-attribution {vertical-align: -3px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: inline-block;transition: 0s white-space;transition-delay: 1s;max-width: "+nt(n)+";}",document.getElementsByTagName("head")[0].appendChild(r),t.DomUtil.addClass(n.attributionControl._container,"esri-truncated-attribution"),n.on("resize",function(t){n.attributionControl._container.style.maxWidth=nt(t.target)}),n.attributionControl._esriAttributionAdded=!0)}function pt(n){var i={geometry:null,geometryType:null};return n instanceof t.LatLngBounds?(i.geometry=at(n),i.geometryType="esriGeometryEnvelope",i):(n.getLatLng&&(n=n.getLatLng()),n instanceof t.LatLng&&(n={type:"Point",coordinates:[n.lng,n.lat]}),n instanceof t.GeoJSON&&(n=n.getLayers()[0].feature.geometry,i.geometry=c(n),i.geometryType=yt(n.type)),n.toGeoJSON&&(n=n.toGeoJSON()),"Feature"===n.type&&(n=n.geometry),"Point"===n.type||"LineString"===n.type||"Polygon"===n.type||"MultiPolygon"===n.type?(i.geometry=c(n),i.geometryType=yt(n.type),i):void o("invalid geometry passed to spatial query. Should be L.LatLng, L.LatLngBounds, L.Marker or a GeoJSON Point, Line, Polygon or MultiPolygon object"))}function wi(n,i){f.cors&&et(n,{},t.Util.bind(function(n,r){var f,e,o;if(!n){for(i._esriAttributions=[],f=0;f<r.contributors.length;f++)for(e=r.contributors[f],o=0;o<e.coverageAreas.length;o++){var u=e.coverageAreas[o],s=t.latLng(u.bbox[0],u.bbox[1]),h=t.latLng(u.bbox[2],u.bbox[3]);i._esriAttributions.push({attribution:e.attribution,score:u.score,bounds:t.latLngBounds(s,h),minZoom:u.zoomMin,maxZoom:u.zoomMax})}i._esriAttributions.sort(function(n,t){return t.score-n.score});tt({target:i})}},this))}function tt(n){var i=n.target,e=i._esriAttributions,f,u,s;if(i&&i.attributionControl&&(f=i.attributionControl._container.querySelector(".esri-dynamic-attribution"),f&&e)){for(var r="",h=i.getBounds(),l=t.latLngBounds(h.getSouthWest().wrap(),h.getNorthEast().wrap()),c=i.getZoom(),o=0;o<e.length;o++)u=e[o],s=u.attribution,!r.match(s)&&u.bounds.intersects(l)&&c>=u.minZoom&&c<=u.maxZoom&&(r+=", "+s);r=r.substr(2);f.innerHTML=r;f.style.maxWidth=nt(i);i.fire("attributionupdated",{attribution:r})}}function it(n){return new bi(n)}function ki(n){return new wt(n)}function di(n){return new bt(n)}function gi(n){return new kt(n)}function gt(n){return new dt(n)}function nr(n){return new ni(n)}function tr(n){return new ti(n)}function r(n){this.values=[].concat(n||[])}var w=window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest,u=""===document.documentElement.style.pointerEvents,f={cors:w,pointerEvents:u},fi={attributionWidthOffset:55},ei=0,k=f.cors?si:ot,h,vt,wt,y,bt,kt,s,dt,ni,ti,p,ui;k.CORS=si;k.JSONP=ot;h={request:et,get:k,post:oi};vt=/^(OBJECTID|FID|OID|ID)$/i;var er={warn:o,cleanUrl:g,getUrlParams:e,isArcgisOnline:pi,geojsonTypeToArcGIS:yt,responseToFeatureCollection:l,geojsonToArcGIS:c,arcgisToGeoJSON:ai,boundsToExtent:at,extentToBounds:lt,calcAttributionWidth:nt,setEsriAttribution:a,_setGeometry:pt,_getAttributionData:wi,_updateMapAttribution:tt,_findIdAttributeFromFeature:yi,_findIdAttributeFromResponse:vi},v=t.Class.extend({options:{proxy:!1,useCors:w},generateSetter:function(n,i){return t.Util.bind(function(t){return this.params[n]=t,this},i)},initialize:function(n){var i,r;if(n.request&&n.options?(this._service=n,t.Util.setOptions(this,n.options)):(t.Util.setOptions(this,n),this.options.url=g(n.url)),this.params=t.Util.extend({},this.params||{}),this.setters)for(i in this.setters)r=this.setters[i],this[i]=this.generateSetter(r,this)},token:function(n){return this._service?this._service.authenticate(n):this.params.token=n,this},format:function(n){return this.params.returnUnformattedValues=!n,this},request:function(n,i){return this.options.requestParams&&t.Util.extend(this.params,this.options.requestParams),this._service?this._service.request(this.path,this.params,n,i):this._request("request",this.path,this.params,n,i)},_request:function(n,t,i,r,u){var f=this.options.proxy?this.options.proxy+"?"+this.options.url+t:this.options.url+t;return"get"!==n&&"request"!==n||this.options.useCors?h[n](f,i,r,u):h.get.JSONP(f,i,r,u)}}),bi=v.extend({setters:{offset:"resultOffset",limit:"resultRecordCount",fields:"outFields",precision:"geometryPrecision",featureIds:"objectIds",returnGeometry:"returnGeometry",returnM:"returnM",transform:"datumTransformation",token:"token"},path:"query",params:{returnGeometry:!0,where:"1=1",outSr:4326,outFields:"*"},within:function(n){return this._setGeometryParams(n),this.params.spatialRel="esriSpatialRelContains",this},intersects:function(n){return this._setGeometryParams(n),this.params.spatialRel="esriSpatialRelIntersects",this},contains:function(n){return this._setGeometryParams(n),this.params.spatialRel="esriSpatialRelWithin",this},crosses:function(n){return this._setGeometryParams(n),this.params.spatialRel="esriSpatialRelCrosses",this},touches:function(n){return this._setGeometryParams(n),this.params.spatialRel="esriSpatialRelTouches",this},overlaps:function(n){return this._setGeometryParams(n),this.params.spatialRel="esriSpatialRelOverlaps",this},bboxIntersects:function(n){return this._setGeometryParams(n),this.params.spatialRel="esriSpatialRelEnvelopeIntersects",this},indexIntersects:function(n){return this._setGeometryParams(n),this.params.spatialRel="esriSpatialRelIndexIntersects",this},nearby:function(n,i){return n=t.latLng(n),this.params.geometry=[n.lng,n.lat],this.params.geometryType="esriGeometryPoint",this.params.spatialRel="esriSpatialRelIntersects",this.params.units="esriSRUnit_Meter",this.params.distance=i,this.params.inSr=4326,this},where:function(n){return this.params.where=n,this},between:function(n,t){return this.params.time=[n.valueOf(),t.valueOf()],this},simplify:function(n,t){var i=Math.abs(n.getBounds().getWest()-n.getBounds().getEast());return this.params.maxAllowableOffset=i/n.getSize().y*t,this},orderBy:function(n,t){return t=t||"ASC",this.params.orderByFields=this.params.orderByFields?this.params.orderByFields+",":"",this.params.orderByFields+=[n,t].join(" "),this},run:function(n,t){return this._cleanParams(),this.options.isModern||pi(this.options.url)?(this.params.f="geojson",this.request(function(i,r){this._trapSQLerrors(i);n.call(t,i,r,r)},this)):this.request(function(i,r){this._trapSQLerrors(i);n.call(t,i,r&&l(r),r)},this)},count:function(n,t){return this._cleanParams(),this.params.returnCountOnly=!0,this.request(function(t,i){n.call(this,t,i&&i.count,i)},t)},ids:function(n,t){return this._cleanParams(),this.params.returnIdsOnly=!0,this.request(function(t,i){n.call(this,t,i&&i.objectIds,i)},t)},bounds:function(n,t){return this._cleanParams(),this.params.returnExtentOnly=!0,this.request(function(i,r){r&&r.extent&&lt(r.extent)?n.call(t,i,lt(r.extent),r):(i={message:"Invalid Bounds"},n.call(t,i,null,r))},t)},distinct:function(){return this.params.returnGeometry=!1,this.params.returnDistinctValues=!0,this},pixelSize:function(n){var i=t.point(n);return this.params.pixelSize=[i.x,i.y],this},layer:function(n){return this.path=n+"/query",this},_trapSQLerrors:function(n){n&&"400"===n.code&&o("one common syntax error in query requests is encasing string values in double quotes instead of single quotes")},_cleanParams:function(){delete this.params.returnIdsOnly;delete this.params.returnExtentOnly;delete this.params.returnCountOnly},_setGeometryParams:function(n){this.params.inSr=4326;var t=pt(n);this.params.geometry=t.geometry;this.params.geometryType=t.geometryType}});wt=v.extend({setters:{contains:"contains",text:"searchText",fields:"searchFields",spatialReference:"sr",sr:"sr",layers:"layers",returnGeometry:"returnGeometry",maxAllowableOffset:"maxAllowableOffset",precision:"geometryPrecision",dynamicLayers:"dynamicLayers",returnZ:"returnZ",returnM:"returnM",gdbVersion:"gdbVersion",token:"token"},path:"find",params:{sr:4326,contains:!0,returnGeometry:!0,returnZ:!0,returnM:!1},layerDefs:function(n,t){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[n,t].join(":"),this},simplify:function(n,t){var i=Math.abs(n.getBounds().getWest()-n.getBounds().getEast());return this.params.maxAllowableOffset=i/n.getSize().y*t,this},run:function(n,t){return this.request(function(i,r){n.call(t,i,r&&l(r),r)},t)}});y=v.extend({path:"identify",between:function(n,t){return this.params.time=[n.valueOf(),t.valueOf()],this}});bt=y.extend({setters:{layers:"layers",precision:"geometryPrecision",tolerance:"tolerance",returnGeometry:"returnGeometry"},params:{sr:4326,layers:"all",tolerance:3,returnGeometry:!0},on:function(n){var t=at(n.getBounds()),i=n.getSize();return this.params.imageDisplay=[i.x,i.y,96],this.params.mapExtent=[t.xmin,t.ymin,t.xmax,t.ymax],this},at:function(n){return 2===n.length&&(n=t.latLng(n)),this._setGeometryParams(n),this},layerDef:function(n,t){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[n,t].join(":"),this},simplify:function(n,t){var i=Math.abs(n.getBounds().getWest()-n.getBounds().getEast());return this.params.maxAllowableOffset=i/n.getSize().y*t,this},run:function(n,t){return this.request(function(i,r){var f,u;if(i)n.call(t,i,void 0,r);else{for(f=l(r),r.results=r.results.reverse(),u=0;u<f.features.length;u++)f.features[u].layerId=r.results[u].layerId;n.call(t,void 0,f,r)}})},_setGeometryParams:function(n){var t=pt(n);this.params.geometry=t.geometry;this.params.geometryType=t.geometryType}});kt=y.extend({setters:{setMosaicRule:"mosaicRule",setRenderingRule:"renderingRule",setPixelSize:"pixelSize",returnCatalogItems:"returnCatalogItems",returnGeometry:"returnGeometry"},params:{returnGeometry:!1},at:function(n){return n=t.latLng(n),this.params.geometry=JSON.stringify({x:n.lng,y:n.lat,spatialReference:{wkid:4326}}),this.params.geometryType="esriGeometryPoint",this},getMosaicRule:function(){return this.params.mosaicRule},getRenderingRule:function(){return this.params.renderingRule},getPixelSize:function(){return this.params.pixelSize},run:function(n,t){return this.request(function(i,r){n.call(t,i,r&&this._responseToGeoJSON(r),r)},this)},_responseToGeoJSON:function(n){var u=n.location,f=n.catalogItems,r=n.catalogItemVisibilities,t={pixel:{type:"Feature",geometry:{type:"Point",coordinates:[u.x,u.y]},crs:{type:"EPSG",properties:{code:u.spatialReference.wkid}},properties:{OBJECTID:n.objectId,name:n.name,value:n.value},id:n.objectId}},i;if(n.properties&&n.properties.Values&&(t.pixel.properties.values=n.properties.Values),f&&f.features&&(t.catalogItems=l(f),r&&r.length===t.catalogItems.features.length))for(i=r.length-1;i>=0;i--)t.catalogItems.features[i].properties.catalogItemVisibility=r[i];return t}});s=t.Evented.extend({options:{proxy:!1,useCors:w,timeout:0},initialize:function(n){n=n||{};this._requestQueue=[];this._authenticating=!1;t.Util.setOptions(this,n);this.options.url=g(this.options.url)},get:function(n,t,i,r){return this._request("get",n,t,i,r)},post:function(n,t,i,r){return this._request("post",n,t,i,r)},request:function(n,t,i,r){return this._request("request",n,t,i,r)},metadata:function(n,t){return this._request("get","",{},n,t)},authenticate:function(n){return this._authenticating=!1,this.options.token=n,this._runQueue(),this},getTimeout:function(){return this.options.timeout},setTimeout:function(n){this.options.timeout=n},_request:function(n,i,r,u,f){var e,o;if(this.fire("requeststart",{url:this.options.url+i,params:r,method:n},!0),e=this._createServiceCallback(n,i,r,u,f),this.options.token&&(r.token=this.options.token),this.options.requestParams&&t.Util.extend(r,this.options.requestParams),!this._authenticating)return o=this.options.proxy?this.options.proxy+"?"+this.options.url+i:this.options.url+i,"get"!==n&&"request"!==n||this.options.useCors?h[n](o,r,e,f):h.get.JSONP(o,r,e,f);this._requestQueue.push([n,i,r,u,f])},_createServiceCallback:function(n,i,r,u,f){return t.Util.bind(function(e,o){e&&(499===e.code||498===e.code)&&(this._authenticating=!0,this._requestQueue.push([n,i,r,u,f]),this.fire("authenticationrequired",{authenticate:t.Util.bind(this.authenticate,this)},!0),e.authenticate=t.Util.bind(this.authenticate,this));u.call(f,e,o);e?this.fire("requesterror",{url:this.options.url+i,params:r,message:e.message,code:e.code,method:n},!0):this.fire("requestsuccess",{url:this.options.url+i,params:r,response:o,method:n},!0);this.fire("requestend",{url:this.options.url+i,params:r,method:n},!0)},this)},_runQueue:function(){for(var t,n=this._requestQueue.length-1;n>=0;n--)t=this._requestQueue[n],this[t.shift()].apply(this,t);this._requestQueue=[]}});dt=s.extend({identify:function(){return di(this)},find:function(){return ki(this)},query:function(){return it(this)}});ni=s.extend({query:function(){return it(this)},identify:function(){return gi(this)}});ti=s.extend({options:{idAttribute:"OBJECTID"},query:function(){return it(this)},addFeature:function(n,t,i){this.addFeatures(n,t,i)},addFeatures:function(n,t,i){for(var r=n.features?n.features:[n],u=r.length-1;u>=0;u--)delete r[u].id;return n=c(n),n=r.length>1?n:[n],this.post("addFeatures",{features:n},function(n,r){var u=r&&r.addResults?r.addResults.length>1?r.addResults:r.addResults[0]:void 0;t&&t.call(i,n||r.addResults[0].error,u)},i)},updateFeature:function(n,t,i){this.updateFeatures(n,t,i)},updateFeatures:function(n,t,i){var r=n.features?n.features:[n];return n=c(n,this.options.idAttribute),n=r.length>1?n:[n],this.post("updateFeatures",{features:n},function(n,r){var u=r&&r.updateResults?r.updateResults.length>1?r.updateResults:r.updateResults[0]:void 0;t&&t.call(i,n||r.updateResults[0].error,u)},i)},deleteFeature:function(n,t,i){this.deleteFeatures(n,t,i)},deleteFeatures:function(n,t,i){return this.post("deleteFeatures",{objectIds:n},function(n,r){var u=r&&r.deleteResults?r.deleteResults.length>1?r.deleteResults:r.deleteResults[0]:void 0;t&&t.call(i,n||r.deleteResults[0].error,u)},i)}});var i="https:"!==window.location.protocol?"http:":"https:",rt=t.TileLayer.extend({statics:{TILES:{Streets:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/World_Street_Map"}},Topographic:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/World_Topo_Map"}},Oceans:{urlTemplate:i+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/Ocean_Basemap"}},OceansLabels:{urlTemplate:i+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:u?"esri-labels":"tilePane",attribution:""}},NationalGeographic:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"National Geographic, DeLorme, HERE, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, increment P Corp."}},DarkGray:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"HERE, DeLorme, MapmyIndia, &copy; OpenStreetMap contributors"}},DarkGrayLabels:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:u?"esri-labels":"tilePane",attribution:""}},Gray:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"HERE, DeLorme, MapmyIndia, &copy; OpenStreetMap contributors"}},GrayLabels:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:u?"esri-labels":"tilePane",attribution:""}},Imagery:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community",attributionUrl:"https://static.arcgis.com/attribution/World_Imagery"}},ImageryLabels:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:u?"esri-labels":"tilePane",attribution:""}},ImageryTransportation:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:u?"esri-labels":"tilePane",attribution:""}},ShadedRelief:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"USGS"}},ShadedReliefLabels:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:12,subdomains:["server","services"],pane:u?"esri-labels":"tilePane",attribution:""}},Terrain:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"USGS, NOAA"}},TerrainLabels:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],pane:u?"esri-labels":"tilePane",attribution:""}},USATopo:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:15,subdomains:["server","services"],attribution:"USGS, National Geographic Society, i-cubed"}},ImageryClarity:{urlTemplate:i+"//clarity.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,attribution:"Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community"}},Physical:{urlTemplate:i+"//{s}.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:8,subdomains:["server","services"],attribution:"U.S. National Park Service"}},ImageryFirefly:{urlTemplate:i+"//fly.maptiles.arcgis.com/arcgis/rest/services/World_Imagery_Firefly/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,attribution:"Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community",attributionUrl:"https://static.arcgis.com/attribution/World_Imagery"}}}},initialize:function(n,i){var r,u;if("object"==typeof n&&n.urlTemplate&&n.options)r=n;else{if("string"!=typeof n||!rt.TILES[n])throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of "Streets", "Topographic", "Oceans", "OceansLabels", "NationalGeographic", "Physical", "Gray", "GrayLabels", "DarkGray", "DarkGrayLabels", "Imagery", "ImageryLabels", "ImageryTransportation", "ImageryClarity", "ImageryFirefly", ShadedRelief", "ShadedReliefLabels", "Terrain", "TerrainLabels" or "USATopo"');r=rt.TILES[n]}u=t.Util.extend(r.options,i);t.Util.setOptions(this,u);this.options.token&&-1===r.urlTemplate.indexOf("token=")&&(r.urlTemplate+="?token="+this.options.token);this.options.proxy&&(r.urlTemplate=this.options.proxy+"?"+r.urlTemplate);t.TileLayer.prototype.initialize.call(this,r.urlTemplate,u)},onAdd:function(n){a(n);"esri-labels"===this.options.pane&&this._initPane();this.options.attributionUrl&&wi((this.options.proxy?this.options.proxy+"?":"")+this.options.attributionUrl,n);n.on("moveend",tt);t.TileLayer.prototype.onAdd.call(this,n)},onRemove:function(n){n.off("moveend",tt);t.TileLayer.prototype.onRemove.call(this,n)},_initPane:function(){if(!this._map.getPane(this.options.pane)){var n=this._map.createPane(this.options.pane);n.style.pointerEvents="none";n.style.zIndex=500}},getAttribution:function(){if(this.options.attribution)var n='<span class="esri-dynamic-attribution">'+this.options.attribution+"<\/span>";return n}}),ii=t.TileLayer.extend({options:{zoomOffsetAllowance:.1,errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEABAMAAACuXLVVAAAAA1BMVEUzNDVszlHHAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAAAAAAAAAB6mUWpAAAADZJREFUeJztwQEBAAAAgiD/r25IQAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7waBAAABw08RwAAAAABJRU5ErkJggg=="},statics:{MercatorZoomLevels:{0:156543.033928,1:78271.5169639999,2:39135.7584820001,3:19567.8792409999,4:9783.93962049996,5:4891.96981024998,6:2445.98490512499,7:1222.99245256249,8:611.49622628138,9:305.748113140558,10:152.874056570411,11:76.4370282850732,12:38.2185141425366,13:19.1092570712683,14:9.55462853563415,15:4.77731426794937,16:2.38865713397468,17:1.19432856685505,18:.597164283559817,19:.298582141647617,20:.14929107082381,21:.07464553541191,22:.0373227677059525,23:.0186613838529763}},initialize:function(n){n=e(n=t.Util.setOptions(this,n));this.tileUrl=(n.proxy?n.proxy+"?":"")+n.url+"tile/{z}/{y}/{x}"+(n.requestParams&&Object.keys(n.requestParams).length>0?t.Util.getParamString(n.requestParams):"");-1!==n.url.indexOf("{s}")&&n.subdomains&&(n.url=n.url.replace("{s}",n.subdomains[0]));this.service=gt(n);this.service.addEventParent(this);new RegExp(/tiles.arcgis(online)?\.com/g).test(n.url)&&(this.tileUrl=this.tileUrl.replace("://tiles","://tiles{s}"),n.subdomains=["1","2","3","4"]);this.options.token&&(this.tileUrl+="?token="+this.options.token);t.TileLayer.prototype.initialize.call(this,this.tileUrl,n)},getTileUrl:function(n){var i=this._getZoomForUrl();return t.Util.template(this.tileUrl,t.Util.extend({s:this._getSubdomain(n),x:n.x,y:n.y,z:this._lodMap&&this._lodMap[i]?this._lodMap[i]:i},this.options))},createTile:function(n,i){var r=document.createElement("img");return t.DomEvent.on(r,"load",t.Util.bind(this._tileOnLoad,this,i,r)),t.DomEvent.on(r,"error",t.Util.bind(this._tileOnError,this,i,r)),this.options.crossOrigin&&(r.crossOrigin=""),r.alt="",!this._lodMap||this._lodMap&&this._lodMap[this._getZoomForUrl()]?r.src=this.getTileUrl(n):this.once("lodmap",function(){r.src=this.getTileUrl(n)},this),r},onAdd:function(n){a(n);this._lodMap||this.metadata(function(i,r){var u,e,s,l;if(!i&&r.spatialReference)if(u=r.spatialReference.latestWkid||r.spatialReference.wkid,!this.options.attribution&&n.attributionControl&&r.copyrightText&&(this.options.attribution=r.copyrightText,n.attributionControl.addAttribution(this.getAttribution())),n.options.crs!==t.CRS.EPSG3857||102100!==u&&3857!==u)n.options.crs&&n.options.crs.code&&n.options.crs.code.indexOf(u)>-1||o("L.esri.TiledMapLayer is using a non-mercator spatial reference. Support may be available through Proj4Leaflet http://esri.github.io/esri-leaflet/examples/non-mercator-projection.html");else{this._lodMap={};for(var h=r.tileInfo.lods,c=ii.MercatorZoomLevels,f=0;f<h.length;f++){e=h[f];for(s in c)if(l=c[s],this._withinPercentage(e.resolution,l,this.options.zoomOffsetAllowance)){this._lodMap[s]=e.level;break}}this.fire("lodmap")}},this);t.TileLayer.prototype.onAdd.call(this,n)},metadata:function(n,t){return this.service.metadata(n,t),this},identify:function(){return this.service.identify()},find:function(){return this.service.find()},query:function(){return this.service.query()},authenticate:function(n){var t="?token="+n;return this.tileUrl=this.options.token?this.tileUrl.replace(/\?token=(.+)/g,t):this.tileUrl+t,this.options.token=n,this.service.authenticate(n),this},_withinPercentage:function(n,t,i){return Math.abs(n/t-1)<i}}),or=t.ImageOverlay.extend({onAdd:function(n){this._topLeft=n.getPixelBounds().min;t.ImageOverlay.prototype.onAdd.call(this,n)},_reset:function(){this._map.options.crs===t.CRS.EPSG3857?t.ImageOverlay.prototype._reset.call(this):t.DomUtil.setPosition(this._image,this._topLeft.subtract(this._map.getPixelOrigin()))}}),ri=t.Layer.extend({options:{opacity:1,position:"front",f:"image",useCors:w,attribution:null,interactive:!1,alt:""},onAdd:function(n){a(n);this.options.zIndex&&(this.options.position=null);this._update=t.Util.throttle(this._update,this.options.updateInterval,this);n.on("moveend",this._update,this);this._currentImage&&this._currentImage._bounds.equals(this._map.getBounds())?n.addLayer(this._currentImage):this._currentImage&&(this._map.removeLayer(this._currentImage),this._currentImage=null);this._update();this._popup&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this));this.metadata(function(t,i){!t&&!this.options.attribution&&n.attributionControl&&i.copyrightText&&(this.options.attribution=i.copyrightText,n.attributionControl.addAttribution(this.getAttribution()))},this)},onRemove:function(){this._currentImage&&this._map.removeLayer(this._currentImage);this._popup&&(this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this));this._map.off("moveend",this._update,this)},bindPopup:function(n,i){return this._shouldRenderPopup=!1,this._lastClick=!1,this._popup=t.popup(i),this._popupFunction=n,this._map&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this)),this},unbindPopup:function(){return this._map&&(this._map.closePopup(this._popup),this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._popup=!1,this},bringToFront:function(){return this.options.position="front",this._currentImage&&(this._currentImage.bringToFront(),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this.options.position="back",this._currentImage&&(this._currentImage.bringToBack(),this._setAutoZIndex(Math.min)),this},setZIndex:function(n){return this.options.zIndex=n,this._currentImage&&this._currentImage.setZIndex(n),this},_setAutoZIndex:function(n){if(this._currentImage){for(var r,u=this._currentImage.getPane().children,t=-n(-1/0,1/0),i=0,f=u.length;i<f;i++)r=u[i].style.zIndex,u[i]!==this._currentImage._image&&r&&(t=n(t,+r));isFinite(t)&&(this.options.zIndex=t+n(-1,1),this.setZIndex(this.options.zIndex))}},getAttribution:function(){return this.options.attribution},getOpacity:function(){return this.options.opacity},setOpacity:function(n){return this.options.opacity=n,this._currentImage&&this._currentImage.setOpacity(n),this},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(n,t){return this.options.from=n,this.options.to=t,this._update(),this},metadata:function(n,t){return this.service.metadata(n,t),this},authenticate:function(n){return this.service.authenticate(n),this},redraw:function(){this._update()},_renderImage:function(n,t,i){if(this._map){if(i&&(n="data:"+i+";base64,"+n),!n)return;var r=new or(n,t,{opacity:0,crossOrigin:this.options.useCors,alt:this.options.alt,pane:this.options.pane||this.getPane(),interactive:this.options.interactive}).addTo(this._map),u=function(n){if(r.off("error",u,this),this._map){var f=n.target,i=this._currentImage;f._bounds.equals(t)&&f._bounds.equals(this._map.getBounds())?(this._currentImage=f,"front"===this.options.position?this.bringToFront():"back"===this.options.position&&this.bringToBack(),this.options.zIndex&&this.setZIndex(this.options.zIndex),this._map&&this._currentImage._map?this._currentImage.setOpacity(this.options.opacity):this._currentImage._map.removeLayer(this._currentImage),i&&this._map&&this._map.removeLayer(i),i&&i._map&&i._map.removeLayer(i)):this._map.removeLayer(f)}this.fire("load",{bounds:t})};r.once("error",function(){this._map.removeLayer(r);this.fire("error");r.off("load",u,this)},this);r.once("load",u,this);this.fire("loading",{bounds:t})}},_update:function(){var i,r,n;this._map&&(i=this._map.getZoom(),r=this._map.getBounds(),this._animatingZoom||this._map._panTransition&&this._map._panTransition._inProgress||(i>this.options.maxZoom||i<this.options.minZoom?this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null):(n=this._buildExportParams(),t.Util.extend(n,this.options.requestParams),n?this._requestExport(n,r):this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null))))},_renderPopup:function(n,i,r,u){if(n=t.latLng(n),this._shouldRenderPopup&&this._lastClick.equals(n)){var f=this._popupFunction(i,r,u);f&&this._popup.setLatLng(n).setContent(f).openOn(this._map)}},_resetPopupState:function(n){this._shouldRenderPopup=!1;this._lastClick=n.latlng},_calculateBbox:function(){var i=this._map.getPixelBounds(),r=this._map.unproject(i.getBottomLeft()),u=this._map.unproject(i.getTopRight()),f=this._map.options.crs.project(u),e=this._map.options.crs.project(r),n=t.bounds(f,e);return[n.getBottomLeft().x,n.getBottomLeft().y,n.getTopRight().x,n.getTopRight().y].join(",")},_calculateImageSize:function(){var t=this._map.getPixelBounds(),n=this._map.getSize(),u=this._map.unproject(t.getBottomLeft()),f=this._map.unproject(t.getTopRight()),i=this._map.latLngToLayerPoint(f).y,r=this._map.latLngToLayerPoint(u).y;return(i>0||r<n.y)&&(n.y=r-i),n.x+","+n.y}}),ir=ri.extend({options:{updateInterval:150,format:"jpgpng",transparent:!0,f:"image"},query:function(){return this.service.query()},identify:function(){return this.service.identify()},initialize:function(n){n=e(n);this.service=nr(n);this.service.addEventParent(this);t.Util.setOptions(this,n)},setPixelType:function(n){return this.options.pixelType=n,this._update(),this},getPixelType:function(){return this.options.pixelType},setBandIds:function(n){return this.options.bandIds=t.Util.isArray(n)?n.join(","):n.toString(),this._update(),this},getBandIds:function(){return this.options.bandIds},setNoData:function(n,i){return this.options.noData=t.Util.isArray(n)?n.join(","):n.toString(),i&&(this.options.noDataInterpretation=i),this._update(),this},getNoData:function(){return this.options.noData},getNoDataInterpretation:function(){return this.options.noDataInterpretation},setRenderingRule:function(n){this.options.renderingRule=n;this._update()},getRenderingRule:function(){return this.options.renderingRule},setMosaicRule:function(n){this.options.mosaicRule=n;this._update()},getMosaicRule:function(){return this.options.mosaicRule},_getPopupData:function(n){var r=t.Util.bind(function(i,r,u){i||setTimeout(t.Util.bind(function(){this._renderPopup(n.latlng,i,r,u)},this),300)},this),i=this.identify().at(n.latlng);this.options.mosaicRule&&i.setMosaicRule(this.options.mosaicRule);i.run(r);this._shouldRenderPopup=!0;this._lastClick=n.latlng},_buildExportParams:function(){var t=parseInt(this._map.options.crs.code.split(":")[1],10),n={bbox:this._calculateBbox(),size:this._calculateImageSize(),format:this.options.format,transparent:this.options.transparent,bboxSR:t,imageSR:t};return this.options.from&&this.options.to&&(n.time=this.options.from.valueOf()+","+this.options.to.valueOf()),this.options.pixelType&&(n.pixelType=this.options.pixelType),this.options.interpolation&&(n.interpolation=this.options.interpolation),this.options.compressionQuality&&(n.compressionQuality=this.options.compressionQuality),this.options.bandIds&&(n.bandIds=this.options.bandIds),(0===this.options.noData||this.options.noData)&&(n.noData=this.options.noData),this.options.noDataInterpretation&&(n.noDataInterpretation=this.options.noDataInterpretation),this.service.options.token&&(n.token=this.service.options.token),this.options.renderingRule&&(n.renderingRule=JSON.stringify(this.options.renderingRule)),this.options.mosaicRule&&(n.mosaicRule=JSON.stringify(this.options.mosaicRule)),n},_requestExport:function(n,i){"json"===this.options.f?this.service.request("exportImage",n,function(n,t){n||(this.options.token&&(t.href+="?token="+this.options.token),this.options.proxy&&(t.href=this.options.proxy+"?"+t.href),this._renderImage(t.href,i))},this):(n.f="image",this._renderImage(this.options.url+"exportImage"+t.Util.getParamString(n),i))}}),rr=ri.extend({options:{updateInterval:150,layers:!1,layerDefs:!1,timeOptions:!1,format:"png24",transparent:!0,f:"json"},initialize:function(n){n=e(n);this.service=gt(n);this.service.addEventParent(this);(n.proxy||n.token)&&"json"!==n.f&&(n.f="json");t.Util.setOptions(this,n)},getDynamicLayers:function(){return this.options.dynamicLayers},setDynamicLayers:function(n){return this.options.dynamicLayers=n,this._update(),this},getLayers:function(){return this.options.layers},setLayers:function(n){return this.options.layers=n,this._update(),this},getLayerDefs:function(){return this.options.layerDefs},setLayerDefs:function(n){return this.options.layerDefs=n,this._update(),this},getTimeOptions:function(){return this.options.timeOptions},setTimeOptions:function(n){return this.options.timeOptions=n,this._update(),this},query:function(){return this.service.query()},identify:function(){return this.service.identify()},find:function(){return this.service.find()},_getPopupData:function(n){var i,u=t.Util.bind(function(i,r,u){i||setTimeout(t.Util.bind(function(){this._renderPopup(n.latlng,i,r,u)},this),300)},this),r;if((i=this.options.popup?this.options.popup.on(this._map).at(n.latlng):this.identify().on(this._map).at(n.latlng)).params.maxAllowableOffset||i.simplify(this._map,.5),this.options.popup&&this.options.popup.params&&this.options.popup.params.layers||(this.options.layers?i.layers("visible:"+this.options.layers.join(",")):i.layers("visible")),this.options.layerDefs&&"string"!=typeof this.options.layerDefs&&!i.params.layerDefs)for(r in this.options.layerDefs)this.options.layerDefs.hasOwnProperty(r)&&i.layerDef(r,this.options.layerDefs[r]);i.run(u);this._shouldRenderPopup=!0;this._lastClick=n.latlng},_buildExportParams:function(){var t=parseInt(this._map.options.crs.code.split(":")[1],10),n={bbox:this._calculateBbox(),size:this._calculateImageSize(),dpi:96,format:this.options.format,transparent:this.options.transparent,bboxSR:t,imageSR:t};if(this.options.dynamicLayers&&(n.dynamicLayers=this.options.dynamicLayers),this.options.layers){if(0===this.options.layers.length)return;n.layers="show:"+this.options.layers.join(",")}return this.options.layerDefs&&(n.layerDefs="string"==typeof this.options.layerDefs?this.options.layerDefs:JSON.stringify(this.options.layerDefs)),this.options.timeOptions&&(n.timeOptions=JSON.stringify(this.options.timeOptions)),this.options.from&&this.options.to&&(n.time=this.options.from.valueOf()+","+this.options.to.valueOf()),this.service.options.token&&(n.token=this.service.options.token),this.options.proxy&&(n.proxy=this.options.proxy),this.options.disableCache&&(n._ts=Date.now()),n},_requestExport:function(n,i){"json"===this.options.f?this.service.request("export",n,function(n,t){n||(this.options.token&&(t.href+="?token="+this.options.token),this.options.proxy&&(t.href=this.options.proxy+"?"+t.href),t.href?this._renderImage(t.href,i):this._renderImage(t.imageData,i,t.contentType))},this):(n.f="image",this._renderImage(this.options.url+"export"+t.Util.getParamString(n),i))}}),ut=t.Layer.extend({options:{cellSize:512,updateInterval:150},initialize:function(n){n=t.setOptions(this,n);this._zooming=!1},onAdd:function(n){this._map=n;this._update=t.Util.throttle(this._update,this.options.updateInterval,this);this._reset();this._update()},onRemove:function(){this._map.removeEventListener(this.getEvents(),this);this._removeCells()},getEvents:function(){return{moveend:this._update,zoomstart:this._zoomstart,zoomend:this._reset}},addTo:function(n){return n.addLayer(this),this},removeFrom:function(n){return n.removeLayer(this),this},_zoomstart:function(){this._zooming=!0},_reset:function(){this._removeCells();this._cells={};this._activeCells={};this._cellsToLoad=0;this._cellsTotal=0;this._cellNumBounds=this._getCellNumBounds();this._resetWrap();this._zooming=!1},_resetWrap:function(){var t=this._map,n=t.options.crs,i;n.infinite||(i=this._getCellSize(),n.wrapLng&&(this._wrapLng=[Math.floor(t.project([0,n.wrapLng[0]]).x/i),Math.ceil(t.project([0,n.wrapLng[1]]).x/i)]),n.wrapLat&&(this._wrapLat=[Math.floor(t.project([n.wrapLat[0],0]).y/i),Math.ceil(t.project([n.wrapLat[1],0]).y/i)]))},_getCellSize:function(){return this.options.cellSize},_update:function(){if(this._map){var n=this._map.getPixelBounds(),i=this._getCellSize(),r=t.bounds(n.min.divideBy(i).floor(),n.max.divideBy(i).floor());this._removeOtherCells(r);this._addCells(r);this.fire("cellsupdated")}},_addCells:function(n){for(var i,e,f=[],o=n.getCenter(),s=this._map.getZoom(),r,u=n.min.y;u<=n.max.y;u++)for(i=n.min.x;i<=n.max.x;i++)(e=t.point(i,u)).z=s,this._isValidCell(e)&&f.push(e);if(r=f.length,0!==r)for(this._cellsToLoad+=r,this._cellsTotal+=r,f.sort(function(n,t){return n.distanceTo(o)-t.distanceTo(o)}),i=0;i<r;i++)this._addCell(f[i])},_isValidCell:function(n){var r=this._map.options.crs,i,u;return!r.infinite&&((i=this._cellNumBounds,!i)||!r.wrapLng&&(n.x<i.min.x||n.x>i.max.x)||!r.wrapLat&&(n.y<i.min.y||n.y>i.max.y))?!1:this.options.bounds?(u=this._cellCoordsToBounds(n),t.latLngBounds(this.options.bounds).intersects(u)):!0},_cellCoordsToBounds:function(n){var i=this._map,r=this.options.cellSize,u=n.multiplyBy(r),f=u.add([r,r]),e=i.wrapLatLng(i.unproject(u,n.z)),o=i.wrapLatLng(i.unproject(f,n.z));return t.latLngBounds(e,o)},_cellCoordsToKey:function(n){return n.x+":"+n.y},_keyToCellCoords:function(n){var i=n.split(":"),r=parseInt(i[0],10),u=parseInt(i[1],10);return t.point(r,u)},_removeOtherCells:function(n){for(var t in this._cells)n.contains(this._keyToCellCoords(t))||this._removeCell(t)},_removeCell:function(n){var t=this._activeCells[n];t&&(delete this._activeCells[n],this.cellLeave&&this.cellLeave(t.bounds,t.coords),this.fire("cellleave",{bounds:t.bounds,coords:t.coords}))},_removeCells:function(){var n,t,i;for(n in this._cells)t=this._cells[n].bounds,i=this._cells[n].coords,this.cellLeave&&this.cellLeave(t,i),this.fire("cellleave",{bounds:t,coords:i})},_addCell:function(n){this._wrapCoords(n);var i=this._cellCoordsToKey(n),t=this._cells[i];t&&!this._activeCells[i]&&(this.cellEnter&&this.cellEnter(t.bounds,n),this.fire("cellenter",{bounds:t.bounds,coords:n}),this._activeCells[i]=t);t||(t={coords:n,bounds:this._cellCoordsToBounds(n)},this._cells[i]=t,this._activeCells[i]=t,this.createCell&&this.createCell(t.bounds,n),this.fire("cellcreate",{bounds:t.bounds,coords:n}))},_wrapCoords:function(n){n.x=this._wrapLng?t.Util.wrapNum(n.x,this._wrapLng):n.x;n.y=this._wrapLat?t.Util.wrapNum(n.y,this._wrapLat):n.y},_getCellNumBounds:function(){var n=this._map.getPixelWorldBounds(),i=this._getCellSize();return n?t.bounds(n.min.divideBy(i).floor(),n.max.divideBy(i).ceil().subtract([1,1])):null}});r.prototype.query=function(n){var t=this.getIndex(n);return this.values[t]};r.prototype.getIndex=function(n){this.dirty&&this.sort();for(var t,u,r=0,i=this.values.length-1;r<=i;)if(t=(r+i)/2|0,+(u=this.values[Math.round(t)]).value<+n)r=t+1;else{if(!(+u.value>+n))return t;i=t-1}return Math.abs(~i)};r.prototype.between=function(n,t){var r=this.getIndex(n),i=this.getIndex(t);if(0===r&&0===i)return[];for(;this.values[r-1]&&this.values[r-1].value===n;)r--;for(;this.values[i+1]&&this.values[i+1].value===t;)i++;return this.values[i]&&this.values[i].value===t&&this.values[i+1]&&i++,this.values.slice(r,i)};r.prototype.insert=function(n){return this.values.splice(this.getIndex(n.value),0,n),this};r.prototype.bulkAdd=function(n,t){return this.values=this.values.concat([].concat(n||[])),t?this.sort():this.dirty=!0,this};r.prototype.sort=function(){return this.values.sort(function(n,t){return+t.value-+n.value}).reverse(),this.dirty=!1,this};p=ut.extend({options:{attribution:null,where:"1=1",fields:["*"],from:!1,to:!1,timeField:!1,timeFilterMode:"server",simplifyFactor:0,precision:6},initialize:function(n){if(ut.prototype.initialize.call(this,n),n=e(n),n=t.Util.setOptions(this,n),this.service=tr(n),this.service.addEventParent(this),"*"!==this.options.fields[0]){for(var u=!1,i=0;i<this.options.fields.length;i++)this.options.fields[i].match(/^(OBJECTID|FID|OID|ID)$/i)&&(u=!0);!1===u&&o("no known esriFieldTypeOID field detected in fields Array.  Please add an attribute field containing unique IDs to ensure the layer can be drawn correctly.")}this.options.timeField.start&&this.options.timeField.end?(this._startTimeIndex=new r,this._endTimeIndex=new r):this.options.timeField&&(this._timeIndex=new r);this._cache={};this._currentSnapshot=[];this._activeRequests=0},onAdd:function(n){return a(n),this.service.metadata(function(t,i){if(!t){var r=i.supportedQueryFormats,u=!1;!1===this.service.options.isModern&&(u=!0);!u&&r&&-1!==r.indexOf("geoJSON")&&(this.service.options.isModern=!0);i.objectIdField&&(this.service.options.idAttribute=i.objectIdField);!this.options.attribution&&n.attributionControl&&i.copyrightText&&(this.options.attribution=i.copyrightText,n.attributionControl.addAttribution(this.getAttribution()))}},this),n.on("zoomend",this._handleZoomChange,this),ut.prototype.onAdd.call(this,n)},onRemove:function(n){return n.off("zoomend",this._handleZoomChange,this),ut.prototype.onRemove.call(this,n)},getAttribution:function(){return this.options.attribution},createCell:function(n,t){this._visibleZoom()&&this._requestFeatures(n,t)},_requestFeatures:function(n,i,r){return this._activeRequests++,1===this._activeRequests&&this.fire("loading",{bounds:n},!0),this._buildQuery(n).run(function(u,f,e){e&&e.exceededTransferLimit&&this.fire("drawlimitexceeded");!u&&f&&f.features.length&&t.Util.requestAnimFrame(t.Util.bind(function(){this._addFeatures(f.features,i);this._postProcessFeatures(n)},this));u||!f||f.features.length||this._postProcessFeatures(n);u&&this._postProcessFeatures(n);r&&r.call(this,u,f)},this)},_postProcessFeatures:function(n){this._activeRequests--;this._activeRequests<=0&&this.fire("load",{bounds:n})},_cacheKey:function(n){return n.z+":"+n.x+":"+n.y},_addFeatures:function(n,t){var r=this._cacheKey(t),u,i;for(this._cache[r]=this._cache[r]||[],u=n.length-1;u>=0;u--)i=n[u].id,-1===this._currentSnapshot.indexOf(i)&&this._currentSnapshot.push(i),-1===this._cache[r].indexOf(i)&&this._cache[r].push(i);this.options.timeField&&this._buildTimeIndexes(n);this.createLayers(n)},_buildQuery:function(n){var i=this.service.query().intersects(n).where(this.options.where).fields(this.options.fields).precision(this.options.precision);return this.options.requestParams&&t.Util.extend(i.params,this.options.requestParams),this.options.simplifyFactor&&i.simplify(this._map,this.options.simplifyFactor),"server"===this.options.timeFilterMode&&this.options.from&&this.options.to&&i.between(this.options.from,this.options.to),i},setWhere:function(n,i,r){var e,c,l;this.options.where=n&&n.length?n:"1=1";for(var o=[],u=[],s=0,h=null,a=t.Util.bind(function(n,f){if(n&&(h=n),f)for(var e=f.features.length-1;e>=0;e--)u.push(f.features[e].id);--s<=0&&this._visibleZoom()&&(this._currentSnapshot=u,t.Util.requestAnimFrame(t.Util.bind(function(){this.removeLayers(o);this.addLayers(u);i&&i.call(r,h)},this)))},this),f=this._currentSnapshot.length-1;f>=0;f--)o.push(this._currentSnapshot[f]);for(e in this._activeCells)s++,c=this._keyToCellCoords(e),l=this._cellCoordsToBounds(c),this._requestFeatures(l,e,a);return this},getWhere:function(){return this.options.where},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(n,i,r,u){var o=this.options.from,s=this.options.to,f=0,h=null,a=t.Util.bind(function(t){t&&(h=t);this._filterExistingFeatures(o,s,n,i);f--;r&&f<=0&&r.call(u,h)},this),e,c,l;if(this.options.from=n,this.options.to=i,this._filterExistingFeatures(o,s,n,i),"server"===this.options.timeFilterMode)for(e in this._activeCells)f++,c=this._keyToCellCoords(e),l=this._cellCoordsToBounds(c),this._requestFeatures(l,e,a);return this},refresh:function(){var n,t,i;for(n in this._activeCells)t=this._keyToCellCoords(n),i=this._cellCoordsToBounds(t),this._requestFeatures(i,n);this.redraw&&this.once("load",function(){this.eachFeature(function(n){this._redraw(n.feature.id)},this)},this)},_filterExistingFeatures:function(n,i,r,u){var o=n&&i?this._getFeaturesInTimeRange(n,i):this._currentSnapshot,f=this._getFeaturesInTimeRange(r,u),e,s;if(f.indexOf)for(e=0;e<f.length;e++)s=o.indexOf(f[e]),s>=0&&o.splice(s,1);t.Util.requestAnimFrame(t.Util.bind(function(){this.removeLayers(o);this.addLayers(f)},this))},_getFeaturesInTimeRange:function(n,t){var i,u=[],f,e,r;for(this.options.timeField.start&&this.options.timeField.end?(f=this._startTimeIndex.between(n,t),e=this._endTimeIndex.between(n,t),i=f.concat(e)):i=this._timeIndex.between(n,t),r=i.length-1;r>=0;r--)u.push(i[r].id);return u},_buildTimeIndexes:function(n){var t,i,r,u,f;if(this.options.timeField.start&&this.options.timeField.end){for(r=[],u=[],t=n.length-1;t>=0;t--)i=n[t],r.push({id:i.id,value:new Date(i.properties[this.options.timeField.start])}),u.push({id:i.id,value:new Date(i.properties[this.options.timeField.end])});this._startTimeIndex.bulkAdd(r);this._endTimeIndex.bulkAdd(u)}else{for(f=[],t=n.length-1;t>=0;t--)i=n[t],f.push({id:i.id,value:new Date(i.properties[this.options.timeField])});this._timeIndex.bulkAdd(f)}},_featureWithinTimeRange:function(n){var t,i,r,u,f;return!this.options.from||!this.options.to?!0:(t=+this.options.from.valueOf(),i=+this.options.to.valueOf(),"string"==typeof this.options.timeField)?(r=+n.properties[this.options.timeField],r>=t&&r<=i):this.options.timeField.start&&this.options.timeField.end?(u=+n.properties[this.options.timeField.start],f=+n.properties[this.options.timeField.end],u>=t&&u<=i||f>=t&&f<=i):void 0},_visibleZoom:function(){if(!this._map)return!1;var n=this._map.getZoom();return!(n>this.options.maxZoom||n<this.options.minZoom)},_handleZoomChange:function(){var t,i,n;if(this._visibleZoom())for(t in this._activeCells)i=this._activeCells[t].coords,n=this._cacheKey(i),this._cache[n]&&this.addLayers(this._cache[n]);else this.removeLayers(this._currentSnapshot),this._currentSnapshot=[]},authenticate:function(n){return this.service.authenticate(n),this},metadata:function(n,t){return this.service.metadata(n,t),this},query:function(){return this.service.query()},_getMetadata:function(n){this._metadata?n(void 0,this._metadata):this.metadata(t.Util.bind(function(t,i){this._metadata=i;n(t,this._metadata)},this))},addFeature:function(n,t,i){this.addFeatures(n,t,i)},addFeatures:function(n,i,r){this._getMetadata(t.Util.bind(function(u,f){if(u)i&&i.call(this,u,null);else{var e=n.features?n.features:[n];this.service.addFeatures(n,t.Util.bind(function(n,t){if(!n){for(var u=e.length-1;u>=0;u--)e[u].properties[f.objectIdField]=e.length>1?t[u].objectId:t.objectId,e[u].id=e.length>1?t[u].objectId:t.objectId;this.createLayers(e)}i&&i.call(r,n,t)},this))}},this))},updateFeature:function(n,t,i){this.updateFeatures(n,t,i)},updateFeatures:function(n,t,i){var r=n.features?n.features:[n];this.service.updateFeatures(n,function(n,u){if(!n){for(var f=r.length-1;f>=0;f--)this.removeLayers([r[f].id],!0);this.createLayers(r)}t&&t.call(i,n,u)},this)},deleteFeature:function(n,t,i){this.deleteFeatures(n,t,i)},deleteFeatures:function(n,t,i){return this.service.deleteFeatures(n,function(n,r){var f=r.length?r:[r],u;if(!n&&f.length>0)for(u=f.length-1;u>=0;u--)this.removeLayers([f[u].objectId],!0);t&&t.call(i,n,r)},this)}});ui=p.extend({options:{cacheLayers:!0},initialize:function(n){p.prototype.initialize.call(this,n);this._originalStyle=this.options.style;this._layers={}},onRemove:function(n){for(var t in this._layers)n.removeLayer(this._layers[t]),this.fire("removefeature",{feature:this._layers[t].feature,permanent:!1},!0);return p.prototype.onRemove.call(this,n)},createNewLayer:function(n){var i=t.GeoJSON.geometryToLayer(n,this.options);return i&&(i.defaultOptions=i.options),i},_updateLayer:function(n,i){var r=[],u=this.options.coordsToLatLng||t.GeoJSON.coordsToLatLng;switch(i.properties&&(n.feature.properties=i.properties),i.geometry.type){case"Point":r=t.GeoJSON.coordsToLatLng(i.geometry.coordinates);n.setLatLng(r);break;case"LineString":r=t.GeoJSON.coordsToLatLngs(i.geometry.coordinates,0,u);n.setLatLngs(r);break;case"MultiLineString":case"Polygon":r=t.GeoJSON.coordsToLatLngs(i.geometry.coordinates,1,u);n.setLatLngs(r);break;case"MultiPolygon":r=t.GeoJSON.coordsToLatLngs(i.geometry.coordinates,2,u);n.setLatLngs(r)}},createLayers:function(n){for(var t,r,i,u=n.length-1;u>=0;u--)r=n[u],i=this._layers[r.id],this._visibleZoom()&&i&&!this._map.hasLayer(i)&&(this._map.addLayer(i),this.fire("addfeature",{feature:i.feature},!0)),i&&this.options.simplifyFactor>0&&(i.setLatLngs||i.setLatLng)&&this._updateLayer(i,r),i||((t=this.createNewLayer(r))?(t.feature=r,t.addEventParent(this),this.options.onEachFeature&&this.options.onEachFeature(t.feature,t),this._layers[t.feature.id]=t,this.setFeatureStyle(t.feature.id,this.options.style),this.fire("createfeature",{feature:t.feature},!0),this._visibleZoom()&&(!this.options.timeField||this.options.timeField&&this._featureWithinTimeRange(r))&&this._map.addLayer(t)):o("invalid GeoJSON encountered"))},addLayers:function(n){for(var i,t=n.length-1;t>=0;t--)i=this._layers[n[t]],i&&this._map.addLayer(i)},removeLayers:function(n,t){for(var u,i,r=n.length-1;r>=0;r--)u=n[r],i=this._layers[u],i&&(this.fire("removefeature",{feature:i.feature,permanent:t},!0),this._map.removeLayer(i)),i&&t&&delete this._layers[u]},cellEnter:function(n,i){this._visibleZoom()&&!this._zooming&&this._map&&t.Util.requestAnimFrame(t.Util.bind(function(){var t=this._cacheKey(i),r=this._cellCoordsToKey(i),n=this._cache[t];this._activeCells[r]&&n&&this.addLayers(n)},this))},cellLeave:function(n,i){this._zooming||t.Util.requestAnimFrame(t.Util.bind(function(){var t,r,u;if(this._map){var e=this._cacheKey(i),f=this._cellCoordsToKey(i),n=this._cache[e],o=this._map.getBounds();if(!this._activeCells[f]&&n){for(t=!0,r=0;r<n.length;r++)u=this._layers[n[r]],u&&u.getBounds&&o.intersects(u.getBounds())&&(t=!1);t&&this.removeLayers(n,!this.options.cacheLayers);!this.options.cacheLayers&&t&&(delete this._cache[e],delete this._cells[f],delete this._activeCells[f])}}},this))},resetStyle:function(){return this.options.style=this._originalStyle,this.eachFeature(function(n){this.resetFeatureStyle(n.feature.id)},this),this},setStyle:function(n){return this.options.style=n,this.eachFeature(function(t){this.setFeatureStyle(t.feature.id,n)},this),this},resetFeatureStyle:function(n){var i=this._layers[n],r=this._originalStyle||t.Path.prototype.options;return i&&(t.Util.extend(i.options,i.defaultOptions),this.setFeatureStyle(n,r)),this},setFeatureStyle:function(n,t){var i=this._layers[n];return"function"==typeof t&&(t=t(i.feature)),i.setStyle&&i.setStyle(t),this},eachActiveFeature:function(n,t){var r,i;if(this._map){r=this._map.getBounds();for(i in this._layers)-1!==this._currentSnapshot.indexOf(this._layers[i].feature.id)&&("function"==typeof this._layers[i].getLatLng&&r.contains(this._layers[i].getLatLng())?n.call(t,this._layers[i]):"function"==typeof this._layers[i].getBounds&&r.intersects(this._layers[i].getBounds())&&n.call(t,this._layers[i]))}return this},eachFeature:function(n,t){for(var i in this._layers)n.call(t,this._layers[i]);return this},getFeature:function(n){return this._layers[n]},bringToBack:function(){this.eachFeature(function(n){n.bringToBack&&n.bringToBack()})},bringToFront:function(){this.eachFeature(function(n){n.bringToFront&&n.bringToFront()})},redraw:function(n){return n&&this._redraw(n),this},_redraw:function(n){var i=this._layers[n],r=i.feature,u,f;i&&i.setIcon&&this.options.pointToLayer&&this.options.pointToLayer&&(u=this.options.pointToLayer(r,t.latLng(r.geometry.coordinates[1],r.geometry.coordinates[0])).options.icon,i.setIcon(u));i&&i.setStyle&&this.options.pointToLayer&&(f=this.options.pointToLayer(r,t.latLng(r.geometry.coordinates[1],r.geometry.coordinates[0])).options,this.setFeatureStyle(r.id,f));i&&i.setStyle&&this.options.style&&this.resetStyle(r.id)}});n.VERSION="2.2.4";n.Support=f;n.options=fi;n.Util=er;n.get=k;n.post=oi;n.request=et;n.Task=v;n.task=function(n){return n=e(n),new v(n)};n.Query=bi;n.query=it;n.Find=wt;n.find=ki;n.Identify=y;n.identify=function(n){return new y(n)};n.IdentifyFeatures=bt;n.identifyFeatures=di;n.IdentifyImage=kt;n.identifyImage=gi;n.Service=s;n.service=function(n){return n=e(n),new s(n)};n.MapService=dt;n.mapService=gt;n.ImageService=ni;n.imageService=nr;n.FeatureLayerService=ti;n.featureLayerService=tr;n.BasemapLayer=rt;n.basemapLayer=function(n,t){return new rt(n,t)};n.TiledMapLayer=ii;n.tiledMapLayer=function(n,t){return new ii(n,t)};n.RasterLayer=ri;n.ImageMapLayer=ir;n.imageMapLayer=function(n,t){return new ir(n,t)};n.DynamicMapLayer=rr;n.dynamicMapLayer=function(n,t){return new rr(n,t)};n.FeatureManager=p;n.FeatureLayer=ui;n.featureLayer=function(n){return new ui(n)};Object.defineProperty(n,"__esModule",{value:!0})});L.ResponsivePopup=L.Popup.extend({options:{hasTip:!0},_initLayout:function(){var n="leaflet-popup",i=this._container=L.DomUtil.create("div",n+" "+(this.options.className||"")+" leaflet-zoom-animated"),r=this._wrapper=L.DomUtil.create("div",n+"-content-wrapper",i),t;this._contentNode=L.DomUtil.create("div",n+"-content",r);L.DomEvent.disableClickPropagation(r);L.DomEvent.disableScrollPropagation(this._contentNode);L.DomEvent.on(r,"contextmenu",L.DomEvent.stopPropagation);if(this._tipContainer=L.DomUtil.create("div",n+"-tip-container",i),this.options.hasTip||(this._tipContainer.style.visibility="hidden"),this._tip=L.DomUtil.create("div",n+"-tip",this._tipContainer),this.options.closeButton){t=this._closeButton=L.DomUtil.create("a",n+"-close-button",i);t.href="#close";t.innerHTML="&#215;";L.DomEvent.on(t,"click",this._onCloseButtonClick,this)}},_updatePosition:function(){var v,y,d,g,nt,tt,i;if(this._map){var i=this._map.latLngToLayerPoint(this._latlng),t=this._map.layerPointToContainerPoint(i),u=this._container.offsetWidth,f=this._container.offsetHeight,it=L.point(this.options.autoPanPadding),o=L.point(this.options.autoPanPaddingTopLeft||it),s=L.point(this.options.autoPanPaddingBottomRight||it),e=this._map.getSize(),n=this._getAnchor(),rt=L.point(this.options.offset),ut=11,h=22,c=12,l=Math.abs(rt.x),a=Math.abs(rt.y);this.options.hasTip&&(l+=ut,a+=ut,L.DomUtil.removeClass(this._container,"leaflet-resp-popup-north"),L.DomUtil.removeClass(this._container,"leaflet-resp-popup-south"),L.DomUtil.removeClass(this._container,"leaflet-resp-popup-east"),L.DomUtil.removeClass(this._container,"leaflet-resp-popup-west"),L.DomUtil.removeClass(this._container,"leaflet-resp-popup-north-east"),L.DomUtil.removeClass(this._container,"leaflet-resp-popup-north-west"),L.DomUtil.removeClass(this._container,"leaflet-resp-popup-south-east"),L.DomUtil.removeClass(this._container,"leaflet-resp-popup-south-west"),L.DomUtil.removeClass(this._container,"leaflet-resp-popup-east-north"),L.DomUtil.removeClass(this._container,"leaflet-resp-popup-east-south"),L.DomUtil.removeClass(this._container,"leaflet-resp-popup-west-north"),L.DomUtil.removeClass(this._container,"leaflet-resp-popup-west-south"));var p=!0,w=!0,b=!0,k=!0,r=!1;t.y+n.y-a-f-Math.abs(o.y)<0&&(p=!1);t.y+n.y+a+f+Math.abs(s.y)>e.y&&(w=!1);t.x+n.x-l-u-Math.abs(o.x)<0&&(b=!1);t.x+n.x+l+u+Math.abs(s.x)>e.x&&(k=!1);v=u/2-n.x;y=f/2-n.y;(p||w)&&(d=t.x+n.x-u/2,g=t.x+n.x+u/2,d<Math.abs(o.x)&&(v=u/2-n.x-Math.abs(o.x)+d),g>e.x-Math.abs(s.x)&&(v=u/2-n.x+g-e.x+Math.abs(s.x)));(b||k)&&(nt=t.y+n.y-f/2,tt=t.y+n.y+f/2,nt<Math.abs(o.y)&&(y=f/2-n.y-Math.abs(o.y)+nt),tt>e.y-Math.abs(s.y)&&(y=f/2-n.y+tt-e.y+Math.abs(s.y)));p?(r=i.subtract(L.point(v,-n.y+f+a,!0)),this.options.hasTip&&(t.x+n.x<o.x+c+h/2?(r.x=i.x+n.x,L.DomUtil.addClass(this._container,"leaflet-resp-popup-north-east"),this._tipContainer.style.top=f+"px",this._tipContainer.style.left="0px"):t.x+n.x>e.x-s.x-c-h/2?(r.x=i.x+n.x-u,L.DomUtil.addClass(this._container,"leaflet-resp-popup-north-west"),this._tipContainer.style.top=f+"px",this._tipContainer.style.left=u+"px"):(L.DomUtil.addClass(this._container,"leaflet-resp-popup-north"),this._tipContainer.style.top=f+"px",this._tipContainer.style.left=i.x+n.x-r.x+"px"))):b?(r=i.subtract(L.point(-n.x+u+l,y,!0)),this.options.hasTip&&(t.y+n.y<o.y+c+h/2?(r.y=i.y+n.y,L.DomUtil.addClass(this._container,"leaflet-resp-popup-west-south"),this._tipContainer.style.top="0px",this._tipContainer.style.left=u+"px"):t.y+n.y>e.y-s.y-c-h/2?(r.y=i.y+n.y-f,L.DomUtil.addClass(this._container,"leaflet-resp-popup-west-north"),this._tipContainer.style.top=f+"px",this._tipContainer.style.left=u+"px"):(L.DomUtil.addClass(this._container,"leaflet-resp-popup-west"),this._tipContainer.style.top=i.y+n.y-r.y+"px",this._tipContainer.style.left=u+"px"))):w?(r=i.subtract(L.point(v,-n.y-a,!0)),this.options.hasTip&&(t.x+n.x<o.x+c+h/2?(r.x=i.x+n.x,L.DomUtil.addClass(this._container,"leaflet-resp-popup-south-east"),this._tipContainer.style.top="0px",this._tipContainer.style.left="0px"):t.x+n.x>e.x-s.x-c-h/2?(r.x=i.x+n.x-u,L.DomUtil.addClass(this._container,"leaflet-resp-popup-south-west"),this._tipContainer.style.top="0px",this._tipContainer.style.left=u+"px"):(L.DomUtil.addClass(this._container,"leaflet-resp-popup-south"),this._tipContainer.style.top="0px",this._tipContainer.style.left=i.x+n.x-r.x+"px"))):k?(r=i.subtract(L.point(-n.x-l,y,!0)),this.options.hasTip&&(t.y+n.y<o.y+c+h/2?(r.y=i.y+n.y,L.DomUtil.addClass(this._container,"leaflet-resp-popup-east-south"),this._tipContainer.style.top="0px",this._tipContainer.style.left="0px"):t.y+n.y>e.y-s.y-c-h/2?(r.y=i.y+n.y-f,L.DomUtil.addClass(this._container,"leaflet-resp-popup-east-north"),this._tipContainer.style.top=f+"px",this._tipContainer.style.left="0px"):(L.DomUtil.addClass(this._container,"leaflet-resp-popup-east"),this._tipContainer.style.top=i.y+n.y-r.y+"px",this._tipContainer.style.left="0px"))):(i=this._map.latLngToLayerPoint(this._map.getCenter()),r=i.subtract(L.point(u/2,f/2)),this.options.hasTip);t.x<0||t.y<0||t.x>e.x||t.y>e.y;u-Math.abs(o.x)-Math.abs(s.x)>e.x||f-Math.abs(o.y)-Math.abs(s.y)>e.y;L.DomUtil.setPosition(this._container,r)}}});L.responsivePopup=function(n,t){return new L.ResponsivePopup(n,t)};typeof exports=="object"&&typeof module!="undefined"&&(exports.responsivePopup=L.responsivePopup,exports.ResponsivePopup=L.ResponsivePopup)