require=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}({events:[function(n,t){function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}function r(n){return typeof n=="function"}function e(n){return typeof n=="number"}function u(n){return typeof n=="object"&&n!==null}function f(n){return n===void 0}t.exports=i;i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;i.defaultMaxListeners=10;i.prototype.setMaxListeners=function(n){if(!e(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this};i.prototype.emit=function(n){var s,i,e,o,t,h;if(this._events||(this._events={}),n==="error"&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if(s=arguments[1],s instanceof Error)throw s;throw TypeError('Uncaught, unspecified "error" event.');}if(i=this._events[n],f(i))return!1;if(r(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:for(e=arguments.length,o=new Array(e-1),t=1;t<e;t++)o[t-1]=arguments[t];i.apply(this,o)}else if(u(i)){for(e=arguments.length,o=new Array(e-1),t=1;t<e;t++)o[t-1]=arguments[t];for(h=i.slice(),e=h.length,t=0;t<e;t++)h[t].apply(this,o)}return!0};i.prototype.addListener=function(n,t){var e;if(!r(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",n,r(t.listener)?t.listener:t),this._events[n]?u(this._events[n])?this._events[n].push(t):this._events[n]=[this._events[n],t]:this._events[n]=t,u(this._events[n])&&!this._events[n].warned&&(e=f(this._maxListeners)?i.defaultMaxListeners:this._maxListeners,e&&e>0&&this._events[n].length>e&&(this._events[n].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[n].length),typeof console.trace=="function"&&console.trace())),this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(n,t){function i(){this.removeListener(n,i);u||(u=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var u=!1;i.listener=t;this.on(n,i);return this};i.prototype.removeListener=function(n,t){var i,e,o,f;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[n])return this;if(i=this._events[n],o=i.length,e=-1,i===t||r(i.listener)&&i.listener===t)delete this._events[n],this._events.removeListener&&this.emit("removeListener",n,t);else if(u(i)){for(f=o;f-->0;)if(i[f]===t||i[f].listener&&i[f].listener===t){e=f;break}if(e<0)return this;i.length===1?(i.length=0,delete this._events[n]):i.splice(e,1);this._events.removeListener&&this.emit("removeListener",n,t)}return this};i.prototype.removeAllListeners=function(n){var i,t;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[n]&&delete this._events[n],this;if(arguments.length===0){for(i in this._events)i!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events={},this}if(t=this._events[n],r(t))this.removeListener(n,t);else while(t.length)this.removeListener(n,t[t.length-1]);return delete this._events[n],this};i.prototype.listeners=function(n){return this._events&&this._events[n]?r(this._events[n])?[this._events[n]]:this._events[n].slice():[]};i.listenerCount=function(n,t){return n._events&&n._events[t]?r(n._events[t])?1:n._events[t].length:0}},{}]},{},[]);require=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}({inherits:[function(n,t){t.exports=typeof Object.create=="function"?function(n,t){n.super_=t;n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}:function(n,t){n.super_=t;var i=function(){};i.prototype=t.prototype;n.prototype=new i;n.prototype.constructor=n}},{}]},{},[]);require=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}({leaflet:[function(n,t){(function(n,i,r){var o=n.L,u={},f,e;u.version="0.7.7";typeof t=="object"&&typeof t.exports=="object"?t.exports=u:typeof define=="function"&&define.amd&&define(u);u.noConflict=function(){return n.L=o,this};n.L=u;u.Util={extend:function(n){for(var u=Array.prototype.slice.call(arguments,1),t,i,r=0,f=u.length;r<f;r++){i=u[r]||{};for(t in i)i.hasOwnProperty(t)&&(n[t]=i[t])}return n},bind:function(n,t){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return n.apply(t,i||arguments)}},stamp:function(){var t=0,n="_leaflet_id";return function(i){return i[n]=i[n]||++t,i[n]}}(),invokeEach:function(n,t,i){var r,u;if(typeof n=="object"){u=Array.prototype.slice.call(arguments,3);for(r in n)t.apply(i,[r,n[r]].concat(u));return!0}return!1},limitExecByInterval:function(n,t,i){var r,u;return function f(){var e=arguments;if(r){u=!0;return}r=!0;setTimeout(function(){r=!1;u&&(f.apply(i,e),u=!1)},t);n.apply(i,e)}},falseFn:function(){return!1},formatNum:function(n,t){var i=Math.pow(10,t||5);return Math.round(n*i)/i},trim:function(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")},splitWords:function(n){return u.Util.trim(n).split(/\s+/)},setOptions:function(n,t){return n.options=u.extend({},n.options,t),n.options},getParamString:function(n,t,i){var u=[],r;for(r in n)u.push(encodeURIComponent(i?r.toUpperCase():r)+"="+encodeURIComponent(n[r]));return(!t||t.indexOf("?")===-1?"?":"&")+u.join("&")},template:function(n,t){return n.replace(/\{ *([\w_]+) *\}/g,function(n,i){var u=t[i];if(u===r)throw new Error("No value provided for variable "+n);else typeof u=="function"&&(u=u(t));return u})},isArray:Array.isArray||function(n){return Object.prototype.toString.call(n)==="[object Array]"},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function t(t){for(var i,u=["webkit","moz","o","ms"],r=0;r<u.length&&!i;r++)i=n[u[r]+t];return i}function i(t){var i=+new Date,u=Math.max(0,16-(i-r));return r=i+u,n.setTimeout(t,u)}var r=0,f=n.requestAnimationFrame||t("RequestAnimationFrame")||i,e=n.cancelAnimationFrame||t("CancelAnimationFrame")||t("CancelRequestAnimationFrame")||function(t){n.clearTimeout(t)};u.Util.requestAnimFrame=function(t,r,e,o){if(t=u.bind(t,r),e&&f===i)t();else return f.call(n,t,o)};u.Util.cancelAnimFrame=function(t){t&&e.call(n,t)}}();u.extend=u.Util.extend;u.bind=u.Util.bind;u.stamp=u.Util.stamp;u.setOptions=u.Util.setOptions;u.Class=function(){};u.Class.extend=function(n){var i=function(){this.initialize&&this.initialize.apply(this,arguments);this._initHooks&&this.callInitHooks()},e=function(){},t,r,f;e.prototype=this.prototype;t=new e;t.constructor=i;i.prototype=t;for(r in this)this.hasOwnProperty(r)&&r!=="prototype"&&(i[r]=this[r]);return n.statics&&(u.extend(i,n.statics),delete n.statics),n.includes&&(u.Util.extend.apply(null,[t].concat(n.includes)),delete n.includes),n.options&&t.options&&(n.options=u.extend({},t.options,n.options)),u.extend(t,n),t._initHooks=[],f=this,i.__super__=f.prototype,t.callInitHooks=function(){if(!this._initHooksCalled){f.prototype.callInitHooks&&f.prototype.callInitHooks.call(this);this._initHooksCalled=!0;for(var n=0,i=t._initHooks.length;n<i;n++)t._initHooks[n].call(this)}},i};u.Class.include=function(n){u.extend(this.prototype,n)};u.Class.mergeOptions=function(n){u.extend(this.prototype.options,n)};u.Class.addInitHook=function(n){var t=Array.prototype.slice.call(arguments,1),i=typeof n=="function"?n:function(){this[n].apply(this,t)};this.prototype._initHooks=this.prototype._initHooks||[];this.prototype._initHooks.push(i)};f="_leaflet_events";u.Mixin={};u.Mixin.Events={addEventListener:function(n,t,i){if(u.Util.invokeEach(n,this.addEventListener,this,t,i))return this;var r=this[f]=this[f]||{},o=i&&i!==this&&u.stamp(i),s,v,l,e,h,a,c;for(n=u.Util.splitWords(n),s=0,v=n.length;s<v;s++)l={action:t,context:i||this},e=n[s],o?(h=e+"_idx",a=h+"_len",c=r[h]=r[h]||{},c[o]||(c[o]=[],r[a]=(r[a]||0)+1),c[o].push(l)):(r[e]=r[e]||[],r[e].push(l));return this},hasEventListeners:function(n){var t=this[f];return!!t&&(n in t&&t[n].length>0||n+"_idx"in t&&t[n+"_idx_len"]>0)},removeEventListener:function(n,t,i){if(!this[f])return this;if(!n)return this.clearAllEventListeners();if(u.Util.invokeEach(n,this.removeEventListener,this,t,i))return this;var e=this[f],a=i&&i!==this&&u.stamp(i),h,y,c,r,o,l,v,s,p;for(n=u.Util.splitWords(n),h=0,y=n.length;h<y;h++)if(c=n[h],l=c+"_idx",v=l+"_len",s=e[l],t){if(r=a&&s?s[a]:e[c],r){for(o=r.length-1;o>=0;o--)r[o].action!==t||i&&r[o].context!==i||(p=r.splice(o,1),p[0].action=u.Util.falseFn);i&&s&&r.length===0&&(delete s[a],e[v]--)}}else delete e[c],delete e[l],delete e[v];return this},clearAllEventListeners:function(){return delete this[f],this},fireEvent:function(n,t){if(!this.hasEventListeners(n))return this;var h=u.Util.extend({},t,{type:n,target:this}),o=this[f],r,i,e,s,c;if(o[n])for(r=o[n].slice(),i=0,e=r.length;i<e;i++)r[i].action.call(r[i].context,h);s=o[n+"_idx"];for(c in s)if(r=s[c].slice(),r)for(i=0,e=r.length;i<e;i++)r[i].action.call(r[i].context,h);return this},addOneTimeEventListener:function(n,t,i){if(u.Util.invokeEach(n,this.addOneTimeEventListener,this,t,i))return this;var r=u.bind(function(){this.removeEventListener(n,t,i).removeEventListener(n,r,i)},this);return this.addEventListener(n,t,i).addEventListener(n,r,i)}};u.Mixin.Events.on=u.Mixin.Events.addEventListener;u.Mixin.Events.off=u.Mixin.Events.removeEventListener;u.Mixin.Events.once=u.Mixin.Events.addOneTimeEventListener;u.Mixin.Events.fire=u.Mixin.Events.fireEvent,function(){var f="ActiveXObject"in n,b=f&&!i.addEventListener,t=navigator.userAgent.toLowerCase(),o=t.indexOf("webkit")!==-1,k=t.indexOf("chrome")!==-1,c=t.indexOf("phantom")!==-1,d=t.indexOf("android")!==-1,l=t.search("android [23]")!==-1,g=t.indexOf("gecko")!==-1,e=typeof orientation!=r+"",a=!n.PointerEvent&&n.MSPointerEvent,v=n.PointerEvent&&n.navigator.pointerEnabled||a,nt="devicePixelRatio"in n&&n.devicePixelRatio>1||"matchMedia"in n&&n.matchMedia("(min-resolution:144dpi)")&&n.matchMedia("(min-resolution:144dpi)").matches,s=i.documentElement,y=f&&"transition"in s.style,h="WebKitCSSMatrix"in n&&"m11"in new n.WebKitCSSMatrix&&!l,p="MozPerspective"in s.style,w="OTransition"in s.style,tt=!n.L_DISABLE_3D&&(y||h||p||w)&&!c,it=!n.L_NO_TOUCH&&!c&&(v||"ontouchstart"in n||n.DocumentTouch&&i instanceof n.DocumentTouch);u.Browser={ie:f,ielt9:b,webkit:o,gecko:g&&!o&&!n.opera&&!f,android:d,android23:l,chrome:k,ie3d:y,webkit3d:h,gecko3d:p,opera3d:w,any3d:tt,mobile:e,mobileWebkit:e&&o,mobileWebkit3d:e&&h,mobileOpera:e&&n.opera,touch:it,msPointer:a,pointer:v,retina:nt}}();u.Point=function(n,t,i){this.x=i?Math.round(n):n;this.y=i?Math.round(t):t};u.Point.prototype={clone:function(){return new u.Point(this.x,this.y)},add:function(n){return this.clone()._add(u.point(n))},_add:function(n){return this.x+=n.x,this.y+=n.y,this},subtract:function(n){return this.clone()._subtract(u.point(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},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},distanceTo:function(n){n=u.point(n);var t=n.x-this.x,i=n.y-this.y;return Math.sqrt(t*t+i*i)},equals:function(n){return n=u.point(n),n.x===this.x&&n.y===this.y},contains:function(n){return n=u.point(n),Math.abs(n.x)<=Math.abs(this.x)&&Math.abs(n.y)<=Math.abs(this.y)},toString:function(){return"Point("+u.Util.formatNum(this.x)+", "+u.Util.formatNum(this.y)+")"}};u.point=function(n,t,i){return n instanceof u.Point?n:u.Util.isArray(n)?new u.Point(n[0],n[1]):n===r||n===null?n:new u.Point(n,t,i)};u.Bounds=function(n,t){var r,i,u;if(n)for(r=t?[n,t]:n,i=0,u=r.length;i<u;i++)this.extend(r[i])};u.Bounds.prototype={extend:function(n){return n=u.point(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 u.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,n)},getBottomLeft:function(){return new u.Point(this.min.x,this.max.y)},getTopRight:function(){return new u.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(n){var t,i;return n=typeof n[0]=="number"||n instanceof u.Point?u.point(n):u.bounds(n),n instanceof u.Bounds?(t=n.min,i=n.max):t=i=n,t.x>=this.min.x&&i.x<=this.max.x&&t.y>=this.min.y&&i.y<=this.max.y},intersects:function(n){n=u.bounds(n);var t=this.min,i=this.max,r=n.min,f=n.max,e=f.x>=t.x&&r.x<=i.x,o=f.y>=t.y&&r.y<=i.y;return e&&o},isValid:function(){return!!(this.min&&this.max)}};u.bounds=function(n,t){return!n||n instanceof u.Bounds?n:new u.Bounds(n,t)};u.Transformation=function(n,t,i,r){this._a=n;this._b=t;this._c=i;this._d=r};u.Transformation.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,t){return t=t||1,new u.Point((n.x/t-this._b)/this._a,(n.y/t-this._d)/this._c)}};u.DomUtil={get:function(n){return typeof n=="string"?i.getElementById(n):n},getStyle:function(n,t){var r=n.style[t],u;return!r&&n.currentStyle&&(r=n.currentStyle[t]),(!r||r==="auto")&&i.defaultView&&(u=i.defaultView.getComputedStyle(n,null),r=u?u[t]:null),r==="auto"?null:r},getViewportOffset:function(n){var r=0,f=0,t=n,e=i.body,s=i.documentElement,o;do{if(r+=t.offsetTop||0,f+=t.offsetLeft||0,r+=parseInt(u.DomUtil.getStyle(t,"borderTopWidth"),10)||0,f+=parseInt(u.DomUtil.getStyle(t,"borderLeftWidth"),10)||0,o=u.DomUtil.getStyle(t,"position"),t.offsetParent===e&&o==="absolute")break;if(o==="fixed"){r+=e.scrollTop||s.scrollTop||0;f+=e.scrollLeft||s.scrollLeft||0;break}if(o==="relative"&&!t.offsetLeft){var c=u.DomUtil.getStyle(t,"width"),l=u.DomUtil.getStyle(t,"max-width"),h=t.getBoundingClientRect();(c!=="none"||l!=="none")&&(f+=h.left+t.clientLeft);r+=h.top+(e.scrollTop||s.scrollTop||0);break}t=t.offsetParent}while(t);t=n;do{if(t===e)break;r-=t.scrollTop||0;f-=t.scrollLeft||0;t=t.parentNode}while(t);return new u.Point(f,r)},documentIsLtr:function(){return u.DomUtil._docIsLtrCached||(u.DomUtil._docIsLtrCached=!0,u.DomUtil._docIsLtr=u.DomUtil.getStyle(i.body,"direction")==="ltr"),u.DomUtil._docIsLtr},create:function(n,t,r){var u=i.createElement(n);return u.className=t,r&&r.appendChild(u),u},hasClass:function(n,t){if(n.classList!==r)return n.classList.contains(t);var i=u.DomUtil._getClass(n);return i.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(i)},addClass:function(n,t){var f,i,o,e;if(n.classList!==r)for(f=u.Util.splitWords(t),i=0,o=f.length;i<o;i++)n.classList.add(f[i]);else u.DomUtil.hasClass(n,t)||(e=u.DomUtil._getClass(n),u.DomUtil._setClass(n,(e?e+" ":"")+t))},removeClass:function(n,t){n.classList!==r?n.classList.remove(t):u.DomUtil._setClass(n,u.Util.trim((" "+u.DomUtil._getClass(n)+" ").replace(" "+t+" "," ")))},_setClass:function(n,t){n.className.baseVal===r?n.className=t:n.className.baseVal=t},_getClass:function(n){return n.className.baseVal===r?n.className:n.className.baseVal},setOpacity:function(n,t){if("opacity"in n.style)n.style.opacity=t;else if("filter"in n.style){var i=!1,r="DXImageTransform.Microsoft.Alpha";try{i=n.filters.item(r)}catch(u){if(t===1)return}t=Math.round(t*100);i?(i.Enabled=t!==100,i.Opacity=t):n.style.filter+=" progid:"+r+"(opacity="+t+")"}},testProp:function(n){for(var r=i.documentElement.style,t=0;t<n.length;t++)if(n[t]in r)return n[t];return!1},getTranslateString:function(n){var t=u.Browser.webkit3d,i="translate"+(t?"3d":"")+"(",r=(t?",0":"")+")";return i+n.x+"px,"+n.y+"px"+r},getScaleString:function(n,t){var i=u.DomUtil.getTranslateString(t.add(t.multiplyBy(-1*n))),r=" scale("+n+") ";return i+r},setPosition:function(n,t,i){n._leaflet_pos=t;!i&&u.Browser.any3d?n.style[u.DomUtil.TRANSFORM]=u.DomUtil.getTranslateString(t):(n.style.left=t.x+"px",n.style.top=t.y+"px")},getPosition:function(n){return n._leaflet_pos}};u.DomUtil.TRANSFORM=u.DomUtil.testProp(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]);u.DomUtil.TRANSITION=u.DomUtil.testProp(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);u.DomUtil.TRANSITION_END=u.DomUtil.TRANSITION==="webkitTransition"||u.DomUtil.TRANSITION==="OTransition"?u.DomUtil.TRANSITION+"End":"transitionend",function(){if("onselectstart"in i)u.extend(u.DomUtil,{disableTextSelection:function(){u.DomEvent.on(n,"selectstart",u.DomEvent.preventDefault)},enableTextSelection:function(){u.DomEvent.off(n,"selectstart",u.DomEvent.preventDefault)}});else{var t=u.DomUtil.testProp(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);u.extend(u.DomUtil,{disableTextSelection:function(){if(t){var n=i.documentElement.style;this._userSelect=n[t];n[t]="none"}},enableTextSelection:function(){t&&(i.documentElement.style[t]=this._userSelect,delete this._userSelect)}})}u.extend(u.DomUtil,{disableImageDrag:function(){u.DomEvent.on(n,"dragstart",u.DomEvent.preventDefault)},enableImageDrag:function(){u.DomEvent.off(n,"dragstart",u.DomEvent.preventDefault)}})}();u.LatLng=function(n,t,i){if(n=parseFloat(n),t=parseFloat(t),isNaN(n)||isNaN(t))throw new Error("Invalid LatLng object: ("+n+", "+t+")");this.lat=n;this.lng=t;i!==r&&(this.alt=parseFloat(i))};u.extend(u.LatLng,{DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,MAX_MARGIN:1e-9});u.LatLng.prototype={equals:function(n){if(!n)return!1;n=u.latLng(n);var t=Math.max(Math.abs(this.lat-n.lat),Math.abs(this.lng-n.lng));return t<=u.LatLng.MAX_MARGIN},toString:function(n){return"LatLng("+u.Util.formatNum(this.lat,n)+", "+u.Util.formatNum(this.lng,n)+")"},distanceTo:function(n){n=u.latLng(n);var t=u.LatLng.DEG_TO_RAD,e=(n.lat-this.lat)*t,o=(n.lng-this.lng)*t,s=this.lat*t,h=n.lat*t,i=Math.sin(e/2),r=Math.sin(o/2),f=i*i+r*r*Math.cos(s)*Math.cos(h);return 12756274*Math.atan2(Math.sqrt(f),Math.sqrt(1-f))},wrap:function(n,t){var i=this.lng;return n=n||-180,t=t||180,i=(i+t)%(t-n)+(i<n||i===t?t:n),new u.LatLng(this.lat,i)}};u.latLng=function(n,t){return n instanceof u.LatLng?n:u.Util.isArray(n)?typeof n[0]=="number"||typeof n[0]=="string"?new u.LatLng(n[0],n[1],n[2]):null:n===r||n===null?n:typeof n=="object"&&"lat"in n?new u.LatLng(n.lat,"lng"in n?n.lng:n.lon):t===r?null:new u.LatLng(n,t)};u.LatLngBounds=function(n,t){var r,i,u;if(n)for(r=t?[n,t]:n,i=0,u=r.length;i<u;i++)this.extend(r[i])};u.LatLngBounds.prototype={extend:function(n){if(!n)return this;var t=u.latLng(n);return n=t!==null?t:u.latLngBounds(n),n instanceof u.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(n.lat,this._southWest.lat),this._southWest.lng=Math.min(n.lng,this._southWest.lng),this._northEast.lat=Math.max(n.lat,this._northEast.lat),this._northEast.lng=Math.max(n.lng,this._northEast.lng)):(this._southWest=new u.LatLng(n.lat,n.lng),this._northEast=new u.LatLng(n.lat,n.lng)):n instanceof u.LatLngBounds&&(this.extend(n._southWest),this.extend(n._northEast)),this},pad:function(n){var t=this._southWest,i=this._northEast,r=Math.abs(t.lat-i.lat)*n,f=Math.abs(t.lng-i.lng)*n;return new u.LatLngBounds(new u.LatLng(t.lat-r,t.lng-f),new u.LatLng(i.lat+r,i.lng+f))},getCenter:function(){return new u.LatLng((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 u.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new u.LatLng(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=typeof n[0]=="number"||n instanceof u.LatLng?u.latLng(n):u.latLngBounds(n);var r=this._southWest,f=this._northEast,t,i;return n instanceof u.LatLngBounds?(t=n.getSouthWest(),i=n.getNorthEast()):t=i=n,t.lat>=r.lat&&i.lat<=f.lat&&t.lng>=r.lng&&i.lng<=f.lng},intersects:function(n){n=u.latLngBounds(n);var t=this._southWest,i=this._northEast,r=n.getSouthWest(),f=n.getNorthEast(),e=f.lat>=t.lat&&r.lat<=i.lat,o=f.lng>=t.lng&&r.lng<=i.lng;return e&&o},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(n){return n?(n=u.latLngBounds(n),this._southWest.equals(n.getSouthWest())&&this._northEast.equals(n.getNorthEast())):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};u.latLngBounds=function(n,t){return!n||n instanceof u.LatLngBounds?n:new u.LatLngBounds(n,t)};u.Projection={};u.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(n){var i=u.LatLng.DEG_TO_RAD,r=this.MAX_LATITUDE,f=Math.max(Math.min(r,n.lat),-r),e=n.lng*i,t=f*i;return t=Math.log(Math.tan(Math.PI/4+t/2)),new u.Point(e,t)},unproject:function(n){var t=u.LatLng.RAD_TO_DEG,i=n.x*t,r=(2*Math.atan(Math.exp(n.y))-Math.PI/2)*t;return new u.LatLng(r,i)}};u.Projection.LonLat={project:function(n){return new u.Point(n.lng,n.lat)},unproject:function(n){return new u.LatLng(n.y,n.x)}};u.CRS={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)},scale:function(n){return 256*Math.pow(2,n)},getSize:function(n){var t=this.scale(n);return u.point(t,t)}};u.CRS.Simple=u.extend({},u.CRS,{projection:u.Projection.LonLat,transformation:new u.Transformation(1,0,-1,0),scale:function(n){return Math.pow(2,n)}});u.CRS.EPSG3857=u.extend({},u.CRS,{code:"EPSG:3857",projection:u.Projection.SphericalMercator,transformation:new u.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(n){var t=this.projection.project(n);return t.multiplyBy(6378137)}});u.CRS.EPSG900913=u.extend({},u.CRS.EPSG3857,{code:"EPSG:900913"});u.CRS.EPSG4326=u.extend({},u.CRS,{code:"EPSG:4326",projection:u.Projection.LonLat,transformation:new u.Transformation(1/360,.5,-1/360,.5)});u.Map=u.Class.extend({includes:u.Mixin.Events,options:{crs:u.CRS.EPSG3857,fadeAnimation:u.DomUtil.TRANSITION&&!u.Browser.android23,trackResize:!0,markerZoomAnimation:u.DomUtil.TRANSITION&&u.Browser.any3d},initialize:function(n,t){t=u.setOptions(this,t);this._initContainer(n);this._initLayout();this._onResize=u.bind(this._onResize,this);this._initEvents();t.maxBounds&&this.setMaxBounds(t.maxBounds);t.center&&t.zoom!==r&&this.setView(u.latLng(t.center),t.zoom,{reset:!0});this._handlers=[];this._layers={};this._zoomBoundLayers={};this._tileLayersNum=0;this.callInitHooks();this._addLayers(t.layers)},setView:function(n,t){return t=t===r?this.getZoom():t,this._resetView(u.latLng(n),this._limitZoom(t)),this},setZoom:function(n,t){return this._loaded?this.setView(this.getCenter(),n,{zoom:t}):(this._zoom=this._limitZoom(n),this)},zoomIn:function(n,t){return this.setZoom(this._zoom+(n||1),t)},zoomOut:function(n,t){return this.setZoom(this._zoom-(n||1),t)},setZoomAround:function(n,t,i){var f=this.getZoomScale(t),r=this.getSize().divideBy(2),e=n instanceof u.Point?n:this.latLngToContainerPoint(n),o=e.subtract(r).multiplyBy(1-1/f),s=this.containerPointToLatLng(r.add(o));return this.setView(s,t,{zoom:i})},fitBounds:function(n,t){t=t||{};n=n.getBounds?n.getBounds():u.latLngBounds(n);var r=u.point(t.paddingTopLeft||t.padding||[0,0]),f=u.point(t.paddingBottomRight||t.padding||[0,0]),i=this.getBoundsZoom(n,!1,r.add(f));i=t.maxZoom?Math.min(t.maxZoom,i):i;var e=f.subtract(r).divideBy(2),o=this.project(n.getSouthWest(),i),s=this.project(n.getNorthEast(),i),h=this.unproject(o.add(s).divideBy(2).add(e),i);return this.setView(h,i,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){return this.fire("movestart"),this._rawPanBy(u.point(n)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(n){if(n=u.latLngBounds(n),this.options.maxBounds=n,!n)return this.off("moveend",this._panInsideMaxBounds,this);this._loaded&&this._panInsideMaxBounds();return this.on("moveend",this._panInsideMaxBounds,this)},panInsideBounds:function(n,t){var i=this.getCenter(),r=this._limitCenter(i,this._zoom,n);return i.equals(r)?this:this.panTo(r,t)},addLayer:function(n){var t=u.stamp(n);if(this._layers[t])return this;if(this._layers[t]=n,!n.options||isNaN(n.options.maxZoom)&&isNaN(n.options.minZoom)||(this._zoomBoundLayers[t]=n,this._updateZoomLevels()),this.options.zoomAnimation&&u.TileLayer&&n instanceof u.TileLayer){this._tileLayersNum++;this._tileLayersToLoad++;n.on("load",this._onTileLayerLoad,this)}return this._loaded&&this._layerAdd(n),this},removeLayer:function(n){var t=u.stamp(n);if(!this._layers[t])return this;if(this._loaded)n.onRemove(this);return delete this._layers[t],this._loaded&&this.fire("layerremove",{layer:n}),this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels()),this.options.zoomAnimation&&u.TileLayer&&n instanceof u.TileLayer&&(this._tileLayersNum--,this._tileLayersToLoad--,n.off("load",this._onTileLayerLoad,this)),this},hasLayer:function(n){return n?u.stamp(n)in this._layers:!1},eachLayer:function(n,t){for(var i in this._layers)n.call(t,this._layers[i]);return this},invalidateSize:function(n){var i;if(!this._loaded)return this;n=u.extend({animate:!1,pan:!0},n===!0?{animate:!0}:n);i=this.getSize();this._sizeChanged=!0;this._initialCenter=null;var r=this.getSize(),f=i.divideBy(2).round(),e=r.divideBy(2).round(),t=f.subtract(e);return!t.x&&!t.y?this:(n.animate&&n.pan?this.panBy(t):(n.pan&&this._rawPanBy(t),this.fire("move"),n.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(u.bind(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:i,newSize:r}))},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(){this._loaded&&this.fire("unload");this._initEvents("off");try{delete this._container._leaflet}catch(n){this._container._leaflet=r}return this._clearPanes(),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this},getCenter:function(){return(this._checkIfLoaded(),this._initialCenter&&!this._moved())?this._initialCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var n=this.getPixelBounds(),t=this.unproject(n.getBottomLeft()),i=this.unproject(n.getTopRight());return new u.LatLngBounds(t,i)},getMinZoom:function(){return this.options.minZoom===r?this._layersMinZoom===r?0:this._layersMinZoom:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===r?this._layersMaxZoom===r?Infinity:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(n,t,i){n=u.latLngBounds(n);var r=this.getMinZoom()-(t?1:0),s=this.getMaxZoom(),e=this.getSize(),h=n.getNorthWest(),c=n.getSouthEast(),o=!0,f;i=u.point(i||[0,0]);do r++,f=this.project(c,r).subtract(this.project(h,r)).add(i),o=t?f.x<e.x||f.y<e.y:e.contains(f);while(o&&r<=s);return o&&t?null:t?r:r-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new u.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var n=this._getTopLeftPoint();return new u.Bounds(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(n){var t=this.options.crs;return t.scale(n)/t.scale(this._zoom)},getScaleZoom:function(n){return this._zoom+Math.log(n)/Math.LN2},project:function(n,t){return t=t===r?this._zoom:t,this.options.crs.latLngToPoint(u.latLng(n),t)},unproject:function(n,t){return t=t===r?this._zoom:t,this.options.crs.pointToLatLng(u.point(n),t)},layerPointToLatLng:function(n){var t=u.point(n).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(n){var t=this.project(u.latLng(n))._round();return t._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(n){return u.point(n).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(n){return u.point(n).add(this._getMapPanePos())},containerPointToLatLng:function(n){var t=this.containerPointToLayerPoint(u.point(n));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(n){return this.layerPointToContainerPoint(this.latLngToLayerPoint(u.latLng(n)))},mouseEventToContainerPoint:function(n){return u.DomEvent.getMousePosition(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=u.DomUtil.get(n);if(t){if(t._leaflet)throw new Error("Map container is already initialized.");}else throw new Error("Map container not found.");t._leaflet=!0},_initLayout:function(){var t=this._container,n;u.DomUtil.addClass(t,"leaflet-container"+(u.Browser.touch?" leaflet-touch":"")+(u.Browser.retina?" leaflet-retina":"")+(u.Browser.ielt9?" leaflet-oldie":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));n=u.DomUtil.getStyle(t,"position");n!=="absolute"&&n!=="relative"&&n!=="fixed"&&(t.style.position="relative");this._initPanes();this._initControlPos&&this._initControlPos()},_initPanes:function(){var n=this._panes={},t;this._mapPane=n.mapPane=this._createPane("leaflet-map-pane",this._container);this._tilePane=n.tilePane=this._createPane("leaflet-tile-pane",this._mapPane);n.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane);n.shadowPane=this._createPane("leaflet-shadow-pane");n.overlayPane=this._createPane("leaflet-overlay-pane");n.markerPane=this._createPane("leaflet-marker-pane");n.popupPane=this._createPane("leaflet-popup-pane");t=" leaflet-zoom-hide";this.options.markerZoomAnimation||(u.DomUtil.addClass(n.markerPane,t),u.DomUtil.addClass(n.shadowPane,t),u.DomUtil.addClass(n.popupPane,t))},_createPane:function(n,t){return u.DomUtil.create("div",n,t||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(n){n=n?u.Util.isArray(n)?n:[n]:[];for(var t=0,i=n.length;t<i;t++)this.addLayer(n[t])},_resetView:function(n,t,i,r){var f=this._zoom!==t,e;r||(this.fire("movestart"),f&&this.fire("zoomstart"));this._zoom=t;this._initialCenter=n;this._initialTopLeftPoint=this._getNewTopLeftPoint(n);i?this._initialTopLeftPoint._add(this._getMapPanePos()):u.DomUtil.setPosition(this._mapPane,new u.Point(0,0));this._tileLayersToLoad=this._tileLayersNum;e=!this._loaded;this._loaded=!0;this.fire("viewreset",{hard:!i});e&&(this.fire("load"),this.eachLayer(this._layerAdd,this));this.fire("move");(f||r)&&this.fire("zoomend");this.fire("moveend",{hard:!i})},_rawPanBy:function(n){u.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(n))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var t,i=Infinity,u=-Infinity,f=this._getZoomSpan(),n;for(t in this._zoomBoundLayers)n=this._zoomBoundLayers[t],isNaN(n.options.minZoom)||(i=Math.min(i,n.options.minZoom)),isNaN(n.options.maxZoom)||(u=Math.max(u,n.options.maxZoom));t===r?this._layersMaxZoom=this._layersMinZoom=r:(this._layersMaxZoom=u,this._layersMinZoom=i);f!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.");},_initEvents:function(t){if(u.DomEvent){t=t||"on";u.DomEvent[t](this._container,"click",this._onMouseClick,this);for(var r=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"],i=0,f=r.length;i<f;i++)u.DomEvent[t](this._container,r[i],this._fireMouseEvent,this);this.options.trackResize&&u.DomEvent[t](n,"resize",this._onResize,this)}},_onResize:function(){u.Util.cancelAnimFrame(this._resizeRequest);this._resizeRequest=u.Util.requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this,!1,this._container)},_onMouseClick:function(n){!this._loaded||!n._simulated&&(this.dragging&&this.dragging.moved()||this.boxZoom&&this.boxZoom.moved())||u.DomEvent._skipped(n)||(this.fire("preclick"),this._fireMouseEvent(n))},_fireMouseEvent:function(n){var t;if(this._loaded&&!u.DomEvent._skipped(n)&&(t=n.type,t=t==="mouseenter"?"mouseover":t==="mouseleave"?"mouseout":t,this.hasEventListeners(t))){t==="contextmenu"&&u.DomEvent.preventDefault(n);var i=this.mouseEventToContainerPoint(n),r=this.containerPointToLayerPoint(i),f=this.layerPointToLatLng(r);this.fire(t,{latlng:f,layerPoint:r,containerPoint:i,originalEvent:n})}},_onTileLayerLoad:function(){this._tileLayersToLoad--;this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var n=0,t=this._handlers.length;n<t;n++)this._handlers[n].disable()},whenReady:function(n,t){if(this._loaded)n.call(t||this,this);else this.on("load",n,t);return this},_layerAdd:function(n){n.onAdd(this);this.fire("layeradd",{layer:n})},_getMapPanePos:function(){return u.DomUtil.getPosition(this._mapPane)},_moved:function(){var n=this._getMapPanePos();return n&&!n.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(n,t){var i=this.getSize()._divideBy(2);return this.project(n,t)._subtract(i)._round()},_latLngToNewLayerPoint:function(n,t,i){var r=this._getNewTopLeftPoint(i,t).add(this._getMapPanePos());return this.project(n,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),f=this.getSize().divideBy(2),e=new u.Bounds(r.subtract(f),r.add(f)),o=this._getBoundsOffset(e,i,t);return this.unproject(r.add(o),t)},_limitOffset:function(n,t){if(!t)return n;var i=this.getPixelBounds(),r=new u.Bounds(i.min.add(n),i.max.add(n));return n.add(this._getBoundsOffset(r,t))},_getBoundsOffset:function(n,t,i){var r=this.project(t.getNorthWest(),i).subtract(n.min),f=this.project(t.getSouthEast(),i).subtract(n.max),e=this._rebound(r.x,-f.x),o=this._rebound(r.y,-f.y);return new u.Point(e,o)},_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 t=this.getMinZoom(),i=this.getMaxZoom();return Math.max(t,Math.min(i,n))}});u.map=function(n,t){return new u.Map(n,t)};u.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.3142451793,R_MAJOR:6378137,project:function(n){var f=u.LatLng.DEG_TO_RAD,e=this.MAX_LATITUDE,c=Math.max(Math.min(e,n.lat),-e),r=this.R_MAJOR,l=this.R_MINOR,a=n.lng*f*r,t=c*f,o=l/r,s=Math.sqrt(1-o*o),i=s*Math.sin(t),h;return i=Math.pow((1-i)/(1+i),s*.5),h=Math.tan(.5*(Math.PI*.5-t))/i,t=-r*Math.log(h),new u.Point(a,t)},unproject:function(n){for(var e=u.LatLng.RAD_TO_DEG,i=this.R_MAJOR,c=this.R_MINOR,l=n.x*e/i,o=c/i,s=Math.sqrt(1-o*o),h=Math.exp(-n.y/i),t=Math.PI/2-2*Math.atan(h),a=15,r=.1,f;Math.abs(r)>1e-7&&--a>0;)f=s*Math.sin(t),r=Math.PI/2-2*Math.atan(h*Math.pow((1-f)/(1+f),.5*s))-t,t+=r;return new u.LatLng(t*e,l)}};u.CRS.EPSG3395=u.extend({},u.CRS,{code:"EPSG:3395",projection:u.Projection.Mercator,transformation:function(){var t=u.Projection.Mercator,i=t.R_MAJOR,n=.5/(Math.PI*i);return new u.Transformation(n,.5,-n,.5)}()});u.TileLayer=u.Class.extend({includes:u.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:u.Browser.mobile,updateWhenIdle:u.Browser.mobile},initialize:function(n,t){t=u.setOptions(this,t);t.detectRetina&&u.Browser.retina&&t.maxZoom>0&&(t.tileSize=Math.floor(t.tileSize/2),t.zoomOffset++,t.minZoom>0&&t.minZoom--,this.options.maxZoom--);t.bounds&&(t.bounds=u.latLngBounds(t.bounds));this._url=n;var i=this.options.subdomains;typeof i=="string"&&(this.options.subdomains=i.split(""))},onAdd:function(n){this._map=n;this._animated=n._zoomAnimated;this._initContainer();n.on({viewreset:this._reset,moveend:this._update},this);if(this._animated)n.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this);if(!this.options.updateWhenIdle){this._limitedUpdate=u.Util.limitExecByInterval(this._update,150,this);n.on("move",this._limitedUpdate,this)}this._reset();this._update()},addTo:function(n){return n.addLayer(this),this},onRemove:function(n){this._container.parentNode.removeChild(this._container);n.off({viewreset:this._reset,moveend:this._update},this);this._animated&&n.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this);this.options.updateWhenIdle||n.off("move",this._limitedUpdate,this);this._container=null;this._map=null},bringToFront:function(){var n=this._map._panes.tilePane;return this._container&&(n.appendChild(this._container),this._setAutoZIndex(n,Math.max)),this},bringToBack:function(){var n=this._map._panes.tilePane;return this._container&&(n.insertBefore(this._container,n.firstChild),this._setAutoZIndex(n,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(n){return this.options.opacity=n,this._map&&this._updateOpacity(),this},setZIndex:function(n){return this.options.zIndex=n,this._updateZIndex(),this},setUrl:function(n,t){return this._url=n,t||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==r&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(n,t){for(var u=n.children,i=-t(Infinity,-Infinity),f,r=0,e=u.length;r<e;r++)u[r]!==this._container&&(f=parseInt(u[r].style.zIndex,10),isNaN(f)||(i=t(i,f)));this.options.zIndex=this._container.style.zIndex=(isFinite(i)?i:0)+t(1,-1)},_updateOpacity:function(){var n,t=this._tiles;if(u.Browser.ielt9)for(n in t)u.DomUtil.setOpacity(t[n],this.options.opacity);else u.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var t=this._map._panes.tilePane,n;this._container||(this._container=u.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated?(n="leaflet-tile-container",this._bgBuffer=u.DomUtil.create("div",n,this._container),this._tileContainer=u.DomUtil.create("div",n,this._container)):this._tileContainer=this._container,t.appendChild(this._container),this.options.opacity<1&&this._updateOpacity())},_reset:function(n){for(var t in this._tiles)this.fire("tileunload",{tile:this._tiles[t]});this._tiles={};this._tilesToLoad=0;this.options.reuseTiles&&(this._unusedTiles=[]);this._tileContainer.innerHTML="";this._animated&&n&&n.hard&&this._clearBgBuffer();this._initContainer()},_getTileSize:function(){var n=this._map,r=n.getZoom()+this.options.zoomOffset,t=this.options.maxNativeZoom,i=this.options.tileSize;return t&&r>t&&(i=Math.round(n.getZoomScale(r)/n.getZoomScale(t)*i)),i},_update:function(){var n;if(this._map){var t=this._map,i=t.getPixelBounds(),r=t.getZoom(),f=this._getTileSize();r>this.options.maxZoom||r<this.options.minZoom||(n=u.bounds(i.min.divideBy(f)._floor(),i.max.divideBy(f)._floor()),this._addTilesFromCenterOut(n),(this.options.unloadInvisibleTiles||this.options.reuseTiles)&&this._removeOtherTiles(n))}},_addTilesFromCenterOut:function(n){for(var r=[],h=n.getCenter(),t,e,f,o,s=n.min.y;s<=n.max.y;s++)for(t=n.min.x;t<=n.max.x;t++)e=new u.Point(t,s),this._tileShouldBeLoaded(e)&&r.push(e);if(f=r.length,f!==0){for(r.sort(function(n,t){return n.distanceTo(h)-t.distanceTo(h)}),o=i.createDocumentFragment(),this._tilesToLoad||this.fire("loading"),this._tilesToLoad+=f,t=0;t<f;t++)this._addTile(r[t],o);this._tileContainer.appendChild(o)}},_tileShouldBeLoaded:function(n){var t,i;if(n.x+":"+n.y in this._tiles||(t=this.options,!t.continuousWorld&&(i=this._getWrapTileNum(),t.noWrap&&(n.x<0||n.x>=i.x)||n.y<0||n.y>=i.y)))return!1;if(t.bounds){var r=this._getTileSize(),e=n.multiplyBy(r),o=e.add([r,r]),u=this._map.unproject(e),f=this._map.unproject(o);if(t.continuousWorld||t.noWrap||(u=u.wrap(),f=f.wrap()),!t.bounds.intersects([u,f]))return!1}return!0},_removeOtherTiles:function(n){var t,i,r,u;for(u in this._tiles)t=u.split(":"),i=parseInt(t[0],10),r=parseInt(t[1],10),(i<n.min.x||i>n.max.x||r<n.min.y||r>n.max.y)&&this._removeTile(u)},_removeTile:function(n){var t=this._tiles[n];this.fire("tileunload",{tile:t,url:t.src});this.options.reuseTiles?(u.DomUtil.removeClass(t,"leaflet-tile-loaded"),this._unusedTiles.push(t)):t.parentNode===this._tileContainer&&this._tileContainer.removeChild(t);u.Browser.android||(t.onload=null,t.src=u.Util.emptyImageUrl);delete this._tiles[n]},_addTile:function(n,t){var r=this._getTilePos(n),i=this._getTile();u.DomUtil.setPosition(i,r,u.Browser.chrome);this._tiles[n.x+":"+n.y]=i;this._loadTile(i,n);i.parentNode!==this._tileContainer&&t.appendChild(i)},_getZoomForUrl:function(){var n=this.options,t=this._map.getZoom();return n.zoomReverse&&(t=n.maxZoom-t),t+=n.zoomOffset,n.maxNativeZoom?Math.min(t,n.maxNativeZoom):t},_getTilePos:function(n){var t=this._map.getPixelOrigin(),i=this._getTileSize();return n.multiplyBy(i).subtract(t)},getTileUrl:function(n){return u.Util.template(this._url,u.extend({s:this._getSubdomain(n),z:n.z,x:n.x,y:n.y},this.options))},_getWrapTileNum:function(){var n=this._map.options.crs,t=n.getSize(this._map.getZoom());return t.divideBy(this._getTileSize())._floor()},_adjustTilePoint:function(n){var t=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(n.x=(n.x%t.x+t.x)%t.x);this.options.tms&&(n.y=t.y-n.y-1);n.z=this._getZoomForUrl()},_getSubdomain:function(n){var t=Math.abs(n.x+n.y)%this.options.subdomains.length;return this.options.subdomains[t]},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var n=this._unusedTiles.pop();return this._resetTile(n),n}return this._createTile()},_resetTile:function(){},_createTile:function(){var n=u.DomUtil.create("img","leaflet-tile");return n.style.width=n.style.height=this._getTileSize()+"px",n.galleryimg="no",n.onselectstart=n.onmousemove=u.Util.falseFn,u.Browser.ielt9&&this.options.opacity!==r&&u.DomUtil.setOpacity(n,this.options.opacity),u.Browser.mobileWebkit3d&&(n.style.WebkitBackfaceVisibility="hidden"),n},_loadTile:function(n,t){n._layer=this;n.onload=this._tileOnLoad;n.onerror=this._tileOnError;this._adjustTilePoint(t);n.src=this.getTileUrl(t);this.fire("tileloadstart",{tile:n,url:n.src})},_tileLoaded:function(){this._tilesToLoad--;this._animated&&u.DomUtil.addClass(this._tileContainer,"leaflet-zoom-animated");this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(u.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var n=this._layer;this.src!==u.Util.emptyImageUrl&&(u.DomUtil.addClass(this,"leaflet-tile-loaded"),n.fire("tileload",{tile:this,url:this.src}));n._tileLoaded()},_tileOnError:function(){var n=this._layer,t;n.fire("tileerror",{tile:this,url:this.src});t=n.options.errorTileUrl;t&&(this.src=t);n._tileLoaded()}});u.tileLayer=function(n,t){return new u.TileLayer(n,t)};u.TileLayer.WMS=u.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(n,t){var i,f,r;this._url=n;i=u.extend({},this.defaultWmsParams);f=t.tileSize||this.options.tileSize;i.width=i.height=t.detectRetina&&u.Browser.retina?f*2:f;for(r in t)this.options.hasOwnProperty(r)||r==="crs"||(i[r]=t[r]);this.wmsParams=i;u.setOptions(this,t)},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;u.TileLayer.prototype.onAdd.call(this,n)},getTileUrl:function(n){var f=this._map,r=this.options.tileSize,e=n.multiplyBy(r),s=e.add([r,r]),t=this._crs.project(f.unproject(e,n.z)),i=this._crs.project(f.unproject(s,n.z)),h=this._wmsVersion>=1.3&&this._crs===u.CRS.EPSG4326?[i.y,t.x,t.y,i.x].join(","):[t.x,i.y,i.x,t.y].join(","),o=u.Util.template(this._url,{s:this._getSubdomain(n)});return o+u.Util.getParamString(this.wmsParams,o,!0)+"&BBOX="+h},setParams:function(n,t){return u.extend(this.wmsParams,n),t||this.redraw(),this}});u.tileLayer.wms=function(n,t){return new u.TileLayer.WMS(n,t)};u.TileLayer.Canvas=u.TileLayer.extend({options:{async:!1},initialize:function(n){u.setOptions(this,n)},redraw:function(){this._map&&(this._reset({hard:!0}),this._update());for(var n in this._tiles)this._redrawTile(this._tiles[n]);return this},_redrawTile:function(n){this.drawTile(n,n._tilePoint,this._map._zoom)},_createTile:function(){var n=u.DomUtil.create("canvas","leaflet-tile");return n.width=n.height=this.options.tileSize,n.onselectstart=n.onmousemove=u.Util.falseFn,n},_loadTile:function(n,t){n._layer=this;n._tilePoint=t;this._redrawTile(n);this.options.async||this.tileDrawn(n)},drawTile:function(){},tileDrawn:function(n){this._tileOnLoad.call(n)}});u.tileLayer.canvas=function(n){return new u.TileLayer.Canvas(n)};u.ImageOverlay=u.Class.extend({includes:u.Mixin.Events,options:{opacity:1},initialize:function(n,t,i){this._url=n;this._bounds=u.latLngBounds(t);u.setOptions(this,i)},onAdd:function(n){this._map=n;this._image||this._initImage();n._panes.overlayPane.appendChild(this._image);n.on("viewreset",this._reset,this);if(n.options.zoomAnimation&&u.Browser.any3d)n.on("zoomanim",this._animateZoom,this);this._reset()},onRemove:function(n){n.getPanes().overlayPane.removeChild(this._image);n.off("viewreset",this._reset,this);n.options.zoomAnimation&&n.off("zoomanim",this._animateZoom,this)},addTo:function(n){return n.addLayer(this),this},setOpacity:function(n){return this.options.opacity=n,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var n=this._map._panes.overlayPane;return this._image&&n.insertBefore(this._image,n.firstChild),this},setUrl:function(n){this._url=n;this._image.src=this._url},getAttribution:function(){return this.options.attribution},_initImage:function(){this._image=u.DomUtil.create("img","leaflet-image-layer");this._map.options.zoomAnimation&&u.Browser.any3d?u.DomUtil.addClass(this._image,"leaflet-zoom-animated"):u.DomUtil.addClass(this._image,"leaflet-zoom-hide");this._updateOpacity();u.extend(this._image,{galleryimg:"no",onselectstart:u.Util.falseFn,onmousemove:u.Util.falseFn,onload:u.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(n){var t=this._map,f=this._image,i=t.getZoomScale(n.zoom),e=this._bounds.getNorthWest(),o=this._bounds.getSouthEast(),r=t._latLngToNewLayerPoint(e,n.zoom,n.center),s=t._latLngToNewLayerPoint(o,n.zoom,n.center)._subtract(r),h=r._add(s._multiplyBy(1/2*(1-1/i)));f.style[u.DomUtil.TRANSFORM]=u.DomUtil.getTranslateString(h)+" scale("+i+") "},_reset:function(){var n=this._image,t=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(t);u.DomUtil.setPosition(n,t);n.style.width=i.x+"px";n.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){u.DomUtil.setOpacity(this._image,this.options.opacity)}});u.imageOverlay=function(n,t,i){return new u.ImageOverlay(n,t,i)};u.Icon=u.Class.extend({options:{className:""},initialize:function(n){u.setOptions(this,n)},createIcon:function(n){return this._createIcon("icon",n)},createShadow:function(n){return this._createIcon("shadow",n)},_createIcon:function(n,t){var i=this._getIconUrl(n),r;if(!i){if(n==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}return r=t&&t.tagName==="IMG"?this._createImg(i,t):this._createImg(i),this._setIconStyles(r,n),r},_setIconStyles:function(n,t){var r=this.options,f=u.point(r[t+"Size"]),i;i=t==="shadow"?u.point(r.shadowAnchor||r.iconAnchor):u.point(r.iconAnchor);!i&&f&&(i=f.divideBy(2,!0));n.className="leaflet-marker-"+t+" "+r.className;i&&(n.style.marginLeft=-i.x+"px",n.style.marginTop=-i.y+"px");f&&(n.style.width=f.x+"px",n.style.height=f.y+"px")},_createImg:function(n,t){return t=t||i.createElement("img"),t.src=n,t},_getIconUrl:function(n){return u.Browser.retina&&this.options[n+"RetinaUrl"]?this.options[n+"RetinaUrl"]:this.options[n+"Url"]}});u.icon=function(n){return new u.Icon(n)};u.Icon.Default=u.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(n){var i=n+"Url",t;if(this.options[i])return this.options[i];if(u.Browser.retina&&n==="icon"&&(n+="-2x"),t=u.Icon.Default.imagePath,!t)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return t+"/marker-"+n+".png"}});u.Icon.Default.imagePath=function(){for(var u=i.getElementsByTagName("script"),f=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/,n,e,t,r=0,o=u.length;r<o;r++)if(n=u[r].src,e=n.match(f),e)return t=n.split(f)[0],(t?t+"/":"")+"images"}();u.Marker=u.Class.extend({includes:u.Mixin.Events,options:{icon:new u.Icon.Default,title:"",alt:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(n,t){u.setOptions(this,t);this._latlng=u.latLng(n)},onAdd:function(n){this._map=n;n.on("viewreset",this.update,this);if(this._initIcon(),this.update(),this.fire("add"),n.options.zoomAnimation&&n.options.markerZoomAnimation)n.on("zoomanim",this._animateZoom,this)},addTo:function(n){return n.addLayer(this),this},onRemove:function(n){this.dragging&&this.dragging.disable();this._removeIcon();this._removeShadow();this.fire("remove");n.off({viewreset:this.update,zoomanim:this._animateZoom},this);this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(n){return this._latlng=u.latLng(n),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(n){return this.options.zIndexOffset=n,this.update(),this},setIcon:function(n){return this.options.icon=n,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup),this},update:function(){return this._icon&&this._setPos(this._map.latLngToLayerPoint(this._latlng).round()),this},_initIcon:function(){var n=this.options,e=this._map,h=e.options.zoomAnimation&&e.options.markerZoomAnimation,o=h?"leaflet-zoom-animated":"leaflet-zoom-hide",t=n.icon.createIcon(this._icon),s=!1,i,r,f;if(t!==this._icon&&(this._icon&&this._removeIcon(),s=!0,n.title&&(t.title=n.title),n.alt&&(t.alt=n.alt)),u.DomUtil.addClass(t,o),n.keyboard&&(t.tabIndex="0"),this._icon=t,this._initInteraction(),n.riseOnHover)u.DomEvent.on(t,"mouseover",this._bringToFront,this).on(t,"mouseout",this._resetZIndex,this);i=n.icon.createShadow(this._shadow);r=!1;i!==this._shadow&&(this._removeShadow(),r=!0);i&&u.DomUtil.addClass(i,o);this._shadow=i;n.opacity<1&&this._updateOpacity();f=this._map._panes;s&&f.markerPane.appendChild(this._icon);i&&r&&f.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&u.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex);this._map._panes.markerPane.removeChild(this._icon);this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow);this._shadow=null},_setPos:function(n){u.DomUtil.setPosition(this._icon,n);this._shadow&&u.DomUtil.setPosition(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(){var n,i,t;if(this.options.clickable){n=this._icon;i=["dblclick","mousedown","mouseover","mouseout","contextmenu"];u.DomUtil.addClass(n,"leaflet-clickable");u.DomEvent.on(n,"click",this._onMouseClick,this);u.DomEvent.on(n,"keypress",this._onKeyPress,this);for(t=0;t<i.length;t++)u.DomEvent.on(n,i[t],this._fireMouseEvent,this);u.Handler.MarkerDrag&&(this.dragging=new u.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_onMouseClick:function(n){var t=this.dragging&&this.dragging.moved();((this.hasEventListeners(n.type)||t)&&u.DomEvent.stopPropagation(n),t)||(this.dragging&&this.dragging._enabled||!this._map.dragging||!this._map.dragging.moved())&&this.fire(n.type,{originalEvent:n,latlng:this._latlng})},_onKeyPress:function(n){n.keyCode===13&&this.fire("click",{originalEvent:n,latlng:this._latlng})},_fireMouseEvent:function(n){this.fire(n.type,{originalEvent:n,latlng:this._latlng});n.type==="contextmenu"&&this.hasEventListeners(n.type)&&u.DomEvent.preventDefault(n);n.type!=="mousedown"?u.DomEvent.stopPropagation(n):u.DomEvent.preventDefault(n)},setOpacity:function(n){return this.options.opacity=n,this._map&&this._updateOpacity(),this},_updateOpacity:function(){u.DomUtil.setOpacity(this._icon,this.options.opacity);this._shadow&&u.DomUtil.setOpacity(this._shadow,this.options.opacity)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)}});u.marker=function(n,t){return new u.Marker(n,t)};u.DivIcon=u.Icon.extend({options:{iconSize:[12,12],className:"leaflet-div-icon",html:!1},createIcon:function(n){var r=n&&n.tagName==="DIV"?n:i.createElement("div"),t=this.options;return r.innerHTML=t.html!==!1?t.html:"",t.bgPos&&(r.style.backgroundPosition=-t.bgPos.x+"px "+-t.bgPos.y+"px"),this._setIconStyles(r,"icon"),r},createShadow:function(){return null}});u.divIcon=function(n){return new u.DivIcon(n)};u.Map.mergeOptions({closePopupOnClick:!0});u.Popup=u.Class.extend({includes:u.Mixin.Events,options:{minWidth:50,maxWidth:300,autoPan:!0,closeButton:!0,offset:[0,7],autoPanPadding:[5,5],keepInView:!1,className:"",zoomAnimation:!0},initialize:function(n,t){u.setOptions(this,n);this._source=t;this._animated=u.Browser.any3d&&this.options.zoomAnimation;this._isOpen=!1},onAdd:function(n){this._map=n;this._container||this._initLayout();var t=n.options.fadeAnimation;t&&u.DomUtil.setOpacity(this._container,0);n._panes.popupPane.appendChild(this._container);n.on(this._getEvents(),this);this.update();t&&u.DomUtil.setOpacity(this._container,1);this.fire("open");n.fire("popupopen",{popup:this});this._source&&this._source.fire("popupopen",{popup:this})},addTo:function(n){return n.addLayer(this),this},openOn:function(n){return n.openPopup(this),this},onRemove:function(n){n._panes.popupPane.removeChild(this._container);u.Util.falseFn(this._container.offsetWidth);n.off(this._getEvents(),this);n.options.fadeAnimation&&u.DomUtil.setOpacity(this._container,0);this._map=null;this.fire("close");n.fire("popupclose",{popup:this});this._source&&this._source.fire("popupclose",{popup:this})},getLatLng:function(){return this._latlng},setLatLng:function(n){return this._latlng=u.latLng(n),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(n){return this._content=n,this.update(),this},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={viewreset:this._updatePosition};return this._animated&&(n.zoomanim=this._zoomAnimation),("closeOnClick"in this.options?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",f=n+" "+this.options.className+" leaflet-zoom-"+(this._animated?"animated":"hide"),r=this._container=u.DomUtil.create("div",f),t,i;if(this.options.closeButton){t=this._closeButton=u.DomUtil.create("a",n+"-close-button",r);t.href="#close";t.innerHTML="&#215;";u.DomEvent.disableClickPropagation(t);u.DomEvent.on(t,"click",this._onCloseButtonClick,this)}i=this._wrapper=u.DomUtil.create("div",n+"-content-wrapper",r);u.DomEvent.disableClickPropagation(i);this._contentNode=u.DomUtil.create("div",n+"-content",i);u.DomEvent.disableScrollPropagation(this._contentNode);u.DomEvent.on(i,"contextmenu",u.DomEvent.stopPropagation);this._tipContainer=u.DomUtil.create("div",n+"-tip-container",r);this._tip=u.DomUtil.create("div",n+"-tip",this._tipContainer)},_updateContent:function(){if(this._content){if(typeof this._content=="string")this._contentNode.innerHTML=this._content;else{while(this._contentNode.hasChildNodes())this._contentNode.removeChild(this._contentNode.firstChild);this._contentNode.appendChild(this._content)}this.fire("contentupdate")}},_updateLayout:function(){var i=this._contentNode,n=i.style,t;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="";var e=i.offsetHeight,r=this.options.maxHeight,f="leaflet-popup-scrolled";r&&e>r?(n.height=r+"px",u.DomUtil.addClass(i,f)):u.DomUtil.removeClass(i,f);this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var n=this._map.latLngToLayerPoint(this._latlng),t=this._animated,i=u.point(this.options.offset);t&&u.DomUtil.setPosition(this._container,n);this._containerBottom=-i.y-(t?0:n.y);this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(t?0:n.x);this._container.style.bottom=this._containerBottom+"px";this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(n){var t=this._map._latLngToNewLayerPoint(this._latlng,n.zoom,n.center);u.DomUtil.setPosition(this._container,t)},_adjustPan:function(){if(this.options.autoPan){var o=this._map,s=this._container.offsetHeight,h=this._containerWidth,c=new u.Point(this._containerLeft,-s-this._containerBottom);this._animated&&c._add(u.DomUtil.getPosition(this._container));var n=o.layerPointToContainerPoint(c),l=u.point(this.options.autoPanPadding),r=u.point(this.options.autoPanPaddingTopLeft||l),f=u.point(this.options.autoPanPaddingBottomRight||l),e=o.getSize(),t=0,i=0;n.x+h+f.x>e.x&&(t=n.x+h-e.x+f.x);n.x-t-r.x<0&&(t=n.x-r.x);n.y+s+f.y>e.y&&(i=n.y+s-e.y+f.y);n.y-i-r.y<0&&(i=n.y-r.y);(t||i)&&o.fire("autopanstart").panBy([t,i])}},_onCloseButtonClick:function(n){this._close();u.DomEvent.stop(n)}});u.popup=function(n,t){return new u.Popup(n,t)};u.Map.include({openPopup:function(n,t,i){if(this.closePopup(),!(n instanceof u.Popup)){var r=n;n=new u.Popup(i).setLatLng(t).setContent(r)}return n._isOpen=!0,this._popup=n,this.addLayer(n)},closePopup:function(n){return n&&n!==this._popup||(n=this._popup,this._popup=null),n&&(this.removeLayer(n),n._isOpen=!1),this}});u.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(){return this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup()),this},bindPopup:function(n,t){var i=u.point(this.options.icon.options.popupAnchor||[0,0]);if(i=i.add(u.Popup.prototype.options.offset),t&&t.offset&&(i=i.add(t.offset)),t=u.extend({offset:i},t),!this._popupHandlersAdded){this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this);this._popupHandlersAdded=!0}return n instanceof u.Popup?(u.setOptions(n,t),this._popup=n,n._source=this):this._popup=new u.Popup(t,this).setContent(n),this},setPopupContent:function(n){return this._popup&&this._popup.setContent(n),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.togglePopup,this).off("remove",this.closePopup,this).off("move",this._movePopup,this),this._popupHandlersAdded=!1),this},getPopup:function(){return this._popup},_movePopup:function(n){this._popup.setLatLng(n.latlng)}});u.LayerGroup=u.Class.extend({initialize:function(n){this._layers={};var t,i;if(n)for(t=0,i=n.length;t<i;t++)this.addLayer(n[t])},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:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(n){var r=Array.prototype.slice.call(arguments,1),i,t;for(i in this._layers)t=this._layers[i],t[n]&&t[n].apply(t,r);return this},onAdd:function(n){this._map=n;this.eachLayer(n.addLayer,n)},onRemove:function(n){this.eachLayer(n.removeLayer,n);this._map=null},addTo:function(n){return n.addLayer(this),this},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=[],t;for(t in this._layers)n.push(this._layers[t]);return n},setZIndex:function(n){return this.invoke("setZIndex",n)},getLayerId:function(n){return u.stamp(n)}});u.layerGroup=function(n){return new u.LayerGroup(n)};u.FeatureGroup=u.LayerGroup.extend({includes:u.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(n){if(this.hasLayer(n))return this;if("on"in n)n.on(u.FeatureGroup.EVENTS,this._propagateEvent,this);return u.LayerGroup.prototype.addLayer.call(this,n),this._popupContent&&n.bindPopup&&n.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:n})},removeLayer:function(n){return this.hasLayer(n)?(n in this._layers&&(n=this._layers[n]),"off"in n&&n.off(u.FeatureGroup.EVENTS,this._propagateEvent,this),u.LayerGroup.prototype.removeLayer.call(this,n),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:n})):this},bindPopup:function(n,t){return this._popupContent=n,this._popupOptions=t,this.invoke("bindPopup",n,t)},openPopup:function(n){for(var t in this._layers){this._layers[t].openPopup(n);break}return this},setStyle:function(n){return this.invoke("setStyle",n)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var n=new u.LatLngBounds;return this.eachLayer(function(t){n.extend(t instanceof u.Marker?t.getLatLng():t.getBounds())}),n},_propagateEvent:function(n){n=u.extend({layer:n.target,target:this},n);this.fire(n.type,n)}});u.featureGroup=function(n){return new u.FeatureGroup(n)};u.Path=u.Class.extend({includes:[u.Mixin.Events],statics:{CLIP_PADDING:function(){var t=u.Browser.mobile?1280:2e3,i=(t/Math.max(n.outerWidth,n.outerHeight)-1)/2;return Math.max(0,Math.min(.5,i))}()},options:{stroke:!0,color:"#0033ff",dashArray:null,lineCap:null,lineJoin:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(n){u.setOptions(this,n)},onAdd:function(n){this._map=n;this._container||(this._initElements(),this._initEvents());this.projectLatlngs();this._updatePath();this._container&&this._map._pathRoot.appendChild(this._container);this.fire("add");n.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(n){return n.addLayer(this),this},onRemove:function(n){n._pathRoot.removeChild(this._container);this.fire("remove");this._map=null;u.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null);n.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(n){return u.setOptions(this,n),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}});u.Map.include({_updatePathViewport:function(){var n=u.Path.CLIP_PADDING,t=this.getSize(),r=u.DomUtil.getPosition(this._mapPane),i=r.multiplyBy(-1)._subtract(t.multiplyBy(n)._round()),f=i.add(t.multiplyBy(1+n*2)._round());this._pathViewport=new u.Bounds(i,f)}});u.Path.SVG_NS="http://www.w3.org/2000/svg";u.Browser.svg=!!(i.createElementNS&&i.createElementNS(u.Path.SVG_NS,"svg").createSVGRect);u.Path=u.Path.extend({statics:{SVG:u.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,n=this._container;return n&&t.lastChild!==n&&t.appendChild(n),this},bringToBack:function(){var t=this._map._pathRoot,n=this._container,i=t.firstChild;return n&&i!==n&&t.insertBefore(n,i),this},getPathString:function(){},_createElement:function(n){return i.createElementNS(u.Path.SVG_NS,n)},_initElements:function(){this._map._initPathRoot();this._initPath();this._initStyle()},_initPath:function(){this._container=this._createElement("g");this._path=this._createElement("path");this.options.className&&u.DomUtil.addClass(this._path,this.options.className);this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round"));this.options.fill&&this._path.setAttribute("fill-rule","evenodd");this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents);this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none");this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray"),this.options.lineCap&&this._path.setAttribute("stroke-linecap",this.options.lineCap),this.options.lineJoin&&this._path.setAttribute("stroke-linejoin",this.options.lineJoin)):this._path.setAttribute("stroke","none");this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var n=this.getPathString();n||(n="M0 0");this._path.setAttribute("d",n)},_initEvents:function(){var t,n;if(this.options.clickable){(u.Browser.svg||!u.Browser.vml)&&u.DomUtil.addClass(this._path,"leaflet-clickable");u.DomEvent.on(this._container,"click",this._onMouseClick,this);for(t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],n=0;n<t.length;n++)u.DomEvent.on(this._container,t[n],this._fireMouseEvent,this)}},_onMouseClick:function(n){this._map.dragging&&this._map.dragging.moved()||this._fireMouseEvent(n)},_fireMouseEvent:function(n){if(this._map&&this.hasEventListeners(n.type)){var t=this._map,i=t.mouseEventToContainerPoint(n),r=t.containerPointToLayerPoint(i),f=t.layerPointToLatLng(r);this.fire(n.type,{latlng:f,layerPoint:r,containerPoint:i,originalEvent:n});n.type==="contextmenu"&&u.DomEvent.preventDefault(n);n.type!=="mousemove"&&u.DomEvent.stopPropagation(n)}}});u.Map.include({_initPathRoot:function(){if(!this._pathRoot){if(this._pathRoot=u.Path.prototype._createElement("svg"),this._panes.overlayPane.appendChild(this._pathRoot),this.options.zoomAnimation&&u.Browser.any3d){u.DomUtil.addClass(this._pathRoot,"leaflet-zoom-animated");this.on({zoomanim:this._animatePathZoom,zoomend:this._endPathZoom})}else u.DomUtil.addClass(this._pathRoot,"leaflet-zoom-hide");this.on("moveend",this._updateSvgViewport);this._updateSvgViewport()}},_animatePathZoom:function(n){var t=this.getZoomScale(n.zoom),i=this._getCenterOffset(n.center)._multiplyBy(-t)._add(this._pathViewport.min);this._pathRoot.style[u.DomUtil.TRANSFORM]=u.DomUtil.getTranslateString(i)+" scale("+t+") ";this._pathZooming=!0},_endPathZoom:function(){this._pathZooming=!1},_updateSvgViewport:function(){if(!this._pathZooming){this._updatePathViewport();var i=this._pathViewport,t=i.min,r=i.max,f=r.x-t.x,e=r.y-t.y,n=this._pathRoot,o=this._panes.overlayPane;u.Browser.mobileWebkit&&o.removeChild(n);u.DomUtil.setPosition(n,t);n.setAttribute("width",f);n.setAttribute("height",e);n.setAttribute("viewBox",[t.x,t.y,f,e].join(" "));u.Browser.mobileWebkit&&o.appendChild(n)}}});u.Path.include({bindPopup:function(n,t){if(n instanceof u.Popup?this._popup=n:((!this._popup||t)&&(this._popup=new u.Popup(t,this)),this._popup.setContent(n)),!this._popupHandlersAdded){this.on("click",this._openPopup,this).on("remove",this.closePopup,this);this._popupHandlersAdded=!0}return this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this._openPopup).off("remove",this.closePopup),this._popupHandlersAdded=!1),this},openPopup:function(n){return this._popup&&(n=n||this._latlng||this._latlngs[Math.floor(this._latlngs.length/2)],this._openPopup({latlng:n})),this},closePopup:function(){return this._popup&&this._popup._close(),this},_openPopup:function(n){this._popup.setLatLng(n.latlng);this._map.openPopup(this._popup)}});u.Browser.vml=!u.Browser.svg&&function(){var t,n;try{return t=i.createElement("div"),t.innerHTML='<v:shape adj="1"/>',n=t.firstChild,n.style.behavior="url(#default#VML)",n&&typeof n.adj=="object"}catch(r){return!1}}();u.Path=u.Browser.svg||!u.Browser.vml?u.Path:u.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return i.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(n){return i.createElement("<lvml:"+n+' class="lvml">')}}catch(n){return function(n){return i.createElement("<"+n+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var n=this._container=this._createElement("shape");u.DomUtil.addClass(n,"leaflet-vml-shape"+(this.options.className?" "+this.options.className:""));this.options.clickable&&u.DomUtil.addClass(n,"leaflet-clickable");n.coordsize="1 1";this._path=this._createElement("path");n.appendChild(this._path);this._map._pathRoot.appendChild(n)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,i=this._fill,n=this.options,r=this._container;r.stroked=n.stroke;r.filled=n.fill;n.stroke?(t||(t=this._stroke=this._createElement("stroke"),t.endcap="round",r.appendChild(t)),t.weight=n.weight+"px",t.color=n.color,t.opacity=n.opacity,t.dashStyle=n.dashArray?u.Util.isArray(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):"",n.lineCap&&(t.endcap=n.lineCap.replace("butt","flat")),n.lineJoin&&(t.joinstyle=n.lineJoin)):t&&(r.removeChild(t),this._stroke=null);n.fill?(i||(i=this._fill=this._createElement("fill"),r.appendChild(i)),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(r.removeChild(i),this._fill=null)},_updatePath:function(){var n=this._container.style;n.display="none";this._path.v=this.getPathString()+" ";n.display=""}});u.Map.include(u.Browser.svg||!u.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var n=this._pathRoot=i.createElement("div");n.className="leaflet-vml-container";this._panes.overlayPane.appendChild(n);this.on("moveend",this._updatePathViewport);this._updatePathViewport()}}});u.Browser.canvas=function(){return!!i.createElement("canvas").getContext}();u.Path=u.Path.SVG&&!n.L_PREFER_CANVAS||!u.Browser.canvas?u.Path:u.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(n){return u.setOptions(this,n),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(n){n.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this);this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this));this._requestUpdate();this.fire("remove");this._map=null},_requestUpdate:function(){this._map&&!u.Path._updateRequest&&(u.Path._updateRequest=u.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){u.Path._updateRequest=null;this.fire("moveend")},_initElements:function(){this._map._initPathRoot();this._ctx=this._map._canvasCtx},_updateStyle:function(){var n=this.options;n.stroke&&(this._ctx.lineWidth=n.weight,this._ctx.strokeStyle=n.color);n.fill&&(this._ctx.fillStyle=n.fillColor||n.color);n.lineCap&&(this._ctx.lineCap=n.lineCap);n.lineJoin&&(this._ctx.lineJoin=n.lineJoin)},_drawPath:function(){var n,t,r,f,i,e;for(this._ctx.beginPath(),n=0,r=this._parts.length;n<r;n++){for(t=0,f=this._parts[n].length;t<f;t++)i=this._parts[n][t],e=(t===0?"move":"line")+"To",this._ctx[e](i.x,i.y);this instanceof u.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var n=this._ctx,t=this.options;this._drawPath();n.save();this._updateStyle();t.fill&&(n.globalAlpha=t.fillOpacity,n.fill(t.fillRule||"evenodd"));t.stroke&&(n.globalAlpha=t.opacity,n.stroke());n.restore()}},_initEvents:function(){if(this.options.clickable){this._map.on("mousemove",this._onMouseMove,this);this._map.on("click dblclick contextmenu",this._fireMouseEvent,this)}},_fireMouseEvent:function(n){this._containsPoint(n.layerPoint)&&this.fire(n.type,n)},_onMouseMove:function(n){this._map&&!this._map._animatingZoom&&(this._containsPoint(n.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",n)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",n)))}});u.Map.include(u.Path.SVG&&!n.L_PREFER_CANVAS||!u.Browser.canvas?{}:{_initPathRoot:function(){var n=this._pathRoot,t;if(!n){if(n=this._pathRoot=i.createElement("canvas"),n.style.position="absolute",t=this._canvasCtx=n.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(n),this.options.zoomAnimation){this._pathRoot.className="leaflet-zoom-animated";this.on("zoomanim",this._animatePathZoom);this.on("zoomend",this._endPathZoom)}this.on("moveend",this._updateCanvasViewport);this._updateCanvasViewport()}},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var i=this._pathViewport,n=i.min,r=i.max.subtract(n),t=this._pathRoot;u.DomUtil.setPosition(t,n);t.width=r.x;t.height=r.y;t.getContext("2d").translate(-n.x,-n.y)}}});u.LineUtil={simplify:function(n,t){if(!t||!n.length)return n.slice();var i=t*t;return n=this._reducePoints(n,i),this._simplifyDP(n,i)},pointToSegmentDistance:function(n,t,i){return Math.sqrt(this._sqClosestPointOnSegment(n,t,i,!0))},closestPointOnSegment:function(n,t,i){return this._sqClosestPointOnSegment(n,t,i)},_simplifyDP:function(n,t){var u=n.length,o=typeof Uint8Array!=r+""?Uint8Array:Array,f=new o(u),i,e;for(f[0]=f[u-1]=1,this._simplifyDPStep(n,f,t,0,u-1),e=[],i=0;i<u;i++)f[i]&&e.push(n[i]);return e},_simplifyDPStep:function(n,t,i,r,u){for(var o=0,f,s,e=r+1;e<=u-1;e++)s=this._sqClosestPointOnSegment(n[e],n[r],n[u],!0),s>o&&(f=e,o=s);o>i&&(t[f]=1,this._simplifyDPStep(n,t,i,r,f),this._simplifyDPStep(n,t,i,f,u))},_reducePoints:function(n,t){for(var r=[n[0]],i=1,u=0,f=n.length;i<f;i++)this._sqDist(n[i],n[u])>t&&(r.push(n[i]),u=i);return u<f-1&&r.push(n[f-1]),r},clipSegment:function(n,t,i,r){var u=r?this._lastCode:this._getBitCode(n,i),f=this._getBitCode(t,i),o,e,s;for(this._lastCode=f;;)if(u|f){if(u&f)return!1;o=u||f;e=this._getEdgeIntersection(n,t,o,i);s=this._getBitCode(e,i);o===u?(n=e,u=s):(t=e,f=s)}else return[n,t]},_getEdgeIntersection:function(n,t,i,r){var f=t.x-n.x,e=t.y-n.y,o=r.min,s=r.max;return i&8?new u.Point(n.x+f*(s.y-n.y)/e,s.y):i&4?new u.Point(n.x+f*(o.y-n.y)/e,o.y):i&2?new u.Point(s.x,n.y+e*(s.x-n.x)/f):i&1?new u.Point(o.x,n.y+e*(o.x-n.x)/f):void 0},_getBitCode:function(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},_sqDist:function(n,t){var i=t.x-n.x,r=t.y-n.y;return i*i+r*r},_sqClosestPointOnSegment:function(n,t,i,r){var o=t.x,s=t.y,f=i.x-o,e=i.y-s,c=f*f+e*e,h;return c>0&&(h=((n.x-o)*f+(n.y-s)*e)/c,h>1?(o=i.x,s=i.y):h>0&&(o+=f*h,s+=e*h)),f=n.x-o,e=n.y-s,r?f*f+e*e:new u.Point(o,s)}};u.Polyline=u.Path.extend({initialize:function(n,t){u.Path.prototype.initialize.call(this,t);this._latlngs=this._convertLatLngs(n)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var n=0,t=this._latlngs.length;n<t;n++)this._originalPoints[n]=this._map.latLngToLayerPoint(this._latlngs[n])},getPathString:function(){for(var n=0,i=this._parts.length,t="";n<i;n++)t+=this._getPathPartStr(this._parts[n]);return t},getLatLngs:function(){return this._latlngs},setLatLngs:function(n){return this._latlngs=this._convertLatLngs(n),this.redraw()},addLatLng:function(n){return this._latlngs.push(u.latLng(n)),this.redraw()},spliceLatLngs:function(){var n=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),n},closestLayerPoint:function(n){for(var f=Infinity,c=this._parts,e,o,i=null,r,t,l,s,h=0,a=c.length;h<a;h++)for(r=c[h],t=1,l=r.length;t<l;t++)e=r[t-1],o=r[t],s=u.LineUtil._sqClosestPointOnSegment(n,e,o,!0),s<f&&(f=s,i=u.LineUtil._sqClosestPointOnSegment(n,e,o));return i&&(i.distance=Math.sqrt(f)),i},getBounds:function(){return new u.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(n,t){for(var r=t?n:[],i=0,f=n.length;i<f;i++){if(u.Util.isArray(n[i])&&typeof n[i][0]!="number")return;r[i]=u.latLng(n[i])}return r},_initEvents:function(){u.Path.prototype._initEvents.call(this)},_getPathPartStr:function(n){for(var f=u.Path.VML,t=0,e=n.length,r="",i;t<e;t++)i=n[t],f&&i._round(),r+=(t?"L":"M")+i.x+" "+i.y;return r},_clipPoints:function(){var i=this._originalPoints,e=i.length,n,t,r;if(this.options.noClip){this._parts=[i];return}this._parts=[];var f=this._parts,o=this._map._pathViewport,s=u.LineUtil;for(n=0,t=0;n<e-1;n++)(r=s.clipSegment(i[n],i[n+1],o,n),r)&&(f[t]=f[t]||[],f[t].push(r[0]),(r[1]!==i[n+1]||n===e-2)&&(f[t].push(r[1]),t++))},_simplifyPoints:function(){for(var t=this._parts,i=u.LineUtil,n=0,r=t.length;n<r;n++)t[n]=i.simplify(t[n],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),u.Path.prototype._updatePath.call(this))}});u.polyline=function(n,t){return new u.Polyline(n,t)};u.PolyUtil={};u.PolyUtil.clipPolygon=function(n,t){for(var e,v=[1,4,2,8],a,c,o,s,f,i,h=u.LineUtil,r=0,l=n.length;r<l;r++)n[r]._code=h._getBitCode(n[r],t);for(c=0;c<4;c++){for(f=v[c],e=[],r=0,l=n.length,a=l-1;r<l;a=r++)o=n[r],s=n[a],o._code&f?s._code&f||(i=h._getEdgeIntersection(s,o,f,t),i._code=h._getBitCode(i,t),e.push(i)):(s._code&f&&(i=h._getEdgeIntersection(s,o,f,t),i._code=h._getBitCode(i,t),e.push(i)),e.push(o));n=e}return n};u.Polygon=u.Polyline.extend({options:{fill:!0},initialize:function(n,t){u.Polyline.prototype.initialize.call(this,n,t);this._initWithHoles(n)},_initWithHoles:function(n){var t,r,i;if(n&&u.Util.isArray(n[0])&&typeof n[0][0]!="number")for(this._latlngs=this._convertLatLngs(n[0]),this._holes=n.slice(1),t=0,r=this._holes.length;t<r;t++)i=this._holes[t]=this._convertLatLngs(this._holes[t]),i[0].equals(i[i.length-1])&&i.pop();n=this._latlngs;n.length>=2&&n[0].equals(n[n.length-1])&&n.pop()},projectLatlngs:function(){if(u.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes)for(var t,i,n=0,r=this._holes.length;n<r;n++)for(this._holePoints[n]=[],t=0,i=this._holes[n].length;t<i;t++)this._holePoints[n][t]=this._map.latLngToLayerPoint(this._holes[n][t])},setLatLngs:function(n){return n&&u.Util.isArray(n[0])&&typeof n[0][0]!="number"?(this._initWithHoles(n),this.redraw()):u.Polyline.prototype.setLatLngs.call(this,n)},_clipPoints:function(){var f=this._originalPoints,i=[],n,r,t;if(this._parts=[f].concat(this._holePoints),!this.options.noClip){for(n=0,r=this._parts.length;n<r;n++)t=u.PolyUtil.clipPolygon(this._parts[n],this._map._pathViewport),t.length&&i.push(t);this._parts=i}},_getPathPartStr:function(n){var t=u.Polyline.prototype._getPathPartStr.call(this,n);return t+(u.Browser.svg?"z":"x")}});u.polygon=function(n,t){return new u.Polygon(n,t)},function(){function n(n){return u.FeatureGroup.extend({initialize:function(n,t){this._layers={};this._options=t;this.setLatLngs(n)},setLatLngs:function(t){var i=0,r=t.length;for(this.eachLayer(function(n){i<r?n.setLatLngs(t[i++]):this.removeLayer(n)},this);i<r;)this.addLayer(new n(t[i++],this._options));return this},getLatLngs:function(){var n=[];return this.eachLayer(function(t){n.push(t.getLatLngs())}),n}})}u.MultiPolyline=n(u.Polyline);u.MultiPolygon=n(u.Polygon);u.multiPolyline=function(n,t){return new u.MultiPolyline(n,t)};u.multiPolygon=function(n,t){return new u.MultiPolygon(n,t)}}();u.Rectangle=u.Polygon.extend({initialize:function(n,t){u.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(n),t)},setBounds:function(n){this.setLatLngs(this._boundsToLatLngs(n))},_boundsToLatLngs:function(n){return n=u.latLngBounds(n),[n.getSouthWest(),n.getNorthWest(),n.getNorthEast(),n.getSouthEast()]}});u.rectangle=function(n,t){return new u.Rectangle(n,t)};u.Circle=u.Path.extend({initialize:function(n,t,i){u.Path.prototype.initialize.call(this,i);this._latlng=u.latLng(n);this._mRadius=t},options:{fill:!0},setLatLng:function(n){return this._latlng=u.latLng(n),this.redraw()},setRadius:function(n){return this._mRadius=n,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),n=this._latlng,i=this._map.latLngToLayerPoint([n.lat,n.lng-t]);this._point=this._map.latLngToLayerPoint(n);this._radius=Math.max(this._point.x-i.x,1)},getBounds:function(){var t=this._getLngRadius(),i=this._mRadius/40075017*360,n=this._latlng;return new u.LatLngBounds([n.lat-i,n.lng-t],[n.lat+i,n.lng+t])},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,n=this._radius;return this._checkIfEmpty()?"":u.Browser.svg?"M"+t.x+","+(t.y-n)+"A"+n+","+n+",0,1,1,"+(t.x-.1)+","+(t.y-n)+" z":(t._round(),n=Math.round(n),"AL "+t.x+","+t.y+" "+n+","+n+" 0,23592600")},getRadius:function(){return this._mRadius},_getLatRadius:function(){return this._mRadius/40075017*360},_getLngRadius:function(){return this._getLatRadius()/Math.cos(u.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var n=this._map._pathViewport,t=this._radius,i=this._point;return i.x-t>n.max.x||i.y-t>n.max.y||i.x+t<n.min.x||i.y+t<n.min.y}});u.circle=function(n,t,i){return new u.Circle(n,t,i)};u.CircleMarker=u.Circle.extend({options:{radius:10,weight:2},initialize:function(n,t){u.Circle.prototype.initialize.call(this,n,null,t);this._radius=this.options.radius},projectLatlngs:function(){this._point=this._map.latLngToLayerPoint(this._latlng)},_updateStyle:function(){u.Circle.prototype._updateStyle.call(this);this.setRadius(this.options.radius)},setLatLng:function(n){return u.Circle.prototype.setLatLng.call(this,n),this._popup&&this._popup._isOpen&&this._popup.setLatLng(n),this},setRadius:function(n){return this.options.radius=this._radius=n,this.redraw()},getRadius:function(){return this._radius}});u.circleMarker=function(n,t){return new u.CircleMarker(n,t)};u.Polyline.include(u.Path.CANVAS?{_containsPoint:function(n,t){var r,i,e,s,o,h,f,c=this.options.weight/2;for(u.Browser.touch&&(c+=10),r=0,s=this._parts.length;r<s;r++)for(f=this._parts[r],i=0,o=f.length,e=o-1;i<o;e=i++)if((t||i!==0)&&(h=u.LineUtil.pointToSegmentDistance(n,f[e],f[i]),h<=c))return!0;return!1}}:{});u.Polygon.include(u.Path.CANVAS?{_containsPoint:function(n){var o=!1,i,t,r,f,e,s,c,h;if(u.Polyline.prototype._containsPoint.call(this,n,!0))return!0;for(f=0,c=this._parts.length;f<c;f++)for(i=this._parts[f],e=0,h=i.length,s=h-1;e<h;s=e++)t=i[e],r=i[s],t.y>n.y!=r.y>n.y&&n.x<(r.x-t.x)*(n.y-t.y)/(r.y-t.y)+t.x&&(o=!o);return o}}:{});u.Circle.include(u.Path.CANVAS?{_drawPath:function(){var n=this._point;this._ctx.beginPath();this._ctx.arc(n.x,n.y,this._radius,0,Math.PI*2,!1)},_containsPoint:function(n){var t=this._point,i=this.options.stroke?this.options.weight/2:0;return n.distanceTo(t)<=this._radius+i}}:{});u.CircleMarker.include(u.Path.CANVAS?{_updateStyle:function(){u.Path.prototype._updateStyle.call(this)}}:{});u.GeoJSON=u.FeatureGroup.extend({initialize:function(n,t){u.setOptions(this,t);this._layers={};n&&this.addData(n)},addData:function(n){var e=u.Util.isArray(n)?n:n.features,r,o,f,t,i;if(e){for(r=0,o=e.length;r<o;r++)f=e[r],(f.geometries||f.geometry||f.features||f.coordinates)&&this.addData(e[r]);return this}if(t=this.options,!t.filter||t.filter(n)){if(i=u.GeoJSON.geometryToLayer(n,t.pointToLayer,t.coordsToLatLng,t),i.feature=u.GeoJSON.asFeature(n),i.defaultOptions=i.options,this.resetStyle(i),t.onEachFeature)t.onEachFeature(n,i);return this.addLayer(i)}},resetStyle:function(n){var t=this.options.style;t&&(u.Util.extend(n.options,n.defaultOptions),this._setLayerStyle(n,t))},setStyle:function(n){this.eachLayer(function(t){this._setLayerStyle(t,n)},this)},_setLayerStyle:function(n,t){typeof t=="function"&&(t=t(n.feature));n.setStyle&&n.setStyle(t)}});u.extend(u.GeoJSON,{geometryToLayer:function(n,t,i,r){var h=n.type==="Feature"?n.geometry:n,f=h.coordinates,c=[],s,e,o,l;i=i||this.coordsToLatLng;switch(h.type){case"Point":return s=i(f),t?t(n,s):new u.Marker(s);case"MultiPoint":for(o=0,l=f.length;o<l;o++)s=i(f[o]),c.push(t?t(n,s):new u.Marker(s));return new u.FeatureGroup(c);case"LineString":return e=this.coordsToLatLngs(f,0,i),new u.Polyline(e,r);case"Polygon":if(f.length===2&&!f[1].length)throw new Error("Invalid GeoJSON object.");return e=this.coordsToLatLngs(f,1,i),new u.Polygon(e,r);case"MultiLineString":return e=this.coordsToLatLngs(f,1,i),new u.MultiPolyline(e,r);case"MultiPolygon":return e=this.coordsToLatLngs(f,2,i),new u.MultiPolygon(e,r);case"GeometryCollection":for(o=0,l=h.geometries.length;o<l;o++)c.push(this.geometryToLayer({geometry:h.geometries[o],type:"Feature",properties:n.properties},t,i,r));return new u.FeatureGroup(c);default:throw new Error("Invalid GeoJSON object.");}},coordsToLatLng:function(n){return new u.LatLng(n[1],n[0],n[2])},coordsToLatLngs:function(n,t,i){for(var u,f=[],r=0,e=n.length;r<e;r++)u=t?this.coordsToLatLngs(n[r],t-1,i):(i||this.coordsToLatLng)(n[r]),f.push(u);return f},latLngToCoords:function(n){var t=[n.lng,n.lat];return n.alt!==r&&t.push(n.alt),t},latLngsToCoords:function(n){for(var i=[],t=0,r=n.length;t<r;t++)i.push(u.GeoJSON.latLngToCoords(n[t]));return i},getFeature:function(n,t){return n.feature?u.extend({},n.feature,{geometry:t}):u.GeoJSON.asFeature(t)},asFeature:function(n){return n.type==="Feature"?n:{type:"Feature",properties:{},geometry:n}}});e={toGeoJSON:function(){return u.GeoJSON.getFeature(this,{type:"Point",coordinates:u.GeoJSON.latLngToCoords(this.getLatLng())})}};u.Marker.include(e);u.Circle.include(e);u.CircleMarker.include(e);u.Polyline.include({toGeoJSON:function(){return u.GeoJSON.getFeature(this,{type:"LineString",coordinates:u.GeoJSON.latLngsToCoords(this.getLatLngs())})}});u.Polygon.include({toGeoJSON:function(){var n=[u.GeoJSON.latLngsToCoords(this.getLatLngs())],t,r,i;if(n[0].push(n[0][0]),this._holes)for(t=0,r=this._holes.length;t<r;t++)i=u.GeoJSON.latLngsToCoords(this._holes[t]),i.push(i[0]),n.push(i);return u.GeoJSON.getFeature(this,{type:"Polygon",coordinates:n})}}),function(){function n(n){return function(){var t=[];return this.eachLayer(function(n){t.push(n.toGeoJSON().geometry.coordinates)}),u.GeoJSON.getFeature(this,{type:n,coordinates:t})}}u.MultiPolyline.include({toGeoJSON:n("MultiLineString")});u.MultiPolygon.include({toGeoJSON:n("MultiPolygon")});u.LayerGroup.include({toGeoJSON:function(){var t=this.feature&&this.feature.geometry,i=[],r,f;return t&&t.type==="MultiPoint"?n("MultiPoint").call(this):(f=t&&t.type==="GeometryCollection",this.eachLayer(function(n){n.toGeoJSON&&(r=n.toGeoJSON(),i.push(f?r.geometry:u.GeoJSON.asFeature(r)))}),f)?u.GeoJSON.getFeature(this,{geometries:i,type:"GeometryCollection"}):{type:"FeatureCollection",features:i}}})}();u.geoJson=function(n,t){return new u.GeoJSON(n,t)};u.DomEvent={addListener:function(n,t,i,r){var o=u.stamp(i),s="_leaflet_"+t+o,f,e,h;return n[s]?this:(f=function(t){return i.call(r||n,t||u.DomEvent._getEvent())},u.Browser.pointer&&t.indexOf("touch")===0)?this.addPointerListener(n,t,f,o):(u.Browser.touch&&t==="dblclick"&&this.addDoubleTapListener&&this.addDoubleTapListener(n,f,o),"addEventListener"in n?t==="mousewheel"?(n.addEventListener("DOMMouseScroll",f,!1),n.addEventListener(t,f,!1)):t==="mouseenter"||t==="mouseleave"?(e=f,h=t==="mouseenter"?"mouseover":"mouseout",f=function(t){if(u.DomEvent._checkMouse(n,t))return e(t)},n.addEventListener(h,f,!1)):t==="click"&&u.Browser.android?(e=f,f=function(n){return u.DomEvent._filterClick(n,e)},n.addEventListener(t,f,!1)):n.addEventListener(t,f,!1):"attachEvent"in n&&n.attachEvent("on"+t,f),n[s]=f,this)},removeListener:function(n,t,i){var f=u.stamp(i),e="_leaflet_"+t+f,r=n[e];return r?(u.Browser.pointer&&t.indexOf("touch")===0?this.removePointerListener(n,t,f):u.Browser.touch&&t==="dblclick"&&this.removeDoubleTapListener?this.removeDoubleTapListener(n,f):"removeEventListener"in n?t==="mousewheel"?(n.removeEventListener("DOMMouseScroll",r,!1),n.removeEventListener(t,r,!1)):t==="mouseenter"||t==="mouseleave"?n.removeEventListener(t==="mouseenter"?"mouseover":"mouseout",r,!1):n.removeEventListener(t,r,!1):"detachEvent"in n&&n.detachEvent("on"+t,r),n[e]=null,this):this},stopPropagation:function(n){return n.stopPropagation?n.stopPropagation():n.cancelBubble=!0,u.DomEvent._skipped(n),this},disableScrollPropagation:function(n){var t=u.DomEvent.stopPropagation;return u.DomEvent.on(n,"mousewheel",t).on(n,"MozMousePixelScroll",t)},disableClickPropagation:function(n){for(var i=u.DomEvent.stopPropagation,t=u.Draggable.START.length-1;t>=0;t--)u.DomEvent.on(n,u.Draggable.START[t],i);return u.DomEvent.on(n,"click",u.DomEvent._fakeStop).on(n,"dblclick",i)},preventDefault:function(n){return n.preventDefault?n.preventDefault():n.returnValue=!1,this},stop:function(n){return u.DomEvent.preventDefault(n).stopPropagation(n)},getMousePosition:function(n,t){if(!t)return new u.Point(n.clientX,n.clientY);var i=t.getBoundingClientRect();return new u.Point(n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop)},getWheelDelta:function(n){var t=0;return n.wheelDelta&&(t=n.wheelDelta/120),n.detail&&(t=-n.detail/3),t},_skipEvents:{},_fakeStop:function(n){u.DomEvent._skipEvents[n.type]=!0},_skipped:function(n){var t=this._skipEvents[n.type];return this._skipEvents[n.type]=!1,t},_checkMouse:function(n,t){var i=t.relatedTarget;if(!i)return!0;try{while(i&&i!==n)i=i.parentNode}catch(r){return!1}return i!==n},_getEvent:function(){var t=n.event,i;if(!t)for(i=arguments.callee.caller;i;){if(t=i.arguments[0],t&&n.Event===t.constructor)break;i=i.caller}return t},_filterClick:function(n,t){var r=n.timeStamp||n.originalEvent.timeStamp,i=u.DomEvent._lastClick&&r-u.DomEvent._lastClick;if(i&&i>100&&i<500||n.target._simulatedClick&&!n._simulated){u.DomEvent.stop(n);return}return u.DomEvent._lastClick=r,t(n)}};u.DomEvent.on=u.DomEvent.addListener;u.DomEvent.off=u.DomEvent.removeListener;u.Draggable=u.Class.extend({includes:u.Mixin.Events,statics:{START:u.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"}},initialize:function(n,t){this._element=n;this._dragStartTarget=t||n},enable:function(){if(!this._enabled){for(var n=u.Draggable.START.length-1;n>=0;n--)u.DomEvent.on(this._dragStartTarget,u.Draggable.START[n],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var n=u.Draggable.START.length-1;n>=0;n--)u.DomEvent.off(this._dragStartTarget,u.Draggable.START[n],this._onDown,this);this._enabled=!1;this._moved=!1}},_onDown:function(n){if((this._moved=!1,!n.shiftKey&&(n.which===1||n.button===1||n.touches))&&(u.DomEvent.stopPropagation(n),!u.Draggable._disabled)&&(u.DomUtil.disableImageDrag(),u.DomUtil.disableTextSelection(),!this._moving)){var t=n.touches?n.touches[0]:n;this._startPoint=new u.Point(t.clientX,t.clientY);this._startPos=this._newPos=u.DomUtil.getPosition(this._element);u.DomEvent.on(i,u.Draggable.MOVE[n.type],this._onMove,this).on(i,u.Draggable.END[n.type],this._onUp,this)}},_onMove:function(n){if(n.touches&&n.touches.length>1){this._moved=!0;return}var r=n.touches&&n.touches.length===1?n.touches[0]:n,f=new u.Point(r.clientX,r.clientY),t=f.subtract(this._startPoint);(t.x||t.y)&&(u.Browser.touch&&Math.abs(t.x)+Math.abs(t.y)<3||(u.DomEvent.preventDefault(n),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=u.DomUtil.getPosition(this._element).subtract(t),u.DomUtil.addClass(i.body,"leaflet-dragging"),this._lastTarget=n.target||n.srcElement,u.DomUtil.addClass(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(t),this._moving=!0,u.Util.cancelAnimFrame(this._animRequest),this._animRequest=u.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget)))},_updatePosition:function(){this.fire("predrag");u.DomUtil.setPosition(this._element,this._newPos);this.fire("drag")},_onUp:function(){u.DomUtil.removeClass(i.body,"leaflet-dragging");this._lastTarget&&(u.DomUtil.removeClass(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null);for(var n in u.Draggable.MOVE)u.DomEvent.off(i,u.Draggable.MOVE[n],this._onMove).off(i,u.Draggable.END[n],this._onUp);u.DomUtil.enableImageDrag();u.DomUtil.enableTextSelection();this._moved&&this._moving&&(u.Util.cancelAnimFrame(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)}));this._moving=!1}});u.Handler=u.Class.extend({initialize:function(n){this._map=n},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}});u.Map.mergeOptions({dragging:!0,inertia:!u.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:Infinity,inertiaThreshold:u.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1});u.Map.Drag=u.Handler.extend({addHooks:function(){if(!this._draggable){var n=this._map;this._draggable=new u.Draggable(n._mapPane,n._container);this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this);if(n.options.worldCopyJump){this._draggable.on("predrag",this._onPreDrag,this);n.on("viewreset",this._onViewReset,this);n.whenReady(this._onViewReset,this)}}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var n=this._map;n._panAnim&&n._panAnim.stop();n.fire("movestart").fire("dragstart");n.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var n=this._lastTime=+new Date,t=this._lastPos=this._draggable._newPos;this._positions.push(t);this._times.push(n);n-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var n=this._map.getSize()._divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(n).x;this._worldWidth=this._map.project([0,180]).x},_onPreDrag: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._newPos.x=e},_onDragEnd:function(n){var t=this._map,i=t.options,e=+new Date-this._lastTime,l=!i.inertia||e>i.inertiaThreshold||!this._positions[0];if(t.fire("dragend",n),l)t.fire("moveend");else{var a=this._lastPos.subtract(this._positions[0]),v=(this._lastTime+e-this._times[0])/1e3,f=i.easeLinearity,o=a.multiplyBy(f/v),s=o.distanceTo([0,0]),h=Math.min(i.inertiaMaxSpeed,s),y=o.multiplyBy(h/s),c=h/(i.inertiaDeceleration*f),r=y.multiplyBy(-c/2).round();r.x&&r.y?(r=t._limitOffset(r,t.options.maxBounds),u.Util.requestAnimFrame(function(){t.panBy(r,{duration:c,easeLinearity:f,noMoveStart:!0})})):t.fire("moveend")}}});u.Map.addInitHook("addHandler","dragging",u.Map.Drag);u.Map.mergeOptions({doubleClickZoom:!0});u.Map.DoubleClickZoom=u.Handler.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()+(n.originalEvent.shiftKey?-1:1);t.options.doubleClickZoom==="center"?t.setZoom(i):t.setZoomAround(n.containerPoint,i)}});u.Map.addInitHook("addHandler","doubleClickZoom",u.Map.DoubleClickZoom);u.Map.mergeOptions({scrollWheelZoom:!0});u.Map.ScrollWheelZoom=u.Handler.extend({addHooks:function(){u.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this);u.DomEvent.on(this._map._container,"MozMousePixelScroll",u.DomEvent.preventDefault);this._delta=0},removeHooks:function(){u.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll);u.DomEvent.off(this._map._container,"MozMousePixelScroll",u.DomEvent.preventDefault)},_onWheelScroll:function(n){var i=u.DomEvent.getWheelDelta(n),t;this._delta+=i;this._lastMousePos=this._map.mouseEventToContainerPoint(n);this._startTime||(this._startTime=+new Date);t=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer);this._timer=setTimeout(u.bind(this._performZoom,this),t);u.DomEvent.preventDefault(n);u.DomEvent.stopPropagation(n)},_performZoom:function(){var t=this._map,n=this._delta,i=t.getZoom();(n=n>0?Math.ceil(n):Math.floor(n),n=Math.max(Math.min(n,4),-4),n=t._limitZoom(i+n)-i,this._delta=0,this._startTime=null,n)&&(t.options.scrollWheelZoom==="center"?t.setZoom(i+n):t.setZoomAround(this._lastMousePos,i+n))}});u.Map.addInitHook("addHandler","scrollWheelZoom",u.Map.ScrollWheelZoom);u.extend(u.DomEvent,{_touchstart:u.Browser.msPointer?"MSPointerDown":u.Browser.pointer?"pointerdown":"touchstart",_touchend:u.Browser.msPointer?"MSPointerUp":u.Browser.pointer?"pointerup":"touchend",addDoubleTapListener:function(n,t,r){function c(n){var i,t,r;(u.Browser.pointer?(e.push(n.pointerId),i=e.length):i=n.touches.length,i>1)||(t=Date.now(),r=t-(s||t),f=n.touches?n.touches[0]:n,l=r>0&&r<=p,s=t)}function o(n){var r,o,i,h;if(u.Browser.pointer){if(r=e.indexOf(n.pointerId),r===-1)return;e.splice(r,1)}if(l){if(u.Browser.pointer){o={};for(h in f)i=f[h],o[h]=typeof i=="function"?i.bind(f):i;f=o}f.type="dblclick";t(f);s=null}}var s,l=!1,p=250,f,a="_leaflet_",v=this._touchstart,y=this._touchend,e=[],h;return n[a+v+r]=c,n[a+y+r]=o,h=u.Browser.pointer?i.documentElement:n,n.addEventListener(v,c,!1),h.addEventListener(y,o,!1),u.Browser.pointer&&h.addEventListener(u.DomEvent.POINTER_CANCEL,o,!1),this},removeDoubleTapListener:function(n,t){var r="_leaflet_";return n.removeEventListener(this._touchstart,n[r+this._touchstart+t],!1),(u.Browser.pointer?i.documentElement:n).removeEventListener(this._touchend,n[r+this._touchend+t],!1),u.Browser.pointer&&i.documentElement.removeEventListener(u.DomEvent.POINTER_CANCEL,n[r+this._touchend+t],!1),this}});u.extend(u.DomEvent,{POINTER_DOWN:u.Browser.msPointer?"MSPointerDown":"pointerdown",POINTER_MOVE:u.Browser.msPointer?"MSPointerMove":"pointermove",POINTER_UP:u.Browser.msPointer?"MSPointerUp":"pointerup",POINTER_CANCEL:u.Browser.msPointer?"MSPointerCancel":"pointercancel",_pointers:[],_pointerDocumentListener:!1,addPointerListener:function(n,t,i,r){switch(t){case"touchstart":return this.addPointerListenerStart(n,t,i,r);case"touchend":return this.addPointerListenerEnd(n,t,i,r);case"touchmove":return this.addPointerListenerMove(n,t,i,r);default:throw"Unknown touch event type";}},addPointerListenerStart:function(n,t,r,f){var e=this._pointers,s=function(n){var i,t;for(n.pointerType!=="mouse"&&n.pointerType!==n.MSPOINTER_TYPE_MOUSE&&u.DomEvent.preventDefault(n),i=!1,t=0;t<e.length;t++)if(e[t].pointerId===n.pointerId){i=!0;break}i||e.push(n);n.touches=e.slice();n.changedTouches=[n];r(n)},o;return n["_leaflet_touchstart"+f]=s,n.addEventListener(this.POINTER_DOWN,s,!1),this._pointerDocumentListener||(o=function(n){for(var t=0;t<e.length;t++)if(e[t].pointerId===n.pointerId){e.splice(t,1);break}},i.documentElement.addEventListener(this.POINTER_UP,o,!1),i.documentElement.addEventListener(this.POINTER_CANCEL,o,!1),this._pointerDocumentListener=!0),this},addPointerListenerMove:function(n,t,i,r){function f(n){if(n.pointerType!==n.MSPOINTER_TYPE_MOUSE&&n.pointerType!=="mouse"||n.buttons!==0){for(var t=0;t<u.length;t++)if(u[t].pointerId===n.pointerId){u[t]=n;break}n.touches=u.slice();n.changedTouches=[n];i(n)}}var u=this._pointers;return n["_leaflet_touchmove"+r]=f,n.addEventListener(this.POINTER_MOVE,f,!1),this},addPointerListenerEnd:function(n,t,i,r){var u=this._pointers,f=function(n){for(var t=0;t<u.length;t++)if(u[t].pointerId===n.pointerId){u.splice(t,1);break}n.touches=u.slice();n.changedTouches=[n];i(n)};return n["_leaflet_touchend"+r]=f,n.addEventListener(this.POINTER_UP,f,!1),n.addEventListener(this.POINTER_CANCEL,f,!1),this},removePointerListener:function(n,t,i){var r=n["_leaflet_"+t+i];switch(t){case"touchstart":n.removeEventListener(this.POINTER_DOWN,r,!1);break;case"touchmove":n.removeEventListener(this.POINTER_MOVE,r,!1);break;case"touchend":n.removeEventListener(this.POINTER_UP,r,!1);n.removeEventListener(this.POINTER_CANCEL,r,!1)}return this}});u.Map.mergeOptions({touchZoom:u.Browser.touch&&!u.Browser.android23,bounceAtZoomLimits:!0});u.Map.TouchZoom=u.Handler.extend({addHooks:function(){u.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){u.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(n){var t=this._map;if(n.touches&&n.touches.length===2&&!t._animatingZoom&&!this._zooming){var r=t.mouseEventToLayerPoint(n.touches[0]),f=t.mouseEventToLayerPoint(n.touches[1]),e=t._getCenterLayerPoint();this._startCenter=r.add(f)._divideBy(2);this._startDist=r.distanceTo(f);this._moved=!1;this._zooming=!0;this._centerOffset=e.subtract(this._startCenter);t._panAnim&&t._panAnim.stop();u.DomEvent.on(i,"touchmove",this._onTouchMove,this).on(i,"touchend",this._onTouchEnd,this);u.DomEvent.preventDefault(n)}},_onTouchMove:function(n){var t=this._map,i,r;n.touches&&n.touches.length===2&&this._zooming&&(i=t.mouseEventToLayerPoint(n.touches[0]),r=t.mouseEventToLayerPoint(n.touches[1]),this._scale=i.distanceTo(r)/this._startDist,this._delta=i._add(r)._divideBy(2)._subtract(this._startCenter),this._scale!==1)&&(!t.options.bounceAtZoomLimits&&(t.getZoom()===t.getMinZoom()&&this._scale<1||t.getZoom()===t.getMaxZoom()&&this._scale>1)||(this._moved||(u.DomUtil.addClass(t._mapPane,"leaflet-touching"),t.fire("movestart").fire("zoomstart"),this._moved=!0),u.Util.cancelAnimFrame(this._animRequest),this._animRequest=u.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),u.DomEvent.preventDefault(n)))},_updateOnMove:function(){var n=this._map,t=this._getScaleOrigin(),i=n.layerPointToLatLng(t),r=n.getScaleZoom(this._scale);n._animateZoom(i,r,this._startCenter,this._scale,this._delta,!1,!0)},_onTouchEnd:function(){var n;if(!this._moved||!this._zooming){this._zooming=!1;return}n=this._map;this._zooming=!1;u.DomUtil.removeClass(n._mapPane,"leaflet-touching");u.Util.cancelAnimFrame(this._animRequest);u.DomEvent.off(i,"touchmove",this._onTouchMove).off(i,"touchend",this._onTouchEnd);var r=this._getScaleOrigin(),o=n.layerPointToLatLng(r),f=n.getZoom(),t=n.getScaleZoom(this._scale)-f,s=t>0?Math.ceil(t):Math.floor(t),e=n._limitZoom(f+s),h=n.getZoomScale(e)/this._scale;n._animateZoom(o,e,r,h)},_getScaleOrigin:function(){var n=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(n)}});u.Map.addInitHook("addHandler","touchZoom",u.Map.TouchZoom);u.Map.mergeOptions({tap:!0,tapTolerance:15});u.Map.Tap=u.Handler.extend({addHooks:function(){u.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){u.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(n){if(n.touches){if(u.DomEvent.preventDefault(n),this._fireClick=!0,n.touches.length>1){this._fireClick=!1;clearTimeout(this._holdTimeout);return}var t=n.touches[0],r=t.target;this._startPos=this._newPos=new u.Point(t.clientX,t.clientY);r.tagName&&r.tagName.toLowerCase()==="a"&&u.DomUtil.addClass(r,"leaflet-active");this._holdTimeout=setTimeout(u.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",t))},this),1e3);u.DomEvent.on(i,"touchmove",this._onMove,this).on(i,"touchend",this._onUp,this)}},_onUp:function(n){if(clearTimeout(this._holdTimeout),u.DomEvent.off(i,"touchmove",this._onMove,this).off(i,"touchend",this._onUp,this),this._fireClick&&n&&n.changedTouches){var r=n.changedTouches[0],t=r.target;t&&t.tagName&&t.tagName.toLowerCase()==="a"&&u.DomUtil.removeClass(t,"leaflet-active");this._isTapValid()&&this._simulateEvent("click",r)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(n){var t=n.touches[0];this._newPos=new u.Point(t.clientX,t.clientY)},_simulateEvent:function(t,r){var u=i.createEvent("MouseEvents");u._simulated=!0;r.target._simulatedClick=!0;u.initMouseEvent(t,!0,!0,n,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null);r.target.dispatchEvent(u)}});u.Browser.touch&&!u.Browser.pointer&&u.Map.addInitHook("addHandler","tap",u.Map.Tap);u.Map.mergeOptions({boxZoom:!0});u.Map.BoxZoom=u.Handler.extend({initialize:function(n){this._map=n;this._container=n._container;this._pane=n._panes.overlayPane;this._moved=!1},addHooks:function(){u.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){u.DomEvent.off(this._container,"mousedown",this._onMouseDown);this._moved=!1},moved:function(){return this._moved},_onMouseDown:function(n){if(this._moved=!1,!n.shiftKey||n.which!==1&&n.button!==1)return!1;u.DomUtil.disableTextSelection();u.DomUtil.disableImageDrag();this._startLayerPoint=this._map.mouseEventToLayerPoint(n);u.DomEvent.on(i,"mousemove",this._onMouseMove,this).on(i,"mouseup",this._onMouseUp,this).on(i,"keydown",this._onKeyDown,this)},_onMouseMove:function(n){this._moved||(this._box=u.DomUtil.create("div","leaflet-zoom-box",this._pane),u.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",this._map.fire("boxzoomstart"));var t=this._startLayerPoint,i=this._box,r=this._map.mouseEventToLayerPoint(n),f=r.subtract(t),e=new u.Point(Math.min(r.x,t.x),Math.min(r.y,t.y));u.DomUtil.setPosition(i,e);this._moved=!0;i.style.width=Math.max(0,Math.abs(f.x)-4)+"px";i.style.height=Math.max(0,Math.abs(f.y)-4)+"px"},_finish:function(){this._moved&&(this._pane.removeChild(this._box),this._container.style.cursor="");u.DomUtil.enableTextSelection();u.DomUtil.enableImageDrag();u.DomEvent.off(i,"mousemove",this._onMouseMove).off(i,"mouseup",this._onMouseUp).off(i,"keydown",this._onKeyDown)},_onMouseUp:function(n){var t,i,r;(this._finish(),t=this._map,i=t.mouseEventToLayerPoint(n),this._startLayerPoint.equals(i))||(r=new u.LatLngBounds(t.layerPointToLatLng(this._startLayerPoint),t.layerPointToLatLng(i)),t.fitBounds(r),t.fire("boxzoomend",{boxZoomBounds:r}))},_onKeyDown:function(n){n.keyCode===27&&this._finish()}});u.Map.addInitHook("addHandler","boxZoom",u.Map.BoxZoom);u.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1});u.Map.Keyboard=u.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,173]},initialize:function(n){this._map=n;this._setPanOffset(n.options.keyboardPanOffset);this._setZoomOffset(n.options.keyboardZoomOffset)},addHooks:function(){var n=this._map._container;n.tabIndex===-1&&(n.tabIndex="0");u.DomEvent.on(n,"focus",this._onFocus,this).on(n,"blur",this._onBlur,this).on(n,"mousedown",this._onMouseDown,this);this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var n=this._map._container;u.DomEvent.off(n,"focus",this._onFocus,this).off(n,"blur",this._onBlur,this).off(n,"mousedown",this._onMouseDown,this);this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var t=i.body,r=i.documentElement,u=t.scrollTop||r.scrollTop,f=t.scrollLeft||r.scrollLeft;this._map._container.focus();n.scrollTo(f,u)}},_onFocus:function(){this._focused=!0;this._map.fire("focus")},_onBlur:function(){this._focused=!1;this._map.fire("blur")},_setPanOffset: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]},_setZoomOffset: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(){u.DomEvent.on(i,"keydown",this._onKeyDown,this)},_removeHooks:function(){u.DomEvent.off(i,"keydown",this._onKeyDown,this)},_onKeyDown:function(n){var i=n.keyCode,t=this._map;if(i in this._panKeys){if(t._panAnim&&t._panAnim._inProgress)return;t.panBy(this._panKeys[i]);t.options.maxBounds&&t.panInsideBounds(t.options.maxBounds)}else if(i in this._zoomKeys)t.setZoom(t.getZoom()+this._zoomKeys[i]);else return;u.DomEvent.stop(n)}});u.Map.addInitHook("addHandler","keyboard",u.Map.Keyboard);u.Handler.MarkerDrag=u.Handler.extend({initialize:function(n){this._marker=n},addHooks:function(){var n=this._marker._icon;this._draggable||(this._draggable=new u.Draggable(n,n));this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this);this._draggable.enable();u.DomUtil.addClass(this._marker._icon,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this);this._draggable.disable();u.DomUtil.removeClass(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var n=this._marker,t=n._shadow,i=u.DomUtil.getPosition(n._icon),r=n._map.layerPointToLatLng(i);t&&u.DomUtil.setPosition(t,i);n._latlng=r;n.fire("move",{latlng:r}).fire("drag")},_onDragEnd:function(n){this._marker.fire("moveend").fire("dragend",n)}});u.Control=u.Class.extend({options:{position:"topright"},initialize:function(n){u.setOptions(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._map=n;var t=this._container=this.onAdd(n),r=this.getPosition(),i=n._controlCorners[r];return u.DomUtil.addClass(t,"leaflet-control"),r.indexOf("bottom")!==-1?i.insertBefore(t,i.firstChild):i.appendChild(t),this},removeFrom:function(n){var t=this.getPosition(),i=n._controlCorners[t];if(i.removeChild(this._container),this._map=null,this.onRemove)this.onRemove(n);return this},_refocusOnMap:function(){this._map&&this._map.getContainer().focus()}});u.control=function(n){return new u.Control(n)};u.Map.include({addControl:function(n){return n.addTo(this),this},removeControl:function(n){return n.removeFrom(this),this},_initControlPos:function(){function n(n,f){var e=t+n+" "+t+f;i[n+f]=u.DomUtil.create("div",e,r)}var i=this._controlCorners={},t="leaflet-",r=this._controlContainer=u.DomUtil.create("div",t+"control-container",this._container);n("top","left");n("top","right");n("bottom","left");n("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}});u.Control.Zoom=u.Control.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"-",zoomOutTitle:"Zoom out"},onAdd:function(n){var t="leaflet-control-zoom",i=u.DomUtil.create("div",t+" leaflet-bar");this._map=n;this._zoomInButton=this._createButton(this.options.zoomInText,this.options.zoomInTitle,t+"-in",i,this._zoomIn,this);this._zoomOutButton=this._createButton(this.options.zoomOutText,this.options.zoomOutTitle,t+"-out",i,this._zoomOut,this);this._updateDisabled();n.on("zoomend zoomlevelschange",this._updateDisabled,this);return i},onRemove:function(n){n.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(n){this._map.zoomIn(n.shiftKey?3:1)},_zoomOut:function(n){this._map.zoomOut(n.shiftKey?3:1)},_createButton:function(n,t,i,r,f,e){var o=u.DomUtil.create("a",i,r),s;o.innerHTML=n;o.href="#";o.title=t;s=u.DomEvent.stopPropagation;u.DomEvent.on(o,"click",s).on(o,"mousedown",s).on(o,"dblclick",s).on(o,"click",u.DomEvent.preventDefault).on(o,"click",f,e).on(o,"click",this._refocusOnMap,e);return o},_updateDisabled:function(){var n=this._map,t="leaflet-disabled";u.DomUtil.removeClass(this._zoomInButton,t);u.DomUtil.removeClass(this._zoomOutButton,t);n._zoom===n.getMinZoom()&&u.DomUtil.addClass(this._zoomOutButton,t);n._zoom===n.getMaxZoom()&&u.DomUtil.addClass(this._zoomInButton,t)}});u.Map.mergeOptions({zoomControl:!0});u.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new u.Control.Zoom,this.addControl(this.zoomControl))});u.control.zoom=function(n){return new u.Control.Zoom(n)};u.Control.Attribution=u.Control.extend({options:{position:"bottomright",prefix:'<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet<\/a>'},initialize:function(n){u.setOptions(this,n);this._attributions={}},onAdd:function(n){this._container=u.DomUtil.create("div","leaflet-control-attribution");u.DomEvent.disableClickPropagation(this._container);for(var t in n._layers)n._layers[t].getAttribution&&this.addAttribution(n._layers[t].getAttribution());n.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this);return this._update(),this._container},onRemove:function(n){n.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(n){return this.options.prefix=n,this._update(),this},addAttribution:function(n){if(n)return this._attributions[n]||(this._attributions[n]=0),this._attributions[n]++,this._update(),this},removeAttribution:function(n){if(n)return this._attributions[n]&&(this._attributions[n]--,this._update()),this},_update:function(){var n,i,t;if(this._map){n=[];for(i in this._attributions)this._attributions[i]&&n.push(i);t=[];this.options.prefix&&t.push(this.options.prefix);n.length&&t.push(n.join(", "));this._container.innerHTML=t.join(" | ")}},_onLayerAdd:function(n){n.layer.getAttribution&&this.addAttribution(n.layer.getAttribution())},_onLayerRemove:function(n){n.layer.getAttribution&&this.removeAttribution(n.layer.getAttribution())}});u.Map.mergeOptions({attributionControl:!0});u.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new u.Control.Attribution).addTo(this))});u.control.attribution=function(n){return new u.Control.Attribution(n)};u.Control.Scale=u.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(n){this._map=n;var t="leaflet-control-scale",i=u.DomUtil.create("div",t),r=this.options;this._addScales(r,t,i);n.on(r.updateWhenIdle?"moveend":"move",this._update,this);return n.whenReady(this._update,this),i},onRemove:function(n){n.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(n,t,i){n.metric&&(this._mScale=u.DomUtil.create("div",t+"-line",i));n.imperial&&(this._iScale=u.DomUtil.create("div",t+"-line",i))},_update:function(){var n=this._map.getBounds(),u=n.getCenter().lat,f=6378137*Math.PI*Math.cos(u*Math.PI/180),e=f*(n.getNorthEast().lng-n.getSouthWest().lng)/180,t=this._map.getSize(),i=this.options,r=0;t.x>0&&(r=e*(i.maxWidth/t.x));this._updateScales(i,r)},_updateScales:function(n,t){n.metric&&t&&this._updateMetric(t);n.imperial&&t&&this._updateImperial(t)},_updateMetric:function(n){var t=this._getRoundNum(n);this._mScale.style.width=this._getScaleWidth(t/n)+"px";this._mScale.innerHTML=t<1e3?t+" m":t/1e3+" km"},_updateImperial:function(n){var t=n*3.2808399,i=this._iScale,r,u,f;t>5280?(r=t/5280,u=this._getRoundNum(r),i.style.width=this._getScaleWidth(u/r)+"px",i.innerHTML=u+" mi"):(f=this._getRoundNum(t),i.style.width=this._getScaleWidth(f/t)+"px",i.innerHTML=f+" ft")},_getScaleWidth:function(n){return Math.round(this.options.maxWidth*n)-10},_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}});u.control.scale=function(n){return new u.Control.Scale(n)};u.Control.Layers=u.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(n,t,i){u.setOptions(this,i);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();n.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this);return this._container},onRemove:function(n){n.off("layeradd",this._onLayerChange,this).off("layerremove",this._onLayerChange,this)},addBaseLayer:function(n,t){return this._addLayer(n,t),this._update(),this},addOverlay:function(n,t){return this._addLayer(n,t,!0),this._update(),this},removeLayer:function(n){var t=u.stamp(n);return delete this._layers[t],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",n=this._container=u.DomUtil.create("div",t),i,r;if(n.setAttribute("aria-haspopup",!0),u.Browser.touch)u.DomEvent.on(n,"click",u.DomEvent.stopPropagation);else u.DomEvent.disableClickPropagation(n).disableScrollPropagation(n);if(i=this._form=u.DomUtil.create("form",t+"-list"),this.options.collapsed){if(!u.Browser.android)u.DomEvent.on(n,"mouseover",this._expand,this).on(n,"mouseout",this._collapse,this);if(r=this._layersLink=u.DomUtil.create("a",t+"-toggle",n),r.href="#",r.title="Layers",u.Browser.touch)u.DomEvent.on(r,"click",u.DomEvent.stop).on(r,"click",this._expand,this);else u.DomEvent.on(r,"focus",this._expand,this);u.DomEvent.on(i,"click",function(){setTimeout(u.bind(this._onInputClick,this),0)},this);this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=u.DomUtil.create("div",t+"-base",i);this._separator=u.DomUtil.create("div",t+"-separator",i);this._overlaysList=u.DomUtil.create("div",t+"-overlays",i);n.appendChild(i)},_addLayer:function(n,t,i){var r=u.stamp(n);this._layers[r]={layer:n,name:t,overlay:i};this.options.autoZIndex&&n.setZIndex&&(this._lastZIndex++,n.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="";this._overlaysList.innerHTML="";var t=!1,i=!1,r,n;for(r in this._layers)n=this._layers[r],this._addItem(n),i=i||n.overlay,t=t||!n.overlay;this._separator.style.display=i&&t?"":"none"}},_onLayerChange:function(n){var t=this._layers[u.stamp(n.layer)],i;t&&(this._handlingClick||this._update(),i=t.overlay?n.type==="layeradd"?"overlayadd":"overlayremove":n.type==="layeradd"?"baselayerchange":null,i&&this._map.fire(i,t))},_createRadioElement:function(n,t){var r='<input type="radio" class="leaflet-control-layers-selector" name="'+n+'"',u;return t&&(r+=' checked="checked"'),r+="/>",u=i.createElement("div"),u.innerHTML=r,u.firstChild},_addItem:function(n){var r=i.createElement("label"),t,e=this._map.hasLayer(n.layer),f,o;n.overlay?(t=i.createElement("input"),t.type="checkbox",t.className="leaflet-control-layers-selector",t.defaultChecked=e):t=this._createRadioElement("leaflet-base-layers",e);t.layerId=u.stamp(n.layer);u.DomEvent.on(t,"click",this._onInputClick,this);return f=i.createElement("span"),f.innerHTML=" "+n.name,r.appendChild(t),r.appendChild(f),o=n.overlay?this._overlaysList:this._baseLayersList,o.appendChild(r),r},_onInputClick:function(){var t,i,n,r=this._form.getElementsByTagName("input"),u=r.length;for(this._handlingClick=!0,t=0;t<u;t++)i=r[t],n=this._layers[i.layerId],i.checked&&!this._map.hasLayer(n.layer)?this._map.addLayer(n.layer):!i.checked&&this._map.hasLayer(n.layer)&&this._map.removeLayer(n.layer);this._handlingClick=!1;this._refocusOnMap()},_expand:function(){u.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}});u.control.layers=function(n,t,i){return new u.Control.Layers(n,t,i)};u.PosAnimation=u.Class.extend({includes:u.Mixin.Events,run:function(n,t,i,r){this.stop();this._el=n;this._inProgress=!0;this._newPos=t;this.fire("start");n.style[u.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(r||.5)+",1)";u.DomEvent.on(n,u.DomUtil.TRANSITION_END,this._onTransitionEnd,this);u.DomUtil.setPosition(n,t);u.Util.falseFn(n.offsetWidth);this._stepTimer=setInterval(u.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(u.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),u.Util.falseFn(this._el.offsetWidth))},_onStep:function(){var n=this._getPos();if(!n){this._onTransitionEnd();return}this._el._leaflet_pos=n;this.fire("step")},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var i,r,t,e=this._el,f=n.getComputedStyle(e);if(u.Browser.any3d){if(t=f[u.DomUtil.TRANSFORM].match(this._transformRe),!t)return;i=parseFloat(t[1]);r=parseFloat(t[2])}else i=parseFloat(f.left),r=parseFloat(f.top);return new u.Point(i,r,!0)},_onTransitionEnd:function(){(u.DomEvent.off(this._el,u.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress)&&(this._inProgress=!1,this._el.style[u.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}});u.Map.include({setView:function(n,t,i){if(t=t===r?this._zoom:this._limitZoom(t),n=this._limitCenter(u.latLng(n),t,this.options.maxBounds),i=i||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!i.reset&&i!==!0){i.animate!==r&&(i.zoom=u.extend({animate:i.animate},i.zoom),i.pan=u.extend({animate:i.animate},i.pan));var f=this._zoom!==t?this._tryAnimatedZoom&&this._tryAnimatedZoom(n,t,i.zoom):this._tryAnimatedPan(n,i.pan);if(f)return clearTimeout(this._sizeTimer),this}return this._resetView(n,t),this},panBy:function(n,t){if(n=u.point(n).round(),t=t||{},!n.x&&!n.y)return this;if(!this._panAnim){this._panAnim=new u.PosAnimation;this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)}if(t.noMoveStart||this.fire("movestart"),t.animate!==!1){u.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(n);this._panAnim.run(this._mapPane,i,t.duration||.25,t.easeLinearity)}else this._rawPanBy(n),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){u.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim");this.fire("moveend")},_tryAnimatedPan:function(n,t){var i=this._getCenterOffset(n)._floor();return(t&&t.animate)!==!0&&!this.getSize().contains(i)?!1:(this.panBy(i,t),!0)}});u.PosAnimation=u.DomUtil.TRANSITION?u.PosAnimation:u.PosAnimation.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=u.DomUtil.getPosition(n);this._offset=t.subtract(this._startPos);this._startTime=+new Date;this.fire("start");this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=u.Util.requestAnimFrame(this._animate,this);this._step()},_step:function(){var n=+new Date-this._startTime,t=this._duration*1e3;n<t?this._runFrame(this._easeOut(n/t)):(this._runFrame(1),this._complete())},_runFrame:function(n){var t=this._startPos.add(this._offset.multiplyBy(n));u.DomUtil.setPosition(this._el,t);this.fire("step")},_complete:function(){u.Util.cancelAnimFrame(this._animId);this._inProgress=!1;this.fire("end")},_easeOut:function(n){return 1-Math.pow(1-n,this._easeOutPower)}});u.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4});u.DomUtil.TRANSITION&&u.Map.addInitHook(function(){if(this._zoomAnimated=this.options.zoomAnimation&&u.DomUtil.TRANSITION&&u.Browser.any3d&&!u.Browser.android23&&!u.Browser.mobileOpera,this._zoomAnimated)u.DomEvent.on(this._mapPane,u.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)});u.Map.include(u.DomUtil.TRANSITION?{_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||i.animate===!1||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),f=this._getCenterLayerPoint()._add(u);return i.animate!==!0&&!this.getSize().contains(u)?!1:(this.fire("movestart").fire("zoomstart"),this._animateZoom(n,t,f,r,null,!0),!0)},_animateZoom:function(n,t,i,r,f,e,o){o||(this._animatingZoom=!0);u.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim");this._animateToCenter=n;this._animateToZoom=t;u.Draggable&&(u.Draggable._disabled=!0);u.Util.requestAnimFrame(function(){this.fire("zoomanim",{center:n,zoom:t,origin:i,scale:r,delta:f,backwards:e});setTimeout(u.bind(this._onZoomTransitionEnd,this),250)},this)},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._animatingZoom=!1,u.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),u.Util.requestAnimFrame(function(){this._resetView(this._animateToCenter,this._animateToZoom,!0,!0);u.Draggable&&(u.Draggable._disabled=!1)},this))}}:{});u.TileLayer.include({_animateZoom:function(n){this._animating||(this._animating=!0,this._prepareBgBuffer());var t=this._bgBuffer,i=u.DomUtil.TRANSFORM,r=n.delta?u.DomUtil.getTranslateString(n.delta):t.style[i],f=u.DomUtil.getScaleString(n.scale,n.origin);t.style[i]=n.backwards?f+" "+r:r+" "+f},_endZoomAnim:function(){var n=this._tileContainer,i=this._bgBuffer,t;n.style.visibility="";n.parentNode.appendChild(n);u.Util.falseFn(i.offsetWidth);t=this._map.getZoom();(t>this.options.maxZoom||t<this.options.minZoom)&&this._clearBgBuffer();this._animating=!1},_clearBgBuffer:function(){var n=this._map;!n||n._animatingZoom||n.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[u.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var t=this._tileContainer,n=this._bgBuffer,i=this._getLoadedTilesPercentage(n),r=this._getLoadedTilesPercentage(t);if(n&&i>.5&&r<.5){t.style.visibility="hidden";this._stopLoadingImages(t);return}n.style.visibility="hidden";n.style[u.DomUtil.TRANSFORM]="";this._tileContainer=n;n=this._bgBuffer=t;this._stopLoadingImages(n);clearTimeout(this._clearBgBufferTimer)},_getLoadedTilesPercentage:function(n){for(var i=n.getElementsByTagName("img"),r=0,t=0,u=i.length;t<u;t++)i[t].complete&&r++;return r/u},_stopLoadingImages:function(n){for(var r=Array.prototype.slice.call(n.getElementsByTagName("img")),t,i=0,f=r.length;i<f;i++)t=r[i],t.complete||(t.onload=u.Util.falseFn,t.onerror=u.Util.falseFn,t.src=u.Util.emptyImageUrl,t.parentNode.removeChild(t))}});u.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:Infinity,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(n){if(n=this._locateOptions=u.extend(this._defaultLocateOptions,n),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var t=u.bind(this._handleGeolocationResponse,this),i=u.bind(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(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(n){var t=n.code,i=n.message||(t===1?"permission denied":t===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld();this.fire("locationerror",{code:t,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(n){var t=n.coords.latitude,r=n.coords.longitude,o=new u.LatLng(t,r),f=180*n.coords.accuracy/40075017,s=f/Math.cos(u.LatLng.DEG_TO_RAD*t),h=u.latLngBounds([t-f,r-s],[t+f,r+s]),c=this._locateOptions,l,e,i;c.setView&&(l=Math.min(this.getBoundsZoom(h),c.maxZoom),this.setView(o,l));e={latlng:o,bounds:h,timestamp:n.timestamp};for(i in n.coords)typeof n.coords[i]=="number"&&(e[i]=n.coords[i]);this.fire("locationfound",e)}})})(window,document)},{}]},{},[]);require=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}({"leaflet.markercluster":[function(){!function(n,t){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,polygonOptions:{}},initialize:function(n){L.Util.setOptions(this,n);this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction);this._featureGroup=L.featureGroup();this._featureGroup.on(L.FeatureGroup.EVENTS,this._propagateEvent,this);this._nonPointGroup=L.featureGroup();this._nonPointGroup.on(L.FeatureGroup.EVENTS,this._propagateEvent,this);this._inZoomAnimation=0;this._needsClustering=[];this._needsRemoving=[];this._currentShownBounds=null;this._queue=[]},addLayer:function(n){var i,r,t,u;if(n instanceof L.LayerGroup){i=[];for(r in n._layers)i.push(n._layers[r]);return this.addLayers(i)}if(!n.getLatLng)return this._nonPointGroup.addLayer(n),this;if(!this._map)return this._needsClustering.push(n),this;if(this.hasLayer(n))return this;if(this._unspiderfy&&this._unspiderfy(),this._addLayer(n,this._maxZoom),t=n,u=this._map.getZoom(),n.__parent)for(;t.__parent._zoom>=u;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(n,t):this._animationAddLayerNonAnimated(n,t)),this},removeLayer:function(n){var t,i;if(n instanceof L.LayerGroup){t=[];for(i in n._layers)t.push(n._layers[i]);return this.removeLayers(t)}return n.getLatLng?this._map?n.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(n)),this._removeLayer(n,!0),this._featureGroup.hasLayer(n)&&(this._featureGroup.removeLayer(n),n.setOpacity&&n.setOpacity(1)),this):this:(!this._arraySplice(this._needsClustering,n)&&this.hasLayer(n)&&this._needsRemoving.push(n),this):(this._nonPointGroup.removeLayer(n),this)},addLayers:function(n){for(var t,u=this._map,f=this._featureGroup,o=this._nonPointGroup,i,e,r=0,s=n.length;s>r;r++)(t=n[r],t.getLatLng)?this.hasLayer(t)||(u?(this._addLayer(t,this._maxZoom),t.__parent&&2===t.__parent.getChildCount())&&(i=t.__parent.getAllChildMarkers(),e=i[0]===t?i[1]:i[0],f.removeLayer(e)):this._needsClustering.push(t)):o.addLayer(t);return u&&(f.eachLayer(function(n){n instanceof L.MarkerCluster&&n._iconNeedsUpdate&&n._updateIcon()}),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)),this},removeLayers:function(n){var i,r,t,u=this._featureGroup,f=this._nonPointGroup;if(!this._map){for(i=0,r=n.length;r>i;i++)t=n[i],this._arraySplice(this._needsClustering,t),f.removeLayer(t);return this}for(i=0,r=n.length;r>i;i++)t=n[i],t.__parent?(this._removeLayer(t,!0,!0),u.hasLayer(t)&&(u.removeLayer(t),t.setOpacity&&t.setOpacity(1))):f.removeLayer(t);return this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),u.eachLayer(function(n){n instanceof L.MarkerCluster&&n._updateIcon()}),this},clearLayers:function(){return this._map||(this._needsClustering=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(n){delete n.__parent}),this._map&&this._generateInitialClusters(),this},getBounds:function(){var n=new L.LatLngBounds,t;if(this._topClusterLevel)n.extend(this._topClusterLevel._bounds);else for(t=this._needsClustering.length-1;t>=0;t--)n.extend(this._needsClustering[t].getLatLng());return n.extend(this._nonPointGroup.getBounds()),n},eachLayer:function(n,t){var i,r=this._needsClustering.slice();for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(r),i=r.length-1;i>=0;i--)n.call(t,r[i]);this._nonPointGroup.eachLayer(n,t)},getLayers:function(){var n=[];return this.eachLayer(function(t){n.push(t)}),n},getLayer:function(n){var t=null;return this.eachLayer(function(i){L.stamp(i)===n&&(t=i)}),t},hasLayer:function(n){if(!n)return!1;for(var i=this._needsClustering,t=i.length-1;t>=0;t--)if(i[t]===n)return!0;for(i=this._needsRemoving,t=i.length-1;t>=0;t--)if(i[t]===n)return!1;return!(!n.__parent||n.__parent._group!==this)||this._nonPointGroup.hasLayer(n)},zoomToShowLayer:function(n,t){var i=function(){if((n._icon||n.__parent._icon)&&!this._inZoomAnimation)if(this._map.off("moveend",i,this),this.off("animationend",i,this),n._icon)t();else if(n.__parent._icon){var r=function(){this.off("spiderfied",r,this);t()};this.on("spiderfied",r,this);n.__parent.spiderfy()}};n._icon&&this._map.getBounds().contains(n.getLatLng())?t():n.__parent._zoom<this._map.getZoom()?(this._map.on("moveend",i,this),this._map.panTo(n.getLatLng())):(this._map.on("moveend",i,this),this.on("animationend",i,this),this._map.setView(n.getLatLng(),n.__parent._zoom+1),n.__parent.zoomToBounds())},onAdd:function(n){this._map=n;var t,r,i;if(!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.onAdd(n),this._nonPointGroup.onAdd(n),this._gridClusters||this._generateInitialClusters(),t=0,r=this._needsRemoving.length;r>t;t++)i=this._needsRemoving[t],this._removeLayer(i,!0);for(this._needsRemoving=[],t=0,r=this._needsClustering.length;r>t;t++)i=this._needsClustering[t],i.getLatLng?i.__parent||this._addLayer(i,this._maxZoom):this._featureGroup.addLayer(i);this._needsClustering=[];this._map.on("zoomend",this._zoomEnd,this);this._map.on("moveend",this._moveEnd,this);this._spiderfierOnAdd&&this._spiderfierOnAdd();this._bindEvents();this._zoom=this._map.getZoom();this._currentShownBounds=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)},onRemove:function(n){n.off("zoomend",this._zoomEnd,this);n.off("moveend",this._moveEnd,this);this._unbindEvents();this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","");this._spiderfierOnRemove&&this._spiderfierOnRemove();this._hideCoverage();this._featureGroup.onRemove(n);this._nonPointGroup.onRemove(n);this._featureGroup.clearLayers();this._map=null},getVisibleParent:function(n){for(var t=n;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(n,t){for(var i=n.length-1;i>=0;i--)if(n[i]===t)return n.splice(i,1),!0},_removeLayer:function(n,t,i){var c=this._gridClusters,o=this._gridUnclustered,s=this._featureGroup,e=this._map,f,u,r,h;if(t)for(f=this._maxZoom;f>=0&&o[f].removeObject(n,e.project(n.getLatLng(),f));f--);for(r=n.__parent,h=r._markers,this._arraySplice(h,n);r&&(r._childCount--,!(r._zoom<0));)t&&r._childCount<=1?(u=r._markers[0]===n?r._markers[1]:r._markers[0],c[r._zoom].removeObject(r,e.project(r._cLatLng,r._zoom)),o[r._zoom].addObject(u,e.project(u.getLatLng(),r._zoom)),this._arraySplice(r.__parent._childClusters,r),r.__parent._markers.push(u),u.__parent=r.__parent,r._icon&&(s.removeLayer(r),i||s.addLayer(u))):(r._recalculateBounds(),i&&r._icon||r._updateIcon()),r=r.__parent;delete n.__parent},_isOrIsParent:function(n,t){for(;t;){if(n===t)return!0;t=t.parentNode}return!1},_propagateEvent:function(n){if(n.layer instanceof L.MarkerCluster){if(n.originalEvent&&this._isOrIsParent(n.layer._icon,n.originalEvent.relatedTarget))return;n.type="cluster"+n.type}this.fire(n.type,n)},_defaultIconCreateFunction:function(n){var t=n.getChildCount(),i=" marker-cluster-";return i+=10>t?"small":100>t?"medium":"large",new L.DivIcon({html:"<div><span>"+t+"<\/span><\/div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var n=this._map,t=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,r=this.options.zoomToBoundsOnClick;(t||r)&&this.on("clusterclick",this._zoomOrSpiderfy,this);i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),n.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(n){var t=this._map;t.getMaxZoom()===t.getZoom()?this.options.spiderfyOnMaxZoom&&n.layer.spiderfy():this.options.zoomToBoundsOnClick&&n.layer.zoomToBounds();n.originalEvent&&13===n.originalEvent.keyCode&&t._container.focus()},_showCoverage:function(n){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),n.layer.getChildCount()>2&&n.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(n.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var n=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,r=this._map;(n||i)&&this.off("clusterclick",this._zoomOrSpiderfy,this);t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),r.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=this._map._zoom,this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var n=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,this._zoom,n);this._topClusterLevel._recursivelyAddChildrenToMap(null,this._map._zoom,n);this._currentShownBounds=n}},_generateInitialClusters:function(){var t=this._map.getMaxZoom(),i=this.options.maxClusterRadius,n;for(this.options.disableClusteringAtZoom&&(t=this.options.disableClusteringAtZoom-1),this._maxZoom=t,this._gridClusters={},this._gridUnclustered={},n=t;n>=0;n--)this._gridClusters[n]=new L.DistanceGrid(i),this._gridUnclustered[n]=new L.DistanceGrid(i);this._topClusterLevel=new L.MarkerCluster(this,-1)},_addLayer:function(n,t){var e,r,s=this._gridClusters,h=this._gridUnclustered,i,o,u,f;for(this.options.singleMarkerMode&&(n.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[n]}}));t>=0;t--){if(e=this._map.project(n.getLatLng(),t),i=s[t].getNearObject(e),i)return i._addChild(n),n.__parent=i,void 0;if(i=h[t].getNearObject(e)){for(o=i.__parent,o&&this._removeLayer(i,!1),u=new L.MarkerCluster(this,t,i,n),s[t].addObject(u,this._map.project(u._cLatLng,t)),i.__parent=u,n.__parent=u,f=u,r=t-1;r>o._zoom;r--)f=new L.MarkerCluster(this,r,f),s[r].addObject(f,this._map.project(i.getLatLng(),r));for(o._addChild(f),r=t;r>=0&&h[r].removeObject(i,this._map.project(i.getLatLng(),r));r--);return}h[t].addObject(n,e)}this._topClusterLevel._addChild(n);n.__parent=this._topClusterLevel},_enqueue:function(n){this._queue.push(n);this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var n=0;n<this._queue.length;n++)this._queue[n].call(this);this._queue.length=0;clearTimeout(this._queueTimeout);this._queueTimeout=null},_mergeSplitClusters:function(){this._processQueue();this._zoom<this._map._zoom&&this._currentShownBounds.contains(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,this._map._zoom)):this._zoom>this._map._zoom?(this._animationStart(),this._animationZoomOut(this._zoom,this._map._zoom)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(!this.options.removeOutsideVisibleBounds)return this.getBounds();var f=this._map,i=f.getBounds(),n=i._southWest,t=i._northEast,r=L.Browser.mobile?0:Math.abs(n.lat-t.lat),u=L.Browser.mobile?0:Math.abs(n.lng-t.lng);return new L.LatLngBounds(new L.LatLng(n.lat-r,n.lng-u,!0),new L.LatLng(t.lat+r,t.lng+u,!0))},_animationAddLayerNonAnimated:function(n,t){if(t===n)this._featureGroup.addLayer(n);else if(2===t._childCount){t._addToMap();var i=t.getAllChildMarkers();this._featureGroup.removeLayer(i[0]);this._featureGroup.removeLayer(i[1])}else t._updateIcon()}});L.MarkerClusterGroup.include(L.DomUtil.TRANSITION?{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim";this._inZoomAnimation++},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""));this._inZoomAnimation--;this.fire("animationend")},_animationZoomIn:function(n,t){var r,i=this._getExpandedVisibleBounds(),u=this._featureGroup;this._topClusterLevel._recursively(i,n,0,function(f){var e,o=f._latlng,s=f._markers;for(i.contains(o)||(o=null),f._isSingleParent()&&n+1===t?(u.removeLayer(f),f._recursivelyAddChildrenToMap(null,t,i)):(f.setOpacity(0),f._recursivelyAddChildrenToMap(o,t,i)),r=s.length-1;r>=0;r--)e=s[r],i.contains(e._latlng)||u.removeLayer(e)});this._forceLayout();this._topClusterLevel._recursivelyBecomeVisible(i,t);u.eachLayer(function(n){n instanceof L.MarkerCluster||!n._icon||n.setOpacity(1)});this._topClusterLevel._recursively(i,n,t,function(n){n._recursivelyRestoreChildPositions(t)});this._enqueue(function(){this._topClusterLevel._recursively(i,n,0,function(n){u.removeLayer(n);n.setOpacity(1)});this._animationEnd()})},_animationZoomOut:function(n,t){this._animationZoomOutSingle(this._topClusterLevel,n-1,t);this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds());this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,n,this._getExpandedVisibleBounds())},_animationZoomOutSingle:function(n,t,i){var r=this._getExpandedVisibleBounds(),u;n._recursivelyAnimateChildrenInAndAddSelfToMap(r,t+1,i);u=this;this._forceLayout();n._recursivelyBecomeVisible(r,i);this._enqueue(function(){if(1===n._childCount){var f=n._markers[0];f.setLatLng(f.getLatLng());f.setOpacity(1)}else n._recursively(r,i,0,function(n){n._recursivelyRemoveChildrenFromMap(r,t+1)});u._animationEnd()})},_animationAddLayer:function(n,t){var i=this,r=this._featureGroup;r.addLayer(n);t!==n&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),n._setPos(this._map.latLngToLayerPoint(t.getLatLng())),n.setOpacity(0),this._enqueue(function(){r.removeLayer(n);n.setOpacity(1);i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._map.getZoom())))},_forceLayout:function(){L.Util.falseFn(t.body.offsetWidth)}}:{_animationStart:function(){},_animationZoomIn:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,n);this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds())},_animationZoomOut:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,n);this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds())},_animationAddLayer:function(n,t){this._animationAddLayerNonAnimated(n,t)}});L.markerClusterGroup=function(n){return new L.MarkerClusterGroup(n)};L.MarkerCluster=L.Marker.extend({initialize:function(n,t,i,r){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this});this._group=n;this._zoom=t;this._markers=[];this._childClusters=[];this._childCount=0;this._iconNeedsUpdate=!0;this._bounds=new L.LatLngBounds;i&&this._addChild(i);r&&this._addChild(r)},getAllChildMarkers:function(n){var t,i;for(n=n||[],t=this._childClusters.length-1;t>=0;t--)this._childClusters[t].getAllChildMarkers(n);for(i=this._markers.length-1;i>=0;i--)n.push(this._markers[i]);return n},getChildCount:function(){return this._childCount},zoomToBounds:function(){for(var n,t,i=this._childClusters.slice(),f=this._group._map,u=f.getBoundsZoom(this._bounds),r=this._zoom+1,e=f.getZoom();i.length>0&&u>r;){for(r++,n=[],t=0;t<i.length;t++)n=n.concat(i[t]._childClusters);i=n}u>r?this._group._map.setView(this._latlng,r):e>=u?this._group._map.setView(this._latlng,e+1):this._group._map.fitBounds(this._bounds)},getBounds:function(){var n=new L.LatLngBounds;return n.extend(this._bounds),n},_updateIcon:function(){this._iconNeedsUpdate=!0;this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(n,t){this._iconNeedsUpdate=!0;this._expandBounds(n);n instanceof L.MarkerCluster?(t||(this._childClusters.push(n),n.__parent=this),this._childCount+=n._childCount):(t||this._markers.push(n),this._childCount++);this.__parent&&this.__parent._addChild(n,!0)},_expandBounds:function(n){var i,t=n._wLatLng||n._latlng,r;n instanceof L.MarkerCluster?(this._bounds.extend(n._bounds),i=n._childCount):(this._bounds.extend(t),i=1);this._cLatLng||(this._cLatLng=n._cLatLng||t);r=this._childCount+i;this._wLatLng?(this._wLatLng.lat=(t.lat*i+this._wLatLng.lat*this._childCount)/r,this._wLatLng.lng=(t.lng*i+this._wLatLng.lng*this._childCount)/r):this._latlng=this._wLatLng=new L.LatLng(t.lat,t.lng)},_addToMap:function(n){n&&(this._backupLatlng=this._latlng,this.setLatLng(n));this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(n,t,i){this._recursively(n,0,i-1,function(n){for(var i,u=n._markers,r=u.length-1;r>=0;r--)i=u[r],i._icon&&(i._setPos(t),i.setOpacity(0))},function(n){for(var i,u=n._childClusters,r=u.length-1;r>=0;r--)i=u[r],i._icon&&(i._setPos(t),i.setOpacity(0))})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(n,t,i){this._recursively(n,i,0,function(r){r._recursivelyAnimateChildrenIn(n,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),t);r._isSingleParent()&&t-1===i?(r.setOpacity(1),r._recursivelyRemoveChildrenFromMap(n,t)):r.setOpacity(0);r._addToMap()})},_recursivelyBecomeVisible:function(n,t){this._recursively(n,0,t,null,function(n){n.setOpacity(1)})},_recursivelyAddChildrenToMap:function(n,t,i){this._recursively(i,-1,t,function(r){var f,u;if(t!==r._zoom)for(f=r._markers.length-1;f>=0;f--)u=r._markers[f],i.contains(u._latlng)&&(n&&(u._backupLatlng=u.getLatLng(),u.setLatLng(n),u.setOpacity&&u.setOpacity(0)),r._group._featureGroup.addLayer(u))},function(t){t._addToMap(n)})},_recursivelyRestoreChildPositions:function(n){for(var t,i,r,u=this._markers.length-1;u>=0;u--)t=this._markers[u],t._backupLatlng&&(t.setLatLng(t._backupLatlng),delete t._backupLatlng);if(n-1===this._zoom)for(i=this._childClusters.length-1;i>=0;i--)this._childClusters[i]._restorePosition();else for(r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._recursivelyRestoreChildPositions(n)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(n,t,i){var r,u;this._recursively(n,-1,t-1,function(n){for(u=n._markers.length-1;u>=0;u--)r=n._markers[u],i&&i.contains(r._latlng)||(n._group._featureGroup.removeLayer(r),r.setOpacity&&r.setOpacity(1))},function(n){for(u=n._childClusters.length-1;u>=0;u--)r=n._childClusters[u],i&&i.contains(r._latlng)||(n._group._featureGroup.removeLayer(r),r.setOpacity&&r.setOpacity(1))})},_recursively:function(n,t,i,r,u){var f,e,o=this._childClusters,s=this._zoom;if(t>s)for(f=o.length-1;f>=0;f--)e=o[f],n.intersects(e._bounds)&&e._recursively(n,t,i,r,u);else if(r&&r(this),u&&this._zoom===i&&u(this),i>s)for(f=o.length-1;f>=0;f--)e=o[f],n.intersects(e._bounds)&&e._recursively(n,t,i,r,u)},_recalculateBounds:function(){var n,t=this._markers,i=this._childClusters;for(this._bounds=new L.LatLngBounds,delete this._wLatLng,n=t.length-1;n>=0;n--)this._expandBounds(t[n]);for(n=i.length-1;n>=0;n--)this._expandBounds(i[n])},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.DistanceGrid=function(n){this._cellSize=n;this._sqCellSize=n*n;this._grid={};this._objectPoint={}};L.DistanceGrid.prototype={addObject:function(n,t){var i=this._getCoord(t.x),r=this._getCoord(t.y),u=this._grid,f=u[r]=u[r]||{},e=f[i]=f[i]||[],o=L.Util.stamp(n);this._objectPoint[o]=t;e.push(n)},updateObject:function(n,t){this.removeObject(n);this.addObject(n,t)},removeObject:function(n,t){var i,r,u=this._getCoord(t.x),o=this._getCoord(t.y),s=this._grid,f=s[o]=s[o]||{},e=f[u]=f[u]||[];for(delete this._objectPoint[L.Util.stamp(n)],i=0,r=e.length;r>i;i++)if(e[i]===n)return e.splice(i,1),1===r&&delete f[u],!0},eachObject:function(n,t){var e,o,i,r,u,f,s,h=this._grid;for(e in h){u=h[e];for(o in u)for(f=u[o],i=0,r=f.length;r>i;i++)s=n.call(t,f[i]),s&&(i--,r--)}},getNearObject:function(n){for(var t,i,o,r,s,u,f,h=this._getCoord(n.x),c=this._getCoord(n.y),v=this._objectPoint,l=this._sqCellSize,a=null,e=c-1;c+1>=e;e++)if(o=this._grid[e])for(t=h-1;h+1>=t;t++)if(r=o[t])for(i=0,s=r.length;s>i;i++)u=r[i],f=this._sqDist(v[L.Util.stamp(u)],n),l>f&&(l=f,a=u);return a},_getCoord:function(n){return Math.floor(n/this._cellSize)},_sqDist:function(n,t){var i=t.x-n.x,r=t.y-n.y;return i*i+r*r}},function(){L.QuickHull={getDistant:function(n,t){var i=t[1].lat-t[0].lat,r=t[0].lng-t[1].lng;return r*(n.lat-t[0].lat)+i*(n.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(n,t){for(var i,r,f=0,e=null,o=[],u=t.length-1;u>=0;u--)i=t[u],r=this.getDistant(i,n),r>0&&(o.push(i),r>f&&(f=r,e=i));return{maxPoint:e,newPoints:o}},buildConvexHull:function(n,t){var r=[],i=this.findMostDistantPointFromBaseLine(n,t);return i.maxPoint?(r=r.concat(this.buildConvexHull([n[0],i.maxPoint],i.newPoints)),r=r.concat(this.buildConvexHull([i.maxPoint,n[1]],i.newPoints))):[n[0]]},getConvexHull:function(n){for(var i=!1,r=!1,u=null,f=null,t,e=n.length-1;e>=0;e--)t=n[e],(i===!1||t.lat>i)&&(u=t,i=t.lat),(r===!1||t.lat<r)&&(f=t,r=t.lat);return[].concat(this.buildConvexHull([f,u],n),this.buildConvexHull([u,f],n))}}}();L.MarkerCluster.include({getConvexHull:function(){for(var t,i=this.getAllChildMarkers(),r=[],n=i.length-1;n>=0;n--)t=i[n].getLatLng(),r.push(t);return L.QuickHull.getConvexHull(r)}});L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:Math.PI/6,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var t,n=this.getAllChildMarkers(),r=this._group,u=r._map,i=u.latLngToLayerPoint(this._latlng);this._group._unspiderfy();this._group._spiderfied=this;n.length>=this._circleSpiralSwitchover?t=this._generatePointsSpiral(n.length,i):(i.y+=10,t=this._generatePointsCircle(n.length,i));this._animationSpiderfy(n,t)}},unspiderfy:function(n){this._group._inZoomAnimation||(this._animationUnspiderfy(n),this._group._spiderfied=null)},_generatePointsCircle:function(n,t){var i,r,e=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+n),f=e/this._2PI,o=this._2PI/n,u=[];for(u.length=n,i=n-1;i>=0;i--)r=this._circleStartAngle+i*o,u[i]=new L.Point(t.x+f*Math.cos(r),t.y+f*Math.sin(r))._round();return u},_generatePointsSpiral:function(n,t){var i,r=this._group.options.spiderfyDistanceMultiplier*this._spiralLengthStart,e=this._group.options.spiderfyDistanceMultiplier*this._spiralFootSeparation,o=this._group.options.spiderfyDistanceMultiplier*this._spiralLengthFactor,u=0,f=[];for(f.length=n,i=n-1;i>=0;i--)u+=e/r+.0005*i,f[i]=new L.Point(t.x+r*Math.cos(u),t.y+r*Math.sin(u))._round(),r+=this._2PI*o/u;return f},_noanimationUnspiderfy:function(){var n,t,i=this._group,u=i._map,f=i._featureGroup,r=this.getAllChildMarkers();for(this.setOpacity(1),t=r.length-1;t>=0;t--)n=r[t],f.removeLayer(n),n._preSpiderfyLatlng&&(n.setLatLng(n._preSpiderfyLatlng),delete n._preSpiderfyLatlng),n.setZIndexOffset&&n.setZIndexOffset(0),n._spiderLeg&&(u.removeLayer(n._spiderLeg),delete n._spiderLeg);i._spiderfied=null}});L.MarkerCluster.include(L.DomUtil.TRANSITION?{SVG_ANIMATION:function(){return t.createElementNS("http://www.w3.org/2000/svg","animate").toString().indexOf("SVGAnimate")>-1}(),_animationSpiderfy:function(n,i){for(var r,e,h,a=this,o=this._group,c=o._map,v=o._featureGroup,p=c.latLngToLayerPoint(this._latlng),y,l,s,u,f=n.length-1;f>=0;f--)r=n[f],r.setOpacity?(r.setZIndexOffset(1e6),r.setOpacity(0),v.addLayer(r),r._setPos(p)):v.addLayer(r);for(o._forceLayout(),o._animationStart(),y=L.Path.SVG?0:.3,l=L.Path.SVG_NS,f=n.length-1;f>=0;f--)(h=c.layerPointToLatLng(i[f]),r=n[f],r._preSpiderfyLatlng=r._latlng,r.setLatLng(h),r.setOpacity&&r.setOpacity(1),e=new L.Polyline([a._latlng,h],{weight:1.5,color:"#222",opacity:y}),c.addLayer(e),r._spiderLeg=e,L.Path.SVG&&this.SVG_ANIMATION)&&(s=e._path.getTotalLength(),e._path.setAttribute("stroke-dasharray",s+","+s),u=t.createElementNS(l,"animate"),u.setAttribute("attributeName","stroke-dashoffset"),u.setAttribute("begin","indefinite"),u.setAttribute("from",s),u.setAttribute("to",0),u.setAttribute("dur",.25),e._path.appendChild(u),u.beginElement(),u=t.createElementNS(l,"animate"),u.setAttribute("attributeName","stroke-opacity"),u.setAttribute("attributeName","stroke-opacity"),u.setAttribute("begin","indefinite"),u.setAttribute("from",0),u.setAttribute("to",.5),u.setAttribute("dur",.25),e._path.appendChild(u),u.beginElement());if(a.setOpacity(.3),L.Path.SVG)for(this._group._forceLayout(),f=n.length-1;f>=0;f--)r=n[f]._spiderLeg,r.options.opacity=.5,r._path.setAttribute("stroke-opacity",.5);setTimeout(function(){o._animationEnd();o.fire("spiderfied")},200)},_animationUnspiderfy:function(n){var t,i,r,f=this._group,e=f._map,o=f._featureGroup,s=n?e._latLngToNewLayerPoint(this._latlng,n.zoom,n.center):e.latLngToLayerPoint(this._latlng),u=this.getAllChildMarkers(),h=L.Path.SVG&&this.SVG_ANIMATION;for(f._animationStart(),this.setOpacity(1),i=u.length-1;i>=0;i--)t=u[i],t._preSpiderfyLatlng&&(t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng,t.setOpacity?(t._setPos(s),t.setOpacity(0)):o.removeLayer(t),h&&(r=t._spiderLeg._path.childNodes[0],r.setAttribute("to",r.getAttribute("from")),r.setAttribute("from",0),r.beginElement(),r=t._spiderLeg._path.childNodes[1],r.setAttribute("from",.5),r.setAttribute("to",0),r.setAttribute("stroke-opacity",0),r.beginElement(),t._spiderLeg._path.setAttribute("stroke-opacity",0)));setTimeout(function(){var n=0;for(i=u.length-1;i>=0;i--)t=u[i],t._spiderLeg&&n++;for(i=u.length-1;i>=0;i--)t=u[i],t._spiderLeg&&(t.setOpacity&&(t.setOpacity(1),t.setZIndexOffset(0)),n>1&&o.removeLayer(t),e.removeLayer(t._spiderLeg),delete t._spiderLeg);f._animationEnd()},200)}}:{_animationSpiderfy:function(n,t){for(var i,u,f,e=this._group,o=e._map,s=e._featureGroup,r=n.length-1;r>=0;r--)f=o.layerPointToLatLng(t[r]),i=n[r],i._preSpiderfyLatlng=i._latlng,i.setLatLng(f),i.setZIndexOffset&&i.setZIndexOffset(1e6),s.addLayer(i),u=new L.Polyline([this._latlng,f],{weight:1.5,color:"#222"}),o.addLayer(u),i._spiderLeg=u;this.setOpacity(.3);e.fire("spiderfied")},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}});L.MarkerClusterGroup.include({_spiderfied:null,_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this);this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this);this._map.on("zoomend",this._noanimationUnspiderfy,this);L.Path.SVG&&!L.Browser.touch&&this._map._initPathRoot()},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this);this._map.off("zoomstart",this._unspiderfyZoomStart,this);this._map.off("zoomanim",this._unspiderfyZoomAnim,this);this._unspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(n){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(n))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(n){this._spiderfied&&this._spiderfied.unspiderfy(n)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(n){n._spiderLeg&&(this._featureGroup.removeLayer(n),n.setOpacity(1),n.setZIndexOffset(0),this._map.removeLayer(n._spiderLeg),delete n._spiderLeg)}})}(window,document)},{}]},{},[]);require=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){t.exports=["streets","streets-basic","light","dark","satellite","streets-satellite","outdoors","emerald"]},{}],"/stena-map-widget-render.js":[function(n,t){function r(n,t){function ut(n,t){function r(n){var i=n;return{name:"option",text:n,attributes:{value:i,selected:i===t}}}return i("label",{text:n,children:[{name:"select",children:e.map(r)}]})}function a(n,t,r){function u(n){var i=n;return{name:"option",text:n,attributes:{value:i,selected:i===t}}}return i("label",{text:n,attributes:{style:"display: "+(r?"block":"none")+";"},children:[{name:"select",children:["topleft","topright","bottomleft","bottomright"].map(u)}]})}var s=i("div",{"class":"m_route_map_spot _01 p_001 stena-map-widget"}),ft=s.appendChild(i("div",{"class":"map"})),h=s.appendChild(i("div",{"class":"design-controls max",attributes:{style:"display: "+(t.design?"block":"none")+";"}})),et=h.appendChild(i("span",{"class":"toggle-design-controls",text:"-"})),wt=h.appendChild(i("div",{"class":"ribbon",children:[{name:"span",text:"Design mode v0.0.48",attributes:{style:"display: "+(t.design?"block":"none")+";"}}]})),ot=h.appendChild(i("form",{"class":"search",children:[{name:"input",attributes:{type:"search",results:5,name:"center",placeholder:"search center position"}}]})),r=h.appendChild(i("div",{"class":"options"})),st=r.appendChild(i("fieldset",{children:[{name:"legend",text:"Center position"},{name:"input","class":"center-position"}]})).querySelector("input"),p=r.appendChild(i("fieldset",{children:[{name:"legend",text:"Zoom"}]})),w,o,v,c,b,f,k,d,g,nt;p.appendChild(i("label",{"class":"show-zoom",children:[{name:"input",attributes:{type:"checkbox",checked:!!n.options.zoomControl}},{name:"span",text:"Show"}]}));var tt=r.querySelector(".show-zoom input"),ht=p.appendChild(a("Position",n.options.zoomControlOptions.position,tt.checked)).querySelector("select"),ct=r.querySelector(".large-zoom input"),it=s.appendChild(i("div",{"class":"status-widget",children:[{name:"span"}]})),y=r.appendChild(i("fieldset",{children:[{name:"legend",text:"Map Switcher"}]}));y.appendChild(i("label",{"class":"show-map-type",children:[{name:"input",attributes:{type:"checkbox",checked:!!n.options.mapTypeControl}},{name:"span",text:"Show"}]}));var lt=r.querySelector(".show-map-type input"),at=y.appendChild(a("Position",n.options.mapTypeControlOptions.position,n.options.mapTypeControl)).querySelector("select"),vt=y.appendChild(ut("Default",n.options.mapTypeId)).querySelector("select"),rt=r.appendChild(i("fieldset",{children:[{name:"legend",text:"Interaction"}]}));rt.appendChild(i("label",{"class":"make-static",children:[{name:"input",attributes:{type:"checkbox",checked:!!n.static}},{name:"span",text:"Static by default"}]}));w=rt.querySelector("input");o=r.appendChild(i("fieldset",{children:[{name:"legend",text:"Markers"}]}));o.appendChild(i("label",{children:[{name:"input","class":"show-marker",attributes:{type:"checkbox",checked:!!n.showMarkerAtCenter}},{name:"span",text:"Show location marker"}]}));v=i("input",{"class":"marker-position",type:"text"});o.appendChild(v);o.appendChild(i("label",{children:[{name:"input","class":"load-markers",attributes:{type:"checkbox",checked:!!n.loadMarkers}},{name:"span",text:"Load category markers"}]}));var yt=o.querySelector(".show-marker"),pt=o.querySelector(".load-markers"),l=r.appendChild(i("fieldset",{children:[{name:"legend",text:"Cluster"}]}));return l.appendChild(i("label",{children:[{name:"input","class":"cluster",attributes:{type:"checkbox",checked:!!n.loadCluster}},{name:"span",text:"Cluster markers"}]})),c=l.querySelector(".cluster"),n.loadCluster===undefined&&(c.checked=!0),l.appendChild(i("label",{text:"Stop clustering after zoom",attributes:{style:"display: "+(c.checked?"block":"none")+";"},children:[{name:"input","class":"cluster-max-zoom",attributes:{type:"number",value:n.clusterMaxZoom||11}}]})),b=l.querySelector(".cluster-max-zoom"),f=r.appendChild(i("fieldset",{children:[{name:"legend",text:"Layers"}]})),f.appendChild(i("label",{children:[{name:"input","class":"show-routes",attributes:{type:"checkbox",checked:!!n.showRoutes}},{name:"span",text:"Show routes"}]})),f.appendChild(i("label",{children:[{name:"input","class":"show-realtime",attributes:{type:"checkbox",checked:!!n.showRoutes}},{name:"span",text:"Show realtime ships"}]})),k=f.querySelector(".show-routes"),d=f.querySelector(".show-realtime"),f.appendChild(i("label",{children:[{name:"input","class":"show-weather",attributes:{type:"checkbox",checked:!!n.showWeather}},{name:"span",text:"Show weather"}]})),g=f.querySelector(".show-weather"),nt=f.appendChild(a("Position",n.options.weatherOptions.position,n.options.showWeather)).querySelector("select"),{el:s,mapEl:ft,design:r,toggleDesign:et,search:ot,showZoom:tt,zoomPosition:ht,largeZoom:ct,status:it,showMapType:lt,setMapType:vt,mapTypePosition:at,statusText:it.querySelector("span"),makeStatic:w,renderMarker:u,showMarkerAtCenter:yt,loadMarkers:pt,showRoutes:k,showWeather:g,showRealtime:d,weatherPosition:nt,position:st,loadCluster:c,clusterMaxZoom:b,markerPosition:v}}function i(n,t){function u(n){var i=t.attributes[n];typeof i=="boolean"?i&&r.setAttribute(n,i):r.setAttribute(n,i)}var r=document.createElement(n);return t["class"]&&(r.className=t["class"]),t.text&&(r["textContent"in r?"textContent":"innerText"]=t.text),t.html&&(r.innerHTML=t.html),t.children&&t.children.forEach(function(n){r.appendChild(i(n.name,n))}),Object.keys(t.attributes||{}).forEach(u),r}function u(n){var t=i("div",{children:[{name:"div",attributes:{"class":"infobox"},children:[{name:"div",text:n.title,attributes:{"class":"infobox-header stenalight-blue"}},{name:"div",html:n.longDescription,attributes:{"class":"infobox-content"}},{name:"div",html:n.image?'<img alt="'+n.title+'" src="'+n.image+'">':"",attributes:{"class":"infobox-content"}},{name:"div",html:n.link?n.link:"",attributes:{"class":"infobox-content link"}},{name:"div",text:n.category+"/"+n.list,attributes:{"class":"infobox-content infobox-label"}}]}]}),r=i("div",{children:[{name:"div",attributes:{"class":"infobox infobox-tooltip"},children:[{name:"div",text:n.title,attributes:{"class":"infobox-header stenalight-blue"}},{name:"div",html:n.shortDescription+(n.image?'<img alt="'+n.title+'" src="'+n.image+'">':""),attributes:{"class":"infobox-content"}},{name:"div",text:n.category+"/"+n.list,attributes:{"class":"infobox-content infobox-label"}}]}]});return{click:t.innerHTML,hover:r.innerHTML,position:new f.LatLng(Number(n.latitude),Number(n.longitude))}}var f=n("leaflet"),e=n("./base-layers");t.exports=r},{"./base-layers":1,leaflet:"leaflet"}]},{},[]);require=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){t.exports=["streets","streets-basic","light","dark","satellite","streets-satellite","outdoors","emerald"]},{}],2:[function(n,t){var i=n("leaflet");t.exports=i.Control.Layers.extend({initialize:function(n,t,r,u){this._overlaysContainer=r;i.Control.Layers.prototype.initialize.call(this,n,t,u)},setOverlaysContainer:function(n){this._overlaysContainer=n;this._update()},_addItem:function(n){var r=document.createElement("label"),t,f=n.overlay?this._overlaysContainer.hasLayer(n.layer):this._map.hasLayer(n.layer),u,e;n.overlay?(t=document.createElement("input"),t.type="checkbox",t.className="leaflet-control-layers-selector",t.defaultChecked=f):t=this._createRadioElement("leaflet-base-layers",f);t.layerId=i.stamp(n.layer);i.DomEvent.on(t,"click",this._onInputClick,this);return u=document.createElement("span"),u.innerHTML=" "+n.name,r.appendChild(t),r.appendChild(u),e=n.overlay?this._overlaysList:this._baseLayersList,e.appendChild(r),r},_onInputClick:function(){var i,r,n,t,u=this._form.getElementsByTagName("input"),f=u.length;for(this._handlingClick=!0,i=0;i<f;i++)r=u[i],n=this._layers[r.layerId],t=n.overlay?this._overlaysContainer:this._map,r.checked&&!t.hasLayer(n.layer)?t.addLayer(n.layer):!r.checked&&t.hasLayer(n.layer)&&t.removeLayer(n.layer);this._handlingClick=!1;this._refocusOnMap()}})},{leaflet:"leaflet"}],3:[function(n,t){function f(n){var t=u[n];return t||(t=u[n]=i.icon({iconUrl:n,iconSize:[32,32],iconAnchor:[16,16],popupAnchor:[0,-19]})),t}var i=n("leaflet"),e=n("xhr"),o=n("./popup"),r,u;n("leaflet.markercluster");r=i.MarkerClusterGroup.extend({initialize:function(n){this._gamcgGroupLayers={};i.MarkerClusterGroup.prototype.initialize.call(this,n)},addLayer:function(n){var t=n instanceof i.LayerGroup;return t&&(this._gamcgGroupLayers[i.stamp(n)]=n),i.MarkerClusterGroup.prototype.addLayer.call(this,n),this._map&&t&&this._map.fire("layeradd",{layer:n}),this},removeLayer:function(n){var t=n instanceof i.LayerGroup;return t&&delete this._gamcgGroupLayers[i.stamp(n)],i.MarkerClusterGroup.prototype.removeLayer.call(this,n),this._map&&t&&this._map.fire("layerremove",{layer:n}),this},hasLayer:function(n){var t=n instanceof i.LayerGroup;return t?!!this._gamcgGroupLayers[i.stamp(n)]:i.MarkerClusterGroup.prototype.hasLayer.call(this,n)}});t.exports=i.Class.extend({options:{showCoverageOnHover:!1,disableClusteringAtZoom:11,allowInteraction:!0,defaultVisibleCategories:{},useOverlays:!1},includes:i.Mixin.Events,initialize:function(n,t,u,f){i.setOptions(this,f);this._url=n;this._useClustering=t;this._createPopupContent=u;this._markerLayer=i.layerGroup();this._clusterLayer=new r(i.extend({},this.options,{iconCreateFunction:function(n){var t=n.getChildCount(),r="marker-icon"+(i.Browser.retina?"-2x":"")+".png";return new i.DivIcon({html:'<div><img src="/assets/img/leaflet/'+r+'" style="width:25px;height:41px;"><span>'+t+"<\/span><\/div>",className:"marker-cluster",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34]})}}))},addTo:function(n){return n.addLayer(this),this},onAdd:function(n){this._map=n;this._markerLayers?this._map.addLayer(this.getLayersContainer()):this._loadData(i.bind(function(n){if(n)return console.warn(n);this.fire("containerchange",{container:this.getLayersContainer()});this._addData();this._map.addLayer(this.getLayersContainer())},this))},onRemove:function(){this._map.removeLayer(this.getLayersContainer());this._map=null},setClustering:function(n){if(this._map&&this._useClustering!==n){var t=this.getLayersContainer();t.clearLayers();this._map.removeLayer(t);this._useClustering=n;this._addData();this._map.addLayer(this.getLayersContainer());this.fire("containerchange",{container:this.getLayersContainer()})}else this._useClustering=n},setClusteringMaxZoom:function(n){var t=this._clusterLayer;this.options.disableClusteringAtZoom=n;this._clusterLayer=new r(this.options);this._map&&this._useClustering&&(this.fire("containerchange",{container:this._clusterLayer}),this._map.removeLayer(t),t.clearLayers(),this._addData(),this._map.addLayer(this._clusterLayer))},setInteraction:function(n){this.options.allowInteraction=n},getLayersContainer:function(){return this._useClustering?this._clusterLayer:this._markerLayer},_loadData:function(n){e(this._url,i.bind(function(t,r,u){if(t)return n(t);var e=JSON.parse(u);this._markerLayers=e.categories.map(i.bind(function(n){var t=new i.layerGroup([]);return t.description=n.description,n.lists.forEach(i.bind(function(n){var r=f(n.icon32x32),u=n.markers.map(i.bind(function(n){return this._createMarker(r,n)},this));u.forEach(function(n){n.addTo(t)})},this)),t},this));n(null,this._markerLayers)},this))},_addData:function(){var n=this.getLayersContainer();this._markerLayers.forEach(i.bind(function(t){var i=this.options.defaultVisibleCategories[t.description],r=i===undefined||i;r&&n.addLayer(t);this.fire("layeradd",{layer:t,description:t.description})},this))},_createMarker:function(n,t){var f=this._createPopupContent,u=f(t),r=i.marker(u.position,{icon:n});r.on("click",function(){if(this.options.allowInteraction){this._clickPopup=new o({offset:n.options.popupAnchor,useOverlay:this.options.useOverlays}).setLatLng(r.getLatLng()).setContent(u.click).openOn(this._map);this._map.once("popupclose",function(){this._clickPopup=null},this)}},this).on("mouseover",function(){this.options.allowInteraction&&!this._clickPopup&&(this._hoverPopup=i.popup({offset:n.options.popupAnchor}).setLatLng(r.getLatLng()).setContent(u.hover).openOn(this._map))},this).on("mouseout",function(){this._hoverPopup&&this._map.closePopup(this._hoverPopup)},this);return r}});u={}},{"./popup":26,leaflet:"leaflet","leaflet.markercluster":"leaflet.markercluster",xhr:24}],4:[function(){},{}],5:[function(n,t){function u(n,t,i){if(!s(t))throw new TypeError("iterator must be a function");arguments.length<3&&(i=this);r.call(n)==="[object Array]"?f(n,t,i):typeof n=="string"?e(n,t,i):o(n,t,i)}function f(n,t,r){for(var u=0,f=n.length;u<f;u++)i.call(n,u)&&t.call(r,n[u],u,n)}function e(n,t,i){for(var r=0,u=n.length;r<u;r++)t.call(i,n.charAt(r),r,n)}function o(n,t,r){for(var u in n)i.call(n,u)&&t.call(r,n[u],u,n)}var s=n("is-function"),r,i;t.exports=u;r=Object.prototype.toString;i=Object.prototype.hasOwnProperty},{"is-function":7}],6:[function(n,t){(function(n){t.exports=typeof window!="undefined"?window:typeof n!="undefined"?n:typeof self!="undefined"?self:{}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],7:[function(n,t){function i(n){var t=r.call(n);return t==="[object Function]"||typeof n=="function"&&t!=="[object RegExp]"||typeof window!="undefined"&&(n===window.setTimeout||n===window.alert||n===window.confirm||n===window.prompt)}t.exports=i;var r=Object.prototype.toString},{}],8:[function(n,t){(function(i){"use strict";var r=typeof window!="undefined"?window.L:typeof i!="undefined"?i.L:null,u=n("reqwest");r.Realtime=r.GeoJSON.extend({includes:r.Mixin.Events,options:{start:!0,interval:6e4,getFeatureId:function(n){return n.properties.id},updateFeature:function(n,t,i){return n.geometry.type==="Point"?(t.setLatLng(i.getLatLng()),t):i},cache:!1},initialize:function(n,t){r.GeoJSON.prototype.initialize.call(this,undefined,t);this._src=typeof n=="function"?n:r.bind(function(t,i){var r=this.options.cache?n:this._bustCache(n);u(r).then(t,i)},this);this._features={};this._featureLayers={};this.options.start&&this.start()},start:function(){return this._timer||(this._timer=setInterval(r.bind(this.update,this),this.options.interval),this.update()),this},stop:function(){return this._timer&&(clearTimeout(this._timer),delete this._timer),this},isRunning:function(){return this._timer},update:function(n){var t,i;return n?this._onNewData(!1,n):(t=r.bind(function(n){this._onNewData(!0,n)},this),i=r.bind(this._onError,this),this._src(t,i)),this},remove:function(n){for(var u=r.Util.isArray(n)?n:n.features?n.features:[n],f={},t,i=0,e=u.length;i<e;i++)t=this.options.getFeatureId(u[i]),this.removeLayer(this._featureLayers[t]),f[t]=this._features[t],delete this._features[t],delete this._featureLayers[t];return this.fire("update",{features:this._features,enter:{},update:{},exit:f}),this},getLayer:function(n){return this._featureLayers[n]},getFeature:function(n){return this._features[n]},_onNewData:function(n,t){var u=this.options.onEachFeature,f=[],e={},o={},s={},h={},i;for(this.options.onEachFeature=r.bind(function(n,t){var i,r,h;u&&u(n,t);i=this.options.getFeatureId(n);r=this._featureLayers[i];r?(h=this.options.updateFeature(n,r,t),h!==r&&this.removeLayer(r),h!==t&&f.push(t),t=h,s[i]=n):o[i]=n;this._featureLayers[i]=t;this._features[i]=e[i]=n},this),this.addData(t),n&&(h=this._removeUnknown(e)),i=0;i<f.length;i++)this.removeLayer(f[i]);this.fire("update",{features:this._features,enter:o,update:s,exit:h});this.options.onEachFeature=u},_onError:function(n,t){this.fire("error",{error:n,message:t})},_removeUnknown:function(n){var t,i={};for(t in this._featureLayers)n[t]||(this.removeLayer(this._featureLayers[t]),i[t]=this._features[t],delete this._featureLayers[t],delete this._features[t]);return i},_bustCache:function(n){function t(n){return n+r.Util.getParamString({_:(new Date).getTime()},n)}return typeof n=="string"||n instanceof String?t(n):r.extend({},n,{url:t(n.url)})}});r.realtime=function(n,t){return new r.Realtime(n,t)};r.Realtime.reqwest=u;t.exports=r.Realtime}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{reqwest:4}],9:[function(n,t){function i(n){var t=!1;return function(){if(!t)return t=!0,n.apply(this,arguments)}}t.exports=i;i.proto=i(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0})})},{}],10:[function(n,t){var i=n("trim"),r=n("for-each"),u=function(n){return Object.prototype.toString.call(n)==="[object Array]"};t.exports=function(n){if(!n)return{};var t={};return r(i(n).split("\n"),function(n){var e=n.indexOf(":"),r=i(n.slice(0,e)).toLowerCase(),f=i(n.slice(e+1));typeof t[r]=="undefined"?t[r]=f:u(t[r])?t[r].push(f):t[r]=[t[r],f]}),t}},{"for-each":5,trim:11}],11:[function(n,t,i){function r(n){return n.replace(/^\s*|\s*$/g,"")}i=t.exports=r;i.left=function(n){return n.replace(/^\s*/,"")};i.right=function(n){return n.replace(/\s*$/,"")}},{}],12:[function(n,t){var r=n("turf-distance"),i=n("turf-point"),u=n("turf-bearing"),f=n("turf-destination");t.exports=function(n,t,e){var o,h,s,c,l,a;if(n.type==="Feature")o=n.geometry.coordinates;else if(n.type==="LineString")o=n.geometry.coordinates;else throw new Error("input must be a LineString Feature or Geometry");for(h=0,s=0;s<o.length;s++)if(t>=h&&s===o.length-1)break;else{if(h>=t)return c=t-h,c?(l=u(i(o[s]),i(o[s-1]))-180,a=f(i(o[s]),c,l,e),a):i(o[s]);h+=r(i(o[s]),i(o[s+1]),e)}return i(o[o.length-1])}},{"turf-bearing":13,"turf-destination":14,"turf-distance":15,"turf-point":17}],13:[function(n,t){function i(n){return n*Math.PI/180}function r(n){return n*180/Math.PI}t.exports=function(n,t){var f=n.geometry.coordinates,e=t.geometry.coordinates,o=i(f[0]),s=i(e[0]),h=i(f[1]),u=i(e[1]),c=Math.sin(s-o)*Math.cos(u),l=Math.cos(h)*Math.sin(u)-Math.sin(h)*Math.cos(u)*Math.cos(s-o);return r(Math.atan2(c,l))}},{}],14:[function(n,t){function i(n){return n*Math.PI/180}function r(n){return n*180/Math.PI}var u=n("turf-point");t.exports=function(n,t,f,e){var c=n.geometry.coordinates,v=i(c[0]),s=i(c[1]),l=i(f),o=0,h,a;switch(e){case"miles":o=3960;break;case"kilometers":o=6373;break;case"degrees":o=57.2957795;break;case"radians":o=1}return h=Math.asin(Math.sin(s)*Math.cos(t/o)+Math.cos(s)*Math.sin(t/o)*Math.cos(l)),a=v+Math.atan2(Math.sin(l)*Math.sin(t/o)*Math.cos(s),Math.cos(t/o)-Math.sin(s)*Math.sin(h)),u([r(a),r(h)])}},{"turf-point":17}],15:[function(n,t){function i(n){return n*Math.PI/180}var r=n("turf-invariant");t.exports=function(n,t,u){r.featureOf(n,"Point","distance");r.featureOf(t,"Point","distance");var e=n.geometry.coordinates,o=t.geometry.coordinates,h=i(o[1]-e[1]),c=i(o[0]-e[0]),l=i(e[1]),a=i(o[1]),s=Math.pow(Math.sin(h/2),2)+Math.pow(Math.sin(c/2),2)*Math.cos(l)*Math.cos(a),v=2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)),f;switch(u){case"miles":f=3960;break;case"kilometers":case"kilometres":f=6373;break;case"degrees":f=57.2957795;break;case"radians":f=1;break;case undefined:f=6373;break;default:throw new Error('unknown option given to "units"');}return f*v}},{"turf-invariant":16}],16:[function(n,t){function i(n,t,i){if(!t||!i)throw new Error("type and name required");if(!n||n.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+n.type);}function r(n,t,i){if(!i)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!n.geometry||n.geometry.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+n.geometry.type);}function u(n,t,i){var u,r;if(!i)throw new Error(".collectionOf() requires a name");if(!n||n.type!=="FeatureCollection")throw new Error("Invalid input to "+i+", FeatureCollection required");for(u=0;u<n.features.length;u++){if(r=n.features[u],!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!r.geometry||r.geometry.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+r.geometry.type);}}t.exports.geojsonType=i;t.exports.collectionOf=u;t.exports.featureOf=r},{}],17:[function(n,t){var i=Array.isArray||function(n){return Object.prototype.toString.call(n)==="[object Array]"};t.exports=function(n,t){if(!i(n))throw new Error("Coordinates must be an array");if(n.length<2)throw new Error("Coordinates must be at least 2 numbers long");return{type:"Feature",geometry:{type:"Point",coordinates:n},properties:t||{}}}},{}],18:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14,"turf-point":19}],19:[function(n,t,i){arguments[4][17][0].apply(i,arguments)},{dup:17}],20:[function(n,t){var r=n("turf-distance"),i=n("turf-point");t.exports=function(n,t){var u,e,f;if(n.type==="Feature")u=n.geometry.coordinates;else if(n.type==="LineString")u=n.geometry.coordinates;else throw new Error("input must be a LineString Feature or Geometry");for(e=0,f=0;f<u.length-1;f++)e+=r(i(u[f]),i(u[f+1]),t);return e}},{"turf-distance":21,"turf-point":23}],21:[function(n,t,i){arguments[4][15][0].apply(i,arguments)},{dup:15,"turf-invariant":22}],22:[function(n,t,i){arguments[4][16][0].apply(i,arguments)},{dup:16}],23:[function(n,t,i){arguments[4][17][0].apply(i,arguments)},{dup:17}],24:[function(n,t){"use strict";function e(n,t){for(var i=0;i<n.length;i++)t(n[i])}function o(n){for(var t in n)if(n.hasOwnProperty(t))return!1;return!0}function r(n,t,i){var r=n;return c(t)?(i=t,typeof n=="string"&&(r={uri:n})):r=a(t,{uri:n}),r.callback=i,r}function i(n,t,i){return t=r(n,t,i),u(t)}function u(n){function d(){t.readyState===4&&p()}function g(){var n=undefined;if(t.response?n=t.response:t.responseType!=="text"&&t.responseType||(n=t.responseText||t.responseXML),k)try{n=JSON.parse(n)}catch(i){}return n}function s(n){clearTimeout(y);n instanceof Error||(n=new Error(""+(n||"Unknown XMLHttpRequest Error")));n.statusCode=0;u(n,c)}function p(){var r,i,e;w||(clearTimeout(y),r=n.useXDR&&t.status===undefined?200:t.status===1223?204:t.status,i=c,e=null,r!==0?(i={body:g(),statusCode:r,method:f,headers:{},url:a,rawRequest:t},t.getAllResponseHeaders&&(i.headers=l(t.getAllResponseHeaders()))):e=new Error("Internal XMLHttpRequest Error"),u(e,i,i.body))}var u=n.callback,c,t;if(typeof u=="undefined")throw new Error("callback argument missing");u=h(u);c={body:undefined,headers:{},statusCode:0,method:f,url:a,rawRequest:t};t=n.xhr||null;t||(t=n.cors||n.useXDR?new i.XDomainRequest:new i.XMLHttpRequest);var e,w,a=t.url=n.uri||n.url,f=t.method=n.method||"GET",b=n.body||n.data||null,r=t.headers=n.headers||{},v=!!n.sync,k=!1,y;if("json"in n&&(k=!0,r.accept||r.Accept||(r.Accept="application/json"),f!=="GET"&&f!=="HEAD"&&(r["content-type"]||r["Content-Type"]||(r["Content-Type"]="application/json"),b=JSON.stringify(n.json))),t.onreadystatechange=d,t.onload=p,t.onerror=s,t.onprogress=function(){},t.ontimeout=s,t.open(f,a,!v,n.username,n.password),v||(t.withCredentials=!!n.withCredentials),!v&&n.timeout>0&&(y=setTimeout(function(){w=!0;t.abort("timeout");var n=new Error("XMLHttpRequest timeout");n.code="ETIMEDOUT";s(n)},n.timeout)),t.setRequestHeader)for(e in r)r.hasOwnProperty(e)&&t.setRequestHeader(e,r[e]);else if(n.headers&&!o(n.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in n&&(t.responseType=n.responseType),"beforeSend"in n&&typeof n.beforeSend=="function"&&n.beforeSend(t),t.send(b),t}function s(){}var f=n("global/window"),h=n("once"),c=n("is-function"),l=n("parse-headers"),a=n("xtend");t.exports=i;i.XMLHttpRequest=f.XMLHttpRequest||s;i.XDomainRequest="withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:f.XDomainRequest;e(["get","put","post","patch","head","delete"],function(n){i[n==="delete"?"del":n]=function(t,i,f){return i=r(t,i,f),i.method=n.toUpperCase(),u(i)}})},{"global/window":6,"is-function":7,once:9,"parse-headers":10,xtend:25}],25:[function(n,t){function i(){for(var u={},n,t,i=0;i<arguments.length;i++){n=arguments[i];for(t in n)r.call(n,t)&&(u[t]=n[t])}return u}t.exports=i;var r=Object.prototype.hasOwnProperty},{}],26:[function(n,t){var i=n("leaflet");t.exports=i.Popup.extend({options:{useOverlay:!1},initialize:function(n,t){i.Popup.prototype.initialize.call(this,n,t)},onAdd:function(n){if(!this.options.useOverlay)return i.Popup.prototype.onAdd.call(this,n);this._map=n;this._container||this._initOverlayLayout();n._panes.popupOverlayPane=i.DomUtil.create("div","overlay-pane",n._container);n._panes.popupOverlayPane.appendChild(this._container);this.options.maxWidth=this.options.minWidth=this._container.offsetWidth;this.update()},onRemove:function(n){if(!this.options.useOverlay)return i.Popup.prototype.onRemove.call(this,n);n._container.removeChild(n._panes.popupOverlayPane);n._panes.popupOverlayPane=null;i.Util.falseFn(this._container.offsetWidth);n.off(this._getEvents(),this);n.options.fadeAnimation&&i.DomUtil.setOpacity(this._container,0);this._map=null;this.fire("close");n.fire("popupclose",{popup:this});this._source&&this._source.fire("popupclose",{popup:this})},update:function(){if(!this.options.useOverlay)return i.Popup.prototype.update.call(this);this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._container.style.visibility="")},_initOverlayLayout:function(){var r="leaflet-popup",u=this._container=i.DomUtil.create("div","overlay-popup"),n,t;if(this.options.closeButton){n=this._closeButton=i.DomUtil.create("a",r+"-close-button",u);n.href="#close";n.innerHTML="&#215;";i.DomEvent.disableClickPropagation(n);i.DomEvent.on(n,"click",this._onCloseButtonClick,this)}t=this._wrapper=i.DomUtil.create("div",r+"-content-wrapper",u);i.DomEvent.disableClickPropagation(t);this._contentNode=i.DomUtil.create("div",r+"-content",t);i.DomEvent.disableScrollPropagation(this._contentNode);i.DomEvent.on(t,"contextmenu",i.DomEvent.stopPropagation)}})},{leaflet:"leaflet"}],27:[function(n,t){var i=n("leaflet"),o=n("xhr"),s=n("turf-destination"),c=Math.PI/180;n("leaflet-realtime");var u=i.Marker.extend({options:{angle:0},_setPos:function(n){if(i.Marker.prototype._setPos.call(this,n),i.DomUtil.TRANSFORM)this._icon.style[i.DomUtil.TRANSFORM]+=" rotate("+this.options.angle+"deg)";else if(i.Browser.ie){var t=this.options.angle*i.LatLng.DEG_TO_RAD,r=Math.cos(t),u=Math.sin(t);this._icon.style.filter+=" progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11="+r+", M12="+-u+", M21="+u+", M22="+r+")"}}}),r=i.icon({iconUrl:"/assets/img/ferry.png",iconRetinaUrl:"/assets/img/ferry@2x.png",iconSize:[12,24],iconAnchor:[6,12],popupAnchor:[0,-14]}),f=i.icon({iconUrl:"/assets/img/anchor.png",iconRetinaUrl:"/assets/img/anchor@2x.png",iconSize:[18,18],iconAnchor:[9,9],popupAnchor:[0,-14]}),h=u.extend({options:{icon:r,texts:{speed:"Speed",heading:"Heading",knots:"knots",degrees:"&deg;"}},initialize:function(n,t){t.angle=n.properties.dHeading;i.setOptions(this,t);var r=n.geometry.coordinates,f=i.latLng(r[1],r[0]);this._feature=n;u.prototype.initialize.call(this,f,t);this.updateData(n)},updateData:function(n){var t=n.geometry.coordinates,e=i.latLng(t[1],t[0]),u=Math.round(n.properties.dSoG);u===0&&this.options.icon!==f?(this.setIcon(f),this.options.angle=0):u!==0&&(this.options.angle=n.properties.dHeading,this.options.icon!==r&&this.setIcon(r));this.setLatLng(e);this._feature=n;this._bindPopup()},_bindPopup:function(){var n=this._feature.properties,t=Math.round(n.dSoG);this.bindPopup('<h3 class="infobox-header stenalight-blue">'+n.sName+'<\/h3><div class="infobox-content"><dl><dt>'+this.options.texts.speed+"<\/dt><dd>"+t+" "+this.options.texts.knots+"<\/dd>"+(t?"<dt>"+this.options.texts.heading+"<\/dt><dd>"+Math.round(n.dHeading)+this.options.texts.degrees+"<\/dd>":"")+"<\/dl><\/div>")}}),e=function(n,t){return{type:"FeatureCollection",features:n.features.map(function(n){var i=Number(n.properties.dSoG)*1.852,r=Math.min(15,Number(n.properties.ageMinutes)+t/6e4)/60,u=i*r;return{type:"Feature",properties:n.properties,geometry:s(n,u,n.properties.dHeading,"kilometers").geometry}})}};t.exports=i.Realtime.extend({initialize:function(n){var t,r,u;i.Realtime.prototype.initialize.call(this,function(n,i){var f=(new Date).getTime();!t||f-t>=6e4?(r&&r.abort(),r=o({uri:"/services/RealtimeShipsService.ashx",headers:{"Content-Type":"application/json"}},function(o,s,h){if(t=f,r=null,o||s.statusCode!==200)return i(o||"HTTP "+s.statusCode+" "+h);try{u=JSON.parse(h);n(e(u,f-t))}catch(c){i(c)}})):u&&n(e(u,f-t))},i.extend({pointToLayer:i.bind(function(n){return new h(n,this.options)},this),getFeatureId:function(n){return n.properties.nMMSI},updateFeature:function(n,t){return t.updateData(n),t},filter:function(n){return n.properties.ageMinutes<=40},interval:3e3},n))}})},{leaflet:"leaflet","leaflet-realtime":8,"turf-destination":18,xhr:24}],28:[function(n,t){function r(n){return n.split(",").map(Number).reverse()}function u(n,t){var i;if(t.Geometry&&(i=t.Geometry,typeof i=="string"||i instanceof String))try{i=JSON.parse(i)}catch(u){console.warn("Can't parse route geometry: "+u);i=null}return i||(i={type:"LineString",coordinates:t.Coordinates.map(r)}),{type:"Feature",properties:{style:n,route:t},geometry:i}}function f(n){var t,i,f;return t=r(n.MarkerCoordinate),t&&t.length===2&&t[0]&&t[1]||(i=u(null,n),f=s(i,"kilometers"),t=h(i,f/2,"kilometers").geometry.coordinates),{type:"Feature",properties:{route:n},geometry:{type:"Point",coordinates:t}}}function e(n){return[].concat.apply([],n)}function o(n,t){var u,r;return u=window.STENA?window.STENA.templates.map_route_info_box:i.Util.template.bind(null,'<div class="infobox"><div class="infobox-header stenalight-blue">{Name}<\/div><div class="infobox-content">{BodyText}<\/div><p class="legend"> <span class="legend-title">{FromPriceText}<\/span> <span class="legend-value bold">{FromPrice}<\/span><\/p><p class="legend"> <span class="legend-title">{TravelTimeText}<\/span> <span class="legend-value bold">{TravelTime}<\/span><\/p><div class="book-now-link"> <a class="standard" href="{Links.0.Value}">{Links.0.Text}<\/a><\/div><\/div><\/div>'),r=u(n),window.$&&window._utils&&window._utils.renderLegends&&(r=window.$(r),_utils.renderLegends(r,!1,290),r=r[0]),new l({useOverlay:t.useOverlays}).setContent(r)}var i=n("leaflet"),s=n("turf-line-distance"),h=n("turf-along"),c=n("xhr"),l=n("./popup"),a=i.icon({iconUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAFElEQVR4XgXAAQ0AAABAMP1L30IDCPwC/o5WcS4AAAAASUVORK5CYII=",iconSize:[30,40],iconAnchor:[16,20],popupAnchor:[-4,-8],className:"marker route"});t.exports=i.GeoJSON.extend({options:{useOverlays:!1},initialize:function(n,t){this._interactive=n;this._layers=[];i.GeoJSON.prototype.initialize.call(this,null,i.extend({},{pointToLayer:i.bind(function(n){var t=[n.geometry.coordinates[1],n.geometry.coordinates[0]];return i.marker(t,{icon:a})},this),style:function(n){return n.properties.style},onEachFeature:i.bind(function(n,t){t.on("click",this._onFeatureClick,this)},this)},t))},setInteractive:function(n){this._interactive=n},onAdd:function(n){i.GeoJSON.prototype.onAdd.call(this,n);this._dataLoaded||(this._dataLoaded=!0,c({url:"/services/RouteMapService.ashx"},i.bind(function(n,t,i){if(n)return console.warn("Failed to map routes:",n);var o=JSON.parse(i),r=e([{color:"black",weight:5,opacity:.4},{color:"white",weight:4,opacity:.8},{color:"#2864cb",weight:2,opacity:1}].map(function(n){return o.map(u.bind(null,n))}));r=r.concat(o.map(f));this.addData(r)},this)))},_onFeatureClick:function(n){if(this._interactive){var t=n.target,i=t.feature,r=i.geometry.type==="Point"?t.getLatLng():n.latlng;o(i.properties.route,this.options).setLatLng(r).openOn(this._map)}}})},{"./popup":26,leaflet:"leaflet","turf-along":12,"turf-line-distance":20,xhr:24}],29:[function(n,t){var i=n("leaflet"),r=n("xhr");t.exports=i.Control.extend({options:{zIndex:10,forecaCategories:{Weather:62,Wind:21},lang:"en",collapse:!1},includes:i.Mixin.Events,initialize:function(n,t){i.setOptions(this,t);this._cid=n;this._category=this.options.forecaCategories[Object.keys(this.options.forecaCategories)[0]]},onAdd:function(n){this._map=n;var t=i.DomUtil.create("div","leaflet-bar weather-control"),r=i.DomUtil.create("ul","category-list",t),u=Object.keys(this.options.forecaCategories).map(i.bind(function(n){var u=i.DomUtil.create("li",null,r),t=i.DomUtil.create("a",null,u);t.href="#";t.innerHTML=n;t.setAttribute("data-category",this.options.forecaCategories[n]);i.DomEvent.on(t,"click",this._selectCategory,this);return t},this));if(this._selectCategory({target:u[0]}),this._timeList=i.DomUtil.create("ul","time-list",t),this._updateAvailableTimestamps(),this.options.collapse){i.DomUtil.addClass(this._timeList,"collapsed");this._currentTimeEl=i.DomUtil.create("a","expand-collapse collapsed",t);this._currentTimeEl.href="#";this._currentTimeText=i.DomUtil.create("span","",this._currentTimeEl);i.DomUtil.create("span","expand-indicator",this._currentTimeEl);i.DomEvent.on(this._currentTimeEl,"click",this._toggle,this)}return t},setInteractive:function(n){return this._container.style.display=n?"":"none",this},onRemove:function(n){n.removeLayer(this._layer);delete this._map},_getTileUrl:function(n,t){return"http://gma.foreca.com/tile.php?x={x}&y={y}&z={z}&t="+n+"&p="+t+"&cid="+this._cid},_updateAvailableTimestamps:function(){var n=this._map.getCenter(),t="http://gma.foreca.com/info-json.php?lon="+n.lng+"&lat="+n.lat+"&cid="+this._cid;r(t,i.bind(function(n,t,r){var u;if(n)return u="Error getting forecast timestamps from Foreca.",console.warn(u,n),this.fire("error",{message:u,error:n});var o=JSON.parse(r),e=o[this._category],f=e.UTC.map(i.bind(function(n,t){var i=e.Local[t].toString(),r=i.substring(0,4),u=i.substring(4,6),f=i.substring(6,8),o=i.substring(8,10),s=i.substring(10,12),h=new Date(r+"-"+u+"-"+f);return{text:h.toLocaleDateString(this.options.lang,{weekday:"short",day:"numeric"})+" "+o+":"+s,time:n.toString()}},this));this._currentTime=f[0].time;this._currentTimeEl&&(this._currentTimeText.innerHTML=f[0].text);this._updateTimeList(f);this._updateTileUrl()},this))},_updateTimeList:function(n){while(this._timeList.children.length)this._timeList.removeChild(this._timeList.firstChild);var t=n.map(i.bind(function(n){var r=i.DomUtil.create("li",null,this._timeList),t=i.DomUtil.create("a",null,r);t.setAttribute("data-time",n.time);t.href="#";t.innerHTML=n.text;i.DomEvent.on(t,"mouseover",this._hover,this);i.DomEvent.on(t,"click",function(n){this._hover(n);this._currentTimeEl&&this._toggle()},this);return t},this));this._hover({target:t[0]})},_hover:function(n){var t=n.target;this._hover.current!==t&&(this._hover.current&&i.DomUtil.removeClass(this._hover.current,"selected"),this._currentTime=t.getAttribute("data-time"),this._updateTileUrl(),this._currentTimeEl&&(this._currentTimeText.innerHTML=t.innerHTML),i.DomUtil.addClass(t,"selected"),this._hover.current=t,i.DomEvent.preventDefault(n))},_selectCategory:function(n){this._setCategory(n.target.getAttribute("data-category"));this._currentCategoryEl&&i.DomUtil.removeClass(this._currentCategoryEl,"selected");this._currentCategoryEl=n.target;i.DomUtil.addClass(this._currentCategoryEl,"selected");i.DomEvent.preventDefault(n)},_setCategory:function(n){this._category=n;this._updateTileUrl()},_updateTileUrl:function(){this._setTileUrl(this._getTileUrl(this._currentTime,this._category))},_setTileUrl:function(n){this._layer?this._layer.setUrl(n):this._layer=i.tileLayer(n,this.options);this._map&&!this._map.hasLayer(this._layer)&&this._map.addLayer(this._layer)},_toggle:function(){var t=i.DomUtil.hasClass(this._timeList,"collapsed"),n=t?"removeClass":"addClass";i.DomUtil[n](this._timeList,"collapsed");i.DomUtil[n](this._currentTimeEl,"collapsed")}})},{leaflet:"leaflet",xhr:24}],"stena-map-widget":[function(n,t){function a(n){function t(n){Object.keys(n).filter(function(n){return n.indexOf("ControlOptions")>=0}).forEach(function(t){if(n[t]&&n[t].position){var i=Number(n[t].position);isNaN(i)||(n[t].position={1:"topleft",2:"topleft",3:"topright",4:"topleft",5:"topleft",7:"topright",8:"bottomright",9:"bottomright",10:"bottomleft",11:"bottomright",12:"bottomright"}[i])}})}t(n);t(n.options);n.markerPosition||(n.markerPosition=n.options.center);n.options.weatherOptions||(n.options.weatherOptions={position:"bottomright"});n.defaultVisibleCategories||(n.defaultVisibleCategories={})}function u(n){if(!(this instanceof u))return new u(n);if(this.setConfig(n),!c&&!s){c=!0;var t="readyState"in document?/loaded|complete/.test(document.readyState):!!document.body;t?f():document.addEventListener?window.addEventListener("load",f,!1):document.attachEvent&&window.attachEvent("onload",f)}}function f(){e()}function e(){var t,n,i;if(!r)return r={MapTypeMap:"Map",MapTypeSatellite:"Satellite",WeatherTypeWeather:"Weather",WeatherTypeWind:"Wind",RealtimeSpeed:"Speed",RealtimeHeading:"Heading",RealtimeKnots:"knots"},h("/services/AppTextsJson.aspx?type=maps",function(n,t,i){if(n||t.statusCode!==200)console.warn("Could not load map widget I18N:",n||t.statusCode+" "+t.body);else try{r=JSON.parse(i)||r}catch(u){console.warn("Could not parse map widget I18N:",u)}e()});if(t=rt.pop(),!t){s=!0;l.forEach(function(n){n()});return}n=document.createElement("script");n.src=t;i=!1;n.onload=n.onreadystatechange=function(){i||this.readyState&&this.readyState!=="loaded"&&this.readyState!=="complete"||(i=!0,e())};document.body.appendChild(n)}function v(){window.scForm&&window.scForm.handleKey&&(window.scForm.handleKey=function(){})}var i=n("leaflet"),y=n("events").EventEmitter,p=n("inherits"),w=n("./stena-map-widget-render"),ut=n("fs"),h=n("xhr"),b=n("./markers-layer"),k=n("./base-layers"),d=n("./route-layer"),g=n("./layer-control"),nt=n("./weather-control"),tt=n("./realtime-layer"),o="pk.eyJ1Ijoic3RlbmFsaW5lIiwiYSI6ImNpa2kycjh2YjAwMm13OW00aGthdXRsbDkifQ.wtHKsCgrqLtqqzPXkxx0yw",it="eyJvcHRpb25zIjp7ImNlbnRlciI6WzU3Ljg4MTU5NTg1Mzc4NzcyLDExLjQ4MDE3NTIzNDM3NDk5N10sInpvb20iOjcsInpvb21Db250cm9sT3B0aW9ucyI6eyJwb3NpdGlvbiI6InRvcGxlZnQifSwic3R5bGVzIjpudWxsLCJkaXNhYmxlRGVmYXVsdFVJIjp0cnVlLCJ6b29tQ29udHJvbCI6dHJ1ZSwibWFwVHlwZUlkIjoic3RyZWV0cyIsIm1hcFR5cGVDb250cm9sIjp0cnVlLCJtYXBUeXBlQ29udHJvbE9wdGlvbnMiOnsic3R5bGUiOjEsInBvc2l0aW9uIjoiYm90dG9tcmlnaHQifSwic2NhbGVDb250cm9sIjp0cnVlfSwic3RhdGljIjp0cnVlLCJ3aWR0aCI6NjQwLCJoZWlnaHQiOjQ4MCwic3RhdGljVXJsIjoiaHR0cDovL21hcHMuZ29vZ2xlYXBpcy5jb20vbWFwcy9hcGkvc3RhdGljbWFwP2NlbnRlcj01Ny44ODE1OTYsMTEuNDgwMTc1Jnpvb209NyZmb3JtYXQ9cG5nJnNlbnNvcj1mYWxzZSZzaXplPTY0MHg0ODAmbWFwdHlwZT1yb2FkbWFwIiwibWFwTGF5ZXIiOiJzdHJlZXRzIiwic2F0ZWxsaXRlTGF5ZXIiOiJzYXRlbGxpdGUiLCJjbHVzdGVyTWF4Wm9vbSI6IDExfQ==",r;i.Icon.Default.imagePath="/assets/img/leaflet";i.LatLng.prototype.toUrlValue=function(){return this.lat.toFixed(5)+","+this.lng.toFixed(5)};t.exports=u;p(u,y);u.prototype.setConfig=function(n){n=n||{};this.design=n.design;this.config=(n.config||it).replace(/ /g,"+");this.lists=n.lists||"";this.categories=n.categories||"";var t=this;!n.config&&this.design&&setTimeout(function(){t.emit("config",t.config)})};u.prototype.appendTo=function(n){function t(){i.design&&v();i._show()}this.el=n;var i=this;s?t():l.push(t)};u.prototype.remove=function(){this.el&&(this.el.parentNode.removeChild(this.el),this.el=null)};u.prototype._show=function(){function v(){var n=["dragging","touchZoom","doubleClickZoom","scrollWheelZoom","boxZoom","keyboard","tap"];if(rt){i.DomUtil.removeClass(it,"map-no-interaction");v.overlay&&(it.removeChild(v.overlay),v.overlay=null);i.DomEvent.on(it,"keydown",pi)}else{v.overlay=v.overlay||i.DomUtil.create("div","map-static-overlay",it);n.forEach(function(n){t[n]&&t[n].disable()});t.once("click",function(){n.forEach(function(n){t[n]&&t[n].enable()});e.allowInteraction(!0)});i.DomUtil.addClass(it,"map-no-interaction");t.closePopup()}bt.setInteractive(rt)}function kt(n,t,i,r){l[n]={property:t,control:i,showWhenStatic:r}}function wi(){Object.keys(l).forEach(function(i){var u=l[i],r=u.control,f=n.options[u.property]&&(u.showWhenStatic||rt);try{t.removeControl(r)}catch(e){}f&&(t.addControl(r),r.setInteractive&&r.setInteractive(rt))}.bind(this))}function bi(){t.on("overlayadd",function(t){n.defaultVisibleCategories[t.layer.description]=!0;f()}).on("overlayremove",function(t){n.defaultVisibleCategories[t.layer.description]=!1;f()});i.DomEvent.on(hi,"click",function(){var n=lt.parentNode.classList.contains("min");lt.parentNode.classList.remove("min");lt.parentNode.classList.remove("max");lt.parentNode.classList.add(n?"max":"min");hi.textContent=n?"-":"≣"});i.DomEvent.on(ni,"change",function(){n.options.zoomControl=ni.checked;at.parentNode.style.display=ni.checked?"block":"none";f()});i.DomEvent.on(ti,"change",function(){n.options.mapTypeControl=ti.checked;vt.parentNode.style.display=ti.checked?"block":"none";f()});i.DomEvent.on(et,"change",function(){n.options.mapTypeId=et.value;var i=y[et.value],u=l.layer.control,o=!n.options.mapTypeControl,e=et.value.indexOf("satellite")<0;i!==p&&(o&&u.addTo(t),t.removeLayer(p),u.removeLayer(y[e?n.mapLayer:n.satelliteLayer]),i.addTo(t),u.addBaseLayer(i,r[e?"MapTypeMap":"MapTypeSatellite"]),p=i,n[e?"mapLayer":"satelliteLayer"]=et.value,o&&t.removeControl(u));f()});i.DomEvent.on(ci,"change",function(){f()});i.DomEvent.on(li,"change",function(){f();n.showMarkerAtCenter?c():st()});i.DomEvent.on(ui,"change",function(){n.markerPosition=ui.value.split(" ").map(Number);st();c()});i.DomEvent.on(ai,"change",function(){f();n.loadMarkers?t.addLayer(s):t.removeLayer(s)});i.DomEvent.on(vi,"change",function(){f();n.showRoutes?bt.addTo(t):t.removeLayer(bt)});i.DomEvent.on(yi,"change",function(){f();n.showRealtime?(ut.addTo(t),ut.start()):(t.removeLayer(ut),ut.stop())});i.DomEvent.on(yt,"change",function(){n.options.showWeather=yt.checked;pt.parentNode.style.display=yt.checked?"block":"none";f()});i.DomEvent.on(ri,"change",function(){var t=l.layer.control;wt.parentNode.style.display=ri.checked?"block":"none";f();s.setClustering(n.loadCluster)});i.DomEvent.on(wt,"change",function(){n.clusterMaxZoom=Number(wt.value);f();s.setClusteringMaxZoom(n.clusterMaxZoom)});i.DomEvent.on(at,"change",function(){n.options.zoomControlOptions.position=at.value;l.zoom.control.setPosition(at.value);f()});i.DomEvent.on(vt,"change",function(){n.options.mapTypeControlOptions.position=vt.value;l.layer.control.setPosition(vt.value);f()});i.DomEvent.on(pt,"change",function(){n.options.weatherOptions.position=pt.value;l.weather.control.setPosition(pt.value);f()})}function ot(){return{center:new i.LatLng(n.options.center[0],n.options.center[1]),zoom:n.options.zoom,zoomControl:!1}}function f(){var n=ot();i.setOptions(t,n);wi();ft(n)}function ft(t){e.design&&(n.showMarkerAtCenter=li.checked,n.loadMarkers=ai.checked,n.showRoutes=vi.checked,n.showWeather=yt.checked,n.showRealtime=yi.checked,n.static=ci.checked,n.loadCluster=ri.checked,n.clusterMaxZoom=Number(wt.value),clearTimeout(ft.timer),ft.timer=setTimeout(function(){n.options.center=t.center;n.options.zoom=t.zoom;n.width=640;n.height=480;n.options.center=dt(n.options.center);n.staticUrl=di(t);e.emit("config",btoa(JSON.stringify(n)))},300))}function ei(){n.options.zoom=t.getZoom();n.options.center=dt(t.getCenter());nr.value=n.options.center.join(" ");ft(ot())}function dt(n){return n.toUrlValue().split(",")}function c(){var u=function(){ui.value=n.markerPosition.join(" ")},r;if(n.markerPosition=n.markerPosition||t.getCenter(),st(),r=c.marker=new i.Marker(n.markerPosition,{draggable:e.design}).addTo(t),u(),e.design)r.on("dragend",function(){n.markerPosition=dt(r.getLatLng());u();ft(ot())})}function st(){c.marker&&(t.removeLayer(c.marker),c.marker=null)}function ki(n){function u(n,u,f){var e,s,o,h;if(n)return oi(null,"Error geocoding: "+n),console.warn("Failed to geocode:",n);e=JSON.parse(f);e&&e.features&&e.features.length>0?(s=e.features[0],o=s.geometry.coordinates,o.reverse(),t.setView(o),h=i.popup().setLatLng(o).setContent('<h3 class="infobox-header stenalight-blue">'+s.text+"<\/h3>").openOn(t),setTimeout(function(){t.closePopup(h)},2500)):oi(null,"Cannot find "+r)}n.preventDefault();var r=document.querySelector(".search input").value;h({url:"https://api.mapbox.com/geocoding/v5/mapbox.places/"+encodeURIComponent(r)+".json?access_token="+o},u)}function oi(n,t){si();tr.textContent=n||t;ii.classList.add("status-widget-"+(n?"success":"error"));setTimeout(si,4e3)}function si(){ii.classList.remove("status-widget-success");ii.classList.remove("status-widget-error")}function di(i){var s=function(n){var t=n.getLatLng();return"pin-s+42a("+t.lng+","+t.lat+")"},f="https://api.mapbox.com/v4/",e=t.getCenter(),r=[],u=[];return r.push("mapbox."+(i.mapLayer||"streets")),n.showMarkerAtCenter&&u.push(s(c.marker)),u.length>0&&r.push(u.join(",")),r.push(e.lng+","+e.lat+","+t.getZoom()),r.push("640x480.png"),f+=r.join("/"),f+"?access_token="+o}var e=this,n,u,t,y,p,ht,l,ct;e.markers={};n=JSON.parse(atob(this.config));a(n);u=w(n,{design:this.design});this.view=u;var gt=window.matchMedia&&window.matchMedia("only screen and (max-width: 599px)").matches||document.body.width<600,gi=u.el,nr=u.position,it=u.mapEl,lt=u.design,hi=u.toggleDesign,rr=u.search,ni=u.showZoom,at=u.zoomPosition,ur=u.showPan,fr=u.panPosition,ti=u.showMapType,et=u.setMapType,vt=u.mapTypePosition,ii=u.status,tr=u.statusText,er=u.styles,ci=u.makeStatic,li=u.showMarkerAtCenter,rt=!n.static||this.design,ir=u.renderMarker,ai=u.loadMarkers,vi=u.showRoutes,yt=u.showWeather,yi=u.showRealtime,pt=u.weatherPosition,ri=u.loadCluster,wt=u.clusterMaxZoom,ui=u.markerPosition,pi=function(n){n.keyCode===27&&(e.allowInteraction(!1),i.DomEvent.off(it,"keypress",pi),i.DomEvent.preventDefault(n))};e.allowInteraction=function(i){if(i!==rt){rt=i;var r=t.getCenter();e.emit(i?"fullscreen":"normalscreen");t.invalidateSize();f();t.setView(r);v();st();n.showMarkerAtCenter&&c();s.setInteraction(i)}};this.el=this.el.appendChild(gi);t=new i.Map(it,ot());t.attributionControl.setPrefix("");y=k.reduce(function(n,t){var r=n[t]=i.tileLayer("https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}",{attribution:'© <a href="https://www.mapbox.com/about/maps/">Mapbox<\/a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap<\/a> <strong><a href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map<\/a><\/strong>',tileSize:512,maxZoom:18,zoomOffset:-1,id:"mapbox/streets-v11",accessToken:o});r.on("load",this.emit.bind(this,"tilesloaded"));return n}.bind(this),{});p=y[n.options.mapTypeId];p||(p=y.streets);p.addTo(t);var bt=new d(!0,{useOverlays:gt}),s=new b("/services/MapMarkers.ashx?categories="+e.categories+"&lists="+e.lists,n.loadCluster,ir,{disableClusteringAtZoom:n.options.clusterMaxZoom,allowInteraction:rt,useOverlays:gt}),ut=new tt({start:!1,texts:{speed:r.RealtimeSpeed,heading:r.RealtimeHeading,knots:r.RealtimeKnots,degrees:"&deg;"}}),fi={};fi[r.MapTypeMap]=y[n.mapLayer||"streets"];fi[r.MapTypeSatellite]=y[n.satelliteLayer||"satellite"];ht=new g(fi,null,s.getLayersContainer(),n.options.mapTypeControlOptions);s.on("layeradd",function(n){ht.addOverlay(n.layer,n.description)}).on("containerchange",function(n){ht.setOverlaysContainer(n.container)});l={};kt("layer","mapTypeControl",ht);kt("zoom","zoomControl",i.control.zoom(n.options.zoomControlOptions));ct={lang:document.querySelector("html").getAttribute("lang")||"en",forecaCategories:{},collapse:gt};ct.forecaCategories[r.WeatherTypeWeather]=62;ct.forecaCategories[r.WeatherTypeWind]=21;kt("weather","showWeather",new nt("uhe7hg9",i.extend(n.options.weatherOptions,ct)),!0);t.on("moveend",ei);t.on("zoomend",ei);v();f();s.setClustering(n.loadCluster);s.options.defaultVisibleCategories=n.defaultVisibleCategories;n.showMarkerAtCenter&&c();n.loadMarkers&&s.addTo(t);n.showRoutes&&bt.addTo(t);n.showRealtime&&(ut.addTo(t),ut.start());e.design&&bi();this.emit("loaded");this.loaded=!0;i.DomEvent.on(document.querySelector(".search"),"submit",ki)};var s=!1,c=!1,l=[],rt=["//cdnjs.cloudflare.com/ajax/libs/es5-shim/4.1.0/es5-shim.min.js","//cdnjs.cloudflare.com/ajax/libs/Base64/0.3.0/base64.min.js"]},{"./base-layers":1,"./layer-control":2,"./markers-layer":3,"./realtime-layer":27,"./route-layer":28,"./stena-map-widget-render":"/stena-map-widget-render.js","./weather-control":29,events:"events",fs:4,inherits:"inherits",leaflet:"leaflet",xhr:24}]},{},[])