!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 t,i,r=1,u=arguments.length;r<u;r++){i=arguments[r];for(t in i)n[t]=i[t]}return n}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||++rh,n._leaflet_id}function uf(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 hr(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 g(){return!1}function lt(n,t){var i=Math.pow(10,void 0===t?6:t);return Math.round(n*i)/i}function ff(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function yi(n){return ff(n).split(/\s+/)}function l(n,t){n.hasOwnProperty("options")||(n.options=n.options?pu(n.options):{});for(var i in t)n.options[i]=t[i];return n.options}function rs(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 us(n,t){return n.replace(wc,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 fs(n,t){for(var i=0;i<n.length;i++)if(n[i]===t)return i;return-1}function ef(n){return window["webkit"+n]||window["moz"+n]||window["ms"+n]}function es(n){var t=+new Date,i=Math.max(0,16-(t-uh));return uh=t+i,window.setTimeout(n,i)}function d(n,t,i){if(!i||be!==es)return be.call(window,c(n,t));n.call(t)}function rt(n){n&&fh.call(window,n)}function kt(){}function rc(n){if("undefined"!=typeof L&&L&&L.Mixin){n=pt(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)}}function t(n,t,i){this.x=i?Math.round(n):n;this.y=i?Math.round(t):t}function u(n,i,r){return n instanceof t?n:pt(n)?new t(n[0],n[1]):void 0===n||null===n?n:"object"==typeof n&&"x"in n&&"y"in n?new t(n.x,n.y):new t(n,i,r)}function v(n,t){if(n)for(var r=t?[n,t]:n,i=0,u=r.length;i<u;i++)this.extend(r[i])}function at(n,t){return!n||n instanceof v?n:new v(n,t)}function nt(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 nt?n:new nt(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:pt(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:void 0===n||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 of(n,t,i,r){if(pt(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 cr(n,t,i,r){return new of(n,t,i,r)}function os(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function ss(n,t){for(var i,e,o,r,u="",f=0,s=n.length;f<s;f++){for(i=0,e=(o=n[f]).length;i<e;i++)r=o[i],u+=(i?"L":"M")+r.x+" "+r.y;u+=t?bu?"z":"x":""}return u||"M0 0"}function vt(n){return navigator.userAgent.toLowerCase().indexOf(n)>=0}function uc(n,t,i,r){return"touchstart"===t?ec(n,i,r):"touchmove"===t?hc(n,i,r):"touchend"===t&&cc(n,i,r),this}function fc(n,t,i){var r=n["_leaflet_"+t+i];return"touchstart"===t?n.removeEventListener(oo,r,!1):"touchmove"===t?n.removeEventListener(so,r,!1):"touchend"===t&&(n.removeEventListener(ho,r,!1),n.removeEventListener(co,r,!1)),this}function ec(n,t,i){var r=c(function(n){if("mouse"!==n.pointerType&&n.MSPOINTER_TYPE_MOUSE&&n.pointerType!==n.MSPOINTER_TYPE_MOUSE){if(!(rl.indexOf(n.target.tagName)<0))return;ut(n)}sf(n,t)});n["_leaflet_touchstart"+i]=r;n.addEventListener(oo,r,!1);yh||(document.documentElement.addEventListener(oo,oc,!0),document.documentElement.addEventListener(so,sc,!0),document.documentElement.addEventListener(ho,hs,!0),document.documentElement.addEventListener(co,hs,!0),yh=!0)}function oc(n){ir[n.pointerId]=n;lo++}function sc(n){ir[n.pointerId]&&(ir[n.pointerId]=n)}function hs(n){delete ir[n.pointerId];lo--}function sf(n,t){n.touches=[];for(var i in ir)n.touches.push(ir[i]);n.changedTouches=[n];t(n)}function hc(n,t,i){var r=function(n){(n.pointerType!==n.MSPOINTER_TYPE_MOUSE&&"mouse"!==n.pointerType||0!==n.buttons)&&sf(n,t)};n["_leaflet_touchmove"+i]=r;n.addEventListener(so,r,!1)}function cc(n,t,i){var r=function(n){sf(n,t)};n["_leaflet_touchend"+i]=r;n.addEventListener(ho,r,!1);n.addEventListener(co,r,!1)}function cs(n,t,i){function f(n){var i,t,f;if(st){if(!wr||"mouse"===n.pointerType)return;i=lo}else i=n.touches.length;i>1||(t=Date.now(),f=t-(u||t),r=n.touches?n.touches[0]:n,o=f>0&&f<=s,u=t)}function e(n){if(o&&!r.cancelBubble){if(st){if(!wr||"mouse"===n.pointerType)return;var i,f,e={};for(f in r)i=r[f],e[f]=i&&i.bind?i.bind(r):i;r=e}r.type="dblclick";t(r);u=null}}var u,r,o=!1,s=250;return n[rr+du+i]=f,n[rr+gu+i]=e,n[rr+"dblclick"+i]=t,n.addEventListener(du,f,!1),n.addEventListener(gu,e,!1),n.addEventListener("dblclick",t,!1),this}function ls(n,t){var i=n[rr+du+t],r=n[rr+gu+t],u=n[rr+"dblclick"+t];return n.removeEventListener(du,i,!1),n.removeEventListener(gu,r,!1),wr||n.removeEventListener("dblclick",u,!1),this}function i(n,t,i,r){var f,u,e;if("object"==typeof t)for(f in t)uu(n,f,t[f],i);else for(u=0,e=(t=yi(t)).length;u<e;u++)uu(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)hf(n,f,t[f],i);else if(t)for(u=0,o=(t=yi(t)).length;u<o;u++)hf(n,t[u],i,r);else{for(e in n[ht])hf(n,e,n[ht][e]);delete n[ht]}return this}function uu(n,t,i,r){var f=t+o(i)+(r?"_"+o(r):""),u,e;if(n[ht]&&n[ht][f])return this;u=function(t){return i.call(r||n,t||window.event)};e=u;st&&0===t.indexOf("touch")?uc(n,t,u,f):!wt||"dblclick"!==t||!cs||st&&kr?"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;fu(n,t)&&e(t)},n.addEventListener("mouseenter"===t?"mouseover":"mouseout",u,!1)):("click"===t&&nr&&(u=function(n){lc(n,e)}),n.addEventListener(t,u,!1)):"attachEvent"in n&&n.attachEvent("on"+t,u):cs(n,u,f);n[ht]=n[ht]||{};n[ht][f]=u}function hf(n,t,i,r){var u=t+o(i)+(r?"_"+o(r):""),f=n[ht]&&n[ht][u];if(!f)return this;st&&0===t.indexOf("touch")?fc(n,t,u):!wt||"dblclick"!==t||!ls||st&&kr?"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):ls(n,u);n[ht][u]=null}function oi(n){return n.stopPropagation?n.stopPropagation():n.originalEvent?n.originalEvent._stopped=!0:n.cancelBubble=!0,af(n),this}function cf(n){return uu(n,"mousewheel",oi),this}function lr(n){return i(n,"mousedown touchstart dblclick",oi),uu(n,"click",lf),this}function ut(n){return n.preventDefault?n.preventDefault():n.returnValue=!1,this}function yt(n){return ut(n),oi(n),this}function as(n,i){if(!i)return new t(n.clientX,n.clientY);var r=i.getBoundingClientRect(),u=r.width/i.offsetWidth||1,f=r.height/i.offsetHeight||1;return new t(n.clientX/u-r.left-i.clientLeft,n.clientY/f-r.top-i.clientTop)}function vs(n){return wr?n.wheelDeltaY/2:n.deltaY&&0===n.deltaMode?-n.deltaY/ul: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 lf(n){ao[n.type]=!0}function af(n){var t=ao[n.type];return ao[n.type]=!1,t}function fu(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 lc(n,t){var r=n.timeStamp||n.originalEvent&&n.originalEvent.timeStamp,i=de&&r-de;i&&i>100&&i<500||n.target._simulatedClick&&!n._simulated?yt(n):(de=r,t(n))}function ys(n){return"string"==typeof n?document.getElementById(n):n}function ar(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 a(n){var t=n.parentNode;t&&t.removeChild(n)}function vf(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function pi(n){var t=n.parentNode;t.lastChild!==n&&t.appendChild(n)}function wi(n){var t=n.parentNode;t.firstChild!==n&&t.insertBefore(n,t.firstChild)}function yf(n,t){if(void 0!==n.classList)return n.classList.contains(t);var i=eu(n);return i.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(i)}function r(n,t){var i;if(void 0!==n.classList)for(var u=yi(t),r=0,f=u.length;r<f;r++)n.classList.add(u[r]);else yf(n,t)||(i=eu(n),pf(n,(i?i+" ":"")+t))}function p(n,t){void 0!==n.classList?n.classList.remove(t):pf(n,ff((" "+eu(n)+" ").replace(" "+t+" "," ")))}function pf(n,t){void 0===n.className.baseVal?n.className=t:n.className.baseVal=t}function eu(n){return void 0===n.className.baseVal?n.className:n.className.baseVal}function ft(n,t){"opacity"in n.style?n.style.opacity=t:"filter"in n.style&&ac(n,t)}function ac(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+")"}function ou(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[vo]=(fo?"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;et?si(n,t):(n.style.left=t.x+"px",n.style.top=t.y+"px")}function hi(n){return n._leaflet_pos||new t(0,0)}function wf(){i(window,"dragstart",ut)}function bf(){w(window,"dragstart",ut)}function kf(n){for(;-1===n.tabIndex;)n=n.parentNode;n.style&&(su(),nf=n,yo=n.style.outline,n.style.outline="none",i(window,"keydown",su))}function su(){nf&&(nf.style.outline=yo,nf=void 0,yo=void 0,w(window,"keydown",su))}function ps(n,t){if(!t||!n.length)return n.slice();var i=t*t;return n=yc(n,i),n=vc(n,i)}function ws(n,t,i){return Math.sqrt(vr(n,t,i,!0))}function vc(n,t){var r=n.length,u=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(r),i,f;for(u[0]=u[r-1]=1,df(n,u,t,0,r-1),f=[],i=0;i<r;i++)u[i]&&f.push(n[i]);return f}function df(n,t,i,r,u){for(var f,s,o=0,e=r+1;e<=u-1;e++)(s=vr(n[e],n[r],n[u],!0))>o&&(f=e,o=s);o>i&&(t[f]=1,df(n,t,i,r,f),df(n,t,i,f,u))}function yc(n,t){for(var r=[n[0]],i=1,u=0,f=n.length;i<f;i++)pc(n[i],n[u])>t&&(r.push(n[i]),u=i);return u<f-1&&r.push(n[f-1]),r}function bs(n,t,i,r,u){var h,o,s,f=r?bh:ci(n,i),e=ci(t,i);for(bh=e;;){if(!(f|e))return[n,t];if(f&e)return!1;s=ci(o=hu(n,t,h=f||e,i,u),i);h===f?(n=o,f=s):(t=o,e=s)}}function hu(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 ci(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 pc(n,t){var i=t.x-n.x,r=t.y-n.y;return i*i+r*r}function vr(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 c>0&&((h=((n.x-o)*f+(n.y-s)*e)/c)>1?(o=r.x,s=r.y):h>0&&(o+=f*h,s+=e*h)),f=n.x-o,e=n.y-s,u?f*f+e*e:new t(o,s)}function dt(n){return!pt(n[0])||"object"!=typeof n[0][0]&&void 0!==n[0][0]}function ks(n){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),dt(n)}function ds(n,t,i){for(var e,c,h,o,s,u,f,a=[1,4,2,8],r=0,l=n.length;r<l;r++)n[r]._code=ci(n[r],t);for(h=0;h<4;h++){for(u=a[h],e=[],r=0,c=(l=n.length)-1;r<l;c=r++)o=n[r],s=n[c],o._code&u?s._code&u||((f=hu(s,o,u,t,i))._code=ci(f,t),e.push(f)):(s._code&u&&((f=hu(s,o,u,t,i))._code=ci(f,t),e.push(f)),e.push(o));n=e}return n}function gf(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||ne,l;if(!f&&!r)return null;switch(r.type){case"Point":return u=c(f),h?h(n,u):new tu(u);case"MultiPoint":for(i=0,o=f.length;i<o;i++)u=c(f[i]),s.push(h?h(n,u):new tu(u));return new vi(s);case"LineString":case"MultiLineString":return e=cu(f,"LineString"===r.type?0:1,c),new ni(e,t);case"Polygon":case"MultiPolygon":return e=cu(f,"Polygon"===r.type?1:2,c),new er(e,t);case"GeometryCollection":for(i=0,o=r.geometries.length;i<o;i++)l=gf({geometry:r.geometries[i],type:"Feature",properties:n.properties},t),l&&s.push(l);return new vi(s);default:throw new Error("Invalid GeoJSON object.");}}function ne(n){return new h(n[1],n[0],n[2])}function cu(n,t,i){for(var u,f=[],r=0,e=n.length;r<e;r++)u=t?cu(n[r],t-1,i):(i||ne)(n[r]),f.push(u);return f}function te(n,t){return t="number"==typeof t?t:6,void 0!==n.alt?[lt(n.lng,t),lt(n.lat,t),lt(n.alt,t)]:[lt(n.lng,t),lt(n.lat,t)]}function lu(n,t,i,r){for(var u=[],f=0,e=n.length;f<e;f++)u.push(t?lu(n[f],t-1,i,r):te(n[f],r));return!t&&i&&u.push(u[0]),u}function bi(n,t){return n.feature?s({},n.feature,{geometry:t}):au(t)}function au(n){return"Feature"===n.type||"FeatureCollection"===n.type?n:{type:"Feature",properties:{},geometry:n}}function gs(n,t){return new ti(n,t)}function nh(n,t){return new iu(n,t)}function ie(n){return vh?new is(n):null}function re(n){return bu||ku?new sr(n):null}var th=Object.freeze,tt,ki,ue,di,fe,vu,ee,yu,ot,it,li,oe,se,he,ce,le,ae,ve,ye,pe,ih;Object.freeze=function(n){return n};var pu=Object.create||function(){function n(){}return function(t){return n.prototype=t,new n}}(),rh=0,wc=/\{ *([\w_-]+) *\}/g,pt=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},we="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",uh=0,be=window.requestAnimationFrame||ef("RequestAnimationFrame")||es,fh=window.cancelAnimationFrame||ef("CancelAnimationFrame")||ef("CancelRequestAnimationFrame")||function(n){window.clearTimeout(n)},bc=(Object.freeze||Object)({freeze:th,extend:s,create:pu,bind:c,lastId:rh,stamp:o,throttle:uf,wrapNum:hr,falseFn:g,formatNum:lt,trim:ff,splitWords:yi,setOptions:l,getParamString:rs,template:us,isArray:pt,indexOf:fs,emptyImageUrl:we,requestFn:be,cancelFn:fh,requestAnimFrame:d,cancelAnimFrame:rt});kt.extend=function(n){var i=function(){this.initialize&&this.initialize.apply(this,arguments);this.callInitHooks()},u=i.__super__=this.prototype,t=pu(u),r;t.constructor=i;i.prototype=t;for(r in this)this.hasOwnProperty(r)&&"prototype"!==r&&"__super__"!==r&&(i[r]=this[r]);return n.statics&&(s(i,n.statics),delete n.statics),n.includes&&(rc(n.includes),s.apply(null,[t].concat(n.includes)),delete n.includes),t.options&&(n.options=s(pu(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};kt.include=function(n){return s(this.prototype,n),this};kt.mergeOptions=function(n){return s(this.prototype.options,n),this};kt.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=yi(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=yi(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=g,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=g;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;ki=kt.extend(tt);ue=Math.trunc||function(n){return n>0?Math.floor(n):Math.ceil(n)};t.prototype={clone:function(){return new t(this.x,this.y)},add:function(n){return this.clone()._add(u(n))},_add:function(n){return this.x+=n.x,this.y+=n.y,this},subtract:function(n){return this.clone()._subtract(u(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=ue(this.x),this.y=ue(this.y),this},distanceTo:function(n){var t=(n=u(n)).x-this.x,i=n.y-this.y;return Math.sqrt(t*t+i*i)},equals:function(n){return(n=u(n)).x===this.x&&n.y===this.y},contains:function(n){return n=u(n),Math.abs(n.x)<=Math.abs(this.x)&&Math.abs(n.y)<=Math.abs(this.y)},toString:function(){return"Point("+lt(this.x)+", "+lt(this.y)+")"}};v.prototype={extend:function(n){return n=u(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,r;return(n="number"==typeof n[0]||n instanceof t?u(n):at(n))instanceof v?(i=n.min,r=n.max):i=r=n,i.x>=this.min.x&&r.x<=this.max.x&&i.y>=this.min.y&&r.y<=this.max.y},intersects:function(n){n=at(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=at(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)}};nt.prototype={extend:function(n){var t,i,r=this._southWest,u=this._northEast;if(n instanceof h)t=n,i=n;else{if(!(n instanceof nt))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 nt(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 nt?(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)}};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("+lt(this.lat,n)+", "+lt(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)}};var 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 v(this.transformation.transform(t.min,i),this.transformation.transform(t.max,i))},infinite:!1,wrapLatLng:function(n){var t=this.wrapLng?hr(n.lng,this.wrapLng,!0):n.lng;return new h(this.wrapLat?hr(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 nt(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}}),ke={R:6378137,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:function(){var n=6378137*Math.PI;return new v([-n,-n],[n,n])}()};of.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)}};var de,yr,pr,ge,no=s({},ri,{code:"EPSG:3857",projection:ke,transformation:function(){var n=.5/(Math.PI*ke.R);return cr(n,.5,-n,.5)}()}),kc=s({},no,{code:"EPSG:900913"}),to=document.documentElement.style,wu="ActiveXObject"in window,gi=wu&&!document.addEventListener,wr="msLaunchUri"in navigator&&!("documentMode"in document),io=vt("webkit"),nr=vt("android"),br=vt("android 2")||vt("android 3"),dc=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),eh=nr&&vt("Google")&&dc<537&&!("AudioNode"in window),ro=!!window.opera,kr=vt("chrome"),uo=vt("gecko")&&!io&&!ro&&!wu,oh=!kr&&vt("safari"),sh=vt("phantom"),hh="OTransition"in to,ch=0===navigator.platform.indexOf("Win"),fo=wu&&"transition"in to,eo="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!br,lh="MozPerspective"in to,et=!window.L_DISABLE_3D&&(fo||eo||lh)&&!hh&&!sh,tr="undefined"!=typeof orientation||vt("mobile"),gc=tr&&io,nl=tr&&eo,ui=!window.PointerEvent&&window.MSPointerEvent,st=!(!window.PointerEvent&&!ui),wt=!window.L_NO_TOUCH&&(st||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),ah=tr&&ro,tl=tr&&uo,fi=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,vh=!!document.createElement("canvas").getContext,bu=!(!document.createElementNS||!os("svg").createSVGRect),ku=!bu&&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}}(),il=(Object.freeze||Object)({ie:wu,ielt9:gi,edge:wr,webkit:io,android:nr,android23:br,androidStock:eh,opera:ro,chrome:kr,gecko:uo,safari:oh,phantom:sh,opera12:hh,win:ch,ie3d:fo,webkit3d:eo,gecko3d:lh,any3d:et,mobile:tr,mobileWebkit:gc,mobileWebkit3d:nl,msPointer:ui,pointer:st,touch:wt,mobileOpera:ah,mobileGecko:tl,retina:fi,canvas:vh,svg:bu,vml:ku}),oo=ui?"MSPointerDown":"pointerdown",so=ui?"MSPointerMove":"pointermove",ho=ui?"MSPointerUp":"pointerup",co=ui?"MSPointerCancel":"pointercancel",rl=["INPUT","SELECT","OPTION"],ir={},yh=!1,lo=0,du=ui?"MSPointerDown":st?"pointerdown":"touchstart",gu=ui?"MSPointerUp":st?"pointerup":"touchend",rr="_leaflet_",ht="_leaflet_events",ul=ch&&kr?2*window.devicePixelRatio:uo?window.devicePixelRatio:1,ao={},fl=(Object.freeze||Object)({on:i,off:w,stopPropagation:oi,disableScrollPropagation:cf,disableClickPropagation:lr,preventDefault:ut,stop:yt,getMousePosition:as,getWheelDelta:vs,fakeStop:lf,skipped:af,isExternalTarget:fu,addListener:i,removeListener:w}),vo=ou(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),dr=ou(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ph="webkitTransition"===dr||"OTransition"===dr?dr+"End":"transitionend";"onselectstart"in document?(yr=function(){i(window,"selectstart",ut)},pr=function(){w(window,"selectstart",ut)}):(di=ou(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]),yr=function(){if(di){var n=document.documentElement.style;ge=n[di];n[di]="none"}},pr=function(){di&&(document.documentElement.style[di]=ge,ge=void 0)});var nf,yo,el=(Object.freeze||Object)({TRANSFORM:vo,TRANSITION:dr,TRANSITION_END:ph,get:ys,getStyle:ar,create:e,remove:a,empty:vf,toFront:pi,toBack:wi,hasClass:yf,addClass:r,removeClass:p,setClass:pf,getClass:eu,setOpacity:ft,testProp:ou,setTransform:si,setPosition:b,getPosition:hi,disableTextSelection:yr,enableTextSelection:pr,disableImageDrag:wf,enableImageDrag:bf,preventOutline:kf,restoreOutline:su}),wh=ki.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=hi(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=d(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(){rt(this._animId);this._inProgress=!1;this.fire("end")},_easeOut:function(n){return 1-Math.pow(1-n,this._easeOutPower)}}),f=ki.extend({options:{crs:no,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._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._handlers=[];this._layers={};this._zoomBoundLayers={};this._sizeChanged=!0;this.callInitHooks();this._zoomAnimated=dr&&et&&!ah&&this.options.zoomAnimation;this._zoomAnimated&&(this._createAnimProxy(),i(this._proxy,ph,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||(et?this.options.zoomDelta:1),this.setZoom(this._zoom+n,t)},zoomOut:function(n,t){return n=n||(et?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 r=u(t.paddingTopLeft||t.padding||[0,0]),f=u(t.paddingBottomRight||t.padding||[0,0]),i=this.getBoundsZoom(n,!1,r.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(r).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(n=u(n).round(),t=t||{},!n.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){r(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(n).round();this._panAnim.run(this._mapPane,i,t.duration||.25,t.easeLinearity)}else this._rawPanBy(n),this.fire("move").fire("moveend");return this},flyTo:function(n,t,i){function a(n){var t=(l*l-r*r+(n?-1:1)*h*h*s*s)/(2*(n?l:r)*h*s),i=Math.sqrt(t*t+1)-t;return i<1e-9?-18:Math.log(i)}function v(n){return(Math.exp(n)-Math.exp(-n))/2}function e(n){return(Math.exp(n)+Math.exp(-n))/2}function g(n){return v(n)/e(n)}function nt(n){return r*(e(u)/e(u+f*n))}function tt(n){return r*(e(u)*g(u+f*n)-v(u))/h}function it(n){return 1-Math.pow(1-n,1.5)}function p(){var i=(Date.now()-rt)/ut,u=it(i)*k;i<=1?(this._flyToFrame=d(p,this),this._move(this.unproject(c.add(w.subtract(c).multiplyBy(tt(u)/s)),o),this.getScaleZoom(r/nt(u),o),{flyTo:!0})):this._move(n,t)._moveEnd(!0)}if(!1===(i=i||{}).animate||!et)return this.setView(n,t,i);this._stop();var c=this.project(this.getCenter()),w=this.project(n),b=this.getSize(),o=this._zoom;n=y(n);t=void 0===t?o:t;var r=Math.max(b.x,b.y),l=r*this.getZoomScale(o,t),s=w.distanceTo(c)||1,f=1.42,h=f*f,u=a(0),rt=Date.now(),k=(a(1)-u)/f,ut=i.duration?1e3*i.duration:1e3*k*.8;return this._moveStart(!0,i.noMoveStart),p.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},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(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}void 0!==this._locationWatchId&&this.stopLocate();this._stop();a(this._mapPane);this._clearControlPos&&this._clearControlPos();this._clearHandlers();this._loaded&&this.fire("unload");for(var n in this._layers)this._layers[n].remove();for(n in this._panes)a(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 nt(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=u(i||[0,0]);var r=this.getZoom()||0,c=this.getMinZoom(),l=this.getMaxZoom(),a=n.getNorthWest(),v=n.getSouthEast(),e=this.getSize().subtract(i),o=at(this.project(v,r),this.project(a,r)).getSize(),f=et?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 r=this.getScaleZoom(y,r),f&&(r=Math.round(r/(f/100))*(f/100),r=t?Math.ceil(r/f)*f:Math.floor(r/f)*f),Math.max(c,Math.min(l,r))},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 v(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(u(n),t)},layerPointToLatLng:function(n){var t=u(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 u(n).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(n){return u(n).add(this._getMapPanePos())},containerPointToLatLng:function(n){var t=this.containerPointToLayerPoint(u(n));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(n){return this.layerPointToContainerPoint(this.latLngToLayerPoint(y(n)))},mouseEventToContainerPoint:function(n){return as(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=ys(n);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");i(t,"scroll",this._onScroll,this);this._containerId=o(t)},_initLayout:function(){var t=this._container,n;this._fadeAnimated=this.options.fadeAnimation&&et;r(t,"leaflet-container"+(wt?" leaflet-touch":"")+(fi?" leaflet-retina":"")+(gi?" leaflet-oldie":"")+(oh?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));n=ar(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||(r(n.markerPane,"leaflet-zoom-hide"),r(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 rt(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={};this._targets[o(this._container)]=this;var t=n?w:i;t(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress",this._handleDOMEvent,this);this.options.trackResize&&t(window,"resize",this._onResize,this);et&&this.options.transform3DLimit&&(n?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){rt(this._resizeRequest);this._resizeRequest=d(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&&!fu(i,n))break;if(u.push(r),f)break}if(i===this._container)break;i=i.parentNode}return u.length||e||f||!fu(i,n)||(u=[this]),u},_handleDOMEvent:function(n){if(this._loaded&&!af(n)){var t=n.type;"mousedown"!==t&&"keypress"!==t||kf(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)&&ut(n),r={originalEvent:n},"keypress"!==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!==fs(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 hi(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 at([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 v(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 v(i.min.add(n),i.max.add(n));return n.add(this._getBoundsOffset(r,t))},_getBoundsOffset:function(n,i,r){var u=at(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 n+t>0?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=et?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=vo,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(){a(this._proxy);delete this._proxy},_catchTransitionEnd:function(n){this._animatingZoom&&n.propertyName.indexOf("transform")>=0&&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))&&(d(function(){this._moveStart(!0,!1)._animateZoom(n,t,!0)},this),!0)},_animateZoom:function(n,t,i,u){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=n,this._animateToZoom=t,r(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),d(function(){this._moveEnd(!0)},this))}}),ct=kt.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(),i=n._controlCorners[u];return r(t,"leaflet-control"),-1!==u.indexOf("bottom")?i.insertBefore(t,i.firstChild):i.appendChild(t),this},remove:function(){return this._map?(a(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this):this},_refocusOnMap:function(n){this._map&&n&&n.screenX>0&&n.screenY>0&&this._map.getContainer().focus()}}),gr=function(n){return new ct(n)};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)a(this._controlCorners[n]);a(this._controlContainer);delete this._controlCorners;delete this._controlContainer}});fe=ct.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){l(this,i);this._layerControlInputs=[];this._layers=[];this._lastZIndex=0;this._handlingClick=!1;for(var r in 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;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 ct.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(){r(this._container,"leaflet-control-layers-expanded");this._form.style.height=null;var n=this._map.getSize().y-(this._container.offsetTop+50);return n<this._form.clientHeight?(r(this._form,"leaflet-control-layers-scrollbar"),this._form.style.height=n+"px"):p(this._form,"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,u,r;t.setAttribute("aria-haspopup",!0);lr(t);cf(t);u=this._form=e("form",n+"-list");f&&(this._map.on("click",this.collapse,this),nr||i(t,{mouseenter:this.expand,mouseleave:this.collapse},this));r=this._layersLink=e("a",n+"-toggle",t);r.href="#";r.title="Layers";wt?(i(r,"click",yt),i(r,"click",this.expand,this)):i(r,"focus",this.expand,this);f||this.expand();this._baseLayersList=e("div",n+"-base",u);this._separator=e("div",n+"-separator",u);this._overlaysList=e("div",n+"-overlays",u);t.appendChild(u)},_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;vf(this._baseLayersList);vf(this._overlaysList);this._layerControlInputs=[];for(var n,i,t,u=0,r=0;r<this._layers.length;r++)t=this._layers[r],this._addItem(t),i=i||t.overlay,n=n||!t.overlay,u+=t.overlay?0:1;return this.options.hideSingleBase&&(n=n&&u>1,this._baseLayersList.style.display=n?"":"none"),this._separator.style.display=i&&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,u=document.createElement("label"),e=this._map.hasLayer(n.layer),f,r;return n.overlay?((t=document.createElement("input")).type="checkbox",t.className="leaflet-control-layers-selector",t.defaultChecked=e):t=this._createRadioElement("leaflet-base-layers",e),this._layerControlInputs.push(t),t.layerId=o(n.layer),i(t,"click",this._onInputClick,this),f=document.createElement("span"),f.innerHTML=" "+n.name,r=document.createElement("div"),u.appendChild(r),r.appendChild(t),r.appendChild(f),(n.overlay?this._overlaysList:this._baseLayersList).appendChild(u),this._checkDisabledLayers(),u},_onInputClick:function(){var t,u,f=this._layerControlInputs,i=[],r=[],n;for(this._handlingClick=!0,n=f.length-1;n>=0;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;i>=0;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()}});vu=ct.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,r,u,f){var o=e("a",r,u);return o.innerHTML=n,o.href="#",o.title=t,o.setAttribute("role","button"),o.setAttribute("aria-label",t),lr(o),i(o,"click",yt),i(o,"click",f,this),i(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())&&r(this._zoomOutButton,t);(this._disabled||n._zoom===n.getMaxZoom())&&r(this._zoomInButton,t)}});f.mergeOptions({zoomControl:!0});f.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new vu,this.addControl(this.zoomControl))});ee=ct.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(n){var t=e("div","leaflet-control-scale"),i=this.options;return this._addScales(i,"leaflet-control-scale-line",t),n.on(i.updateWhenIdle?"moveend":"move",this._update,this),n.whenReady(this._update,this),t},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;t>5280?(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 t=t>=10?10:t>=5?5:t>=3?3:t>=2?2:1,i*t}});yu=ct.extend({options:{position:"bottomright",prefix:'<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet<\/a>'},initialize:function(n){l(this,n);this._attributions={}},onAdd:function(n){n.attributionControl=this;this._container=e("div","leaflet-control-attribution");lr(this._container);for(var t in 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):this},removeAttribution:function(n){return n?(this._attributions[n]&&(this._attributions[n]--,this._update()),this):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 yu).addTo(this)});ct.Layers=fe;ct.Zoom=vu;ct.Scale=ee;ct.Attribution=yu;gr.layers=function(n,t,i){return new fe(n,t,i)};gr.zoom=function(n){return new vu(n)};gr.scale=function(n){return new ee(n)};gr.attribution=function(n){return new yu(n)};ot=kt.extend({initialize:function(n){this._map=n},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});ot.addTo=function(n,t){return n.addHandler(t,this),this};var bh,ol={Events:tt},kh=wt?"touchstart mousedown":"mousedown",dh={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},po={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},ai=ki.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||(i(this._dragStartTarget,kh,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ai._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,!yf(this._element,"leaflet-zoom-anim")&&!(ai._dragging||n.shiftKey||1!==n.which&&1!==n.button&&!n.touches||(ai._dragging=this,this._preventOutline&&kf(this._element),wf(),yr(),this._moving)))){this.fire("down");var r=n.touches?n.touches[0]:n;this._startPoint=new t(r.clientX,r.clientY);i(document,po[n.type],this._onMove,this);i(document,dh[n.type],this._onUp,this)}},_onMove:function(n){if(!n._simulated&&this._enabled)if(n.touches&&n.touches.length>1)this._moved=!0;else{var u=n.touches&&1===n.touches.length?n.touches[0]:n,i=new t(u.clientX,u.clientY).subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(ut(n),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=hi(this._element).subtract(i),r(document.body,"leaflet-dragging"),this._lastTarget=n.target||n.srcElement,window.SVGElementInstance&&this._lastTarget instanceof SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),r(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,rt(this._animRequest),this._lastEvent=n,this._animRequest=d(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(){p(document.body,"leaflet-dragging");this._lastTarget&&(p(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null);for(var n in po)w(document,po[n],this._onMove,this),w(document,dh[n],this._onUp,this);bf();pr();this._moved&&this._moving&&(rt(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)}));this._moving=!1;ai._dragging=!1}}),sl=(Object.freeze||Object)({simplify:ps,pointToSegmentDistance:ws,closestPointOnSegment:function(n,t,i){return vr(n,t,i)},clipSegment:bs,_getEdgeIntersection:hu,_getBitCode:ci,_sqClosestPointOnSegment:vr,isFlat:dt,_flat:ks}),hl=(Object.freeze||Object)({clipPolygon:ds}),wo={project:function(n){return new t(n.lng,n.lat)},unproject:function(n){return new h(n.y,n.x)},bounds:new v([-180,-90],[180,90])},bo={R:6378137,R_MINOR:6356752.3142451793,bounds:new v([-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&&Math.abs(c)>1e-7;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)}},cl=(Object.freeze||Object)({LonLat:wo,Mercator:bo,SphericalMercator:ke}),ll=s({},ri,{code:"EPSG:3395",projection:bo,transformation:function(){var n=.5/(Math.PI*bo.R);return cr(n,.5,-n,.5)}()}),gh=s({},ri,{code:"EPSG:4326",projection:wo,transformation:cr(1/180,1,-1/180,.5)}),al=s({},gt,{projection:wo,transformation:cr(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=ll;gt.EPSG3857=no;gt.EPSG900913=kc;gt.EPSG4326=gh;gt.Simple=al;it=ki.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,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:(this._layers[t]=n,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):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?pt(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=it.extend({initialize:function(n,t){l(this,t);this._layers={};var i,r;if(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)}}),vi=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 nt,i,n;for(i in this._layers)n=this._layers[i],t.extend(n.getBounds?n.getBounds():n.getLatLng());return t}}),fr=kt.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,r=f[t+"Size"],i,e;"number"==typeof r&&(r=[r,r]);i=u(r);e=u("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"),t.src=n,t},_getIconUrl:function(n){return fi&&this.options[n+"RetinaUrl"]||this.options[n+"Url"]}}),nu=fr.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 nu.imagePath||(nu.imagePath=this._detectIconPath()),(this.options.imagePath||nu.imagePath)+fr.prototype._getIconUrl.call(this,n)},_detectIconPath:function(){var t=e("div","leaflet-default-icon-path",document.body),n=ar(t,"background-image")||ar(t,"backgroundImage");return document.body.removeChild(t),n=null===n||0!==n.indexOf("url")?"":n.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),nc=ot.extend({initialize:function(n){this._marker=n},addHooks:function(){var n=this._marker._icon;this._draggable||(this._draggable=new ai(n,n,!0));this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable();r(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,r=L.DomUtil.getPosition(e._icon),i=o.getPixelBounds(),h=o.getPixelOrigin(),t=at(i.min._subtract(h).add(s),i.max._subtract(h).subtract(s)),f;t.contains(r)||(f=u((Math.max(t.max.x,r.x)-t.max.x)/(i.max.x-t.max.x)-(Math.min(t.min.x,r.x)-t.min.x)/(i.min.x-t.min.x),(Math.max(t.max.y,r.y)-t.max.y)/(i.max.y-t.max.y)-(Math.min(t.min.y,r.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),L.DomUtil.setPosition(e._icon,this._draggable._newPos),this._onDrag(n),this._panRequest=d(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&&(rt(this._panRequest),this._panRequest=d(this._adjustPan.bind(this,n)))},_onDrag:function(n){var t=this._marker,i=t._shadow,r=hi(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){rt(this._panRequest);delete this._oldLatLng;this._marker.fire("moveend").fire("dragend",n)}}),tu=it.extend({options:{icon:new nu,interactive:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",bubblingMouseEvents:!1},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()},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,i,u;t!==this._icon&&(this._icon&&this._removeIcon(),e=!0,n.title&&(t.title=n.title),"IMG"===t.tagName&&(t.alt=n.alt||""));r(t,f);n.keyboard&&(t.tabIndex="0");this._icon=t;n.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});i=n.icon.createShadow(this._shadow);u=!1;i!==this._shadow&&(this._removeShadow(),u=!0);i&&(r(i,f),i.alt="");this._shadow=i;n.opacity<1&&this._updateOpacity();e&&this.getPane().appendChild(this._icon);this._initInteraction();i&&u&&this.getPane("shadowPane").appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex});a(this._icon);this.removeInteractiveTarget(this._icon);this._icon=null},_removeShadow:function(){this._shadow&&a(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&&(r(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),nc)){var n=this.options.draggable;this.dragging&&(n=this.dragging.enabled(),this.dragging.disable());this.dragging=new nc(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;ft(this._icon,n);this._shadow&&ft(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}}),ei=it.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},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}}),tf=ei.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 ei.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 v(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()}}),ko=tf.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 nt(this._map.layerPointToLatLng(this._point.subtract(n)),this._map.layerPointToLatLng(this._point.add(n)))},setStyle:ei.prototype.setStyle,_project:function(){var e=this._latlng.lng,i=this._latlng.lat,n=this._map,o=n.options.crs,h;if(o.distance===ri.distance){var t=Math.PI/180,u=this._mRadius/ri.R/t,c=n.project([i+u,e]),l=n.project([i-u,e]),f=c.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-c.y}else h=o.unproject(o.project(this._latlng).subtract([this._mRadius,0])),this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(h).x;this._updateBounds()}}),ni=ei.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 r,o,s,u=1/0,t=null,h=vr,f=0,c=this._parts.length;f<c;f++)for(var e=this._parts[f],i=1,l=e.length;i<l;i++)r=h(n,o=e[i-1],s=e[i],!0),r<u&&(u=r,t=h(n,o,s));return t&&(t.distance=Math.sqrt(u)),t},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var n,r,f,e,u,t,o,i=this._rings[0],s=i.length;if(!s)return null;for(n=0,r=0;n<s-1;n++)r+=i[n].distanceTo(i[n+1])/2;if(0===r)return this._map.layerPointToLatLng(i[0]);for(n=0,e=0;n<s-1;n++)if(u=i[n],t=i[n+1],f=u.distanceTo(t),(e+=f)>r)return o=(e-r)/f,this._map.layerPointToLatLng([t.x-o*(t.x-u.x),t.y-o*(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 nt;this._latlngs=this._convertLatLngs(n)},_defaultShape:function(){return dt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(n){for(var i=[],r=dt(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 v,i,r;this._rings=[];this._projectLatlngs(this._latlngs,this._rings,n);i=this._clickTolerance();r=new t(i,i);this._bounds.isValid()&&n.isValid()&&(n.min._subtract(r),n.max._add(r),this._pxBounds=n)},_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,r=0,t=0,s=this._rings.length;r<s;r++)for(n=0,e=(f=this._rings[r]).length;n<e-1;n++)(u=bs(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]=ps(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)&&ws(n,f[u],f[i])<=s)return!0;return!1}});ni._flat=ks;var er=ni.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=ni.prototype._convertLatLngs.call(this,n),i=t.length;return i>=2&&t[0]instanceof h&&t[0].equals(t[i-1])&&t.pop(),t},_setLatLngs:function(n){ni.prototype._setLatLngs.call(this,n);dt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return dt(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 v(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=ds(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.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||ni.prototype._containsPoint.call(this,n,!0)}}),ti=vi.extend({initialize:function(n,t){l(this,t);this._layers={};n&&this.addData(n)},addData:function(n){var u,e,r,f=pt(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=gf(n,i),t?(t.feature=au(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){"function"==typeof t&&(t=t(n.feature));n.setStyle&&n.setStyle(t)}}),go={toGeoJSON:function(n){return bi(this,{type:"Point",coordinates:te(this.getLatLng(),n)})}};tu.include(go);ko.include(go);tf.include(go);ni.include({toGeoJSON:function(n){var t=!dt(this._latlngs),i=lu(this._latlngs,t?1:0,!1,n);return bi(this,{type:(t?"Multi":"")+"LineString",coordinates:i})}});er.include({toGeoJSON:function(n){var t=!dt(this._latlngs),r=t&&!dt(this._latlngs[0]),i=lu(this._latlngs,r?2:t?1:0,!0,n);return t||(i=[i]),bi(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)}),bi(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=au(f),"FeatureCollection"===u.type?t.push.apply(t,u.features):t.push(u)))}),i?bi(this,{geometries:t,type:"GeometryCollection"}):{type:"FeatureCollection",features:t})}});var vl=gs,ns=it.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&&(r(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image));this.getPane().appendChild(this._image);this._reset()},onRemove:function(){a(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&&pi(this._image),this},bringToBack:function(){return this._map&&wi(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");r(n,"leaflet-image-layer");this._zoomAnimated&&r(n,"leaflet-zoom-animated");this.options.className&&r(n,this.options.className);n.onselectstart=g;n.onmousemove=g;n.onload=c(this.fire,this,"load");n.onerror=c(this._overlayOnError,this,"error");this.options.crossOrigin&&(n.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 v(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(){ft(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)}}),tc=ns.extend({options:{autoplay:!0,loop:!0},_initImage:function(){var o="VIDEO"===this._url.tagName,n=this._image=o?this._url:e("video"),t,i;if(r(n,"leaflet-image-layer"),this._zoomAnimated&&r(n,"leaflet-zoom-animated"),n.onselectstart=g,n.onmousemove=g,n.onloadeddata=c(this.fire,this,"load"),o){for(var u=n.getElementsByTagName("source"),s=[],f=0;f<u.length;f++)s.push(u[f].src);this._url=u.length>0?s:[n.src]}else for(pt(this._url)||(this._url=[this._url]),n.autoplay=!!this.options.autoplay,n.loop=!!this.options.loop,t=0;t<this._url.length;t++)i=e("source"),i.src=this._url[t],n.appendChild(i)}}),ii=it.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&&ft(this._container,0);clearTimeout(this._removeTimeout);this.getPane().appendChild(this._container);this.update();n._fadeAnimated&&ft(this._container,1);this.bringToFront()},onRemove:function(n){n._fadeAnimated?(ft(this._container,0),this._removeTimeout=setTimeout(c(a,void 0,this._container),200)):a(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&&pi(this._container),this},bringToBack:function(){return this._map&&wi(this._container),this},_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 t,i;if(this._map){var r=this._map.latLngToLayerPoint(this._latlng),n=u(this.options.offset),f=this._getAnchor();this._zoomAnimated?b(this._container,r.add(f)):n=n.add(r).add(f);t=this._containerBottom=-n.y;i=this._containerLeft=-Math.round(this._containerWidth/2)+n.x;this._container.style.bottom=t+"px";this._container.style.left=i+"px"}},_getAnchor:function(){return[0,0]}}),or=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 ei||this._source.on("preclick",oi))},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 ei||this._source.off("preclick",oi))},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",r=this._container=e("div",n+" "+(this.options.className||"")+" leaflet-zoom-animated"),u=this._wrapper=e("div",n+"-content-wrapper",r),t;(this._contentNode=e("div",n+"-content",u),lr(u),cf(this._contentNode),i(u,"contextmenu",oi),this._tipContainer=e("div",n+"-tip-container",r),this._tip=e("div",n+"-tip",this._tipContainer),this.options.closeButton)&&(t=this._closeButton=e("a",n+"-close-button",r),t.href="#close",t.innerHTML="&#215;",i(t,"click",this._onCloseButtonClick,this))},_updateLayout:function(){var i=this._contentNode,n=i.style,t,f,u;n.width="";n.whiteSpace="nowrap";t=i.offsetWidth;t=Math.min(t,this.options.maxWidth);t=Math.max(t,this.options.minWidth);n.width=t+1+"px";n.whiteSpace="";n.height="";f=i.offsetHeight;u=this.options.maxHeight;u&&f>u?(n.height=u+"px",r(i,"leaflet-popup-scrolled")):p(i,"leaflet-popup-scrolled");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._inProgress)){var s=this._map,v=parseInt(ar(this._container,"marginBottom"),10)||0,h=this._container.offsetHeight+v,c=this._containerWidth,l=new t(this._containerLeft,-h-this._containerBottom);l._add(hi(this._container));var n=s.layerPointToContainerPoint(l),a=u(this.options.autoPanPadding),f=u(this.options.autoPanPaddingTopLeft||a),e=u(this.options.autoPanPaddingBottomRight||a),o=s.getSize(),i=0,r=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&&(r=n.y+h-o.y+e.y);n.y-r-f.y<0&&(r=n.y-f.y);(i||r)&&s.fire("autopanstart").panBy([i,r])}},_onCloseButtonClick:function(n){this._close();yt(n)},_getAnchor:function(){return u(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});f.mergeOptions({closePopupOnClick:!0});f.include({openPopup:function(n,t,i){return n instanceof or||(n=new or(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}});it.include({bindPopup:function(n,t){return n instanceof or?(l(n,t),this._popup=n,n._source=this):(this._popup&&!t||(this._popup=new or(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){if(n instanceof it||(t=n,n=this),n instanceof vi)for(var i in this._layers){n=this._layers[i];break}return t||(t=n.getCenter?n.getCenter():n.getLatLng()),this._popup&&this._map&&(this._popup._source=n,this._popup.update(),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&&(yt(n),t instanceof ei?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)}});li=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 wt&&!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,i=this._container,c=h.latLngToContainerPoint(h.getCenter()),l=h.layerPointToContainerPoint(n),f=this.options.direction,o=i.offsetWidth,s=i.offsetHeight,t=u(this.options.offset),e=this._getAnchor();"top"===f?n=n.add(u(-o/2+t.x,-s+t.y+e.y,!0)):"bottom"===f?n=n.subtract(u(o/2-t.x,-t.y,!0)):"center"===f?n=n.subtract(u(o/2+t.x,s/2-e.y+t.y,!0)):"right"===f||"auto"===f&&l.x<c.x?(f="right",n=n.add(u(t.x+e.x,e.y-s/2+t.y,!0))):(f="left",n=n.subtract(u(o+e.x-t.x,s/2-e.y-t.y,!0)));p(i,"leaflet-tooltip-right");p(i,"leaflet-tooltip-left");p(i,"leaflet-tooltip-top");p(i,"leaflet-tooltip-bottom");r(i,"leaflet-tooltip-"+f);b(i,n)},_updatePosition:function(){var n=this._map.latLngToLayerPoint(this._latlng);this._setPosition(n)},setOpacity:function(n){this.options.opacity=n;this._container&&ft(this._container,n)},_animateZoom:function(n){var t=this._map._latLngToNewLayerPoint(this._latlng,n.zoom,n.center);this._setPosition(t)},_getAnchor:function(){return u(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}});f.include({openTooltip:function(n,t,i){return n instanceof li||(n=new li(i).setContent(n)),t&&n.setLatLng(t),this.hasLayer(n)?this:this.addLayer(n)},closeTooltip:function(n){return n&&this.removeLayer(n),this}});it.include({bindTooltip:function(n,t){return n instanceof li?(l(n,t),this._tooltip=n,n._source=this):(this._tooltip&&!t||(this._tooltip=new li(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),wt&&(t.click=this._openTooltip));this[i](t);this._tooltipHandlersAdded=!n}},openTooltip:function(n,t){if(n instanceof it||(t=n,n=this),n instanceof vi)for(var i in this._layers){n=this._layers[i];break}return t||(t=n.getCenter?n.getCenter():n.getLatLng()),this._tooltip&&this._map&&(this._tooltip._source=n,this._tooltip.update(),this._map.openTooltip(this._tooltip,t),this._tooltip.options.interactive&&this._tooltip._container&&(r(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)}});oe=fr.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,r;return(t.innerHTML=!1!==i.html?i.html:"",i.bgPos)&&(r=u(i.bgPos),t.style.backgroundPosition=-r.x+"px "+-r.y+"px"),this._setIconStyles(t,"icon"),t},createShadow:function(){return null}});fr.Default=nu;var ts=it.extend({options:{tileSize:256,opacity:1,updateWhenIdle:tr,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();a(this._container);n._removeZoomLimit(this);this._container=null;this._tileZoom=void 0},bringToFront:function(){return this._map&&(pi(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(wi(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=uf(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 i,n,t;if(this._map&&!gi){ft(this._container,this.options.opacity);var f=+new Date,r=!1,u=!1;for(i in this._tiles)n=this._tiles[i],n.current&&n.loaded&&(t=Math.min(1,(f-n.loaded)/200),ft(n.el,t),t<1?r=!0:(n.active?u=!0:this._onOpaqueTile(n),n.active=!0));u&&!this._noPrune&&this._pruneTiles();r&&(rt(this._fadeFrame),this._fadeFrame=d(this._updateOpacity,this))}},_onOpaqueTile:g,_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,t,n,r;if(void 0!==i){for(t in this._levels)this._levels[t].el.children.length||t===i?(this._levels[t].el.style.zIndex=u-Math.abs(i-t),this._onUpdateLevel(t)):(a(this._levels[t].el),this._removeTilesAtZoom(t),this._onRemoveLevel(t),delete this._levels[t]);return n=this._levels[i],r=this._map,n||((n=this._levels[i]={}).el=e("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=u,n.origin=r.project(r.unproject(r.getPixelOrigin()),i).round(),n.zoom=i,this._setZoomTransform(n,r.getCenter(),r.getZoom()),n.el.offsetWidth,this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:g,_onRemoveLevel:g,_onCreateLevel:g,_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)a(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,!0):(f&&f.loaded&&(f.retain=!0),e>u&&this._retainParent(o,s,e,u))},_retainChildren:function(n,i,r,u){for(var e,s,h,f,o=2*n;o<2*n+2;o++)for(e=2*i;e<2*i+2;e++)s=new t(o,e),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(o,e,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();et?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 v(i.subtract(r),i.add(r))},_update:function(n){var h=this._map,c,l,e,o,r,u,a,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(),f=[],s=this.options.keepBuffer,b=new v(i.getBottomLeft().subtract([s,-s]),i.getTopRight().add([s,-s]));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)e=this._tiles[l].coords,e.z===this._tileZoom&&b.contains(new t(e.x,e.y))||(this._tiles[l].current=!1);if(Math.abs(c-this._tileZoom)>1)this._setView(n,c);else{for(o=i.min.y;o<=i.max.y;o++)for(r=i.min.x;r<=i.max.x;r++)u=new t(r,o),(u.z=this._tileZoom,this._isValidTile(u))&&(a=this._tiles[this._tileCoordsToKey(u)],a?a.current=!0:f.push(u));if(f.sort(function(n,t){return n.distanceTo(p)-t.distanceTo(p)}),0!==f.length){for(this._loading||(this._loading=!0,this.fire("loading")),y=document.createDocumentFragment(),r=0;r<f.length;r++)this._addTile(f[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 nt(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&&(eh||t.el.setAttribute("src",we),a(t.el),delete this._tiles[n],this.fire("tileunload",{tile:t.el,coords:this._keyToTileCoords(n)}))},_initTile:function(n){r(n,"leaflet-tile");var t=this.getTileSize();n.style.width=t.x+"px";n.style.height=t.y+"px";n.onselectstart=g;n.onmousemove=g;gi&&this.options.opacity<1&&ft(n,this.options.opacity);nr&&!br&&(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&&d(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,i){if(this._map){t&&this.fire("tileerror",{error:t,tile:i,coords:n});var u=this._tileCoordsToKey(n);(i=this._tiles[u])&&(i.loaded=+new Date,this._map._fadeAnimated?(ft(i.el,0),rt(this._fadeFrame),this._fadeFrame=d(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),t||(r(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:n})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),gi||!this._map._fadeAnimated?d(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?hr(n.x,this._wrapX):n.x,this._wrapY?hr(n.y,this._wrapY):n.y);return i.z=n.z,i},_pxBoundsToTileRange:function(n){var t=this.getTileSize();return new v(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}}),iu=ts.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&&t.maxZoom>0&&(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(""));nr||this.on("tileunload",this._onTileRemove)},setUrl:function(n,t){return this._url=n,t||this.redraw(),this},createTile:function(n,t){var r=document.createElement("img");return i(r,"load",c(this._tileOnLoad,this,t,r)),i(r,"error",c(this._tileOnError,this,t,r)),this.options.crossOrigin&&(r.crossOrigin=""),r.alt="",r.setAttribute("role","presentation"),r.src=this.getTileUrl(n),r},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),us(this._url,s(t,this.options))},_tileOnLoad:function(n,t){gi?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,i=this.options.zoomReverse,r=this.options.zoomOffset;return i&&(n=t-n),n+r},_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=g,n.onerror=g,n.complete||(n.src=we,a(n),delete this._tiles[t]))}}),ic=iu.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=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code;iu.prototype.onAdd.call(this,n)},getTileUrl:function(n){var r=this._tileCoordsToNwSe(n),u=this._crs,f=at(u.project(r[0]),u.project(r[1])),t=f.min,i=f.max,o=(this._wmsVersion>=1.3&&this._crs===gh?[t.y,t.x,i.y,i.x]:[t.x,t.y,i.x,i.y]).join(","),e=L.TileLayer.prototype.getTileUrl.call(this,n);return e+rs(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}});iu.WMS=ic;nh.wms=function(n,t){return new ic(n,t)};var bt=it.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&&r(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=hi(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);et?si(this._container,u,i):b(this._container,u)},_reset:function(){this._update();this._updateTransform(this._center,this._zoom);for(var n in 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 v(i,i.add(t.multiplyBy(1+2*n)).round());this._center=this._map.getCenter();this._zoom=this._map.getZoom()}}),is=bt.extend({getEvents:function(){var n=bt.prototype.getEvents.call(this);return n.viewprereset=this._onViewPreReset,n},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){bt.prototype.onAdd.call(this);this._draw()},_initContainer:function(){var n=this._container=document.createElement("canvas");i(n,"mousemove",uf(this._onMouseMove,32,this),this);i(n,"click dblclick mousedown mouseup contextmenu",this._onClick,this);i(n,"mouseout",this._handleMouseOut,this);this._ctx=n.getContext("2d")},_destroyContainer:function(){delete this._ctx;a(this._container);w(this._container);delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){this._redrawBounds=null;for(var n in this._layers)this._layers[n]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){this._drawnLayers={};bt.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(){bt.prototype._reset.call(this);this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(n){this._updateDashArray(n);this._layers[o(n)]=n;var t=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[L.stamp(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(n.options.dashArray){for(var i=n.options.dashArray.split(","),r=[],t=0;t<i.length;t++)r.push(Number(i[t]));n.options._dashArray=r}},_requestRedraw:function(n){this._map&&(this._extendRedrawBounds(n),this._redrawRequest=this._redrawRequest||d(this._redraw,this))},_extendRedrawBounds:function(n){if(n._pxBounds){var t=(n.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new v;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(this._drawnLayers[n._leaflet_id]=n,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;this._drawnLayers[n._leaflet_id]=n;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&&(lf(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,i,u=this._drawFirst;u;u=u.next)(f=u.layer).options.interactive&&f._containsPoint(t)&&(i=f);i!==this._hoveredLayer&&(this._handleMouseOut(n),i&&(r(this._container,"leaflet-interactive"),this._fireEvent([i],n,"mouseover"),this._hoveredLayer=i));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=t.next,r=t.prev;i&&(i.prev=r,r?r.next=i:i&&(this._drawFirst=i),t.prev=this._drawLast,this._drawLast.next=t,t.next=null,this._drawLast=t,this._requestRedraw(n))},_bringToBack:function(n){var t=n._order,r=t.next,i=t.prev;i&&(i.next=r,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))}}),ru=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">')}}}(),yl={_initContainer:function(){this._container=e("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(bt.prototype._update.call(this),this.fire("update"))},_initPath:function(n){var t=n._container=ru("shape");r(t,"leaflet-vml-shape "+(this.options.className||""));t.coordsize="1 1";n._path=ru("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;a(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=ru("stroke")),u.appendChild(i),i.weight=t.weight+"px",i.color=t.color,i.opacity=t.opacity,i.dashStyle=t.dashArray?pt(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=ru("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){pi(n._container)},_bringToBack:function(n){wi(n._container)}},rf=ku?ru:os,sr=bt.extend({getEvents:function(){var n=bt.prototype.getEvents.call(this);return n.zoomstart=this._onZoomStart,n},_initContainer:function(){this._container=rf("svg");this._container.setAttribute("pointer-events","none");this._rootGroup=rf("g");this._container.appendChild(this._rootGroup)},_destroyContainer:function(){a(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){bt.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=rf("path");n.options.className&&r(t,n.options.className);n.options.interactive&&r(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){a(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,ss(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){pi(n._path)},_bringToBack:function(n){wi(n._path)}});ku&&sr.include(yl);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.options.preferCanvas&&ie()||re()),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=sr&&re({pane:n})||is&&ie({pane:n}),this._paneRenderers[n]=t),t}});se=er.extend({initialize:function(n,t){er.prototype.initialize.call(this,this._boundsToLatLngs(n),t)},setBounds:function(n){return this.setLatLngs(this._boundsToLatLngs(n))},_boundsToLatLngs:function(n){return n=k(n),[n.getSouthWest(),n.getNorthWest(),n.getNorthEast(),n.getSouthEast()]}});sr.create=rf;sr.pointsToPath=ss;ti.geometryToLayer=gf;ti.coordsToLatLng=ne;ti.coordsToLatLngs=cu;ti.latLngToCoords=te;ti.latLngsToCoords=lu;ti.getFeature=bi;ti.asFeature=au;f.mergeOptions({boxZoom:!0});he=ot.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(){i(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){w(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){a(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();yr();wf();this._startPoint=this._map.mouseEventToContainerPoint(n);i(document,{contextmenu:yt,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),r(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart"));this._point=this._map.mouseEventToContainerPoint(n);var t=new v(this._point,this._startPoint),i=t.getSize();b(this._box,t.min);this._box.style.width=i.x+"px";this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(a(this._box),p(this._container,"leaflet-crosshair"));pr();bf();w(document,{contextmenu:yt,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 nt(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",he);f.mergeOptions({doubleClickZoom:!0});ce=ot.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",ce);f.mergeOptions({dragging:!0,inertia:!br,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});le=ot.extend({addHooks:function(){if(!this._draggable){var n=this._map;this._draggable=new ai(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))}r(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=at(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(;this._positions.length>1&&n-this._times[0]>50;)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),d(function(){t.panBy(i,{duration:s,easeLinearity:u,noMoveStart:!0,animate:!0})})):t.fire("moveend")}}});f.addInitHook("addHandler","dragging",le);f.mergeOptions({keyboard:!0,keyboardPanDelta:80});ae=ot.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");i(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={},i=this.keyCodes,t=0,r=i.left.length;t<r;t++)u[i.left[t]]=[-1*n,0];for(t=0,r=i.right.length;t<r;t++)u[i.right[t]]=[n,0];for(t=0,r=i.down.length;t<r;t++)u[i.down[t]]=[0,n];for(t=0,r=i.up.length;t<r;t++)u[i.up[t]]=[0,-1*n]},_setZoomDelta:function(n){for(var u=this._zoomKeys={},i=this.keyCodes,t=0,r=i.zoomIn.length;t<r;t++)u[i.zoomIn[t]]=n;for(t=0,r=i.zoomOut.length;t<r;t++)u[i.zoomOut[t]]=-n},_addHooks:function(){i(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){w(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(n){if(!(n.altKey||n.ctrlKey||n.metaKey)){var r,i=n.keyCode,t=this._map;if(i in this._panKeys){if(t._panAnim&&t._panAnim._inProgress)return;r=this._panKeys[i];n.shiftKey&&(r=u(r).multiplyBy(3));t.panBy(r);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()}yt(n)}}});f.addInitHook("addHandler","keyboard",ae);f.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});ve=ot.extend({addHooks:function(){i(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=vs(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);yt(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+(this._delta>0?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",ve);f.mergeOptions({tap:!0,tapTolerance:15});ye=ot.extend({addHooks:function(){i(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){w(this._map._container,"touchstart",this._onDown,this)},_onDown:function(n){if(n.touches){if(ut(n),this._fireClick=!0,n.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var u=n.touches[0],f=u.target;this._startPos=this._newPos=new t(u.clientX,u.clientY);f.tagName&&"a"===f.tagName.toLowerCase()&&r(f,"leaflet-active");this._holdTimeout=setTimeout(c(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",u))},this),1e3);this._simulateEvent("mousedown",u);i(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)}});wt&&!st&&f.addInitHook("addHandler","tap",ye);f.mergeOptions({touchZoom:wt&&!br,bounceAtZoomLimits:!0});pe=ot.extend({addHooks:function(){r(this._map._container,"leaflet-touch-zoom");i(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,r,u;!n.touches||2!==n.touches.length||t._animatingZoom||this._zooming||(r=t.mouseEventToContainerPoint(n.touches[0]),u=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(r.add(u)._divideBy(2))),this._startDist=r.distanceTo(u),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),i(document,"touchmove",this._onTouchMove,this),i(document,"touchend",this._onTouchEnd,this),ut(n))},_onTouchMove:function(n){var r,u;if(n.touches&&2===n.touches.length&&this._zooming){var t=this._map,f=t.mouseEventToContainerPoint(n.touches[0]),e=t.mouseEventToContainerPoint(n.touches[1]),i=f.distanceTo(e)/this._startDist;if(this._zoom=t.getScaleZoom(i,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoom<t.getMinZoom()&&i<1||this._zoom>t.getMaxZoom()&&i>1)&&(this._zoom=t._limitZoom(this._zoom)),"center"===t.options.touchZoom){if(this._center=this._startLatLng,1===i)return}else{if(r=f._add(e)._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);rt(this._animRequest);u=c(t._move,t,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=d(u,this,!0);ut(n)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,rt(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",pe);f.BoxZoom=he;f.DoubleClickZoom=ce;f.Drag=le;f.Keyboard=ae;f.ScrollWheelZoom=ve;f.Tap=ye;f.TouchZoom=pe;ih=window.L;window.L=n;Object.freeze=th;n.version="1.3.1+HEAD.ba6f97f";n.noConflict=function(){return window.L=ih,this};n.Control=ct;n.control=gr;n.Browser=il;n.Evented=ki;n.Mixin=ol;n.Util=bc;n.Class=kt;n.Handler=ot;n.extend=s;n.bind=c;n.stamp=o;n.setOptions=l;n.DomEvent=fl;n.DomUtil=el;n.PosAnimation=wh;n.Draggable=ai;n.LineUtil=sl;n.PolyUtil=hl;n.Point=t;n.point=u;n.Bounds=v;n.bounds=at;n.Transformation=of;n.transformation=cr;n.Projection=cl;n.LatLng=h;n.latLng=y;n.LatLngBounds=nt;n.latLngBounds=k;n.CRS=gt;n.GeoJSON=ti;n.geoJSON=gs;n.geoJson=vl;n.Layer=it;n.LayerGroup=ur;n.layerGroup=function(n,t){return new ur(n,t)};n.FeatureGroup=vi;n.featureGroup=function(n){return new vi(n)};n.ImageOverlay=ns;n.imageOverlay=function(n,t,i){return new ns(n,t,i)};n.VideoOverlay=tc;n.videoOverlay=function(n,t,i){return new tc(n,t,i)};n.DivOverlay=ii;n.Popup=or;n.popup=function(n,t){return new or(n,t)};n.Tooltip=li;n.tooltip=function(n,t){return new li(n,t)};n.Icon=fr;n.icon=function(n){return new fr(n)};n.DivIcon=oe;n.divIcon=function(n){return new oe(n)};n.Marker=tu;n.marker=function(n,t){return new tu(n,t)};n.TileLayer=iu;n.tileLayer=nh;n.GridLayer=ts;n.gridLayer=function(n){return new ts(n)};n.SVG=sr;n.svg=re;n.Renderer=bt;n.Canvas=is;n.canvas=ie;n.Path=ei;n.CircleMarker=tf;n.circleMarker=function(n,t){return new tf(n,t)};n.Circle=ko;n.circle=function(n,t,i){return new ko(n,t,i)};n.Polyline=ni;n.polyline=function(n,t){return new ni(n,t)};n.Polygon=er;n.polygon=function(n,t){return new er(n,t)};n.Rectangle=se;n.rectangle=function(n,t){return new se(n,t)};n.Map=f;n.map=function(n,t){return new f(n,t)}}),function(n){var t=n.L;t.labelVersion="0.2.2-dev";t.Label=(t.Layer?t.Layer:t.Class).extend({includes:t.Mixin.Events,options:{className:"",clickable:!1,direction:"right",noHide:!1,offset:[12,-15],opacity:1,zoomAnimation:!0},initialize:function(n,i){t.setOptions(this,n);this._source=i;this._animated=t.Browser.any3d&&this.options.zoomAnimation;this._isOpen=!1},onAdd:function(n){this._map=n;this._pane=this.options.pane?n._panes[this.options.pane]:this._source instanceof t.Marker?n._panes.markerPane:n._panes.popupPane;this._container||this._initLayout();this._pane.appendChild(this._container);this._initInteraction();this._update();this.setOpacity(this.options.opacity);n.on("moveend",this._onMoveEnd,this).on("viewreset",this._onViewReset,this);this._animated&&n.on("zoomanim",this._zoomAnimation,this);t.Browser.touch&&!this.options.noHide&&(t.DomEvent.on(this._container,"click",this.close,this),n.on("click",this.close,this))},onRemove:function(n){this._pane.removeChild(this._container);n.off({zoomanim:this._zoomAnimation,moveend:this._onMoveEnd,viewreset:this._onViewReset},this);this._removeInteraction();this._map=null},setLatLng:function(n){return this._latlng=t.latLng(n),this._map&&this._updatePosition(),this},setContent:function(n){return this._previousContent=this._content,this._content=n,this._updateContent(),this},close:function(){var n=this._map;n&&(t.Browser.touch&&!this.options.noHide&&(t.DomEvent.off(this._container,"click",this.close),n.off("click",this.close,this)),n.removeLayer(this))},updateZIndex:function(n){this._zIndex=n;this._container&&this._zIndex&&(this._container.style.zIndex=n)},setOpacity:function(n){this.options.opacity=n;this._container&&t.DomUtil.setOpacity(this._container,n)},_initLayout:function(){this._container=t.DomUtil.create("div","leaflet-label "+this.options.className+" leaflet-zoom-animated");this.updateZIndex(this._zIndex)},_update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updatePosition(),this._container.style.visibility="")},_updateContent:function(){this._content&&this._map&&this._prevContent!==this._content&&"string"==typeof this._content&&(this._container.innerHTML=this._content,this._prevContent=this._content,this._labelWidth=this._container.offsetWidth)},_updatePosition:function(){var n=this._map.latLngToLayerPoint(this._latlng);this._setPosition(n)},_setPosition:function(n){var r=this._map,i=this._container,e=r.latLngToContainerPoint(r.getCenter()),o=r.layerPointToContainerPoint(n),f=this.options.direction,s=this._labelWidth,u=t.point(this.options.offset);"right"===f||"auto"===f&&o.x<e.x?(t.DomUtil.addClass(i,"leaflet-label-right"),t.DomUtil.removeClass(i,"leaflet-label-left"),n=n.add(u)):(t.DomUtil.addClass(i,"leaflet-label-left"),t.DomUtil.removeClass(i,"leaflet-label-right"),n=n.add(t.point(-u.x-s,u.y)));t.DomUtil.setPosition(i,n)},_zoomAnimation:function(n){var t=this._map._latLngToNewLayerPoint(this._latlng,n.zoom,n.center).round();this._setPosition(t)},_onMoveEnd:function(){this._animated&&"auto"!==this.options.direction||this._updatePosition()},_onViewReset:function(n){n&&n.hard&&this._update()},_initInteraction:function(){var n,r,i;if(this.options.clickable)for(n=this._container,r=["dblclick","mousedown","mouseover","mouseout","contextmenu"],t.DomUtil.addClass(n,"leaflet-clickable"),t.DomEvent.on(n,"click",this._onMouseClick,this),i=0;r.length>i;i++)t.DomEvent.on(n,r[i],this._fireMouseEvent,this)},_removeInteraction:function(){var n,r,i;if(this.options.clickable)for(n=this._container,r=["dblclick","mousedown","mouseover","mouseout","contextmenu"],t.DomUtil.removeClass(n,"leaflet-clickable"),t.DomEvent.off(n,"click",this._onMouseClick,this),i=0;r.length>i;i++)t.DomEvent.off(n,r[i],this._fireMouseEvent,this)},_onMouseClick:function(n){this.hasEventListeners(n.type)&&t.DomEvent.stopPropagation(n);this.fire(n.type,{originalEvent:n})},_fireMouseEvent:function(n){this.fire(n.type,{originalEvent:n});"contextmenu"===n.type&&this.hasEventListeners(n.type)&&t.DomEvent.preventDefault(n);"mousedown"!==n.type?t.DomEvent.stopPropagation(n):t.DomEvent.preventDefault(n)}});t.BaseMarkerMethods={showLabel:function(){return this.label&&this._map&&(this.label.setLatLng(this._latlng),this._map.showLabel(this.label)),this},hideLabel:function(){return this.label&&this.label.close(),this},setLabelNoHide:function(n){this._labelNoHide!==n&&(this._labelNoHide=n,n?(this._removeLabelRevealHandlers(),this.showLabel()):(this._addLabelRevealHandlers(),this.hideLabel()))},bindLabel:function(n,i){var u=this.options.icon?this.options.icon.options.labelAnchor:this.options.labelAnchor,r=t.point(u)||t.point(0,0);return r=r.add(t.Label.prototype.options.offset),i&&i.offset&&(r=r.add(i.offset)),i=t.Util.extend({offset:r},i),this._labelNoHide=i.noHide,this.label||(this._labelNoHide||this._addLabelRevealHandlers(),this.on("remove",this.hideLabel,this).on("move",this._moveLabel,this).on("add",this._onMarkerAdd,this),this._hasLabelHandlers=!0),this.label=new t.Label(i,this).setContent(n),this},unbindLabel:function(){return this.label&&(this.hideLabel(),this.label=null,this._hasLabelHandlers&&(this._labelNoHide||this._removeLabelRevealHandlers(),this.off("remove",this.hideLabel,this).off("move",this._moveLabel,this).off("add",this._onMarkerAdd,this)),this._hasLabelHandlers=!1),this},updateLabelContent:function(n){this.label&&this.label.setContent(n)},getLabel:function(){return this.label},_onMarkerAdd:function(){this._labelNoHide&&this.showLabel()},_addLabelRevealHandlers:function(){this.on("mouseover",this.showLabel,this).on("mouseout",this.hideLabel,this);t.Browser.touch&&this.on("click",this.showLabel,this)},_removeLabelRevealHandlers:function(){this.off("mouseover",this.showLabel,this).off("mouseout",this.hideLabel,this);t.Browser.touch&&this.off("click",this.showLabel,this)},_moveLabel:function(n){this.label.setLatLng(n.latlng)}};t.Icon.Default.mergeOptions({labelAnchor:new t.Point(9,-20)});t.Marker.mergeOptions({icon:new t.Icon.Default});t.Marker.include(t.BaseMarkerMethods);t.Marker.include({_originalUpdateZIndex:t.Marker.prototype._updateZIndex,_updateZIndex:function(n){var t=this._zIndex+n;this._originalUpdateZIndex(n);this.label&&this.label.updateZIndex(t)},_originalSetOpacity:t.Marker.prototype.setOpacity,setOpacity:function(n,t){this.options.labelHasSemiTransparency=t;this._originalSetOpacity(n)},_originalUpdateOpacity:t.Marker.prototype._updateOpacity,_updateOpacity:function(){var n=0===this.options.opacity?0:1;this._originalUpdateOpacity();this.label&&this.label.setOpacity(this.options.labelHasSemiTransparency?this.options.opacity:n)},_originalSetLatLng:t.Marker.prototype.setLatLng,setLatLng:function(n){return this.label&&!this._labelNoHide&&this.hideLabel(),this._originalSetLatLng(n)}});t.CircleMarker.mergeOptions({labelAnchor:new t.Point(0,0)});t.CircleMarker.include(t.BaseMarkerMethods);t.Path.include({bindLabel:function(n,i){return this.label&&this.label.options===i||(this.label=new t.Label(i,this)),this.label.setContent(n),this._showLabelAdded||(this.on("mouseover",this._showLabel,this).on("mousemove",this._moveLabel,this).on("mouseout remove",this._hideLabel,this),t.Browser.touch&&this.on("click",this._showLabel,this),this._showLabelAdded=!0),this},unbindLabel:function(){return this.label&&(this._hideLabel(),this.label=null,this._showLabelAdded=!1,this.off("mouseover",this._showLabel,this).off("mousemove",this._moveLabel,this).off("mouseout remove",this._hideLabel,this)),this},updateLabelContent:function(n){this.label&&this.label.setContent(n)},_showLabel:function(n){this.label.setLatLng(n.latlng);this._map.showLabel(this.label)},_moveLabel:function(n){this.label.setLatLng(n.latlng)},_hideLabel:function(){this.label.close()}});t.Map.include({showLabel:function(n){return this.addLayer(n)}});t.FeatureGroup.include({clearLayers:function(){return this.unbindLabel(),this.eachLayer(this.removeLayer,this),this},bindLabel:function(n,t){return this.invoke("bindLabel",n,t)},unbindLabel:function(){return this.invoke("unbindLabel")},updateLabelContent:function(n){this.invoke("updateLabelContent",n)}})}(window,document);!function(n,t){function i(n,t){for(;(n=n.parentElement)&&!n.classList.contains(t););return n}L.drawVersion="0.4.14";L.Draw={};L.drawLocal={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:<\/strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes",text:"Save"},cancel:{title:"Cancel editing, discards all changes",text:"Cancel"},clearAll:{title:"Clear all layers",text:"Clear All"}},buttons:{edit:"Edit layers",editDisabled:"No layers to edit",remove:"Delete layers",removeDisabled:"No layers to delete"}},handlers:{edit:{tooltip:{text:"Drag handles or markers to edit features.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove."}}}}};L.Draw.Event={};L.Draw.Event.CREATED="draw:created";L.Draw.Event.EDITED="draw:edited";L.Draw.Event.DELETED="draw:deleted";L.Draw.Event.DRAWSTART="draw:drawstart";L.Draw.Event.DRAWSTOP="draw:drawstop";L.Draw.Event.DRAWVERTEX="draw:drawvertex";L.Draw.Event.EDITSTART="draw:editstart";L.Draw.Event.EDITMOVE="draw:editmove";L.Draw.Event.EDITRESIZE="draw:editresize";L.Draw.Event.EDITVERTEX="draw:editvertex";L.Draw.Event.EDITSTOP="draw:editstop";L.Draw.Event.DELETESTART="draw:deletestart";L.Draw.Event.DELETESTOP="draw:deletestop";L.Draw.Event.TOOLBAROPENED="draw:toolbaropened";L.Draw.Event.TOOLBARCLOSED="draw:toolbarclosed";L.Draw.Event.MARKERCONTEXT="draw:markercontext";L.Draw=L.Draw||{};L.Draw.Feature=L.Handler.extend({initialize:function(n,t){this._map=n;this._container=n._container;this._overlayPane=n._panes.overlayPane;this._popupPane=n._panes.popupPane;t&&t.shapeOptions&&(t.shapeOptions=L.Util.extend({},this.options.shapeOptions,t.shapeOptions));L.setOptions(this,t);var i=L.version.split(".");1===parseInt(i[0],10)&&parseInt(i[1],10)>=2?L.Draw.Feature.include(L.Evented.prototype):L.Draw.Feature.include(L.Mixin.Events)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(L.DomUtil.disableTextSelection(),n.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,"keyup",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,"keyup",this._cancelDrawing,this))},setOptions:function(n){L.setOptions(this,n)},_fireCreatedEvent:function(n){this._map.fire(L.Draw.Event.CREATED,{layer:n,layerType:this.type})},_cancelDrawing:function(n){27===n.keyCode&&(this._map.fire("draw:canceled",{layerType:this.type}),this.disable())}});L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:"polyline"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},initialize:function(n,t){L.Browser.touch&&(this.options.icon=this.options.touchIcon);this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error;t&&t.drawError&&(t.drawError=L.Util.extend({},this.options.drawError,t.drawError));this.type=L.Draw.Polyline.TYPE;L.Draw.Feature.prototype.initialize.call(this,n,t)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this);this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("mouseout",this._onMouseOut,this).on("mousemove",this._onMouseMove,this).on("mousedown",this._onMouseDown,this).on("mouseup",this._onMouseUp,this).addTo(this._map),this._map.on("mouseup",this._onMouseUp,this).on("mousemove",this._onMouseMove,this).on("zoomlevelschange",this._onZoomEnd,this).on("touchstart",this._onTouch,this).on("zoomend",this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this);this._clearHideErrorTimeout();this._cleanUpShape();this._map.removeLayer(this._markerGroup);delete this._markerGroup;delete this._markers;this._map.removeLayer(this._poly);delete this._poly;this._mouseMarker.off("mousedown",this._onMouseDown,this).off("mouseout",this._onMouseOut,this).off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this);this._map.removeLayer(this._mouseMarker);delete this._mouseMarker;this._clearGuides();this._map.off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this).off("zoomlevelschange",this._onZoomEnd,this).off("zoomend",this._onZoomEnd,this).off("touchstart",this._onTouch,this).off("click",this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var i=this._markers.pop(),n=this._poly,t=n.getLatLngs(),r=t.splice(-1,1)[0];this._poly.setLatLngs(t);this._markerGroup.removeLayer(i);n.getLatLngs().length<2&&this._map.removeLayer(n);this._vertexChanged(r,!1)}},addVertex:function(n){if(this._markers.length>=2&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(n))return void this._showErrorTooltip();this._errorShown&&this._hideErrorTooltip();this._markers.push(this._createMarker(n));this._poly.addLatLng(n);2===this._poly.getLatLngs().length&&this._map.addLayer(this._poly);this._vertexChanged(n,!0)},completeShape:function(){this._markers.length<=1||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_finishShape:function(){var n=this._poly._defaultShape?this._poly._defaultShape():this._poly.getLatLngs(),t=this._poly.newLatLngIntersects(n[n.length-1]);if(!this.options.allowIntersection&&t||!this._shapeIsValid())return void this._showErrorTooltip();this._fireCreatedEvent();this.disable();this.options.repeatMode&&this.enable()},_shapeIsValid:function(){return!0},_onZoomEnd:function(){null!==this._markers&&this._updateGuide()},_onMouseMove:function(n){var i=this._map.mouseEventToLayerPoint(n.originalEvent),t=this._map.layerPointToLatLng(i);this._currentLatLng=t;this._updateTooltip(t);this._updateGuide(i);this._mouseMarker.setLatLng(t);L.DomEvent.preventDefault(n.originalEvent)},_vertexChanged:function(n,t){this._map.fire(L.Draw.Event.DRAWVERTEX,{layers:this._markerGroup});this._updateFinishHandler();this._updateRunningMeasure(n,t);this._clearGuides();this._updateTooltip()},_onMouseDown:function(n){if(!this._clickHandled&&!this._touchHandled&&!this._disableMarkers){this._onMouseMove(n);this._clickHandled=!0;this._disableNewMarkers();var t=n.originalEvent,i=t.clientX,r=t.clientY;this._startPoint.call(this,i,r)}},_startPoint:function(n,t){this._mouseDownOrigin=L.point(n,t)},_onMouseUp:function(n){var t=n.originalEvent,i=t.clientX,r=t.clientY;this._endPoint.call(this,i,r,n);this._clickHandled=null},_endPoint:function(t,i,r){if(this._mouseDownOrigin){var u=L.point(t,i).distanceTo(this._mouseDownOrigin),f=this._calculateFinishDistance(r.latlng);this.options.maxPoints>1&&this.options.maxPoints==this._markers.length+1?(this.addVertex(r.latlng),this._finishShape()):f<10&&L.Browser.touch?this._finishShape():Math.abs(u)<9*(n.devicePixelRatio||1)&&this.addVertex(r.latlng);this._enableNewMarkers()}this._mouseDownOrigin=null},_onTouch:function(n){var i,r,t=n.originalEvent;!t.touches||!t.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(i=t.touches[0].clientX,r=t.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,i,r),this._endPoint.call(this,i,r,n),this._touchHandled=null);this._clickHandled=null},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_calculateFinishDistance:function(n){var t,i;if(this._markers.length>0){if(this.type===L.Draw.Polyline.TYPE)i=this._markers[this._markers.length-1];else{if(this.type!==L.Draw.Polygon.TYPE)return 1/0;i=this._markers[0]}var r=this._map.latLngToContainerPoint(i.getLatLng()),u=new L.Marker(n,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),f=this._map.latLngToContainerPoint(u.getLatLng());t=r.distanceTo(f)}else t=1/0;return t},_updateFinishHandler:function(){var n=this._markers.length;n>1&&this._markers[n-1].on("click",this._finishShape,this);n>2&&this._markers[n-2].off("click",this._finishShape,this)},_createMarker:function(n){var t=new L.Marker(n,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(t),t},_updateGuide:function(n){var t=this._markers?this._markers.length:0;t>0&&(n=n||this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[t-1].getLatLng()),n))},_updateTooltip:function(n){var t=this._getTooltipText();n&&this._tooltip.updatePosition(n);this._errorShown||this._tooltip.updateContent(t)},_drawGuide:function(n,t){var i,e,u,r=Math.floor(Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))),s=this.options.guidelineDistance,o=this.options.maxGuideLineLength,f=r>o?r-o:s;for(this._guidesContainer||(this._guidesContainer=L.DomUtil.create("div","leaflet-draw-guides",this._overlayPane));f<r;f+=this.options.guidelineDistance)i=f/r,e={x:Math.floor(n.x*(1-i)+i*t.x),y:Math.floor(n.y*(1-i)+i*t.y)},u=L.DomUtil.create("div","leaflet-draw-guide-dash",this._guidesContainer),u.style.backgroundColor=this._errorShown?this.options.drawError.color:this.options.shapeOptions.color,L.DomUtil.setPosition(u,e)},_updateGuideColor:function(n){if(this._guidesContainer)for(var t=0,i=this._guidesContainer.childNodes.length;t<i;t++)this._guidesContainer.childNodes[t].style.backgroundColor=n},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var n,t,i=this.options.showLength;return 0===this._markers.length?n={text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(t=i?this._getMeasurementString():"",n=1===this._markers.length?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:t}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:t}),n},_updateRunningMeasure:function(n,t){var i,r,u=this._markers.length;1===this._markers.length?this._measurementRunningTotal=0:(i=u-(t?2:1),r=L.GeometryUtil.isVersion07x()?n.distanceTo(this._markers[i].getLatLng())*(this.options.factor||1):this._map.distance(n,this._markers[i].getLatLng())*(this.options.factor||1),this._measurementRunningTotal+=r*(t?1:-1))},_getMeasurementString:function(){var i,n=this._currentLatLng,t=this._markers[this._markers.length-1].getLatLng();return i=L.GeometryUtil.isVersion07x()?t&&n&&n.distanceTo?this._measurementRunningTotal+n.distanceTo(t)*(this.options.factor||1):this._measurementRunningTotal||0:t&&n?this._measurementRunningTotal+this._map.distance(n,t)*(this.options.factor||1):this._measurementRunningTotal||0,L.GeometryUtil.readableDistance(i,this.options.metric,this.options.feet,this.options.nautic,this.options.precision)},_showErrorTooltip:function(){this._errorShown=!0;this._tooltip.showAsError().updateContent({text:this.options.drawError.message});this._updateGuideColor(this.options.drawError.color);this._poly.setStyle({color:this.options.drawError.color});this._clearHideErrorTimeout();this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1;this._clearHideErrorTimeout();this._tooltip.removeError().updateContent(this._getTooltipText());this._updateGuideColor(this.options.shapeOptions.color);this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&(clearTimeout(this._hideErrorTimeout),this._hideErrorTimeout=null)},_disableNewMarkers:function(){this._disableMarkers=!0},_enableNewMarkers:function(){setTimeout(function(){this._disableMarkers=!1}.bind(this),50)},_cleanUpShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off("click",this._finishShape,this)},_fireCreatedEvent:function(){var n=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)}});L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:"polygon"},Poly:L.Polygon,options:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},initialize:function(n,t){L.Draw.Polyline.prototype.initialize.call(this,n,t);this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var n=this._markers.length;1===n&&this._markers[0].on("click",this._finishShape,this);n>2&&(this._markers[n-1].on("dblclick",this._finishShape,this),n>3&&this._markers[n-2].off("dblclick",this._finishShape,this))},_getTooltipText:function(){var n,t;return 0===this._markers.length?n=L.drawLocal.draw.handlers.polygon.tooltip.start:this._markers.length<3?(n=L.drawLocal.draw.handlers.polygon.tooltip.cont,t=this._getMeasurementString()):(n=L.drawLocal.draw.handlers.polygon.tooltip.end,t=this._getMeasurementString()),{text:n,subtext:t}},_getMeasurementString:function(){var n=this._area,t="";return n||this.options.showLength?(this.options.showLength&&(t=L.Draw.Polyline.prototype._getMeasurementString.call(this)),n&&(t+="<br>"+L.GeometryUtil.readableArea(n,this.options.metric,this.options.precision)),t):null},_shapeIsValid:function(){return this._markers.length>=3},_vertexChanged:function(n,t){var i;!this.options.allowIntersection&&this.options.showArea&&(i=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(i));L.Draw.Polyline.prototype._vertexChanged.call(this,n,t)},_cleanUpShape:function(){var n=this._markers.length;n>0&&(this._markers[0].off("click",this._finishShape,this),n>2&&this._markers[n-1].off("dblclick",this._finishShape,this))}});L.SimpleShape={};L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(n,t){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end;L.Draw.Feature.prototype.initialize.call(this,n,t)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this);this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor="crosshair",this._tooltip.updateContent({text:this._initialLabelText}),this._map.on("mousedown",this._onMouseDown,this).on("mousemove",this._onMouseMove,this).on("touchstart",this._onMouseDown,this).on("touchmove",this._onMouseMove,this),t.addEventListener("touchstart",L.DomEvent.preventDefault,{passive:!1}))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this);this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor="",this._map.off("mousedown",this._onMouseDown,this).off("mousemove",this._onMouseMove,this).off("touchstart",this._onMouseDown,this).off("touchmove",this._onMouseMove,this),L.DomEvent.off(t,"mouseup",this._onMouseUp,this),L.DomEvent.off(t,"touchend",this._onMouseUp,this),t.removeEventListener("touchstart",L.DomEvent.preventDefault),this._shape&&(this._map.removeLayer(this._shape),delete this._shape));this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(n){this._isDrawing=!0;this._startLatLng=n.latlng;L.DomEvent.on(t,"mouseup",this._onMouseUp,this).on(t,"touchend",this._onMouseUp,this).preventDefault(n.originalEvent)},_onMouseMove:function(n){var t=n.latlng;this._tooltip.updatePosition(t);this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(t))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent();this.disable();this.options.repeatMode&&this.enable()}});L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:"rectangle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,showArea:!0,clickable:!0},metric:!0},initialize:function(n,t){this.type=L.Draw.Rectangle.TYPE;this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start;L.Draw.SimpleShape.prototype.initialize.call(this,n,t)},disable:function(){this._enabled&&(this._isCurrentlyTwoClickDrawing=!1,L.Draw.SimpleShape.prototype.disable.call(this))},_onMouseUp:function(n){if(!this._shape&&!this._isCurrentlyTwoClickDrawing)return void(this._isCurrentlyTwoClickDrawing=!0);this._isCurrentlyTwoClickDrawing&&!i(n.target,"leaflet-pane")||L.Draw.SimpleShape.prototype._onMouseUp.call(this)},_drawShape:function(n){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,n)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,n),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var n=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,n)},_getTooltipText:function(){var n,t,i,r=L.Draw.SimpleShape.prototype._getTooltipText.call(this),u=this._shape,f=this.options.showArea;return u&&(n=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),t=L.GeometryUtil.geodesicArea(n),i=f?L.GeometryUtil.readableArea(t,this.options.metric):""),{text:r.text,subtext:i}}});L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:"marker"},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(n,t){this.type=L.Draw.Marker.TYPE;this._initialLabelText=L.drawLocal.draw.handlers.marker.tooltip.start;L.Draw.Feature.prototype.initialize.call(this,n,t)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this);this._map&&(this._tooltip.updateContent({text:this._initialLabelText}),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("click",this._onClick,this).addTo(this._map),this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this);this._map&&(this._map.off("click",this._onClick,this).off("click",this._onTouch,this),this._marker&&(this._marker.off("click",this._onClick,this),this._map.removeLayer(this._marker),delete this._marker),this._mouseMarker.off("click",this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off("mousemove",this._onMouseMove,this))},_onMouseMove:function(n){var t=n.latlng;this._tooltip.updatePosition(t);this._mouseMarker.setLatLng(t);this._marker?(t=this._mouseMarker.getLatLng(),this._marker.setLatLng(t)):(this._marker=this._createMarker(t),this._marker.on("click",this._onClick,this),this._map.on("click",this._onClick,this).addLayer(this._marker))},_createMarker:function(n){return new L.Marker(n,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset})},_onClick:function(){this._fireCreatedEvent();this.disable();this.options.repeatMode&&this.enable()},_onTouch:function(n){this._onMouseMove(n);this._onClick()},_fireCreatedEvent:function(){var n=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)}});L.Draw.CircleMarker=L.Draw.Marker.extend({statics:{TYPE:"circlemarker"},options:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0,zIndexOffset:2e3},initialize:function(n,t){this.type=L.Draw.CircleMarker.TYPE;this._initialLabelText=L.drawLocal.draw.handlers.circlemarker.tooltip.start;L.Draw.Feature.prototype.initialize.call(this,n,t)},_fireCreatedEvent:function(){var n=new L.CircleMarker(this._marker.getLatLng(),this.options);L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)},_createMarker:function(n){return new L.CircleMarker(n,this.options)}});L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:"circle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},initialize:function(n,t){this.type=L.Draw.Circle.TYPE;this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start;L.Draw.SimpleShape.prototype.initialize.call(this,n,t)},_drawShape:function(n){var t;t=L.GeometryUtil.isVersion07x()?this._startLatLng.distanceTo(n):this._map.distance(this._startLatLng,n);this._shape?this._shape.setRadius(t):(this._shape=new L.Circle(this._startLatLng,t,this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var n=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,n)},_onMouseMove:function(n){var i,r=n.latlng,u=this.options.showRadius,f=this.options.metric,t;(this._tooltip.updatePosition(r),this._isDrawing)&&(this._drawShape(r),i=this._shape.getRadius().toFixed(1),t="",u&&(t=L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(i,f,this.options.feet,this.options.nautic)),this._tooltip.updateContent({text:this._endLabelText,subtext:t}))}});L.Edit=L.Edit||{};L.Edit.Marker=L.Handler.extend({initialize:function(n,t){this._marker=n;L.setOptions(this,t)},addHooks:function(){var n=this._marker;n.dragging.enable();n.on("dragend",this._onDragEnd,n);this._toggleMarkerHighlight()},removeHooks:function(){var n=this._marker;n.dragging.disable();n.off("dragend",this._onDragEnd,n);this._toggleMarkerHighlight()},_onDragEnd:function(n){var t=n.target;t.edited=!0;this._map.fire(L.Draw.Event.EDITMOVE,{layer:t})},_toggleMarkerHighlight:function(){var n=this._marker._icon;n&&(n.style.display="none",L.DomUtil.hasClass(n,"leaflet-edit-marker-selected")?(L.DomUtil.removeClass(n,"leaflet-edit-marker-selected"),this._offsetMarker(n,-4)):(L.DomUtil.addClass(n,"leaflet-edit-marker-selected"),this._offsetMarker(n,4)),n.style.display="")},_offsetMarker:function(n,t){var i=parseInt(n.style.marginTop,10)-t,r=parseInt(n.style.marginLeft,10)-t;n.style.marginTop=i+"px";n.style.marginLeft=r+"px"}});L.Marker.addInitHook(function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())});L.Edit=L.Edit||{};L.Edit.Poly=L.Handler.extend({initialize:function(n){this.latlngs=[n._latlngs];n._holes&&(this.latlngs=this.latlngs.concat(n._holes));this._poly=n;this._poly.on("revert-edited",this._updateLatLngs,this)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._poly._latlngs)?this._poly._latlngs:this._poly._latlngs[0]:this._poly._latlngs},_eachVertexHandler:function(n){for(var t=0;t<this._verticesHandlers.length;t++)n(this._verticesHandlers[t])},addHooks:function(){this._initHandlers();this._eachVertexHandler(function(n){n.addHooks()})},removeHooks:function(){this._eachVertexHandler(function(n){n.removeHooks()})},updateMarkers:function(){this._eachVertexHandler(function(n){n.updateMarkers()})},_initHandlers:function(){this._verticesHandlers=[];for(var n=0;n<this.latlngs.length;n++)this._verticesHandlers.push(new L.Edit.PolyVerticesEdit(this._poly,this.latlngs[n],this._poly.options.poly))},_updateLatLngs:function(n){this.latlngs=[n.layer._latlngs];n.layer._holes&&(this.latlngs=this.latlngs.concat(n.layer._holes))}});L.Edit.PolyVerticesEdit=L.Handler.extend({options:{icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),drawError:{color:"#b00b00",timeout:1e3}},initialize:function(n,t,i){L.Browser.touch&&(this.options.icon=this.options.touchIcon);this._poly=n;i&&i.drawError&&(i.drawError=L.Util.extend({},this.options.drawError,i.drawError));this._latlngs=t;L.setOptions(this,i)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]:this._latlngs},addHooks:function(){var n=this._poly,t=n._path;n instanceof L.Polygon||(n.options.fill=!1,n.options.editing&&(n.options.editing.fill=!1));t&&n.options.editing.className&&(n.options.original.className&&n.options.original.className.split(" ").forEach(function(n){L.DomUtil.removeClass(t,n)}),n.options.editing.className.split(" ").forEach(function(n){L.DomUtil.addClass(t,n)}));n.setStyle(n.options.editing);this._poly._map&&(this._map=this._poly._map,this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var n=this._poly,t=n._path;t&&n.options.editing.className&&(n.options.editing.className.split(" ").forEach(function(n){L.DomUtil.removeClass(t,n)}),n.options.original.className&&n.options.original.className.split(" ").forEach(function(n){L.DomUtil.addClass(t,n)}));n.setStyle(n.options.original);n._map&&(n._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers();this._initMarkers()},_initMarkers:function(){var n,r,t,i,u,f,e;for(this._markerGroup||(this._markerGroup=new L.LayerGroup),this._markers=[],u=this._defaultShape(),n=0,t=u.length;n<t;n++)i=this._createMarker(u[n],n),i.on("click",this._onMarkerClick,this),i.on("contextmenu",this._onContextMenu,this),this._markers.push(i);for(n=0,r=t-1;n<t;r=n++)(0!==n||L.Polygon&&this._poly instanceof L.Polygon)&&(f=this._markers[r],e=this._markers[n],this._createMiddleMarker(f,e),this._updatePrevNext(f,e))},_createMarker:function(n,t){var i=new L.Marker.Touch(n,{draggable:!0,icon:this.options.icon});return i._origLatLng=n,i._index=t,i.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._fireEdit,this).on("touchmove",this._onTouchMove,this).on("touchend",this._fireEdit,this).on("MSPointerMove",this._onTouchMove,this).on("MSPointerUp",this._fireEdit,this),this._markerGroup.addLayer(i),i},_onMarkerDragStart:function(){this._poly.fire("editstart")},_spliceLatLngs:function(){var n=this._defaultShape(),t=[].splice.apply(n,arguments);return this._poly._convertLatLngs(n,!0),this._poly.redraw(),t},_removeMarker:function(n){var t=n._index;this._markerGroup.removeLayer(n);this._markers.splice(t,1);this._spliceLatLngs(t,1);this._updateIndexes(t,-1);n.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._fireEdit,this).off("touchmove",this._onMarkerDrag,this).off("touchend",this._fireEdit,this).off("click",this._onMarkerClick,this).off("MSPointerMove",this._onTouchMove,this).off("MSPointerUp",this._fireEdit,this)},_fireEdit:function(){this._poly.edited=!0;this._poly.fire("edit");this._poly._map.fire(L.Draw.Event.EDITVERTEX,{layers:this._markerGroup,poly:this._poly})},_onMarkerDrag:function(n){var t=n.target,i=this._poly,r,u,f;(L.extend(t._origLatLng,t._latlng),t._middleLeft&&t._middleLeft.setLatLng(this._getMiddleLatLng(t._prev,t)),t._middleRight&&t._middleRight.setLatLng(this._getMiddleLatLng(t,t._next)),i.options.poly)&&(r=i._map._editTooltip,!i.options.poly.allowIntersection&&i.intersects()&&(u=i.options.color,i.setStyle({color:this.options.drawError.color}),0!==L.version.indexOf("0.7")&&t.dragging._draggable._onUp(n),this._onMarkerClick(n),r&&r.updateContent({text:L.drawLocal.draw.handlers.polyline.error}),setTimeout(function(){i.setStyle({color:u});r&&r.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext})},1e3)));this._poly._bounds._southWest=L.latLng(1/0,1/0);this._poly._bounds._northEast=L.latLng(-1/0,-1/0);f=this._poly.getLatLngs();this._poly._convertLatLngs(f,!0);this._poly.redraw();this._poly.fire("editdrag")},_onMarkerClick:function(n){var i=L.Polygon&&this._poly instanceof L.Polygon?4:3,t=n.target;this._defaultShape().length<i||(this._removeMarker(t),this._updatePrevNext(t._prev,t._next),t._middleLeft&&this._markerGroup.removeLayer(t._middleLeft),t._middleRight&&this._markerGroup.removeLayer(t._middleRight),t._prev&&t._next?this._createMiddleMarker(t._prev,t._next):t._prev?t._next||(t._prev._middleRight=null):t._next._middleLeft=null,this._fireEdit())},_onContextMenu:function(n){var t=n.target;this._poly;this._poly._map.fire(L.Draw.Event.MARKERCONTEXT,{marker:t,layers:this._markerGroup,poly:this._poly});L.DomEvent.stopPropagation},_onTouchMove:function(n){var i=this._map.mouseEventToLayerPoint(n.originalEvent.touches[0]),r=this._map.layerPointToLatLng(i),t=n.target;L.extend(t._origLatLng,r);t._middleLeft&&t._middleLeft.setLatLng(this._getMiddleLatLng(t._prev,t));t._middleRight&&t._middleRight.setLatLng(this._getMiddleLatLng(t,t._next));this._poly.redraw();this.updateMarkers()},_updateIndexes:function(n,t){this._markerGroup.eachLayer(function(i){i._index>n&&(i._index+=t)})},_createMiddleMarker:function(n,t){var e,r,u,f=this._getMiddleLatLng(n,t),i=this._createMarker(f);i.setOpacity(.6);n._middleRight=t._middleLeft=i;r=function(){i.off("touchmove",r,this);var u=t._index;i._index=u;i.off("click",e,this).on("click",this._onMarkerClick,this);f.lat=i.getLatLng().lat;f.lng=i.getLatLng().lng;this._spliceLatLngs(u,0,f);this._markers.splice(u,0,i);i.setOpacity(1);this._updateIndexes(u,1);t._index++;this._updatePrevNext(n,i);this._updatePrevNext(i,t);this._poly.fire("editstart")};u=function(){i.off("dragstart",r,this);i.off("dragend",u,this);i.off("touchmove",r,this);this._createMiddleMarker(n,i);this._createMiddleMarker(i,t)};e=function(){r.call(this);u.call(this);this._fireEdit()};i.on("click",e,this).on("dragstart",r,this).on("dragend",u,this).on("touchmove",r,this);this._markerGroup.addLayer(i)},_updatePrevNext:function(n,t){n&&(n._next=t);t&&(t._prev=n)},_getMiddleLatLng:function(n,t){var i=this._poly._map,r=i.project(n.getLatLng()),u=i.project(t.getLatLng());return i.unproject(r._add(u)._divideBy(2))}});L.Polyline.addInitHook(function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))});L.Edit=L.Edit||{};L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move"}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize"}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon"}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon"})},initialize:function(n,t){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon);this._shape=n;L.Util.setOptions(this,t)},addHooks:function(){var n=this._shape;this._shape._map&&(this._map=this._shape._map,n.setStyle(n.options.editing),n._map&&(this._map=n._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var t=this._shape,n,i;if(t.setStyle(t.options.original),t._map){for(this._unbindMarker(this._moveMarker),n=0,i=this._resizeMarkers.length;n<i;n++)this._unbindMarker(this._resizeMarkers[n]);this._resizeMarkers=null;this._map.removeLayer(this._markerGroup);delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers();this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup);this._createMoveMarker();this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(n,t){var i=new L.Marker.Touch(n,{draggable:!0,icon:t,zIndexOffset:10});return this._bindMarker(i),this._markerGroup.addLayer(i),i},_bindMarker:function(n){n.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._onMarkerDragEnd,this).on("touchstart",this._onTouchStart,this).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onTouchEnd,this).on("MSPointerUp",this._onTouchEnd,this)},_unbindMarker:function(n){n.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._onMarkerDragEnd,this).off("touchstart",this._onTouchStart,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onTouchEnd,this).off("MSPointerUp",this._onTouchEnd,this)},_onMarkerDragStart:function(n){n.target.setOpacity(0);this._shape.fire("editstart")},_fireEdit:function(){this._shape.edited=!0;this._shape.fire("edit")},_onMarkerDrag:function(n){var t=n.target,i=t.getLatLng();t===this._moveMarker?this._move(i):this._resize(i);this._shape.redraw();this._shape.fire("editdrag")},_onMarkerDragEnd:function(n){n.target.setOpacity(1);this._fireEdit()},_onTouchStart:function(n){if(L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,n),"function"==typeof this._getCorners){var r=this._getCorners(),t=n.target,i=t._cornerIndex;t.setOpacity(0);this._oppositeCorner=r[(i+2)%4];this._toggleCornerMarkers(0,i)}this._shape.fire("editstart")},_onTouchMove:function(n){var i=this._map.mouseEventToLayerPoint(n.originalEvent.touches[0]),t=this._map.layerPointToLatLng(i);return n.target===this._moveMarker?this._move(t):this._resize(t),this._shape.redraw(),!1},_onTouchEnd:function(n){n.target.setOpacity(1);this.updateMarkers();this._fireEdit()},_move:function(){},_resize:function(){}});L.Edit=L.Edit||{};L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var n=this._shape.getBounds(),t=n.getCenter();this._moveMarker=this._createMarker(t,this.options.moveIcon)},_createResizeMarker:function(){var t=this._getCorners(),n,i;for(this._resizeMarkers=[],n=0,i=t.length;n<i;n++)this._resizeMarkers.push(this._createMarker(t[n],this.options.resizeIcon)),this._resizeMarkers[n]._cornerIndex=n},_onMarkerDragStart:function(n){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,n);var i=this._getCorners(),r=n.target,t=r._cornerIndex;this._oppositeCorner=i[(t+2)%4];this._toggleCornerMarkers(0,t)},_onMarkerDragEnd:function(n){var t,i,r=n.target;r===this._moveMarker&&(t=this._shape.getBounds(),i=t.getCenter(),r.setLatLng(i));this._toggleCornerMarkers(1);this._repositionCornerMarkers();L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,n)},_move:function(n){for(var i,r=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),e=this._shape.getBounds(),u=e.getCenter(),f=[],t=0,o=r.length;t<o;t++)i=[r[t].lat-u.lat,r[t].lng-u.lng],f.push([n.lat+i[0],n.lng+i[1]]);this._shape.setLatLngs(f);this._repositionCornerMarkers();this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})},_resize:function(n){var t;this._shape.setBounds(L.latLngBounds(n,this._oppositeCorner));t=this._shape.getBounds();this._moveMarker.setLatLng(t.getCenter());this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})},_getCorners:function(){var n=this._shape.getBounds();return[n.getNorthWest(),n.getNorthEast(),n.getSouthEast(),n.getSouthWest()]},_toggleCornerMarkers:function(n){for(var t=0,i=this._resizeMarkers.length;t<i;t++)this._resizeMarkers[t].setOpacity(n)},_repositionCornerMarkers:function(){for(var t=this._getCorners(),n=0,i=this._resizeMarkers.length;n<i;n++)this._resizeMarkers[n].setLatLng(t[n])}});L.Rectangle.addInitHook(function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable&&this.editing.enable())});L.Edit=L.Edit||{};L.Edit.CircleMarker=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var n=this._shape.getLatLng();this._moveMarker=this._createMarker(n,this.options.moveIcon)},_createResizeMarker:function(){this._resizeMarkers=[]},_move:function(n){if(this._resizeMarkers.length){var t=this._getResizeMarkerPoint(n);this._resizeMarkers[0].setLatLng(t)}this._shape.setLatLng(n);this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})}});L.CircleMarker.addInitHook(function(){L.Edit.CircleMarker&&(this.editing=new L.Edit.CircleMarker(this),this.options.editable&&this.editing.enable());this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()});this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})});L.Edit=L.Edit||{};L.Edit.Circle=L.Edit.CircleMarker.extend({_createResizeMarker:function(){var n=this._shape.getLatLng(),t=this._getResizeMarkerPoint(n);this._resizeMarkers=[];this._resizeMarkers.push(this._createMarker(t,this.options.resizeIcon))},_getResizeMarkerPoint:function(n){var t=this._shape._radius*Math.cos(Math.PI/4),i=this._map.project(n);return this._map.unproject([i.x+t,i.y-t])},_resize:function(n){var t=this._moveMarker.getLatLng();radius=L.GeometryUtil.isVersion07x()?t.distanceTo(n):this._map.distance(t,n);this._shape.setRadius(radius);this._map._editTooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.subtext+"<br />"+L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(radius,!0,this.options.feet,this.options.nautic)});this._shape.setRadius(radius);this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})}});L.Circle.addInitHook(function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable());this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()});this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})});L.Map.mergeOptions({touchExtend:!0});L.Map.TouchExtend=L.Handler.extend({initialize:function(n){this._map=n;this._container=n._container;this._pane=n._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,"touchstart",this._onTouchStart,this);L.DomEvent.on(this._container,"touchend",this._onTouchEnd,this);L.DomEvent.on(this._container,"touchmove",this._onTouchMove,this);this._detectIE()?(L.DomEvent.on(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.on(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.on(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.on(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.on(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.on(this._container,"touchleave",this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,"touchstart",this._onTouchStart);L.DomEvent.off(this._container,"touchend",this._onTouchEnd);L.DomEvent.off(this._container,"touchmove",this._onTouchMove);this._detectIE()?(L.DomEvent.off(this._container,"MSPointerDowm",this._onTouchStart),L.DomEvent.off(this._container,"MSPointerUp",this._onTouchEnd),L.DomEvent.off(this._container,"MSPointerMove",this._onTouchMove),L.DomEvent.off(this._container,"MSPointerCancel",this._onTouchCancel)):(L.DomEvent.off(this._container,"touchcancel",this._onTouchCancel),L.DomEvent.off(this._container,"touchleave",this._onTouchLeave))},_touchEvent:function(n,t){var i={};if(void 0!==n.touches){if(!n.touches.length)return;i=n.touches[0]}else{if("touch"!==n.pointerType)return;if(i=n,!this._filterClick(n))return}var u=this._map.mouseEventToContainerPoint(i),r=this._map.mouseEventToLayerPoint(i),f=this._map.layerPointToLatLng(r);this._map.fire(t,{latlng:f,layerPoint:r,containerPoint:u,pageX:i.pageX,pageY:i.pageY,originalEvent:n})},_filterClick:function(n){var i=n.timeStamp||n.originalEvent.timeStamp,t=L.DomEvent._lastClick&&i-L.DomEvent._lastClick;return t&&t>100&&t<500||n.target._simulatedClick&&!n._simulated?(L.DomEvent.stop(n),!1):(L.DomEvent._lastClick=i,!0)},_onTouchStart:function(n){this._map._loaded&&this._touchEvent(n,"touchstart")},_onTouchEnd:function(n){this._map._loaded&&this._touchEvent(n,"touchend")},_onTouchCancel:function(n){if(this._map._loaded){var t="touchcancel";this._detectIE()&&(t="pointercancel");this._touchEvent(n,t)}},_onTouchLeave:function(n){this._map._loaded&&this._touchEvent(n,"touchleave")},_onTouchMove:function(n){this._map._loaded&&this._touchEvent(n,"touchmove")},_detectIE:function(){var t=n.navigator.userAgent,r=t.indexOf("MSIE "),u,i;return r>0?parseInt(t.substring(r+5,t.indexOf(".",r)),10):t.indexOf("Trident/")>0?(u=t.indexOf("rv:"),parseInt(t.substring(u+3,t.indexOf(".",u)),10)):(i=t.indexOf("Edge/"),i>0&&parseInt(t.substring(i+5,t.indexOf(".",i)),10))}});L.Map.addInitHook("addHandler","touchExtend",L.Map.TouchExtend);L.Marker.Touch=L.Marker.extend({_initInteraction:function(){return this.addInteractiveTarget?L.Marker.prototype._initInteraction.apply(this):this._initInteractionLegacy()},_initInteractionLegacy:function(){var n,t,i;if(this.options.clickable){for(n=this._icon,t=["dblclick","mousedown","mouseover","mouseout","contextmenu","touchstart","touchend","touchmove"],this._detectIE?t.concat(["MSPointerDown","MSPointerUp","MSPointerMove","MSPointerCancel"]):t.concat(["touchcancel"]),L.DomUtil.addClass(n,"leaflet-clickable"),L.DomEvent.on(n,"click",this._onMouseClick,this),L.DomEvent.on(n,"keypress",this._onKeyPress,this),i=0;i<t.length;i++)L.DomEvent.on(n,t[i],this._fireMouseEvent,this);L.Handler.MarkerDrag&&(this.dragging=new L.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_detectIE:function(){var t=n.navigator.userAgent,r=t.indexOf("MSIE "),u,i;return r>0?parseInt(t.substring(r+5,t.indexOf(".",r)),10):t.indexOf("Trident/")>0?(u=t.indexOf("rv:"),parseInt(t.substring(u+3,t.indexOf(".",u)),10)):(i=t.indexOf("Edge/"),i>0&&parseInt(t.substring(i+5,t.indexOf(".",i)),10))}});L.LatLngUtil={cloneLatLngs:function(n){for(var i=[],t=0,r=n.length;t<r;t++)Array.isArray(n[t])?i.push(L.LatLngUtil.cloneLatLngs(n[t])):i.push(this.cloneLatLng(n[t]));return i},cloneLatLng:function(n){return L.latLng(n.lat,n.lng)}},function(){var n={km:2,ha:2,m:0,mi:2,ac:2,yd:0,ft:0,nm:2};L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(n){var r,u,f=n.length,i=0,e=Math.PI/180,t;if(f>2){for(t=0;t<f;t++)r=n[t],u=n[(t+1)%f],i+=(u.lng-r.lng)*e*(2+Math.sin(r.lat*e)+Math.sin(u.lat*e));i=40680631590769*i/2}return Math.abs(i)},formattedNumber:function(n,t){var i=parseFloat(n).toFixed(t),o=L.drawLocal.format&&L.drawLocal.format.numeric,u=o&&o.delimiters,e=u&&u.thousands,f=u&&u.decimal,r;return(e||f)&&(r=i.split("."),i=e?r[0].replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+e):r[0],f=f||".",r.length>1&&(i=i+f+r[1])),i},readableArea:function(t,i,r){var f,u,r=L.Util.extend({},n,r);return i?(u=["ha","m"],type=typeof i,"string"===type?u=[i]:"boolean"!==type&&(u=i),f=t>=1e6&&-1!==u.indexOf("km")?L.GeometryUtil.formattedNumber(1e-6*t,r.km)+" km²":t>=1e4&&-1!==u.indexOf("ha")?L.GeometryUtil.formattedNumber(.0001*t,r.ha)+" ha":L.GeometryUtil.formattedNumber(t,r.m)+" m²"):(t/=.836127,f=t>=3097600?L.GeometryUtil.formattedNumber(t/3097600,r.mi)+" mi²":t>=4840?L.GeometryUtil.formattedNumber(t/4840,r.ac)+" acres":L.GeometryUtil.formattedNumber(t,r.yd)+" yd²"),f},readableDistance:function(t,i,r,u,f){var e,f=L.Util.extend({},n,f);switch(i?"string"==typeof i?i:"metric":r?"feet":u?"nauticalMile":"yards"){case"metric":e=t>1e3?L.GeometryUtil.formattedNumber(t/1e3,f.km)+" km":L.GeometryUtil.formattedNumber(t,f.m)+" m";break;case"feet":t*=3.28083;e=L.GeometryUtil.formattedNumber(t,f.ft)+" ft";break;case"nauticalMile":t*=.53996;e=L.GeometryUtil.formattedNumber(t/1e3,f.nm)+" nm";break;case"yards":default:t*=1.09361;e=t>1760?L.GeometryUtil.formattedNumber(t/1760,f.mi)+" miles":L.GeometryUtil.formattedNumber(t,f.yd)+" yd"}return e},isVersion07x:function(){var n=L.version.split(".");return 0===parseInt(n[0],10)&&7===parseInt(n[1],10)}})}();L.Util.extend(L.LineUtil,{segmentsIntersect:function(n,t,i,r){return this._checkCounterclockwise(n,i,r)!==this._checkCounterclockwise(t,i,r)&&this._checkCounterclockwise(n,t,i)!==this._checkCounterclockwise(n,t,r)},_checkCounterclockwise:function(n,t,i){return(i.y-n.y)*(t.x-n.x)>(t.y-n.y)*(i.x-n.x)}});L.Polyline.include({intersects:function(){var n,i,r,t=this._getProjectedPoints(),u=t?t.length:0;if(this._tooFewPointsForIntersection())return!1;for(n=u-1;n>=3;n--)if(i=t[n-1],r=t[n],this._lineSegmentsIntersectsRange(i,r,n-2))return!0;return!1},newLatLngIntersects:function(n,t){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(n),t)},newPointIntersects:function(n,t){var i=this._getProjectedPoints(),r=i?i.length:0,u=i?i[r-1]:null,f=r-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(u,n,f,t?1:0)},_tooFewPointsForIntersection:function(n){var t=this._getProjectedPoints(),i=t?t.length:0;return i+=n||0,!t||i<=3},_lineSegmentsIntersectsRange:function(n,t,i,r){var f,e,o=this._getProjectedPoints(),u;for(r=r||0,u=i;u>r;u--)if(f=o[u-1],e=o[u],L.LineUtil.segmentsIntersect(n,t,f,e))return!0;return!1},_getProjectedPoints:function(){if(!this._defaultShape)return this._originalPoints;for(var t=[],i=this._defaultShape(),n=0;n<i.length;n++)t.push(this._map.latLngToLayerPoint(i[n]));return t}});L.Polygon.include({intersects:function(){var n,i,r,u,t=this._getProjectedPoints();return!this._tooFewPointsForIntersection()&&(!!L.Polyline.prototype.intersects.call(this)||(n=t.length,i=t[0],r=t[n-1],u=n-2,this._lineSegmentsIntersectsRange(r,i,u,1)))}});L.Control.Draw=L.Control.extend({options:{position:"topleft",draw:{},edit:!1},initialize:function(n){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");L.Control.prototype.initialize.call(this,n);var t;this._toolbars={};L.DrawToolbar&&this.options.draw&&(t=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=t,this._toolbars[L.DrawToolbar.TYPE].on("enable",this._toolbarEnabled,this));L.EditToolbar&&this.options.edit&&(t=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=t,this._toolbars[L.EditToolbar.TYPE].on("enable",this._toolbarEnabled,this));L.toolbar=this},onAdd:function(n){var t,i=L.DomUtil.create("div","leaflet-draw"),r=!1;for(var u in this._toolbars)this._toolbars.hasOwnProperty(u)&&(t=this._toolbars[u].addToolbar(n))&&(r||(L.DomUtil.hasClass(t,"leaflet-draw-toolbar-top")||L.DomUtil.addClass(t.childNodes[0],"leaflet-draw-toolbar-top"),r=!0),i.appendChild(t));return i},onRemove:function(){for(var n in this._toolbars)this._toolbars.hasOwnProperty(n)&&this._toolbars[n].removeToolbar()},setDrawingOptions:function(n){for(var t in this._toolbars)this._toolbars[t]instanceof L.DrawToolbar&&this._toolbars[t].setOptions(n)},_toolbarEnabled:function(n){var i=n.target;for(var t in this._toolbars)this._toolbars[t]!==i&&this._toolbars[t].disable()}});L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1});L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))});L.Toolbar=L.Class.extend({initialize:function(n){L.setOptions(this,n);this._modes={};this._actionButtons=[];this._activeMode=null;var t=L.version.split(".");1===parseInt(t[0],10)&&parseInt(t[1],10)>=2?L.Toolbar.include(L.Evented.prototype):L.Toolbar.include(L.Mixin.Events)},enabled:function(){return null!==this._activeMode},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(n){var t,r=L.DomUtil.create("div","leaflet-draw-section"),u=0,f=this._toolbarClass||"",i=this.getModeHandlers(n);for(this._toolbarContainer=L.DomUtil.create("div","leaflet-draw-toolbar leaflet-bar"),this._map=n,t=0;t<i.length;t++)i[t].enabled&&this._initModeHandler(i[t].handler,this._toolbarContainer,u++,f,i[t].title);if(u)return this._lastButtonIndex=--u,this._actionsContainer=L.DomUtil.create("ul","leaflet-draw-actions"),r.appendChild(this._toolbarContainer),r.appendChild(this._actionsContainer),r},removeToolbar:function(){var n,t,i;for(n in this._modes)this._modes.hasOwnProperty(n)&&(this._disposeButton(this._modes[n].button,this._modes[n].handler.enable,this._modes[n].handler),this._modes[n].handler.disable(),this._modes[n].handler.off("enabled",this._handlerActivated,this).off("disabled",this._handlerDeactivated,this));for(this._modes={},t=0,i=this._actionButtons.length;t<i;t++)this._disposeButton(this._actionButtons[t].button,this._actionButtons[t].callback,this);this._actionButtons=[];this._actionsContainer=null},_initModeHandler:function(n,t,i,r,u){var f=n.type;this._modes[f]={};this._modes[f].handler=n;this._modes[f].button=this._createButton({type:f,title:u,className:r+"-"+f,container:t,callback:this._modes[f].handler.enable,context:this._modes[f].handler});this._modes[f].buttonIndex=i;this._modes[f].handler.on("enabled",this._handlerActivated,this).on("disabled",this._handlerDeactivated,this)},_detectIOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!n.MSStream},_createButton:function(n){var t=L.DomUtil.create("a",n.className||"",n.container),i=L.DomUtil.create("span","sr-only",n.container),r;return t.href="#",t.appendChild(i),n.title&&(t.title=n.title,i.innerHTML=n.title),n.text&&(t.innerHTML=n.text,i.innerHTML=n.text),r=this._detectIOS()?"touchstart":"click",L.DomEvent.on(t,"click",L.DomEvent.stopPropagation).on(t,"mousedown",L.DomEvent.stopPropagation).on(t,"dblclick",L.DomEvent.stopPropagation).on(t,"touchstart",L.DomEvent.stopPropagation).on(t,"click",L.DomEvent.preventDefault).on(t,r,n.callback,n.context),t},_disposeButton:function(n,t){var i=this._detectIOS()?"touchstart":"click";L.DomEvent.off(n,"click",L.DomEvent.stopPropagation).off(n,"mousedown",L.DomEvent.stopPropagation).off(n,"dblclick",L.DomEvent.stopPropagation).off(n,"touchstart",L.DomEvent.stopPropagation).off(n,"click",L.DomEvent.preventDefault).off(n,i,t)},_handlerActivated:function(n){this.disable();this._activeMode=this._modes[n.handler];L.DomUtil.addClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled");this._showActionsToolbar();this.fire("enable")},_handlerDeactivated:function(){this._hideActionsToolbar();L.DomUtil.removeClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled");this._activeMode=null;this.fire("disable")},_createActions:function(n){for(var f,e,r=this._actionsContainer,i=this.getActions(n),o=i.length,t,u=0,s=this._actionButtons.length;u<s;u++)this._disposeButton(this._actionButtons[u].button,this._actionButtons[u].callback);for(this._actionButtons=[];r.firstChild;)r.removeChild(r.firstChild);for(t=0;t<o;t++)"enabled"in i[t]&&!i[t].enabled||(f=L.DomUtil.create("li","",r),e=this._createButton({title:i[t].title,text:i[t].text,container:f,callback:i[t].callback,context:i[t].context}),this._actionButtons.push({button:e,callback:i[t].callback}))},_showActionsToolbar:function(){var n=this._activeMode.buttonIndex,t=this._lastButtonIndex,i=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler);this._actionsContainer.style.top=i+"px";0===n&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-top"));n===t&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-bottom"));this._actionsContainer.style.display="block";this._map.fire(L.Draw.Event.TOOLBAROPENED)},_hideActionsToolbar:function(){this._actionsContainer.style.display="none";L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-notop");L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom");L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-top");L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-bottom");this._map.fire(L.Draw.Event.TOOLBARCLOSED)}});L.Draw=L.Draw||{};L.Draw.Tooltip=L.Class.extend({initialize:function(n){this._map=n;this._popupPane=n._panes.popupPane;this._visible=!1;this._container=n.options.drawControlTooltips?L.DomUtil.create("div","leaflet-draw-tooltip",this._popupPane):null;this._singleLineLabel=!1;this._map.on("mouseout",this._onMouseOut,this)},dispose:function(){this._map.off("mouseout",this._onMouseOut,this);this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(n){return this._container?(n.subtext=n.subtext||"",0!==n.subtext.length||this._singleLineLabel?n.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!0),this._container.innerHTML=(n.subtext.length>0?'<span class="leaflet-draw-tooltip-subtext">'+n.subtext+"<\/span><br />":"")+"<span>"+n.text+"<\/span>",n.text||n.subtext?(this._visible=!0,this._container.style.visibility="inherit"):(this._visible=!1,this._container.style.visibility="hidden"),this):this},updatePosition:function(n){var i=this._map.latLngToLayerPoint(n),t=this._container;return this._container&&(this._visible&&(t.style.visibility="inherit"),L.DomUtil.setPosition(t,i)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,"leaflet-error-draw-tooltip"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,"leaflet-error-draw-tooltip"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility="hidden")}});L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:"draw"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{},circlemarker:{}},initialize:function(n){for(var t in this.options)this.options.hasOwnProperty(t)&&n[t]&&(n[t]=L.extend({},this.options[t],n[t]));this._toolbarClass="leaflet-draw-draw";L.Toolbar.prototype.initialize.call(this,n)},getModeHandlers:function(n){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(n,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(n,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(n,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(n,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(n,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker},{enabled:this.options.circlemarker,handler:new L.Draw.CircleMarker(n,this.options.circlemarker),title:L.drawLocal.draw.toolbar.buttons.circlemarker}]},getActions:function(n){return[{enabled:n.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:n.completeShape,context:n},{enabled:n.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:n.deleteLastVertex,context:n},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(n){L.setOptions(this,n);for(var t in this._modes)this._modes.hasOwnProperty(t)&&n.hasOwnProperty(t)&&this._modes[t].handler.setOptions(n[t])}});L.EditToolbar=L.Toolbar.extend({statics:{TYPE:"edit"},options:{edit:{selectedPathOptions:{dashArray:"10, 10",fill:!0,fillColor:"#fe57a1",fillOpacity:.1,maintainColor:!1}},remove:{},poly:null,featureGroup:null},initialize:function(n){n.edit&&(void 0===n.edit.selectedPathOptions&&(n.edit.selectedPathOptions=this.options.edit.selectedPathOptions),n.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,n.edit.selectedPathOptions));n.remove&&(n.remove=L.extend({},this.options.remove,n.remove));n.poly&&(n.poly=L.extend({},this.options.poly,n.poly));this._toolbarClass="leaflet-draw-edit";L.Toolbar.prototype.initialize.call(this,n);this._selectedFeatureCount=0},getModeHandlers:function(n){var t=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(n,{featureGroup:t,selectedPathOptions:this.options.edit.selectedPathOptions,poly:this.options.poly}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(n,{featureGroup:t}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(n){var t=[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}];return n.removeAllLayers&&t.push({title:L.drawLocal.edit.toolbar.actions.clearAll.title,text:L.drawLocal.edit.toolbar.actions.clearAll.text,callback:this._clearAllLayers,context:this}),t},addToolbar:function(n){var t=L.Toolbar.prototype.addToolbar.call(this,n);return this._checkDisabled(),this.options.featureGroup.on("layeradd layerremove",this._checkDisabled,this),t},removeToolbar:function(){this.options.featureGroup.off("layeradd layerremove",this._checkDisabled,this);L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save();this._activeMode&&this._activeMode.handler.disable()},_clearAllLayers:function(){this._activeMode.handler.removeAllLayers();this._activeMode&&this._activeMode.handler.disable()},_checkDisabled:function(){var n,i=this.options.featureGroup,t=0!==i.getLayers().length;this.options.edit&&(n=this._modes[L.EditToolbar.Edit.TYPE].button,t?L.DomUtil.removeClass(n,"leaflet-disabled"):L.DomUtil.addClass(n,"leaflet-disabled"),n.setAttribute("title",t?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled));this.options.remove&&(n=this._modes[L.EditToolbar.Delete.TYPE].button,t?L.DomUtil.removeClass(n,"leaflet-disabled"):L.DomUtil.addClass(n,"leaflet-disabled"),n.setAttribute("title",t?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}});L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:"edit"},initialize:function(n,t){if(L.Handler.prototype.initialize.call(this,n),L.setOptions(this,t),this._featureGroup=t.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this._uneditedLayerProps={};this.type=L.EditToolbar.Edit.TYPE;var i=L.version.split(".");1===parseInt(i[0],10)&&parseInt(i[1],10)>=2?L.EditToolbar.Edit.include(L.Evented.prototype):L.EditToolbar.Edit.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.EDITSTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on("layeradd",this._enableLayerEdit,this).on("layerremove",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off("layeradd",this._enableLayerEdit,this).off("layerremove",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.EDITSTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(n.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),n._editTooltip=this._tooltip,this._updateTooltip(),this._map.on("mousemove",this._onMouseMove,this).on("touchmove",this._onMouseMove,this).on("MSPointerMove",this._onMouseMove,this).on(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this).off("touchmove",this._onMouseMove,this).off("MSPointerMove",this._onMouseMove,this).off(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},revertLayers:function(){this._featureGroup.eachLayer(function(n){this._revertLayer(n)},this)},save:function(){var n=new L.LayerGroup;this._featureGroup.eachLayer(function(t){t.edited&&(n.addLayer(t),t.edited=!1)});this._map.fire(L.Draw.Event.EDITED,{layers:n})},_backupLayer:function(n){var t=L.Util.stamp(n);this._uneditedLayerProps[t]||(n instanceof L.Polyline||n instanceof L.Polygon||n instanceof L.Rectangle?this._uneditedLayerProps[t]={latlngs:L.LatLngUtil.cloneLatLngs(n.getLatLngs())}:n instanceof L.Circle?this._uneditedLayerProps[t]={latlng:L.LatLngUtil.cloneLatLng(n.getLatLng()),radius:n.getRadius()}:(n instanceof L.Marker||n instanceof L.CircleMarker)&&(this._uneditedLayerProps[t]={latlng:L.LatLngUtil.cloneLatLng(n.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(n){var t=L.Util.stamp(n);n.edited=!1;this._uneditedLayerProps.hasOwnProperty(t)&&(n instanceof L.Polyline||n instanceof L.Polygon||n instanceof L.Rectangle?n.setLatLngs(this._uneditedLayerProps[t].latlngs):n instanceof L.Circle?(n.setLatLng(this._uneditedLayerProps[t].latlng),n.setRadius(this._uneditedLayerProps[t].radius)):(n instanceof L.Marker||n instanceof L.CircleMarker)&&n.setLatLng(this._uneditedLayerProps[t].latlng),n.fire("revert-edited",{layer:n}))},_enableLayerEdit:function(n){var i,r,t=n.layer||n.target||n;this._backupLayer(t);this.options.poly&&(r=L.Util.extend({},this.options.poly),t.options.poly=r);this.options.selectedPathOptions&&(i=L.Util.extend({},this.options.selectedPathOptions),i.maintainColor&&(i.color=t.options.color,i.fillColor=t.options.fillColor),t.options.original=L.extend({},t.options),t.options.editing=i);t instanceof L.Marker?(t.editing&&t.editing.enable(),t.dragging.enable(),t.on("dragend",this._onMarkerDragEnd).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onMarkerDragEnd,this).on("MSPointerUp",this._onMarkerDragEnd,this)):t.editing.enable()},_disableLayerEdit:function(n){var t=n.layer||n.target||n;t.edited=!1;t.editing&&t.editing.disable();delete t.options.editing;delete t.options.original;this._selectedPathOptions&&(t instanceof L.Marker?this._toggleMarkerHighlight(t):(t.setStyle(t.options.previousOptions),delete t.options.previousOptions));t instanceof L.Marker?(t.dragging.disable(),t.off("dragend",this._onMarkerDragEnd,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onMarkerDragEnd,this).off("MSPointerUp",this._onMarkerDragEnd,this)):t.editing.disable()},_onMouseMove:function(n){this._tooltip.updatePosition(n.latlng)},_onMarkerDragEnd:function(n){var t=n.target;t.edited=!0;this._map.fire(L.Draw.Event.EDITMOVE,{layer:t})},_onTouchMove:function(n){var t=n.originalEvent.changedTouches[0],i=this._map.mouseEventToLayerPoint(t),r=this._map.layerPointToLatLng(i);n.target.setLatLng(r)},_hasAvailableLayers:function(){return 0!==this._featureGroup.getLayers().length}});L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:"remove"},initialize:function(n,t){if(L.Handler.prototype.initialize.call(this,n),L.Util.setOptions(this,t),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this.type=L.EditToolbar.Delete.TYPE;var i=L.version.split(".");1===parseInt(i[0],10)&&parseInt(i[1],10)>=2?L.EditToolbar.Delete.include(L.Evented.prototype):L.EditToolbar.Delete.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on("layeradd",this._enableLayerDelete,this).on("layerremove",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off("layeradd",this._enableLayerDelete,this).off("layerremove",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(n.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(n){this._deletableLayers.addLayer(n);n.fire("revert-deleted",{layer:n})},this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer(function(n){this._removeLayer({layer:n})},this);this.save()},_enableLayerDelete:function(n){(n.layer||n.target||n).on("click",this._removeLayer,this)},_disableLayerDelete:function(n){var t=n.layer||n.target||n;t.off("click",this._removeLayer,this);this._deletedLayers.removeLayer(t)},_removeLayer:function(n){var t=n.layer||n.target||n;this._deletableLayers.removeLayer(t);this._deletedLayers.addLayer(t);t.fire("deleted")},_onMouseMove:function(n){this._tooltip.updatePosition(n.latlng)},_hasAvailableLayers:function(){return 0!==this._deletableLayers.getLayers().length}})}(window,document),function(n,t,i){function r(u,e){var s,h,o;if(!t[u]){if(!n[u]){if(s=typeof require=="function"&&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=typeof require=="function"&&require,u=0;u<i.length;u++)r(i[u]);return r}({1:[function(n,t){(function(i){var r=typeof window!="undefined"?window.L:typeof i!="undefined"?i.L:null,u=n("./geocoders/nominatim")["class"];t.exports={"class":r.Control.extend({options:{showResultIcons:!1,collapsed:!0,expand:"click",position:"topright",placeholder:"Search...",errorMessage:"Nothing found.",suggestMinLength:3,suggestTimeout:250,defaultMarkGeocode:!0},includes:r.Mixin.Events,initialize:function(n){r.Util.setOptions(this,n);this.options.geocoder||(this.options.geocoder=new u);this._requestCount=0},onAdd:function(n){var i="leaflet-control-geocoder",t=r.DomUtil.create("div",i+" leaflet-bar"),u=r.DomUtil.create("button",i+"-icon",t),e=this._form=r.DomUtil.create("div",i+"-form",t),f;if(this._map=n,this._container=t,u.innerHTML="&nbsp;",u.type="button",f=this._input=r.DomUtil.create("input","",e),f.type="text",f.placeholder=this.options.placeholder,this._errorElement=r.DomUtil.create("div",i+"-form-no-error",t),this._errorElement.innerHTML=this.options.errorMessage,this._alts=r.DomUtil.create("ul",i+"-alternatives leaflet-control-geocoder-alternatives-minimized",t),r.DomEvent.addListener(f,"keydown",this._keydown,this),r.DomEvent.addListener(f,"blur",function(){this.options.collapsed&&this._collapse()},this),this.options.expand==="click")r.DomEvent.addListener(u,"click",function(n){n.button===0&&n.detail!==2&&this._toggle()},this);else{r.DomEvent.addListener(u,"mouseover",this._expand,this);r.DomEvent.addListener(u,"mouseout",this._collapse,this);this._map.on("movestart",this._collapse,this)}if(this.options.collapsed||this._expand(),this.options.defaultMarkGeocode)this.on("markgeocode",this.markGeocode,this);this.on("startgeocode",function(){r.DomUtil.addClass(this._container,"leaflet-control-geocoder-throbber")},this);this.on("finishgeocode",function(){r.DomUtil.removeClass(this._container,"leaflet-control-geocoder-throbber")},this);return r.DomEvent.disableClickPropagation(t),t},_geocodeResult:function(n,t){if(t||n.length!==1)if(n.length>0){this._alts.innerHTML="";this._results=n;r.DomUtil.removeClass(this._alts,"leaflet-control-geocoder-alternatives-minimized");for(var i=0;i<n.length;i++)this._alts.appendChild(this._createAlt(n[i],i))}else r.DomUtil.addClass(this._errorElement,"leaflet-control-geocoder-error");else this._geocodeResultSelected(n[0])},markGeocode:function(n){return n=n.geocode||n,this._map.fitBounds(n.bbox),this._geocodeMarker&&this._map.removeLayer(this._geocodeMarker),this._geocodeMarker=new r.Marker(n.center).bindPopup(n.html||n.name).addTo(this._map).openPopup(),this},_geocode:function(n){var i=++this._requestCount,t=n?"suggest":"geocode";this._lastGeocode=this._input.value;n||this._clearResults();this.fire("start"+t);this.options.geocoder[t](this._input.value,function(r){i===this._requestCount&&(this.fire("finish"+t),this._geocodeResult(r,n))},this)},_geocodeSuggestion:function(n){var i=++this._requestCount,t="geocode";this._lastGeocode=this._input.value;this._clearResults();this.fire("start"+t);this.options.geocoder.geocodeSuggestion(n,function(n){i===this._requestCount&&(this.fire("finish"+t),this._geocodeResult(n,!1))},this)},_geocodeResultSelected:function(n){this.options.collapsed?this._collapse():this._clearResults();this.fire("markgeocode",{geocode:n})},_toggle:function(){this._container.className.indexOf("leaflet-control-geocoder-expanded")>=0?this._collapse():this._expand()},_expand:function(){r.DomUtil.addClass(this._container,"leaflet-control-geocoder-expanded");this._input.select();this.fire("expand")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-geocoder-expanded","");r.DomUtil.addClass(this._alts,"leaflet-control-geocoder-alternatives-minimized");r.DomUtil.removeClass(this._errorElement,"leaflet-control-geocoder-error");this.fire("collapse")},_clearResults:function(){r.DomUtil.addClass(this._alts,"leaflet-control-geocoder-alternatives-minimized");this._selection=null;r.DomUtil.removeClass(this._errorElement,"leaflet-control-geocoder-error")},_processResult:function(n){n.suggested?(this._input.value=n.name,this._geocodeSuggestion(n.locationId)):this._geocodeResultSelected(n)},_createAlt:function(n,t){var i=r.DomUtil.create("li",""),u=r.DomUtil.create("a","",i),f=this.options.showResultIcons&&n.icon?r.DomUtil.create("img","",u):null,e=n.html?undefined:document.createTextNode(n.name),o=function(t){r.DomEvent.preventDefault(t);this._processResult(n)};return f&&(f.src=n.icon),i.setAttribute("data-result-index",t),n.html?u.innerHTML=u.innerHTML+n.html:u.appendChild(e),r.DomEvent.addListener(i,"mousedown",o,this),i},_keydown:function(n){var t=this,u=function(n){t._selection&&(r.DomUtil.removeClass(t._selection,"leaflet-control-geocoder-selected"),t._selection=t._selection[n>0?"nextSibling":"previousSibling"]);t._selection||(t._selection=t._alts[n>0?"firstChild":"lastChild"]);t._selection&&r.DomUtil.addClass(t._selection,"leaflet-control-geocoder-selected")},f,i;switch(n.keyCode){case 27:this.options.collapsed&&this._collapse();break;case 38:u(-1);r.DomEvent.preventDefault(n);break;case 40:u(1);r.DomEvent.preventDefault(n);break;case 13:this._selection?(f=parseInt(this._selection.getAttribute("data-result-index"),10),this._processResult(this._results[f])):this._geocode();r.DomEvent.preventDefault(n);break;default:i=this._input.value;this.options.geocoder.suggest&&i!==this._lastGeocode&&(clearTimeout(this._suggestTimeout),i.length>=this.options.suggestMinLength?this._suggestTimeout=setTimeout(r.bind(function(){this._geocode(!0)},this),this.options.suggestTimeout):this._clearResults())}}}),factory:function(n){return new r.Control.Geocoder(n)}}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./geocoders/nominatim":9}],2:[function(n,t){(function(i){var r=typeof window!="undefined"?window.L:typeof i!="undefined"?i.L:null,u=n("../util");t.exports={"class":r.Class.extend({options:{service_url:"http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"},initialize:function(n,t){r.setOptions(this,t);this._accessToken=n},geocode:function(n,t,i){var f={SingleLine:n,outFields:"Addr_Type",forStorage:!1,maxLocations:10,f:"json"};this._key&&this._key.length&&(f.token=this._key);u.getJSON(this.options.service_url+"/findAddressCandidates",f,function(n){var e=[],u,o,s,f;if(n.candidates&&n.candidates.length)for(f=0;f<=n.candidates.length-1;f++)u=n.candidates[f],o=r.latLng(u.location.y,u.location.x),s=r.latLngBounds(r.latLng(u.extent.ymax,u.extent.xmax),r.latLng(u.extent.ymin,u.extent.xmin)),e[f]={name:u.address,bbox:s,center:o};t.call(i,e)})},suggest:function(n,t,i){return this.geocode(n,t,i)},reverse:function(n,t,i,f){var e={location:encodeURIComponent(n.lng)+","+encodeURIComponent(n.lat),distance:100,f:"json"};u.getJSON(this.options.service_url+"/reverseGeocode",e,function(n){var u=[],t;n&&!n.error&&(t=r.latLng(n.location.y,n.location.x),u.push({name:n.address.Match_addr,center:t,bounds:r.latLngBounds(t,t)}));i.call(f,u)})}}),factory:function(n,t){return new r.Control.Geocoder.ArcGis(n,t)}}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"../util":13}],3:[function(n,t){(function(i){var r=typeof window!="undefined"?window.L:typeof i!="undefined"?i.L:null,u=n("../util");t.exports={"class":r.Class.extend({initialize:function(n){this.key=n},geocode:function(n,t,i){u.jsonp("https://dev.virtualearth.net/REST/v1/Locations",{query:n,key:this.key},function(n){var o=[],u,e,f;if(n.resourceSets.length>0)for(u=n.resourceSets[0].resources.length-1;u>=0;u--)e=n.resourceSets[0].resources[u],f=e.bbox,o[u]={name:e.name,bbox:r.latLngBounds([f[0],f[1]],[f[2],f[3]]),center:r.latLng(e.point.coordinates)};t.call(i,o)},this,"jsonp")},reverse:function(n,t,i,f){u.jsonp("//dev.virtualearth.net/REST/v1/Locations/"+n.lat+","+n.lng,{key:this.key},function(n){for(var u,t,o=[],e=n.resourceSets[0].resources.length-1;e>=0;e--)u=n.resourceSets[0].resources[e],t=u.bbox,o[e]={name:u.name,bbox:r.latLngBounds([t[0],t[1]],[t[2],t[3]]),center:r.latLng(u.point.coordinates)};i.call(f,o)},this,"jsonp")}}),factory:function(n){return new r.Control.Geocoder.Bing(n)}}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"../util":13}],4:[function(n,t){(function(i){var r=typeof window!="undefined"?window.L:typeof i!="undefined"?i.L:null,u=n("../util");t.exports={"class":r.Class.extend({options:{serviceUrl:"https://maps.googleapis.com/maps/api/geocode/json",geocodingQueryParams:{},reverseQueryParams:{}},initialize:function(n,t){this._key=n;r.setOptions(this,t);this.options.serviceUrl=this.options.service_url||this.options.serviceUrl},geocode:function(n,t,i){var f={address:n};this._key&&this._key.length&&(f.key=this._key);f=r.Util.extend(f,this.options.geocodingQueryParams);u.getJSON(this.options.serviceUrl,f,function(n){var e=[],u,o,s,f;if(n.results&&n.results.length)for(f=0;f<=n.results.length-1;f++)u=n.results[f],o=r.latLng(u.geometry.location),s=r.latLngBounds(r.latLng(u.geometry.viewport.northeast),r.latLng(u.geometry.viewport.southwest)),e[f]={name:u.formatted_address,bbox:s,center:o,properties:u.address_components};t.call(i,e)})},reverse:function(n,t,i,f){var e={latlng:encodeURIComponent(n.lat)+","+encodeURIComponent(n.lng)};e=r.Util.extend(e,this.options.reverseQueryParams);this._key&&this._key.length&&(e.key=this._key);u.getJSON(this.options.serviceUrl,e,function(n){var e=[],t,o,s,u;if(n.results&&n.results.length)for(u=0;u<=n.results.length-1;u++)t=n.results[u],o=r.latLng(t.geometry.location),s=r.latLngBounds(r.latLng(t.geometry.viewport.northeast),r.latLng(t.geometry.viewport.southwest)),e[u]={name:t.formatted_address,bbox:s,center:o,properties:t.address_components};i.call(f,e)})}}),factory:function(n,t){return new r.Control.Geocoder.Google(n,t)}}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"../util":13}],5:[function(n,t){(function(i){var r=typeof window!="undefined"?window.L:typeof i!="undefined"?i.L:null,u=n("../util");t.exports={"class":r.Class.extend({options:{geocodeUrl:"http://geocoder.api.here.com/6.2/geocode.json",reverseGeocodeUrl:"http://reverse.geocoder.api.here.com/6.2/reversegeocode.json",suggestUrl:"https://autocomplete.geocoder.cit.api.here.com/6.2/suggest.json",app_id:"<insert your app_id here>",app_code:"<insert your app_code here>",geocodingQueryParams:{},reverseQueryParams:{},suggestQueryParams:{}},initialize:function(n){r.setOptions(this,n)},geocode:function(n,t,i){var u={searchtext:n,gen:9,app_id:this.options.app_id,app_code:this.options.app_code,jsonattributes:1};u=r.Util.extend(u,this.options.geocodingQueryParams);this.getJSON(this.options.geocodeUrl,u,t,i)},suggest:function(n,t,i){var f={query:n,gen:9,maxresults:5,beginHighlight:"<strong>",endHighlight:"<\/strong>",app_id:this.options.app_id,app_code:this.options.app_code,jsonattributes:1};f=r.Util.extend(f,this.options.suggestQueryParams);u.getJSON(this.options.suggestUrl,f,function(n){if(n&&n.suggestions){var r=$.map(n.suggestions,function(n){return{html:n.label,name:n.label.replace(/(<strong>|<\/strong>)/gm,""),locationId:n.locationId,suggested:!0}});t.call(i,r)}})},geocodeSuggestion:function(n,t,i){var u={locationId:n,gen:9,app_id:this.options.app_id,app_code:this.options.app_code,jsonattributes:1};u=r.Util.extend(u,this.options.geocodingQueryParams);this.getJSON(this.options.geocodeUrl,u,t,i)},reverse:function(n,t,i,u){var f={prox:encodeURIComponent(n.lat)+","+encodeURIComponent(n.lng),mode:"retrieveAddresses",app_id:this.options.app_id,app_code:this.options.app_code,gen:9,jsonattributes:1};f=r.Util.extend(f,this.options.reverseQueryParams);this.getJSON(this.options.reverseGeocodeUrl,f,i,u)},getJSON:function(n,t,i,f){u.getJSON(n,t,function(n){var e=[],t,o,s,u;if(n.response.view&&n.response.view.length)for(u=0;u<=n.response.view[0].result.length-1;u++)t=n.response.view[0].result[u].location,o=r.latLng(t.displayPosition.latitude,t.displayPosition.longitude),s=r.latLngBounds(r.latLng(t.mapView.topLeft.latitude,t.mapView.topLeft.longitude),r.latLng(t.mapView.bottomRight.latitude,t.mapView.bottomRight.longitude)),e[u]={name:t.address.label,bbox:s,center:o};i.call(f,e)})}}),factory:function(n){return new r.Control.Geocoder.HERE(n)}}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"../util":13}],6:[function(n,t){(function(i){var r=typeof window!="undefined"?window.L:typeof i!="undefined"?i.L:null,u=n("../util");t.exports={"class":r.Class.extend({options:{serviceUrl:"https://api.tiles.mapbox.com/v4/geocode/mapbox.places-v1/"},initialize:function(n,t){r.setOptions(this,t);this._accessToken=n},geocode:function(n,t,i){u.getJSON(this.options.serviceUrl+encodeURIComponent(n)+".json",{access_token:this._accessToken},function(n){var o=[],u,e,s,f;if(n.features&&n.features.length)for(f=0;f<=n.features.length-1;f++)u=n.features[f],e=r.latLng(u.center.reverse()),s=u.hasOwnProperty("bbox")?r.latLngBounds(r.latLng(u.bbox.slice(0,2).reverse()),r.latLng(u.bbox.slice(2,4).reverse())):r.latLngBounds(e,e),o[f]={name:u.place_name,bbox:s,center:e};t.call(i,o)})},suggest:function(n,t,i){return this.geocode(n,t,i)},reverse:function(n,t,i,f){u.getJSON(this.options.serviceUrl+encodeURIComponent(n.lng)+","+encodeURIComponent(n.lat)+".json",{access_token:this._accessToken},function(n){var o=[],t,e,s,u;if(n.features&&n.features.length)for(u=0;u<=n.features.length-1;u++)t=n.features[u],e=r.latLng(t.center.reverse()),s=t.hasOwnProperty("bbox")?r.latLngBounds(r.latLng(t.bbox.slice(0,2).reverse()),r.latLng(t.bbox.slice(2,4).reverse())):r.latLngBounds(e,e),o[u]={name:t.place_name,bbox:s,center:e};i.call(f,o)})}}),factory:function(n,t){return new r.Control.Geocoder.Mapbox(n,t)}}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"../util":13}],7:[function(n,t){(function(i){var r=typeof window!="undefined"?window.L:typeof i!="undefined"?i.L:null,u=n("../util");t.exports={"class":r.Class.extend({options:{serviceUrl:"https://www.mapquestapi.com/geocoding/v1"},initialize:function(n,t){this._key=decodeURIComponent(n);r.Util.setOptions(this,t)},_formatName:function(){for(var t=[],n=0;n<arguments.length;n++)arguments[n]&&t.push(arguments[n]);return t.join(", ")},geocode:function(n,t,i){u.jsonp(this.options.serviceUrl+"/address",{key:this._key,location:n,limit:5,outFormat:"json"},function(n){var o=[],u,e,f;if(n.results&&n.results[0].locations)for(f=n.results[0].locations.length-1;f>=0;f--)u=n.results[0].locations[f],e=r.latLng(u.latLng),o[f]={name:this._formatName(u.street,u.adminArea4,u.adminArea3,u.adminArea1),bbox:r.latLngBounds(e,e),center:e};t.call(i,o)},this)},reverse:function(n,t,i,f){u.jsonp(this.options.serviceUrl+"/reverse",{key:this._key,location:n.lat+","+n.lng,outputFormat:"json"},function(n){var o=[],t,e,u;if(n.results&&n.results[0].locations)for(u=n.results[0].locations.length-1;u>=0;u--)t=n.results[0].locations[u],e=r.latLng(t.latLng),o[u]={name:this._formatName(t.street,t.adminArea4,t.adminArea3,t.adminArea1),bbox:r.latLngBounds(e,e),center:e};i.call(f,o)},this)}}),factory:function(n,t){return new r.Control.Geocoder.MapQuest(n,t)}}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"../util":13}],8:[function(n,t){(function(i){var r=typeof window!="undefined"?window.L:typeof i!="undefined"?i.L:null,u=n("../util");t.exports={"class":r.Class.extend({options:{serviceUrl:"https://search.mapzen.com/v1",geocodingQueryParams:{},reverseQueryParams:{}},initialize:function(n,t){r.Util.setOptions(this,t);this._apiKey=n;this._lastSuggest=0},geocode:function(n,t,i){var f=this;u.getJSON(this.options.serviceUrl+"/search",r.extend({api_key:this._apiKey,text:n},this.options.geocodingQueryParams),function(n){t.call(i,f._parseResults(n,"bbox"))})},suggest:function(n,t,i){var f=this;u.getJSON(this.options.serviceUrl+"/autocomplete",r.extend({api_key:this._apiKey,text:n},this.options.geocodingQueryParams),r.bind(function(n){n.geocoding.timestamp>this._lastSuggest&&(this._lastSuggest=n.geocoding.timestamp,t.call(i,f._parseResults(n,"bbox")))},this))},reverse:function(n,t,i,f){var e=this;u.getJSON(this.options.serviceUrl+"/reverse",r.extend({api_key:this._apiKey,"point.lat":n.lat,"point.lon":n.lng},this.options.reverseQueryParams),function(n){i.call(f,e._parseResults(n,"bounds"))})},_parseResults:function(n,t){var i=[];return r.geoJson(n,{pointToLayer:function(n,t){return r.circleMarker(t)},onEachFeature:function(n,u){var f={},o,e;u.getBounds?(o=u.getBounds(),e=o.getCenter()):(e=u.getLatLng(),o=r.latLngBounds(e,e));f.name=u.feature.properties.label;f.center=e;f[t]=o;f.properties=u.feature.properties;i.push(f)}}),i}}),factory:function(n,t){return new r.Control.Geocoder.Mapzen(n,t)}}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"../util":13}],9:[function(n,t){(function(i){var r=typeof window!="undefined"?window.L:typeof i!="undefined"?i.L:null,u=n("../util");t.exports={"class":r.Class.extend({options:{serviceUrl:"https://nominatim.openstreetmap.org/",geocodingQueryParams:{},reverseQueryParams:{},htmlTemplate:function(n){var t=n.address,i=[];return(t.road||t.building)&&i.push("{building} {road} {house_number}"),(t.city||t.town||t.village||t.hamlet)&&i.push('<span class="'+(i.length>0?"leaflet-control-geocoder-address-detail":"")+'">{postcode} {city} {town} {village} {hamlet}<\/span>'),(t.state||t.country)&&i.push('<span class="'+(i.length>0?"leaflet-control-geocoder-address-context":"")+'">{state} {country}<\/span>'),u.template(i.join("<br/>"),t,!0)}},initialize:function(n){r.Util.setOptions(this,n)},geocode:function(n,t,i){u.jsonp(this.options.serviceUrl+"search",r.extend({q:n,limit:5,format:"json",addressdetails:1},this.options.geocodingQueryParams),function(n){for(var f,e,o=[],u=n.length-1;u>=0;u--){for(f=n[u].boundingbox,e=0;e<4;e++)f[e]=parseFloat(f[e]);o[u]={icon:n[u].icon,name:n[u].display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(n[u]):undefined,bbox:r.latLngBounds([f[0],f[2]],[f[1],f[3]]),center:r.latLng(n[u].lat,n[u].lon),properties:n[u]}}t.call(i,o)},this,"json_callback")},reverse:function(n,t,i,f){u.jsonp(this.options.serviceUrl+"reverse",r.extend({lat:n.lat,lon:n.lng,zoom:Math.round(Math.log(t/256)/Math.log(2)),addressdetails:1,format:"json"},this.options.reverseQueryParams),function(n){var u=[],t;n&&n.lat&&n.lon&&(t=r.latLng(n.lat,n.lon),u.push({name:n.display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(n):undefined,center:t,bounds:r.latLngBounds(t,t),properties:n}));i.call(f,u)},this,"json_callback")}}),factory:function(n){return new r.Control.Geocoder.Nominatim(n)}}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"../util":13}],10:[function(n,t){(function(i){var r=typeof window!="undefined"?window.L:typeof i!="undefined"?i.L:null,u=n("../util");t.exports={"class":r.Class.extend({options:{serviceUrl:"https://photon.komoot.de/api/",reverseUrl:"https://photon.komoot.de/reverse/",nameProperties:["name","street","suburb","hamlet","town","city","state","country"]},initialize:function(n){r.setOptions(this,n)},geocode:function(n,t,i){var f=r.extend({q:n},this.options.geocodingQueryParams);u.getJSON(this.options.serviceUrl,f,r.bind(function(n){t.call(i,this._decodeFeatures(n))},this))},suggest:function(n,t,i){return this.geocode(n,t,i)},reverse:function(n,t,i,f){var e=r.extend({lat:n.lat,lon:n.lng},this.options.geocodingQueryParams);u.getJSON(this.options.reverseUrl,e,r.bind(function(n){i.call(f,this._decodeFeatures(n))},this))},_decodeFeatures:function(n){var o=[],u,i,e,f,t,s;if(n&&n.features)for(u=0;u<n.features.length;u++)i=n.features[u],e=i.geometry.coordinates,f=r.latLng(e[1],e[0]),t=i.properties.extent,s=t?r.latLngBounds([t[1],t[0]],[t[3],t[2]]):r.latLngBounds(f,f),o.push({name:this._deocodeFeatureName(i),center:f,bbox:s,properties:i.properties});return o},_deocodeFeatureName:function(n){for(var t,i=0;!t&&i<this.options.nameProperties.length;i++)t=n.properties[this.options.nameProperties[i]];return t}}),factory:function(n){return new r.Control.Geocoder.Photon(n)}}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"../util":13}],11:[function(n,t){(function(i){var r=typeof window!="undefined"?window.L:typeof i!="undefined"?i.L:null,u=n("../util");t.exports={"class":r.Class.extend({options:{serviceUrl:"https://api.what3words.com/v2/"},initialize:function(n){this._accessToken=n},geocode:function(n,t,i){u.getJSON(this.options.serviceUrl+"forward",{key:this._accessToken,addr:n.split(/\s+/).join(".")},function(n){var f=[],u,e;n.hasOwnProperty("geometry")&&(u=r.latLng(n.geometry.lat,n.geometry.lng),e=r.latLngBounds(u,u),f[0]={name:n.words,bbox:e,center:u});t.call(i,f)})},suggest:function(n,t,i){return this.geocode(n,t,i)},reverse:function(n,t,i,f){u.getJSON(this.options.serviceUrl+"reverse",{key:this._accessToken,coords:[n.lat,n.lng].join(",")},function(n){var u=[],t,e;n.status.status==200&&(t=r.latLng(n.geometry.lat,n.geometry.lng),e=r.latLngBounds(t,t),u[0]={name:n.words,bbox:e,center:t});i.call(f,u)})}}),factory:function(n){return new r.Control.Geocoder.What3Words(n)}}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"../util":13}],12:[function(n,t){(function(i){var r=typeof window!="undefined"?window.L:typeof i!="undefined"?i.L:null,u=n("./control"),f=n("./geocoders/nominatim"),e=n("./geocoders/bing"),o=n("./geocoders/mapquest"),s=n("./geocoders/mapbox"),h=n("./geocoders/what3words"),c=n("./geocoders/google"),l=n("./geocoders/photon"),a=n("./geocoders/mapzen"),v=n("./geocoders/arcgis"),y=n("./geocoders/here");t.exports=r.Util.extend(u["class"],{Nominatim:f["class"],nominatim:f.factory,Bing:e["class"],bing:e.factory,MapQuest:o["class"],mapQuest:o.factory,Mapbox:s["class"],mapbox:s.factory,What3Words:h["class"],what3words:h.factory,Google:c["class"],google:c.factory,Photon:l["class"],photon:l.factory,Mapzen:a["class"],mapzen:a.factory,ArcGis:v["class"],arcgis:v.factory,HERE:y["class"],here:y.factory});r.Util.extend(r.Control,{Geocoder:t.exports,geocoder:u.factory})}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./control":1,"./geocoders/arcgis":2,"./geocoders/bing":3,"./geocoders/google":4,"./geocoders/here":5,"./geocoders/mapbox":6,"./geocoders/mapquest":7,"./geocoders/mapzen":8,"./geocoders/nominatim":9,"./geocoders/photon":10,"./geocoders/what3words":11}],13:[function(n,t){(function(n){var i=typeof window!="undefined"?window.L:typeof n!="undefined"?n.L:null,u=0,r=function(){function n(n){return r[n]}var t=/[&<>"'`]/g,i=/[&<>"'`]/,r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return function(r){return r==null?"":r?(r=""+r,!i.test(r))?r:r.replace(t,n):r+""}}();t.exports={jsonp:function(n,t,r,f,e){var s="_l_geocoder_"+u++,o;t[e||"callback"]=s;window[s]=i.Util.bind(r,f);o=document.createElement("script");o.type="text/javascript";o.src=n+i.Util.getParamString(t);o.id=s;document.getElementsByTagName("head")[0].appendChild(o)},getJSON:function(n,t,r){var u=new XMLHttpRequest;u.onreadystatechange=function(){if(u.readyState===4){if(u.status!==200&&u.status!==304){r("");return}r(JSON.parse(u.response))}};u.open("GET",n+i.Util.getParamString(t),!0);u.setRequestHeader("Accept","application/json");u.send(null)},template:function(n,t){return n.replace(/\{ *([\w_]+) *\}/g,function(n,i){var u=t[i];return u===undefined?u="":typeof u=="function"&&(u=u(t)),r(u)})},htmlEscape:r}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}]},{},[12]),function(){function n(n,i){this.title=n.title;this.stateName=n.stateName?n.stateName:"unnamed-state";this.icon=L.DomUtil.create("span","");L.DomUtil.addClass(this.icon,"button-state state-"+this.stateName.trim());this.icon.innerHTML=t(n.icon);this.onClick=L.Util.bind(n.onClick?n.onClick:function(){},i)}function t(n){var t;return n.match(/[&;=<>"']/)?t=n:(n=n.trim(),t=L.DomUtil.create("span",""),n.indexOf("fa-")===0?L.DomUtil.addClass(t,"fa "+n):n.indexOf("glyphicon-")===0?L.DomUtil.addClass(t,"glyphicon "+n):L.DomUtil.addClass(t,n),t=t.outerHTML),t}L.Control.EasyBar=L.Control.extend({options:{position:"topleft",id:null,leafletClasses:!0},initialize:function(n,t){t&&L.Util.setOptions(this,t);this._buildContainer();this._buttons=[];for(var i=0;i<n.length;i++)n[i]._bar=this,n[i]._container=n[i].button,this._buttons.push(n[i]),this.container.appendChild(n[i].button)},_buildContainer:function(){this._container=this.container=L.DomUtil.create("div","");this.options.leafletClasses&&L.DomUtil.addClass(this.container,"leaflet-bar easy-button-container leaflet-control");this.options.id&&(this.container.id=this.options.id)},enable:function(){return L.DomUtil.addClass(this.container,"enabled"),L.DomUtil.removeClass(this.container,"disabled"),this.container.setAttribute("aria-hidden","false"),this},disable:function(){return L.DomUtil.addClass(this.container,"disabled"),L.DomUtil.removeClass(this.container,"enabled"),this.container.setAttribute("aria-hidden","true"),this},onAdd:function(){return this.container},addTo:function(n){var t;for(this._map=n,t=0;t<this._buttons.length;t++)this._buttons[t]._map=n;var i=this._container=this.onAdd(n),u=this.getPosition(),r=n._controlCorners[u];return L.DomUtil.addClass(i,"leaflet-control"),u.indexOf("bottom")!==-1?r.insertBefore(i,r.firstChild):r.appendChild(i),this}});L.easyBar=function(){for(var t=[L.Control.EasyBar],n=0;n<arguments.length;n++)t.push(arguments[n]);return new(Function.prototype.bind.apply(L.Control.EasyBar,t))};L.Control.EasyButton=L.Control.extend({options:{position:"topleft",id:null,type:"replace",states:[],leafletClasses:!0},initialize:function(t,i,r){this.options.states=[];this.storage={};typeof arguments[arguments.length-1]=="object"&&L.Util.setOptions(this,arguments[arguments.length-1]);this.options.states.length===0&&typeof t=="string"&&typeof i=="function"&&this.options.states.push({icon:t,onClick:i,title:typeof r=="string"?r:""});this._states=[];for(var u=0;u<this.options.states.length;u++)this._states.push(new n(this.options.states[u],this));this._buildButton();this._activateState(this._states[0])},_buildButton:function(){if(this.button=L.DomUtil.create("button",""),this.options.id&&(this.button.id=this.options.id),this.options.leafletClasses&&L.DomUtil.addClass(this.button,"easy-button-button leaflet-bar-part"),L.DomEvent.addListener(this.button,"dblclick",L.DomEvent.stop),L.DomEvent.addListener(this.button,"click",function(n){L.DomEvent.stop(n);this._currentState.onClick(this,this._map?this._map:null);this._map.getContainer().focus()},this),this.options.type=="replace")this.button.appendChild(this._currentState.icon);else for(var n=0;n<this._states.length;n++)this.button.appendChild(this._states[n].icon)},_currentState:{stateName:"unnamed",icon:function(){return document.createElement("span")}()},_states:null,state:function(n){return typeof n=="string"?this._activateStateNamed(n):typeof n=="number"&&this._activateState(this._states[n]),this},_activateStateNamed:function(n){for(var t=0;t<this._states.length;t++)this._states[t].stateName==n&&this._activateState(this._states[t])},_activateState:function(n){if(n!==this._currentState){this.options.type=="replace"&&(this.button.appendChild(n.icon),this.button.removeChild(this._currentState.icon));n.title?this.button.title=n.title:this.button.removeAttribute("title");for(var t=0;t<this._states.length;t++)L.DomUtil.removeClass(this._states[t].icon,this._currentState.stateName+"-active"),L.DomUtil.addClass(this._states[t].icon,n.stateName+"-active");L.DomUtil.removeClass(this.button,this._currentState.stateName+"-active");L.DomUtil.addClass(this.button,n.stateName+"-active");this._currentState=n}},enable:function(){return L.DomUtil.addClass(this.button,"enabled"),L.DomUtil.removeClass(this.button,"disabled"),this.button.setAttribute("aria-hidden","false"),this},disable:function(){return L.DomUtil.addClass(this.button,"disabled"),L.DomUtil.removeClass(this.button,"enabled"),this.button.setAttribute("aria-hidden","true"),this},removeFrom:function(){return this._container.parentNode.removeChild(this._container),this._map=null,this},onAdd:function(){var n=L.easyBar([this],{position:this.options.position,leafletClasses:this.options.leafletClasses});return this._container=n.container,this._container}});L.easyButton=function(){var n=Array.prototype.concat.apply([L.Control.EasyButton],arguments);return new(Function.prototype.bind.apply(L.Control.EasyButton,n))}}(),function(n){if(typeof exports=="object"&&typeof module!="undefined")module.exports=n();else if(typeof define=="function"&&define.amd)define([],n);else{var t;t=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:this;t.leafletImage=n()}}(function(){var n;return function t(n,i,r){function u(f,o){var h,c,s;if(!i[f]){if(!n[f]){if(h=typeof require=="function"&&require,!o&&h)return h(f,!0);if(e)return e(f,!0);c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c;}s=i[f]={exports:{}};n[f][0].call(s.exports,function(t){var i=n[f][1][t];return u(i?i:t)},s,s.exports,t,n,i,r)}return i[f].exports}for(var e=typeof require=="function"&&require,f=0;f<r.length;f++)u(r[f]);return u}({1:[function(n,t){var i=n("d3-queue").queue,r=+new Date;t.exports=function(n,t){function v(n){n instanceof L.TileLayer?f.defer(k,n):n._heat&&f.defer(s,n._canvas)}function y(n){n instanceof L.Marker&&n.options.icon instanceof L.Icon&&f.defer(d,n)}function p(n){L.esri&&n instanceof L.esri.DynamicMapLayer&&f.defer(g,n)}function w(){t(null,o)}function b(n,t){if(n)throw n;t.forEach(function(n){n&&n.canvas&&a.drawImage(n.canvas,0,0)});w()}function k(t,r){function w(n,t,i,r){r(null,{img:n,pos:t,size:i})}function b(n,i,r,u){var f=new Image;f.crossOrigin="";f.onload=function(){u(null,{img:this,pos:i,size:r})};f.onerror=function(n){t.options.errorTileUrl!=""&&n.target.errorCheck===undefined?(n.target.errorCheck=!0,n.target.src=t.options.errorTileUrl):u(null,{img:e,pos:i,size:r})};f.src=n}function k(n,t){t.forEach(d);r(null,{canvas:o})}function d(n){nt.drawImage(n.img,Math.floor(n.pos.x),Math.floor(n.pos.y),n.size,n.size)}var g=L.TileLayer.Canvas&&t instanceof L.TileLayer.Canvas,o=document.createElement("canvas");o.width=u.x;o.height=u.y;var nt=o.getContext("2d"),l=n.getPixelBounds(),y=n.getZoom(),f=t.options.tileSize;if(y>t.options.maxZoom||y<t.options.minZoom||tt&&t instanceof L.mapbox.tileLayer&&!t.options.tiles)return r();for(var s=L.bounds(l.min.divideBy(f)._floor(),l.max.divideBy(f)._floor()),p=[],c,a=new i(1),v=s.min.y;v<=s.max.y;v++)for(c=s.min.x;c<=s.max.x;c++)p.push(new L.Point(c,v));p.forEach(function(n){var e=n.clone(),i,r,u;t._adjustTilePoint&&t._adjustTilePoint(n);i=e.scaleBy(new L.Point(f,f)).subtract(l.min);n.y>=0&&(g?(r=t._tiles[n.x+":"+n.y],a.defer(w,r,i,f)):(u=h(t.getTileUrl(n)),a.defer(b,u,i,f)))});a.awaitAll(k)}function s(t,i){var o=n.getPixelBounds(),s=n.getPixelOrigin(),r=document.createElement("canvas"),e,f;r.width=u.x;r.height=u.y;e=r.getContext("2d");f=L.DomUtil.getPosition(t).subtract(o.min).add(s);try{e.drawImage(t,f.x,f.y,r.width-f.x*2,r.height-f.y*2);i(null,{canvas:r})}catch(h){console.error("Element could not be drawn on canvas",t)}}function d(t,i){var f=document.createElement("canvas"),p=f.getContext("2d"),o=n.getPixelBounds(),w=new L.Point(o.min.x,o.min.y),b=n.project(t.getLatLng()),s=/^data\:/.test(t._icon.src),k=s?t._icon.src:h(t._icon.src),e=new Image,c=t.options.icon.options,r=c.iconSize,l=b.subtract(w),a=L.point(c.iconAnchor||r&&r.divideBy(2,!0)),v,y;r instanceof L.Point&&(r=[r.x,r.y]);v=Math.round(l.x-r[0]+a.x);y=Math.round(l.y-a.y);f.width=u.x;f.height=u.y;e.crossOrigin="";e.onload=function(){p.drawImage(this,v,y,r[0],r[1]);i(null,{canvas:f})};e.src=k;s&&e.onload()}function g(n,t){var r=document.createElement("canvas"),f,i;r.width=u.x;r.height=u.y;f=r.getContext("2d");i=new Image;i.crossOrigin="";i.src=h(n._currentImage._image.src);i.onload=function(){f.drawImage(i,0,0);t(null,{canvas:r})}}function h(n){return nt(n)||n.indexOf("mapbox.com/styles/v1")!==-1?n:n+(n.match(/\?/)?"&":"?")+"cache="+r}function nt(n){return!!n.match(/^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i)}var tt=!!L.mapbox,u=n.getSize(),f=new i(1),o=document.createElement("canvas"),a,e,c,l;o.width=u.x;o.height=u.y;a=o.getContext("2d");e=document.createElement("canvas");e.width=1;e.height=1;c=e.getContext("2d");c.fillStyle="rgba(0,0,0,0)";c.fillRect(0,0,1,1);n.eachLayer(v);n.eachLayer(p);n._pathRoot?f.defer(s,n._pathRoot):n._panes&&(l=n._panes.overlayPane.getElementsByTagName("canvas").item(0),l&&f.defer(s,l));n.eachLayer(y);f.awaitAll(b)}},{"d3-queue":2}],2:[function(t,i,r){(function(t,u){typeof r=="object"&&typeof i!="undefined"?u(r):typeof n=="function"&&n.amd?n(["exports"],u):u(t.d3_queue=t.d3_queue||{})})(this,function(n){"use strict";function i(n){if(!(n>=1))throw new Error;this._size=n;this._call=this._error=null;this._tasks=[];this._data=[];this._waiting=this._active=this._ended=this._start=0}function u(n){if(!n._start)try{e(n)}catch(t){n._tasks[n._ended+n._active-1]&&r(n,t)}}function e(n){while(n._start=n._waiting&&n._active<n._size){var i=n._ended+n._active,t=n._tasks[i],r=t.length-1,u=t[r];(t[r]=o(n,i),--n._waiting,++n._active,t=u.apply(null,t),n._tasks[i])&&(n._tasks[i]=t||h)}}function o(n,i){return function(f,e){n._tasks[i]&&(--n._active,++n._ended,n._tasks[i]=null,n._error==null)&&(f!=null?r(n,f):(n._data[i]=e,n._waiting?u(n):t(n)))}}function r(n,i){var r=n._tasks.length,u;for(n._error=i,n._data=undefined,n._waiting=NaN;--r>=0;)if((u=n._tasks[r])&&(n._tasks[r]=null,u.abort))try{u.abort()}catch(i){}n._active=NaN;t(n)}function t(n){!n._active&&n._call&&n._call(n._error,n._data)}function f(n){return new i(arguments.length?+n:Infinity)}var s=[].slice,h={};i.prototype=f.prototype={constructor:i,defer:function(n){if(typeof n!="function"||this._call)throw new Error;if(this._error!=null)return this;var t=s.call(arguments,1);return t.push(n),++this._waiting,this._tasks.push(t),u(this),this},abort:function(){return this._error==null&&r(this,new Error("abort")),this},await:function(n){if(typeof n!="function"||this._call)throw new Error;return this._call=function(t,i){n.apply(null,[t].concat(i))},t(this),this},awaitAll:function(n){if(typeof n!="function"||this._call)throw new Error;return this._call=n,t(this),this}};n.version="2.0.3";n.queue=f})},{}]},{},[1])(1)})