WPR FM
uid=9814(b13i2mwmyrdbxio) php=8.4.28
info
cwd /data/sites/web/b13i2mwmyrdbxio/www |
naik
Buka
-
admin.js
1107954
x
-
block.js
649
x
-
dashboard.js
830
x
-
mapsmarkerpro.js
588280
x
-
shortcode.js
1585
x
Upload
Simpan
!function(){var t={10:function(t,e,i){var n,o;(()=>{var r=Object.create,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,h=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,p=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),u=(t,e,i)=>(i=null!=t?r(h(t)):{},((t,e,i,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let o of l(e))!c.call(t,o)&&o!==i&&s(t,o,{get:()=>e[o],enumerable:!(n=a(e,o))||n.enumerable});return t})(!e&&t&&t.__esModule?i:s(i,"default",{value:t,enumerable:!0}),t)),d=p(((t,e)=>{e.exports=function(){this.__data__=[],this.size=0}})),m=p(((t,e)=>{e.exports=function(t,e){return t===e||t!=t&&e!=e}})),f=p(((t,e)=>{var i=m();e.exports=function(t,e){for(var n=t.length;n--;)if(i(t[n][0],e))return n;return-1}})),g=p(((t,e)=>{var i=f(),n=Array.prototype.splice;e.exports=function(t){var e=this.__data__,o=i(e,t);return!(o<0)&&(o==e.length-1?e.pop():n.call(e,o,1),--this.size,!0)}})),_=p(((t,e)=>{var i=f();e.exports=function(t){var e=this.__data__,n=i(e,t);return n<0?void 0:e[n][1]}})),v=p(((t,e)=>{var i=f();e.exports=function(t){return i(this.__data__,t)>-1}})),y=p(((t,e)=>{var i=f();e.exports=function(t,e){var n=this.__data__,o=i(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}})),b=p(((t,e)=>{var i=d(),n=g(),o=_(),r=v(),s=y();function a(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}a.prototype.clear=i,a.prototype.delete=n,a.prototype.get=o,a.prototype.has=r,a.prototype.set=s,e.exports=a})),x=p(((t,e)=>{var i=b();e.exports=function(){this.__data__=new i,this.size=0}})),k=p(((t,e)=>{e.exports=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}})),w=p(((t,e)=>{e.exports=function(t){return this.__data__.get(t)}})),M=p(((t,e)=>{e.exports=function(t){return this.__data__.has(t)}})),C=p(((t,e)=>{var n="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;e.exports=n})),P=p(((t,e)=>{var i=C(),n="object"==typeof self&&self&&self.Object===Object&&self,o=i||n||Function("return this")();e.exports=o})),S=p(((t,e)=>{var i=P().Symbol;e.exports=i})),T=p(((t,e)=>{var i=S(),n=Object.prototype,o=n.hasOwnProperty,r=n.toString,s=i?i.toStringTag:void 0;e.exports=function(t){var e=o.call(t,s),i=t[s];try{t[s]=void 0;var n=!0}catch{}var a=r.call(t);return n&&(e?t[s]=i:delete t[s]),a}})),A=p(((t,e)=>{var i=Object.prototype.toString;e.exports=function(t){return i.call(t)}})),D=p(((t,e)=>{var i=S(),n=T(),o=A(),r=i?i.toStringTag:void 0;e.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":r&&r in Object(t)?n(t):o(t)}})),E=p(((t,e)=>{e.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}})),O=p(((t,e)=>{var i=D(),n=E();e.exports=function(t){if(!n(t))return!1;var e=i(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}})),I=p(((t,e)=>{var i=P()["__core-js_shared__"];e.exports=i})),B=p(((t,e)=>{var i,n=I(),o=(i=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"";e.exports=function(t){return!!o&&o in t}})),R=p(((t,e)=>{var i=Function.prototype.toString;e.exports=function(t){if(null!=t){try{return i.call(t)}catch{}try{return t+""}catch{}}return""}})),z=p(((t,e)=>{var i=O(),n=B(),o=E(),r=R(),s=/^\[object .+?Constructor\]$/,a=Function.prototype,l=Object.prototype,h=a.toString,c=l.hasOwnProperty,p=RegExp("^"+h.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(t){return!(!o(t)||n(t))&&(i(t)?p:s).test(r(t))}})),F=p(((t,e)=>{e.exports=function(t,e){return t?.[e]}})),j=p(((t,e)=>{var i=z(),n=F();e.exports=function(t,e){var o=n(t,e);return i(o)?o:void 0}})),N=p(((t,e)=>{var i=j()(P(),"Map");e.exports=i})),U=p(((t,e)=>{var i=j()(Object,"create");e.exports=i})),G=p(((t,e)=>{var i=U();e.exports=function(){this.__data__=i?i(null):{},this.size=0}})),H=p(((t,e)=>{e.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}})),Z=p(((t,e)=>{var i=U(),n=Object.prototype.hasOwnProperty;e.exports=function(t){var e=this.__data__;if(i){var o=e[t];return"__lodash_hash_undefined__"===o?void 0:o}return n.call(e,t)?e[t]:void 0}})),V=p(((t,e)=>{var i=U(),n=Object.prototype.hasOwnProperty;e.exports=function(t){var e=this.__data__;return i?void 0!==e[t]:n.call(e,t)}})),W=p(((t,e)=>{var i=U();e.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=i&&void 0===e?"__lodash_hash_undefined__":e,this}})),q=p(((t,e)=>{var i=G(),n=H(),o=Z(),r=V(),s=W();function a(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}a.prototype.clear=i,a.prototype.delete=n,a.prototype.get=o,a.prototype.has=r,a.prototype.set=s,e.exports=a})),$=p(((t,e)=>{var i=q(),n=b(),o=N();e.exports=function(){this.size=0,this.__data__={hash:new i,map:new(o||n),string:new i}}})),K=p(((t,e)=>{e.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}})),Y=p(((t,e)=>{var i=K();e.exports=function(t,e){var n=t.__data__;return i(e)?n["string"==typeof e?"string":"hash"]:n.map}})),J=p(((t,e)=>{var i=Y();e.exports=function(t){var e=i(this,t).delete(t);return this.size-=e?1:0,e}})),X=p(((t,e)=>{var i=Y();e.exports=function(t){return i(this,t).get(t)}})),Q=p(((t,e)=>{var i=Y();e.exports=function(t){return i(this,t).has(t)}})),tt=p(((t,e)=>{var i=Y();e.exports=function(t,e){var n=i(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}})),et=p(((t,e)=>{var i=$(),n=J(),o=X(),r=Q(),s=tt();function a(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}a.prototype.clear=i,a.prototype.delete=n,a.prototype.get=o,a.prototype.has=r,a.prototype.set=s,e.exports=a})),it=p(((t,e)=>{var i=b(),n=N(),o=et();e.exports=function(t,e){var r=this.__data__;if(r instanceof i){var s=r.__data__;if(!n||s.length<199)return s.push([t,e]),this.size=++r.size,this;r=this.__data__=new o(s)}return r.set(t,e),this.size=r.size,this}})),nt=p(((t,e)=>{var i=b(),n=x(),o=k(),r=w(),s=M(),a=it();function l(t){var e=this.__data__=new i(t);this.size=e.size}l.prototype.clear=n,l.prototype.delete=o,l.prototype.get=r,l.prototype.has=s,l.prototype.set=a,e.exports=l})),ot=p(((t,e)=>{var i=j(),n=function(){try{var t=i(Object,"defineProperty");return t({},"",{}),t}catch{}}();e.exports=n})),rt=p(((t,e)=>{var i=ot();e.exports=function(t,e,n){"__proto__"==e&&i?i(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}})),st=p(((t,e)=>{var i=rt(),n=m();e.exports=function(t,e,o){(void 0!==o&&!n(t[e],o)||void 0===o&&!(e in t))&&i(t,e,o)}})),at=p(((t,e)=>{e.exports=function(t){return function(e,i,n){for(var o=-1,r=Object(e),s=n(e),a=s.length;a--;){var l=s[t?a:++o];if(!1===i(r[l],l,r))break}return e}}})),lt=p(((t,e)=>{var i=at()();e.exports=i})),ht=p(((t,e)=>{var i=P(),n="object"==typeof t&&t&&!t.nodeType&&t,o=n&&"object"==typeof e&&e&&!e.nodeType&&e,r=o&&o.exports===n?i.Buffer:void 0,s=r?r.allocUnsafe:void 0;e.exports=function(t,e){if(e)return t.slice();var i=t.length,n=s?s(i):new t.constructor(i);return t.copy(n),n}})),ct=p(((t,e)=>{var i=P().Uint8Array;e.exports=i})),pt=p(((t,e)=>{var i=ct();e.exports=function(t){var e=new t.constructor(t.byteLength);return new i(e).set(new i(t)),e}})),ut=p(((t,e)=>{var i=pt();e.exports=function(t,e){var n=e?i(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}})),dt=p(((t,e)=>{e.exports=function(t,e){var i=-1,n=t.length;for(e||(e=Array(n));++i<n;)e[i]=t[i];return e}})),mt=p(((t,e)=>{var i=E(),n=Object.create,o=function(){function t(){}return function(e){if(!i(e))return{};if(n)return n(e);t.prototype=e;var o=new t;return t.prototype=void 0,o}}();e.exports=o})),ft=p(((t,e)=>{e.exports=function(t,e){return function(i){return t(e(i))}}})),gt=p(((t,e)=>{var i=ft()(Object.getPrototypeOf,Object);e.exports=i})),_t=p(((t,e)=>{var i=Object.prototype;e.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||i)}})),vt=p(((t,e)=>{var i=mt(),n=gt(),o=_t();e.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:i(n(t))}})),yt=p(((t,e)=>{e.exports=function(t){return null!=t&&"object"==typeof t}})),bt=p(((t,e)=>{var i=D(),n=yt();e.exports=function(t){return n(t)&&"[object Arguments]"==i(t)}})),xt=p(((t,e)=>{var i=bt(),n=yt(),o=Object.prototype,r=o.hasOwnProperty,s=o.propertyIsEnumerable,a=i(function(){return arguments}())?i:function(t){return n(t)&&r.call(t,"callee")&&!s.call(t,"callee")};e.exports=a})),kt=p(((t,e)=>{var i=Array.isArray;e.exports=i})),Lt=p(((t,e)=>{e.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}})),wt=p(((t,e)=>{var i=O(),n=Lt();e.exports=function(t){return null!=t&&n(t.length)&&!i(t)}})),Mt=p(((t,e)=>{var i=wt(),n=yt();e.exports=function(t){return n(t)&&i(t)}})),Ct=p(((t,e)=>{e.exports=function(){return!1}})),Pt=p(((t,e)=>{var i=P(),n=Ct(),o="object"==typeof t&&t&&!t.nodeType&&t,r=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=r&&r.exports===o?i.Buffer:void 0,a=(s?s.isBuffer:void 0)||n;e.exports=a})),St=p(((t,e)=>{var i=D(),n=gt(),o=yt(),r=Function.prototype,s=Object.prototype,a=r.toString,l=s.hasOwnProperty,h=a.call(Object);e.exports=function(t){if(!o(t)||"[object Object]"!=i(t))return!1;var e=n(t);if(null===e)return!0;var r=l.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&a.call(r)==h}})),Tt=p(((t,e)=>{var i=D(),n=Lt(),o=yt(),r={};r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0,r["[object Arguments]"]=r["[object Array]"]=r["[object ArrayBuffer]"]=r["[object Boolean]"]=r["[object DataView]"]=r["[object Date]"]=r["[object Error]"]=r["[object Function]"]=r["[object Map]"]=r["[object Number]"]=r["[object Object]"]=r["[object RegExp]"]=r["[object Set]"]=r["[object String]"]=r["[object WeakMap]"]=!1,e.exports=function(t){return o(t)&&n(t.length)&&!!r[i(t)]}})),At=p(((t,e)=>{e.exports=function(t){return function(e){return t(e)}}})),Dt=p(((t,e)=>{var i=C(),n="object"==typeof t&&t&&!t.nodeType&&t,o=n&&"object"==typeof e&&e&&!e.nodeType&&e,r=o&&o.exports===n&&i.process,s=function(){try{return o&&o.require&&o.require("util").types||r&&r.binding&&r.binding("util")}catch{}}();e.exports=s})),Et=p(((t,e)=>{var i=Tt(),n=At(),o=Dt(),r=o&&o.isTypedArray,s=r?n(r):i;e.exports=s})),Ot=p(((t,e)=>{e.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}})),It=p(((t,e)=>{var i=rt(),n=m(),o=Object.prototype.hasOwnProperty;e.exports=function(t,e,r){var s=t[e];(!o.call(t,e)||!n(s,r)||void 0===r&&!(e in t))&&i(t,e,r)}})),Bt=p(((t,e)=>{var i=It(),n=rt();e.exports=function(t,e,o,r){var s=!o;o||(o={});for(var a=-1,l=e.length;++a<l;){var h=e[a],c=r?r(o[h],t[h],h,o,t):void 0;void 0===c&&(c=t[h]),s?n(o,h,c):i(o,h,c)}return o}})),Rt=p(((t,e)=>{e.exports=function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}})),zt=p(((t,e)=>{var i=/^(?:0|[1-9]\d*)$/;e.exports=function(t,e){var n=typeof t;return!!(e=e??9007199254740991)&&("number"==n||"symbol"!=n&&i.test(t))&&t>-1&&t%1==0&&t<e}})),Ft=p(((t,e)=>{var i=Rt(),n=xt(),o=kt(),r=Pt(),s=zt(),a=Et(),l=Object.prototype.hasOwnProperty;e.exports=function(t,e){var h=o(t),c=!h&&n(t),p=!h&&!c&&r(t),u=!h&&!c&&!p&&a(t),d=h||c||p||u,m=d?i(t.length,String):[],f=m.length;for(var g in t)(e||l.call(t,g))&&(!d||!("length"==g||p&&("offset"==g||"parent"==g)||u&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,f)))&&m.push(g);return m}})),jt=p(((t,e)=>{e.exports=function(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e}})),Nt=p(((t,e)=>{var i=E(),n=_t(),o=jt(),r=Object.prototype.hasOwnProperty;e.exports=function(t){if(!i(t))return o(t);var e=n(t),s=[];for(var a in t)"constructor"==a&&(e||!r.call(t,a))||s.push(a);return s}})),Ut=p(((t,e)=>{var i=Ft(),n=Nt(),o=wt();e.exports=function(t){return o(t)?i(t,!0):n(t)}})),Gt=p(((t,e)=>{var i=Bt(),n=Ut();e.exports=function(t){return i(t,n(t))}})),Ht=p(((t,e)=>{var i=st(),n=ht(),o=ut(),r=dt(),s=vt(),a=xt(),l=kt(),h=Mt(),c=Pt(),p=O(),u=E(),d=St(),m=Et(),f=Ot(),g=Gt();e.exports=function(t,e,_,v,y,b,x){var k=f(t,_),L=f(e,_),w=x.get(L);if(w)i(t,_,w);else{var M=b?b(k,L,_+"",t,e,x):void 0,C=void 0===M;if(C){var P=l(L),S=!P&&c(L),T=!P&&!S&&m(L);M=L,P||S||T?l(k)?M=k:h(k)?M=r(k):S?(C=!1,M=n(L,!0)):T?(C=!1,M=o(L,!0)):M=[]:d(L)||a(L)?(M=k,a(k)?M=g(k):(!u(k)||p(k))&&(M=s(L))):C=!1}C&&(x.set(L,M),y(M,L,v,b,x),x.delete(L)),i(t,_,M)}}})),Zt=p(((t,e)=>{var i=nt(),n=st(),o=lt(),r=Ht(),s=E(),a=Ut(),l=Ot();e.exports=function t(e,h,c,p,u){e!==h&&o(h,(function(o,a){if(u||(u=new i),s(o))r(e,h,a,c,t,p,u);else{var d=p?p(l(e,a),o,a+"",e,h,u):void 0;void 0===d&&(d=o),n(e,a,d)}}),a)}})),Vt=p(((t,e)=>{e.exports=function(t){return t}})),Wt=p(((t,e)=>{e.exports=function(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}})),qt=p(((t,e)=>{var i=Wt(),n=Math.max;e.exports=function(t,e,o){return e=n(void 0===e?t.length-1:e,0),function(){for(var r=arguments,s=-1,a=n(r.length-e,0),l=Array(a);++s<a;)l[s]=r[e+s];s=-1;for(var h=Array(e+1);++s<e;)h[s]=r[s];return h[e]=o(l),i(t,this,h)}}})),$t=p(((t,e)=>{e.exports=function(t){return function(){return t}}})),Kt=p(((t,e)=>{var i=$t(),n=ot(),o=Vt(),r=n?function(t,e){return n(t,"toString",{configurable:!0,enumerable:!1,value:i(e),writable:!0})}:o;e.exports=r})),Yt=p(((t,e)=>{var i=Date.now;e.exports=function(t){var e=0,n=0;return function(){var o=i(),r=16-(o-n);if(n=o,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}})),Jt=p(((t,e)=>{var i=Kt(),n=Yt()(i);e.exports=n})),Xt=p(((t,e)=>{var i=Vt(),n=qt(),o=Jt();e.exports=function(t,e){return o(n(t,e,i),t+"")}})),Qt=p(((t,e)=>{var i=m(),n=wt(),o=zt(),r=E();e.exports=function(t,e,s){if(!r(s))return!1;var a=typeof e;return!!("number"==a?n(s)&&o(e,s.length):"string"==a&&e in s)&&i(s[e],t)}})),te=p(((t,e)=>{var i=Xt(),n=Qt();e.exports=function(t){return i((function(e,i){var o=-1,r=i.length,s=r>1?i[r-1]:void 0,a=r>2?i[2]:void 0;for(s=t.length>3&&"function"==typeof s?(r--,s):void 0,a&&n(i[0],i[1],a)&&(s=r<3?void 0:s,r=1),e=Object(e);++o<r;){var l=i[o];l&&t(e,l,o,s)}return e}))}})),ee=p(((t,e)=>{var i=Zt(),n=te()((function(t,e,n){i(t,e,n)}));e.exports=n})),ie=p(((t,e)=>{var i=D(),n=yt();e.exports=function(t){return"symbol"==typeof t||n(t)&&"[object Symbol]"==i(t)}})),ne=p(((t,e)=>{var i=kt(),n=ie(),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;e.exports=function(t,e){if(i(t))return!1;var s=typeof t;return!("number"!=s&&"symbol"!=s&&"boolean"!=s&&null!=t&&!n(t))||(r.test(t)||!o.test(t)||null!=e&&t in Object(e))}})),oe=p(((t,e)=>{var i=et();function n(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var o=function(){var i=arguments,n=e?e.apply(this,i):i[0],r=o.cache;if(r.has(n))return r.get(n);var s=t.apply(this,i);return o.cache=r.set(n,s)||r,s};return o.cache=new(n.Cache||i),o}n.Cache=i,e.exports=n})),re=p(((t,e)=>{var i=oe();e.exports=function(t){var e=i(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}})),se=p(((t,e)=>{var i=re(),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,r=i((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(n,(function(t,i,n,r){e.push(n?r.replace(o,"$1"):i||t)})),e}));e.exports=r})),ae=p(((t,e)=>{e.exports=function(t,e){for(var i=-1,n=null==t?0:t.length,o=Array(n);++i<n;)o[i]=e(t[i],i,t);return o}})),le=p(((t,e)=>{var i=S(),n=ae(),o=kt(),r=ie(),s=i?i.prototype:void 0,a=s?s.toString:void 0;e.exports=function t(e){if("string"==typeof e)return e;if(o(e))return n(e,t)+"";if(r(e))return a?a.call(e):"";var i=e+"";return"0"==i&&1/e==-Infinity?"-0":i}})),he=p(((t,e)=>{var i=le();e.exports=function(t){return null==t?"":i(t)}})),ce=p(((t,e)=>{var i=kt(),n=ne(),o=se(),r=he();e.exports=function(t,e){return i(t)?t:n(t,e)?[t]:o(r(t))}})),pe=p(((t,e)=>{var i=ie();e.exports=function(t){if("string"==typeof t||i(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}})),ue=p(((t,e)=>{var i=ce(),n=pe();e.exports=function(t,e){for(var o=0,r=(e=i(e,t)).length;null!=t&&o<r;)t=t[n(e[o++])];return o&&o==r?t:void 0}})),de=p(((t,e)=>{var i=ue();e.exports=function(t,e,n){var o=null==t?void 0:i(t,e);return void 0===o?n:o}})),me=p(((t,e)=>{var i=Object.prototype.hasOwnProperty;e.exports=function(t,e){return null!=t&&i.call(t,e)}})),fe=p(((t,e)=>{var i=ce(),n=xt(),o=kt(),r=zt(),s=Lt(),a=pe();e.exports=function(t,e,l){for(var h=-1,c=(e=i(e,t)).length,p=!1;++h<c;){var u=a(e[h]);if(!(p=null!=t&&l(t,u)))break;t=t[u]}return p||++h!=c?p:!!(c=null==t?0:t.length)&&s(c)&&r(u,c)&&(o(t)||n(t))}})),ge=p(((t,e)=>{var i=me(),n=fe();e.exports=function(t,e){return null!=t&&n(t,e,i)}})),_e=p(((r,s)=>{var a;a=function(){"use strict";function t(t,n,o,r,s){!function t(i,n,o,r,s){for(;r>o;){if(r-o>600){var a=r-o+1,l=n-o+1,h=Math.log(a),c=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*c*(a-c)/a)*(l-a/2<0?-1:1);t(i,n,Math.max(o,Math.floor(n-l*c/a+p)),Math.min(r,Math.floor(n+(a-l)*c/a+p)),s)}var u=i[n],d=o,m=r;for(e(i,o,n),s(i[r],u)>0&&e(i,o,r);d<m;){for(e(i,d,m),d++,m--;s(i[d],u)<0;)d++;for(;s(i[m],u)>0;)m--}0===s(i[o],u)?e(i,o,m):e(i,++m,r),m<=n&&(o=m+1),n<=m&&(r=m-1)}}(t,n,o||0,r||t.length-1,s||i)}function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return t<e?-1:t>e?1:0}var n=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function r(t,e){s(t,0,t.children.length,e,t)}function s(t,e,i,n,o){o||(o=m(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var r=e;r<i;r++){var s=t.children[r];a(o,t.leaf?n(s):s)}return o}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function h(t,e){return t.minY-e.minY}function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function u(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function d(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function f(e,i,n,o,r){for(var s=[i,n];s.length;)if(!((n=s.pop())-(i=s.pop())<=o)){var a=i+Math.ceil((n-i)/o/2)*o;t(e,a,i,n,r),s.push(i,a,a,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var e=this.data,i=[];if(!d(t,e))return i;for(var n=this.toBBox,o=[];e;){for(var r=0;r<e.children.length;r++){var s=e.children[r],a=e.leaf?n(s):s;d(t,a)&&(e.leaf?i.push(s):u(t,a)?this._all(s,i):o.push(s))}e=o.pop()}return i},n.prototype.collides=function(t){var e=this.data;if(!d(t,e))return!1;for(var i=[];e;){for(var n=0;n<e.children.length;n++){var o=e.children[n],r=e.leaf?this.toBBox(o):o;if(d(t,r)){if(e.leaf||u(t,r))return!0;i.push(o)}}e=i.pop()}return!1},n.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var i=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var n=this.data;this.data=i,i=n}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},n.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},n.prototype.clear=function(){return this.data=m([]),this},n.prototype.remove=function(t,e){if(!t)return this;for(var i,n,r,s=this.data,a=this.toBBox(t),l=[],h=[];s||l.length;){if(s||(s=l.pop(),n=l[l.length-1],i=h.pop(),r=!0),s.leaf){var c=o(t,s.children,e);if(-1!==c)return s.children.splice(c,1),l.push(s),this._condense(l),this}r||s.leaf||!u(s,a)?n?(i++,s=n.children[i],r=!1):s=null:(l.push(s),h.push(i),i=0,n=s,s=s.children[0])}return this},n.prototype.toBBox=function(t){return t},n.prototype.compareMinX=function(t,e){return t.minX-e.minX},n.prototype.compareMinY=function(t,e){return t.minY-e.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(t){return this.data=t,this},n.prototype._all=function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},n.prototype._build=function(t,e,i,n){var o,s=i-e+1,a=this._maxEntries;if(s<=a)return r(o=m(t.slice(e,i+1)),this.toBBox),o;n||(n=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,n-1))),(o=m([])).leaf=!1,o.height=n;var l=Math.ceil(s/a),h=l*Math.ceil(Math.sqrt(a));f(t,e,i,h,this.compareMinX);for(var c=e;c<=i;c+=h){var p=Math.min(c+h-1,i);f(t,c,p,l,this.compareMinY);for(var u=c;u<=p;u+=l){var d=Math.min(u+l-1,p);o.children.push(this._build(t,u,d,n-1))}}return r(o,this.toBBox),o},n.prototype._chooseSubtree=function(t,e,i,n){for(;n.push(e),!e.leaf&&n.length-1!==i;){for(var o=1/0,r=1/0,s=void 0,a=0;a<e.children.length;a++){var l=e.children[a],h=c(l),p=(u=t,d=l,(Math.max(d.maxX,u.maxX)-Math.min(d.minX,u.minX))*(Math.max(d.maxY,u.maxY)-Math.min(d.minY,u.minY))-h);p<r?(r=p,o=h<o?h:o,s=l):p===r&&h<o&&(o=h,s=l)}e=s||e.children[0]}var u,d;return e},n.prototype._insert=function(t,e,i){var n=i?t:this.toBBox(t),o=[],r=this._chooseSubtree(n,this.data,e,o);for(r.children.push(t),a(r,n);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(n,o,e)},n.prototype._split=function(t,e){var i=t[e],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);var s=this._chooseSplitIndex(i,o,n),a=m(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,r(i,this.toBBox),r(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},n.prototype._splitRoot=function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,e,i){for(var n,o,r,a,l,h,p,u=1/0,d=1/0,m=e;m<=i-e;m++){var f=s(t,0,m,this.toBBox),g=s(t,m,i,this.toBBox),_=(o=f,r=g,a=Math.max(o.minX,r.minX),l=Math.max(o.minY,r.minY),h=Math.min(o.maxX,r.maxX),p=Math.min(o.maxY,r.maxY),Math.max(0,h-a)*Math.max(0,p-l)),v=c(f)+c(g);_<u?(u=_,n=m,d=v<d?v:d):_===u&&v<d&&(d=v,n=m)}return n||i-e},n.prototype._chooseSplitAxis=function(t,e,i){var n=t.leaf?this.compareMinX:l,o=t.leaf?this.compareMinY:h;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,o)&&t.children.sort(n)},n.prototype._allDistMargin=function(t,e,i,n){t.children.sort(n);for(var o=this.toBBox,r=s(t,0,e,o),l=s(t,i-e,i,o),h=p(r)+p(l),c=e;c<i-e;c++){var u=t.children[c];a(r,t.leaf?o(u):u),h+=p(r)}for(var d=i-e-1;d>=e;d--){var m=t.children[d];a(l,t.leaf?o(m):m),h+=p(l)}return h},n.prototype._adjustParentBBoxes=function(t,e,i){for(var n=i;n>=0;n--)a(e[n],t)},n.prototype._condense=function(t){for(var e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():r(t[e],this.toBBox)},n},"object"==typeof r&&typeof s<"u"?s.exports=a():void 0===(o="function"==typeof(n=a)?n.call(e,i,e,t):n)||(t.exports=o)})),ve=p((t=>{"use strict";function e(t,e,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=e||{},n.geometry=t,n}function i(t,i,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!u(t[0])||!u(t[1]))throw new Error("coordinates must contain numbers");return e({type:"Point",coordinates:t},i,n)}function n(t,i,n){void 0===n&&(n={});for(var o=0,r=t;o<r.length;o++){var s=r[o];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}return e({type:"Polygon",coordinates:t},i,n)}function o(t,i,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return e({type:"LineString",coordinates:t},i,n)}function r(t,e){void 0===e&&(e={});var i={type:"FeatureCollection"};return e.id&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.features=t,i}function s(t,i,n){return void 0===n&&(n={}),e({type:"MultiLineString",coordinates:t},i,n)}function a(t,i,n){return void 0===n&&(n={}),e({type:"MultiPoint",coordinates:t},i,n)}function l(t,i,n){return void 0===n&&(n={}),e({type:"MultiPolygon",coordinates:t},i,n)}function h(e,i){void 0===i&&(i="kilometers");var n=t.factors[i];if(!n)throw new Error(i+" units is invalid");return e*n}function c(e,i){void 0===i&&(i="kilometers");var n=t.factors[i];if(!n)throw new Error(i+" units is invalid");return e/n}function p(t){return 180*(t%(2*Math.PI))/Math.PI}function u(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=6371008.8,t.factors={centimeters:100*t.earthRadius,centimetres:100*t.earthRadius,degrees:t.earthRadius/111325,feet:3.28084*t.earthRadius,inches:39.37*t.earthRadius,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:1e3*t.earthRadius,millimetres:1e3*t.earthRadius,nauticalmiles:t.earthRadius/1852,radians:1,yards:1.0936*t.earthRadius},t.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},t.feature=e,t.geometry=function(t,e,r){switch(void 0===r&&(r={}),t){case"Point":return i(e).geometry;case"LineString":return o(e).geometry;case"Polygon":return n(e).geometry;case"MultiPoint":return a(e).geometry;case"MultiLineString":return s(e).geometry;case"MultiPolygon":return l(e).geometry;default:throw new Error(t+" is invalid")}},t.point=i,t.points=function(t,e,n){return void 0===n&&(n={}),r(t.map((function(t){return i(t,e)})),n)},t.polygon=n,t.polygons=function(t,e,i){return void 0===i&&(i={}),r(t.map((function(t){return n(t,e)})),i)},t.lineString=o,t.lineStrings=function(t,e,i){return void 0===i&&(i={}),r(t.map((function(t){return o(t,e)})),i)},t.featureCollection=r,t.multiLineString=s,t.multiPoint=a,t.multiPolygon=l,t.geometryCollection=function(t,i,n){return void 0===n&&(n={}),e({type:"GeometryCollection",geometries:t},i,n)},t.round=function(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var i=Math.pow(10,e||0);return Math.round(t*i)/i},t.radiansToLength=h,t.lengthToRadians=c,t.lengthToDegrees=function(t,e){return p(c(t,e))},t.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},t.radiansToDegrees=p,t.degreesToRadians=function(t){return t%360*Math.PI/180},t.convertLength=function(t,e,i){if(void 0===e&&(e="kilometers"),void 0===i&&(i="kilometers"),!(t>=0))throw new Error("length must be a positive number");return h(c(t,e),i)},t.convertArea=function(e,i,n){if(void 0===i&&(i="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var o=t.areaFactors[i];if(!o)throw new Error("invalid original units");var r=t.areaFactors[n];if(!r)throw new Error("invalid final units");return e/o*r},t.isNumber=u,t.isObject=function(t){return!!t&&t.constructor===Object},t.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!u(t))throw new Error("bbox must only contain numbers")}))},t.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}})),ye=p((t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=ve();function i(t,e,n){if(null!==t)for(var o,r,s,a,l,h,c,p,u=0,d=0,m=t.type,f="FeatureCollection"===m,g="Feature"===m,_=f?t.features.length:1,v=0;v<_;v++){l=(p=!!(c=f?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var y=0;y<l;y++){var b=0,x=0;if(null!==(a=p?c.geometries[y]:c)){h=a.coordinates;var k=a.type;switch(u=!n||"Polygon"!==k&&"MultiPolygon"!==k?0:1,k){case null:break;case"Point":if(!1===e(h,d,v,b,x))return!1;d++,b++;break;case"LineString":case"MultiPoint":for(o=0;o<h.length;o++){if(!1===e(h[o],d,v,b,x))return!1;d++,"MultiPoint"===k&&b++}"LineString"===k&&b++;break;case"Polygon":case"MultiLineString":for(o=0;o<h.length;o++){for(r=0;r<h[o].length-u;r++){if(!1===e(h[o][r],d,v,b,x))return!1;d++}"MultiLineString"===k&&b++,"Polygon"===k&&x++}"Polygon"===k&&b++;break;case"MultiPolygon":for(o=0;o<h.length;o++){for(x=0,r=0;r<h[o].length;r++){for(s=0;s<h[o][r].length-u;s++){if(!1===e(h[o][r][s],d,v,b,x))return!1;d++}x++}b++}break;case"GeometryCollection":for(o=0;o<a.geometries.length;o++)if(!1===i(a.geometries[o],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function n(t,e){var i;switch(t.type){case"FeatureCollection":for(i=0;i<t.features.length&&!1!==e(t.features[i].properties,i);i++);break;case"Feature":e(t.properties,0)}}function o(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var i=0;i<t.features.length&&!1!==e(t.features[i],i);i++);}function r(t,e){var i,n,o,r,s,a,l,h,c,p,u=0,d="FeatureCollection"===t.type,m="Feature"===t.type,f=d?t.features.length:1;for(i=0;i<f;i++){for(a=d?t.features[i].geometry:m?t.geometry:t,h=d?t.features[i].properties:m?t.properties:{},c=d?t.features[i].bbox:m?t.bbox:void 0,p=d?t.features[i].id:m?t.id:void 0,s=(l=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,o=0;o<s;o++)if(null!==(r=l?a.geometries[o]:a))switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(r,u,h,c,p))return!1;break;case"GeometryCollection":for(n=0;n<r.geometries.length;n++)if(!1===e(r.geometries[n],u,h,c,p))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,u,h,c,p))return!1;u++}}function s(t,i){r(t,(function(t,n,o,r,s){var a,l=null===t?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==i(e.feature(t,o,{bbox:r,id:s}),n,0)&&void 0}switch(l){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var h=0;h<t.coordinates.length;h++){var c={type:a,coordinates:t.coordinates[h]};if(!1===i(e.feature(c,o),n,h))return!1}}))}function a(t,n){s(t,(function(t,o,r){var s=0;if(t.geometry){var a=t.geometry.type;if("Point"!==a&&"MultiPoint"!==a){var l,h=0,c=0,p=0;if(!1===i(t,(function(i,a,u,d,m){if(void 0===l||o>h||d>c||m>p)return l=i,h=o,c=d,p=m,void(s=0);var f=e.lineString([l,i],t.properties);if(!1===n(f,o,r,m,s))return!1;s++,l=i})))return!1}}}))}function l(t,i){if(!t)throw new Error("geojson is required");s(t,(function(t,n,o){if(null!==t.geometry){var r=t.geometry.type,s=t.geometry.coordinates;switch(r){case"LineString":if(!1===i(t,n,o,0,0))return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(!1===i(e.lineString(s[a],t.properties),n,o,a))return!1}}}))}t.coordAll=function(t){var e=[];return i(t,(function(t){e.push(t)})),e},t.coordEach=i,t.coordReduce=function(t,e,n,o){var r=n;return i(t,(function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)}),o),r},t.featureEach=o,t.featureReduce=function(t,e,i){var n=i;return o(t,(function(t,o){n=0===o&&void 0===i?t:e(n,t,o)})),n},t.findPoint=function(t,i){if(i=i||{},!e.isObject(i))throw new Error("options is invalid");var n,o=i.featureIndex||0,r=i.multiFeatureIndex||0,s=i.geometryIndex||0,a=i.coordIndex||0,l=i.properties;switch(t.type){case"FeatureCollection":o<0&&(o=t.features.length+o),l=l||t.features[o].properties,n=t.features[o].geometry;break;case"Feature":l=l||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var h=n.coordinates;switch(n.type){case"Point":return e.point(h,l,i);case"MultiPoint":return r<0&&(r=h.length+r),e.point(h[r],l,i);case"LineString":return a<0&&(a=h.length+a),e.point(h[a],l,i);case"Polygon":return s<0&&(s=h.length+s),a<0&&(a=h[s].length+a),e.point(h[s][a],l,i);case"MultiLineString":return r<0&&(r=h.length+r),a<0&&(a=h[r].length+a),e.point(h[r][a],l,i);case"MultiPolygon":return r<0&&(r=h.length+r),s<0&&(s=h[r].length+s),a<0&&(a=h[r][s].length-a),e.point(h[r][s][a],l,i)}throw new Error("geojson is invalid")},t.findSegment=function(t,i){if(i=i||{},!e.isObject(i))throw new Error("options is invalid");var n,o=i.featureIndex||0,r=i.multiFeatureIndex||0,s=i.geometryIndex||0,a=i.segmentIndex||0,l=i.properties;switch(t.type){case"FeatureCollection":o<0&&(o=t.features.length+o),l=l||t.features[o].properties,n=t.features[o].geometry;break;case"Feature":l=l||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var h=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=h.length+a-1),e.lineString([h[a],h[a+1]],l,i);case"Polygon":return s<0&&(s=h.length+s),a<0&&(a=h[s].length+a-1),e.lineString([h[s][a],h[s][a+1]],l,i);case"MultiLineString":return r<0&&(r=h.length+r),a<0&&(a=h[r].length+a-1),e.lineString([h[r][a],h[r][a+1]],l,i);case"MultiPolygon":return r<0&&(r=h.length+r),s<0&&(s=h[r].length+s),a<0&&(a=h[r][s].length-a-1),e.lineString([h[r][s][a],h[r][s][a+1]],l,i)}throw new Error("geojson is invalid")},t.flattenEach=s,t.flattenReduce=function(t,e,i){var n=i;return s(t,(function(t,o,r){n=0===o&&0===r&&void 0===i?t:e(n,t,o,r)})),n},t.geomEach=r,t.geomReduce=function(t,e,i){var n=i;return r(t,(function(t,o,r,s,a){n=0===o&&void 0===i?t:e(n,t,o,r,s,a)})),n},t.lineEach=l,t.lineReduce=function(t,e,i){var n=i;return l(t,(function(t,o,r,s){n=0===o&&void 0===i?t:e(n,t,o,r,s)})),n},t.propEach=n,t.propReduce=function(t,e,i){var o=i;return n(t,(function(t,n){o=0===n&&void 0===i?t:e(o,t,n)})),o},t.segmentEach=a,t.segmentReduce=function(t,e,i){var n=i,o=!1;return a(t,(function(t,r,s,a,l){n=!1===o&&void 0===i?t:e(n,t,r,s,a,l),o=!0})),n}})),be=p((t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=ye();function i(t){var i=[1/0,1/0,-1/0,-1/0];return e.coordEach(t,(function(t){i[0]>t[0]&&(i[0]=t[0]),i[1]>t[1]&&(i[1]=t[1]),i[2]<t[0]&&(i[2]=t[0]),i[3]<t[1]&&(i[3]=t[1])})),i}i.default=i,t.default=i})),xe=p(((t,e)=>{var i=_e(),n=ve(),o=ye(),r=be().default,s=o.featureEach,a=(o.coordEach,n.polygon,n.featureCollection);function l(t){var e=new i(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:r(t),i.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:r(t),e.push(t)})):s(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:r(t),e.push(t)})),i.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:r(t),i.prototype.remove.call(this,t,e)},e.clear=function(){return i.prototype.clear.call(this)},e.search=function(t){var e=i.prototype.search.call(this,this.toBBox(t));return a(e)},e.collides=function(t){return i.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=i.prototype.all.call(this);return a(t)},e.toJSON=function(){return i.prototype.toJSON.call(this)},e.fromJSON=function(t){return i.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=r(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=r(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}e.exports=l,e.exports.default=l})),ke=p(((r,s)=>{var a;a=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function i(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}var n=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function o(t,e){return t>e?1:t<e?-1:0}function r(t,e,i){for(var o=new n(null,null),r=o,s=o;;){var a=i(t,e.key);if(a<0){if(null===e.left)break;if(i(t,e.left.key)<0){var l=e.left;if(e.left=l.right,l.right=e,null===(e=l).left)break}s.left=e,s=e,e=e.left}else{if(!(a>0))break;if(null===e.right)break;if(i(t,e.right.key)>0&&(l=e.right,e.right=l.left,l.left=e,null===(e=l).right))break;r.right=e,r=e,e=e.right}}return r.right=e.left,s.left=e.right,e.left=o.right,e.right=o.left,e}function s(t,e,i,o){var s=new n(t,e);if(null===i)return s.left=s.right=null,s;var a=o(t,(i=r(t,i,o)).key);return a<0?(s.left=i.left,s.right=i,i.left=null):a>=0&&(s.right=i.right,s.left=i,i.right=null),s}function a(t,e,i){var n=null,o=null;if(e){var s=i((e=r(t,e,i)).key,t);0===s?(n=e.left,o=e.right):s<0?(o=e.right,e.right=null,n=e):(n=e.left,e.left=null,o=e)}return{left:n,right:o}}function l(t,e,i,n,o){if(t){n(e+(i?"└── ":"├── ")+o(t)+"\n");var r=e+(i?" ":"│ ");t.left&&l(t.left,r,!1,n,o),t.right&&l(t.right,r,!0,n,o)}}var h=function(){function t(t){void 0===t&&(t=o),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=s(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new n(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,s=r(t,this._root,o),a=o(t,s.key);return 0===a?this._root=s:(a<0?(i.left=s.left,i.right=s,s.left=null):a>0&&(i.right=s.right,i.left=s,s.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,i){var n;return null===e?null:0===i(t,(e=r(t,e,i)).key)?(null===e.left?n=e.right:(n=r(t,e.left,i)).right=e.right,this._size--,n):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=r(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return e;e=n<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=r(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return!0;e=n<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,n=[],o=!1;!o;)null!==i?(n.push(i),i=i.left):0!==n.length?(i=n.pop(),t.call(e,i),i=i.right):o=!0;return this},t.prototype.range=function(t,e,i,n){for(var o=[],r=this._comparator,s=this._root;0!==o.length||s;)if(s)o.push(s),s=s.left;else{if(r((s=o.pop()).key,e)>0)break;if(r(s.key,t)>=0&&i.call(n,s))return this;s=s.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var i=e.key;return t.push(i)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var i=e.data;return t.push(i)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,i=!1,n=0,o=[];!i;)if(e)o.push(e),e=e.left;else if(o.length>0){if(e=o.pop(),n===t)return e;n++,e=e.right}else i=!0;return null},t.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var n=this._comparator;e;){var o=n(t.key,e.key);if(0===o)break;o<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(t){var e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}for(var n=this._comparator;e;){var o=n(t.key,e.key);if(0===o)break;o<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){for(var e=t,i=[],o=!1,r=new n(null,null),s=r;!o;)e?(i.push(e),e=e.left):i.length>0?e=(e=s=s.next=i.pop()).right:o=!0;return s.next=null,r.next}(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var o=t.length,r=this._comparator;if(i&&u(t,e,0,o-1,r),null===this._root)this._root=c(t,e,0,o),this._size=o;else{var s=function(t,e,i){for(var o=new n(null,null),r=o,s=t,a=e;null!==s&&null!==a;)i(s.key,a.key)<0?(r.next=s,s=s.next):(r.next=a,a=a.next),r=r.next;return null!==s?r.next=s:null!==a&&(r.next=a),o.next}(this.toList(),function(t,e){for(var i=new n(null,null),o=i,r=0;r<t.length;r++)o=o.next=new n(t[r],e[r]);return o.next=null,i.next}(t,e),r);o=this._size+o,this._root=p({head:s},0,o)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return l(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var n=this._comparator,o=a(t,this._root,n),l=o.left,h=o.right;n(t,e)<0?h=s(e,i,h,n):l=s(e,i,l,n),this._root=function(t,e,i){return null===e?t:(null===t||((e=r(t.key,e,i)).left=t),e)}(l,h,n)},t.prototype.split=function(t){return a(t,this._root,this._comparator)},t}();function c(t,e,i,o){var r=o-i;if(r>0){var s=i+Math.floor(r/2),a=t[s],l=e[s],h=new n(a,l);return h.left=c(t,e,i,s),h.right=c(t,e,s+1,o),h}return null}function p(t,e,i){var n=i-e;if(n>0){var o=e+Math.floor(n/2),r=p(t,e,o),s=t.head;return s.left=r,t.head=t.head.next,s.right=p(t,o+1,i),s}return null}function u(t,e,i,n,o){if(!(i>=n)){for(var r=t[i+n>>1],s=i-1,a=n+1;;){do{s++}while(o(t[s],r)<0);do{a--}while(o(t[a],r)>0);if(s>=a)break;var l=t[s];t[s]=t[a],t[a]=l,l=e[s],e[s]=e[a],e[a]=l}u(t,e,i,a,o),u(t,e,a+1,n,o)}}var d=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},m=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var i=t.ll.x<e.ll.x?e.ll.x:t.ll.x,n=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:n,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},f=Number.EPSILON;void 0===f&&(f=Math.pow(2,-52));var g=f*f,_=function(t,e){if(-f<t&&t<f&&-f<e&&e<f)return 0;var i=t-e;return i*i<g*t*e?0:t<e?-1:1},v=function(){function e(){t(this,e),this.reset()}return i(e,[{key:"reset",value:function(){this.xRounder=new y,this.yRounder=new y}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),e}(),y=function(){function e(){t(this,e),this.tree=new h,this.round(0)}return i(e,[{key:"round",value:function(t){var e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===_(e.key,i.key))return this.tree.remove(t),i.key;var n=this.tree.next(e);return null!==n&&0===_(e.key,n.key)?(this.tree.remove(t),n.key):t}}]),e}(),b=new v,x=function(t,e){return t.x*e.y-t.y*e.x},k=function(t,e){return t.x*e.x+t.y*e.y},L=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},o={x:i.x-t.x,y:i.y-t.y},r=x(n,o);return _(r,0)},w=function(t){return Math.sqrt(k(t,t))},M=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},o={x:i.x-t.x,y:i.y-t.y};return x(o,n)/w(o)/w(n)},C=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},o={x:i.x-t.x,y:i.y-t.y};return k(o,n)/w(o)/w(n)},P=function(t,e,i){return 0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i}},S=function(t,e,i){return 0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)}},T=function(){function e(i,n){t(this,e),void 0===i.events?i.events=[this]:i.events.push(this),this.point=i,this.isLeft=n}return i(e,null,[{key:"compare",value:function(t,i){var n=e.comparePoints(t.point,i.point);return 0!==n?n:(t.point!==i.point&&t.link(i),t.isLeft!==i.isLeft?t.isLeft?1:-1:D.compare(t.segment,i.segment))}},{key:"comparePoints",value:function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}}]),i(e,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,i=0,n=e.length;i<n;i++){var o=e[i];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var i=this.point.events[e];if(void 0===i.segment.consumedBy)for(var n=e+1;n<t;n++){var o=this.point.events[n];void 0===o.consumedBy&&i.otherSE.point.events===o.otherSE.point.events&&i.segment.consume(o.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,i=this.point.events.length;e<i;e++){var n=this.point.events[e];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&t.push(n)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,i=new Map,n=function(n){var o=n.otherSE;i.set(n,{sine:M(e.point,t.point,o.point),cosine:C(e.point,t.point,o.point)})};return function(t,e){i.has(t)||n(t),i.has(e)||n(e);var o=i.get(t),r=o.sine,s=o.cosine,a=i.get(e),l=a.sine,h=a.cosine;return r>=0&&l>=0?s<h?1:s>h?-1:0:r<0&&l<0?s<h?-1:s>h?1:0:l<r?-1:l>r?1:0}}}]),e}(),A=0,D=function(){function e(i,n,o,r){t(this,e),this.id=++A,this.leftSE=i,i.segment=this,i.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=i,this.rings=o,this.windings=r}return i(e,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,n=e.leftSE.point.x,o=t.rightSE.point.x,r=e.rightSE.point.x;if(r<i)return 1;if(o<n)return-1;var s=t.leftSE.point.y,a=e.leftSE.point.y,l=t.rightSE.point.y,h=e.rightSE.point.y;if(i<n){if(a<s&&a<l)return 1;if(a>s&&a>l)return-1;var c=t.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;var p=e.comparePoint(t.rightSE.point);return 0!==p?p:-1}if(i>n){if(s<a&&s<h)return-1;if(s>a&&s>h)return 1;var u=e.comparePoint(t.leftSE.point);if(0!==u)return u;var d=t.comparePoint(e.rightSE.point);return d<0?1:d>0?-1:1}if(s<a)return-1;if(s>a)return 1;if(o<r){var m=e.comparePoint(t.rightSE.point);if(0!==m)return m}if(o>r){var f=t.comparePoint(e.rightSE.point);if(f<0)return 1;if(f>0)return-1}if(o!==r){var g=l-s,_=o-i,v=h-a,y=r-n;if(g>_&&v<y)return 1;if(g<_&&v>y)return-1}return o>r?1:o<r||l<h?-1:l>h?1:t.id<e.id?-1:t.id>e.id?1:0}}]),i(e,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,i=this.rightSE.point,n=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;var o=(t.y-e.y)/n.y,r=e.x+o*n.x;if(t.x===r)return 0;var s=(t.x-e.x)/n.x,a=e.y+s*n.y;return t.y===a?0:t.y<a?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),i=t.bbox(),n=m(e,i);if(null===n)return null;var o=this.leftSE.point,r=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,l=d(e,s)&&0===this.comparePoint(s),h=d(i,o)&&0===t.comparePoint(o),c=d(e,a)&&0===this.comparePoint(a),p=d(i,r)&&0===t.comparePoint(r);if(h&&l)return p&&!c?r:!p&&c?a:null;if(h)return c&&o.x===a.x&&o.y===a.y?null:o;if(l)return p&&r.x===s.x&&r.y===s.y?null:s;if(p&&c)return null;if(p)return r;if(c)return a;var u=function(t,e,i,n){if(0===e.x)return S(i,n,t.x);if(0===n.x)return S(t,e,i.x);if(0===e.y)return P(i,n,t.y);if(0===n.y)return P(t,e,i.y);var o=x(e,n);if(0==o)return null;var r={x:i.x-t.x,y:i.y-t.y},s=x(r,e)/o,a=x(r,n)/o;return{x:(t.x+a*e.x+(i.x+s*n.x))/2,y:(t.y+a*e.y+(i.y+s*n.y))/2}}(o,this.vector(),s,t.vector());return null!==u&&d(n,u)?b.round(u.x,u.y):null}},{key:"split",value:function(t){var i=[],n=void 0!==t.events,o=new T(t,!0),r=new T(t,!1),s=this.rightSE;this.replaceRightSE(r),i.push(r),i.push(o);var a=new e(o,s,this.rings.slice(),this.windings.slice());return T.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),T.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(o.checkForConsuming(),r.checkForConsuming()),i}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}},{key:"consume",value:function(t){for(var i=this,n=t;i.consumedBy;)i=i.consumedBy;for(;n.consumedBy;)n=n.consumedBy;var o=e.compare(i,n);if(0!==o){if(o>0){var r=i;i=n,n=r}if(i.prev===n){var s=i;i=n,n=s}for(var a=0,l=n.rings.length;a<l;a++){var h=n.rings[a],c=n.windings[a],p=i.rings.indexOf(h);-1===p?(i.rings.push(h),i.windings.push(c)):i.windings[p]+=c}n.rings=null,n.windings=null,n.consumedBy=i,n.leftSE.consumedBy=i.leftSE,n.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,i=this._afterState.windings,n=this._afterState.multiPolys,o=0,r=this.rings.length;o<r;o++){var s=this.rings[o],a=this.windings[o],l=e.indexOf(s);-1===l?(e.push(s),i.push(a)):i[l]+=a}for(var h=[],c=[],p=0,u=e.length;p<u;p++)if(0!==i[p]){var d=e[p],m=d.poly;if(-1===c.indexOf(m))if(d.isExterior)h.push(m);else{-1===c.indexOf(m)&&c.push(m);var f=h.indexOf(d.poly);-1!==f&&h.splice(f,1)}}for(var g=0,_=h.length;g<_;g++){var v=h[g].multiPoly;-1===n.indexOf(v)&&n.push(v)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(U.type){case"union":var i=0===t.length,n=0===e.length;this._isInResult=i!==n;break;case"intersection":var o,r;t.length<e.length?(o=t.length,r=e.length):(o=e.length,r=t.length),this._isInResult=r===U.numMultiPolys&&o<r;break;case"xor":var s=Math.abs(t.length-e.length);this._isInResult=s%2==1;break;case"difference":var a=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=a(t)!==a(e);break;default:throw new Error("Unrecognized operation type found ".concat(U.type))}return this._isInResult}}],[{key:"fromRing",value:function(t,i,n){var o,r,s,a=T.comparePoints(t,i);if(a<0)o=t,r=i,s=1;else{if(!(a>0))throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));o=i,r=t,s=-1}return new e(new T(o,!0),new T(r,!1),[n],[s])}}]),e}(),E=function(){function e(i,n,o){if(t(this,e),!Array.isArray(i)||0===i.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=o,this.segments=[],"number"!=typeof i[0][0]||"number"!=typeof i[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var r=b.round(i[0][0],i[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};for(var s=r,a=1,l=i.length;a<l;a++){if("number"!=typeof i[a][0]||"number"!=typeof i[a][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var h=b.round(i[a][0],i[a][1]);h.x===s.x&&h.y===s.y||(this.segments.push(D.fromRing(s,h,this)),h.x<this.bbox.ll.x&&(this.bbox.ll.x=h.x),h.y<this.bbox.ll.y&&(this.bbox.ll.y=h.y),h.x>this.bbox.ur.x&&(this.bbox.ur.x=h.x),h.y>this.bbox.ur.y&&(this.bbox.ur.y=h.y),s=h)}(r.x!==s.x||r.y!==s.y)&&this.segments.push(D.fromRing(s,r,this))}return i(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;e<i;e++){var n=this.segments[e];t.push(n.leftSE),t.push(n.rightSE)}return t}}]),e}(),O=function(){function e(i,n){if(t(this,e),!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new E(i[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var o=1,r=i.length;o<r;o++){var s=new E(i[o],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=n}return i(e,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;e<i;e++)for(var n=this.interiorRings[e].getSweepEvents(),o=0,r=n.length;o<r;o++)t.push(n[o]);return t}}]),e}(),I=function(){function e(i,n){if(t(this,e),!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof i[0][0][0]&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var o=0,r=i.length;o<r;o++){var s=new O(i[o],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=n}return i(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++)for(var n=this.polys[e].getSweepEvents(),o=0,r=n.length;o<r;o++)t.push(n[o]);return t}}]),e}(),B=function(){function e(i){t(this,e),this.events=i;for(var n=0,o=i.length;n<o;n++)i[n].segment.ringOut=this;this.poly=null}return i(e,null,[{key:"factory",value:function(t){for(var i=[],n=0,o=t.length;n<o;n++){var r=t[n];if(r.isInResult()&&!r.ringOut){for(var s=null,a=r.leftSE,l=r.rightSE,h=[a],c=a.point,p=[];s=a,a=l,h.push(a),a.point!==c;)for(;;){var u=a.getAvailableLinkedEvents();if(0===u.length){var d=h[0].point,m=h[h.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(d.x,",")+" ".concat(d.y,"]. Last matching segment found ends at")+" [".concat(m.x,", ").concat(m.y,"]."))}if(1===u.length){l=u[0].otherSE;break}for(var f=null,g=0,_=p.length;g<_;g++)if(p[g].point===a.point){f=g;break}if(null===f){p.push({index:h.length,point:a.point});var v=a.getLeftmostComparator(s);l=u.sort(v)[0].otherSE;break}var y=p.splice(f)[0],b=h.splice(y.index);b.unshift(b[0].otherSE),i.push(new e(b.reverse()))}i.push(new e(h))}}return i}}]),i(e,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],i=1,n=this.events.length-1;i<n;i++){var o=this.events[i].point,r=this.events[i+1].point;0!==L(o,t,r)&&(e.push(o),t=o)}if(1===e.length)return null;var s=e[0],a=e[1];0===L(s,t,a)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,h=this.isExteriorRing()?0:e.length-1,c=this.isExteriorRing()?e.length:-1,p=[],u=h;u!=c;u+=l)p.push([e[u].x,e[u].y]);return p}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,i=this.events.length;e<i;e++){var n=this.events[e];T.compare(t,n)>0&&(t=n)}for(var o=t.segment.prevInResult(),r=o?o.prevInResult():null;;){if(!o)return null;if(!r)return o.ringOut;if(r.ringOut!==o.ringOut)return r.ringOut.enclosingRing()!==o.ringOut?o.ringOut:o.ringOut.enclosingRing();o=r.prevInResult(),r=o?o.prevInResult():null}}}]),e}(),R=function(){function e(i){t(this,e),this.exteriorRing=i,i.poly=this,this.interiorRings=[]}return i(e,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,i=this.interiorRings.length;e<i;e++){var n=this.interiorRings[e].getGeom();null!==n&&t.push(n)}return t}}]),e}(),z=function(){function e(i){t(this,e),this.rings=i,this.polys=this._composePolys(i)}return i(e,[{key:"getGeom",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++){var n=this.polys[e].getGeom();null!==n&&t.push(n)}return t}},{key:"_composePolys",value:function(t){for(var e=[],i=0,n=t.length;i<n;i++){var o=t[i];if(!o.poly)if(o.isExteriorRing())e.push(new R(o));else{var r=o.enclosingRing();r.poly||e.push(new R(r)),r.poly.addInterior(o)}}return e}}]),e}(),F=function(){function e(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:D.compare;t(this,e),this.queue=i,this.tree=new h(n),this.segments=[]}return i(e,[{key:"process",value:function(t){var e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;var n=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!n)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var o=n,r=n,s=void 0,a=void 0;void 0===s;)null===(o=this.tree.prev(o))?s=null:void 0===o.key.consumedBy&&(s=o.key);for(;void 0===a;)null===(r=this.tree.next(r))?a=null:void 0===r.key.consumedBy&&(a=r.key);if(t.isLeft){var l=null;if(s){var h=s.getIntersection(e);if(null!==h&&(e.isAnEndpoint(h)||(l=h),!s.isAnEndpoint(h)))for(var c=this._splitSafely(s,h),p=0,u=c.length;p<u;p++)i.push(c[p])}var d=null;if(a){var m=a.getIntersection(e);if(null!==m&&(e.isAnEndpoint(m)||(d=m),!a.isAnEndpoint(m)))for(var f=this._splitSafely(a,m),g=0,_=f.length;g<_;g++)i.push(f[g])}if(null!==l||null!==d){var v=null;v=null===l?d:null===d||T.comparePoints(l,d)<=0?l:d,this.queue.remove(e.rightSE),i.push(e.rightSE);for(var y=e.split(v),b=0,x=y.length;b<x;b++)i.push(y[b])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=s)}else{if(s&&a){var k=s.getIntersection(a);if(null!==k){if(!s.isAnEndpoint(k))for(var L=this._splitSafely(s,k),w=0,M=L.length;w<M;w++)i.push(L[w]);if(!a.isAnEndpoint(k))for(var C=this._splitSafely(a,k),P=0,S=C.length;P<S;P++)i.push(C[P])}}this.tree.remove(e)}return i}},{key:"_splitSafely",value:function(t,e){this.tree.remove(t);var i=t.rightSE;this.queue.remove(i);var n=t.split(e);return n.push(i),void 0===t.consumedBy&&this.tree.insert(t),n}}]),e}(),j=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,N=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,U=new(function(){function e(){t(this,e)}return i(e,[{key:"run",value:function(t,e,i){U.type=t,b.reset();for(var n=[new I(e,!0)],o=0,r=i.length;o<r;o++)n.push(new I(i[o],!1));if(U.numMultiPolys=n.length,"difference"===U.type)for(var s=n[0],a=1;a<n.length;)null!==m(n[a].bbox,s.bbox)?a++:n.splice(a,1);if("intersection"===U.type)for(var l=0,c=n.length;l<c;l++)for(var p=n[l],u=l+1,d=n.length;u<d;u++)if(null===m(p.bbox,n[u].bbox))return[];for(var f=new h(T.compare),g=0,_=n.length;g<_;g++)for(var v=n[g].getSweepEvents(),y=0,x=v.length;y<x;y++)if(f.insert(v[y]),f.size>j)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var k=new F(f),L=f.size,w=f.pop();w;){var M=w.key;if(f.size===L){var C=M.segment;throw new Error("Unable to pop() ".concat(M.isLeft?"left":"right"," SweepEvent ")+"[".concat(M.point.x,", ").concat(M.point.y,"] from segment #").concat(C.id," ")+"[".concat(C.leftSE.point.x,", ").concat(C.leftSE.point.y,"] -> ")+"[".concat(C.rightSE.point.x,", ").concat(C.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(f.size>j)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(k.segments.length>N)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var P=k.process(M),S=0,A=P.length;S<A;S++){var D=P[S];void 0===D.consumedBy&&f.insert(D)}L=f.size,w=f.pop()}b.reset();var E=B.factory(k.segments);return new z(E).getGeom()}}]),e}()),G={union:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return U.run("union",t,i)},intersection:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return U.run("intersection",t,i)},xor:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return U.run("xor",t,i)},difference:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return U.run("difference",t,i)}};return G},"object"==typeof r&&typeof s<"u"?s.exports=a():void 0===(o="function"==typeof(n=a)?n.call(e,i,e,t):n)||(t.exports=o)}));Array.prototype.findIndex=Array.prototype.findIndex||function(t){if(null===this)throw new TypeError("Array.prototype.findIndex called on null or undefined");if("function"!=typeof t)throw new TypeError("callback must be a function");for(var e=Object(this),i=e.length>>>0,n=arguments[1],o=0;o<i;o++)if(t.call(n,e[o],o,e))return o;return-1},Array.prototype.find=Array.prototype.find||function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("callback must be a function");for(var e=Object(this),i=e.length>>>0,n=arguments[1],o=0;o<i;o++){var r=e[o];if(t.call(n,r,o,e))return r}},"function"!=typeof Object.assign&&(Object.assign=function(t){"use strict";if(null==t)throw new TypeError("Cannot convert undefined or null to object");t=Object(t);for(var e=1;e<arguments.length;e++){var i=arguments[e];if(null!=i)for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}),[Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach((function(t){t.hasOwnProperty("remove")||Object.defineProperty(t,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){this.parentNode.removeChild(this)}})})),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(t,e){if(null==this)throw new TypeError('"this" is null or not defined');var i=Object(this),n=i.length>>>0;if(0===n)return!1;var o,r,s=0|e,a=Math.max(s>=0?s:n-Math.abs(s),0);for(;a<n;){if((o=i[a])===(r=t)||"number"==typeof o&&"number"==typeof r&&isNaN(o)&&isNaN(r))return!0;a++}return!1}});var Le=u(ee()),we={en:{tooltips:{placeMarker:"Click to place marker",firstVertex:"Click to place first vertex",continueLine:"Click to continue drawing",finishLine:"Click any existing marker to finish",finishPoly:"Click first marker to finish",finishRect:"Click to finish",startCircle:"Click to place circle center",finishCircle:"Click to finish circle",placeCircleMarker:"Click to place circle marker",placeText:"Click to place text"},actions:{finish:"Finish",cancel:"Cancel",removeLastVertex:"Remove Last Vertex"},buttonTitles:{drawMarkerButton:"Draw Marker",drawPolyButton:"Draw Polygons",drawLineButton:"Draw Polyline",drawCircleButton:"Draw Circle",drawRectButton:"Draw Rectangle",editButton:"Edit Layers",dragButton:"Drag Layers",cutButton:"Cut Layers",deleteButton:"Remove Layers",drawCircleMarkerButton:"Draw Circle Marker",snappingButton:"Snap dragged marker to other layers and vertices",pinningButton:"Pin shared vertices together",rotateButton:"Rotate Layers",drawTextButton:"Draw Text",scaleButton:"Scale Layers",autoTracingButton:"Auto trace Line"},measurements:{totalLength:"Length",segmentLength:"Segment length",area:"Area",radius:"Radius",perimeter:"Perimeter",height:"Height",width:"Width",coordinates:"Position",coordinatesMarker:"Position Marker"}},de:{tooltips:{placeMarker:"Platziere den Marker mit Klick",firstVertex:"Platziere den ersten Marker mit Klick",continueLine:"Klicke, um weiter zu zeichnen",finishLine:"Beende mit Klick auf existierenden Marker",finishPoly:"Beende mit Klick auf ersten Marker",finishRect:"Beende mit Klick",startCircle:"Platziere das Kreiszentrum mit Klick",finishCircle:"Beende den Kreis mit Klick",placeCircleMarker:"Platziere den Kreismarker mit Klick",placeText:"Platziere den Text mit Klick"},actions:{finish:"Beenden",cancel:"Abbrechen",removeLastVertex:"Letzten Vertex löschen"},buttonTitles:{drawMarkerButton:"Marker zeichnen",drawPolyButton:"Polygon zeichnen",drawLineButton:"Polyline zeichnen",drawCircleButton:"Kreis zeichnen",drawRectButton:"Rechteck zeichnen",editButton:"Layer editieren",dragButton:"Layer bewegen",cutButton:"Layer schneiden",deleteButton:"Layer löschen",drawCircleMarkerButton:"Kreismarker zeichnen",snappingButton:"Bewegter Layer an andere Layer oder Vertexe einhacken",pinningButton:"Vertexe an der gleichen Position verknüpfen",rotateButton:"Layer drehen",drawTextButton:"Text zeichnen",scaleButton:"Layer skalieren",autoTracingButton:"Linie automatisch nachzeichen"},measurements:{totalLength:"Länge",segmentLength:"Segment Länge",area:"Fläche",radius:"Radius",perimeter:"Umfang",height:"Höhe",width:"Breite",coordinates:"Position",coordinatesMarker:"Position Marker"}},it:{tooltips:{placeMarker:"Clicca per posizionare un Marker",firstVertex:"Clicca per posizionare il primo vertice",continueLine:"Clicca per continuare a disegnare",finishLine:"Clicca qualsiasi marker esistente per terminare",finishPoly:"Clicca il primo marker per terminare",finishRect:"Clicca per terminare",startCircle:"Clicca per posizionare il punto centrale del cerchio",finishCircle:"Clicca per terminare il cerchio",placeCircleMarker:"Clicca per posizionare un Marker del cherchio"},actions:{finish:"Termina",cancel:"Annulla",removeLastVertex:"Rimuovi l'ultimo vertice"},buttonTitles:{drawMarkerButton:"Disegna Marker",drawPolyButton:"Disegna Poligoni",drawLineButton:"Disegna Polilinea",drawCircleButton:"Disegna Cerchio",drawRectButton:"Disegna Rettangolo",editButton:"Modifica Livelli",dragButton:"Sposta Livelli",cutButton:"Ritaglia Livelli",deleteButton:"Elimina Livelli",drawCircleMarkerButton:"Disegna Marker del Cerchio",snappingButton:"Snap ha trascinato il pennarello su altri strati e vertici",pinningButton:"Pin condiviso vertici insieme",rotateButton:"Ruota livello"}},id:{tooltips:{placeMarker:"Klik untuk menempatkan marker",firstVertex:"Klik untuk menempatkan vertex pertama",continueLine:"Klik untuk meneruskan digitasi",finishLine:"Klik pada sembarang marker yang ada untuk mengakhiri",finishPoly:"Klik marker pertama untuk mengakhiri",finishRect:"Klik untuk mengakhiri",startCircle:"Klik untuk menempatkan titik pusat lingkaran",finishCircle:"Klik untuk mengakhiri lingkaran",placeCircleMarker:"Klik untuk menempatkan penanda lingkarann"},actions:{finish:"Selesai",cancel:"Batal",removeLastVertex:"Hilangkan Vertex Terakhir"},buttonTitles:{drawMarkerButton:"Digitasi Marker",drawPolyButton:"Digitasi Polygon",drawLineButton:"Digitasi Polyline",drawCircleButton:"Digitasi Lingkaran",drawRectButton:"Digitasi Segi Empat",editButton:"Edit Layer",dragButton:"Geser Layer",cutButton:"Potong Layer",deleteButton:"Hilangkan Layer",drawCircleMarkerButton:"Digitasi Penanda Lingkaran",snappingButton:"Jepretkan penanda yang ditarik ke lapisan dan simpul lain",pinningButton:"Sematkan simpul bersama bersama",rotateButton:"Putar lapisan"}},ro:{tooltips:{placeMarker:"Adaugă un punct",firstVertex:"Apasă aici pentru a adăuga primul Vertex",continueLine:"Apasă aici pentru a continua desenul",finishLine:"Apasă pe orice obiect pentru a finisa desenul",finishPoly:"Apasă pe primul obiect pentru a finisa",finishRect:"Apasă pentru a finisa",startCircle:"Apasă pentru a desena un cerc",finishCircle:"Apasă pentru a finisa un cerc",placeCircleMarker:"Adaugă un punct"},actions:{finish:"Termină",cancel:"Anulează",removeLastVertex:"Șterge ultimul Vertex"},buttonTitles:{drawMarkerButton:"Adaugă o bulină",drawPolyButton:"Desenează un poligon",drawLineButton:"Desenează o linie",drawCircleButton:"Desenează un cerc",drawRectButton:"Desenează un dreptunghi",editButton:"Editează straturile",dragButton:"Mută straturile",cutButton:"Taie straturile",deleteButton:"Șterge straturile",drawCircleMarkerButton:"Desenează marcatorul cercului",snappingButton:"Fixați marcatorul glisat pe alte straturi și vârfuri",pinningButton:"Fixați vârfurile partajate împreună",rotateButton:"Rotiți stratul"}},ru:{tooltips:{placeMarker:"Нажмите, чтобы нанести маркер",firstVertex:"Нажмите, чтобы нанести первый объект",continueLine:"Нажмите, чтобы продолжить рисование",finishLine:"Нажмите любой существующий маркер для завершения",finishPoly:"Выберите первую точку, чтобы закончить",finishRect:"Нажмите, чтобы закончить",startCircle:"Нажмите, чтобы добавить центр круга",finishCircle:"Нажмите, чтобы задать радиус",placeCircleMarker:"Нажмите, чтобы нанести круговой маркер"},actions:{finish:"Завершить",cancel:"Отменить",removeLastVertex:"Отменить последнее действие"},buttonTitles:{drawMarkerButton:"Добавить маркер",drawPolyButton:"Рисовать полигон",drawLineButton:"Рисовать кривую",drawCircleButton:"Рисовать круг",drawRectButton:"Рисовать прямоугольник",editButton:"Редактировать слой",dragButton:"Перенести слой",cutButton:"Вырезать слой",deleteButton:"Удалить слой",drawCircleMarkerButton:"Добавить круговой маркер",snappingButton:"Привязать перетаскиваемый маркер к другим слоям и вершинам",pinningButton:"Связать общие точки вместе",rotateButton:"Поворот слоя"}},es:{tooltips:{placeMarker:"Presiona para colocar un marcador",firstVertex:"Presiona para colocar el primer vértice",continueLine:"Presiona para continuar dibujando",finishLine:"Presiona cualquier marcador existente para finalizar",finishPoly:"Presiona el primer marcador para finalizar",finishRect:"Presiona para finalizar",startCircle:"Presiona para colocar el centro del círculo",finishCircle:"Presiona para finalizar el círculo",placeCircleMarker:"Presiona para colocar un marcador de círculo"},actions:{finish:"Finalizar",cancel:"Cancelar",removeLastVertex:"Eliminar último vértice"},buttonTitles:{drawMarkerButton:"Dibujar Marcador",drawPolyButton:"Dibujar Polígono",drawLineButton:"Dibujar Línea",drawCircleButton:"Dibujar Círculo",drawRectButton:"Dibujar Rectángulo",editButton:"Editar Capas",dragButton:"Arrastrar Capas",cutButton:"Cortar Capas",deleteButton:"Eliminar Capas",drawCircleMarkerButton:"Dibujar Marcador de Círculo",snappingButton:"El marcador de Snap arrastrado a otras capas y vértices",pinningButton:"Fijar juntos los vértices compartidos",rotateButton:"Rotar capa"}},nl:{tooltips:{placeMarker:"Klik om een marker te plaatsen",firstVertex:"Klik om het eerste punt te plaatsen",continueLine:"Klik om te blijven tekenen",finishLine:"Klik op een bestaand punt om te beëindigen",finishPoly:"Klik op het eerst punt om te beëindigen",finishRect:"Klik om te beëindigen",startCircle:"Klik om het middelpunt te plaatsen",finishCircle:"Klik om de cirkel te beëindigen",placeCircleMarker:"Klik om een marker te plaatsen"},actions:{finish:"Bewaar",cancel:"Annuleer",removeLastVertex:"Verwijder laatste punt"},buttonTitles:{drawMarkerButton:"Plaats Marker",drawPolyButton:"Teken een vlak",drawLineButton:"Teken een lijn",drawCircleButton:"Teken een cirkel",drawRectButton:"Teken een vierkant",editButton:"Bewerk",dragButton:"Verplaats",cutButton:"Knip",deleteButton:"Verwijder",drawCircleMarkerButton:"Plaats Marker",snappingButton:"Snap gesleepte marker naar andere lagen en hoekpunten",pinningButton:"Speld gedeelde hoekpunten samen",rotateButton:"Laag roteren"}},fr:{tooltips:{placeMarker:"Cliquez pour placer un marqueur",firstVertex:"Cliquez pour placer le premier sommet",continueLine:"Cliquez pour continuer à dessiner",finishLine:"Cliquez sur n'importe quel marqueur pour terminer",finishPoly:"Cliquez sur le premier marqueur pour terminer",finishRect:"Cliquez pour terminer",startCircle:"Cliquez pour placer le centre du cercle",finishCircle:"Cliquez pour finir le cercle",placeCircleMarker:"Cliquez pour placer le marqueur circulaire"},actions:{finish:"Terminer",cancel:"Annuler",removeLastVertex:"Retirer le dernier sommet"},buttonTitles:{drawMarkerButton:"Placer des marqueurs",drawPolyButton:"Dessiner des polygones",drawLineButton:"Dessiner des polylignes",drawCircleButton:"Dessiner un cercle",drawRectButton:"Dessiner un rectangle",editButton:"Éditer des calques",dragButton:"Déplacer des calques",cutButton:"Couper des calques",deleteButton:"Supprimer des calques",drawCircleMarkerButton:"Dessiner un marqueur circulaire",snappingButton:"Glisser le marqueur vers d'autres couches et sommets",pinningButton:"Épingler ensemble les sommets partagés",rotateButton:"Tourner des calques"}},pt_br:{tooltips:{placeMarker:"Clique para posicionar o marcador",firstVertex:"Clique para posicionar o primeiro vértice",continueLine:"Clique para continuar desenhando",finishLine:"Clique em qualquer marcador existente para finalizar",finishPoly:"Clique no primeiro ponto para fechar o polígono",finishRect:"Clique para finalizar",startCircle:"Clique para posicionar o centro do círculo",finishCircle:"Clique para fechar o círculo",placeCircleMarker:"Clique para posicionar o marcador circular"},actions:{finish:"Finalizar",cancel:"Cancelar",removeLastVertex:"Remover último vértice"},buttonTitles:{drawMarkerButton:"Desenhar um marcador",drawPolyButton:"Desenhar um polígono",drawLineButton:"Desenhar uma polilinha",drawCircleButton:"Desenhar um círculo",drawRectButton:"Desenhar um retângulo",editButton:"Editar camada(s)",dragButton:"Mover camada(s)",cutButton:"Recortar camada(s)",deleteButton:"Remover camada(s)",drawCircleMarkerButton:"Marcador de círculos de desenho",snappingButton:"Marcador arrastado para outras camadas e vértices",pinningButton:"Vértices compartilhados de pinos juntos"}},zh:{tooltips:{placeMarker:"单击放置标记",firstVertex:"单击放置首个顶点",continueLine:"单击继续绘制",finishLine:"单击任何存在的标记以完成",finishPoly:"单击第一个标记以完成",finishRect:"单击完成",startCircle:"单击放置圆心",finishCircle:"单击完成圆形",placeCircleMarker:"点击放置圆形标记"},actions:{finish:"完成",cancel:"取消",removeLastVertex:"移除最后的顶点"},buttonTitles:{drawMarkerButton:"绘制标记",drawPolyButton:"绘制多边形",drawLineButton:"绘制线段",drawCircleButton:"绘制圆形",drawRectButton:"绘制长方形",editButton:"编辑图层",dragButton:"拖拽图层",cutButton:"剪切图层",deleteButton:"删除图层",drawCircleMarkerButton:"画圆圈标记",snappingButton:"将拖动的标记捕捉到其他图层和顶点",pinningButton:"将共享顶点固定在一起",rotateButton:"旋转图层"}},zh_tw:{tooltips:{placeMarker:"單擊放置標記",firstVertex:"單擊放置第一個頂點",continueLine:"單擊繼續繪製",finishLine:"單擊任何存在的標記以完成",finishPoly:"單擊第一個標記以完成",finishRect:"單擊完成",startCircle:"單擊放置圓心",finishCircle:"單擊完成圓形",placeCircleMarker:"點擊放置圓形標記"},actions:{finish:"完成",cancel:"取消",removeLastVertex:"移除最後一個頂點"},buttonTitles:{drawMarkerButton:"放置標記",drawPolyButton:"繪製多邊形",drawLineButton:"繪製線段",drawCircleButton:"繪製圓形",drawRectButton:"繪製方形",editButton:"編輯圖形",dragButton:"移動圖形",cutButton:"裁切圖形",deleteButton:"刪除圖形",drawCircleMarkerButton:"畫圓圈標記",snappingButton:"將拖動的標記對齊到其他圖層和頂點",pinningButton:"將共享頂點固定在一起",rotateButton:"旋轉圖形"}},pl:{tooltips:{placeMarker:"Kliknij, aby umieścić znacznik",firstVertex:"Kliknij, aby umieścić pierwszy wierzchołek",continueLine:"Kliknij, aby kontynuować rysowanie",finishLine:"Kliknij dowolny istniejący znacznik, aby zakończyć",finishPoly:"Kliknij pierwszy znacznik, aby zakończyć",finishRect:"Kliknij, aby zakończyć",startCircle:"Kliknij, aby umieścić środek okręgu",finishCircle:"Kliknij, aby zakończyć okrąg",placeCircleMarker:"Kliknij, aby umieścić znacznik okręgu",placeText:"Kliknij, aby umieścić tekst"},actions:{finish:"Zakończ",cancel:"Anuluj",removeLastVertex:"Usuń ostatni wierzchołek"},buttonTitles:{drawMarkerButton:"Rysuj znacznik",drawPolyButton:"Rysuj wielokąt",drawLineButton:"Rysuj linię",drawCircleButton:"Rysuj okrąg",drawRectButton:"Rysuj prostokąt",editButton:"Edytuj warstwy",dragButton:"Przeciągnij warstwy",cutButton:"Wytnij warstwy",deleteButton:"Usuń warstwy",drawCircleMarkerButton:"Rysuj znacznik okrągły",snappingButton:"Przyciągnij przenoszony znacznik do innych warstw i wierzchołków",pinningButton:"Przypnij wspólne wierzchołki razem",rotateButton:"Obróć warstwy",drawTextButton:"Rysuj tekst",scaleButton:"Skaluj warstwy",autoTracingButton:"Automatyczne śledzenie linii"},measurements:{totalLength:"Długość",segmentLength:"Długość odcinka",area:"Obszar",radius:"Promień",perimeter:"Obwód",height:"Wysokość",width:"Szerokość",coordinates:"Pozycja",coordinatesMarker:"Znacznik pozycji"}},sv:{tooltips:{placeMarker:"Klicka för att placera markör",firstVertex:"Klicka för att placera första hörnet",continueLine:"Klicka för att fortsätta rita",finishLine:"Klicka på en existerande punkt för att slutföra",finishPoly:"Klicka på den första punkten för att slutföra",finishRect:"Klicka för att slutföra",startCircle:"Klicka för att placera cirkelns centrum",finishCircle:"Klicka för att slutföra cirkeln",placeCircleMarker:"Klicka för att placera cirkelmarkör"},actions:{finish:"Slutför",cancel:"Avbryt",removeLastVertex:"Ta bort sista hörnet"},buttonTitles:{drawMarkerButton:"Rita Markör",drawPolyButton:"Rita Polygoner",drawLineButton:"Rita Linje",drawCircleButton:"Rita Cirkel",drawRectButton:"Rita Rektangel",editButton:"Redigera Lager",dragButton:"Dra Lager",cutButton:"Klipp i Lager",deleteButton:"Ta bort Lager",drawCircleMarkerButton:"Rita Cirkelmarkör",snappingButton:"Snäpp dra markören till andra lager och hörn",pinningButton:"Fäst delade hörn tillsammans",rotateButton:"Rotera lagret"}},el:{tooltips:{placeMarker:"Κάντε κλικ για να τοποθετήσετε Δείκτη",firstVertex:"Κάντε κλικ για να τοποθετήσετε το πρώτο σημείο",continueLine:"Κάντε κλικ για να συνεχίσετε να σχεδιάζετε",finishLine:"Κάντε κλικ σε οποιονδήποτε υπάρχον σημείο για να ολοκληρωθεί",finishPoly:"Κάντε κλικ στο πρώτο σημείο για να τελειώσετε",finishRect:"Κάντε κλικ για να τελειώσετε",startCircle:"Κάντε κλικ για να τοποθετήσετε κέντρο Κύκλου",finishCircle:"Κάντε κλικ για να ολοκληρώσετε τον Κύκλο",placeCircleMarker:"Κάντε κλικ για να τοποθετήσετε Κυκλικό Δείκτη"},actions:{finish:"Τέλος",cancel:"Ακύρωση",removeLastVertex:"Κατάργηση τελευταίου σημείου"},buttonTitles:{drawMarkerButton:"Σχεδίαση Δείκτη",drawPolyButton:"Σχεδίαση Πολυγώνου",drawLineButton:"Σχεδίαση Γραμμής",drawCircleButton:"Σχεδίαση Κύκλου",drawRectButton:"Σχεδίαση Ορθογωνίου",editButton:"Επεξεργασία Επιπέδων",dragButton:"Μεταφορά Επιπέδων",cutButton:"Αποκοπή Επιπέδων",deleteButton:"Κατάργηση Επιπέδων",drawCircleMarkerButton:"Σχεδίαση Κυκλικού Δείκτη",snappingButton:"Προσκόλληση του Δείκτη μεταφοράς σε άλλα Επίπεδα και Κορυφές",pinningButton:"Περικοπή κοινών κορυφών μαζί",rotateButton:"Περιστρέψτε το στρώμα"}},hu:{tooltips:{placeMarker:"Kattintson a jelölő elhelyezéséhez",firstVertex:"Kattintson az első pont elhelyezéséhez",continueLine:"Kattintson a következő pont elhelyezéséhez",finishLine:"A befejezéshez kattintson egy meglévő pontra",finishPoly:"A befejezéshez kattintson az első pontra",finishRect:"Kattintson a befejezéshez",startCircle:"Kattintson a kör középpontjának elhelyezéséhez",finishCircle:"Kattintson a kör befejezéséhez",placeCircleMarker:"Kattintson a körjelölő elhelyezéséhez"},actions:{finish:"Befejezés",cancel:"Mégse",removeLastVertex:"Utolsó pont eltávolítása"},buttonTitles:{drawMarkerButton:"Jelölő rajzolása",drawPolyButton:"Poligon rajzolása",drawLineButton:"Vonal rajzolása",drawCircleButton:"Kör rajzolása",drawRectButton:"Négyzet rajzolása",editButton:"Elemek szerkesztése",dragButton:"Elemek mozgatása",cutButton:"Elemek vágása",deleteButton:"Elemek törlése",drawCircleMarkerButton:"Kör jelölő rajzolása",snappingButton:"Kapcsolja a jelöltőt másik elemhez vagy ponthoz",pinningButton:"Közös pontok összekötése",rotateButton:"Fólia elforgatása"}},da:{tooltips:{placeMarker:"Tryk for at placere en markør",firstVertex:"Tryk for at placere det første punkt",continueLine:"Tryk for at fortsætte linjen",finishLine:"Tryk på et eksisterende punkt for at afslutte",finishPoly:"Tryk på det første punkt for at afslutte",finishRect:"Tryk for at afslutte",startCircle:"Tryk for at placere cirklens center",finishCircle:"Tryk for at afslutte cirklen",placeCircleMarker:"Tryk for at placere en cirkelmarkør"},actions:{finish:"Afslut",cancel:"Afbryd",removeLastVertex:"Fjern sidste punkt"},buttonTitles:{drawMarkerButton:"Placer markør",drawPolyButton:"Tegn polygon",drawLineButton:"Tegn linje",drawCircleButton:"Tegn cirkel",drawRectButton:"Tegn firkant",editButton:"Rediger",dragButton:"Træk",cutButton:"Klip",deleteButton:"Fjern",drawCircleMarkerButton:"Tegn cirkelmarkør",snappingButton:"Fastgør trukket markør til andre elementer",pinningButton:"Sammenlæg delte elementer",rotateButton:"Roter laget"}},no:{tooltips:{placeMarker:"Klikk for å plassere punkt",firstVertex:"Klikk for å plassere første punkt",continueLine:"Klikk for å tegne videre",finishLine:"Klikk på et eksisterende punkt for å fullføre",finishPoly:"Klikk første punkt for å fullføre",finishRect:"Klikk for å fullføre",startCircle:"Klikk for å sette sirkel midtpunkt",finishCircle:"Klikk for å fullføre sirkel",placeCircleMarker:"Klikk for å plassere sirkel",placeText:"Klikk for å plassere tekst"},actions:{finish:"Fullfør",cancel:"Kanseller",removeLastVertex:"Fjern forrige punkt"},buttonTitles:{drawMarkerButton:"Tegn punkt",drawPolyButton:"Tegn flate",drawLineButton:"Tegn linje",drawCircleButton:"Tegn sirkel",drawRectButton:"Tegn rektangel",editButton:"Rediger objekter",dragButton:"Dra objekter",cutButton:"Kutt objekter",deleteButton:"Fjern objekter",drawCircleMarkerButton:"Tegn sirkel-punkt",snappingButton:"Fest dratt punkt til andre objekter og punkt",pinningButton:"Pin delte punkter sammen",rotateButton:"Rotér objekter",drawTextButton:"Tegn tekst",scaleButton:"Skalér objekter",autoTracingButton:"Automatisk sporing av linje"},measurements:{totalLength:"Lengde",segmentLength:"Segmentlengde",area:"Område",radius:"Radius",perimeter:"Omriss",height:"Høyde",width:"Bredde",coordinates:"Posisjon",coordinatesMarker:"Posisjonsmarkør"}},fa:{tooltips:{placeMarker:"کلیک برای جانمایی نشان",firstVertex:"کلیک برای رسم اولین رأس",continueLine:"کلیک برای ادامه رسم",finishLine:"کلیک روی هر نشان موجود برای پایان",finishPoly:"کلیک روی اولین نشان برای پایان",finishRect:"کلیک برای پایان",startCircle:"کلیک برای رسم مرکز دایره",finishCircle:"کلیک برای پایان رسم دایره",placeCircleMarker:"کلیک برای رسم نشان دایره",placeText:"کلیک برای نوشتن متن"},actions:{finish:"پایان",cancel:"لفو",removeLastVertex:"حذف آخرین رأس"},buttonTitles:{drawMarkerButton:"درج نشان",drawPolyButton:"رسم چندضلعی",drawLineButton:"رسم خط",drawCircleButton:"رسم دایره",drawRectButton:"رسم چهارضلعی",editButton:"ویرایش لایهها",dragButton:"جابجایی لایهها",cutButton:"برش لایهها",deleteButton:"حذف لایهها",drawCircleMarkerButton:"رسم نشان دایره",snappingButton:"نشانگر را به لایهها و رئوس دیگر بکشید",pinningButton:"رئوس مشترک را با هم پین کنید",rotateButton:"چرخش لایه",drawTextButton:"رسم متن",scaleButton:"مقیاسگذاری",autoTracingButton:"ردیاب خودکار"},measurements:{totalLength:"طول",segmentLength:"طول بخش",area:"ناحیه",radius:"شعاع",perimeter:"محیط",height:"ارتفاع",width:"عرض",coordinates:"موقعیت",coordinatesMarker:"موقعیت نشان"}},ua:{tooltips:{placeMarker:"Натисніть, щоб нанести маркер",firstVertex:"Натисніть, щоб нанести першу вершину",continueLine:"Натисніть, щоб продовжити малювати",finishLine:"Натисніть будь-який існуючий маркер для завершення",finishPoly:"Виберіть перший маркер, щоб завершити",finishRect:"Натисніть, щоб завершити",startCircle:"Натисніть, щоб додати центр кола",finishCircle:"Натисніть, щоб завершити коло",placeCircleMarker:"Натисніть, щоб нанести круговий маркер"},actions:{finish:"Завершити",cancel:"Відмінити",removeLastVertex:"Видалити попередню вершину"},buttonTitles:{drawMarkerButton:"Малювати маркер",drawPolyButton:"Малювати полігон",drawLineButton:"Малювати криву",drawCircleButton:"Малювати коло",drawRectButton:"Малювати прямокутник",editButton:"Редагувати шари",dragButton:"Перенести шари",cutButton:"Вирізати шари",deleteButton:"Видалити шари",drawCircleMarkerButton:"Малювати круговий маркер",snappingButton:"Прив’язати перетягнутий маркер до інших шарів та вершин",pinningButton:"Зв'язати спільні вершини разом",rotateButton:"Повернути шар"}},tr:{tooltips:{placeMarker:"İşaretçi yerleştirmek için tıklayın",firstVertex:"İlk tepe noktasını yerleştirmek için tıklayın",continueLine:"Çizime devam etmek için tıklayın",finishLine:"Bitirmek için mevcut herhangi bir işaretçiyi tıklayın",finishPoly:"Bitirmek için ilk işaretçiyi tıklayın",finishRect:"Bitirmek için tıklayın",startCircle:"Daire merkezine yerleştirmek için tıklayın",finishCircle:"Daireyi bitirmek için tıklayın",placeCircleMarker:"Daire işaretçisi yerleştirmek için tıklayın"},actions:{finish:"Bitir",cancel:"İptal",removeLastVertex:"Son köşeyi kaldır"},buttonTitles:{drawMarkerButton:"Çizim İşaretçisi",drawPolyButton:"Çokgenler çiz",drawLineButton:"Çoklu çizgi çiz",drawCircleButton:"Çember çiz",drawRectButton:"Dikdörtgen çiz",editButton:"Katmanları düzenle",dragButton:"Katmanları sürükle",cutButton:"Katmanları kes",deleteButton:"Katmanları kaldır",drawCircleMarkerButton:"Daire işaretçisi çiz",snappingButton:"Sürüklenen işaretçiyi diğer katmanlara ve köşelere yapıştır",pinningButton:"Paylaşılan köşeleri birbirine sabitle",rotateButton:"Katmanı döndür"}},cz:{tooltips:{placeMarker:"Kliknutím vytvoříte značku",firstVertex:"Kliknutím vytvoříte první objekt",continueLine:"Kliknutím pokračujte v kreslení",finishLine:"Kliknutí na libovolnou existující značku pro dokončení",finishPoly:"Vyberte první bod pro dokončení",finishRect:"Klikněte pro dokončení",startCircle:"Kliknutím přidejte střed kruhu",finishCircle:"Нажмите, чтобы задать радиус",placeCircleMarker:"Kliknutím nastavte poloměr"},actions:{finish:"Dokončit",cancel:"Zrušit",removeLastVertex:"Zrušit poslední akci"},buttonTitles:{drawMarkerButton:"Přidat značku",drawPolyButton:"Nakreslit polygon",drawLineButton:"Nakreslit křivku",drawCircleButton:"Nakreslit kruh",drawRectButton:"Nakreslit obdélník",editButton:"Upravit vrstvu",dragButton:"Přeneste vrstvu",cutButton:"Vyjmout vrstvu",deleteButton:"Smazat vrstvu",drawCircleMarkerButton:"Přidat kruhovou značku",snappingButton:"Navázat tažnou značku k dalším vrstvám a vrcholům",pinningButton:"Spojit společné body dohromady",rotateButton:"Otočte vrstvu"}},ja:{tooltips:{placeMarker:"クリックしてマーカーを配置",firstVertex:"クリックして最初の頂点を配置",continueLine:"クリックして描画を続ける",finishLine:"任意のマーカーをクリックして終了",finishPoly:"最初のマーカーをクリックして終了",finishRect:"クリックして終了",startCircle:"クリックして円の中心を配置",finishCircle:"クリックして円の描画を終了",placeCircleMarker:"クリックして円マーカーを配置",placeText:"クリックしてテキストを配置"},actions:{finish:"終了",cancel:"キャンセル",removeLastVertex:"最後の頂点を削除"},buttonTitles:{drawMarkerButton:"マーカーを描画",drawPolyButton:"ポリゴンを描画",drawLineButton:"折れ線を描画",drawCircleButton:"円を描画",drawRectButton:"矩形を描画",editButton:"レイヤーを編集",dragButton:"レイヤーをドラッグ",cutButton:"レイヤーを切り取り",deleteButton:"レイヤーを削除",drawCircleMarkerButton:"円マーカーを描画",snappingButton:"ドラッグしたマーカーを他のレイヤーや頂点にスナップする",pinningButton:"共有する頂点を同時に動かす",rotateButton:"レイヤーを回転",drawTextButton:"テキストを描画"}},fi:{tooltips:{placeMarker:"Klikkaa asettaaksesi merkin",firstVertex:"Klikkaa asettaakseni ensimmäisen osuuden",continueLine:"Klikkaa jatkaaksesi piirtämistä",finishLine:"Klikkaa olemassa olevaa merkkiä lopettaaksesi",finishPoly:"Klikkaa ensimmäistä merkkiä lopettaaksesi",finishRect:"Klikkaa lopettaaksesi",startCircle:"Klikkaa asettaaksesi ympyrän keskipisteen",finishCircle:"Klikkaa lopettaaksesi ympyrän",placeCircleMarker:"Klikkaa asettaaksesi ympyrämerkin",placeText:"Klikkaa asettaaksesi tekstin"},actions:{finish:"Valmis",cancel:"Peruuta",removeLastVertex:"Poista viimeinen osuus"},buttonTitles:{drawMarkerButton:"Piirrä merkkejä",drawPolyButton:"Piirrä monikulmioita",drawLineButton:"Piirrä viivoja",drawCircleButton:"Piirrä ympyrä",drawRectButton:"Piirrä neliskulmioita",editButton:"Muokkaa",dragButton:"Siirrä",cutButton:"Leikkaa",deleteButton:"Poista",drawCircleMarkerButton:"Piirrä ympyrämerkki",snappingButton:"Kiinnitä siirrettävä merkki toisiin muotoihin",pinningButton:"Kiinnitä jaetut muodot yhteen",rotateButton:"Käännä",drawTextButton:"Piirrä tekstiä"}},ko:{tooltips:{placeMarker:"마커 위치를 클릭하세요",firstVertex:"첫번째 꼭지점 위치을 클릭하세요",continueLine:"계속 그리려면 클릭하세요",finishLine:"끝내려면 기존 마커를 클릭하세요",finishPoly:"끝내려면 처음 마커를 클릭하세요",finishRect:"끝내려면 클릭하세요",startCircle:"원의 중심이 될 위치를 클릭하세요",finishCircle:"원을 끝내려면 클릭하세요",placeCircleMarker:"원 마커 위치를 클릭하세요",placeText:"텍스트 위치를 클릭하세요"},actions:{finish:"끝내기",cancel:"취소",removeLastVertex:"마지막 꼭지점 제거"},buttonTitles:{drawMarkerButton:"마커 그리기",drawPolyButton:"다각형 그리기",drawLineButton:"다각선 그리기",drawCircleButton:"원 그리기",drawRectButton:"직사각형 그리기",editButton:"레이어 편집하기",dragButton:"레이어 끌기",cutButton:"레이어 자르기",deleteButton:"레이어 제거하기",drawCircleMarkerButton:"원 마커 그리기",snappingButton:"잡아끈 마커를 다른 레이어 및 꼭지점에 들러붙게 하기",pinningButton:"공유 꼭지점을 함께 찍기",rotateButton:"레이어 회전하기",drawTextButton:"텍스트 그리기"}},ky:{tooltips:{placeMarker:"Маркерди жайгаштыруу үчүн басыңыз",firstVertex:"Биринчи чокуну жайгаштырууну үчүн басыңыз",continueLine:"Сүрөт тартууну улантуу үчүн басыңыз",finishLine:"Аяктоо үчүн учурдагы маркерди басыңыз",finishPoly:"Бүтүрүү үчүн биринчи маркерди басыңыз",finishRect:"Бүтүрүү үчүн басыңыз",startCircle:"Айлананын борборун жайгаштырууну үчүн басыңыз",finishCircle:"Айлананы бүтүрүү үчүн басыңыз",placeCircleMarker:"Тегерек маркерди жайгаштыруу үчүн басыңыз",placeText:"Текстти жайгаштыруу үчүн басыңыз"},actions:{finish:"Аягы",cancel:"Жок кылуу",removeLastVertex:"Акыркы чокуну өчүрүү"},buttonTitles:{drawMarkerButton:"Маркерди чизуу",drawPolyButton:"Полигон чизуу",drawLineButton:"Полилиния чизуу",drawCircleButton:"Дайынды чизуу",drawRectButton:"Прямоугольник чизуу",editButton:"Слоопту түзөтүү",dragButton:"Слоопту карап сүйлөү",cutButton:"Слооптун башын кесүү",deleteButton:"Слооптун өчүрүү",drawCircleMarkerButton:"Дайынды маркерди чизуу",snappingButton:"Башка слооптордун жана вертекстердин арасына чекилдөө",pinningButton:"Бөлүшкөн вертекстерди бирге тутуштуруу",rotateButton:"Слооптун өзгөртүү",drawTextButton:"Текст чизуу",scaleButton:"Слооптун өлчөмүн өзгөртүү",autoTracingButton:"Автоматтык тизмеги чизуу"},measurements:{totalLength:"Узундук",segmentLength:"Сегмент узундугу",area:"Аймак",radius:"Радиус",perimeter:"Периметр",height:"Диаметр",width:"Кенчилик",coordinates:"Координаттар",coordinatesMarker:"Маркердин координаттары"}}},Me={_globalEditModeEnabled:!1,enableGlobalEditMode(t){let e={...t};this._globalEditModeEnabled=!0,this.Toolbar.toggleButton("editMode",this.globalEditModeEnabled()),L.PM.Utils.findLayers(this.map).forEach((t=>{this._isRelevantForEdit(t)&&t.pm.enable(e)})),this.throttledReInitEdit||(this.throttledReInitEdit=L.Util.throttle(this.handleLayerAdditionInGlobalEditMode,100,this)),this._addedLayersEdit={},this.map.on("layeradd",this._layerAddedEdit,this),this.map.on("layeradd",this.throttledReInitEdit,this),this._fireGlobalEditModeToggled(!0)},disableGlobalEditMode(){this._globalEditModeEnabled=!1,L.PM.Utils.findLayers(this.map).forEach((t=>{t.pm.disable()})),this.map.off("layeradd",this._layerAddedEdit,this),this.map.off("layeradd",this.throttledReInitEdit,this),this.Toolbar.toggleButton("editMode",this.globalEditModeEnabled()),this._fireGlobalEditModeToggled(!1)},globalEditEnabled(){return this.globalEditModeEnabled()},globalEditModeEnabled(){return this._globalEditModeEnabled},toggleGlobalEditMode(t=this.globalOptions){this.globalEditModeEnabled()?this.disableGlobalEditMode():this.enableGlobalEditMode(t)},handleLayerAdditionInGlobalEditMode(){let t=this._addedLayersEdit;if(this._addedLayersEdit={},this.globalEditModeEnabled())for(let e in t){let i=t[e];this._isRelevantForEdit(i)&&i.pm.enable({...this.globalOptions})}},_layerAddedEdit({layer:t}){this._addedLayersEdit[L.stamp(t)]=t},_isRelevantForEdit(t){return t.pm&&!(t instanceof L.LayerGroup)&&(!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&!1===t.options.pmIgnore)&&!t._pmTempLayer&&t.pm.options.allowEditing}},Ce={_globalDragModeEnabled:!1,enableGlobalDragMode(){let t=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!0,this._addedLayersDrag={},t.forEach((t=>{this._isRelevantForDrag(t)&&t.pm.enableLayerDrag()})),this.throttledReInitDrag||(this.throttledReInitDrag=L.Util.throttle(this.reinitGlobalDragMode,100,this)),this.map.on("layeradd",this._layerAddedDrag,this),this.map.on("layeradd",this.throttledReInitDrag,this),this.Toolbar.toggleButton("dragMode",this.globalDragModeEnabled()),this._fireGlobalDragModeToggled(!0)},disableGlobalDragMode(){let t=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!1,t.forEach((t=>{t.pm.disableLayerDrag()})),this.map.off("layeradd",this._layerAddedDrag,this),this.map.off("layeradd",this.throttledReInitDrag,this),this.Toolbar.toggleButton("dragMode",this.globalDragModeEnabled()),this._fireGlobalDragModeToggled(!1)},globalDragModeEnabled(){return!!this._globalDragModeEnabled},toggleGlobalDragMode(){this.globalDragModeEnabled()?this.disableGlobalDragMode():this.enableGlobalDragMode()},reinitGlobalDragMode(){let t=this._addedLayersDrag;if(this._addedLayersDrag={},this.globalDragModeEnabled())for(let e in t){let i=t[e];this._isRelevantForDrag(i)&&i.pm.enableLayerDrag()}},_layerAddedDrag({layer:t}){this._addedLayersDrag[L.stamp(t)]=t},_isRelevantForDrag(t){return t.pm&&!(t instanceof L.LayerGroup)&&(!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&!1===t.options.pmIgnore)&&!t._pmTempLayer&&t.pm.options.draggable}},Pe={_globalRemovalModeEnabled:!1,enableGlobalRemovalMode(){this._globalRemovalModeEnabled=!0,this.map.eachLayer((t=>{this._isRelevantForRemoval(t)&&(t.pm.enabled()&&t.pm.disable(),t.on("click",this.removeLayer,this))})),this.throttledReInitRemoval||(this.throttledReInitRemoval=L.Util.throttle(this.handleLayerAdditionInGlobalRemovalMode,100,this)),this._addedLayersRemoval={},this.map.on("layeradd",this._layerAddedRemoval,this),this.map.on("layeradd",this.throttledReInitRemoval,this),this.Toolbar.toggleButton("removalMode",this.globalRemovalModeEnabled()),this._fireGlobalRemovalModeToggled(!0)},disableGlobalRemovalMode(){this._globalRemovalModeEnabled=!1,this.map.eachLayer((t=>{t.off("click",this.removeLayer,this)})),this.map.off("layeradd",this._layerAddedRemoval,this),this.map.off("layeradd",this.throttledReInitRemoval,this),this.Toolbar.toggleButton("removalMode",this.globalRemovalModeEnabled()),this._fireGlobalRemovalModeToggled(!1)},globalRemovalEnabled(){return this.globalRemovalModeEnabled()},globalRemovalModeEnabled(){return!!this._globalRemovalModeEnabled},toggleGlobalRemovalMode(){this.globalRemovalModeEnabled()?this.disableGlobalRemovalMode():this.enableGlobalRemovalMode()},removeLayer(t){let e=t.target;this._isRelevantForRemoval(e)&&!e.pm.dragging()&&(e.removeFrom(this.map.pm._getContainingLayer()),e.remove(),e instanceof L.LayerGroup?(this._fireRemoveLayerGroup(e),this._fireRemoveLayerGroup(this.map,e)):(e.pm._fireRemove(e),e.pm._fireRemove(this.map,e)))},_isRelevantForRemoval(t){return t.pm&&!(t instanceof L.LayerGroup)&&(!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&!1===t.options.pmIgnore)&&!t._pmTempLayer&&t.pm.options.allowRemoval},handleLayerAdditionInGlobalRemovalMode(){let t=this._addedLayersRemoval;if(this._addedLayersRemoval={},this.globalRemovalModeEnabled())for(let e in t){let i=t[e];this._isRelevantForRemoval(i)&&(i.pm.enabled()&&i.pm.disable(),i.on("click",this.removeLayer,this))}},_layerAddedRemoval({layer:t}){this._addedLayersRemoval[L.stamp(t)]=t}},Se={_globalRotateModeEnabled:!1,enableGlobalRotateMode(){this._globalRotateModeEnabled=!0,L.PM.Utils.findLayers(this.map).filter((t=>t instanceof L.Polyline)).forEach((t=>{this._isRelevantForRotate(t)&&t.pm.enableRotate()})),this.throttledReInitRotate||(this.throttledReInitRotate=L.Util.throttle(this.handleLayerAdditionInGlobalRotateMode,100,this)),this._addedLayersRotate={},this.map.on("layeradd",this._layerAddedRotate,this),this.map.on("layeradd",this.throttledReInitRotate,this),this.Toolbar.toggleButton("rotateMode",this.globalRotateModeEnabled()),this._fireGlobalRotateModeToggled()},disableGlobalRotateMode(){this._globalRotateModeEnabled=!1,L.PM.Utils.findLayers(this.map).filter((t=>t instanceof L.Polyline)).forEach((t=>{t.pm.disableRotate()})),this.map.off("layeradd",this._layerAddedRotate,this),this.map.off("layeradd",this.throttledReInitRotate,this),this.Toolbar.toggleButton("rotateMode",this.globalRotateModeEnabled()),this._fireGlobalRotateModeToggled()},globalRotateModeEnabled(){return!!this._globalRotateModeEnabled},toggleGlobalRotateMode(){this.globalRotateModeEnabled()?this.disableGlobalRotateMode():this.enableGlobalRotateMode()},_isRelevantForRotate(t){return t.pm&&t instanceof L.Polyline&&!(t instanceof L.LayerGroup)&&(!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&!1===t.options.pmIgnore)&&!t._pmTempLayer&&t.pm.options.allowRotation},handleLayerAdditionInGlobalRotateMode(){let t=this._addedLayersRotate;if(this._addedLayersRotate={},this.globalRotateModeEnabled())for(let e in t){let i=t[e];this._isRelevantForRemoval(i)&&i.pm.enableRotate()}},_layerAddedRotate({layer:t}){this._addedLayersRotate[L.stamp(t)]=t}},Te=u(ee()),Ae={_fireDrawStart(t="Draw",e={}){this.__fire(this._map,"pm:drawstart",{shape:this._shape,workingLayer:this._layer},t,e)},_fireDrawEnd(t="Draw",e={}){this.__fire(this._map,"pm:drawend",{shape:this._shape},t,e)},_fireCreate(t,e="Draw",i={}){this.__fire(this._map,"pm:create",{shape:this._shape,marker:t,layer:t},e,i)},_fireCenterPlaced(t="Draw",e={}){let i="Draw"===t?this._layer:void 0,n="Draw"!==t?this._layer:void 0;this.__fire(this._layer,"pm:centerplaced",{shape:this._shape,workingLayer:i,layer:n,latlng:this._layer.getLatLng()},t,e)},_fireCut(t,e,i,n="Draw",o={}){this.__fire(t,"pm:cut",{shape:this._shape,layer:e,originalLayer:i},n,o)},_fireEdit(t=this._layer,e="Edit",i={}){this.__fire(t,"pm:edit",{layer:this._layer,shape:this.getShape()},e,i)},_fireEnable(t="Edit",e={}){this.__fire(this._layer,"pm:enable",{layer:this._layer,shape:this.getShape()},t,e)},_fireDisable(t="Edit",e={}){this.__fire(this._layer,"pm:disable",{layer:this._layer,shape:this.getShape()},t,e)},_fireUpdate(t="Edit",e={}){this.__fire(this._layer,"pm:update",{layer:this._layer,shape:this.getShape()},t,e)},_fireMarkerDragStart(t,e=void 0,i="Edit",n={}){this.__fire(this._layer,"pm:markerdragstart",{layer:this._layer,markerEvent:t,shape:this.getShape(),indexPath:e},i,n)},_fireMarkerDrag(t,e=void 0,i="Edit",n={}){this.__fire(this._layer,"pm:markerdrag",{layer:this._layer,markerEvent:t,shape:this.getShape(),indexPath:e},i,n)},_fireMarkerDragEnd(t,e=void 0,i=void 0,n="Edit",o={}){this.__fire(this._layer,"pm:markerdragend",{layer:this._layer,markerEvent:t,shape:this.getShape(),indexPath:e,intersectionReset:i},n,o)},_fireDragStart(t="Edit",e={}){this.__fire(this._layer,"pm:dragstart",{layer:this._layer,shape:this.getShape()},t,e)},_fireDrag(t,e="Edit",i={}){this.__fire(this._layer,"pm:drag",{...t,shape:this.getShape()},e,i)},_fireDragEnd(t="Edit",e={}){this.__fire(this._layer,"pm:dragend",{layer:this._layer,shape:this.getShape()},t,e)},_fireDragEnable(t="Edit",e={}){this.__fire(this._layer,"pm:dragenable",{layer:this._layer,shape:this.getShape()},t,e)},_fireDragDisable(t="Edit",e={}){this.__fire(this._layer,"pm:dragdisable",{layer:this._layer,shape:this.getShape()},t,e)},_fireRemove(t,e=t,i="Edit",n={}){this.__fire(t,"pm:remove",{layer:e,shape:this.getShape()},i,n)},_fireVertexAdded(t,e,i,n="Edit",o={}){this.__fire(this._layer,"pm:vertexadded",{layer:this._layer,workingLayer:this._layer,marker:t,indexPath:e,latlng:i,shape:this.getShape()},n,o)},_fireVertexRemoved(t,e,i="Edit",n={}){this.__fire(this._layer,"pm:vertexremoved",{layer:this._layer,marker:t,indexPath:e,shape:this.getShape()},i,n)},_fireVertexClick(t,e,i="Edit",n={}){this.__fire(this._layer,"pm:vertexclick",{layer:this._layer,markerEvent:t,indexPath:e,shape:this.getShape()},i,n)},_fireIntersect(t,e=this._layer,i="Edit",n={}){this.__fire(e,"pm:intersect",{layer:this._layer,intersection:t,shape:this.getShape()},i,n)},_fireLayerReset(t,e,i="Edit",n={}){this.__fire(this._layer,"pm:layerreset",{layer:this._layer,markerEvent:t,indexPath:e,shape:this.getShape()},i,n)},_fireChange(t,e="Edit",i={}){this.__fire(this._layer,"pm:change",{layer:this._layer,latlngs:t,shape:this.getShape()},e,i)},_fireTextChange(t,e="Edit",i={}){this.__fire(this._layer,"pm:textchange",{layer:this._layer,text:t,shape:this.getShape()},e,i)},_fireTextFocus(t="Edit",e={}){this.__fire(this._layer,"pm:textfocus",{layer:this._layer,shape:this.getShape()},t,e)},_fireTextBlur(t="Edit",e={}){this.__fire(this._layer,"pm:textblur",{layer:this._layer,shape:this.getShape()},t,e)},_fireSnapDrag(t,e,i="Snapping",n={}){this.__fire(t,"pm:snapdrag",e,i,n)},_fireSnap(t,e,i="Snapping",n={}){this.__fire(t,"pm:snap",e,i,n)},_fireUnsnap(t,e,i="Snapping",n={}){this.__fire(t,"pm:unsnap",e,i,n)},_fireRotationEnable(t,e,i="Rotation",n={}){this.__fire(t,"pm:rotateenable",{layer:this._layer,helpLayer:this._rotatePoly,shape:this.getShape()},i,n)},_fireRotationDisable(t,e="Rotation",i={}){this.__fire(t,"pm:rotatedisable",{layer:this._layer,shape:this.getShape()},e,i)},_fireRotationStart(t,e,i="Rotation",n={}){this.__fire(t,"pm:rotatestart",{layer:this._rotationLayer,helpLayer:this._layer,startAngle:this._startAngle,originLatLngs:e},i,n)},_fireRotation(t,e,i,n=this._rotationLayer,o="Rotation",r={}){this.__fire(t,"pm:rotate",{layer:n,helpLayer:this._layer,startAngle:this._startAngle,angle:n.pm.getAngle(),angleDiff:e,oldLatLngs:i,newLatLngs:n.getLatLngs()},o,r)},_fireRotationEnd(t,e,i,n="Rotation",o={}){this.__fire(t,"pm:rotateend",{layer:this._rotationLayer,helpLayer:this._layer,startAngle:e,angle:this._rotationLayer.pm.getAngle(),originLatLngs:i,newLatLngs:this._rotationLayer.getLatLngs()},n,o)},_fireActionClick(t,e,i,n="Toolbar",o={}){this.__fire(this._map,"pm:actionclick",{text:t.text,action:t,btnName:e,button:i},n,o)},_fireButtonClick(t,e,i="Toolbar",n={}){this.__fire(this._map,"pm:buttonclick",{btnName:t,button:e},i,n)},_fireLangChange(t,e,i,n,o="Global",r={}){this.__fire(this.map,"pm:langchange",{oldLang:t,activeLang:e,fallback:i,translations:n},o,r)},_fireGlobalDragModeToggled(t,e="Global",i={}){this.__fire(this.map,"pm:globaldragmodetoggled",{enabled:t,map:this.map},e,i)},_fireGlobalEditModeToggled(t,e="Global",i={}){this.__fire(this.map,"pm:globaleditmodetoggled",{enabled:t,map:this.map},e,i)},_fireGlobalRemovalModeToggled(t,e="Global",i={}){this.__fire(this.map,"pm:globalremovalmodetoggled",{enabled:t,map:this.map},e,i)},_fireGlobalCutModeToggled(t="Global",e={}){this.__fire(this._map,"pm:globalcutmodetoggled",{enabled:!!this._enabled,map:this._map},t,e)},_fireGlobalDrawModeToggled(t="Global",e={}){this.__fire(this._map,"pm:globaldrawmodetoggled",{enabled:this._enabled,shape:this._shape,map:this._map},t,e)},_fireGlobalRotateModeToggled(t="Global",e={}){this.__fire(this.map,"pm:globalrotatemodetoggled",{enabled:this.globalRotateModeEnabled(),map:this.map},t,e)},_fireRemoveLayerGroup(t,e=t,i="Edit",n={}){this.__fire(t,"pm:remove",{layer:e,shape:void 0},i,n)},_fireKeyeventEvent(t,e,i,n="Global",o={}){this.__fire(this.map,"pm:keyevent",{event:t,eventType:e,focusOn:i},n,o)},__fire(t,e,i,n,o={}){i=(0,Te.default)(i,o,{source:n}),L.PM.Utils._fireEvent(t,e,i)}},De=()=>({_lastEvents:{keydown:void 0,keyup:void 0,current:void 0},_initKeyListener(t){this.map=t,L.DomEvent.on(document,"keydown keyup",this._onKeyListener,this),L.DomEvent.on(window,"blur",this._onBlur,this),t.once("unload",this._unbindKeyListenerEvents,this)},_unbindKeyListenerEvents(){L.DomEvent.off(document,"keydown keyup",this._onKeyListener,this),L.DomEvent.off(window,"blur",this._onBlur,this)},_onKeyListener(t){let e="document";this.map.getContainer().contains(t.target)&&(e="map");let i={event:t,eventType:t.type,focusOn:e};this._lastEvents[t.type]=i,this._lastEvents.current=i,this.map.pm._fireKeyeventEvent(t,t.type,e)},_onBlur(t){t.altKey=!1;let e={event:t,eventType:t.type,focusOn:"document"};this._lastEvents[t.type]=e,this._lastEvents.current=e},getLastKeyEvent(t="current"){return this._lastEvents[t]},isShiftKeyPressed(){return this._lastEvents.current?.event.shiftKey},isAltKeyPressed(){return this._lastEvents.current?.event.altKey},isCtrlKeyPressed(){return this._lastEvents.current?.event.ctrlKey},isMetaKeyPressed(){return this._lastEvents.current?.event.metaKey},getPressedKey(){return this._lastEvents.current?.event.key}}),Ee=u(de()),Oe=u(ge());function Ie(t){let e=L.PM.activeLang;return(0,Oe.default)(we,e)||(e="en"),(0,Ee.default)(we[e],t)}function Be(t){for(let e=0;e<t.length;e+=1){let i=t[e];if(Array.isArray(i)){if(Be(i))return!0}else if(null!=i&&""!==i)return!0}return!1}function Re(t){return t.reduce(((t,e)=>{if(0!==e.length){let i=Array.isArray(e)?Re(e):e;Array.isArray(i)?0!==i.length&&t.push(i):t.push(i)}return t}),[])}function ze(t,e,i){let n,o,r,s={a:L.CRS.Earth.R,b:6356752.3142,f:.0033528106647474805},{a:a,b:l,f:h}=s,c=t.lng,p=t.lat,u=i,d=Math.PI,m=e*d/180,f=Math.sin(m),g=Math.cos(m),_=(1-h)*Math.tan(p*d/180),v=1/Math.sqrt(1+_*_),y=_*v,b=Math.atan2(_,g),x=v*f,k=1-x*x,w=k*(a*a-l*l)/(l*l),M=1+w/16384*(4096+w*(w*(320-175*w)-768)),C=w/1024*(256+w*(w*(74-47*w)-128)),P=u/(l*M),S=2*Math.PI;for(;Math.abs(P-S)>1e-12;){n=Math.cos(2*b+P),o=Math.sin(P),r=Math.cos(P),S=P,P=u/(l*M)+C*o*(n+C/4*(r*(2*n*n-1)-C/6*n*(4*o*o-3)*(4*n*n-3)))}let T=y*o-v*r*g,A=Math.atan2(y*r+v*o*g,(1-h)*Math.sqrt(x*x+T*T)),D=h/16*k*(4+h*(4-3*k)),E=c+180*(Math.atan2(o*f,v*r-y*o*g)-(1-D)*h*x*(P+D*o*(n+D*r*(2*n*n-1))))/d,O=180*A/d;return L.latLng(E,O)}function Fe(t,e,i,n,o=!0){let r,s,a,l=[];for(let h=0;h<i;h+=1){if(o)r=360*h/i+n,s=ze(t,r,e),a=L.latLng(s.lng,s.lat);else{let n=t.lat+Math.cos(2*h*Math.PI/i)*e,o=t.lng+Math.sin(2*h*Math.PI/i)*e;a=L.latLng(n,o)}l.push(a)}return l}function je(t,e,i){let n=t.latLngToContainerPoint(e),o=t.latLngToContainerPoint(i),r=180*Math.atan2(o.y-n.y,o.x-n.x)/Math.PI+90;return r+=r<0?360:0,r}function Ne(t,e,i,n){return function(t,e,i){e=(e+360)%360;let n=Math.PI/180,o=180/Math.PI,{R:r}=L.CRS.Earth,s=t.lng*n,a=t.lat*n,l=e*n,h=Math.sin(a),c=Math.cos(a),p=Math.cos(i/r),u=Math.sin(i/r),d=Math.asin(h*p+c*u*Math.cos(l)),m=s+Math.atan2(Math.sin(l)*u*c,p-h*Math.sin(d));return m*=o,m=m>180?m-360:m<-180?m+360:m,L.latLng([d*o,m])}(e,je(t,e,i),n)}function Ue(t,e=t.getLatLngs()){return t instanceof L.Polygon?L.polygon(e).getLatLngs():L.polyline(e).getLatLngs()}function Ge(t,e){if(e.options.crs?.projection?.MAX_LATITUDE){let i=e.options.crs?.projection?.MAX_LATITUDE;t.lat=Math.max(Math.min(i,t.lat),-i)}return t}function He(t){return t.options.renderer||t._map&&(t._map._getPaneRenderer(t.options.pane)||t._map.options.renderer||t._map._renderer)||t._renderer}var Ze=L.Class.extend({includes:[Me,Ce,Pe,Se,Ae],initialize(t){this.map=t,this.Draw=new L.PM.Draw(t),this.Toolbar=new L.PM.Toolbar(t),this.Keyboard=De(),this.globalOptions={snappable:!0,layerGroup:void 0,snappingOrder:["Marker","CircleMarker","Circle","Line","Polygon","Rectangle"],panes:{vertexPane:"markerPane",layerPane:"overlayPane",markerPane:"markerPane"},draggable:!0},this.Keyboard._initKeyListener(t)},setLang(t="en",e,i="en"){let n=L.PM.activeLang;e&&(we[t]=(0,Le.default)(we[i],e)),L.PM.activeLang=t,this.map.pm.Toolbar.reinit(),this._fireLangChange(n,t,i,we[t])},addControls(t){this.Toolbar.addControls(t)},removeControls(){this.Toolbar.removeControls()},toggleControls(){this.Toolbar.toggleControls()},controlsVisible(){return this.Toolbar.isVisible},enableDraw(t="Polygon",e){"Poly"===t&&(t="Polygon"),this.Draw.enable(t,e)},disableDraw(t="Polygon"){"Poly"===t&&(t="Polygon"),this.Draw.disable(t)},setPathOptions(t,e={}){let i=e.ignoreShapes||[],n=e.merge||!1;this.map.pm.Draw.shapes.forEach((e=>{-1===i.indexOf(e)&&this.map.pm.Draw[e].setPathOptions(t,n)}))},getGlobalOptions(){return this.globalOptions},setGlobalOptions(t){let e=(0,Le.default)(this.globalOptions,t);e.editable&&(e.resizeableCircleMarker=e.editable,delete e.editable);let i=!1;this.map.pm.Draw.CircleMarker.enabled()&&!!this.map.pm.Draw.CircleMarker.options.resizeableCircleMarker!=!!e.resizeableCircleMarker&&(this.map.pm.Draw.CircleMarker.disable(),i=!0);let n=!1;this.map.pm.Draw.Circle.enabled()&&!!this.map.pm.Draw.Circle.options.resizableCircle!=!!e.resizableCircle&&(this.map.pm.Draw.Circle.disable(),n=!0),this.map.pm.Draw.shapes.forEach((t=>{this.map.pm.Draw[t].setOptions(e)})),i&&this.map.pm.Draw.CircleMarker.enable(),n&&this.map.pm.Draw.Circle.enable(),L.PM.Utils.findLayers(this.map).forEach((t=>{t.pm.setOptions(e)})),this.map.fire("pm:globaloptionschanged"),this.globalOptions=e,this.applyGlobalOptions()},applyGlobalOptions(){L.PM.Utils.findLayers(this.map).forEach((t=>{t.pm.enabled()&&t.pm.applyOptions()}))},globalDrawModeEnabled(){return!!this.Draw.getActiveShape()},globalCutModeEnabled(){return!!this.Draw.Cut.enabled()},enableGlobalCutMode(t){return this.Draw.Cut.enable(t)},toggleGlobalCutMode(t){return this.Draw.Cut.toggle(t)},disableGlobalCutMode(){return this.Draw.Cut.disable()},getGeomanLayers(t=!1){let e=L.PM.Utils.findLayers(this.map);if(!t)return e;let i=L.featureGroup();return i._pmTempLayer=!0,e.forEach((t=>{i.addLayer(t)})),i},getGeomanDrawLayers(t=!1){let e=L.PM.Utils.findLayers(this.map).filter((t=>!0===t._drawnByGeoman));if(!t)return e;let i=L.featureGroup();return i._pmTempLayer=!0,e.forEach((t=>{i.addLayer(t)})),i},_getContainingLayer(){return this.globalOptions.layerGroup&&this.globalOptions.layerGroup instanceof L.LayerGroup?this.globalOptions.layerGroup:this.map},_isCRSSimple(){return this.map.options.crs===L.CRS.Simple},_touchEventCounter:0,_addTouchEvents(t){0===this._touchEventCounter&&(L.DomEvent.on(t,"touchmove",this._canvasTouchMove,this),L.DomEvent.on(t,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter+=1},_removeTouchEvents(t){1===this._touchEventCounter&&(L.DomEvent.off(t,"touchmove",this._canvasTouchMove,this),L.DomEvent.off(t,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter=this._touchEventCounter<=1?0:this._touchEventCounter-1},_canvasTouchMove(t){He(this.map)._onMouseMove(this._createMouseEvent("mousemove",t))},_canvasTouchClick(t){let e="";"touchstart"===t.type||"pointerdown"===t.type?e="mousedown":("touchend"===t.type||"pointerup"===t.type||"touchcancel"===t.type||"pointercancel"===t.type)&&(e="mouseup"),e&&He(this.map)._onClick(this._createMouseEvent(e,t))},_createMouseEvent(t,e){let i,n=e.touches[0]||e.changedTouches[0];try{i=new MouseEvent(t,{bubbles:e.bubbles,cancelable:e.cancelable,view:e.view,detail:n.detail,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,button:e.button,relatedTarget:e.relatedTarget})}catch{i=document.createEvent("MouseEvents"),i.initMouseEvent(t,e.bubbles,e.cancelable,e.view,n.detail,n.screenX,n.screenY,n.clientX,n.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}return i}}),Ve=L.Control.extend({includes:[Ae],options:{position:"topleft",disableByOtherButtons:!0},initialize(t){this._button=L.Util.extend({},this.options,t)},onAdd(t){return this._map=t,this._map.pm.Toolbar.options.oneBlock?this._container=this._map.pm.Toolbar._createContainer(this.options.position):"edit"===this._button.tool?this._container=this._map.pm.Toolbar.editContainer:"options"===this._button.tool?this._container=this._map.pm.Toolbar.optionsContainer:"custom"===this._button.tool?this._container=this._map.pm.Toolbar.customContainer:this._container=this._map.pm.Toolbar.drawContainer,this.buttonsDomNode=this._makeButton(this._button),this._container.appendChild(this.buttonsDomNode),this._container},onRemove(){return this.buttonsDomNode.remove(),this._container},getText(){return this._button.text},getIconUrl(){return this._button.iconUrl},destroy(){this._button={},this._update()},toggle(t){return this._button.toggleStatus="boolean"==typeof t?t:!this._button.toggleStatus,this._applyStyleClasses(),this._button.toggleStatus},toggled(){return this._button.toggleStatus},onCreate(){this.toggle(!1)},disable(){this.toggle(!1),this._button.disabled=!0,this._updateDisabled()},enable(){this._button.disabled=!1,this._updateDisabled()},_triggerClick(t){t&&t.preventDefault(),!this._button.disabled&&(this._button.onClick(t,{button:this,event:t}),this._clicked(t),this._button.afterClick(t,{button:this,event:t}))},_makeButton(t){let e=this.options.position.indexOf("right")>-1?"pos-right":"",i=L.DomUtil.create("div",`button-container ${e}`,this._container);t.title&&i.setAttribute("title",t.title);let n=L.DomUtil.create("a","leaflet-buttons-control-button",i);n.setAttribute("role","button"),n.setAttribute("tabindex","0"),n.href="#";let o=L.DomUtil.create("div",`leaflet-pm-actions-container ${e}`,i),r=t.actions,s={cancel:{text:Ie("actions.cancel"),onClick(){this._triggerClick()}},finishMode:{text:Ie("actions.finish"),onClick(){this._triggerClick()}},removeLastVertex:{text:Ie("actions.removeLastVertex"),onClick(){this._map.pm.Draw[t.jsClass]._removeLastVertex()}},finish:{text:Ie("actions.finish"),onClick(e){this._map.pm.Draw[t.jsClass]._finishShape(e)}}};r.forEach((i=>{let n,r="string"==typeof i?i:i.name;if(s[r])n=s[r];else{if(!i.text)return;n=i}let a=L.DomUtil.create("a",`leaflet-pm-action ${e} action-${r}`,o);if(a.setAttribute("role","button"),a.setAttribute("tabindex","0"),a.href="#",a.innerHTML=n.text,L.DomEvent.disableClickPropagation(a),L.DomEvent.on(a,"click",L.DomEvent.stop),!t.disabled&&n.onClick){let e=e=>{e.preventDefault();let i="",{buttons:o}=this._map.pm.Toolbar;for(let e in o)if(o[e]._button===t){i=e;break}this._fireActionClick(n,i,t)};L.DomEvent.addListener(a,"click",e,this),L.DomEvent.addListener(a,"click",n.onClick,this)}})),t.toggleStatus&&L.DomUtil.addClass(i,"active");let a=L.DomUtil.create("div","control-icon",n);return t.iconUrl&&a.setAttribute("src",t.iconUrl),t.className&&L.DomUtil.addClass(a,t.className),L.DomEvent.disableClickPropagation(n),L.DomEvent.on(n,"click",L.DomEvent.stop),t.disabled||(L.DomEvent.addListener(n,"click",this._onBtnClick,this),L.DomEvent.addListener(n,"click",this._triggerClick,this)),t.disabled&&(L.DomUtil.addClass(n,"pm-disabled"),n.setAttribute("aria-disabled","true")),i},_applyStyleClasses(){this._container&&(this._button.toggleStatus&&!1!==this._button.cssToggle?(L.DomUtil.addClass(this.buttonsDomNode,"active"),L.DomUtil.addClass(this._container,"activeChild")):(L.DomUtil.removeClass(this.buttonsDomNode,"active"),L.DomUtil.removeClass(this._container,"activeChild")))},_onBtnClick(){if(this._button.disabled)return;this._button.disableOtherButtons&&this._map.pm.Toolbar.triggerClickOnToggledButtons(this);let t="",{buttons:e}=this._map.pm.Toolbar;for(let i in e)if(e[i]._button===this._button){t=i;break}this._fireButtonClick(t,this._button)},_clicked(){this._button.doToggle&&this.toggle()},_updateDisabled(){if(!this._container)return;let t="pm-disabled",e=this.buttonsDomNode.children[0];this._button.disabled?(L.DomUtil.addClass(e,t),e.setAttribute("aria-disabled","true")):(L.DomUtil.removeClass(e,t),e.setAttribute("aria-disabled","false"))}});L.Control.PMButton=Ve;var We=L.Class.extend({options:{drawMarker:!0,drawRectangle:!0,drawPolyline:!0,drawPolygon:!0,drawCircle:!0,drawCircleMarker:!0,drawText:!0,editMode:!0,dragMode:!0,cutPolygon:!0,removalMode:!0,rotateMode:!0,snappingOption:!0,drawControls:!0,editControls:!0,optionsControls:!0,customControls:!0,oneBlock:!1,position:"topleft",positions:{draw:"",edit:"",options:"",custom:""}},customButtons:[],initialize(t){this.init(t)},reinit(){let t=this.isVisible;this.removeControls(),this._defineButtons(),t&&this.addControls()},init(t){this.map=t,this.buttons={},this.isVisible=!1,this.drawContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-draw leaflet-bar leaflet-control"),this.editContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-edit leaflet-bar leaflet-control"),this.optionsContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-options leaflet-bar leaflet-control"),this.customContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-custom leaflet-bar leaflet-control"),this._defineButtons()},_createContainer(t){let e=`${t}Container`;return this[e]||(this[e]=L.DomUtil.create("div",`leaflet-pm-toolbar leaflet-pm-${t} leaflet-bar leaflet-control`)),this[e]},getButtons(){return this.buttons},addControls(t=this.options){typeof t.editPolygon<"u"&&(t.editMode=t.editPolygon),typeof t.deleteLayer<"u"&&(t.removalMode=t.deleteLayer),L.Util.setOptions(this,t),this.applyIconStyle(),this.isVisible=!0,this._showHideButtons()},applyIconStyle(){let t=this.getButtons(),e={geomanIcons:{drawMarker:"control-icon leaflet-pm-icon-marker",drawPolyline:"control-icon leaflet-pm-icon-polyline",drawRectangle:"control-icon leaflet-pm-icon-rectangle",drawPolygon:"control-icon leaflet-pm-icon-polygon",drawCircle:"control-icon leaflet-pm-icon-circle",drawCircleMarker:"control-icon leaflet-pm-icon-circle-marker",editMode:"control-icon leaflet-pm-icon-edit",dragMode:"control-icon leaflet-pm-icon-drag",cutPolygon:"control-icon leaflet-pm-icon-cut",removalMode:"control-icon leaflet-pm-icon-delete",drawText:"control-icon leaflet-pm-icon-text"}};for(let i in t){let n=t[i];L.Util.setOptions(n,{className:e.geomanIcons[i]})}},removeControls(){let t=this.getButtons();for(let e in t)t[e].remove();this.isVisible=!1},toggleControls(t=this.options){this.isVisible?this.removeControls():this.addControls(t)},_addButton(t,e){return this.buttons[t]=e,this.options[t]=this.options[t]||!1,this.buttons[t]},triggerClickOnToggledButtons(t){for(let e in this.buttons){let i=this.buttons[e];i._button.disableByOtherButtons&&i!==t&&i.toggled()&&i._triggerClick()}},toggleButton(t,e,i=!0){return"editPolygon"===t&&(t="editMode"),"deleteLayer"===t&&(t="removalMode"),i&&this.triggerClickOnToggledButtons(this.buttons[t]),!!this.buttons[t]&&this.buttons[t].toggle(e)},_defineButtons(){let t={className:"control-icon leaflet-pm-icon-marker",title:Ie("buttonTitles.drawMarkerButton"),jsClass:"Marker",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},e={title:Ie("buttonTitles.drawPolyButton"),className:"control-icon leaflet-pm-icon-polygon",jsClass:"Polygon",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},i={className:"control-icon leaflet-pm-icon-polyline",title:Ie("buttonTitles.drawLineButton"),jsClass:"Line",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},n={title:Ie("buttonTitles.drawCircleButton"),className:"control-icon leaflet-pm-icon-circle",jsClass:"Circle",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},o={title:Ie("buttonTitles.drawCircleMarkerButton"),className:"control-icon leaflet-pm-icon-circle-marker",jsClass:"CircleMarker",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},r={title:Ie("buttonTitles.drawRectButton"),className:"control-icon leaflet-pm-icon-rectangle",jsClass:"Rectangle",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},s={title:Ie("buttonTitles.editButton"),className:"control-icon leaflet-pm-icon-edit",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalEditMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},a={title:Ie("buttonTitles.dragButton"),className:"control-icon leaflet-pm-icon-drag",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalDragMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},l={title:Ie("buttonTitles.cutButton"),className:"control-icon leaflet-pm-icon-cut",jsClass:"Cut",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle({snappable:!0,cursorMarker:!0,allowSelfIntersection:!1})},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finish","removeLastVertex","cancel"]},h={title:Ie("buttonTitles.deleteButton"),className:"control-icon leaflet-pm-icon-delete",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalRemovalMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},c={title:Ie("buttonTitles.rotateButton"),className:"control-icon leaflet-pm-icon-rotate",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalRotateMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},p={className:"control-icon leaflet-pm-icon-text",title:Ie("buttonTitles.drawTextButton"),jsClass:"Text",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]};this._addButton("drawMarker",new L.Control.PMButton(t)),this._addButton("drawPolyline",new L.Control.PMButton(i)),this._addButton("drawRectangle",new L.Control.PMButton(r)),this._addButton("drawPolygon",new L.Control.PMButton(e)),this._addButton("drawCircle",new L.Control.PMButton(n)),this._addButton("drawCircleMarker",new L.Control.PMButton(o)),this._addButton("drawText",new L.Control.PMButton(p)),this._addButton("editMode",new L.Control.PMButton(s)),this._addButton("dragMode",new L.Control.PMButton(a)),this._addButton("cutPolygon",new L.Control.PMButton(l)),this._addButton("removalMode",new L.Control.PMButton(h)),this._addButton("rotateMode",new L.Control.PMButton(c))},_showHideButtons(){if(!this.isVisible)return;this.removeControls(),this.isVisible=!0;let t=this.getButtons(),e=[];!1===this.options.drawControls&&(e=e.concat(Object.keys(t).filter((e=>!t[e]._button.tool)))),!1===this.options.editControls&&(e=e.concat(Object.keys(t).filter((e=>"edit"===t[e]._button.tool)))),!1===this.options.optionsControls&&(e=e.concat(Object.keys(t).filter((e=>"options"===t[e]._button.tool)))),!1===this.options.customControls&&(e=e.concat(Object.keys(t).filter((e=>"custom"===t[e]._button.tool))));for(let i in t)if(this.options[i]&&-1===e.indexOf(i)){let e=t[i]._button.tool;e||(e="draw"),t[i].setPosition(this._getBtnPosition(e)),t[i].addTo(this.map)}},_getBtnPosition(t){return this.options.positions&&this.options.positions[t]?this.options.positions[t]:this.options.position},setBlockPosition(t,e){this.options.positions[t]=e,this._showHideButtons(),this.changeControlOrder()},getBlockPositions(){return this.options.positions},copyDrawControl(t,e){if(!e)throw new TypeError("Button has no name");"object"!=typeof e&&(e={name:e});let i=this._btnNameMapping(t);if(!e.name)throw new TypeError("Button has no name");if(this.buttons[e.name])throw new TypeError("Button with this name already exists");let n=this.map.pm.Draw.createNewDrawInstance(e.name,i);return e={...this.buttons[i]._button,...e},{drawInstance:n,control:this.createCustomControl(e)}},createCustomControl(t){if(!t.name)throw new TypeError("Button has no name");if(this.buttons[t.name])throw new TypeError("Button with this name already exists");t.onClick||(t.onClick=()=>{}),t.afterClick||(t.afterClick=()=>{}),!1!==t.toggle&&(t.toggle=!0),t.block&&(t.block=t.block.toLowerCase()),(!t.block||"draw"===t.block)&&(t.block=""),t.className?-1===t.className.indexOf("control-icon")&&(t.className=`control-icon ${t.className}`):t.className="control-icon";let e={tool:t.block,className:t.className,title:t.title||"",jsClass:t.name,onClick:t.onClick,afterClick:t.afterClick,doToggle:t.toggle,toggleStatus:!1,disableOtherButtons:t.disableOtherButtons??!0,disableByOtherButtons:t.disableByOtherButtons??!0,cssToggle:t.toggle,position:this.options.position,actions:t.actions||[],disabled:!!t.disabled};!1!==this.options[t.name]&&(this.options[t.name]=!0);let i=this._addButton(t.name,new L.Control.PMButton(e));return this.changeControlOrder(),i},changeControlOrder(t=[]){let e=this._shapeMapping(),i=[];t.forEach((t=>{e[t]?i.push(e[t]):i.push(t)}));let n=this.getButtons(),o={};i.forEach((t=>{n[t]&&(o[t]=n[t])})),Object.keys(n).filter((t=>!n[t]._button.tool)).forEach((t=>{-1===i.indexOf(t)&&(o[t]=n[t])})),Object.keys(n).filter((t=>"edit"===n[t]._button.tool)).forEach((t=>{-1===i.indexOf(t)&&(o[t]=n[t])})),Object.keys(n).filter((t=>"options"===n[t]._button.tool)).forEach((t=>{-1===i.indexOf(t)&&(o[t]=n[t])})),Object.keys(n).filter((t=>"custom"===n[t]._button.tool)).forEach((t=>{-1===i.indexOf(t)&&(o[t]=n[t])})),Object.keys(n).forEach((t=>{-1===i.indexOf(t)&&(o[t]=n[t])})),this.map.pm.Toolbar.buttons=o,this._showHideButtons()},getControlOrder(){let t=this.getButtons(),e=[];for(let i in t)e.push(i);return e},changeActionsOfControl(t,e){let i=this._btnNameMapping(t);if(!i)throw new TypeError("No name passed");if(!e)throw new TypeError("No actions passed");if(!this.buttons[i])throw new TypeError("Button with this name not exists");this.buttons[i]._button.actions=e,this.changeControlOrder()},setButtonDisabled(t,e){let i=this._btnNameMapping(t);e?this.buttons[i].disable():this.buttons[i].enable()},_shapeMapping(){return{Marker:"drawMarker",Circle:"drawCircle",Polygon:"drawPolygon",Rectangle:"drawRectangle",Polyline:"drawPolyline",Line:"drawPolyline",CircleMarker:"drawCircleMarker",Edit:"editMode",Drag:"dragMode",Cut:"cutPolygon",Removal:"removalMode",Rotate:"rotateMode",Text:"drawText"}},_btnNameMapping(t){let e=this._shapeMapping();return e[t]?e[t]:t}}),qe=u(ee()),$e={_initSnappableMarkers(){this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=void 0===this.options.snapSegment||this.options.snapSegment,this._assignEvents(this._markers),this._layer.off("pm:dragstart",this._unsnap,this),this._layer.on("pm:dragstart",this._unsnap,this)},_disableSnapping(){this._layer.off("pm:dragstart",this._unsnap,this)},_assignEvents(t){t.forEach((t=>{Array.isArray(t)?this._assignEvents(t):(t.off("drag",this._handleSnapping,this),t.on("drag",this._handleSnapping,this),t.off("dragend",this._cleanupSnapping,this),t.on("dragend",this._cleanupSnapping,this))}))},_cleanupSnapping(t){if(t){t.target._snapped=!1}delete this._snapList,this.throttledList&&(this._map.off("layeradd",this.throttledList,this),this.throttledList=void 0),this._map.off("layerremove",this._handleSnapLayerRemoval,this),this.debugIndicatorLines&&this.debugIndicatorLines.forEach((t=>{t.remove()}))},_handleThrottleSnapping(){this.throttledList&&this._createSnapList()},_handleSnapping(t){let e=t.target;if(e._snapped=!1,this.throttledList||(this.throttledList=L.Util.throttle(this._handleThrottleSnapping,100,this)),t?.originalEvent?.altKey||this._map?.pm?.Keyboard.isAltKeyPressed()||(void 0===this._snapList&&(this._createSnapList(),this._map.off("layeradd",this.throttledList,this),this._map.on("layeradd",this.throttledList,this)),this._snapList.length<=0))return!1;let i=this._calcClosestLayer(e.getLatLng(),this._snapList);if(0===Object.keys(i).length)return!1;let n,o=i.layer instanceof L.Marker||i.layer instanceof L.CircleMarker||!this.options.snapSegment;n=o?i.latlng:this._checkPrioritiySnapping(i);let r=this.options.snapDistance,s={marker:e,shape:this._shape,snapLatLng:n,segment:i.segment,layer:this._layer,workingLayer:this._layer,layerInteractedWith:i.layer,distance:i.distance};if(this._fireSnapDrag(s.marker,s),this._fireSnapDrag(this._layer,s),i.distance<r){e._orgLatLng=e.getLatLng(),e.setLatLng(n),e._snapped=!0,e._snapInfo=s;let t=()=>{this._snapLatLng=n,this._fireSnap(e,s),this._fireSnap(this._layer,s)},i=this._snapLatLng||{},o=n||{};(i.lat!==o.lat||i.lng!==o.lng)&&t()}else this._snapLatLng&&(this._unsnap(s),e._snapped=!1,e._snapInfo=void 0,this._fireUnsnap(s.marker,s),this._fireUnsnap(this._layer,s));return!0},_createSnapList(){let t=[],e=[],i=this._map;i.off("layerremove",this._handleSnapLayerRemoval,this),i.on("layerremove",this._handleSnapLayerRemoval,this),i.eachLayer((i=>{if((i instanceof L.Polyline||i instanceof L.Marker||i instanceof L.CircleMarker||i instanceof L.ImageOverlay)&&!0!==i.options.snapIgnore){if(void 0===i.options.snapIgnore&&(!L.PM.optIn&&!0===i.options.pmIgnore||L.PM.optIn&&!1!==i.options.pmIgnore))return;(i instanceof L.Circle||i instanceof L.CircleMarker)&&i.pm&&i.pm._hiddenPolyCircle?t.push(i.pm._hiddenPolyCircle):i instanceof L.ImageOverlay&&(i=L.rectangle(i.getBounds())),t.push(i);let n=L.polyline([],{color:"red",pmIgnore:!0});n._pmTempLayer=!0,e.push(n),(i instanceof L.Circle||i instanceof L.CircleMarker)&&e.push(n)}})),t=t.filter((t=>this._layer!==t)),t=t.filter((t=>t._latlng||t._latlngs&&Be(t._latlngs))),t=t.filter((t=>!t._pmTempLayer)),this._otherSnapLayers?(this._otherSnapLayers.forEach((()=>{let t=L.polyline([],{color:"red",pmIgnore:!0});t._pmTempLayer=!0,e.push(t)})),this._snapList=t.concat(this._otherSnapLayers)):this._snapList=t,this.debugIndicatorLines=e},_handleSnapLayerRemoval({layer:t}){if(!t._leaflet_id)return;let e=this._snapList.findIndex((e=>e._leaflet_id===t._leaflet_id));e>-1&&this._snapList.splice(e,1)},_calcClosestLayer(t,e){return this._calcClosestLayers(t,e,1)[0]},_calcClosestLayers(t,e,i=1){let n=[],o={};e.forEach(((e,r)=>{if(e._parentCopy&&e._parentCopy===this._layer)return;let s=this._calcLayerDistances(t,e);if(s.distance=Math.floor(s.distance),this.debugIndicatorLines){if(!this.debugIndicatorLines[r]){let t=L.polyline([],{color:"red",pmIgnore:!0});t._pmTempLayer=!0,this.debugIndicatorLines[r]=t}this.debugIndicatorLines[r].setLatLngs([t,s.latlng])}1===i&&(void 0===o.distance||s.distance-5<=o.distance)?(s.distance+5<o.distance&&(n=[]),o=s,o.layer=e,n.push(o)):1!==i&&(o={},o=s,o.layer=e,n.push(o))})),1!==i&&(n=n.sort(((t,e)=>t.distance-e.distance))),-1===i&&(i=n.length);let r=this._getClosestLayerByPriority(n,i);return L.Util.isArray(r)?r:[r]},_calcLayerDistances(t,e){let i=this._map,n=e instanceof L.Marker||e instanceof L.CircleMarker,o=e instanceof L.Polygon,r=t;if(n){let t=e.getLatLng();return{latlng:{...t},distance:this._getDistance(i,t,r)}}return this._calcLatLngDistances(r,e.getLatLngs(),i,o)},_calcLatLngDistances(t,e,i,n=!1){let o,r,s,a=e=>{e.forEach(((l,h)=>{if(Array.isArray(l))a(l);else if(this.options.snapSegment){let o,a=l;o=n?h+1===e.length?0:h+1:h+1===e.length?void 0:h+1;let c=e[o];if(c){let e=this._getDistanceToSegment(i,t,a,c);(void 0===r||e<r)&&(r=e,s=[a,c])}}else{let e=this._getDistance(i,t,l);(void 0===r||e<r)&&(r=e,o=l)}}))};return a(e),this.options.snapSegment?{latlng:{...this._getClosestPointOnSegment(i,t,s[0],s[1])},segment:s,distance:r}:{latlng:o,distance:r}},_getClosestLayerByPriority(t,e=1){t=t.sort(((t,e)=>t._leaflet_id-e._leaflet_id));let i=this._map.pm.globalOptions.snappingOrder||[],n=0,o={};return i.concat(["Marker","CircleMarker","Circle","Line","Polygon","Rectangle"]).forEach((t=>{o[t]||(n+=1,o[t]=n)})),t.sort(function(t,e,i="asc"){if(!e||0===Object.keys(e).length)return(t,e)=>t-e;let n,o=Object.keys(e),r=o.length-1,s={};for(;r>=0;)n=o[r],s[n.toLowerCase()]=e[n],r-=1;function a(t){return t instanceof L.Marker?"Marker":t instanceof L.Circle?"Circle":t instanceof L.CircleMarker?"CircleMarker":t instanceof L.Rectangle?"Rectangle":t instanceof L.Polygon?"Polygon":t instanceof L.Polyline?"Line":void 0}return(e,n)=>{let o,r;if("instanceofShape"===t){if(o=a(e.layer).toLowerCase(),r=a(n.layer).toLowerCase(),!o||!r)return 0}else{if(!e.hasOwnProperty(t)||!n.hasOwnProperty(t))return 0;o=e[t].toLowerCase(),r=n[t].toLowerCase()}let l=o in s?s[o]:Number.MAX_SAFE_INTEGER,h=r in s?s[r]:Number.MAX_SAFE_INTEGER,c=0;return l<h?c=-1:l>h&&(c=1),"desc"===i?-1*c:c}}("instanceofShape",o)),1===e?t[0]||{}:t.slice(0,e)},_checkPrioritiySnapping(t){let e,i=this._map,n=t.segment[0],o=t.segment[1],r=t.latlng,s=this._getDistance(i,n,r),a=this._getDistance(i,o,r),l=s<a?n:o,h=s<a?s:a;if(this.options.snapMiddle){let t=L.PM.Utils.calcMiddleLatLng(i,n,o),e=this._getDistance(i,t,r);e<s&&e<a&&(l=t,h=e)}return e=h<this.options.snapDistance?l:r,{...e}},_unsnap(){delete this._snapLatLng},_getClosestPointOnSegment(t,e,i,n){let o=t.getMaxZoom();o===1/0&&(o=t.getZoom());let r=t.project(e,o),s=t.project(i,o),a=t.project(n,o),l=L.LineUtil.closestPointOnSegment(r,s,a);return t.unproject(l,o)},_getDistanceToSegment(t,e,i,n){let o=t.latLngToLayerPoint(e),r=t.latLngToLayerPoint(i),s=t.latLngToLayerPoint(n);return L.LineUtil.pointToSegmentDistance(o,r,s)},_getDistance(t,e,i){return t.latLngToLayerPoint(e).distanceTo(t.latLngToLayerPoint(i))}},Ke=L.Class.extend({includes:[$e,Ae],options:{snappable:!0,snapDistance:20,snapMiddle:!1,allowSelfIntersection:!0,tooltips:!0,templineStyle:{},hintlineStyle:{color:"#3388ff",dashArray:"5,5"},pathOptions:null,cursorMarker:!0,finishOn:null,markerStyle:{draggable:!0,icon:L.icon()},hideMiddleMarkers:!1,minRadiusCircle:null,maxRadiusCircle:null,minRadiusCircleMarker:null,maxRadiusCircleMarker:null,resizeableCircleMarker:!1,resizableCircle:!0,markerEditable:!0,continueDrawing:!1,snapSegment:!0,requireSnapToFinish:!1,rectangleAngle:0},setOptions(t){L.Util.setOptions(this,t),this.setStyle(this.options)},setStyle(){},getOptions(){return this.options},initialize(t){let e=new L.Icon.Default;e.options.tooltipAnchor=[0,0],this.options.markerStyle.icon=e,this._map=t,this.shapes=["Marker","CircleMarker","Line","Polygon","Rectangle","Circle","Cut","Text"],this.shapes.forEach((t=>{this[t]=new L.PM.Draw[t](this._map)})),this.Marker.setOptions({continueDrawing:!0}),this.CircleMarker.setOptions({continueDrawing:!0})},setPathOptions(t,e=!1){this.options.pathOptions=e?(0,qe.default)(this.options.pathOptions,t):t},getShapes(){return this.shapes},getShape(){return this._shape},enable(t,e){if(!t)throw new Error(`Error: Please pass a shape as a parameter. Possible shapes are: ${this.getShapes().join(",")}`);this.disable(),this[t].enable(e)},disable(){this.shapes.forEach((t=>{this[t].disable()}))},addControls(){this.shapes.forEach((t=>{this[t].addButton()}))},getActiveShape(){let t;return this.shapes.forEach((e=>{this[e]._enabled&&(t=e)})),t},_setGlobalDrawMode(){"Cut"===this._shape?this._fireGlobalCutModeToggled():this._fireGlobalDrawModeToggled();let t=L.PM.Utils.findLayers(this._map);this._enabled?t.forEach((t=>{L.PM.Utils.disablePopup(t)})):t.forEach((t=>{L.PM.Utils.enablePopup(t)}))},createNewDrawInstance(t,e){let i=this._getShapeFromBtnName(e);if(this[t])throw new TypeError("Draw Type already exists");if(!L.PM.Draw[i])throw new TypeError(`There is no class L.PM.Draw.${i}`);return this[t]=new L.PM.Draw[i](this._map),this[t].toolbarButtonName=t,this[t]._shape=t,this.shapes.push(t),this[e]&&this[t].setOptions(this[e].options),this[t].setOptions(this[t].options),this[t]},_getShapeFromBtnName(t){let e={drawMarker:"Marker",drawCircle:"Circle",drawPolygon:"Polygon",drawPolyline:"Line",drawRectangle:"Rectangle",drawCircleMarker:"CircleMarker",editMode:"Edit",dragMode:"Drag",cutPolygon:"Cut",removalMode:"Removal",rotateMode:"Rotate",drawText:"Text"};return e[t]?e[t]:this[t]?this[t]._shape:t},_finishLayer(t){t.pm&&(t.pm.setOptions(this.options),t.pm._shape=this._shape,t.pm._map=this._map),this._addDrawnLayerProp(t)},_addDrawnLayerProp(t){t._drawnByGeoman=!0},_setPane(t,e){"layerPane"===e?t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":"vertexPane"===e?t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":"markerPane"===e&&(t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.markerPane||"markerPane")},_isFirstLayer(){return 0===(this._map||this._layer._map).pm.getGeomanLayers().length}});Ke.Marker=Ke.extend({initialize(t){this._map=t,this._shape="Marker",this.toolbarButtonName="drawMarker"},enable(t){L.Util.setOptions(this,t),this._enabled=!0,this._map.getContainer().classList.add("geoman-draw-cursor"),this._map.on("click",this._createMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._hintMarker=L.marker(this._map.getCenter(),this.options.markerStyle),this._setPane(this._hintMarker,"markerPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this.options.tooltips&&this._hintMarker.bindTooltip(Ie("tooltips.placeMarker"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._layer=this._hintMarker,this._map.on("mousemove",this._syncHintMarker,this),this.options.markerEditable&&this._map.eachLayer((t=>{this.isRelevantMarker(t)&&t.pm.enable()})),this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("click",this._createMarker,this),this._hintMarker.remove(),this._map.off("mousemove",this._syncHintMarker,this),this._map.eachLayer((t=>{this.isRelevantMarker(t)&&t.pm.disable()})),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(t){this.enabled()?this.disable():this.enable(t)},isRelevantMarker(t){return t instanceof L.Marker&&t.pm&&!t._pmTempLayer&&!t.pm._initTextMarker},_syncHintMarker(t){if(this._hintMarker.setLatLng(t.latlng),this.options.snappable){let e=t;e.target=this._hintMarker,this._handleSnapping(e)}this._fireChange(this._hintMarker.getLatLng(),"Draw")},_createMarker(t){if(!t.latlng||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng(),i=new L.Marker(e,this.options.markerStyle);this._setPane(i,"markerPane"),this._finishLayer(i),i.pm||(i.options.draggable=!1),i.addTo(this._map.pm._getContainingLayer()),i.pm&&this.options.markerEditable?i.pm.enable():i.dragging&&i.dragging.disable(),this._fireCreate(i),this._cleanupSnapping(),this.options.continueDrawing||this.disable()},setStyle(){this.options.markerStyle?.icon&&this._hintMarker?.setIcon(this.options.markerStyle.icon)}});var Ye=6371008.8,Je={centimeters:100*Ye,centimetres:100*Ye,degrees:Ye/111325,feet:3.28084*Ye,inches:39.37*Ye,kilometers:Ye/1e3,kilometres:Ye/1e3,meters:Ye,metres:Ye,miles:Ye/1609.344,millimeters:1e3*Ye,millimetres:1e3*Ye,nauticalmiles:Ye/1852,radians:1,yards:1.0936*Ye};function Xe(t,e,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=e||{},n.geometry=t,n}function Qe(t,e,i){if(void 0===i&&(i={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!oi(t[0])||!oi(t[1]))throw new Error("coordinates must contain numbers");return Xe({type:"Point",coordinates:t},e,i)}function ti(t,e,i){if(void 0===i&&(i={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return Xe({type:"LineString",coordinates:t},e,i)}function ei(t,e){void 0===e&&(e={});var i={type:"FeatureCollection"};return e.id&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.features=t,i}function ii(t){return 180*(t%(2*Math.PI))/Math.PI}function ni(t){return t%360*Math.PI/180}function oi(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function ri(t){var e,i,n={type:"FeatureCollection",features:[]};if("LineString"===(i="Feature"===t.type?t.geometry:t).type)e=[i.coordinates];else if("MultiLineString"===i.type)e=i.coordinates;else if("MultiPolygon"===i.type)e=[].concat.apply([],i.coordinates);else{if("Polygon"!==i.type)throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");e=i.coordinates}return e.forEach((function(t){e.forEach((function(e){for(var i=0;i<t.length-1;i++)for(var o=i;o<e.length-1;o++)if(t!==e||1!==Math.abs(i-o)&&(0!==i||o!==t.length-2||t[i][0]!==t[t.length-1][0]||t[i][1]!==t[t.length-1][1])){var r=si(t[i][0],t[i][1],t[i+1][0],t[i+1][1],e[o][0],e[o][1],e[o+1][0],e[o+1][1]);r&&n.features.push(Qe([r[0],r[1]]))}}))})),n}function si(t,e,i,n,o,r,s,a){var l,h,c,p,u={x:null,y:null,onLine1:!1,onLine2:!1};return 0===(l=(a-r)*(i-t)-(s-o)*(n-e))?null!==u.x&&null!==u.y&&u:(p=(i-t)*(h=e-r)-(n-e)*(c=t-o),h=((s-o)*h-(a-r)*c)/l,c=p/l,u.x=t+h*(i-t),u.y=e+h*(n-e),h>=0&&h<=1&&(u.onLine1=!0),c>=0&&c<=1&&(u.onLine2=!0),!(!u.onLine1||!u.onLine2)&&[u.x,u.y])}function ai(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function li(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function hi(t){return"Feature"===t.type?t.geometry:t}function ci(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}function pi(t,e,i){if(null!==t)for(var n,o,r,s,a,l,h,c,p=0,u=0,d=t.type,m="FeatureCollection"===d,f="Feature"===d,g=m?t.features.length:1,_=0;_<g;_++){a=(c=!!(h=m?t.features[_].geometry:f?t.geometry:t)&&"GeometryCollection"===h.type)?h.geometries.length:1;for(var v=0;v<a;v++){var y=0,b=0;if(null!==(s=c?h.geometries[v]:h)){l=s.coordinates;var x=s.type;switch(p=!i||"Polygon"!==x&&"MultiPolygon"!==x?0:1,x){case null:break;case"Point":if(!1===e(l,u,_,y,b))return!1;u++,y++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===e(l[n],u,_,y,b))return!1;u++,"MultiPoint"===x&&y++}"LineString"===x&&y++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-p;o++){if(!1===e(l[n][o],u,_,y,b))return!1;u++}"MultiLineString"===x&&y++,"Polygon"===x&&b++}"Polygon"===x&&y++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(b=0,o=0;o<l[n].length;o++){for(r=0;r<l[n][o].length-p;r++){if(!1===e(l[n][o][r],u,_,y,b))return!1;u++}b++}y++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===pi(s.geometries[n],e,i))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ui(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var i=0;i<t.features.length&&!1!==e(t.features[i],i);i++);}function di(t,e){!function(t,e){var i,n,o,r,s,a,l,h,c,p,u=0,d="FeatureCollection"===t.type,m="Feature"===t.type,f=d?t.features.length:1;for(i=0;i<f;i++){for(a=d?t.features[i].geometry:m?t.geometry:t,h=d?t.features[i].properties:m?t.properties:{},c=d?t.features[i].bbox:m?t.bbox:void 0,p=d?t.features[i].id:m?t.id:void 0,s=(l=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,o=0;o<s;o++)if(null!==(r=l?a.geometries[o]:a))switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(r,u,h,c,p))return!1;break;case"GeometryCollection":for(n=0;n<r.geometries.length;n++)if(!1===e(r.geometries[n],u,h,c,p))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,u,h,c,p))return!1;u++}}(t,(function(t,i,n,o,r){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(Xe(t,n,{bbox:o,id:r}),i,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var l=0;l<t.coordinates.length;l++){var h=t.coordinates[l];if(!1===e(Xe({type:s,coordinates:h},n),i,l))return!1}}))}Ke.Line=Ke.extend({initialize(t){this._map=t,this._shape="Line",this.toolbarButtonName="drawPolyline",this._doesSelfIntersect=!1},enable(t){L.Util.setOptions(this,t),this._enabled=!0,this._markers=[],this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.polyline([],{...this.options.templineStyle,pmIgnore:!1}),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._layerGroup.addLayer(this._layer),this._hintline=L.polyline([],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._layerGroup.addLayer(this._hintline),this._hintMarker=L.marker(this._map.getCenter(),{interactive:!1,zIndexOffset:100,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Ie("tooltips.firstVertex"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._map.getContainer().classList.add("geoman-draw-cursor"),this._map.on("click",this._createVertex,this),this.options.finishOn&&"snap"!==this.options.finishOn&&this._map.on(this.options.finishOn,this._finishShape,this),"dblclick"===this.options.finishOn&&(this.tempMapDoubleClickZoomState=this._map.doubleClickZoom._enabled,this.tempMapDoubleClickZoomState&&this._map.doubleClickZoom.disable()),this._map.on("mousemove",this._syncHintMarker,this),this._hintMarker.on("move",this._syncHintLine,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[],this.isRed=!1,this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("click",this._createVertex,this),this._map.off("mousemove",this._syncHintMarker,this),this.options.finishOn&&"snap"!==this.options.finishOn&&this._map.off(this.options.finishOn,this._finishShape,this),this.tempMapDoubleClickZoomState&&this._map.doubleClickZoom.enable(),this._map.removeLayer(this._layerGroup),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(t){this.enabled()?this.disable():this.enable(t)},_syncHintLine(){let t=this._layer.getLatLngs();if(t.length>0){let e=t[t.length-1];this._hintline.setLatLngs([e,this._hintMarker.getLatLng()])}},_syncHintMarker(t){if(this._hintMarker.setLatLng(t.latlng),this.options.snappable){let e=t;e.target=this._hintMarker,this._handleSnapping(e)}this.options.allowSelfIntersection||this._handleSelfIntersection(!0,this._hintMarker.getLatLng());let e=this._layer._defaultShape().slice();e.push(this._hintMarker.getLatLng()),this._change(e)},hasSelfIntersection(){return ri(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersection(t,e){let i=L.polyline(this._layer.getLatLngs());t&&(e||(e=this._hintMarker.getLatLng()),i.addLatLng(e));let n=ri(i.toGeoJSON(15));this._doesSelfIntersect=n.features.length>0,this._doesSelfIntersect?this.isRed||(this.isRed=!0,this._hintline.setStyle({color:"#f00000ff"}),this._fireIntersect(n,this._map,"Draw")):this._hintline.isEmpty()||(this.isRed=!1,this._hintline.setStyle(this.options.hintlineStyle))},_createVertex(t){if(!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!0,t.latlng),this._doesSelfIntersect))return;this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng(),i=this._layer.getLatLngs(),n=i[i.length-1];if(e.equals(i[0])||i.length>0&&e.equals(n))return void this._finishShape();this._layer._latlngInfo=this._layer._latlngInfo||[],this._layer._latlngInfo.push({latlng:e,snapInfo:this._hintMarker._snapInfo}),this._layer.addLatLng(e);let o=this._createMarker(e);this._setTooltipText(),this._setHintLineAfterNewVertex(e),this._fireVertexAdded(o,void 0,e,"Draw"),this._change(this._layer.getLatLngs()),"snap"===this.options.finishOn&&this._hintMarker._snapped&&this._finishShape(t)},_setHintLineAfterNewVertex(t){this._hintline.setLatLngs([t,t])},_removeLastVertex(){let t=this._markers;if(t.length<=1)return void this.disable();let e=this._layer.getLatLngs(),i=t[t.length-1],{indexPath:n}=L.PM.Utils.findDeepMarkerIndex(t,i);t.pop(),this._layerGroup.removeLayer(i);let o=t[t.length-1],r=e.indexOf(o.getLatLng());e=e.slice(0,r+1),this._layer.setLatLngs(e),this._layer._latlngInfo.pop(),this._syncHintLine(),this._setTooltipText(),this._fireVertexRemoved(i,n,"Draw"),this._change(this._layer.getLatLngs())},_finishShape(){if(!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!1),this._doesSelfIntersect)||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;let t=this._layer.getLatLngs();if(t.length<=1)return;let e=L.polyline(t,this.options.pathOptions);this._setPane(e,"layerPane"),this._finishLayer(e),e.addTo(this._map.pm._getContainingLayer()),this._fireCreate(e),this.options.snappable&&this._cleanupSnapping(),this.disable(),this.options.continueDrawing&&this.enable()},_createMarker(t){let e=new L.Marker(t,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(e,"vertexPane"),e._pmTempLayer=!0,this._layerGroup.addLayer(e),this._markers.push(e),e.on("click",this._finishShape,this),e},_setTooltipText(){let{length:t}=this._layer.getLatLngs().flat(),e="";e=Ie(t<=1?"tooltips.continueLine":"tooltips.finishLine"),this._hintMarker.setTooltipContent(e)},_change(t){this._fireChange(t,"Draw")},setStyle(){this._layer?.setStyle(this.options.templineStyle),this._hintline?.setStyle(this.options.hintlineStyle)}}),Ke.Polygon=Ke.Line.extend({initialize(t){this._map=t,this._shape="Polygon",this.toolbarButtonName="drawPolygon"},enable(t){L.PM.Draw.Line.prototype.enable.call(this,t),this._layer.pm._shape="Polygon"},_createMarker(t){let e=new L.Marker(t,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(e,"vertexPane"),e._pmTempLayer=!0,this._layerGroup.addLayer(e),this._markers.push(e),1===this._layer.getLatLngs().flat().length?(e.on("click",this._finishShape,this),this._tempSnapLayerIndex=this._otherSnapLayers.push(e)-1,this.options.snappable&&this._cleanupSnapping()):e.on("click",(()=>1)),e},_setTooltipText(){let{length:t}=this._layer.getLatLngs().flat(),e="";e=Ie(t<=2?"tooltips.continueLine":"tooltips.finishPoly"),this._hintMarker.setTooltipContent(e)},_finishShape(){if(!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!0,this._layer.getLatLngs()[0]),this._doesSelfIntersect)||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;let t=this._layer.getLatLngs();if(t.length<=2)return;let e=L.polygon(t,this.options.pathOptions);this._setPane(e,"layerPane"),this._finishLayer(e),e.addTo(this._map.pm._getContainingLayer()),this._fireCreate(e),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex,this.disable(),this.options.continueDrawing&&this.enable()}}),Ke.Rectangle=Ke.extend({initialize(t){this._map=t,this._shape="Rectangle",this.toolbarButtonName="drawRectangle"},enable(t){if(L.Util.setOptions(this,t),this._enabled=!0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.rectangle([[0,0],[0,0]],this.options.pathOptions),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._startMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon rect-start-marker"}),draggable:!1,zIndexOffset:-100,opacity:this.options.cursorMarker?1:0}),this._setPane(this._startMarker,"vertexPane"),this._startMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._startMarker),this._hintMarker=L.marker(this._map.getCenter(),{zIndexOffset:150,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Ie("tooltips.firstVertex"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this.options.cursorMarker){this._styleMarkers=[];for(let t=0;t<2;t+=1){let t=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon rect-style-marker"}),draggable:!1,zIndexOffset:100});this._setPane(t,"vertexPane"),t._pmTempLayer=!0,this._layerGroup.addLayer(t),this._styleMarkers.push(t)}}this._map.getContainer().classList.add("geoman-draw-cursor"),this._map.on("click",this._placeStartingMarkers,this),this._map.on("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[],this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("click",this._finishShape,this),this._map.off("click",this._placeStartingMarkers,this),this._map.off("mousemove",this._syncHintMarker,this),this._map.removeLayer(this._layerGroup),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(t){this.enabled()?this.disable():this.enable(t)},_placeStartingMarkers(t){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng();L.DomUtil.addClass(this._startMarker._icon,"visible"),this._startMarker.setLatLng(e),this.options.cursorMarker&&this._styleMarkers&&this._styleMarkers.forEach((t=>{L.DomUtil.addClass(t._icon,"visible"),t.setLatLng(e)})),this._map.off("click",this._placeStartingMarkers,this),this._map.on("click",this._finishShape,this),this._hintMarker.setTooltipContent(Ie("tooltips.finishRect")),this._setRectangleOrigin()},_setRectangleOrigin(){let t=this._startMarker.getLatLng();t&&(this._layerGroup.addLayer(this._layer),this._layer.setLatLngs([t,t]),this._hintMarker.on("move",this._syncRectangleSize,this))},_syncHintMarker(t){if(this._hintMarker.setLatLng(t.latlng),this.options.snappable){let e=t;e.target=this._hintMarker,this._handleSnapping(e)}let e=this._layerGroup&&this._layerGroup.hasLayer(this._layer)?this._layer.getLatLngs():[this._hintMarker.getLatLng()];this._fireChange(e,"Draw")},_syncRectangleSize(){let t=Ge(this._startMarker.getLatLng(),this._map),e=Ge(this._hintMarker.getLatLng(),this._map),i=L.PM.Utils._getRotatedRectangle(t,e,this.options.rectangleAngle||0,this._map);if(this._layer.setLatLngs(i),this.options.cursorMarker&&this._styleMarkers){let n=[];i.forEach((i=>{!i.equals(t,1e-8)&&!i.equals(e,1e-8)&&n.push(i)})),n.forEach(((t,e)=>{try{this._styleMarkers[e].setLatLng(t)}catch{}}))}},_findCorners(){let t=this._layer.getLatLngs()[0];return L.PM.Utils._getRotatedRectangle(t[0],t[2],this.options.rectangleAngle||0,this._map)},_finishShape(t){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng(),i=this._startMarker.getLatLng();if(this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;let n=L.rectangle([i,e],this.options.pathOptions);if(this.options.rectangleAngle){let t=L.PM.Utils._getRotatedRectangle(i,e,this.options.rectangleAngle||0,this._map);n.setLatLngs(t),n.pm&&n.pm._setAngle(this.options.rectangleAngle||0)}this._setPane(n,"layerPane"),this._finishLayer(n),n.addTo(this._map.pm._getContainingLayer()),this._fireCreate(n),this.disable(),this.options.continueDrawing&&this.enable()},setStyle(){this._layer?.setStyle(this.options.pathOptions)}}),Ke.CircleMarker=Ke.extend({initialize(t){this._map=t,this._shape="CircleMarker",this.toolbarButtonName="drawCircleMarker",this._layerIsDragging=!1,this._BaseCircleClass=L.CircleMarker,this._minRadiusOption="minRadiusCircleMarker",this._maxRadiusOption="maxRadiusCircleMarker",this._editableOption="resizeableCircleMarker",this._defaultRadius=10},enable(t){if(L.Util.setOptions(this,t),this.options.editable&&(this.options.resizeableCircleMarker=this.options.editable,delete this.options.editable),this._enabled=!0,this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._map.getContainer().classList.add("geoman-draw-cursor"),this.options[this._editableOption]){let t={};L.extend(t,this.options.templineStyle),t.radius=0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=new this._BaseCircleClass(this._map.getCenter(),t),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._centerMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon"}),draggable:!1,zIndexOffset:100}),this._setPane(this._centerMarker,"vertexPane"),this._centerMarker._pmTempLayer=!0,this._hintMarker=L.marker(this._map.getCenter(),{zIndexOffset:110,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Ie("tooltips.startCircle"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._hintline=L.polyline([],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._layerGroup.addLayer(this._hintline),this._map.on("click",this._placeCenterMarker,this)}else this._map.on("click",this._createMarker,this),this._hintMarker=new this._BaseCircleClass(this._map.getCenter(),{radius:this._defaultRadius,...this.options.templineStyle}),this._setPane(this._hintMarker,"layerPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this._layer=this._hintMarker,this.options.tooltips&&this._hintMarker.bindTooltip(Ie("tooltips.placeCircleMarker"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip();this._map.on("mousemove",this._syncHintMarker,this),this._extendingEnable(),this._otherSnapLayers=[],this._fireDrawStart(),this._setGlobalDrawMode()},_extendingEnable(){!this.options[this._editableOption]&&this.options.markerEditable&&this._map.eachLayer((t=>{this.isRelevantMarker(t)&&t.pm.enable()})),this._layer.bringToBack()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this.options[this._editableOption]?(this._map.off("click",this._finishShape,this),this._map.off("click",this._placeCenterMarker,this),this._map.removeLayer(this._layerGroup)):(this._map.off("click",this._createMarker,this),this._extendingDisable(),this._hintMarker.remove()),this._map.off("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},_extendingDisable(){this._map.eachLayer((t=>{this.isRelevantMarker(t)&&t.pm.disable()}))},enabled(){return this._enabled},toggle(t){this.enabled()?this.disable():this.enable(t)},_placeCenterMarker(t){this._layerGroup.addLayer(this._layer),this._layerGroup.addLayer(this._centerMarker),this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng();this._layerGroup.addLayer(this._layer),this._centerMarker.setLatLng(e),this._map.off("click",this._placeCenterMarker,this),this._map.on("click",this._finishShape,this),this._placeCircleCenter()},_placeCircleCenter(){let t=this._centerMarker.getLatLng();t&&(this._layer.setLatLng(t),this._hintMarker.on("move",this._syncHintLine,this),this._hintMarker.on("move",this._syncCircleRadius,this),this._hintMarker.setTooltipContent(Ie("tooltips.finishCircle")),this._fireCenterPlaced(),this._fireChange(this._layer.getLatLng(),"Draw"))},_syncHintLine(){let t=this._centerMarker.getLatLng(),e=this._getNewDestinationOfHintMarker();this._hintline.setLatLngs([t,e])},_syncCircleRadius(){let t=this._centerMarker.getLatLng(),e=this._hintMarker.getLatLng(),i=this._distanceCalculation(t,e);this.options[this._minRadiusOption]&&i<this.options[this._minRadiusOption]?this._layer.setRadius(this.options[this._minRadiusOption]):this.options[this._maxRadiusOption]&&i>this.options[this._maxRadiusOption]?this._layer.setRadius(this.options[this._maxRadiusOption]):this._layer.setRadius(i)},_syncHintMarker(t){if(this._hintMarker.setLatLng(t.latlng),this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker()),this.options.snappable){let e=t;e.target=this._hintMarker,this._handleSnapping(e)}this._handleHintMarkerSnapping();let e=this._layerGroup&&this._layerGroup.hasLayer(this._centerMarker)?this._centerMarker.getLatLng():this._hintMarker.getLatLng();this._fireChange(e,"Draw")},isRelevantMarker(t){return t instanceof L.CircleMarker&&!(t instanceof L.Circle)&&t.pm&&!t._pmTempLayer},_createMarker(t){if(this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer()||!t.latlng||this._layerIsDragging)return;this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng(),i=new this._BaseCircleClass(e,{radius:this._defaultRadius,...this.options.pathOptions});this._setPane(i,"layerPane"),this._finishLayer(i),i.addTo(this._map.pm._getContainingLayer()),this._extendingCreateMarker(i),this._fireCreate(i),this._cleanupSnapping(),this.options.continueDrawing||this.disable()},_extendingCreateMarker(t){t.pm&&this.options.markerEditable&&t.pm.enable()},_finishShape(t){if(this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._centerMarker.getLatLng(),i=this._defaultRadius;if(this.options[this._editableOption]){let t=this._hintMarker.getLatLng();i=this._distanceCalculation(e,t),this.options[this._minRadiusOption]&&i<this.options[this._minRadiusOption]?i=this.options[this._minRadiusOption]:this.options[this._maxRadiusOption]&&i>this.options[this._maxRadiusOption]&&(i=this.options[this._maxRadiusOption])}let n={...this.options.pathOptions,radius:i},o=new this._BaseCircleClass(e,n);this._setPane(o,"layerPane"),this._finishLayer(o),o.addTo(this._map.pm._getContainingLayer()),o.pm&&o.pm._updateHiddenPolyCircle(),this._fireCreate(o),this.disable(),this.options.continueDrawing&&this.enable()},_getNewDestinationOfHintMarker(){let t=this._hintMarker.getLatLng();if(this.options[this._editableOption]){if(!this._layerGroup.hasLayer(this._centerMarker))return t;let e=this._centerMarker.getLatLng(),i=this._distanceCalculation(e,t);this.options[this._minRadiusOption]&&i<this.options[this._minRadiusOption]?t=Ne(this._map,e,t,this._getMinDistanceInMeter()):this.options[this._maxRadiusOption]&&i>this.options[this._maxRadiusOption]&&(t=Ne(this._map,e,t,this._getMaxDistanceInMeter()))}return t},_getMinDistanceInMeter(){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._minRadiusOption],this._map,this._centerMarker.getLatLng())},_getMaxDistanceInMeter(){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._maxRadiusOption],this._map,this._centerMarker.getLatLng())},_handleHintMarkerSnapping(){if(this.options[this._editableOption]){if(this._hintMarker._snapped){let t=this._centerMarker.getLatLng(),e=this._hintMarker.getLatLng(),i=this._distanceCalculation(t,e);this._layerGroup.hasLayer(this._centerMarker)&&(this.options[this._minRadiusOption]&&i<this.options[this._minRadiusOption]||this.options[this._maxRadiusOption]&&i>this.options[this._maxRadiusOption])&&this._hintMarker.setLatLng(this._hintMarker._orgLatLng)}this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker())}},setStyle(){let t={};L.extend(t,this.options.templineStyle),this.options[this._editableOption]&&(t.radius=0),this._layer?.setStyle(t),this._hintline?.setStyle(this.options.hintlineStyle)},_distanceCalculation(t,e){return this._map.project(t).distanceTo(this._map.project(e))}}),Ke.Circle=Ke.CircleMarker.extend({initialize(t){this._map=t,this._shape="Circle",this.toolbarButtonName="drawCircle",this._BaseCircleClass=L.Circle,this._minRadiusOption="minRadiusCircle",this._maxRadiusOption="maxRadiusCircle",this._editableOption="resizableCircle",this._defaultRadius=100},_extendingEnable(){},_extendingDisable(){},_extendingCreateMarker(){},isRelevantMarker(){},_getMinDistanceInMeter(){return this.options[this._minRadiusOption]},_getMaxDistanceInMeter(){return this.options[this._maxRadiusOption]},_distanceCalculation(t,e){return this._map.distance(t,e)}});var mi=function(t){if(!t)throw new Error("geojson is required");var e=[];return di(t,(function(t){!function(t,e){var i=[],n=t.geometry;if(null!==n){switch(n.type){case"Polygon":i=li(n);break;case"LineString":i=[li(n)]}i.forEach((function(i){var n=function(t,e){var i=[];return t.reduce((function(t,n){var o=ti([t,n],e);return o.bbox=function(t,e){var i=t[0],n=t[1],o=e[0],r=e[1],s=i<o?i:o,a=n<r?n:r,l=i>o?i:o,h=n>r?n:r;return[s,a,l,h]}(t,n),i.push(o),n})),i}(i,t.properties);n.forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),ei(e)},fi=u(xe(),1);function gi(t,e){var i=li(t),n=li(e);if(2!==i.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==n.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=i[0][0],r=i[0][1],s=i[1][0],a=i[1][1],l=n[0][0],h=n[0][1],c=n[1][0],p=n[1][1],u=(p-h)*(s-o)-(c-l)*(a-r);if(0===u)return null;var d=((c-l)*(r-h)-(p-h)*(o-l))/u,m=((s-o)*(r-h)-(a-r)*(o-l))/u;return d>=0&&d<=1&&m>=0&&m<=1?Qe([o+d*(s-o),r+d*(a-r)]):null}var _i=function(t,e){var i={},n=[];if("LineString"===t.type&&(t=Xe(t)),"LineString"===e.type&&(e=Xe(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var o=gi(t,e);return o&&n.push(o),ei(n)}var r=(0,fi.default)();return r.load(mi(e)),ui(mi(t),(function(t){ui(r.search(t),(function(e){var o=gi(t,e);if(o){var r=li(o).join(",");i[r]||(i[r]=!0,n.push(o))}}))})),ei(n)},vi=u(xe(),1);var yi=function(t,e,i){void 0===i&&(i={});var n=ai(t),o=ai(e),r=ni(o[1]-n[1]),s=ni(o[0]-n[0]),a=ni(n[1]),l=ni(o[1]),h=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return function(t,e){void 0===e&&(e="kilometers");var i=Je[e];if(!i)throw new Error(e+" units is invalid");return t*i}(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)),i.units)};var bi=function(t){var e=t[0],i=t[1],n=t[2],o=t[3];if(yi(t.slice(0,2),[n,i])>=yi(t.slice(0,2),[e,o])){var r=(i+o)/2;return[e,r-(n-e)/2,n,r+(n-e)/2]}var s=(e+n)/2;return[s-(o-i)/2,i,s+(o-i)/2,o]};function xi(t){var e=[1/0,1/0,-1/0,-1/0];return pi(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}xi.default=xi;var ki=xi;var Li=function(t,e){void 0===e&&(e={});var i=e.precision,n=e.coordinates,o=e.mutate;if(i=null==i||isNaN(i)?6:i,n=null==n||isNaN(n)?3:n,!t)throw new Error("<geojson> is required");if("number"!=typeof i)throw new Error("<precision> must be a number");if("number"!=typeof n)throw new Error("<coordinates> must be a number");(!1===o||void 0===o)&&(t=JSON.parse(JSON.stringify(t)));var r=Math.pow(10,i);return pi(t,(function(t){!function(t,e,i){t.length>i&&t.splice(i,t.length);for(var n=0;n<t.length;n++)t[n]=Math.round(t[n]*e)/e}(t,r,n)})),t};function wi(t,e,i){if(void 0===i&&(i={}),!0===i.final)return function(t,e){var i=wi(e,t);return i=(i+180)%360,i}(t,e);var n=ai(t),o=ai(e),r=ni(n[0]),s=ni(o[0]),a=ni(n[1]),l=ni(o[1]),h=Math.sin(s-r)*Math.cos(l),c=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(s-r);return ii(Math.atan2(h,c))}function Mi(t,e,i,n){void 0===n&&(n={});var o=ai(t),r=ni(o[0]),s=ni(o[1]),a=ni(i),l=function(t,e){void 0===e&&(e="kilometers");var i=Je[e];if(!i)throw new Error(e+" units is invalid");return t/i}(e,n.units),h=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(a));return Qe([ii(r+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(h))),ii(h)],n.properties)}var Ci=function(t,e,i){void 0===i&&(i={});var n=Qe([1/0,1/0],{dist:1/0}),o=0;return di(t,(function(t){for(var r=li(t),s=0;s<r.length-1;s++){var a=Qe(r[s]);a.properties.dist=yi(e,a,i);var l=Qe(r[s+1]);l.properties.dist=yi(e,l,i);var h=yi(a,l,i),c=Math.max(a.properties.dist,l.properties.dist),p=wi(a,l),u=Mi(e,c,p+90,i),d=Mi(e,c,p-90,i),m=_i(ti([u.geometry.coordinates,d.geometry.coordinates]),ti([a.geometry.coordinates,l.geometry.coordinates])),f=null;m.features.length>0&&((f=m.features[0]).properties.dist=yi(e,f,i),f.properties.location=o+yi(a,f,i)),a.properties.dist<n.properties.dist&&((n=a).properties.index=s,n.properties.location=o),l.properties.dist<n.properties.dist&&((n=l).properties.index=s+1,n.properties.location=o+h),f&&f.properties.dist<n.properties.dist&&((n=f).properties.index=s),o+=h}})),n};function Pi(t,e){var i=[],n=(0,vi.default)();return di(e,(function(e){if(i.forEach((function(t,e){t.id=e})),i.length){var o=n.search(e);if(o.features.length){var r=Ti(e,o);i=i.filter((function(t){return t.id!==r.id})),n.remove(r),ui(Si(r,e),(function(t){i.push(t),n.insert(t)}))}}else(i=Si(t,e).features).forEach((function(t){t.bbox||(t.bbox=bi(ki(t)))})),n.load(ei(i))})),ei(i)}function Si(t,e){var i=[],n=li(t)[0],o=li(t)[t.geometry.coordinates.length-1];if(Ai(n,ai(e))||Ai(o,ai(e)))return ei([t]);var r=(0,vi.default)(),s=mi(t);r.load(s);var a=r.search(e);if(!a.features.length)return ei([t]);var l=Ti(e,a),h=function(t,e,i){var n=i;return ui(t,(function(t,o){n=0===o&&void 0===i?t:e(n,t,o)})),n}(s,(function(t,n,o){var r=li(n)[1],s=ai(e);return o===l.id?(t.push(s),i.push(ti(t)),Ai(s,r)?[s]:[s,r]):(t.push(r),t)}),[n]);return h.length>1&&i.push(ti(h)),ei(i)}function Ti(t,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var i,n=1/0;return ui(e,(function(e){var o=Ci(e,t).properties.dist;o<n&&(i=e,n=o)})),i}function Ai(t,e){return t[0]===e[0]&&t[1]===e[1]}var Di=function(t,e){if(!t)throw new Error("line is required");if(!e)throw new Error("splitter is required");var i=ci(t),n=ci(e);if("LineString"!==i)throw new Error("line must be LineString");if("FeatureCollection"===n)throw new Error("splitter cannot be a FeatureCollection");if("GeometryCollection"===n)throw new Error("splitter cannot be a GeometryCollection");var o=Li(e,{precision:7});switch(n){case"Point":return Si(t,o);case"MultiPoint":return Pi(t,o);case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return Pi(t,_i(t,o))}};function Ei(t,e,i){if(void 0===i&&(i={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var n=ai(t),o=hi(e),r=o.type,s=e.bbox,a=o.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(n,s))return!1;"Polygon"===r&&(a=[a]);for(var l=!1,h=0;h<a.length&&!l;h++)if(Oi(n,a[h][0],i.ignoreBoundary)){for(var c=!1,p=1;p<a[h].length&&!c;)Oi(n,a[h][p],!i.ignoreBoundary)&&(c=!0),p++;c||(l=!0)}return l}function Oi(t,e,i){var n=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var o=0,r=e.length-1;o<e.length;r=o++){var s=e[o][0],a=e[o][1],l=e[r][0],h=e[r][1];if(t[1]*(s-l)+a*(l-t[0])+h*(t[0]-s)==0&&(s-t[0])*(l-t[0])<=0&&(a-t[1])*(h-t[1])<=0)return!i;a>t[1]!=h>t[1]&&t[0]<(l-s)*(t[1]-a)/(h-a)+s&&(n=!n)}return n}function Ii(t,e,i,n,o){var r=i[0],s=i[1],a=t[0],l=t[1],h=e[0],c=e[1],p=h-a,u=c-l,d=(i[0]-a)*u-(i[1]-l)*p;if(null!==o){if(Math.abs(d)>o)return!1}else if(0!==d)return!1;return n?"start"===n?Math.abs(p)>=Math.abs(u)?p>0?a<r&&r<=h:h<=r&&r<a:u>0?l<s&&s<=c:c<=s&&s<l:"end"===n?Math.abs(p)>=Math.abs(u)?p>0?a<=r&&r<h:h<r&&r<=a:u>0?l<=s&&s<c:c<s&&s<=l:"both"===n&&(Math.abs(p)>=Math.abs(u)?p>0?a<r&&r<h:h<r&&r<a:u>0?l<s&&s<c:c<s&&s<l):Math.abs(p)>=Math.abs(u)?p>0?a<=r&&r<=h:h<=r&&r<=a:u>0?l<=s&&s<=c:c<=s&&s<=l}var Bi=function(t,e,i){void 0===i&&(i={});for(var n=ai(t),o=li(e),r=0;r<o.length-1;r++){var s=!1;if(i.ignoreEndVertices&&(0===r&&(s="start"),r===o.length-2&&(s="end"),0===r&&r+1===o.length-1&&(s="both")),Ii(o[r],o[r+1],n,s,typeof i.epsilon>"u"?null:i.epsilon))return!0}return!1};function Ri(t,e){var i=hi(t),n=hi(e),o=i.type,r=n.type,s=i.coordinates,a=n.coordinates;switch(o){case"Point":if("Point"===r)return Fi(s,a);throw new Error("feature2 "+r+" geometry not supported");case"MultiPoint":switch(r){case"Point":return function(t,e){var i,n=!1;for(i=0;i<t.coordinates.length;i++)if(Fi(t.coordinates[i],e.coordinates)){n=!0;break}return n}(i,n);case"MultiPoint":return function(t,e){for(var i=0,n=e.coordinates;i<n.length;i++){for(var o=n[i],r=!1,s=0,a=t.coordinates;s<a.length;s++){if(Fi(o,a[s])){r=!0;break}}if(!r)return!1}return!0}(i,n);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"Point":return Bi(n,i,{ignoreEndVertices:!0});case"LineString":return function(t,e){for(var i=!1,n=0,o=e.coordinates;n<o.length;n++){var r=o[n];if(Bi({type:"Point",coordinates:r},t,{ignoreEndVertices:!0})&&(i=!0),!Bi({type:"Point",coordinates:r},t,{ignoreEndVertices:!1}))return!1}return i}(i,n);case"MultiPoint":return function(t,e){for(var i=!1,n=0,o=e.coordinates;n<o.length;n++){var r=o[n];if(Bi(r,t,{ignoreEndVertices:!0})&&(i=!0),!Bi(r,t))return!1}return!!i}(i,n);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Point":return Ei(n,i,{ignoreBoundary:!0});case"LineString":return function(t,e){var i=!1,n=0,o=ki(t),r=ki(e);if(!zi(o,r))return!1;for(;n<e.coordinates.length-1;n++){if(Ei({type:"Point",coordinates:ji(e.coordinates[n],e.coordinates[n+1])},t,{ignoreBoundary:!0})){i=!0;break}}return i}(i,n);case"Polygon":return function(t,e){if("Feature"===t.type&&null===t.geometry||"Feature"===e.type&&null===e.geometry)return!1;var i=ki(t),n=ki(e);if(!zi(i,n))return!1;for(var o=hi(e).coordinates,r=0,s=o;r<s.length;r++)for(var a=s[r],l=0,h=a;l<h.length;l++){if(!Ei(h[l],t))return!1}return!0}(i,n);case"MultiPoint":return function(t,e){for(var i=0,n=e.coordinates;i<n.length;i++){if(!Ei(n[i],t,{ignoreBoundary:!0}))return!1}return!0}(i,n);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function zi(t,e){return!(t[0]>e[0]||t[2]<e[2]||t[1]>e[1]||t[3]<e[3])}function Fi(t,e){return t[0]===e[0]&&t[1]===e[1]}function ji(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}var Ni=u(de()),Ui=u(ke());function Gi(t){let e={type:"Feature"};return e.geometry=t,e}function Hi(t){return"Feature"===t.type?t.geometry:t}function Zi(t){return t&&t.geometry&&t.geometry.coordinates?t.geometry.coordinates:t}function Vi(t){return Gi({type:"Polygon",coordinates:t})}function Wi(t){return Gi({type:"MultiPolygon",coordinates:t})}function qi(t){return Array.isArray(t)?1+qi(t[0]):-1}function $i(t){t instanceof L.Polyline&&(t=t.toGeoJSON(15));let e=Zi(t),i=qi(e),n=[];return i>1?e.forEach((t=>{n.push(function(t){return Gi({type:"LineString",coordinates:t})}(t))})):n.push(t),n}function Ki(t){let e=[];return t.eachLayer((t=>{e.push(Zi(t.toGeoJSON(15)))})),function(t){return Gi({type:"MultiLineString",coordinates:t})}(e)}Ke.Cut=Ke.Polygon.extend({initialize(t){this._map=t,this._shape="Cut",this.toolbarButtonName="cutPolygon"},_finishShape(){if(this._editedLayers=[],!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!0,this._layer.getLatLngs()[0]),this._doesSelfIntersect)||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;let t=this._layer.getLatLngs();if(t.length<=2)return;let e=L.polygon(t,this.options.pathOptions);e._latlngInfos=this._layer._latlngInfo,this.cut(e),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex,this._editedLayers.forEach((({layer:t,originalLayer:e})=>{this._fireCut(e,t,e),this._fireCut(this._map,t,e),e.pm._fireEdit()})),this._editedLayers=[],this.disable(),this.options.continueDrawing&&this.enable()},cut(t){let e=this._map._layers,i=t._latlngInfos||[];Object.keys(e).map((t=>e[t])).filter((t=>t.pm)).filter((t=>!t._pmTempLayer)).filter((t=>!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&!1===t.options.pmIgnore)).filter((t=>t instanceof L.Polyline)).filter((e=>e!==t)).filter((t=>t.pm.options.allowCutting)).filter((t=>!(this.options.layersToCut&&L.Util.isArray(this.options.layersToCut)&&this.options.layersToCut.length>0)||this.options.layersToCut.indexOf(t)>-1)).filter((t=>!this._layerGroup.hasLayer(t))).filter((e=>{try{let i=!!_i(t.toGeoJSON(15),e.toGeoJSON(15)).features.length>0;return i||e instanceof L.Polyline&&!(e instanceof L.Polygon)?i:!!function(t,e){let i=Hi(t),n=Hi(e),o=Ui.default.intersection(i.coordinates,n.coordinates);return 0===o.length?null:1===o.length?Vi(o[0]):Wi(o)}(t.toGeoJSON(15),e.toGeoJSON(15))}catch{return e instanceof L.Polygon&&console.error("You can't cut polygons with self-intersections"),!1}})).forEach((e=>{let n;if(e instanceof L.Polygon){n=L.polygon(e.getLatLngs());let t=n.getLatLngs();i.forEach((e=>{if(e&&e.snapInfo){let{latlng:i}=e,o=this._calcClosestLayer(i,[n]);if(o&&o.segment&&o.distance<this.options.snapDistance){let{segment:e}=o;if(e&&2===e.length){let{indexPath:n,parentPath:o,newIndex:r}=L.PM.Utils._getIndexFromSegment(t,e);(n.length>1?(0,Ni.default)(t,o):t).splice(r,0,i)}}}}))}else n=e;let o=this._cutLayer(t,n),r=L.geoJSON(o,e.options);1===r.getLayers().length&&([r]=r.getLayers()),this._setPane(r,"layerPane");let s=r.addTo(this._map.pm._getContainingLayer());if(s.pm.enable(e.pm.options),s.pm.disable(),e._pmTempLayer=!0,t._pmTempLayer=!0,e.remove(),e.removeFrom(this._map.pm._getContainingLayer()),t.remove(),t.removeFrom(this._map.pm._getContainingLayer()),s.getLayers&&0===s.getLayers().length&&this._map.pm.removeLayer({target:s}),s instanceof L.LayerGroup?(s.eachLayer((t=>{this._addDrawnLayerProp(t)})),this._addDrawnLayerProp(s)):this._addDrawnLayerProp(s),this.options.layersToCut&&L.Util.isArray(this.options.layersToCut)&&this.options.layersToCut.length>0){let t=this.options.layersToCut.indexOf(e);t>-1&&this.options.layersToCut.splice(t,1)}this._editedLayers.push({layer:s,originalLayer:e})}))},_cutLayer(t,e){let i,n=L.geoJSON();if(e instanceof L.Polygon)i=function(t,e){let i=Hi(t),n=Hi(e),o=Ui.default.difference(i.coordinates,n.coordinates);return 0===o.length?null:1===o.length?Vi(o[0]):Wi(o)}(e.toGeoJSON(15),t.toGeoJSON(15));else{let o=$i(e);o.forEach((e=>{let i,o=Di(e,t.toGeoJSON(15));i=o&&o.features.length>0?L.geoJSON(o):L.geoJSON(e),i.getLayers().forEach((e=>{Ri(t.toGeoJSON(15),e.toGeoJSON(15))||e.addTo(n)}))})),i=o.length>1?Ki(n):n.toGeoJSON(15)}return i},_change:L.Util.falseFn}),Ke.Text=Ke.extend({initialize(t){this._map=t,this._shape="Text",this.toolbarButtonName="drawText"},enable(t){L.Util.setOptions(this,t),this._enabled=!0,this._map.on("click",this._createMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._hintMarker=L.marker(this._map.getCenter(),{interactive:!1,zIndexOffset:100,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Ie("tooltips.placeText"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._layer=this._hintMarker,this._map.on("mousemove",this._syncHintMarker,this),this._map.getContainer().classList.add("geoman-draw-cursor"),this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.off("click",this._createMarker,this),this._hintMarker?.remove(),this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(t){this.enabled()?this.disable():this.enable(t)},_syncHintMarker(t){if(this._hintMarker.setLatLng(t.latlng),this.options.snappable){let e=t;e.target=this._hintMarker,this._handleSnapping(e)}},_createMarker(t){if(!t.latlng||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng();if(this.textArea=this._createTextArea(),this.options.textOptions?.className){let t=this.options.textOptions.className.split(" ");this.textArea.classList.add(...t)}let i=this._createTextIcon(this.textArea),n=new L.Marker(e,{textMarker:!0,_textMarkerOverPM:!0,icon:i});if(this._setPane(n,"markerPane"),this._finishLayer(n),n.pm||(n.options.draggable=!1),n.addTo(this._map.pm._getContainingLayer()),n.pm){n.pm.textArea=this.textArea,L.setOptions(n.pm,{removeIfEmpty:this.options.textOptions?.removeIfEmpty??!0});let t=this.options.textOptions?.focusAfterDraw??!0;n.pm._createTextMarker(t),this.options.textOptions?.text&&n.pm.setText(this.options.textOptions.text)}this._fireCreate(n),this._cleanupSnapping(),this.disable(),this.options.continueDrawing&&this.enable()},_createTextArea(){let t=document.createElement("textarea");return t.readOnly=!0,t.classList.add("pm-textarea","pm-disabled"),t},_createTextIcon(t){return L.divIcon({className:"pm-text-marker",html:t})}});var Yi={enableLayerDrag(){if(!this.options.draggable||!this._layer._map)return;this.disable(),this._layerDragEnabled=!0,this._map||(this._map=this._layer._map),(this._layer instanceof L.Marker||this._layer instanceof L.ImageOverlay)&&L.DomEvent.on(this._getDOMElem(),"dragstart",this._stopDOMImageDrag),this._layer.dragging&&this._layer.dragging.disable(),this._tempDragCoord=null,He(this._layer)instanceof L.Canvas?(this._layer.on("mouseout",this.removeDraggingClass,this),this._layer.on("mouseover",this.addDraggingClass,this)):this.addDraggingClass(),this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!0;let t=this._getDOMElem();t&&(He(this._layer)instanceof L.Canvas?(this._layer.on("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._addTouchEvents(t)):L.DomEvent.on(t,"touchstart mousedown",this._simulateMouseDownEvent,this)),this._fireDragEnable()},disableLayerDrag(){this._layerDragEnabled=!1,He(this._layer)instanceof L.Canvas?(this._layer.off("mouseout",this.removeDraggingClass,this),this._layer.off("mouseover",this.addDraggingClass,this)):this.removeDraggingClass(),this._originalMapDragState&&this._dragging&&this._map.dragging.enable(),this._safeToCacheDragState=!1,this._layer.dragging&&this._layer.dragging.disable();let t=this._getDOMElem();t&&(He(this._layer)instanceof L.Canvas?(this._layer.off("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._removeTouchEvents(t)):L.DomEvent.off(t,"touchstart mousedown",this._simulateMouseDownEvent,this)),this._layerDragged&&this._fireUpdate(),this._layerDragged=!1,this._fireDragDisable()},dragging(){return this._dragging},layerDragEnabled(){return!!this._layerDragEnabled},_simulateMouseDownEvent(t){let e=t.touches?t.touches[0]:t,i={originalEvent:e,target:this._layer};return i.containerPoint=this._map.mouseEventToContainerPoint(e),i.latlng=this._map.containerPointToLatLng(i.containerPoint),this._dragMixinOnMouseDown(i),!1},_simulateMouseMoveEvent(t){let e=t.touches?t.touches[0]:t,i={originalEvent:e,target:this._layer};return i.containerPoint=this._map.mouseEventToContainerPoint(e),i.latlng=this._map.containerPointToLatLng(i.containerPoint),this._dragMixinOnMouseMove(i),!1},_simulateMouseUpEvent(t){let e={originalEvent:t.touches?t.touches[0]:t,target:this._layer};return-1===t.type.indexOf("touch")&&(e.containerPoint=this._map.mouseEventToContainerPoint(t),e.latlng=this._map.containerPointToLatLng(e.containerPoint)),this._dragMixinOnMouseUp(e),!1},_dragMixinOnMouseDown(t){if(t.originalEvent.button>0)return;this._overwriteEventIfItComesFromMarker(t);let e=t._fromLayerSync,i=this._syncLayers("_dragMixinOnMouseDown",t);if(this._layer instanceof L.Marker&&(!this.options.snappable||e||i?this._disableSnapping():this._initSnappableMarkers()),this._layer instanceof L.CircleMarker){let t="resizeableCircleMarker";this._layer instanceof L.Circle&&(t="resizableCircle"),!this.options.snappable||e||i?this._layer.pm.options[t]?this._layer.pm._disableSnapping():this._layer.pm._disableSnappingDrag():this._layer.pm.options[t]||this._initSnappableMarkersDrag()}this._safeToCacheDragState&&(this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!1),this._tempDragCoord=t.latlng,L.DomEvent.on(this._map.getContainer(),"touchend mouseup",this._simulateMouseUpEvent,this),L.DomEvent.on(this._map.getContainer(),"touchmove mousemove",this._simulateMouseMoveEvent,this)},_dragMixinOnMouseMove(t){this._overwriteEventIfItComesFromMarker(t);let e=this._getDOMElem();this._syncLayers("_dragMixinOnMouseMove",t),this._dragging||(this._dragging=!0,L.DomUtil.addClass(e,"leaflet-pm-dragging"),this._layer instanceof L.Marker||this._layer.bringToFront(),this._originalMapDragState&&this._map.dragging.disable(),this._fireDragStart()),this._tempDragCoord||(this._tempDragCoord=t.latlng),this._onLayerDrag(t),this._layer instanceof L.CircleMarker&&this._layer.pm._updateHiddenPolyCircle()},_dragMixinOnMouseUp(t){let e=this._getDOMElem();return this._syncLayers("_dragMixinOnMouseUp",t),this._originalMapDragState&&this._map.dragging.enable(),this._safeToCacheDragState=!0,L.DomEvent.off(this._map.getContainer(),"touchmove mousemove",this._simulateMouseMoveEvent,this),L.DomEvent.off(this._map.getContainer(),"touchend mouseup",this._simulateMouseUpEvent,this),!!this._dragging&&(this._layer instanceof L.CircleMarker&&this._layer.pm._updateHiddenPolyCircle(),this._layerDragged=!0,window.setTimeout((()=>{this._dragging=!1,e&&L.DomUtil.removeClass(e,"leaflet-pm-dragging"),this._fireDragEnd(),this._fireEdit(),this._layerEdited=!0}),10),!0)},_onLayerDrag(t){let{latlng:e}=t,i=e.lat-this._tempDragCoord.lat,n=e.lng-this._tempDragCoord.lng,o=t=>t.map((t=>{if(Array.isArray(t))return o(t);let e={lat:t.lat+i,lng:t.lng+n};return(t.alt||0===t.alt)&&(e.alt=t.alt),e}));if(this._layer instanceof L.Circle&&this._layer.options.resizableCircle||this._layer instanceof L.CircleMarker&&this._layer.options.resizeableCircleMarker){let t=o([this._layer.getLatLng()]);this._layer.setLatLng(t[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.CircleMarker||this._layer instanceof L.Marker){let t=this._layer.getLatLng();this._layer._snapped&&(t=this._layer._orgLatLng);let e=o([t]);this._layer.setLatLng(e[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.ImageOverlay){let t=o([this._layer.getBounds().getNorthWest(),this._layer.getBounds().getSouthEast()]);this._layer.setBounds(t),this._fireChange(this._layer.getBounds(),"Edit")}else{let t=o(this._layer.getLatLngs());this._layer.setLatLngs(t),this._fireChange(this._layer.getLatLngs(),"Edit")}this._tempDragCoord=e,t.layer=this._layer,this._fireDrag(t)},addDraggingClass(){let t=this._getDOMElem();t&&L.DomUtil.addClass(t,"leaflet-pm-draggable")},removeDraggingClass(){let t=this._getDOMElem();t&&L.DomUtil.removeClass(t,"leaflet-pm-draggable")},_getDOMElem(){let t=null;return this._layer._path?t=this._layer._path:this._layer._renderer&&this._layer._renderer._container?t=this._layer._renderer._container:this._layer._image?t=this._layer._image:this._layer._icon&&(t=this._layer._icon),t},_overwriteEventIfItComesFromMarker(t){t.target.getLatLng&&(!t.target._radius||t.target._radius<=10)&&(t.containerPoint=this._map.mouseEventToContainerPoint(t.originalEvent),t.latlng=this._map.containerPointToLatLng(t.containerPoint))},_syncLayers(t,e){if(this.enabled())return!1;if(!e._fromLayerSync&&this._layer===e.target&&this.options.syncLayersOnDrag){e._fromLayerSync=!0;let i=[];if(L.Util.isArray(this.options.syncLayersOnDrag))i=this.options.syncLayersOnDrag,this.options.syncLayersOnDrag.forEach((t=>{t instanceof L.LayerGroup&&(i=i.concat(t.pm.getLayers(!0)))}));else if(!0===this.options.syncLayersOnDrag&&this._parentLayerGroup)for(let t in this._parentLayerGroup){let e=this._parentLayerGroup[t];e.pm&&(i=e.pm.getLayers(!0))}return L.Util.isArray(i)&&i.length>0&&(i=i.filter((t=>!!t.pm)).filter((t=>!!t.pm.options.draggable)),i.forEach((i=>{i!==this._layer&&i.pm[t]&&(i._snapped=!1,i.pm[t](e))}))),i.length>0}return!1},_stopDOMImageDrag(t){return t.preventDefault(),!1}},Ji=u(de());function Xi(t,e,i){let n=i.getMaxZoom();if(n===1/0&&(n=i.getZoom()),L.Util.isArray(t)){let n=[];return t.forEach((t=>{n.push(Xi(t,e,i))})),n}return t instanceof L.LatLng?function(t,e,i,n){return i.unproject(e.transform(i.project(t,n)),n)}(t,e,i,n):null}function Qi(t,e){e instanceof L.Layer&&(e=e.getLatLng());let i=t.getMaxZoom();return i===1/0&&(i=t.getZoom()),t.project(e,i)}function tn(t,e){let i=t.getMaxZoom();return i===1/0&&(i=t.getZoom()),t.unproject(e,i)}var en={_onRotateStart(t){this._preventRenderingMarkers(!0),this._rotationOriginLatLng=this._getRotationCenter().clone(),this._rotationOriginPoint=Qi(this._map,this._rotationOriginLatLng),this._rotationStartPoint=Qi(this._map,t.target.getLatLng()),this._initialRotateLatLng=Ue(this._layer),this._startAngle=this.getAngle();let e=Ue(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._fireRotationStart(this._rotationLayer,e),this._fireRotationStart(this._map,e)},_onRotate(t){let e=Qi(this._map,t.target.getLatLng()),i=this._rotationStartPoint,n=this._rotationOriginPoint,o=Math.atan2(e.y-n.y,e.x-n.x)-Math.atan2(i.y-n.y,i.x-n.x);this._layer.setLatLngs(this._rotateLayer(o,this._initialRotateLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));let r=this;!function t(e,i=[],n=-1){if(n>-1&&i.push(n),L.Util.isArray(e[0]))e.forEach(((e,n)=>t(e,i.slice(),n)));else{let t=(0,Ji.default)(r._markers,i);e.forEach(((e,i)=>{t[i].setLatLng(e)}))}}(this._layer.getLatLngs());let s=Ue(this._rotationLayer);this._rotationLayer.setLatLngs(this._rotateLayer(o,this._rotationLayer.pm._rotateOrgLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));let a=180*o/Math.PI;a=a<0?a+360:a;let l=a+this._startAngle;this._setAngle(l),this._rotationLayer.pm._setAngle(l),this._fireRotation(this._rotationLayer,a,s),this._fireRotation(this._map,a,s),this._rotationLayer.pm._fireChange(this._rotationLayer.getLatLngs(),"Rotation")},_onRotateEnd(){let t=this._startAngle;delete this._rotationOriginLatLng,delete this._rotationOriginPoint,delete this._rotationStartPoint,delete this._initialRotateLatLng,delete this._startAngle;let e=Ue(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._rotationLayer.pm._rotateOrgLatLng=Ue(this._rotationLayer),this._fireRotationEnd(this._rotationLayer,t,e),this._fireRotationEnd(this._map,t,e),this._rotationLayer.pm._fireEdit(this._rotationLayer,"Rotation"),this._preventRenderingMarkers(!1),this._layerRotated=!0},_rotateLayer(t,e,i,n,o){let r=Qi(o,i);return this._matrix=n.clone().rotate(t,r).flip(),Xi(e,this._matrix,o)},_setAngle(t){t=t<0?t+360:t,this._angle=t%360},_getRotationCenter(){if(this._rotationCenter)return this._rotationCenter;let t=L.polygon(this._layer.getLatLngs(),{stroke:!1,fill:!1,pmIgnore:!0}).addTo(this._layer._map),e=t.getCenter();return t.removeFrom(this._layer._map),e},enableRotate(){if(!this.options.allowRotation)return void this.disableRotate();this.rotateEnabled()&&this.disableRotate(),this._layer instanceof L.Rectangle&&void 0===this._angle&&this.setInitAngle(je(this._layer._map,this._layer.getLatLngs()[0][0],this._layer.getLatLngs()[0][1])||0);this._rotatePoly=L.polygon(this._layer.getLatLngs(),{fill:!1,stroke:!1,pmIgnore:!1,snapIgnore:!0}),this._rotatePoly._pmTempLayer=!0,this._rotatePoly.addTo(this._layer._map),this._rotatePoly.pm._setAngle(this.getAngle()),this._rotatePoly.pm.setRotationCenter(this.getRotationCenter()),this._rotatePoly.pm.setOptions(this._layer._map.pm.getGlobalOptions()),this._rotatePoly.pm.setOptions({rotate:!0,snappable:!1,hideMiddleMarkers:!0}),this._rotatePoly.pm._rotationLayer=this._layer,this._rotatePoly.pm.enable(),this._rotateOrgLatLng=Ue(this._layer),this._rotateEnabled=!0,this._layer.on("remove",this.disableRotate,this),this._fireRotationEnable(this._layer),this._fireRotationEnable(this._layer._map)},disableRotate(){this.rotateEnabled()&&(this._rotatePoly.pm._layerRotated&&this._fireUpdate(),this._rotatePoly.pm._layerRotated=!1,this._rotatePoly.pm.disable(),this._rotatePoly.remove(),this._rotatePoly.pm.setOptions({rotate:!1}),this._rotatePoly=void 0,this._rotateOrgLatLng=void 0,this._layer.off("remove",this.disableRotate,this),this._rotateEnabled=!1,this._fireRotationDisable(this._layer),this._fireRotationDisable(this._layer._map))},rotateEnabled(){return!!this._rotateEnabled},rotateLayer(t){let e=this.getAngle(),i=this._layer.getLatLngs(),n=t*(Math.PI/180);this._layer.setLatLngs(this._rotateLayer(n,this._layer.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._layer._map)),this._rotateOrgLatLng=L.polygon(this._layer.getLatLngs()).getLatLngs(),this._setAngle(this.getAngle()+t),this.rotateEnabled()&&this._rotatePoly&&this._rotatePoly.pm.enabled()&&(this._rotatePoly.setLatLngs(this._rotateLayer(n,this._rotatePoly.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._rotatePoly._map)),this._rotatePoly.pm._initMarkers());let o=this.getAngle()-e;o=o<0?o+360:o,this._startAngle=e,this._fireRotation(this._layer,o,i,this._layer),this._fireRotation(this._map||this._layer._map,o,i,this._layer),delete this._startAngle,this._fireChange(this._layer.getLatLngs(),"Rotation")},rotateLayerToAngle(t){let e=t-this.getAngle();this.rotateLayer(e)},getAngle(){return this._angle||0},setInitAngle(t){this._setAngle(t)},getRotationCenter(){return this._getRotationCenter()},setRotationCenter(t){this._rotationCenter=t,this._rotatePoly&&this._rotatePoly.pm.setRotationCenter(t)}},nn=L.Class.extend({includes:[Yi,$e,en,Ae],options:{snappable:!0,snapDistance:20,allowSelfIntersection:!0,allowSelfIntersectionEdit:!1,preventMarkerRemoval:!1,removeLayerBelowMinVertexCount:!0,limitMarkersToCount:-1,hideMiddleMarkers:!1,snapSegment:!0,syncLayersOnDrag:!1,draggable:!0,allowEditing:!0,allowRemoval:!0,allowCutting:!0,allowRotation:!0,addVertexOn:"click",removeVertexOn:"contextmenu",removeVertexValidation:void 0,addVertexValidation:void 0,moveVertexValidation:void 0,resizeableCircleMarker:!1,resizableCircle:!0},setOptions(t){L.Util.setOptions(this,t)},getOptions(){return this.options},applyOptions(){},isPolygon(){return this._layer instanceof L.Polygon},getShape(){return this._shape},_setPane(t,e){"layerPane"===e?t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":"vertexPane"===e?t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":"markerPane"===e&&(t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.markerPane||"markerPane")},remove(){(this._map||this._layer._map).pm.removeLayer({target:this._layer})},_vertexValidation(t,e){let i=e.target,n={layer:this._layer,marker:i,event:e},o="";return"move"===t?o="moveVertexValidation":"add"===t?o="addVertexValidation":"remove"===t&&(o="removeVertexValidation"),this.options[o]&&"function"==typeof this.options[o]&&!this.options[o](n)?("move"===t&&(i._cancelDragEventChain=i.getLatLng()),!1):(i._cancelDragEventChain=null,!0)},_vertexValidationDrag(t){return!t._cancelDragEventChain||(t._latlng=t._cancelDragEventChain,t.update(),!1)},_vertexValidationDragEnd(t){return!t._cancelDragEventChain||(t._cancelDragEventChain=null,!1)}});nn.LayerGroup=L.Class.extend({initialize(t){this._layerGroup=t,this._layers=this.getLayers(),this._getMap(),this._layers.forEach((t=>this._initLayer(t)));this._layerGroup.on("layeradd",L.Util.throttle((t=>{if(t.layer._pmTempLayer)return;this._layers=this.getLayers();let e=this._layers.filter((t=>!t.pm._parentLayerGroup||!(this._layerGroup._leaflet_id in t.pm._parentLayerGroup)));e.forEach((t=>{this._initLayer(t)})),e.length>0&&this._getMap()&&this._getMap().pm.globalEditModeEnabled()&&this.enabled()&&this.enable(this.getOptions())}),100,this),this),this._layerGroup.on("layerremove",(t=>{this._removeLayerFromGroup(t.target)}),this);this._layerGroup.on("layerremove",L.Util.throttle((t=>{t.target._pmTempLayer||(this._layers=this.getLayers())}),100,this),this)},enable(t,e=[]){0===e.length&&(this._layers=this.getLayers()),this._options=t,this._layers.forEach((i=>{i instanceof L.LayerGroup?-1===e.indexOf(i._leaflet_id)&&(e.push(i._leaflet_id),i.pm.enable(t,e)):i.pm.enable(t)}))},disable(t=[]){0===t.length&&(this._layers=this.getLayers()),this._layers.forEach((e=>{e instanceof L.LayerGroup?-1===t.indexOf(e._leaflet_id)&&(t.push(e._leaflet_id),e.pm.disable(t)):e.pm.disable()}))},enabled(t=[]){return 0===t.length&&(this._layers=this.getLayers()),!!this._layers.find((e=>e instanceof L.LayerGroup?-1===t.indexOf(e._leaflet_id)&&(t.push(e._leaflet_id),e.pm.enabled(t)):e.pm.enabled()))},toggleEdit(t,e=[]){0===e.length&&(this._layers=this.getLayers()),this._options=t,this._layers.forEach((i=>{i instanceof L.LayerGroup?-1===e.indexOf(i._leaflet_id)&&(e.push(i._leaflet_id),i.pm.toggleEdit(t,e)):i.pm.toggleEdit(t)}))},_initLayer(t){let e=L.Util.stamp(this._layerGroup);t.pm._parentLayerGroup||(t.pm._parentLayerGroup={}),t.pm._parentLayerGroup[e]=this._layerGroup},_removeLayerFromGroup(t){if(t.pm&&t.pm._layerGroup){let e=L.Util.stamp(this._layerGroup);delete t.pm._layerGroup[e]}},dragging(){return this._layers=this.getLayers(),!!this._layers&&!!this._layers.find((t=>t.pm.dragging()))},getOptions(){return this.options},_getMap(){return this._map||this._layers.find((t=>!!t._map))?._map||null},getLayers(t=!1,e=!0,i=!0,n=[]){let o=[];return t?this._layerGroup.getLayers().forEach((t=>{o.push(t),t instanceof L.LayerGroup&&-1===n.indexOf(t._leaflet_id)&&(n.push(t._leaflet_id),o=o.concat(t.pm.getLayers(!0,!0,!0,n)))})):o=this._layerGroup.getLayers(),i&&(o=o.filter((t=>!(t instanceof L.LayerGroup)))),e&&(o=o.filter((t=>!!t.pm)),o=o.filter((t=>!t._pmTempLayer)),o=o.filter((t=>!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&!1===t.options.pmIgnore))),o},setOptions(t,e=[]){0===e.length&&(this._layers=this.getLayers()),this.options=t,this._layers.forEach((i=>{i.pm&&(i instanceof L.LayerGroup?-1===e.indexOf(i._leaflet_id)&&(e.push(i._leaflet_id),i.pm.setOptions(t,e)):i.pm.setOptions(t))}))}}),nn.Marker=nn.extend({_shape:"Marker",initialize(t){this._layer=t,this._enabled=!1,this._layer.on("dragend",this._onDragEnd,this)},enable(t={draggable:!0}){L.Util.setOptions(this,t),this.options.allowEditing&&this._layer._map?(this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._fireEnable()):this.disable()},disable(){this.enabled()&&(this.disableLayerDrag(),this._layer.off("remove",this.disable,this),this._layer.off("contextmenu",this._removeMarker,this),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1)},enabled(){return this._enabled},toggleEdit(t){this.enabled()?this.disable():this.enable(t)},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping(),this.options.draggable?this.enableLayerDrag():this.disableLayerDrag(),this.options.preventMarkerRemoval||this._layer.on("contextmenu",this._removeMarker,this)},_removeMarker(t){let e=t.target;e.remove(),this._fireRemove(e),this._fireRemove(this._map,e)},_onDragEnd(){this._fireEdit(),this._layerEdited=!0},_initSnappableMarkers(){let t=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=void 0===this.options.snapSegment||this.options.snapSegment,t.off("pm:drag",this._handleSnapping,this),t.on("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.on("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this),t.on("pm:dragstart",this._unsnap,this)},_disableSnapping(){let t=this._layer;t.off("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this)}});var on=u(de()),rn={filterMarkerGroup(){this.markerCache=[],this.createCache(),this._layer.on("pm:edit",this.createCache,this),this.applyLimitFilters({}),this.throttledApplyLimitFilters||(this.throttledApplyLimitFilters=L.Util.throttle(this.applyLimitFilters,100,this)),this._layer.on("pm:disable",this._removeMarkerLimitEvents,this),this.options.limitMarkersToCount>-1&&(this._layer.on("pm:vertexremoved",this._initMarkers,this),this._map.on("mousemove",this.throttledApplyLimitFilters,this))},_removeMarkerLimitEvents(){this._map.off("mousemove",this.throttledApplyLimitFilters,this),this._layer.off("pm:edit",this.createCache,this),this._layer.off("pm:disable",this._removeMarkerLimitEvents,this),this._layer.off("pm:vertexremoved",this._initMarkers,this)},createCache(){let t=[...this._markerGroup.getLayers(),...this.markerCache];this.markerCache=t.filter(((t,e,i)=>i.indexOf(t)===e))},renderLimits(t){this.markerCache.forEach((e=>{t.includes(e)?this._markerGroup.addLayer(e):this._markerGroup.removeLayer(e)}))},applyLimitFilters({latlng:t={lat:0,lng:0}}){if(this._preventRenderMarkers)return;let e=[...this._filterClosestMarkers(t)];this.renderLimits(e)},_filterClosestMarkers(t){let e=[...this.markerCache],i=this.options.limitMarkersToCount;return-1===i?e:(e.sort(((e,i)=>e._latlng.distanceTo(t)-i._latlng.distanceTo(t))),e.filter(((t,e)=>!(i>-1)||e<i)))},_preventRenderMarkers:!1,_preventRenderingMarkers(t){this._preventRenderMarkers=!!t}};nn.Line=nn.extend({includes:[rn],_shape:"Line",initialize(t){this._layer=t,this._enabled=!1},enable(t){if(L.Util.setOptions(this,t),this._map=this._layer._map,this._map){if(!this.options.allowEditing)return void this.disable();this.enabled()&&this.disable(),this._enabled=!0,this._initMarkers(),this.applyOptions(),this._layer.on("remove",this.disable,this),this.options.allowSelfIntersection||this._layer.on("pm:vertexremoved",this._handleSelfIntersectionOnVertexRemoval,this),this.options.allowSelfIntersection?this.cachedColor=void 0:("#f00000ff"!==this._layer.options.color?(this.cachedColor=this._layer.options.color,this.isRed=!1):this.isRed=!0,this._handleLayerStyle()),this._fireEnable()}},disable(){if(!this.enabled()||this._dragging)return;this._enabled=!1,this._markerGroup.clearLayers(),this._markerGroup.removeFrom(this._map),this._layer.off("remove",this.disable,this),this.options.allowSelfIntersection||this._layer.off("pm:vertexremoved",this._handleSelfIntersectionOnVertexRemoval,this);let t=this._layer._path?this._layer._path:this._layer._renderer._container;L.DomUtil.removeClass(t,"leaflet-pm-draggable"),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable()},enabled(){return this._enabled},toggleEdit(t){return this.enabled()?this.disable():this.enable(t),this.enabled()},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping()},_initMarkers(){let t=this._map,e=this._layer.getLatLngs();this._markerGroup&&this._markerGroup.clearLayers(),this._markerGroup=new L.FeatureGroup,this._markerGroup._pmTempLayer=!0;let i=t=>{if(Array.isArray(t[0]))return t.map(i,this);let e=t.map(this._createMarker,this);return!0!==this.options.hideMiddleMarkers&&t.map(((i,n)=>{let o=this.isPolygon()?(n+1)%t.length:n+1;return this._createMiddleMarker(e[n],e[o])})),e};this._markers=i(e),this.filterMarkerGroup(),t.addLayer(this._markerGroup)},_createMarker(t){let e=new L.Marker(t,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(e,"vertexPane"),e._pmTempLayer=!0,this.options.rotate?(e.on("dragstart",this._onRotateStart,this),e.on("drag",this._onRotate,this),e.on("dragend",this._onRotateEnd,this)):(e.on("click",this._onVertexClick,this),e.on("dragstart",this._onMarkerDragStart,this),e.on("move",this._onMarkerDrag,this),e.on("dragend",this._onMarkerDragEnd,this),this.options.preventMarkerRemoval||e.on(this.options.removeVertexOn,this._removeMarker,this)),this._markerGroup.addLayer(e),e},_createMiddleMarker(t,e){if(!t||!e)return!1;let i=L.PM.Utils.calcMiddleLatLng(this._map,t.getLatLng(),e.getLatLng()),n=this._createMarker(i),o=L.divIcon({className:"marker-icon marker-icon-middle"});return n.setIcon(o),n.leftM=t,n.rightM=e,t._middleMarkerNext=n,e._middleMarkerPrev=n,n.on(this.options.addVertexOn,this._onMiddleMarkerClick,this),n.on("movestart",this._onMiddleMarkerMoveStart,this),n},_onMiddleMarkerClick(t){let e=t.target;if(!this._vertexValidation("add",t))return;let i=L.divIcon({className:"marker-icon"});e.setIcon(i),this._addMarker(e,e.leftM,e.rightM)},_onMiddleMarkerMoveStart(t){let e=t.target;e.on("moveend",this._onMiddleMarkerMoveEnd,this),this._vertexValidation("add",t)?(e._dragging=!0,this._addMarker(e,e.leftM,e.rightM)):e.on("move",this._onMiddleMarkerMovePrevent,this)},_onMiddleMarkerMovePrevent(t){let e=t.target;this._vertexValidationDrag(e)},_onMiddleMarkerMoveEnd(t){let e=t.target;if(e.off("move",this._onMiddleMarkerMovePrevent,this),e.off("moveend",this._onMiddleMarkerMoveEnd,this),!this._vertexValidationDragEnd(e))return;let i=L.divIcon({className:"marker-icon"});e.setIcon(i),setTimeout((()=>{delete e._dragging}),100)},_addMarker(t,e,i){t.off("movestart",this._onMiddleMarkerMoveStart,this),t.off(this.options.addVertexOn,this._onMiddleMarkerClick,this);let n=t.getLatLng(),o=this._layer._latlngs;delete t.leftM,delete t.rightM;let{indexPath:r,index:s,parentPath:a}=L.PM.Utils.findDeepMarkerIndex(this._markers,e),l=r.length>1?(0,on.default)(o,a):o,h=r.length>1?(0,on.default)(this._markers,a):this._markers;l.splice(s+1,0,n),h.splice(s+1,0,t),this._layer.setLatLngs(o),!0!==this.options.hideMiddleMarkers&&(this._createMiddleMarker(e,t),this._createMiddleMarker(t,i)),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit"),this._fireVertexAdded(t,L.PM.Utils.findDeepMarkerIndex(this._markers,t).indexPath,n),this.options.snappable&&this._initSnappableMarkers()},hasSelfIntersection(){return ri(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersectionOnVertexRemoval(){this._handleLayerStyle(!0)&&(this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers())},_handleLayerStyle(t){let e,i,n=this._layer;if(this.options.allowSelfIntersection?e=!1:(i=ri(this._layer.toGeoJSON(15)),e=i.features.length>0),e){if(!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!0),this.isRed)return e;t?this._flashLayer():(n.setStyle({color:"#f00000ff"}),this.isRed=!0),this._fireIntersect(i)}else n.setStyle({color:this.cachedColor}),this.isRed=!1,!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!1);return e},_flashLayer(){this.cachedColor||(this.cachedColor=this._layer.options.color),this._layer.setStyle({color:"#f00000ff"}),this.isRed=!0,window.setTimeout((()=>{this._layer.setStyle({color:this.cachedColor}),this.isRed=!1}),200)},_updateDisabledMarkerStyle(t,e){t.forEach((t=>{Array.isArray(t)?this._updateDisabledMarkerStyle(t,e):t._icon&&(e&&!this._checkMarkerAllowedToDrag(t)?L.DomUtil.addClass(t._icon,"vertexmarker-disabled"):L.DomUtil.removeClass(t._icon,"vertexmarker-disabled"))}))},_removeMarker(t){let e=t.target;if(!this._vertexValidation("remove",t))return;this.options.allowSelfIntersection||(this._coordsBeforeEdit=Ue(this._layer,this._layer.getLatLngs()));let i=this._layer.getLatLngs(),{indexPath:n,index:o,parentPath:r}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);if(!n)return;let s=n.length>1?(0,on.default)(i,r):i,a=n.length>1?(0,on.default)(this._markers,r):this._markers;if(!this.options.removeLayerBelowMinVertexCount&&(s.length<=2||this.isPolygon()&&s.length<=3))return void this._flashLayer();s.splice(o,1),this._layer.setLatLngs(i),this.isPolygon()&&s.length<=2&&s.splice(0,s.length);let l=!1;if(s.length<=1&&(s.splice(0,s.length),r.length>1&&n.length>1&&(i=Re(i)),this._layer.setLatLngs(i),this._initMarkers(),l=!0),Be(i)||this._layer.remove(),i=Re(i),this._layer.setLatLngs(i),this._markers=Re(this._markers),!l&&(a=n.length>1?(0,on.default)(this._markers,r):this._markers,e._middleMarkerPrev&&this._markerGroup.removeLayer(e._middleMarkerPrev),e._middleMarkerNext&&this._markerGroup.removeLayer(e._middleMarkerNext),this._markerGroup.removeLayer(e),a)){let t,e;if(this.isPolygon()?(t=(o+1)%a.length,e=(o+(a.length-1))%a.length):(e=o-1<0?void 0:o-1,t=o+1>=a.length?void 0:o+1),t!==e){let i=a[e],n=a[t];!0!==this.options.hideMiddleMarkers&&this._createMiddleMarker(i,n)}a.splice(o,1)}this._fireEdit(),this._layerEdited=!0,this._fireVertexRemoved(e,n),this._fireChange(this._layer.getLatLngs(),"Edit")},updatePolygonCoordsFromMarkerDrag(t){let e=this._layer.getLatLngs(),i=t.getLatLng(),{indexPath:n,index:o,parentPath:r}=L.PM.Utils.findDeepMarkerIndex(this._markers,t);(n.length>1?(0,on.default)(e,r):e).splice(o,1,i),this._layer.setLatLngs(e)},_getNeighborMarkers(t){let{indexPath:e,index:i,parentPath:n}=L.PM.Utils.findDeepMarkerIndex(this._markers,t),o=e.length>1?(0,on.default)(this._markers,n):this._markers,r=(i+1)%o.length;return{prevMarker:o[(i+(o.length-1))%o.length],nextMarker:o[r]}},_checkMarkerAllowedToDrag(t){let{prevMarker:e,nextMarker:i}=this._getNeighborMarkers(t),n=L.polyline([e.getLatLng(),t.getLatLng()]),o=L.polyline([t.getLatLng(),i.getLatLng()]),r=_i(this._layer.toGeoJSON(15),n.toGeoJSON(15)).features.length,s=_i(this._layer.toGeoJSON(15),o.toGeoJSON(15)).features.length;return t.getLatLng()===this._markers[0][0].getLatLng()?s+=1:t.getLatLng()===this._markers[0][this._markers[0].length-1].getLatLng()&&(r+=1),!(r<=2&&s<=2)},_onMarkerDragStart(t){let e=t.target;if(this.cachedColor||(this.cachedColor=this._layer.options.color),!this._vertexValidation("move",t))return;let{indexPath:i}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);this._fireMarkerDragStart(t,i),this.options.allowSelfIntersection||(this._coordsBeforeEdit=Ue(this._layer,this._layer.getLatLngs())),!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this.hasSelfIntersection()?this._markerAllowedToDrag=this._checkMarkerAllowedToDrag(e):this._markerAllowedToDrag=null},_onMarkerDrag(t){let e=t.target;if(!this._vertexValidationDrag(e))return;let{indexPath:i,index:n,parentPath:o}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);if(!i)return;if(!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this.hasSelfIntersection()&&!1===this._markerAllowedToDrag)return this._layer.setLatLngs(this._coordsBeforeEdit),this._initMarkers(),void this._handleLayerStyle();this.updatePolygonCoordsFromMarkerDrag(e);let r=i.length>1?(0,on.default)(this._markers,o):this._markers,s=(n+1)%r.length,a=(n+(r.length-1))%r.length,l=e.getLatLng(),h=r[a].getLatLng(),c=r[s].getLatLng();if(e._middleMarkerNext){let t=L.PM.Utils.calcMiddleLatLng(this._map,l,c);e._middleMarkerNext.setLatLng(t)}if(e._middleMarkerPrev){let t=L.PM.Utils.calcMiddleLatLng(this._map,l,h);e._middleMarkerPrev.setLatLng(t)}this.options.allowSelfIntersection||this._handleLayerStyle(),this._fireMarkerDrag(t,i),this._fireChange(this._layer.getLatLngs(),"Edit")},_onMarkerDragEnd(t){let e=t.target;if(!this._vertexValidationDragEnd(e))return;let{indexPath:i}=L.PM.Utils.findDeepMarkerIndex(this._markers,e),n=this.hasSelfIntersection();n&&this.options.allowSelfIntersectionEdit&&this._markerAllowedToDrag&&(n=!1);let o=!this.options.allowSelfIntersection&&n;if(this._fireMarkerDragEnd(t,i,o),o)return this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers(),this.options.snappable&&this._initSnappableMarkers(),this._handleLayerStyle(),void this._fireLayerReset(t,i);!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._handleLayerStyle(),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit")},_onVertexClick(t){let e=t.target;if(e._dragging)return;let{indexPath:i}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);this._fireVertexClick(t,i)}}),nn.Polygon=nn.Line.extend({_shape:"Polygon",_checkMarkerAllowedToDrag(t){let{prevMarker:e,nextMarker:i}=this._getNeighborMarkers(t),n=L.polyline([e.getLatLng(),t.getLatLng()]),o=L.polyline([t.getLatLng(),i.getLatLng()]),r=_i(this._layer.toGeoJSON(15),n.toGeoJSON(15)).features.length,s=_i(this._layer.toGeoJSON(15),o.toGeoJSON(15)).features.length;return!(r<=2&&s<=2)}}),nn.Rectangle=nn.Polygon.extend({_shape:"Rectangle",_initMarkers(){let t=this._map,e=this._findCorners();this._markerGroup&&this._markerGroup.clearLayers(),this._markerGroup=new L.FeatureGroup,this._markerGroup._pmTempLayer=!0,t.addLayer(this._markerGroup),this._markers=[],this._markers[0]=e.map(this._createMarker,this),[this._cornerMarkers]=this._markers,this._layer.getLatLngs()[0].forEach(((t,e)=>{let i=this._cornerMarkers.find((t=>t._index===e));i&&i.setLatLng(t)}))},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping(),this._addMarkerEvents()},_createMarker(t,e){let i=new L.Marker(t,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(i,"vertexPane"),i._origLatLng=t,i._index=e,i._pmTempLayer=!0,i.on("click",this._onVertexClick,this),this._markerGroup.addLayer(i),i},_addMarkerEvents(){this._markers[0].forEach((t=>{t.on("dragstart",this._onMarkerDragStart,this),t.on("drag",this._onMarkerDrag,this),t.on("dragend",this._onMarkerDragEnd,this),this.options.preventMarkerRemoval||t.on("contextmenu",this._removeMarker,this)}))},_removeMarker(){return null},_onMarkerDragStart(t){if(!this._vertexValidation("move",t))return;let e=t.target,i=this._cornerMarkers;e._oppositeCornerLatLng=i.find((t=>t._index===(e._index+2)%4)).getLatLng(),e._snapped=!1,this._fireMarkerDragStart(t)},_onMarkerDrag(t){let e=t.target;this._vertexValidationDrag(e)&&void 0!==e._index&&(this._adjustRectangleForMarkerMove(e),this._fireMarkerDrag(t),this._fireChange(this._layer.getLatLngs(),"Edit"))},_onMarkerDragEnd(t){let e=t.target;this._vertexValidationDragEnd(e)&&(this._cornerMarkers.forEach((t=>{delete t._oppositeCornerLatLng})),this._fireMarkerDragEnd(t),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit"))},_adjustRectangleForMarkerMove(t){L.extend(t._origLatLng,t._latlng);let e=L.PM.Utils._getRotatedRectangle(t.getLatLng(),t._oppositeCornerLatLng,this.getAngle(),this._map);this._layer.setLatLngs(e),this._adjustAllMarkers(),this._layer.redraw()},_adjustAllMarkers(){let t=this._layer.getLatLngs()[0];t&&4!==t.length&&t.length>0?(t.forEach(((t,e)=>{this._cornerMarkers[e].setLatLng(t)})),this._cornerMarkers.slice(t.length).forEach((e=>{e.setLatLng(t[0])}))):t&&t.length?this._cornerMarkers.forEach((e=>{e.setLatLng(t[e._index])})):console.error("The layer has no LatLngs")},_findCorners(){void 0===this._angle&&this.setInitAngle(je(this._map,this._layer.getLatLngs()[0][0],this._layer.getLatLngs()[0][1])||0);let t=this._layer.getLatLngs()[0];return L.PM.Utils._getRotatedRectangle(t[0],t[2],this.getAngle(),this._map||this)}}),nn.CircleMarker=nn.extend({_shape:"CircleMarker",initialize(t){this._layer=t,this._enabled=!1,this._minRadiusOption="minRadiusCircleMarker",this._maxRadiusOption="maxRadiusCircleMarker",this._editableOption="resizeableCircleMarker",this._updateHiddenPolyCircle()},enable(t={draggable:!0,snappable:!0}){L.Util.setOptions(this,t),this.options.editable&&(this.options.resizeableCircleMarker=this.options.editable,delete this.options.editable),this.options.allowEditing&&this._layer._map?(this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._extendingEnable(),this._updateHiddenPolyCircle(),this._fireEnable()):this.disable()},_extendingEnable(){this._layer.on("pm:dragstart",this._onDragStart,this),this._layer.on("pm:drag",this._onMarkerDrag,this),this._layer.on("pm:dragend",this._onMarkerDragEnd,this)},disable(){this.dragging()||(this._map||(this._map=this._layer._map),this._map&&this.enabled()&&(this.layerDragEnabled()&&this.disableLayerDrag(),this.options[this._editableOption]?(this._helperLayers&&this._helperLayers.clearLayers(),this._map.off("move",this._syncMarkers,this),this._outerMarker.off("drag",this._handleOuterMarkerSnapping,this)):this._map.off("move",this._updateHiddenPolyCircle,this),this._extendingDisable(),this._layer.off("remove",this.disable,this),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1))},_extendingDisable(){this._layer.off("contextmenu",this._removeMarker,this)},enabled(){return this._enabled},toggleEdit(t){this.enabled()?this.disable():this.enable(t)},applyOptions(){this.options[this._editableOption]?(this._initMarkers(),this._map.on("move",this._syncMarkers,this),this.options.snappable?(this._initSnappableMarkers(),this._outerMarker.on("drag",this._handleOuterMarkerSnapping,this),this._outerMarker.on("move",this._syncHintLine,this),this._outerMarker.on("move",this._syncCircleRadius,this),this._centerMarker.on("move",this._moveCircle,this)):this._disableSnapping()):(this.options.draggable&&this.enableLayerDrag(),this._map.on("move",this._updateHiddenPolyCircle,this),this.options.snappable?this._initSnappableMarkersDrag():this._disableSnappingDrag()),this._extendingApplyOptions()},_extendingApplyOptions(){this.options.preventMarkerRemoval||this._layer.on("contextmenu",this._removeMarker,this)},_initMarkers(){let t=this._map;this._helperLayers&&this._helperLayers.clearLayers(),this._helperLayers=new L.FeatureGroup,this._helperLayers._pmTempLayer=!0,this._helperLayers.addTo(t);let e=this._layer.getLatLng(),i=this._layer._radius,n=this._getLatLngOnCircle(e,i);this._centerMarker=this._createCenterMarker(e),this._outerMarker=this._createOuterMarker(n),this._markers=[this._centerMarker,this._outerMarker],this._createHintLine(this._centerMarker,this._outerMarker)},_getLatLngOnCircle(t,e){let i=this._map.project(t),n=L.point(i.x+e,i.y);return this._map.unproject(n)},_createHintLine(t,e){let i=t.getLatLng(),n=e.getLatLng();this._hintline=L.polyline([i,n],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._helperLayers.addLayer(this._hintline)},_createCenterMarker(t){let e=this._createMarker(t);return this.options.draggable?L.DomUtil.addClass(e._icon,"leaflet-pm-draggable"):e.dragging.disable(),e},_createOuterMarker(t){let e=this._createMarker(t);return e.on("drag",this._resizeCircle,this),e},_createMarker(t){let e=new L.Marker(t,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(e,"vertexPane"),e._origLatLng=t,e._pmTempLayer=!0,e.on("dragstart",this._onMarkerDragStart,this),e.on("drag",this._onMarkerDrag,this),e.on("dragend",this._onMarkerDragEnd,this),e.on("click",this._onVertexClick,this),this._helperLayers.addLayer(e),e},_moveCircle(t){if(t.target._cancelDragEventChain)return;let e=this._centerMarker.getLatLng();this._layer.setLatLng(e);let i=this._layer._radius,n=this._getLatLngOnCircle(e,i);this._outerMarker._latlng=n,this._outerMarker.update(),this._syncHintLine(),this._updateHiddenPolyCircle(),this._fireCenterPlaced("Edit"),this._fireChange(this._layer.getLatLng(),"Edit")},_syncMarkers(){let t=this._layer.getLatLng(),e=this._layer._radius,i=this._getLatLngOnCircle(t,e);this._outerMarker.setLatLng(i),this._centerMarker.setLatLng(t),this._syncHintLine(),this._updateHiddenPolyCircle()},_resizeCircle(){this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker()),this._syncHintLine(),this._syncCircleRadius()},_syncCircleRadius(){let t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng(),i=this._distanceCalculation(t,e);this.options[this._minRadiusOption]&&i<this.options[this._minRadiusOption]?this._layer.setRadius(this.options[this._minRadiusOption]):this.options[this._maxRadiusOption]&&i>this.options[this._maxRadiusOption]?this._layer.setRadius(this.options[this._maxRadiusOption]):this._layer.setRadius(i),this._updateHiddenPolyCircle(),this._fireChange(this._layer.getLatLng(),"Edit")},_syncHintLine(){let t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng();this._hintline.setLatLngs([t,e])},_removeMarker(){this.options[this._editableOption]&&this.disable(),this._layer.remove(),this._fireRemove(this._layer),this._fireRemove(this._map,this._layer)},_onDragStart(){this._map.pm.Draw.CircleMarker._layerIsDragging=!0},_onMarkerDragStart(t){this._vertexValidation("move",t)&&this._fireMarkerDragStart(t)},_onMarkerDrag(t){let e=t.target;e instanceof L.Marker&&!this._vertexValidationDrag(e)||this._fireMarkerDrag(t)},_onMarkerDragEnd(t){this._extedingMarkerDragEnd();let e=t.target;this._vertexValidationDragEnd(e)&&(this.options[this._editableOption]&&(this._fireEdit(),this._layerEdited=!0),this._fireMarkerDragEnd(t))},_extedingMarkerDragEnd(){this._map.pm.Draw.CircleMarker._layerIsDragging=!1},_initSnappableMarkersDrag(){let t=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=void 0===this.options.snapSegment||this.options.snapSegment,t.off("pm:drag",this._handleSnapping,this),t.on("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.on("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this),t.on("pm:dragstart",this._unsnap,this)},_disableSnappingDrag(){let t=this._layer;t.off("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this)},_updateHiddenPolyCircle(){let t=this._layer._map||this._map;if(t){let e=L.PM.Utils.pxRadiusToMeterRadius(this._layer.getRadius(),t,this._layer.getLatLng()),i=L.circle(this._layer.getLatLng(),this._layer.options);i.setRadius(e);let n=t&&t.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(i,200,!n).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(i,200,!n),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)}},_getNewDestinationOfOuterMarker(){let t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng(),i=this._distanceCalculation(t,e);return this.options[this._minRadiusOption]&&i<this.options[this._minRadiusOption]?e=Ne(this._map,t,e,this._getMinDistanceInMeter(t)):this.options[this._maxRadiusOption]&&i>this.options[this._maxRadiusOption]&&(e=Ne(this._map,t,e,this._getMaxDistanceInMeter(t))),e},_handleOuterMarkerSnapping(){if(this._outerMarker._snapped){let t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng(),i=this._distanceCalculation(t,e);(this.options[this._minRadiusOption]&&i<this.options[this._minRadiusOption]||this.options[this._maxRadiusOption]&&i>this.options[this._maxRadiusOption])&&this._outerMarker.setLatLng(this._outerMarker._orgLatLng)}this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker())},_distanceCalculation(t,e){return this._map.project(t).distanceTo(this._map.project(e))},_getMinDistanceInMeter(t){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._minRadiusOption],this._map,t)},_getMaxDistanceInMeter(t){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._maxRadiusOption],this._map,t)},_onVertexClick(t){t.target._dragging||this._fireVertexClick(t,void 0)}}),nn.Circle=nn.CircleMarker.extend({_shape:"Circle",initialize(t){this._layer=t,this._enabled=!1,this._minRadiusOption="minRadiusCircle",this._maxRadiusOption="maxRadiusCircle",this._editableOption="resizableCircle",this._updateHiddenPolyCircle()},enable(t){L.PM.Edit.CircleMarker.prototype.enable.call(this,t||{})},_extendingEnable(){},_extendingDisable(){this._layer.off("remove",this.disable,this);let t=this._layer._path?this._layer._path:this._layer._renderer._container;L.DomUtil.removeClass(t,"leaflet-pm-draggable")},_extendingApplyOptions(){},_syncMarkers(){},_removeMarker(){},_onDragStart(){},_extedingMarkerDragEnd(){},_updateHiddenPolyCircle(){let t=this._map&&this._map.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(this._layer,200,!t).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(this._layer,200,!t),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)},_distanceCalculation(t,e){return this._map.distance(t,e)},_getMinDistanceInMeter(){return this.options[this._minRadiusOption]},_getMaxDistanceInMeter(){return this.options[this._maxRadiusOption]},_onVertexClick(t){t.target._dragging||this._fireVertexClick(t,void 0)}}),nn.ImageOverlay=nn.extend({_shape:"ImageOverlay",initialize(t){this._layer=t,this._enabled=!1},toggleEdit(t){this.enabled()?this.disable():this.enable(t)},enabled(){return this._enabled},enable(t={draggable:!0,snappable:!0}){if(L.Util.setOptions(this,t),this._map=this._layer._map,this._map){if(!this.options.allowEditing)return void this.disable();this.enabled()||this.disable(),this.enableLayerDrag(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._otherSnapLayers=this._findCorners(),this._fireEnable()}},disable(){this._dragging||(this._map||(this._map=this._layer._map),this.disableLayerDrag(),this._layer.off("remove",this.disable,this),this.enabled()||(this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable()),this._enabled=!1)},_findCorners(){let t=this._layer.getBounds();return[t.getNorthWest(),t.getNorthEast(),t.getSouthEast(),t.getSouthWest()]}}),nn.Text=nn.extend({_shape:"Text",initialize(t){this._layer=t,this._enabled=!1},enable(t){if(L.Util.setOptions(this,t),this.textArea){if(!this.options.allowEditing||!this._layer._map)return void this.disable();this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._safeToCacheDragState=!0,this._focusChange(),this.textArea.readOnly=!1,this.textArea.classList.remove("pm-disabled"),this._layer.on("remove",this.disable,this),L.DomEvent.on(this.textArea,"input",this._autoResize,this),L.DomEvent.on(this.textArea,"focus",this._focusChange,this),L.DomEvent.on(this.textArea,"blur",this._focusChange,this),this._layer.on("dblclick",L.DomEvent.stop),L.DomEvent.off(this.textArea,"mousedown",this._preventTextSelection),this._enabled=!0,this._fireEnable()}},disable(){if(!this.enabled())return;this._layer.off("remove",this.disable,this),L.DomEvent.off(this.textArea,"input",this._autoResize,this),L.DomEvent.off(this.textArea,"focus",this._focusChange,this),L.DomEvent.off(this.textArea,"blur",this._focusChange,this),L.DomEvent.off(document,"click",this._documentClick,this),this._focusChange(),this.textArea.readOnly=!0,this.textArea.classList.add("pm-disabled");let t=document.activeElement;this.textArea.focus(),this.textArea.selectionStart=0,this.textArea.selectionEnd=0,L.DomEvent.on(this.textArea,"mousedown",this._preventTextSelection),t.focus(),this._disableOnBlurActive=!1,this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1},enabled(){return this._enabled},toggleEdit(t){this.enabled()?this.disable():this.enable(t)},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping()},_initSnappableMarkers(){let t=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=void 0===this.options.snapSegment||this.options.snapSegment,t.off("pm:drag",this._handleSnapping,this),t.on("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.on("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this),t.on("pm:dragstart",this._unsnap,this)},_disableSnapping(){let t=this._layer;t.off("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this)},_autoResize(){this.textArea.style.height="1px",this.textArea.style.width="1px";let t=this.textArea.scrollHeight>21?this.textArea.scrollHeight:21,e=this.textArea.scrollWidth>16?this.textArea.scrollWidth:16;this.textArea.style.height=`${t}px`,this.textArea.style.width=`${e}px`,this._layer.options.text=this.getText(),this._fireTextChange(this.getText())},_disableOnBlur(){this._disableOnBlurActive=!0,setTimeout((()=>{this.enabled()&&L.DomEvent.on(document,"click",this._documentClick,this)}),100)},_documentClick(t){t.target!==this.textArea&&(this.disable(),!this.getText()&&this.options.removeIfEmpty&&this.remove())},_focusChange(t={}){let e=this._hasFocus;this._hasFocus="focus"===t.type,!e!=!this._hasFocus&&(this._hasFocus?(this._applyFocus(),this._focusText=this.getText(),this._fireTextFocus()):(this._removeFocus(),this._fireTextBlur(),this._focusText!==this.getText()&&(this._fireEdit(),this._layerEdited=!0)))},_applyFocus(){this.textArea.classList.add("pm-hasfocus"),this._map.dragging&&(this._safeToCacheDragState&&(this._originalMapDragState=this._map.dragging._enabled,this._safeToCacheDragState=!1),this._map.dragging.disable())},_removeFocus(){this._map.dragging&&(this._originalMapDragState&&this._map.dragging.enable(),this._safeToCacheDragState=!0),this.textArea.classList.remove("pm-hasfocus")},focus(){if(!this.enabled())throw new TypeError("Layer is not enabled");this.textArea.focus()},blur(){if(!this.enabled())throw new TypeError("Layer is not enabled");this.textArea.blur(),this._disableOnBlurActive&&this.disable()},hasFocus(){return this._hasFocus},getElement(){return this.textArea},setText(t){this.textArea.value=t,this._autoResize()},getText(){return this.textArea.value},_initTextMarker(){if(this.textArea=L.PM.Draw.Text.prototype._createTextArea.call(this),this.options.className){let t=this.options.className.split(" ");this.textArea.classList.add(...t)}let t=L.PM.Draw.Text.prototype._createTextIcon.call(this,this.textArea);this._layer.setIcon(t),this._layer.once("add",this._createTextMarker,this)},_createTextMarker(t=!1){this._layer.off("add",this._createTextMarker,this),this._layer.getElement().tabIndex=-1,this.textArea.wrap="off",this.textArea.style.overflow="hidden",this.textArea.style.height=L.DomUtil.getStyle(this.textArea,"font-size"),this.textArea.style.width="1px",this._layer.options.text&&this.setText(this._layer.options.text),this._autoResize(),!0===t&&(this.enable(),this.focus(),this._disableOnBlur())},_preventTextSelection(t){t.preventDefault()}});var sn=function(t,e,i,n,o,r){this._matrix=[t,e,i,n,o,r]};sn.init=()=>new L.PM.Matrix(1,0,0,1,0,0),sn.prototype={transform(t){return this._transform(t.clone())},_transform(t){let e=this._matrix,{x:i,y:n}=t;return t.x=e[0]*i+e[1]*n+e[4],t.y=e[2]*i+e[3]*n+e[5],t},untransform(t){let e=this._matrix;return new L.Point((t.x/e[0]-e[4])/e[0],(t.y/e[2]-e[5])/e[2])},clone(){let t=this._matrix;return new L.PM.Matrix(t[0],t[1],t[2],t[3],t[4],t[5])},translate(t){if(void 0===t)return new L.Point(this._matrix[4],this._matrix[5]);let e,i;return"number"==typeof t?(e=t,i=t):(e=t.x,i=t.y),this._add(1,0,0,1,e,i)},scale(t,e){if(void 0===t)return new L.Point(this._matrix[0],this._matrix[3]);let i,n;return e=e||L.point(0,0),"number"==typeof t?(i=t,n=t):(i=t.x,n=t.y),this._add(i,0,0,n,e.x,e.y)._add(1,0,0,1,-e.x,-e.y)},rotate(t,e){let i=Math.cos(t),n=Math.sin(t);return e=e||new L.Point(0,0),this._add(i,n,-n,i,e.x,e.y)._add(1,0,0,1,-e.x,-e.y)},flip(){return this._matrix[1]*=-1,this._matrix[2]*=-1,this},_add(t,e,i,n,o,r){let s,a=[[],[],[]],l=this._matrix,h=[[l[0],l[2],l[4]],[l[1],l[3],l[5]],[0,0,1]],c=[[t,i,o],[e,n,r],[0,0,1]];t&&t instanceof L.PM.Matrix&&(l=t._matrix,c=[[l[0],l[2],l[4]],[l[1],l[3],l[5]],[0,0,1]]);for(let t=0;t<3;t+=1)for(let e=0;e<3;e+=1){s=0;for(let i=0;i<3;i+=1)s+=h[t][i]*c[i][e];a[t][e]=s}return this._matrix=[a[0][0],a[1][0],a[0][1],a[1][1],a[0][2],a[1][2]],this}};var an=sn,ln={calcMiddleLatLng(t,e,i){let n=t.project(e),o=t.project(i);return t.unproject(n._add(o)._divideBy(2))},findLayers(t){let e=[];return t.eachLayer((t=>{(t instanceof L.Polyline||t instanceof L.Marker||t instanceof L.Circle||t instanceof L.CircleMarker||t instanceof L.ImageOverlay)&&e.push(t)})),e=e.filter((t=>!!t.pm)),e=e.filter((t=>!t._pmTempLayer)),e=e.filter((t=>!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&!1===t.options.pmIgnore)),e},circleToPolygon(t,e=60,i=!0){let n=Fe(t.getLatLng(),t.getRadius(),e,0,i),o=[];for(let t=0;t<n.length;t+=1){let e=[n[t].lat,n[t].lng];o.push(e)}return L.polygon(o,t.options)},disablePopup(t){t.getPopup()&&(t._tempPopupCopy=t.getPopup(),t.unbindPopup())},enablePopup(t){t._tempPopupCopy&&(t.bindPopup(t._tempPopupCopy),delete t._tempPopupCopy)},_fireEvent(t,e,i,n=!1){t.fire(e,i,n);let{groups:o}=this.getAllParentGroups(t);o.forEach((t=>{t.fire(e,i,n)}))},getAllParentGroups(t){let e=[],i=[],n=t=>{for(let o in t._eventParents)if(-1===e.indexOf(o)){e.push(o);let r=t._eventParents[o];i.push(r),n(r)}};return!t._pmLastGroupFetch||!t._pmLastGroupFetch.time||(new Date).getTime()-t._pmLastGroupFetch.time>1e3?(n(t),t._pmLastGroupFetch={time:(new Date).getTime(),groups:i,groupIds:e},{groupIds:e,groups:i}):{groups:t._pmLastGroupFetch.groups,groupIds:t._pmLastGroupFetch.groupIds}},createGeodesicPolygon:Fe,getTranslation:Ie,findDeepCoordIndex(t,e,i=!0){let n,o=t=>(r,s)=>{let a=t.concat(s);if(i){if(r.lat&&r.lat===e.lat&&r.lng===e.lng)return n=a,!0}else if(r.lat&&L.latLng(r).equals(e))return n=a,!0;return Array.isArray(r)&&r.some(o(a))};t.some(o([]));let r={};return n&&(r={indexPath:n,index:n[n.length-1],parentPath:n.slice(0,n.length-1)}),r},findDeepMarkerIndex(t,e){let i,n=t=>(o,r)=>{let s=t.concat(r);return o._leaflet_id===e._leaflet_id?(i=s,!0):Array.isArray(o)&&o.some(n(s))};t.some(n([]));let o={};return i&&(o={indexPath:i,index:i[i.length-1],parentPath:i.slice(0,i.length-1)}),o},_getIndexFromSegment(t,e){if(e&&2===e.length){let i=this.findDeepCoordIndex(t,e[0]),n=this.findDeepCoordIndex(t,e[1]),o=Math.max(i.index,n.index);return(0===i.index||0===n.index)&&1!==o&&(o+=1),{indexA:i,indexB:n,newIndex:o,indexPath:i.indexPath,parentPath:i.parentPath}}return null},_getRotatedRectangle(t,e,i,n){let o=Qi(n,t),r=Qi(n,e),s=i*Math.PI/180,a=Math.cos(s),l=Math.sin(s),h=(r.x-o.x)*a+(r.y-o.y)*l,c=(r.y-o.y)*a-(r.x-o.x)*l,p=h*a+o.x,u=h*l+o.y,d=-c*l+o.x,m=c*a+o.y;return[tn(n,o),tn(n,{x:p,y:u}),tn(n,r),tn(n,{x:d,y:m})]},pxRadiusToMeterRadius(t,e,i){let n=e.project(i),o=L.point(n.x+t,n.y);return e.distance(e.unproject(o),i)}};L.PM=L.PM||{version:"2.16.0",Map:Ze,Toolbar:We,Draw:Ke,Edit:nn,Utils:ln,Matrix:an,activeLang:"en",optIn:!1,initialize(t){this.addInitHooks(t)},setOptIn(t){this.optIn=!!t},addInitHooks(){L.Map.addInitHook((function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Map(this)):this.options.pmIgnore||(this.pm=new L.PM.Map(this)),this.pm&&this.pm.setGlobalOptions({})})),L.LayerGroup.addInitHook((function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.LayerGroup(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.LayerGroup(this))})),L.Marker.addInitHook((function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.options.textMarker?(this.pm=new L.PM.Edit.Text(this),this.options._textMarkerOverPM||this.pm._initTextMarker(),delete this.options._textMarkerOverPM):this.pm=new L.PM.Edit.Marker(this)):this.options.pmIgnore||(this.options.textMarker?(this.pm=new L.PM.Edit.Text(this),this.options._textMarkerOverPM||this.pm._initTextMarker(),delete this.options._textMarkerOverPM):this.pm=new L.PM.Edit.Marker(this))})),L.CircleMarker.addInitHook((function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.CircleMarker(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.CircleMarker(this))})),L.Polyline.addInitHook((function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.Line(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Line(this))})),L.Polygon.addInitHook((function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.Polygon(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Polygon(this))})),L.Rectangle.addInitHook((function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.Rectangle(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Rectangle(this))})),L.Circle.addInitHook((function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.Circle(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Circle(this))})),L.ImageOverlay.addInitHook((function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.ImageOverlay(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.ImageOverlay(this))}))},reInitLayer(t){t instanceof L.LayerGroup&&t.eachLayer((t=>{this.reInitLayer(t)})),t.pm||L.PM.optIn&&!1!==t.options.pmIgnore||t.options.pmIgnore||(t instanceof L.Map?t.pm=new L.PM.Map(t):t instanceof L.Marker?t.options.textMarker?(t.pm=new L.PM.Edit.Text(t),t.pm._initTextMarker(),t.pm._createTextMarker(!1)):t.pm=new L.PM.Edit.Marker(t):t instanceof L.Circle?t.pm=new L.PM.Edit.Circle(t):t instanceof L.CircleMarker?t.pm=new L.PM.Edit.CircleMarker(t):t instanceof L.Rectangle?t.pm=new L.PM.Edit.Rectangle(t):t instanceof L.Polygon?t.pm=new L.PM.Edit.Polygon(t):t instanceof L.Polyline?t.pm=new L.PM.Edit.Line(t):t instanceof L.LayerGroup?t.pm=new L.PM.Edit.LayerGroup(t):t instanceof L.ImageOverlay&&(t.pm=new L.PM.Edit.ImageOverlay(t)))}},"1.7.1"===L.version&&L.Canvas.include({_onClick(t){let e,i,n=this._map.mouseEventToLayerPoint(t);for(let o=this._drawFirst;o;o=o.next)e=o.layer,e.options.interactive&&e._containsPoint(n)&&("click"!==t.type&&"preclick"!==t.type||!this._map._draggableMoved(e))&&(i=e);i&&(L.DomEvent.fakeStop(t),this._fireEvent([i],t))}}),L.PM.initialize()})()},748:function(t){var e;e=function(){"use strict";function t(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function e(e){for(var i=1;i<arguments.length;i++){var o=null!=arguments[i]?arguments[i]:{};i%2?t(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function n(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function o(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return s(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var a=function(t){return"string"==typeof t?document.querySelector(t):t()},l=function(t,e){var i="string"==typeof t?document.createElement(t):t;for(var n in e){var o=e[n];if("inside"===n)o.append(i);else if("dest"===n)a(o[0]).insertAdjacentElement(o[1],i);else if("around"===n){var r=o;r.parentNode.insertBefore(i,r),i.append(r),null!=r.getAttribute("autofocus")&&r.focus()}else n in i?i[n]=o:i.setAttribute(n,o)}return i},h=function(t,e){return t=String(t).toLowerCase(),e?t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").normalize("NFC"):t},c=function(t,i){return l("mark",e({innerHTML:t},"string"==typeof i&&{class:i})).outerHTML},p=function(t,e){e.input.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e.feedback,cancelable:!0}))},u=function(t,e,i){var n=i||{},o=n.mode,r=n.diacritics,s=n.highlight,a=h(e,r);if(e=String(e),t=h(t,r),"loose"===o){var l=(t=t.replace(/ /g,"")).length,p=0,u=Array.from(e).map((function(e,i){return p<l&&a[i]===t[p]&&(e=s?c(e,s):e,p++),e})).join("");if(p===l)return u}else{var d=a.indexOf(t);if(~d)return t=e.substring(d,d+t.length),s?e.replace(t,c(t,s)):e}},d=function(t,e){return new Promise((function(i,n){var o;return(o=t.data).cache&&o.store?i():new Promise((function(t,i){return"function"==typeof o.src?o.src(e).then(t,i):t(o.src)})).then((function(e){try{return t.feedback=o.store=e,p("response",t),i()}catch(t){return n(t)}}),n)}))},m=function(t,e){var i=e.data,n=e.searchEngine,o=[];i.store.forEach((function(s,a){var l=function(i){var r=i?s[i]:s,a="function"==typeof n?n(t,r):u(t,r,{mode:n,diacritics:e.diacritics,highlight:e.resultItem.highlight});if(a){var l={match:a,value:s};i&&(l.key=i),o.push(l)}};if(i.keys){var h,c=function(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=r(t))){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,l=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){l=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(l)throw s}}}}(i.keys);try{for(c.s();!(h=c.n()).done;)l(h.value)}catch(t){c.e(t)}finally{c.f()}}else l()})),i.filter&&(o=i.filter(o));var s=o.slice(0,e.resultsList.maxResults);e.feedback={query:t,matches:o,results:s},p("results",e)},f="aria-expanded",g="aria-activedescendant",_="aria-selected",v=function(t,i){t.feedback.selection=e({index:i},t.feedback.results[i])},y=function(t){t.isOpen||((t.wrapper||t.input).setAttribute(f,!0),t.list.removeAttribute("hidden"),t.isOpen=!0,p("open",t))},b=function(t){t.isOpen&&((t.wrapper||t.input).setAttribute(f,!1),t.input.setAttribute(g,""),t.list.setAttribute("hidden",""),t.isOpen=!1,p("close",t))},x=function(t,e){var i=e.resultItem,n=e.list.getElementsByTagName(i.tag),r=!!i.selected&&i.selected.split(" ");if(e.isOpen&&n.length){var s,a,l=e.cursor;t>=n.length&&(t=0),t<0&&(t=n.length-1),e.cursor=t,l>-1&&(n[l].removeAttribute(_),r&&(a=n[l].classList).remove.apply(a,o(r))),n[t].setAttribute(_,!0),r&&(s=n[t].classList).add.apply(s,o(r)),e.input.setAttribute(g,n[e.cursor].id),e.list.scrollTop=n[t].offsetTop-e.list.clientHeight+n[t].clientHeight+5,e.feedback.cursor=e.cursor,v(e,t),p("navigate",e)}},k=function(t){x(t.cursor+1,t)},L=function(t){x(t.cursor-1,t)},w=function(t,e,i){(i=i>=0?i:t.cursor)<0||(t.feedback.event=e,v(t,i),p("selection",t),b(t))};function M(t,i){var n=this;return new Promise((function(o,r){var s,a;return s=i||((a=t.input)instanceof HTMLInputElement||a instanceof HTMLTextAreaElement?a.value:a.innerHTML),function(t,e,i){return e?e(t):t.length>=i}(s=t.query?t.query(s):s,t.trigger,t.threshold)?d(t,s).then((function(i){try{return t.feedback instanceof Error?o():(m(s,t),t.resultsList&&function(t){var i=t.resultsList,n=t.list,o=t.resultItem,r=t.feedback,s=r.matches,a=r.results;if(t.cursor=-1,n.innerHTML="",s.length||i.noResults){var h=new DocumentFragment;a.forEach((function(t,i){var n=l(o.tag,e({id:"".concat(o.id,"_").concat(i),role:"option",innerHTML:t.match,inside:h},o.class&&{class:o.class}));o.element&&o.element(n,t)})),n.append(h),i.element&&i.element(n,r),y(t)}else b(t)}(t),h.call(n))}catch(t){return r(t)}}),r):(b(t),h.call(n));function h(){return o()}}))}var C=function(t,e){for(var i in t)for(var n in t[i])e(i,n)},P=function(t){var i,n,o,r=t.events,s=(i=function(){return M(t)},n=t.debounce,function(){clearTimeout(o),o=setTimeout((function(){return i()}),n)}),a=t.events=e({input:e({},r&&r.input)},t.resultsList&&{list:r?e({},r.list):{}}),l={input:{input:function(){s()},keydown:function(e){!function(t,e){switch(t.keyCode){case 40:case 38:t.preventDefault(),40===t.keyCode?k(e):L(e);break;case 13:e.submit||t.preventDefault(),e.cursor>=0&&w(e,t);break;case 9:e.resultsList.tabSelect&&e.cursor>=0&&w(e,t);break;case 27:e.input.value="",b(e)}}(e,t)},blur:function(){b(t)}},list:{mousedown:function(t){t.preventDefault()},click:function(e){!function(t,e){var i=e.resultItem.tag.toUpperCase(),n=Array.from(e.list.querySelectorAll(i)),o=t.target.closest(i);o&&o.nodeName===i&&w(e,t,n.indexOf(o))}(e,t)}}};C(l,(function(e,i){(t.resultsList||"input"===i)&&(a[e][i]||(a[e][i]=l[e][i]))})),C(a,(function(e,i){t[e].addEventListener(i,a[e][i])}))};function S(t){var i=this;return new Promise((function(n,o){var r,s,a;if(r=t.placeHolder,a={role:"combobox","aria-owns":(s=t.resultsList).id,"aria-haspopup":!0,"aria-expanded":!1},l(t.input,e(e({"aria-controls":s.id,"aria-autocomplete":"both"},r&&{placeholder:r}),!t.wrapper&&e({},a))),t.wrapper&&(t.wrapper=l("div",e({around:t.input,class:t.name+"_wrapper"},a))),s&&(t.list=l(s.tag,e({dest:[s.destination,s.position],id:s.id,role:"listbox",hidden:"hidden"},s.class&&{class:s.class}))),P(t),t.data.cache)return d(t).then((function(t){try{return h.call(i)}catch(t){return o(t)}}),o);function h(){return p("init",t),n()}return h.call(i)}))}function T(t){var e=t.prototype;e.init=function(){S(this)},e.start=function(t){M(this,t)},e.unInit=function(){if(this.wrapper){var t=this.wrapper.parentNode;t.insertBefore(this.input,this.wrapper),t.removeChild(this.wrapper)}var e;C((e=this).events,(function(t,i){e[t].removeEventListener(i,e.events[t][i])}))},e.open=function(){y(this)},e.close=function(){b(this)},e.goTo=function(t){x(t,this)},e.next=function(){k(this)},e.previous=function(){L(this)},e.select=function(t){w(this,null,t)},e.search=function(t,e,i){return u(t,e,i)}}return function t(e){this.options=e,this.id=t.instances=(t.instances||0)+1,this.name="autoComplete",this.wrapper=1,this.threshold=1,this.debounce=0,this.resultsList={position:"afterend",tag:"ul",maxResults:5},this.resultItem={tag:"li"},function(t){var e=t.name,n=t.options,o=t.resultsList,r=t.resultItem;for(var s in n)if("object"===i(n[s]))for(var l in t[s]||(t[s]={}),n[s])t[s][l]=n[s][l];else t[s]=n[s];t.selector=t.selector||"#"+e,o.destination=o.destination||t.selector,o.id=o.id||e+"_list_"+t.id,r.id=r.id||e+"_result",t.input=a(t.selector)}(this),T.call(this,t),S(this)}},t.exports=e()},898:function(t){t.exports=function(t,e){return!(t[0]>e[2]||t[2]<e[0]||t[3]<e[1]||t[1]>e[3])}},576:function(t){ /*! * clipboard.js v2.0.11 * https://clipboardjs.com/ * * Licensed MIT © Zeno Rocha */ var e;e=function(){return function(){var t={686:function(t,e,i){"use strict";i.d(e,{default:function(){return k}});var n=i(279),o=i.n(n),r=i(370),s=i.n(r),a=i(817),l=i.n(a);function h(t){try{return document.execCommand(t)}catch(t){return!1}}var c=function(t){var e=l()(t);return h("cut"),e},p=function(t,e){var i=function(t){var e="rtl"===document.documentElement.getAttribute("dir"),i=document.createElement("textarea");i.style.fontSize="12pt",i.style.border="0",i.style.padding="0",i.style.margin="0",i.style.position="absolute",i.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;return i.style.top="".concat(n,"px"),i.setAttribute("readonly",""),i.value=t,i}(t);e.container.appendChild(i);var n=l()(i);return h("copy"),i.remove(),n},u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},i="";return"string"==typeof t?i=p(t,e):t instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==t?void 0:t.type)?i=p(t.value,e):(i=l()(t),h("copy")),i};function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}var m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.action,i=void 0===e?"copy":e,n=t.container,o=t.target,r=t.text;if("copy"!==i&&"cut"!==i)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==o){if(!o||"object"!==d(o)||1!==o.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===i&&o.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===i&&(o.hasAttribute("readonly")||o.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return r?u(r,{container:n}):o?"cut"===i?c(o):u(o,{container:n}):void 0};function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function g(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _(t,e){return _=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},_(t,e)}function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=y(t);if(e){var o=y(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return function(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}(this,i)}}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}function b(t,e){var i="data-clipboard-".concat(t);if(e.hasAttribute(i))return e.getAttribute(i)}var x=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_(t,e)}(r,t);var e,i,n,o=v(r);function r(t,e){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(i=o.call(this)).resolveOptions(e),i.listenClick(t),i}return e=r,i=[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===f(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=s()(t,"click",(function(t){return e.onClick(t)}))}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget,i=this.action(e)||"copy",n=m({action:i,container:this.container,target:this.target(e),text:this.text(e)});this.emit(n?"success":"error",{action:i,text:n,trigger:e,clearSelection:function(){e&&e.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(t){return b("action",t)}},{key:"defaultTarget",value:function(t){var e=b("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return b("text",t)}},{key:"destroy",value:function(){this.listener.destroy()}}],n=[{key:"copy",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return u(t,e)}},{key:"cut",value:function(t){return c(t)}},{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,i=!!document.queryCommandSupported;return e.forEach((function(t){i=i&&!!document.queryCommandSupported(t)})),i}}],i&&g(e.prototype,i),n&&g(e,n),r}(o()),k=x},828:function(t){if("undefined"!=typeof Element&&!Element.prototype.matches){var e=Element.prototype;e.matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},438:function(t,e,i){var n=i(828);function o(t,e,i,n,o){var s=r.apply(this,arguments);return t.addEventListener(i,s,o),{destroy:function(){t.removeEventListener(i,s,o)}}}function r(t,e,i,o){return function(i){i.delegateTarget=n(i.target,e),i.delegateTarget&&o.call(t,i)}}t.exports=function(t,e,i,n,r){return"function"==typeof t.addEventListener?o.apply(null,arguments):"function"==typeof i?o.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,(function(t){return o(t,e,i,n,r)})))}},879:function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var i=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===i||"[object HTMLCollection]"===i)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},370:function(t,e,i){var n=i(879),o=i(438);t.exports=function(t,e,i){if(!t&&!e&&!i)throw new Error("Missing required arguments");if(!n.string(e))throw new TypeError("Second argument must be a String");if(!n.fn(i))throw new TypeError("Third argument must be a Function");if(n.node(t))return function(t,e,i){return t.addEventListener(e,i),{destroy:function(){t.removeEventListener(e,i)}}}(t,e,i);if(n.nodeList(t))return function(t,e,i){return Array.prototype.forEach.call(t,(function(t){t.addEventListener(e,i)})),{destroy:function(){Array.prototype.forEach.call(t,(function(t){t.removeEventListener(e,i)}))}}}(t,e,i);if(n.string(t))return function(t,e,i){return o(document.body,t,e,i)}(t,e,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(t){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var i=t.hasAttribute("readonly");i||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),i||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var n=window.getSelection(),o=document.createRange();o.selectNodeContents(t),n.removeAllRanges(),n.addRange(o),e=n.toString()}return e}},279:function(t){function e(){}e.prototype={on:function(t,e,i){var n=this.e||(this.e={});return(n[t]||(n[t]=[])).push({fn:e,ctx:i}),this},once:function(t,e,i){var n=this;function o(){n.off(t,o),e.apply(i,arguments)}return o._=e,this.on(t,o,i)},emit:function(t){for(var e=[].slice.call(arguments,1),i=((this.e||(this.e={}))[t]||[]).slice(),n=0,o=i.length;n<o;n++)i[n].fn.apply(i[n].ctx,e);return this},off:function(t,e){var i=this.e||(this.e={}),n=i[t],o=[];if(n&&e)for(var r=0,s=n.length;r<s;r++)n[r].fn!==e&&n[r].fn._!==e&&o.push(n[r]);return o.length?i[t]=o:delete i[t],this}},t.exports=e,t.exports.TinyEmitter=e}},e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={exports:{}};return t[n](o,o.exports,i),o.exports}return i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,{a:e}),e},i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i(686)}().default},t.exports=e()},348:function(t,e){var i,n,o;n=[e,t],i=function(t,e){"use strict";var i={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function n(){return"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random())}function o(t){try{delete window[t]}catch(e){window[t]=void 0}}function r(t){var e=document.getElementById(t);e&&document.getElementsByTagName("head")[0].removeChild(e)}function s(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],s=t,a=e.timeout||i.timeout,l=e.jsonpCallback||i.jsonpCallback,h=void 0;return new Promise((function(i,c){var p=e.jsonpCallbackFunction||n(),u=l+"_"+p;window[p]=function(t){i({ok:!0,json:function(){return Promise.resolve(t)}}),h&&clearTimeout(h),r(u),o(p)},s+=-1===s.indexOf("?")?"?":"&";var d=document.createElement("script");d.setAttribute("src",""+s+l+"="+p),e.charset&&d.setAttribute("charset",e.charset),e.nonce&&d.setAttribute("nonce",e.nonce),e.referrerPolicy&&d.setAttribute("referrerPolicy",e.referrerPolicy),e.crossorigin&&d.setAttribute("crossorigin","true"),d.id=u,document.getElementsByTagName("head")[0].appendChild(d),h=setTimeout((function(){c(new Error("JSONP request to "+t+" timed out")),o(p),r(u),window[p]=function(){o(p)}}),a),d.onerror=function(){c(new Error("JSONP request to "+t+" failed")),o(p),r(u),h&&clearTimeout(h)}}))}e.exports=s},void 0===(o="function"==typeof i?i.apply(e,n):i)||(t.exports=o)},990:function(){"use strict";"function"!=typeof Object.assign&&(Object.assign=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(!t)throw TypeError("Cannot convert undefined or null to object");for(var n=function(e){e&&Object.keys(e).forEach((function(i){return t[i]=e[i]}))},o=0,r=e;o<r.length;o++){n(r[o])}return t})},891:function(t,e,i){var n=i(481),o=i(348),r=i(898);var s=["Aerial","AerialWithLabels","AerialWithLabelsOnDemand","Road","RoadOnDemand","CanvasLight","CanvasDark","CanvasGray","OrdnanceSurvey"],a=["AerialWithLabelsOnDemand","RoadOnDemand"];n.TileLayer.Bing=n.TileLayer.extend({options:{bingMapsKey:null,imagerySet:"Aerial",culture:"en-US",minZoom:1,minNativeZoom:1,maxNativeZoom:19},statics:{METADATA_URL:"https://dev.virtualearth.net/REST/v1/Imagery/Metadata/{imagerySet}?key={bingMapsKey}&include=ImageryProviders&uriScheme=https&c={culture}",POINT_METADATA_URL:"https://dev.virtualearth.net/REST/v1/Imagery/Metadata/{imagerySet}/{lat},{lng}?zl={z}&key={bingMapsKey}&uriScheme=https&c={culture}"},initialize:function(t){if("string"==typeof t&&(t={bingMapsKey:t}),t&&t.BingMapsKey&&(t.bingMapsKey=t.BingMapsKey,console.warn("use options.bingMapsKey instead of options.BingMapsKey")),!t||!t.bingMapsKey)throw new Error("Must supply options.BingMapsKey");if(t=n.setOptions(this,t),s.indexOf(t.imagerySet)<0)throw new Error("'"+t.imagerySet+"' is an invalid imagerySet, see https://github.com/digidem/leaflet-bing-layer#parameters");t&&t.style&&a.indexOf(t.imagerySet)<0&&console.warn("Dynamic styles will only work with these imagerySet choices: "+a.join(", "));var e=n.Util.template(n.TileLayer.Bing.METADATA_URL,{bingMapsKey:this.options.bingMapsKey,imagerySet:this.options.imagerySet,culture:this.options.culture});this._imageryProviders=[],this._attributions=[],this._fetch=o(e,{jsonpCallback:"jsonp"}).then((function(t){return t.json()})).then(this._metaDataOnLoad.bind(this)).catch(console.error.bind(console)),n.Browser.android||this.on("tileunload",this._onTileRemove)},createTile:function(t,e){var i=document.createElement("img");return n.DomEvent.on(i,"load",n.bind(this._tileOnLoad,this,e,i)),n.DomEvent.on(i,"error",n.bind(this._tileOnError,this,e,i)),this.options.crossOrigin&&(i.crossOrigin=""),i.alt="",this._url?i.src=this.getTileUrl(t):this._fetch.then(function(){i.src=this.getTileUrl(t)}.bind(this)).catch((function(t){console.error(t),e(t)})),i},getTileUrl:function(t){var e=function(t,e,i){for(var n="",o=i;o>0;o--){var r=0,s=1<<o-1;0!=(t&s)&&r++,0!=(e&s)&&(r+=2),n+=r.toString()}return n}(t.x,t.y,t.z),i=n.Util.template(this._url,{quadkey:e,subdomain:this._getSubdomain(t),culture:this.options.culture});return"string"==typeof this.options.style&&(i+="&st="+this.options.style),i},onAdd:function(t){t.on("moveend",this._updateAttribution,this),n.TileLayer.prototype.onAdd.call(this,t),this._attributions.forEach((function(e){t.attributionControl.addAttribution(e)}))},onRemove:function(t){t.off("moveend",this._updateAttribution,this),this._attributions.forEach((function(e){t.attributionControl.removeAttribution(e)})),n.TileLayer.prototype.onRemove.call(this,t)},getMetaData:function(t,e){if(!(this._map||t&&e))return Promise.reject(new Error("If layer is not attached to map, you must provide LatLng and zoom"));t=t||this._map.getCenter(),e=e||this._map.getZoom();var i=n.Util.template(n.TileLayer.Bing.POINT_METADATA_URL,{bingMapsKey:this.options.bingMapsKey,imagerySet:this.options.imagerySet,z:e,lat:t.lat,lng:t.lng});return o(i,{jsonpCallback:"jsonp"}).then((function(t){return t.json()})).catch(console.error.bind(console))},_metaDataOnLoad:function(t){if(200!==t.statusCode)throw new Error("Bing Imagery Metadata error: \n"+JSON.stringify(t,null," "));var e=t.resourceSets[0].resources[0];return this._url=e.imageUrl,this._imageryProviders=e.imageryProviders||[],this.options.subdomains=e.imageUrlSubdomains,this._updateAttribution(),Promise.resolve()},_updateAttribution:function(){var t=this._map;if(t&&t.attributionControl){var e=t.getZoom(),i=function(t){var e=t.split(",");return[e[1],e[0],e[3],e[2]]}(t.getBounds().toBBoxString());this._fetch.then(function(){var n=this._getAttributions(i,e),o=this._attributions;n.forEach((function(e){o.indexOf(e)>-1||t.attributionControl.addAttribution(e)})),o.filter((function(e){n.indexOf(e)>-1||t.attributionControl.removeAttribution(e)})),this._attributions=n}.bind(this))}},_getAttributions:function(t,e){return this._imageryProviders.reduce((function(i,n){for(var o=0;o<n.coverageAreas.length;o++)if(r(t,n.coverageAreas[o].bbox)&&e>=n.coverageAreas[o].zoomMin&&e<=n.coverageAreas[o].zoomMax)return i.push(n.attribution),i;return i}),[])}}),n.tileLayer.bing=function(t){return new n.TileLayer.Bing(t)},t.exports=n.TileLayer.Bing},157:function(t,e,i){var n,o,r;!function(s,a){o=[i(481)],void 0===(r="function"==typeof(n=s)?n.apply(e,o):n)||(t.exports=r),void 0!==a&&a.L&&!a.L.EdgeBuffer&&s(a.L)}((function(t){t.EdgeBuffer={previousMethods:{getTiledPixelBounds:t.GridLayer.prototype._getTiledPixelBounds}},t.GridLayer.include({_getTiledPixelBounds:function(e,i,n){var o=t.EdgeBuffer.previousMethods.getTiledPixelBounds.call(this,e,i,n),r=1;if(void 0!==this.options.edgeBufferTiles&&null!==this.options.edgeBufferTiles&&(r=this.options.edgeBufferTiles),r>0){var s=t.GridLayer.prototype.getTileSize.call(this).multiplyBy(r);o=new t.Bounds(o.min.subtract(s),o.max.add(s))}return o}})}),window)},189:function(){L.Control.Fullscreen=L.Control.extend({options:{position:"topleft",title:{false:"View Fullscreen",true:"Exit Fullscreen"}},onAdd:function(t){var e=L.DomUtil.create("div","leaflet-control-fullscreen leaflet-bar leaflet-control");return this.link=L.DomUtil.create("a","leaflet-control-fullscreen-button leaflet-bar-part",e),this.link.href="#",this._map=t,this._map.on("fullscreenchange",this._toggleTitle,this),this._toggleTitle(),L.DomEvent.on(this.link,"click",this._click,this),e},_click:function(t){L.DomEvent.stopPropagation(t),L.DomEvent.preventDefault(t),this._map.toggleFullscreen(this.options)},_toggleTitle:function(){this.link.title=this.options.title[this._map.isFullscreen()]}}),L.Map.include({isFullscreen:function(){return this._isFullscreen||!1},toggleFullscreen:function(t){var e=this.getContainer();this.isFullscreen()?t&&t.pseudoFullscreen?this._disablePseudoFullscreen(e):document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this._disablePseudoFullscreen(e):t&&t.pseudoFullscreen?this._enablePseudoFullscreen(e):e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):e.msRequestFullscreen?e.msRequestFullscreen():this._enablePseudoFullscreen(e)},_enablePseudoFullscreen:function(t){L.DomUtil.addClass(t,"leaflet-pseudo-fullscreen"),this._setFullscreen(!0),this.fire("fullscreenchange")},_disablePseudoFullscreen:function(t){L.DomUtil.removeClass(t,"leaflet-pseudo-fullscreen"),this._setFullscreen(!1),this.fire("fullscreenchange")},_setFullscreen:function(t){this._isFullscreen=t;var e=this.getContainer();t?L.DomUtil.addClass(e,"leaflet-fullscreen-on"):L.DomUtil.removeClass(e,"leaflet-fullscreen-on"),this.invalidateSize()},_onFullscreenChange:function(t){var e=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement;e!==this.getContainer()||this._isFullscreen?e!==this.getContainer()&&this._isFullscreen&&(this._setFullscreen(!1),this.fire("fullscreenchange")):(this._setFullscreen(!0),this.fire("fullscreenchange"))}}),L.Map.mergeOptions({fullscreenControl:!1}),L.Map.addInitHook((function(){var t;if(this.options.fullscreenControl&&(this.fullscreenControl=new L.Control.Fullscreen(this.options.fullscreenControl),this.addControl(this.fullscreenControl)),"onfullscreenchange"in document?t="fullscreenchange":"onmozfullscreenchange"in document?t="mozfullscreenchange":"onwebkitfullscreenchange"in document?t="webkitfullscreenchange":"onmsfullscreenchange"in document&&(t="MSFullscreenChange"),t){var e=L.bind(this._onFullscreenChange,this);this.whenReady((function(){L.DomEvent.on(document,t,e)})),this.on("unload",(function(){L.DomEvent.off(document,t,e)}))}})),L.control.fullscreen=function(t){return new L.Control.Fullscreen(t)}},882:function(t,e){!function(t){"use strict";var e={ar:{touch:"استخدم إصبعين لتحريك الخريطة",scroll:"استخدم ctrl + scroll لتصغير/تكبير الخريطة",scrollMac:"يمكنك استخدام ⌘ + التمرير لتكبير/تصغير الخريطة"},bg:{touch:"Използвайте два пръста, за да преместите картата",scroll:"Задръжте бутона Ctrl натиснат, докато превъртате, за да промените мащаба на картата",scrollMac:"Задръжте бутона ⌘ натиснат, докато превъртате, за да промените мащаба на картата"},bn:{touch:"মানচিত্রটিকে সরাতে দুটি আঙ্গুল ব্যবহার করুন",scroll:"ম্যাপ জুম করতে ctrl + scroll ব্যবহার করুন",scrollMac:"ম্যাপে জুম করতে ⌘ বোতাম টিপে স্ক্রল করুন"},ca:{touch:"Fes servir dos dits per moure el mapa",scroll:"Prem la tecla Control mentre et desplaces per apropar i allunyar el mapa",scrollMac:"Prem la tecla ⌘ mentre et desplaces per apropar i allunyar el mapa"},cs:{touch:"K posunutí mapy použijte dva prsty",scroll:"Velikost zobrazení mapy změňte podržením klávesy Ctrl a posouváním kolečka myši",scrollMac:"Velikost zobrazení mapy změníte podržením klávesy ⌘ a posunutím kolečka myši / touchpadu"},da:{touch:"Brug to fingre til at flytte kortet",scroll:"Brug ctrl + rullefunktionen til at zoome ind og ud på kortet",scrollMac:"Brug ⌘ + rullefunktionen til at zoome ind og ud på kortet"},de:{touch:"Verschieben der Karte mit zwei Fingern",scroll:"Verwende Strg+Scrollen zum Zoomen der Karte",scrollMac:"⌘"},el:{touch:"Χρησιμοποιήστε δύο δάχτυλα για μετακίνηση στον χάρτη",scroll:"Χρησιμοποιήστε το πλήκτρο Ctrl και κύλιση, για να μεγεθύνετε τον χάρτη",scrollMac:"Χρησιμοποιήστε το πλήκτρο ⌘ + κύλιση για εστίαση στον χάρτη"},en:{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},"en-AU":{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},"en-GB":{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},es:{touch:"Para mover el mapa, utiliza dos dedos",scroll:"Mantén pulsada la tecla Ctrl mientras te desplazas para acercar o alejar el mapa",scrollMac:"Mantén pulsada la tecla ⌘ mientras te desplazas para acercar o alejar el mapa"},eu:{touch:"Erabili bi hatz mapa mugitzeko",scroll:"Mapan zooma aplikatzeko, sakatu Ktrl eta egin gora edo behera",scrollMac:"Eduki sakatuta ⌘ eta egin gora eta behera mapa handitu eta txikitzeko"},fa:{touch:"برای حرکت دادن نقشه از دو انگشت استفاده کنید.",scroll:"برای بزرگنمایی نقشه از ctrl + scroll استفاده کنید",scrollMac:"برای بزرگنمایی نقشه، از ⌘ + پیمایش استفاده کنید."},fi:{touch:"Siirrä karttaa kahdella sormella.",scroll:"Zoomaa karttaa painamalla Ctrl-painiketta ja vierittämällä.",scrollMac:"Zoomaa karttaa pitämällä painike ⌘ painettuna ja vierittämällä."},fil:{touch:"Gumamit ng dalawang daliri upang iusog ang mapa",scroll:"Gamitin ang ctrl + scroll upang i-zoom ang mapa",scrollMac:"Gamitin ang ⌘ + scroll upang i-zoom ang mapa"},fr:{touch:"Utilisez deux doigts pour déplacer la carte",scroll:"Vous pouvez zoomer sur la carte à l'aide de CTRL+Molette de défilement",scrollMac:"Vous pouvez zoomer sur la carte à l'aide de ⌘+Molette de défilement"},gl:{touch:"Utiliza dous dedos para mover o mapa",scroll:"Preme Ctrl mentres te desprazas para ampliar o mapa",scrollMac:"Preme ⌘ e desprázate para ampliar o mapa"},gu:{touch:"નકશો ખસેડવા બે આંગળીઓનો ઉપયોગ કરો",scroll:"નકશાને ઝૂમ કરવા માટે ctrl + સ્ક્રોલનો ઉપયોગ કરો",scrollMac:"નકશાને ઝૂમ કરવા ⌘ + સ્ક્રોલનો ઉપયોગ કરો"},hi:{touch:"मैप एक जगह से दूसरी जगह ले जाने के लिए दो उंगलियों का इस्तेमाल करें",scroll:"मैप को ज़ूम करने के लिए ctrl + स्क्रोल का उपयोग करें",scrollMac:"मैप को ज़ूम करने के लिए ⌘ + स्क्रोल का उपयोग करें"},hr:{touch:"Pomičite kartu pomoću dva prsta",scroll:"Upotrijebite Ctrl i klizač miša da biste zumirali kartu",scrollMac:"Upotrijebite gumb ⌘ dok se pomičete za zumiranje karte"},hu:{touch:"Két ujjal mozgassa a térképet",scroll:"A térkép a ctrl + görgetés használatával nagyítható",scrollMac:"A térkép a ⌘ + görgetés használatával nagyítható"},id:{touch:"Gunakan dua jari untuk menggerakkan peta",scroll:"Gunakan ctrl + scroll untuk memperbesar atau memperkecil peta",scrollMac:"Gunakan ⌘ + scroll untuk memperbesar atau memperkecil peta"},it:{touch:"Utilizza due dita per spostare la mappa",scroll:"Utilizza CTRL + scorrimento per eseguire lo zoom della mappa",scrollMac:"Utilizza ⌘ + scorrimento per eseguire lo zoom della mappa"},iw:{touch:"הזז את המפה באמצעות שתי אצבעות",scroll:"אפשר לשנות את מרחק התצוגה במפה באמצעות מקש ctrl וגלילה",scrollMac:"אפשר לשנות את מרחק התצוגה במפה באמצעות מקש ⌘ וגלילה"},ja:{touch:"地図を移動させるには指 2 本で操作します",scroll:"地図をズームするには、Ctrl キーを押しながらスクロールしてください",scrollMac:"地図をズームするには、⌘ キーを押しながらスクロールしてください"},kn:{touch:"Use two fingers to move the map",scroll:"Use Ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},ko:{touch:"지도를 움직이려면 두 손가락을 사용하세요.",scroll:"지도를 확대/축소하려면 Ctrl을 누른 채 스크롤하세요.",scrollMac:"지도를 확대하려면 ⌘ + 스크롤 사용"},lt:{touch:"Perkelkite žemėlapį dviem pirštais",scroll:"Slinkite nuspaudę klavišą „Ctrl“, kad pakeistumėte žemėlapio mastelį",scrollMac:"Paspauskite klavišą ⌘ ir slinkite, kad priartintumėte žemėlapį"},lv:{touch:"Lai pārvietotu karti, bīdiet to ar diviem pirkstiem",scroll:"Kartes tālummaiņai izmantojiet ctrl + ritināšanu",scrollMac:"Lai veiktu kartes tālummaiņu, izmantojiet ⌘ + ritināšanu"},ml:{touch:"മാപ്പ് നീക്കാൻ രണ്ട് വിരലുകൾ ഉപയോഗിക്കുക",scroll:"കൺട്രോൾ + സ്ക്രോൾ ഉപയോഗിച്ച് മാപ്പ് സൂം ചെയ്യുക",scrollMac:"⌘ + സ്ക്രോൾ ഉപയോഗിച്ച് മാപ്പ് സൂം ചെയ്യുക"},mr:{touch:"नकाशा हलविण्यासाठी दोन बोटे वापरा",scroll:"नकाशा झूम करण्यासाठी ctrl + scroll वापरा",scrollMac:"नकाशावर झूम करण्यासाठी ⌘ + स्क्रोल वापरा"},nl:{touch:"Gebruik twee vingers om de kaart te verplaatsen",scroll:"Gebruik Ctrl + scrollen om in- en uit te zoomen op de kaart",scrollMac:"Gebruik ⌘ + scrollen om in en uit te zoomen op de kaart"},no:{touch:"Bruk to fingre for å flytte kartet",scroll:"Hold ctrl-tasten inne og rull for å zoome på kartet",scrollMac:"Hold inne ⌘-tasten og rull for å zoome på kartet"},pl:{touch:"Przesuń mapę dwoma palcami",scroll:"Naciśnij CTRL i przewiń, by przybliżyć mapę",scrollMac:"Naciśnij ⌘ i przewiń, by przybliżyć mapę"},pt:{touch:"Use dois dedos para mover o mapa",scroll:"Pressione Ctrl e role a tela simultaneamente para aplicar zoom no mapa",scrollMac:"Use ⌘ e role a tela simultaneamente para aplicar zoom no mapa"},"pt-BR":{touch:"Use dois dedos para mover o mapa",scroll:"Pressione Ctrl e role a tela simultaneamente para aplicar zoom no mapa",scrollMac:"Use ⌘ e role a tela simultaneamente para aplicar zoom no mapa"},"pt-PT":{touch:"Utilize dois dedos para mover o mapa",scroll:"Utilizar ctrl + deslocar para aumentar/diminuir zoom do mapa",scrollMac:"Utilize ⌘ + deslocar para aumentar/diminuir o zoom do mapa"},ro:{touch:"Folosiți două degete pentru a deplasa harta",scroll:"Apăsați tasta ctrl și derulați simultan pentru a mări harta",scrollMac:"Folosiți ⌘ și derulați pentru a mări/micșora harta"},ru:{touch:"Чтобы переместить карту, проведите по ней двумя пальцами",scroll:"Чтобы изменить масштаб, прокручивайте карту, удерживая клавишу Ctrl.",scrollMac:"Чтобы изменить масштаб, нажмите ⌘ + прокрутка"},sk:{touch:"Mapu môžete posunúť dvoma prstami",scroll:"Ak chcete priblížiť mapu, stlačte kláves ctrl a posúvajte",scrollMac:"Ak chcete priblížiť mapu, stlačte kláves ⌘ a posúvajte kolieskom myši"},sl:{touch:"Premaknite zemljevid z dvema prstoma",scroll:"Zemljevid povečate tako, da držite tipko Ctrl in vrtite kolesce na miški",scrollMac:"Uporabite ⌘ + funkcijo pomika, da povečate ali pomanjšate zemljevid"},sr:{touch:"Мапу померајте помоћу два прста",scroll:"Притисните ctrl тастер док померате да бисте зумирали мапу",scrollMac:"Притисните тастер ⌘ док померате да бисте зумирали мапу"},sv:{touch:"Använd två fingrar för att flytta kartan",scroll:"Använd ctrl + rulla för att zooma kartan",scrollMac:"Använd ⌘ + rulla för att zooma på kartan"},ta:{touch:"மேப்பை நகர்த்த இரண்டு விரல்களைப் பயன்படுத்தவும்",scroll:"மேப்பை பெரிதாக்கி/சிறிதாக்கிப் பார்க்க, ctrl பட்டனைப் பிடித்தபடி, மேலே/கீழே ஸ்க்ரால் செய்யவும்",scrollMac:"மேப்பை பெரிதாக்கி/சிறிதாக்கிப் பார்க்க, ⌘ பட்டனைப் பிடித்தபடி, மேலே/கீழே ஸ்க்ரால் செய்யவும்"},te:{touch:"మ్యాప్ని తరలించడం కోసం రెండు వేళ్లను ఉపయోగించండి",scroll:"మ్యాప్ని జూమ్ చేయడానికి ctrl బటన్ను నొక్కి ఉంచి, స్క్రోల్ చేయండి",scrollMac:"మ్యాప్ జూమ్ చేయాలంటే ⌘ + స్క్రోల్ ఉపయోగించండి"},th:{touch:"ใช้ 2 นิ้วเพื่อเลื่อนแผนที่",scroll:"กด Ctrl ค้างไว้ แล้วเลื่อนหน้าจอเพื่อซูมแผนที่",scrollMac:"กด ⌘ แล้วเลื่อนหน้าจอเพื่อซูมแผนที่"},tl:{touch:"Gumamit ng dalawang daliri upang iusog ang mapa",scroll:"Gamitin ang ctrl + scroll upang i-zoom ang mapa",scrollMac:"Gamitin ang ⌘ + scroll upang i-zoom ang mapa"},tr:{touch:"Haritada gezinmek için iki parmağınızı kullanın",scroll:"Haritayı yakınlaştırmak için ctrl + kaydırma kombinasyonunu kullanın",scrollMac:"Haritayı yakınlaştırmak için ⌘ tuşuna basıp ekranı kaydırın"},uk:{touch:"Переміщуйте карту двома пальцями",scroll:"Щоб змінювати масштаб карти, прокручуйте коліщатко миші, утримуючи клавішу Ctrl",scrollMac:"Щоб змінити масштаб карти, використовуйте ⌘ + прокручування"},vi:{touch:"Sử dụng hai ngón tay để di chuyển bản đồ",scroll:"Sử dụng ctrl + cuộn để thu phóng bản đồ",scrollMac:"Sử dụng ⌘ + cuộn để thu phóng bản đồ"},"zh-CN":{touch:"使用双指移动地图",scroll:"按住 Ctrl 并滚动鼠标滚轮才可缩放地图",scrollMac:"按住 ⌘ 并滚动鼠标滚轮才可缩放地图"},"zh-TW":{touch:"同時以兩指移動地圖",scroll:"按住 ctrl 鍵加上捲動滑鼠可以縮放地圖",scrollMac:"按 ⌘ 加上滾動捲軸可以縮放地圖"}};L.Map.mergeOptions({gestureHandlingOptions:{text:{},duration:1e3}});var i=!1,n=L.Handler.extend({addHooks:function(){this._handleTouch=this._handleTouch.bind(this),this._setupPluginOptions(),this._setLanguageContent(),this._disableInteractions(),this._map._container.addEventListener("touchstart",this._handleTouch),this._map._container.addEventListener("touchmove",this._handleTouch),this._map._container.addEventListener("touchend",this._handleTouch),this._map._container.addEventListener("touchcancel",this._handleTouch),this._map._container.addEventListener("click",this._handleTouch),L.DomEvent.on(this._map._container,"wheel",this._handleScroll,this),L.DomEvent.on(this._map,"mouseover",this._handleMouseOver,this),L.DomEvent.on(this._map,"mouseout",this._handleMouseOut,this),L.DomEvent.on(this._map,"movestart",this._handleDragging,this),L.DomEvent.on(this._map,"move",this._handleDragging,this),L.DomEvent.on(this._map,"moveend",this._handleDragging,this)},removeHooks:function(){this._enableInteractions(),this._map._container.removeEventListener("touchstart",this._handleTouch),this._map._container.removeEventListener("touchmove",this._handleTouch),this._map._container.removeEventListener("touchend",this._handleTouch),this._map._container.removeEventListener("touchcancel",this._handleTouch),this._map._container.removeEventListener("click",this._handleTouch),L.DomEvent.off(this._map._container,"wheel",this._handleScroll,this),L.DomEvent.off(this._map,"mouseover",this._handleMouseOver,this),L.DomEvent.off(this._map,"mouseout",this._handleMouseOut,this),L.DomEvent.off(this._map,"movestart",this._handleDragging,this),L.DomEvent.off(this._map,"move",this._handleDragging,this),L.DomEvent.off(this._map,"moveend",this._handleDragging,this)},_handleDragging:function(t){"movestart"==t.type||"move"==t.type?i=!0:"moveend"==t.type&&(i=!1)},_disableInteractions:function(){this._map.dragging.disable(),this._map.scrollWheelZoom.disable(),this._map.tap&&this._map.tap.disable()},_enableInteractions:function(){this._map.dragging.enable(),this._map.scrollWheelZoom.enable(),this._map.tap&&this._map.tap.enable()},_setupPluginOptions:function(){this._map.options.gestureHandlingText&&(this._map.options.gestureHandlingOptions.text=this._map.options.gestureHandlingText)},_setLanguageContent:function(){var t;if(this._map.options.gestureHandlingOptions&&this._map.options.gestureHandlingOptions.text&&this._map.options.gestureHandlingOptions.text.touch&&this._map.options.gestureHandlingOptions.text.scroll&&this._map.options.gestureHandlingOptions.text.scrollMac)t=this._map.options.gestureHandlingOptions.text;else{var i=this._getUserLanguage();i||(i="en"),e[i]&&(t=e[i]),t||-1===i.indexOf("-")||(i=i.split("-")[0],t=e[i]),t||(t=e[i="en"])}var n=!1;0<=navigator.platform.toUpperCase().indexOf("MAC")&&(n=!0);var o=t.scroll;n&&(o=t.scrollMac),this._map._container.setAttribute("data-gesture-handling-touch-content",t.touch),this._map._container.setAttribute("data-gesture-handling-scroll-content",o)},_getUserLanguage:function(){return navigator.languages?navigator.languages[0]:navigator.language||navigator.userLanguage},_handleTouch:function(t){for(var e=["leaflet-control-minimap","leaflet-interactive","leaflet-popup-content","leaflet-popup-content-wrapper","leaflet-popup-close-button","leaflet-control-zoom-in","leaflet-control-zoom-out"],i=!1,n=0;n<e.length;n++)L.DomUtil.hasClass(t.target,e[n])&&(i=!0);i?L.DomUtil.hasClass(t.target,"leaflet-interactive")&&"touchmove"===t.type&&1===t.touches.length?(L.DomUtil.addClass(this._map._container,"leaflet-gesture-handling-touch-warning"),this._disableInteractions()):L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-touch-warning"):"touchmove"===t.type||"touchstart"===t.type?1===t.touches.length?(L.DomUtil.addClass(this._map._container,"leaflet-gesture-handling-touch-warning"),this._disableInteractions()):(t.preventDefault(),this._enableInteractions(),L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-touch-warning")):L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-touch-warning")},_isScrolling:!1,_handleScroll:function(t){t.metaKey||t.ctrlKey?(t.preventDefault(),L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-scroll-warning"),this._map.scrollWheelZoom.enable()):(L.DomUtil.addClass(this._map._container,"leaflet-gesture-handling-scroll-warning"),this._map.scrollWheelZoom.disable(),clearTimeout(this._isScrolling),this._isScrolling=setTimeout((function(){for(var t=document.getElementsByClassName("leaflet-gesture-handling-scroll-warning"),e=0;e<t.length;e++)L.DomUtil.removeClass(t[e],"leaflet-gesture-handling-scroll-warning")}),this._map.options.gestureHandlingOptions.duration))},_handleMouseOver:function(t){this._enableInteractions()},_handleMouseOut:function(t){i||this._disableInteractions()}});L.Map.addInitHook("addHandler","gestureHandling",n),t.GestureHandling=n,t.default=n,Object.defineProperty(t,"__esModule",{value:!0})}(e)},395:function(t,e,i){var n,o,r;!function(s,a){o=[i(481)],void 0===(r="function"==typeof(n=s)?n.apply(e,o):n)||(t.exports=r),void 0!==a&&a.L&&(a.L.Control.MiniMap=s(L),a.L.control.minimap=function(t,e){return new a.L.Control.MiniMap(t,e)})}((function(t){var e=t.Control.extend({includes:t.Evented?t.Evented.prototype:t.Mixin.Events,options:{position:"bottomright",toggleDisplay:!1,zoomLevelOffset:-5,zoomLevelFixed:!1,centerFixed:!1,zoomAnimation:!1,autoToggleDisplay:!1,minimized:!1,width:150,height:150,collapsedWidth:19,collapsedHeight:19,aimingRectOptions:{color:"#ff7800",weight:1,clickable:!1},shadowRectOptions:{color:"#000000",weight:1,clickable:!1,opacity:0,fillOpacity:0},strings:{hideText:"Hide MiniMap",showText:"Show MiniMap"},mapOptions:{}},initialize:function(e,i){t.Util.setOptions(this,i),this.options.aimingRectOptions.clickable=!1,this.options.shadowRectOptions.clickable=!1,this._layer=e},onAdd:function(e){this._mainMap=e,this._container=t.DomUtil.create("div","leaflet-control-minimap"),this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",t.DomEvent.disableClickPropagation(this._container),t.DomEvent.on(this._container,"mousewheel",t.DomEvent.stopPropagation);var i={attributionControl:!1,dragging:!this.options.centerFixed,zoomControl:!1,zoomAnimation:this.options.zoomAnimation,autoToggleDisplay:this.options.autoToggleDisplay,touchZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),scrollWheelZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),doubleClickZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),boxZoom:!this._isZoomLevelFixed(),crs:e.options.crs};return i=t.Util.extend(this.options.mapOptions,i),this._miniMap=new t.Map(this._container,i),this._miniMap.addLayer(this._layer),this._mainMapMoving=!1,this._miniMapMoving=!1,this._userToggledDisplay=!1,this._minimized=!1,this.options.toggleDisplay&&this._addToggleButton(),this._miniMap.whenReady(t.Util.bind((function(){this._aimingRect=t.rectangle(this._mainMap.getBounds(),this.options.aimingRectOptions).addTo(this._miniMap),this._shadowRect=t.rectangle(this._mainMap.getBounds(),this.options.shadowRectOptions).addTo(this._miniMap),this._mainMap.on("moveend",this._onMainMapMoved,this),this._mainMap.on("move",this._onMainMapMoving,this),this._miniMap.on("movestart",this._onMiniMapMoveStarted,this),this._miniMap.on("move",this._onMiniMapMoving,this),this._miniMap.on("moveend",this._onMiniMapMoved,this)}),this)),this._container},addTo:function(e){t.Control.prototype.addTo.call(this,e);var i=this.options.centerFixed||this._mainMap.getCenter();return this._miniMap.setView(i,this._decideZoom(!0)),this._setDisplay(this.options.minimized),this},onRemove:function(t){this._mainMap.off("moveend",this._onMainMapMoved,this),this._mainMap.off("move",this._onMainMapMoving,this),this._miniMap.off("moveend",this._onMiniMapMoved,this),this._miniMap.removeLayer(this._layer)},changeLayer:function(t){this._miniMap.removeLayer(this._layer),this._layer=t,this._miniMap.addLayer(this._layer)},_addToggleButton:function(){this._toggleDisplayButton=this.options.toggleDisplay?this._createButton("",this._toggleButtonInitialTitleText(),"leaflet-control-minimap-toggle-display leaflet-control-minimap-toggle-display-"+this.options.position,this._container,this._toggleDisplayButtonClicked,this):void 0,this._toggleDisplayButton.style.width=this.options.collapsedWidth+"px",this._toggleDisplayButton.style.height=this.options.collapsedHeight+"px"},_toggleButtonInitialTitleText:function(){return this.options.minimized?this.options.strings.showText:this.options.strings.hideText},_createButton:function(e,i,n,o,r,s){var a=t.DomUtil.create("a",n,o);a.innerHTML=e,a.href="#",a.title=i;var l=t.DomEvent.stopPropagation;return t.DomEvent.on(a,"click",l).on(a,"mousedown",l).on(a,"dblclick",l).on(a,"click",t.DomEvent.preventDefault).on(a,"click",r,s),a},_toggleDisplayButtonClicked:function(){this._userToggledDisplay=!0,this._minimized?this._restore():this._minimize()},_setDisplay:function(t){t!==this._minimized&&(this._minimized?this._restore():this._minimize())},_minimize:function(){this.options.toggleDisplay?(this._container.style.width=this.options.collapsedWidth+"px",this._container.style.height=this.options.collapsedHeight+"px",this._toggleDisplayButton.className+=" minimized-"+this.options.position,this._toggleDisplayButton.title=this.options.strings.showText):this._container.style.display="none",this._minimized=!0,this._onToggle()},_restore:function(){this.options.toggleDisplay?(this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",this._toggleDisplayButton.className=this._toggleDisplayButton.className.replace("minimized-"+this.options.position,""),this._toggleDisplayButton.title=this.options.strings.hideText):this._container.style.display="block",this._minimized=!1,this._onToggle()},_onMainMapMoved:function(t){if(this._miniMapMoving)this._miniMapMoving=!1;else{var e=this.options.centerFixed||this._mainMap.getCenter();this._mainMapMoving=!0,this._miniMap.setView(e,this._decideZoom(!0)),this._setDisplay(this._decideMinimized())}this._aimingRect.setBounds(this._mainMap.getBounds())},_onMainMapMoving:function(t){this._aimingRect.setBounds(this._mainMap.getBounds())},_onMiniMapMoveStarted:function(t){if(!this.options.centerFixed){var e=this._aimingRect.getBounds(),i=this._miniMap.latLngToContainerPoint(e.getSouthWest()),n=this._miniMap.latLngToContainerPoint(e.getNorthEast());this._lastAimingRectPosition={sw:i,ne:n}}},_onMiniMapMoving:function(e){this.options.centerFixed||!this._mainMapMoving&&this._lastAimingRectPosition&&(this._shadowRect.setBounds(new t.LatLngBounds(this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.sw),this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.ne))),this._shadowRect.setStyle({opacity:1,fillOpacity:.3}))},_onMiniMapMoved:function(t){this._mainMapMoving?this._mainMapMoving=!1:(this._miniMapMoving=!0,this._mainMap.setView(this._miniMap.getCenter(),this._decideZoom(!1)),this._shadowRect.setStyle({opacity:0,fillOpacity:0}))},_isZoomLevelFixed:function(){var t=this.options.zoomLevelFixed;return this._isDefined(t)&&this._isInteger(t)},_decideZoom:function(t){if(this._isZoomLevelFixed())return t?this.options.zoomLevelFixed:this._mainMap.getZoom();if(t)return this._mainMap.getZoom()+this.options.zoomLevelOffset;var e,i=this._miniMap.getZoom()-this._mainMap.getZoom(),n=this._miniMap.getZoom()-this.options.zoomLevelOffset;return i>this.options.zoomLevelOffset&&this._mainMap.getZoom()<this._miniMap.getMinZoom()-this.options.zoomLevelOffset?this._miniMap.getZoom()>this._lastMiniMapZoom?(e=this._mainMap.getZoom()+1,this._miniMap.setZoom(this._miniMap.getZoom()-1)):e=this._mainMap.getZoom():e=n,this._lastMiniMapZoom=this._miniMap.getZoom(),e},_decideMinimized:function(){return this._userToggledDisplay?this._minimized:this.options.autoToggleDisplay?!!this._mainMap.getBounds().contains(this._miniMap.getBounds()):this._minimized},_isInteger:function(t){return"number"==typeof t},_isDefined:function(t){return void 0!==t},_onToggle:function(){t.Util.requestAnimFrame((function(){t.DomEvent.on(this._container,"transitionend",this._fireToggleEvents,this),t.Browser.any3d||t.Util.requestAnimFrame(this._fireToggleEvents,this)}),this)},_fireToggleEvents:function(){t.DomEvent.off(this._container,"transitionend",this._fireToggleEvents,this);var e={minimized:this._minimized};this.fire(this._minimized?"minimize":"restore",e),this.fire("toggle",e)}});return t.Map.mergeOptions({miniMapControl:!1}),t.Map.addInitHook((function(){this.options.miniMapControl&&(this.miniMapControl=(new e).addTo(this))})),e}),window)},769:function(){!function(){"use strict";var t=Symbol("newer"),e=Symbol("older"),i=function(t,e){"number"!=typeof t&&(e=t,t=0),this.size=0,this.limit=t,this.oldest=this.newest=void 0,this._keymap=new Map,e&&(this.assign(e),t<1&&(this.limit=this.size))};function n(i,n){this.key=i,this.value=n,this[t]=void 0,this[e]=void 0}function o(t){this.entry=t}function r(t){this.entry=t}function s(t){this.entry=t}i.prototype._markEntryAsUsed=function(i){i!==this.newest&&(i[t]&&(i===this.oldest&&(this.oldest=i[t]),i[t][e]=i[e]),i[e]&&(i[e][t]=i[t]),i[t]=void 0,i[e]=this.newest,this.newest&&(this.newest[t]=i),this.newest=i)},i.prototype.assign=function(i){var o,r=this.limit||Number.MAX_VALUE;this._keymap.clear();for(var s=i[Symbol.iterator](),a=s.next();!a.done;a=s.next()){var l=new n(a.value[0],a.value[1]);if(this._keymap.set(l.key,l),o?(o[t]=l,l[e]=o):this.oldest=l,o=l,0==r--)throw new Error("overflow")}this.newest=o,this.size=this._keymap.size},i.prototype.get=function(t){var e=this._keymap.get(t);if(e)return this._markEntryAsUsed(e),e.value},i.prototype.set=function(i,o){var r=this._keymap.get(i);return r?(r.value=o,this._markEntryAsUsed(r),this):(this._keymap.set(i,r=new n(i,o)),this.newest?(this.newest[t]=r,r[e]=this.newest):this.oldest=r,this.newest=r,++this.size,this.size>this.limit&&this.shift(),this)},i.prototype.shift=function(){var i=this.oldest;if(i)return this.oldest[t]?(this.oldest=this.oldest[t],this.oldest[e]=void 0):(this.oldest=void 0,this.newest=void 0),i[t]=i[e]=void 0,this._keymap.delete(i.key),--this.size,[i.key,i.value]},i.prototype.find=function(t){var e=this._keymap.get(t);return e?e.value:void 0},i.prototype.has=function(t){return this._keymap.has(t)},i.prototype.delete=function(i){var n=this._keymap.get(i);if(n)return this._keymap.delete(n.key),n[t]&&n[e]?(n[e][t]=n[t],n[t][e]=n[e]):n[t]?(n[t][e]=void 0,this.oldest=n[t]):n[e]?(n[e][t]=void 0,this.newest=n[e]):this.oldest=this.newest=void 0,this.size--,n.value},i.prototype.clear=function(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()},i.prototype.keys=function(){return new r(this.oldest)},i.prototype.values=function(){return new s(this.oldest)},i.prototype.entries=function(){return this},i.prototype[Symbol.iterator]=function(){return new o(this.oldest)},i.prototype.forEach=function(e,i){"object"!=typeof i&&(i=this);for(var n=this.oldest;n;)e.call(i,n.value,n.key,this),n=n[t]},i.prototype.toJSON=function(){for(var e=new Array(this.size),i=0,n=this.oldest;n;)e[i++]={key:n.key,value:n.value},n=n[t];return e},i.prototype.toString=function(){for(var e="",i=this.oldest;i;)e+=String(i.key)+":"+i.value,(i=i[t])&&(e+=" < ");return e},o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){var e=this.entry;return e?(this.entry=e[t],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}},r.prototype[Symbol.iterator]=function(){return this},r.prototype.next=function(){var e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.key}):{done:!0,value:void 0}},s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){var e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.value}):{done:!0,value:void 0}},L.GridLayer.GoogleMutant=L.GridLayer.extend({options:{maxZoom:21,type:"roadmap",maxNativeZoom:21},initialize:function(t){L.GridLayer.prototype.initialize.call(this,t),this._tileCallbacks={},this._lru=new i(100),this._imagesPerTile="hybrid"===this.options.type?2:1,this._boundOnMutatedImage=this._onMutatedImage.bind(this)},onAdd:function(t){var e,i,n,o,r=this;L.GridLayer.prototype.onAdd.call(this,t),this._initMutantContainer(),this._logoContainer&&t._controlCorners.bottomleft.appendChild(this._logoContainer),this._attributionContainer&&t._controlCorners.bottomright.appendChild(this._attributionContainer),e=function(){r._map&&(r._initMutant(),google.maps.event.addListenerOnce(r._mutant,"idle",(function(){r._map&&(r._checkZoomLevels(),r._mutantIsReady=!0)})))},n=0,o=null,o=setInterval((function(){if(n>=20)throw clearInterval(o),new Error("window.google not found after 10 seconds");window.google&&window.google.maps&&window.google.maps.Map&&(clearInterval(o),e.call(i)),++n}),500)},onRemove:function(t){L.GridLayer.prototype.onRemove.call(this,t),this._observer.disconnect(),t._container.removeChild(this._mutantContainer),this._logoContainer&&L.DomUtil.remove(this._logoContainer),this._attributionContainer&&L.DomUtil.remove(this._attributionContainer),this._mutant&&google.maps.event.clearListeners(this._mutant,"idle")},addGoogleLayer:function(t,e){var i=this;return this._subLayers||(this._subLayers={}),this.whenReady((function(){var n=new(0,google.maps[t])(e);n.setMap(i._mutant),i._subLayers[t]=n})),this},removeGoogleLayer:function(t){var e=this;return this.whenReady((function(){var i=e._subLayers&&e._subLayers[t];i&&(i.setMap(null),delete e._subLayers[t])})),this},_initMutantContainer:function(){this._mutantContainer||(this._mutantContainer=L.DomUtil.create("div","leaflet-google-mutant leaflet-top leaflet-left"),this._mutantContainer.id="_MutantContainer_"+L.Util.stamp(this._mutantContainer),this._mutantContainer.style.pointerEvents="none",this._mutantContainer.style.visibility="hidden",L.DomEvent.off(this._mutantContainer)),this._map.getContainer().appendChild(this._mutantContainer),this.setOpacity(this.options.opacity);var t=this._mutantContainer.style;this._map.options.zoomSnap<1?(t.width="180%",t.height="180%"):(t.width="100%",t.height="100%"),t.zIndex=-1,this._attachObserver(this._mutantContainer)},_initMutant:function(){if(!this._mutant){var t=new google.maps.Map(this._mutantContainer,{center:{lat:0,lng:0},zoom:0,tilt:0,mapTypeId:this.options.type,disableDefaultUI:!0,keyboardShortcuts:!1,draggable:!1,disableDoubleClickZoom:!0,scrollwheel:!1,styles:this.options.styles||[],backgroundColor:"transparent"});this._mutant=t,this._update(),this.fire("spawned",{mapObject:t}),this._waitControls(),this.once("controls_ready",this._setupAttribution)}},_attachObserver:function(t){this._observer||(this._observer=new MutationObserver(this._onMutations.bind(this))),this._observer.observe(t,{childList:!0,subtree:!0}),Array.prototype.forEach.call(t.querySelectorAll("img"),this._boundOnMutatedImage)},_waitControls:function(){var t=this,e=setInterval((function(){var i,n=t._mutant.__gm.layoutManager;n&&(clearInterval(e),Object.keys(n).forEach((function(t){var e=n[t];e.get&&e.get(1)instanceof Node&&(i=e)})),t.fire("controls_ready",{positions:i}))}),50)},_setupAttribution:function(t){if(this._map){var e=google.maps.ControlPosition,i=this._attributionContainer=t.positions.get(e.BOTTOM_RIGHT);L.DomUtil.addClass(i,"leaflet-control leaflet-control-attribution"),L.DomEvent.disableClickPropagation(i),i.style.height="14px",this._map._controlCorners.bottomright.appendChild(i),this._logoContainer=t.positions.get(e.BOTTOM_LEFT),this._logoContainer.style.pointerEvents="auto",this._map._controlCorners.bottomleft.appendChild(this._logoContainer)}},_onMutations:function(t){for(var e=0;e<t.length;++e)for(var i=t[e],n=0;n<i.addedNodes.length;++n){var o=i.addedNodes[n];o instanceof HTMLImageElement?this._onMutatedImage(o):o instanceof HTMLElement&&Array.prototype.forEach.call(o.querySelectorAll("img"),this._boundOnMutatedImage)}},_roadRegexp:/!1i(\d+)!2i(\d+)!3i(\d+|VinaFnapurmBegrtn)!/,_satRegexp:/x=(\d+)&y=(\d+)&z=(\d+|VinaFnapurmBegrtn)/,_onMutatedImage:function(t){var e,i=t.src.match(this._roadRegexp),n=0;if(i?(e={z:i[1],x:i[2],y:i[3]},this._imagesPerTile>1&&(t.style.zIndex=1,n=1)):((i=t.src.match(this._satRegexp))&&(e={x:i[1],y:i[2],z:i[3]}),n=0),e){var o=this._tileCoordsToKey(e);t.style.position="absolute";var r=o+"/"+n;this._lru.set(r,t),r in this._tileCallbacks&&this._tileCallbacks[r]&&(this._tileCallbacks[r].forEach((function(e){return e(t)})),delete this._tileCallbacks[r])}},createTile:function(t,e){var i=this._tileCoordsToKey(t),n=L.DomUtil.create("div");n.style.textAlign="left",n.dataset.pending=this._imagesPerTile,e=e.bind(this,null,n);for(var o=0;o<this._imagesPerTile;++o){var r=i+"/"+o,s=this._lru.get(r);s?(n.appendChild(this._clone(s)),--n.dataset.pending):(this._tileCallbacks[r]=this._tileCallbacks[r]||[],this._tileCallbacks[r].push(function(t){return function(i){t.appendChild(this._clone(i)),--t.dataset.pending,parseInt(t.dataset.pending)||e()}.bind(this)}.bind(this)(n)))}return parseInt(n.dataset.pending)||L.Util.requestAnimFrame(e),n},_clone:function(t){var e=t.cloneNode(!0);return e.style.visibility="visible",e},_checkZoomLevels:function(){var t=this._map.getZoom(),e=this._mutant.getZoom();t&&e&&(e!==t||e>this.options.maxNativeZoom)&&this._setMaxNativeZoom(e)},_setMaxNativeZoom:function(t){t!==this.options.maxNativeZoom&&(this.options.maxNativeZoom=t,this._resetView())},_update:function(t){if(this._mutant){t=t||this._map.getCenter();var e=new google.maps.LatLng(t.lat,t.lng),i=Math.round(this._map.getZoom()),n=this._mutant.getZoom();this._mutant.setCenter(e),i!==n&&(this._mutant.setZoom(i),this._mutantIsReady&&this._checkZoomLevels())}L.GridLayer.prototype._update.call(this,t)},whenReady:function(t,e){return this._mutant?t.call(e||this,{target:this}):this.on("spawned",t,e),this}}),L.gridLayer.googleMutant=function(t){return new L.GridLayer.GoogleMutant(t)}}()},245:function(t,e,i){var n,o,r; /*! Copyright (c) 2016 Dominik Moritz This file is part of the leaflet locate control. It is licensed under the MIT license. You can find the project at: https://github.com/domoritz/leaflet-locatecontrol */!function(s,a){o=[i(481)],void 0===(r="function"==typeof(n=s)?n.apply(e,o):n)||(t.exports=r),void 0!==a&&a.L&&(a.L.Control.Locate=s(L))}((function(t){const e=(e,i,n)=>{(n=n.split(" ")).forEach((function(n){t.DomUtil[e].call(this,i,n)}))},i=(t,i)=>e("addClass",t,i),n=(t,i)=>e("removeClass",t,i),o=t.Marker.extend({initialize(e,i){t.Util.setOptions(this,i),this._latlng=e,this.createIcon()},createIcon(){const e=this.options;let i="";void 0!==e.color&&(i+=`stroke:${e.color};`),void 0!==e.weight&&(i+=`stroke-width:${e.weight};`),void 0!==e.fillColor&&(i+=`fill:${e.fillColor};`),void 0!==e.fillOpacity&&(i+=`fill-opacity:${e.fillOpacity};`),void 0!==e.opacity&&(i+=`opacity:${e.opacity};`);const n=this._getIconSVG(e,i);this._locationIcon=t.divIcon({className:n.className,html:n.svg,iconSize:[n.w,n.h]}),this.setIcon(this._locationIcon)},_getIconSVG(t,e){const i=t.radius,n=i+t.weight,o=2*n;return{className:"leaflet-control-locate-location",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" version="1.1" viewBox="-${n} -${n} ${o} ${o}"><circle r="`+i+'" style="'+e+'" /></svg>',w:o,h:o}},setStyle(e){t.Util.setOptions(this,e),this.createIcon()}}),r=o.extend({initialize(e,i,n){t.Util.setOptions(this,n),this._latlng=e,this._heading=i,this.createIcon()},setHeading(t){this._heading=t},_getIconSVG(t,e){const i=t.radius,n=t.width+t.weight,o=2*(i+t.depth+t.weight),r=`M0,0 l${t.width/2},${t.depth} l-${n},0 z`;return{className:"leaflet-control-locate-heading",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${o}" version="1.1" viewBox="-${n/2} 0 ${n} ${o}" style="${`transform: rotate(${this._heading}deg)`}"><path d="`+r+'" style="'+e+'" /></svg>',w:n,h:o}}}),s=t.Control.extend({options:{position:"topleft",layer:void 0,setView:"untilPanOrZoom",keepCurrentZoomLevel:!1,initialZoomLevel:!1,getLocationBounds(t){return t.bounds},flyTo:!1,clickBehavior:{inView:"stop",outOfView:"setView",inViewNotFollowing:"inView"},returnToPrevBounds:!1,cacheLocation:!0,drawCircle:!0,drawMarker:!0,showCompass:!0,markerClass:o,compassClass:r,circleStyle:{className:"leaflet-control-locate-circle",color:"#136AEC",fillColor:"#136AEC",fillOpacity:.15,weight:0},markerStyle:{className:"leaflet-control-locate-marker",color:"#fff",fillColor:"#2A93EE",fillOpacity:1,weight:3,opacity:1,radius:9},compassStyle:{fillColor:"#2A93EE",fillOpacity:1,weight:0,color:"#fff",opacity:1,radius:9,width:9,depth:6},followCircleStyle:{},followMarkerStyle:{},followCompassStyle:{},icon:"leaflet-control-locate-location-arrow",iconLoading:"leaflet-control-locate-spinner",iconElementTag:"span",textElementTag:"small",circlePadding:[0,0],metric:!0,createButtonCallback(e,i){const n=t.DomUtil.create("a","leaflet-bar-part leaflet-bar-part-single",e);n.title=i.strings.title,n.href="#",n.setAttribute("role","button");const o=t.DomUtil.create(i.iconElementTag,i.icon,n);if(void 0!==i.strings.text){t.DomUtil.create(i.textElementTag,"leaflet-locate-text",n).textContent=i.strings.text,n.classList.add("leaflet-locate-text-active"),n.parentNode.style.display="flex",i.icon.length>0&&o.classList.add("leaflet-locate-icon")}return{link:n,icon:o}},onLocationError(t,e){alert(t.message)},onLocationOutsideMapBounds(t){t.stop(),alert(t.options.strings.outsideMapBoundsMsg)},showPopup:!0,strings:{title:"Show me where I am",metersUnit:"meters",feetUnit:"feet",popup:"You are within {distance} {unit} from this point",outsideMapBoundsMsg:"You seem located outside the boundaries of the map"},locateOptions:{maxZoom:1/0,watch:!0,setView:!1}},initialize(e){for(const i in e)"object"==typeof this.options[i]?t.extend(this.options[i],e[i]):this.options[i]=e[i];this.options.followMarkerStyle=t.extend({},this.options.markerStyle,this.options.followMarkerStyle),this.options.followCircleStyle=t.extend({},this.options.circleStyle,this.options.followCircleStyle),this.options.followCompassStyle=t.extend({},this.options.compassStyle,this.options.followCompassStyle)},onAdd(e){const i=t.DomUtil.create("div","leaflet-control-locate leaflet-bar leaflet-control");this._container=i,this._map=e,this._layer=this.options.layer||new t.LayerGroup,this._layer.addTo(e),this._event=void 0,this._compassHeading=null,this._prevBounds=null;const n=this.options.createButtonCallback(i,this.options);return this._link=n.link,this._icon=n.icon,t.DomEvent.on(this._link,"click",(function(e){t.DomEvent.stopPropagation(e),t.DomEvent.preventDefault(e),this._onClick()}),this).on(this._link,"dblclick",t.DomEvent.stopPropagation),this._resetVariables(),this._map.on("unload",this._unload,this),i},_onClick(){this._justClicked=!0;const t=this._isFollowing();if(this._userPanned=!1,this._userZoomed=!1,this._active&&!this._event)this.stop();else if(this._active){const e=this.options.clickBehavior;let i=e.outOfView;switch(this._map.getBounds().contains(this._event.latlng)&&(i=t?e.inView:e.inViewNotFollowing),e[i]&&(i=e[i]),i){case"setView":this.setView();break;case"stop":if(this.stop(),this.options.returnToPrevBounds){(this.options.flyTo?this._map.flyToBounds:this._map.fitBounds).bind(this._map)(this._prevBounds)}}}else this.options.returnToPrevBounds&&(this._prevBounds=this._map.getBounds()),this.start();this._updateContainerStyle()},start(){this._activate(),this._event&&(this._drawMarker(this._map),this.options.setView&&this.setView()),this._updateContainerStyle()},stop(){this._deactivate(),this._cleanClasses(),this._resetVariables(),this._removeMarker()},stopFollowing(){this._userPanned=!0,this._updateContainerStyle(),this._drawMarker()},_activate(){if(!this._active&&this._map&&(this._map.locate(this.options.locateOptions),this._map.fire("locateactivate",this),this._active=!0,this._map.on("locationfound",this._onLocationFound,this),this._map.on("locationerror",this._onLocationError,this),this._map.on("dragstart",this._onDrag,this),this._map.on("zoomstart",this._onZoom,this),this._map.on("zoomend",this._onZoomEnd,this),this.options.showCompass)){const e="ondeviceorientationabsolute"in window;if(e||"ondeviceorientation"in window){const i=this,n=function(){t.DomEvent.on(window,e?"deviceorientationabsolute":"deviceorientation",i._onDeviceOrientation,i)};DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((function(t){"granted"===t&&n()})):n()}}},_deactivate(){this._active&&this._map&&(this._map.stopLocate(),this._map.fire("locatedeactivate",this),this._active=!1,this.options.cacheLocation||(this._event=void 0),this._map.off("locationfound",this._onLocationFound,this),this._map.off("locationerror",this._onLocationError,this),this._map.off("dragstart",this._onDrag,this),this._map.off("zoomstart",this._onZoom,this),this._map.off("zoomend",this._onZoomEnd,this),this.options.showCompass&&(this._compassHeading=null,"ondeviceorientationabsolute"in window?t.DomEvent.off(window,"deviceorientationabsolute",this._onDeviceOrientation,this):"ondeviceorientation"in window&&t.DomEvent.off(window,"deviceorientation",this._onDeviceOrientation,this)))},setView(){if(this._drawMarker(),this._isOutsideMapBounds())this._event=void 0,this.options.onLocationOutsideMapBounds(this);else if(this._justClicked&&!1!==this.options.initialZoomLevel)(e=this.options.flyTo?this._map.flyTo:this._map.setView).bind(this._map)([this._event.latitude,this._event.longitude],this.options.initialZoomLevel);else if(this.options.keepCurrentZoomLevel){(e=this.options.flyTo?this._map.flyTo:this._map.panTo).bind(this._map)([this._event.latitude,this._event.longitude])}else{var e=this.options.flyTo?this._map.flyToBounds:this._map.fitBounds;this._ignoreEvent=!0,e.bind(this._map)(this.options.getLocationBounds(this._event),{padding:this.options.circlePadding,maxZoom:this.options.initialZoomLevel||this.options.locateOptions.maxZoom}),t.Util.requestAnimFrame((function(){this._ignoreEvent=!1}),this)}},_drawCompass(){if(!this._event)return;const t=this._event.latlng;if(this.options.showCompass&&t&&null!==this._compassHeading){const e=this._isFollowing()?this.options.followCompassStyle:this.options.compassStyle;this._compass?(this._compass.setLatLng(t),this._compass.setHeading(this._compassHeading),this._compass.setStyle&&this._compass.setStyle(e)):this._compass=new this.options.compassClass(t,this._compassHeading,e).addTo(this._layer)}!this._compass||this.options.showCompass&&null!==this._compassHeading||(this._compass.removeFrom(this._layer),this._compass=null)},_drawMarker(){void 0===this._event.accuracy&&(this._event.accuracy=0);const e=this._event.accuracy,i=this._event.latlng;if(this.options.drawCircle){const n=this._isFollowing()?this.options.followCircleStyle:this.options.circleStyle;this._circle?this._circle.setLatLng(i).setRadius(e).setStyle(n):this._circle=t.circle(i,e,n).addTo(this._layer)}let n,o;if(this.options.metric?(n=e.toFixed(0),o=this.options.strings.metersUnit):(n=(3.2808399*e).toFixed(0),o=this.options.strings.feetUnit),this.options.drawMarker){const t=this._isFollowing()?this.options.followMarkerStyle:this.options.markerStyle;this._marker?(this._marker.setLatLng(i),this._marker.setStyle&&this._marker.setStyle(t)):this._marker=new this.options.markerClass(i,t).addTo(this._layer)}this._drawCompass();const r=this.options.strings.popup;function s(){return"string"==typeof r?t.Util.template(r,{distance:n,unit:o}):"function"==typeof r?r({distance:n,unit:o}):r}this.options.showPopup&&r&&this._marker&&this._marker.bindPopup(s())._popup.setLatLng(i),this.options.showPopup&&r&&this._compass&&this._compass.bindPopup(s())._popup.setLatLng(i)},_removeMarker(){this._layer.clearLayers(),this._marker=void 0,this._circle=void 0},_unload(){this.stop(),this._map.off("unload",this._unload,this)},_setCompassHeading(e){!isNaN(parseFloat(e))&&isFinite(e)?(e=Math.round(e),this._compassHeading=e,t.Util.requestAnimFrame(this._drawCompass,this)):this._compassHeading=null},_onCompassNeedsCalibration(){this._setCompassHeading()},_onDeviceOrientation(t){this._active&&(t.webkitCompassHeading?this._setCompassHeading(t.webkitCompassHeading):t.absolute&&t.alpha&&this._setCompassHeading(360-t.alpha))},_onLocationError(t){3==t.code&&this.options.locateOptions.watch||(this.stop(),this.options.onLocationError(t,this))},_onLocationFound(t){if((!this._event||this._event.latlng.lat!==t.latlng.lat||this._event.latlng.lng!==t.latlng.lng||this._event.accuracy!==t.accuracy)&&this._active){switch(this._event=t,this._drawMarker(),this._updateContainerStyle(),this.options.setView){case"once":this._justClicked&&this.setView();break;case"untilPan":this._userPanned||this.setView();break;case"untilPanOrZoom":this._userPanned||this._userZoomed||this.setView();break;case"always":this.setView()}this._justClicked=!1}},_onDrag(){this._event&&!this._ignoreEvent&&(this._userPanned=!0,this._updateContainerStyle(),this._drawMarker())},_onZoom(){this._event&&!this._ignoreEvent&&(this._userZoomed=!0,this._updateContainerStyle(),this._drawMarker())},_onZoomEnd(){this._event&&this._drawCompass(),this._event&&!this._ignoreEvent&&this._marker&&!this._map.getBounds().pad(-.3).contains(this._marker.getLatLng())&&(this._userPanned=!0,this._updateContainerStyle(),this._drawMarker())},_isFollowing(){return!!this._active&&("always"===this.options.setView||("untilPan"===this.options.setView?!this._userPanned:"untilPanOrZoom"===this.options.setView?!this._userPanned&&!this._userZoomed:void 0))},_isOutsideMapBounds(){return void 0!==this._event&&(this._map.options.maxBounds&&!this._map.options.maxBounds.contains(this._event.latlng))},_updateContainerStyle(){this._container&&(this._active&&!this._event?this._setClasses("requesting"):this._isFollowing()?this._setClasses("following"):this._active?this._setClasses("active"):this._cleanClasses())},_setClasses(t){"requesting"==t?(n(this._container,"active following"),i(this._container,"requesting"),n(this._icon,this.options.icon),i(this._icon,this.options.iconLoading)):"active"==t?(n(this._container,"requesting following"),i(this._container,"active"),n(this._icon,this.options.iconLoading),i(this._icon,this.options.icon)):"following"==t&&(n(this._container,"requesting"),i(this._container,"active following"),n(this._icon,this.options.iconLoading),i(this._icon,this.options.icon))},_cleanClasses(){t.DomUtil.removeClass(this._container,"requesting"),t.DomUtil.removeClass(this._container,"active"),t.DomUtil.removeClass(this._container,"following"),n(this._icon,this.options.iconLoading),i(this._icon,this.options.icon)},_resetVariables(){this._active=!1,this._justClicked=!1,this._userPanned=!1,this._userZoomed=!1}});return t.control.locate=e=>new t.Control.Locate(e),s}),window)},389:function(t,e){!function(t){"use strict";var e=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(t){L.Util.setOptions(this,t),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var e=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,e?this._withAnimation:this._noAnimation),this._markerCluster=e?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(t){if(t instanceof L.LayerGroup)return this.addLayers([t]);if(!t.getLatLng)return this._nonPointGroup.addLayer(t),this.fire("layeradd",{layer:t}),this;if(!this._map)return this._needsClustering.push(t),this.fire("layeradd",{layer:t}),this;if(this.hasLayer(t))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(t,this._maxZoom),this.fire("layeradd",{layer:t}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var e=t,i=this._zoom;if(t.__parent)for(;e.__parent._zoom>=i;)e=e.__parent;return this._currentShownBounds.contains(e.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(t,e):this._animationAddLayerNonAnimated(t,e)),this},removeLayer:function(t){return t instanceof L.LayerGroup?this.removeLayers([t]):t.getLatLng?this._map?t.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(t)),this._removeLayer(t,!0),this.fire("layerremove",{layer:t}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),t.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(t)&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,t)&&this.hasLayer(t)&&this._needsRemoving.push({layer:t,latlng:t._latlng}),this.fire("layerremove",{layer:t}),this):(this._nonPointGroup.removeLayer(t),this.fire("layerremove",{layer:t}),this)},addLayers:function(t,e){if(!L.Util.isArray(t))return this.addLayer(t);var i,n=this._featureGroup,o=this._nonPointGroup,r=this.options.chunkedLoading,s=this.options.chunkInterval,a=this.options.chunkProgress,l=t.length,h=0,c=!0;if(this._map){var p=(new Date).getTime(),u=L.bind((function(){var d=(new Date).getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();h<l&&!(r&&h%200==0&&(new Date).getTime()-d>s);h++)if((i=t[h])instanceof L.LayerGroup)c&&(t=t.slice(),c=!1),this._extractNonGroupLayers(i,t),l=t.length;else if(i.getLatLng){if(!this.hasLayer(i)&&(this._addLayer(i,this._maxZoom),e||this.fire("layeradd",{layer:i}),i.__parent&&2===i.__parent.getChildCount())){var m=i.__parent.getAllChildMarkers(),f=m[0]===i?m[1]:m[0];n.removeLayer(f)}}else o.addLayer(i),e||this.fire("layeradd",{layer:i});a&&a(h,l,(new Date).getTime()-p),h===l?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(u,this.options.chunkDelay)}),this);u()}else for(var d=this._needsClustering;h<l;h++)(i=t[h])instanceof L.LayerGroup?(c&&(t=t.slice(),c=!1),this._extractNonGroupLayers(i,t),l=t.length):i.getLatLng?this.hasLayer(i)||d.push(i):o.addLayer(i);return this},removeLayers:function(t){var e,i,n=t.length,o=this._featureGroup,r=this._nonPointGroup,s=!0;if(!this._map){for(e=0;e<n;e++)(i=t[e])instanceof L.LayerGroup?(s&&(t=t.slice(),s=!1),this._extractNonGroupLayers(i,t),n=t.length):(this._arraySplice(this._needsClustering,i),r.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();var a=t.slice(),l=n;for(e=0;e<l;e++)(i=a[e])instanceof L.LayerGroup?(this._extractNonGroupLayers(i,a),l=a.length):this._unspiderfyLayer(i)}for(e=0;e<n;e++)(i=t[e])instanceof L.LayerGroup?(s&&(t=t.slice(),s=!1),this._extractNonGroupLayers(i,t),n=t.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),o.hasLayer(i)&&(o.removeLayer(i),i.clusterShow&&i.clusterShow())):(r.removeLayer(i),this.fire("layerremove",{layer:i}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer((function(t){t.off(this._childMarkerEventHandlers,this),delete t.__parent}),this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var t=new L.LatLngBounds;this._topClusterLevel&&t.extend(this._topClusterLevel._bounds);for(var e=this._needsClustering.length-1;e>=0;e--)t.extend(this._needsClustering[e].getLatLng());return t.extend(this._nonPointGroup.getBounds()),t},eachLayer:function(t,e){var i,n,o,r=this._needsClustering.slice(),s=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(r),n=r.length-1;n>=0;n--){for(i=!0,o=s.length-1;o>=0;o--)if(s[o].layer===r[n]){i=!1;break}i&&t.call(e,r[n])}this._nonPointGroup.eachLayer(t,e)},getLayers:function(){var t=[];return this.eachLayer((function(e){t.push(e)})),t},getLayer:function(t){var e=null;return t=parseInt(t,10),this.eachLayer((function(i){L.stamp(i)===t&&(e=i)})),e},hasLayer:function(t){if(!t)return!1;var e,i=this._needsClustering;for(e=i.length-1;e>=0;e--)if(i[e]===t)return!0;for(e=(i=this._needsRemoving).length-1;e>=0;e--)if(i[e].layer===t)return!1;return!(!t.__parent||t.__parent._group!==this)||this._nonPointGroup.hasLayer(t)},zoomToShowLayer:function(t,e){var i=this._map;"function"!=typeof e&&(e=function(){});var n=function(){!i.hasLayer(t)&&!i.hasLayer(t.__parent)||this._inZoomAnimation||(this._map.off("moveend",n,this),this.off("animationend",n,this),i.hasLayer(t)?e():t.__parent._icon&&(this.once("spiderfied",e,this),t.__parent.spiderfy()))};t._icon&&this._map.getBounds().contains(t.getLatLng())?e():t.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",n,this),this._map.panTo(t.getLatLng())):(this._map.on("moveend",n,this),this.on("animationend",n,this),t.__parent.zoomToBounds())},onAdd:function(t){var e,i,n;if(this._map=t,!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(t),this._nonPointGroup.addTo(t),this._gridClusters||this._generateInitialClusters(),this._maxLat=t.options.crs.projection.MAX_LATITUDE,e=0,i=this._needsRemoving.length;e<i;e++)(n=this._needsRemoving[e]).newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(e=0,i=this._needsRemoving.length;e<i;e++)n=this._needsRemoving[e],this._removeLayer(n.layer,!0),n.layer._latlng=n.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0)},onRemove:function(t){t.off("zoomend",this._zoomEnd,this),t.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(t){for(var e=t;e&&!e._icon;)e=e.__parent;return e||null},_arraySplice:function(t,e){for(var i=t.length-1;i>=0;i--)if(t[i]===e)return t.splice(i,1),!0},_removeFromGridUnclustered:function(t,e){for(var i=this._map,n=this._gridUnclustered,o=Math.floor(this._map.getMinZoom());e>=o&&n[e].removeObject(t,i.project(t.getLatLng(),e));e--);},_childMarkerDragStart:function(t){t.target.__dragStart=t.target._latlng},_childMarkerMoved:function(t){if(!this._ignoreMove&&!t.target.__dragStart){var e=t.target._popup&&t.target._popup.isOpen();this._moveChild(t.target,t.oldLatLng,t.latlng),e&&t.target.openPopup()}},_moveChild:function(t,e,i){t._latlng=e,this.removeLayer(t),t._latlng=i,this.addLayer(t)},_childMarkerDragEnd:function(t){var e=t.target.__dragStart;delete t.target.__dragStart,e&&this._moveChild(t.target,e,t.target._latlng)},_removeLayer:function(t,e,i){var n=this._gridClusters,o=this._gridUnclustered,r=this._featureGroup,s=this._map,a=Math.floor(this._map.getMinZoom());e&&this._removeFromGridUnclustered(t,this._maxZoom);var l,h=t.__parent,c=h._markers;for(this._arraySplice(c,t);h&&(h._childCount--,h._boundsNeedUpdate=!0,!(h._zoom<a));)e&&h._childCount<=1?(l=h._markers[0]===t?h._markers[1]:h._markers[0],n[h._zoom].removeObject(h,s.project(h._cLatLng,h._zoom)),o[h._zoom].addObject(l,s.project(l.getLatLng(),h._zoom)),this._arraySplice(h.__parent._childClusters,h),h.__parent._markers.push(l),l.__parent=h.__parent,h._icon&&(r.removeLayer(h),i||r.addLayer(l))):h._iconNeedsUpdate=!0,h=h.__parent;delete t.__parent},_isOrIsParent:function(t,e){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},fire:function(t,e,i){if(e&&e.layer instanceof L.MarkerCluster){if(e.originalEvent&&this._isOrIsParent(e.layer._icon,e.originalEvent.relatedTarget))return;t="cluster"+t}L.FeatureGroup.prototype.fire.call(this,t,e,i)},listens:function(t,e){return L.FeatureGroup.prototype.listens.call(this,t,e)||L.FeatureGroup.prototype.listens.call(this,"cluster"+t,e)},_defaultIconCreateFunction:function(t){var e=t.getChildCount(),i=" marker-cluster-";return i+=e<10?"small":e<100?"medium":"large",new L.DivIcon({html:"<div><span>"+e+"</span></div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var t=this._map,e=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,o=this.options.spiderfyOnEveryZoom;(e||n||o)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),t.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(t){var e=t.layer,i=e;if("clusterkeypress"!==t.type||!t.originalEvent||13===t.originalEvent.keyCode){for(;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===e._childCount&&this.options.spiderfyOnMaxZoom?e.spiderfy():this.options.zoomToBoundsOnClick&&e.zoomToBounds(),this.options.spiderfyOnEveryZoom&&e.spiderfy(),t.originalEvent&&13===t.originalEvent.keyCode&&this._map._container.focus()}},_showCoverage:function(t){var e=this._map;this._inZoomAnimation||(this._shownPolygon&&e.removeLayer(this._shownPolygon),t.layer.getChildCount()>2&&t.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(t.layer.getConvexHull(),this.options.polygonOptions),e.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom,o=this._map;(t||i||n)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),e&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),o.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var t=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),t),this._currentShownBounds=t}},_generateInitialClusters:function(){var t=Math.ceil(this._map.getMaxZoom()),e=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius,n=i;"function"!=typeof i&&(n=function(){return i}),null!==this.options.disableClusteringAtZoom&&(t=this.options.disableClusteringAtZoom-1),this._maxZoom=t,this._gridClusters={},this._gridUnclustered={};for(var o=t;o>=e;o--)this._gridClusters[o]=new L.DistanceGrid(n(o)),this._gridUnclustered[o]=new L.DistanceGrid(n(o));this._topClusterLevel=new this._markerCluster(this,e-1)},_addLayer:function(t,e){var i,n,o=this._gridClusters,r=this._gridUnclustered,s=Math.floor(this._map.getMinZoom());for(this.options.singleMarkerMode&&this._overrideMarkerIcon(t),t.on(this._childMarkerEventHandlers,this);e>=s;e--){i=this._map.project(t.getLatLng(),e);var a=o[e].getNearObject(i);if(a)return a._addChild(t),void(t.__parent=a);if(a=r[e].getNearObject(i)){var l=a.__parent;l&&this._removeLayer(a,!1);var h=new this._markerCluster(this,e,a,t);o[e].addObject(h,this._map.project(h._cLatLng,e)),a.__parent=h,t.__parent=h;var c=h;for(n=e-1;n>l._zoom;n--)c=new this._markerCluster(this,n,c),o[n].addObject(c,this._map.project(a.getLatLng(),n));return l._addChild(c),void this._removeFromGridUnclustered(a,e)}r[e].addObject(t,i)}this._topClusterLevel._addChild(t),t.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer((function(t){t instanceof L.MarkerCluster&&t._iconNeedsUpdate&&t._updateIcon()}))},_enqueue:function(t){this._queue.push(t),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var t=0;t<this._queue.length;t++)this._queue[t].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var t=Math.round(this._map._zoom);this._processQueue(),this._zoom<t&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,t)):this._zoom>t?(this._animationStart(),this._animationZoomOut(this._zoom,t)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(t){var e=this._maxLat;return void 0!==e&&(t.getNorth()>=e&&(t._northEast.lat=1/0),t.getSouth()<=-e&&(t._southWest.lat=-1/0)),t},_animationAddLayerNonAnimated:function(t,e){if(e===t)this._featureGroup.addLayer(t);else if(2===e._childCount){e._addToMap();var i=e.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else e._updateIcon()},_extractNonGroupLayers:function(t,e){var i,n=t.getLayers(),o=0;for(e=e||[];o<n.length;o++)(i=n[o])instanceof L.LayerGroup?this._extractNonGroupLayers(i,e):e.push(i);return e},_overrideMarkerIcon:function(t){return t.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[t]}})}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(t,e){this._animationAddLayerNonAnimated(t,e)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(t,e){var i,n=this._getExpandedVisibleBounds(),o=this._featureGroup,r=Math.floor(this._map.getMinZoom());this._ignoreMove=!0,this._topClusterLevel._recursively(n,t,r,(function(r){var s,a=r._latlng,l=r._markers;for(n.contains(a)||(a=null),r._isSingleParent()&&t+1===e?(o.removeLayer(r),r._recursivelyAddChildrenToMap(null,e,n)):(r.clusterHide(),r._recursivelyAddChildrenToMap(a,e,n)),i=l.length-1;i>=0;i--)s=l[i],n.contains(s._latlng)||o.removeLayer(s)})),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(n,e),o.eachLayer((function(t){t instanceof L.MarkerCluster||!t._icon||t.clusterShow()})),this._topClusterLevel._recursively(n,t,e,(function(t){t._recursivelyRestoreChildPositions(e)})),this._ignoreMove=!1,this._enqueue((function(){this._topClusterLevel._recursively(n,t,r,(function(t){o.removeLayer(t),t.clusterShow()})),this._animationEnd()}))},_animationZoomOut:function(t,e){this._animationZoomOutSingle(this._topClusterLevel,t-1,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t,this._getExpandedVisibleBounds())},_animationAddLayer:function(t,e){var i=this,n=this._featureGroup;n.addLayer(t),e!==t&&(e._childCount>2?(e._updateIcon(),this._forceLayout(),this._animationStart(),t._setPos(this._map.latLngToLayerPoint(e.getLatLng())),t.clusterHide(),this._enqueue((function(){n.removeLayer(t),t.clusterShow(),i._animationEnd()}))):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(e,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(t,e,i){var n=this._getExpandedVisibleBounds(),o=Math.floor(this._map.getMinZoom());t._recursivelyAnimateChildrenInAndAddSelfToMap(n,o,e+1,i);var r=this;this._forceLayout(),t._recursivelyBecomeVisible(n,i),this._enqueue((function(){if(1===t._childCount){var s=t._markers[0];this._ignoreMove=!0,s.setLatLng(s.getLatLng()),this._ignoreMove=!1,s.clusterShow&&s.clusterShow()}else t._recursively(n,i,o,(function(t){t._recursivelyRemoveChildrenFromMap(n,o,e+1)}));r._animationEnd()}))},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(t){return new L.MarkerClusterGroup(t)};var i=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(t,e,i,n){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this,pane:t.options.clusterPane}),this._group=t,this._zoom=e,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers:function(t,e){t=t||[];for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(t,e);for(var n=this._markers.length-1;n>=0;n--)e&&this._markers[n].__dragStart||t.push(this._markers[n]);return t},getChildCount:function(){return this._childCount},zoomToBounds:function(t){for(var e,i=this._childClusters.slice(),n=this._group._map,o=n.getBoundsZoom(this._bounds),r=this._zoom+1,s=n.getZoom();i.length>0&&o>r;){r++;var a=[];for(e=0;e<i.length;e++)a=a.concat(i[e]._childClusters);i=a}o>r?this._group._map.setView(this._latlng,r):o<=s?this._group._map.setView(this._latlng,s+1):this._group._map.fitBounds(this._bounds,t)},getBounds:function(){var t=new L.LatLngBounds;return t.extend(this._bounds),t},_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(t,e){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(t),t instanceof L.MarkerCluster?(e||(this._childClusters.push(t),t.__parent=this),this._childCount+=t._childCount):(e||this._markers.push(t),this._childCount++),this.__parent&&this.__parent._addChild(t,!0)},_setClusterCenter:function(t){this._cLatLng||(this._cLatLng=t._cLatLng||t._latlng)},_resetBounds:function(){var t=this._bounds;t._southWest&&(t._southWest.lat=1/0,t._southWest.lng=1/0),t._northEast&&(t._northEast.lat=-1/0,t._northEast.lng=-1/0)},_recalculateBounds:function(){var t,e,i,n,o=this._markers,r=this._childClusters,s=0,a=0,l=this._childCount;if(0!==l){for(this._resetBounds(),t=0;t<o.length;t++)i=o[t]._latlng,this._bounds.extend(i),s+=i.lat,a+=i.lng;for(t=0;t<r.length;t++)(e=r[t])._boundsNeedUpdate&&e._recalculateBounds(),this._bounds.extend(e._bounds),i=e._wLatLng,n=e._childCount,s+=i.lat*n,a+=i.lng*n;this._latlng=this._wLatLng=new L.LatLng(s/l,a/l),this._boundsNeedUpdate=!1}},_addToMap:function(t){t&&(this._backupLatlng=this._latlng,this.setLatLng(t)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(t,e,i){this._recursively(t,this._group._map.getMinZoom(),i-1,(function(t){var i,n,o=t._markers;for(i=o.length-1;i>=0;i--)(n=o[i])._icon&&(n._setPos(e),n.clusterHide())}),(function(t){var i,n,o=t._childClusters;for(i=o.length-1;i>=0;i--)(n=o[i])._icon&&(n._setPos(e),n.clusterHide())}))},_recursivelyAnimateChildrenInAndAddSelfToMap:function(t,e,i,n){this._recursively(t,n,e,(function(o){o._recursivelyAnimateChildrenIn(t,o._group._map.latLngToLayerPoint(o.getLatLng()).round(),i),o._isSingleParent()&&i-1===n?(o.clusterShow(),o._recursivelyRemoveChildrenFromMap(t,e,i)):o.clusterHide(),o._addToMap()}))},_recursivelyBecomeVisible:function(t,e){this._recursively(t,this._group._map.getMinZoom(),e,null,(function(t){t.clusterShow()}))},_recursivelyAddChildrenToMap:function(t,e,i){this._recursively(i,this._group._map.getMinZoom()-1,e,(function(n){if(e!==n._zoom)for(var o=n._markers.length-1;o>=0;o--){var r=n._markers[o];i.contains(r._latlng)&&(t&&(r._backupLatlng=r.getLatLng(),r.setLatLng(t),r.clusterHide&&r.clusterHide()),n._group._featureGroup.addLayer(r))}}),(function(e){e._addToMap(t)}))},_recursivelyRestoreChildPositions:function(t){for(var e=this._markers.length-1;e>=0;e--){var i=this._markers[e];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(t-1===this._zoom)for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._restorePosition();else for(var o=this._childClusters.length-1;o>=0;o--)this._childClusters[o]._recursivelyRestoreChildPositions(t)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(t,e,i,n){var o,r;this._recursively(t,e-1,i-1,(function(t){for(r=t._markers.length-1;r>=0;r--)o=t._markers[r],n&&n.contains(o._latlng)||(t._group._featureGroup.removeLayer(o),o.clusterShow&&o.clusterShow())}),(function(t){for(r=t._childClusters.length-1;r>=0;r--)o=t._childClusters[r],n&&n.contains(o._latlng)||(t._group._featureGroup.removeLayer(o),o.clusterShow&&o.clusterShow())}))},_recursively:function(t,e,i,n,o){var r,s,a=this._childClusters,l=this._zoom;if(e<=l&&(n&&n(this),o&&l===i&&o(this)),l<e||l<i)for(r=a.length-1;r>=0;r--)(s=a[r])._boundsNeedUpdate&&s._recalculateBounds(),t.intersects(s._bounds)&&s._recursively(t,e,i,n,o)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var t=this.options.opacity;return this.setOpacity(0),this.options.opacity=t,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(t){this._cellSize=t,this._sqCellSize=t*t,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(t,e){var i=this._getCoord(e.x),n=this._getCoord(e.y),o=this._grid,r=o[n]=o[n]||{},s=r[i]=r[i]||[],a=L.Util.stamp(t);this._objectPoint[a]=e,s.push(t)},updateObject:function(t,e){this.removeObject(t),this.addObject(t,e)},removeObject:function(t,e){var i,n,o=this._getCoord(e.x),r=this._getCoord(e.y),s=this._grid,a=s[r]=s[r]||{},l=a[o]=a[o]||[];for(delete this._objectPoint[L.Util.stamp(t)],i=0,n=l.length;i<n;i++)if(l[i]===t)return l.splice(i,1),1===n&&delete a[o],!0},eachObject:function(t,e){var i,n,o,r,s,a,l=this._grid;for(i in l)for(n in s=l[i])for(o=0,r=(a=s[n]).length;o<r;o++)t.call(e,a[o])&&(o--,r--)},getNearObject:function(t){var e,i,n,o,r,s,a,l,h=this._getCoord(t.x),c=this._getCoord(t.y),p=this._objectPoint,u=this._sqCellSize,d=null;for(e=c-1;e<=c+1;e++)if(o=this._grid[e])for(i=h-1;i<=h+1;i++)if(r=o[i])for(n=0,s=r.length;n<s;n++)a=r[n],((l=this._sqDist(p[L.Util.stamp(a)],t))<u||l<=u&&null===d)&&(u=l,d=a);return d},_getCoord:function(t){var e=Math.floor(t/this._cellSize);return isFinite(e)?e:t},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}},L.QuickHull={getDistant:function(t,e){var i=e[1].lat-e[0].lat;return(e[0].lng-e[1].lng)*(t.lat-e[0].lat)+i*(t.lng-e[0].lng)},findMostDistantPointFromBaseLine:function(t,e){var i,n,o,r=0,s=null,a=[];for(i=e.length-1;i>=0;i--)n=e[i],(o=this.getDistant(n,t))>0&&(a.push(n),o>r&&(r=o,s=n));return{maxPoint:s,newPoints:a}},buildConvexHull:function(t,e){var i=[],n=this.findMostDistantPointFromBaseLine(t,e);return n.maxPoint?i=(i=i.concat(this.buildConvexHull([t[0],n.maxPoint],n.newPoints))).concat(this.buildConvexHull([n.maxPoint,t[1]],n.newPoints)):[t[0]]},getConvexHull:function(t){var e,i=!1,n=!1,o=!1,r=!1,s=null,a=null,l=null,h=null,c=null,p=null;for(e=t.length-1;e>=0;e--){var u=t[e];(!1===i||u.lat>i)&&(s=u,i=u.lat),(!1===n||u.lat<n)&&(a=u,n=u.lat),(!1===o||u.lng>o)&&(l=u,o=u.lng),(!1===r||u.lng<r)&&(h=u,r=u.lng)}return n!==i?(p=a,c=s):(p=h,c=l),[].concat(this.buildConvexHull([p,c],t),this.buildConvexHull([c,p],t))}},L.MarkerCluster.include({getConvexHull:function(){var t,e,i=this.getAllChildMarkers(),n=[];for(e=i.length-1;e>=0;e--)t=i[e].getLatLng(),n.push(t);return L.QuickHull.getConvexHull(n)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var t,e=this.getAllChildMarkers(null,!0),i=this._group._map.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?t=this._group.options.spiderfyShapePositions(e.length,i):e.length>=this._circleSpiralSwitchover?t=this._generatePointsSpiral(e.length,i):(i.y+=10,t=this._generatePointsCircle(e.length,i)),this._animationSpiderfy(e,t)}},unspiderfy:function(t){this._group._inZoomAnimation||(this._animationUnspiderfy(t),this._group._spiderfied=null)},_generatePointsCircle:function(t,e){var i,n,o=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+t)/this._2PI,r=this._2PI/t,s=[];for(o=Math.max(o,35),s.length=t,i=0;i<t;i++)n=this._circleStartAngle+i*r,s[i]=new L.Point(e.x+o*Math.cos(n),e.y+o*Math.sin(n))._round();return s},_generatePointsSpiral:function(t,e){var i,n=this._group.options.spiderfyDistanceMultiplier,o=n*this._spiralLengthStart,r=n*this._spiralFootSeparation,s=n*this._spiralLengthFactor*this._2PI,a=0,l=[];for(l.length=t,i=t;i>=0;i--)i<t&&(l[i]=new L.Point(e.x+o*Math.cos(a),e.y+o*Math.sin(a))._round()),o+=s/(a+=r/o+5e-4*i);return l},_noanimationUnspiderfy:function(){var t,e,i=this._group,n=i._map,o=i._featureGroup,r=this.getAllChildMarkers(null,!0);for(i._ignoreMove=!0,this.setOpacity(1),e=r.length-1;e>=0;e--)t=r[e],o.removeLayer(t),t._preSpiderfyLatlng&&(t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng),t.setZIndexOffset&&t.setZIndexOffset(0),t._spiderLeg&&(n.removeLayer(t._spiderLeg),delete t._spiderLeg);i.fire("unspiderfied",{cluster:this,markers:r}),i._ignoreMove=!1,i._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(t,e){var i,n,o,r,s=this._group,a=s._map,l=s._featureGroup,h=this._group.options.spiderLegPolylineOptions;for(s._ignoreMove=!0,i=0;i<t.length;i++)r=a.layerPointToLatLng(e[i]),n=t[i],o=new L.Polyline([this._latlng,r],h),a.addLayer(o),n._spiderLeg=o,n._preSpiderfyLatlng=n._latlng,n.setLatLng(r),n.setZIndexOffset&&n.setZIndexOffset(1e6),l.addLayer(n);this.setOpacity(.3),s._ignoreMove=!1,s.fire("spiderfied",{cluster:this,markers:t})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(t,e){var i,n,o,r,s,a,l=this,h=this._group,c=h._map,p=h._featureGroup,u=this._latlng,d=c.latLngToLayerPoint(u),m=L.Path.SVG,f=L.extend({},this._group.options.spiderLegPolylineOptions),g=f.opacity;for(void 0===g&&(g=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),m?(f.opacity=0,f.className=(f.className||"")+" leaflet-cluster-spider-leg"):f.opacity=g,h._ignoreMove=!0,i=0;i<t.length;i++)n=t[i],a=c.layerPointToLatLng(e[i]),o=new L.Polyline([u,a],f),c.addLayer(o),n._spiderLeg=o,m&&(s=(r=o._path).getTotalLength()+.1,r.style.strokeDasharray=s,r.style.strokeDashoffset=s),n.setZIndexOffset&&n.setZIndexOffset(1e6),n.clusterHide&&n.clusterHide(),p.addLayer(n),n._setPos&&n._setPos(d);for(h._forceLayout(),h._animationStart(),i=t.length-1;i>=0;i--)a=c.layerPointToLatLng(e[i]),(n=t[i])._preSpiderfyLatlng=n._latlng,n.setLatLng(a),n.clusterShow&&n.clusterShow(),m&&((r=(o=n._spiderLeg)._path).style.strokeDashoffset=0,o.setStyle({opacity:g}));this.setOpacity(.3),h._ignoreMove=!1,setTimeout((function(){h._animationEnd(),h.fire("spiderfied",{cluster:l,markers:t})}),200)},_animationUnspiderfy:function(t){var e,i,n,o,r,s,a=this,l=this._group,h=l._map,c=l._featureGroup,p=t?h._latLngToNewLayerPoint(this._latlng,t.zoom,t.center):h.latLngToLayerPoint(this._latlng),u=this.getAllChildMarkers(null,!0),d=L.Path.SVG;for(l._ignoreMove=!0,l._animationStart(),this.setOpacity(1),i=u.length-1;i>=0;i--)(e=u[i])._preSpiderfyLatlng&&(e.closePopup(),e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng,s=!0,e._setPos&&(e._setPos(p),s=!1),e.clusterHide&&(e.clusterHide(),s=!1),s&&c.removeLayer(e),d&&(r=(o=(n=e._spiderLeg)._path).getTotalLength()+.1,o.style.strokeDashoffset=r,n.setStyle({opacity:0})));l._ignoreMove=!1,setTimeout((function(){var t=0;for(i=u.length-1;i>=0;i--)(e=u[i])._spiderLeg&&t++;for(i=u.length-1;i>=0;i--)(e=u[i])._spiderLeg&&(e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),t>1&&c.removeLayer(e),h.removeLayer(e._spiderLeg),delete e._spiderLeg);l._animationEnd(),l.fire("unspiderfied",{cluster:a,markers:u})}),200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_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.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(t){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(t))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(t){this._spiderfied&&this._spiderfied.unspiderfy(t)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(t){t._spiderLeg&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),this._map.removeLayer(t._spiderLeg),delete t._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(t){return t?t instanceof L.MarkerClusterGroup?t=t._topClusterLevel.getAllChildMarkers():t instanceof L.LayerGroup?t=t._layers:t instanceof L.MarkerCluster?t=t.getAllChildMarkers():t instanceof L.Marker&&(t=[t]):t=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(t),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(t),this},_flagParentsIconsNeedUpdate:function(t){var e,i;for(e in t)for(i=t[e].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(t){var e,i;for(e in t)i=t[e],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(t,e){var i=this.options.icon;return L.setOptions(i,t),this.setIcon(i),e&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),t.MarkerClusterGroup=e,t.MarkerCluster=i,Object.defineProperty(t,"__esModule",{value:!0})}(e)},423:function(t,e,i){var n,o,r;o=[i(481)],void 0===(r="function"==typeof(n=function(t){var e="polyline-measure-control",i="polyline-measure-unicode-icon";return t.Control.PolylineMeasure=t.Control.extend({options:{position:"topleft",unit:"metres",clearMeasurementsOnStop:!0,showBearings:!1,bearingTextIn:"In",bearingTextOut:"Out",tooltipTextFinish:"Click to <b>finish line</b><br>",tooltipTextDelete:"Press SHIFT-key and click to <b>delete point</b>",tooltipTextMove:"Click and drag to <b>move point</b><br>",tooltipTextResume:"<br>Press CTRL-key and click to <b>resume line</b>",tooltipTextAdd:"Press CTRL-key and click to <b>add point</b>",measureControlTitleOn:"Turn on PolylineMeasure",measureControlTitleOff:"Turn off PolylineMeasure",measureControlLabel:"↦",measureControlClasses:[],showClearControl:!1,clearControlTitle:"Clear Measurements",clearControlLabel:"×",clearControlClasses:[],showUnitControl:!1,distanceShowSameUnit:!1,unitControlTitle:{text:"Change Units",metres:"metres",landmiles:"land miles",nauticalmiles:"nautical miles"},unitControlLabel:{metres:"m",kilometres:"km",feet:"ft",landmiles:"mi",nauticalmiles:"nm"},tempLine:{color:"#00f",weight:2},fixedLine:{color:"#006",weight:2},startCircle:{color:"#000",weight:1,fillColor:"#0f0",fillOpacity:1,radius:3},intermedCircle:{color:"#000",weight:1,fillColor:"#ff0",fillOpacity:1,radius:3},currentCircle:{color:"#000",weight:1,fillColor:"#f0f",fillOpacity:1,radius:6},endCircle:{color:"#000",weight:1,fillColor:"#f00",fillOpacity:1,radius:3}},_arcpoints:100,_circleNr:-1,_lineNr:-1,_createControl:function(e,i,n,o,r,s){var a=document.createElement("a");return a.innerHTML=e,a.setAttribute("title",i),n.forEach((function(t){a.classList.add(t)})),t.DomEvent.on(a,"click",r,s),o.appendChild(a),a},onAdd:function(n){var o=this;n.on("movestart ",(function(){o._mapdragging=!0})),this._container=document.createElement("div"),this._container.classList.add("leaflet-bar"),t.DomEvent.disableClickPropagation(this._container);var r=this.options.measureControlTitleOn,s=this.options.measureControlLabel,a=this.options.measureControlClasses;return-1!=s.indexOf("&")&&a.push(i),this._arrPolylines=[],this._measureControl=this._createControl(s,r,a,this._container,this._toggleMeasure,this),this._defaultControlBgColor=this._measureControl.style.backgroundColor,this._measureControl.setAttribute("id",e),this.options.showClearControl&&(r=this.options.clearControlTitle,s=this.options.clearControlLabel,a=this.options.clearControlClasses,-1!=s.indexOf("&")&&a.push(i),this._clearMeasureControl=this._createControl(s,r,a,this._container,this._clearAllMeasurements,this),this._clearMeasureControl.classList.add("polyline-measure-clearControl")),this.options.showUnitControl&&("metres"==this.options.unit?(s=this.options.unitControlLabel.metres,r=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.metres+"]"):"landmiles"==this.options.unit?(s=this.options.unitControlLabel.landmiles,r=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.landmiles+"]"):(s=this.options.unitControlLabel.nauticalmiles,r=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.nauticalmiles+"]"),a=[],this._unitControl=this._createControl(s,r,a,this._container,this._changeUnit,this),this._unitControl.setAttribute("id","unitControlId")),this._container},onRemove:function(){this._measuring&&this._toggleMeasure()},_saveNonpolylineEvents:function(){this._nonpolylineTargets=this._map._targets,void 0!==this._polylineTargets?this._map._targets=this._polylineTargets:this._map._targets={}},_savePolylineEvents:function(){this._polylineTargets=this._map._targets,this._map._targets=this._nonpolylineTargets},_toggleMeasure:function(){this._measuring=!this._measuring,this._measuring?(this._mapdragging=!1,this._saveNonpolylineEvents(),this._measureControl.classList.add("polyline-measure-controlOnBgColor"),this._measureControl.style.backgroundColor=this.options.backgroundColor,this._measureControl.title=this.options.measureControlTitleOff,this._oldCursor=this._map._container.style.cursor,this._map._container.style.cursor="crosshair",this._doubleClickZoom=this._map.doubleClickZoom.enabled(),this._map.doubleClickZoom.disable(),this._layerPaint||(this._layerPaint=t.layerGroup().addTo(this._map)),this._map.on("mousemove",this._mouseMove,this),this._map.on("click",this._mouseClick,this),t.DomEvent.on(document,"keydown",this._onKeyDown,this),this._resetPathVariables()):(this._savePolylineEvents(),this._measureControl.classList.remove("polyline-measure-controlOnBgColor"),this._measureControl.style.backgroundColor=this._defaultControlBgColor,this._measureControl.title=this.options.measureControlTitleOn,this._map._container.style.cursor=this._oldCursor,this._map.off("mousemove",this._mouseMove,this),this._map.off("click",this._mouseClick,this),this._map.off("mousemove",this._resumeFirstpointMousemove,this),this._map.off("click",this._resumeFirstpointClick,this),this._map.off("mousemove",this._dragCircleMousemove,this),this._map.off("mouseup",this._dragCircleMouseup,this),t.DomEvent.off(document,"keydown",this._onKeyDown,this),this._doubleClickZoom&&this._map.doubleClickZoom.enable(),this.options.clearMeasurementsOnStop&&this._layerPaint&&this._clearAllMeasurements(),0!==this._cntCircle&&this._finishPolylinePath()),this._map.fire("polylinemeasure:toggle",{sttus:this._measuring})},_clearAllMeasurements:function(){void 0!==this._cntCircle&&0!==this._cntCircle&&this._finishPolylinePath(),this._layerPaint&&this._layerPaint.clearLayers(),this._arrPolylines=[],this._map.fire("polylinemeasure:clear")},_changeUnit:function(){"metres"==this.options.unit?(this.options.unit="landmiles",document.getElementById("unitControlId").innerHTML=this.options.unitControlLabel.landmiles,this._unitControl.title=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.landmiles+"]"):"landmiles"==this.options.unit?(this.options.unit="nauticalmiles",document.getElementById("unitControlId").innerHTML=this.options.unitControlLabel.nauticalmiles,this._unitControl.title=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.nauticalmiles+"]"):(this.options.unit="metres",document.getElementById("unitControlId").innerHTML=this.options.unitControlLabel.metres,this._unitControl.title=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.metres+"]"),this._currentLine&&this._computeDistance(this._currentLine),this._arrPolylines.map(this._computeDistance.bind(this))},_computeDistance:function(t){var e=0;t.circleCoords.map(function(i,n){if(n>=1){var o=t.circleCoords[n-1].distanceTo(t.circleCoords[n]);e+=o,this._updateTooltip(t.tooltips[n],t.tooltips[n-1],e,o,t.circleCoords[n-1],t.circleCoords[n])}}.bind(this))},_onKeyDown:function(t){if(27===t.keyCode){if(!0===this._resumeFirstpointFlag){this._resumeFirstpointFlag=!1;var e=this._lineNr;this._map.off("mousemove",this._resumeFirstpointMousemove,this),this._map.off("click",this._resumeFirstpointClick,this),this._layerPaint.removeLayer(this._rubberlinePath2),this._layerPaint.removeLayer(this._tooltipNew),this._arrPolylines[e].circleMarkers[0].setStyle(this.options.startCircle);var i="",n=0;return!0===this.options.showBearings&&(i=this.options.bearingTextIn+":---°<br>"+this.options.bearingTextOut+":---°"),i+='<div class="polyline-measure-tooltip-difference">+0</div>',i+='<div class="polyline-measure-tooltip-total">0</div>',this._arrPolylines[e].tooltips[0]._icon.innerHTML=i,this._arrPolylines[e].tooltips.map(function(t,i){if(i>=1){var o=this._arrPolylines[e].circleCoords[i-1].distanceTo(this._arrPolylines[e].circleCoords[i]),r=this._arrPolylines[e].circleCoords[i-1],s=this._arrPolylines[e].circleCoords[i];n+=o;var a=this._arrPolylines[e].tooltips[i-1];this._updateTooltip(t,a,n,o,r,s)}}.bind(this)),void this._map.on("mousemove",this._mouseMove,this)}this._currentLine?this._finishPolylinePath(t):this._toggleMeasure()}},_getDistance:function(t){var e,i=t;return"nauticalmiles"===this.options.unit?(e=this.options.unitControlLabel.nauticalmiles,i>=185200?i=(i/1852).toFixed(0):i>=18520?i=(i/1852).toFixed(1):i>=1852?i=(i/1852).toFixed(2):this.options.distanceShowSameUnit?i=(i/1852).toFixed(3):(i=(i/.3048).toFixed(0),e=this.options.unitControlLabel.feet)):"landmiles"===this.options.unit?(e=this.options.unitControlLabel.landmiles,i>=160934.4?i=(i/1609.344).toFixed(0):i>=16093.44?i=(i/1609.344).toFixed(1):i>=1609.344?i=(i/1609.344).toFixed(2):this.options.distanceShowSameUnit?i=(i/1609.344).toFixed(3):(i=(i/.3048).toFixed(0),e=this.options.unitControlLabel.feet)):(e=this.options.unitControlLabel.kilometres,i>=1e5?i=(i/1e3).toFixed(0):i>=1e4?i=(i/1e3).toFixed(1):i>=1e3?i=(i/1e3).toFixed(2):this.options.distanceShowSameUnit?i=(i/1e3).toFixed(3):(i=i.toFixed(0),e=this.options.unitControlLabel.metres)),{value:i,unit:e}},_polylineArc:function(t,e){function i(t){var e=Math.sin((1-t)*l)/Math.sin(l),i=Math.sin(t*l)/Math.sin(l),n=e*Math.cos(o)*Math.cos(r)+i*Math.cos(s)*Math.cos(a),h=e*Math.cos(o)*Math.sin(r)+i*Math.cos(s)*Math.sin(a),c=e*Math.sin(o)+i*Math.sin(s),p=180/Math.PI*Math.atan2(c,Math.sqrt(Math.pow(n,2)+Math.pow(h,2))),u=180/Math.PI*Math.atan2(h,n),d=u-180*r/Math.PI;function m(t){return Math[t>0?"floor":"ceil"](t)}return[p,u-=d<0?360*m((d-180)/360):360*m((d+180)/360)]}function n(t){for(var e=[],n=1/(t-1),o=0;o<t;o++){var r=i(n*o);e.push(r)}return e}var o=t.lat,r=t.lng,s=e.lat,a=e.lng;o=o*Math.PI/180,r=r*Math.PI/180,s=s*Math.PI/180,a=a*Math.PI/180;var l=2*Math.asin(Math.sqrt(Math.pow(Math.sin((o-s)/2),2)+Math.cos(o)*Math.cos(s)*Math.pow(Math.sin((r-a)/2),2)));return 0===l?[[o,r]]:n(this._arcpoints)},_updateTooltip:function(t,e,i,n,o,r){var s=function(t,e,i){var n=t.lat/180*Math.PI,o=e.lat/180*Math.PI,r=t.lng/180*Math.PI,s=e.lng/180*Math.PI,a=Math.sin(s-r)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(s-r);if("inbound"===i)var h=(180*Math.atan2(a,l)/Math.PI+180).toFixed(0);else h=(180*Math.atan2(a,l)/Math.PI+360).toFixed(0);return h%360},a=s(r,o,"inbound"),l=s(o,r,"outbound"),h=this._getDistance(i),c=this._getDistance(n),p="";if(c.value>0&&(!0===this.options.showBearings&&(p=this.options.bearingTextIn+": "+a+"°<br>"+this.options.bearingTextOut+":---°"),p+='<div class="polyline-measure-tooltip-difference">+'+c.value+" "+c.unit+"</div>"),p+='<div class="polyline-measure-tooltip-total">'+h.value+" "+h.unit+"</div>",t._icon.innerHTML=p,!0===this.options.showBearings&&e){var u=e._icon.innerHTML,d=new RegExp(this.options.bearingTextOut+".*°"),m=u.replace(d,this.options.bearingTextOut+": "+l+"°");e._icon.innerHTML=m}},_drawArrow:function(e){var i=Math.round(e.length/2),n=e[i-1],o=e[i],r=o[1]-n[1],s=o[0]-n[0],a=[n[0]+s/2,n[1]+r/2],l=57.29578*-Math.atan2(s,r),h=t.divIcon({className:"",iconSize:[16,16],iconAnchor:[8,8],html:"<div style = 'font-size: 16px; line-height: 16px; vertical-align:top; transform: rotate("+l+"deg)'>➤</div>"}),c=t.marker(a,{icon:h,zIndexOffset:-50}).addTo(this._layerPaint);return this._currentLine||c.bindTooltip(this.options.tooltipTextAdd,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),c.on("click",this._clickedArrow,this),c},_mouseMove:function(t){var e=t.latlng;if(this._map.on("click",this._mouseClick,this),e&&this._currentLine){var i=this._currentLine.circleCoords.last();this._rubberlinePath.setLatLngs(this._polylineArc(i,e));var n=this._currentLine.tooltips.last(),o=this._currentLine.tooltips.slice(-2,-1)[0];n.setLatLng(e);var r=e.distanceTo(i);this._updateTooltip(n,o,this._currentLine.distance+r,r,i,e)}},_startLine:function(e){var i=t.divIcon({className:"polyline-measure-tooltip",iconAnchor:[-4,-4]}),n=function(){return this.slice(-1)[0]};this._rubberlinePath=t.polyline([],{color:this.options.tempLine.color,weight:this.options.tempLine.weight,interactive:!1,dashArray:"8,8"}).addTo(this._layerPaint).bringToBack();var o=this;this._currentLine={id:0,circleCoords:[],circleMarkers:[],arrowMarkers:[],tooltips:[],distance:0,polylinePath:t.polyline([],{color:this.options.fixedLine.color,weight:this.options.fixedLine.weight,interactive:!1}).addTo(this._layerPaint).bringToBack(),handleMarkers:function(e){var i=this.circleMarkers.last();i&&(i.bindTooltip(o.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),i.off("click",o._finishPolylinePath,o),1===this.circleMarkers.length?i.setStyle(o.options.startCircle):i.setStyle(o.options.intermedCircle));var n=new t.CircleMarker(e,o.options.currentCircle).addTo(o._layerPaint);n.bindTooltip(o.options.tooltipTextFinish+o.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),n.cntLine=o._currentLine.id,n.cntCircle=o._cntCircle,o._cntCircle++,n.on("mousedown",o._dragCircle,o),n.on("click",o._finishPolylinePath,o),this.circleMarkers.push(n)},getNewToolTip:function(e){return t.marker(e,{icon:i,interactive:!1})},addPoint:function(t){var e=this.circleCoords.last();if(!e||!e.equals(t)){if(this.circleCoords.push(t),this.circleCoords.length>1){var i=o._polylineArc(e,t);this.circleCoords.length>2&&i.shift(),this.polylinePath.setLatLngs(this.polylinePath.getLatLngs().concat(i));var n=o._drawArrow(i);n.cntLine=o._currentLine.id,n.cntArrow=o._cntCircle-1,o._currentLine.arrowMarkers.push(n);var r=e.distanceTo(t);this.distance+=r;var s=o._currentLine.tooltips.last(),a=o._currentLine.tooltips.slice(-1,-2)[0];o._updateTooltip(s,a,this.distance,r,e,t)}s&&s.setLatLng(t);var l=this.getNewToolTip(t);l.addTo(o._layerPaint),this.tooltips.push(l),this.handleMarkers(t)}},finalize:function(){if(o._layerPaint.removeLayer(this.tooltips.last()),this.tooltips.pop(),o._layerPaint.removeLayer(o._rubberlinePath),this.circleCoords.length>1){this.tooltips.last()._icon.classList.add("polyline-measure-tooltip-end");var t=this.circleMarkers.last();t.setStyle(o.options.endCircle),t.unbindTooltip(),o._currentLine.circleMarkers.map((function(t){t.bindTooltip(o.options.tooltipTextMove+o.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"})})),o._currentLine.circleMarkers[0].bindTooltip(o.options.tooltipTextMove+o.options.tooltipTextDelete+o.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),t.bindTooltip(o.options.tooltipTextMove+o.options.tooltipTextDelete+o.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),o._currentLine.arrowMarkers.map((function(t){t.bindTooltip(o.options.tooltipTextAdd,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"})})),t.off("click",o._finishPolylinePath,o),t.on("click",o._resumePolylinePath,o),o._arrPolylines.push(this)}else o._layerPaint.removeLayer(this.circleMarkers.last()),o._layerPaint.removeLayer(this.tooltips.last());o._resetPathVariables()}};var r=t.marker(e,{icon:i,interactive:!1});r.addTo(this._layerPaint);var s="";!0===this.options.showBearings&&(s=this.options.bearingTextIn+":---°<br>"+this.options.bearingTextOut+":---°"),s+='<div class="polyline-measure-tooltip-difference">+0</div>',s+='<div class="polyline-measure-tooltip-total">0</div>',r._icon.innerHTML=s,this._currentLine.tooltips.push(r),this._currentLine.circleCoords.last=n,this._currentLine.tooltips.last=n,this._currentLine.circleMarkers.last=n,this._currentLine.id=this._arrPolylines.length},_mouseClick:function(t){!t.latlng||this._finishCircleScreencoords&&this._finishCircleScreencoords.equals(t.containerPoint)||(this._currentLine||this._mapdragging||(this._startLine(t.latlng),this._map.fire("polylinemeasure:start",this._currentLine)),this._mapdragging?this._mapdragging=!1:(this._currentLine.addPoint(t.latlng),this._map.fire("polylinemeasure:add",t),this._map.fire("polylinemeasure:change",this._currentLine)))},_finishPolylinePath:function(t){this._map.fire("polylinemeasure:finish",this._currentLine),this._currentLine.finalize(),t&&(this._finishCircleScreencoords=t.containerPoint)},_resumePolylinePath:function(e){if(!0===e.originalEvent.ctrlKey){this._currentLine=this._arrPolylines[e.target.cntLine],this._rubberlinePath=t.polyline([],{color:this.options.tempLine.color,weight:this.options.tempLine.weight,interactive:!1,dashArray:"8,8"}).addTo(this._layerPaint).bringToBack(),this._currentLine.tooltips.last()._icon.classList.remove("polyline-measure-tooltip-end");var i=this._currentLine.getNewToolTip(e.latlng);i.addTo(this._layerPaint),this._currentLine.tooltips.push(i),this._currentLine.circleMarkers.last().unbindTooltip(),this._currentLine.circleMarkers.last().bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._currentLine.circleMarkers.last().setStyle(this.options.currentCircle),this._cntCircle=this._currentLine.circleCoords.length,this._map.fire("polylinemeasure:resume",this._currentLine)}},_resetPathVariables:function(){this._cntCircle=0,this._currentLine=null},_clickedArrow:function(e){if(e.originalEvent.ctrlKey){var i=e.target.cntLine,n=e.target.cntArrow;this._arrPolylines[i].arrowMarkers[n].removeFrom(this._layerPaint);var o=new t.CircleMarker(e.latlng,this.options.intermedCircle).addTo(this._layerPaint);o.cntLine=i,o.on("mousedown",this._dragCircle,this),o.bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._arrPolylines[i].circleMarkers.splice(n+1,0,o),this._arrPolylines[i].circleMarkers.map((function(t,e){t.cntCircle=e})),this._arrPolylines[i].circleCoords.splice(n+1,0,e.latlng),lineCoords=this._arrPolylines[i].polylinePath.getLatLngs();var r=this._polylineArc(this._arrPolylines[i].circleCoords[n],e.latlng);r.pop();var s=this._polylineArc(e.latlng,this._arrPolylines[i].circleCoords[n+2]);Array.prototype.splice.apply(lineCoords,[n*(this._arcpoints-1),this._arcpoints].concat(r,s)),this._arrPolylines[i].polylinePath.setLatLngs(lineCoords);var a=this._drawArrow(r);this._arrPolylines[i].arrowMarkers[n]=a,a=this._drawArrow(s),this._arrPolylines[i].arrowMarkers.splice(n+1,0,a),this._arrPolylines[i].arrowMarkers.map((function(t,e){t.cntLine=i,t.cntArrow=e})),this._tooltipNew=t.marker(e.latlng,{icon:t.divIcon({className:"polyline-measure-tooltip",iconAnchor:[-4,-4]}),interactive:!1}),this._tooltipNew.addTo(this._layerPaint),this._arrPolylines[i].tooltips.splice(n+1,0,this._tooltipNew);var l=0;this._arrPolylines[i].tooltips.map(function(t,e){if(e>=1){var n=this._arrPolylines[i].circleCoords[e-1].distanceTo(this._arrPolylines[i].circleCoords[e]),o=this._arrPolylines[i].circleCoords[e-1],r=this._arrPolylines[i].circleCoords[e];l+=n;var s=this._arrPolylines[i].tooltips[e-1];this._updateTooltip(t,s,l,n,o,r)}}.bind(this)),this._map.fire("polylinemeasure:insert",e),this._map.fire("polylinemeasure:change",this._arrPolylines[this._lineNr])}},_dragCircleMouseup:function(){0===this._circleNr||this._circleNr===this._arrPolylines[this._lineNr].circleCoords.length-1?this._e1.target.bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}):this._e1.target.bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._resetPathVariables(),this._map.off("mousemove",this._dragCircleMousemove,this),this._map.dragging.enable(),this._map.on("mousemove",this._mouseMove,this),this._map.off("mouseup",this._dragCircleMouseup,this),this._map.fire("polylinemeasure:move",this._e1),this._map.fire("polylinemeasure:change",this._arrPolylines[this._lineNr])},_dragCircleMousemove:function(e){var i=e.latlng.lat,n=e.latlng.lng,o=i-this._mouseStartingLat,r=n-this._mouseStartingLng,s=t.latLng(this._circleStartingLat+o,this._circleStartingLng+r),a=this._arcpoints,l=this._e1.target.cntLine;this._lineNr=l;var h=this._e1.target.cntCircle;this._circleNr=h,this._e1.target.setLatLng(s),this._e1.target.unbindTooltip(),this._arrPolylines[l].circleCoords[h]=s;var c=this._arrPolylines[l].polylinePath.getLatLngs();if(h>=1){var p=this._polylineArc(this._arrPolylines[l].circleCoords[h-1],s);Array.prototype.splice.apply(c,[(h-1)*(a-1),a].concat(p));var u=this._drawArrow(p);u.cntLine=l,u.cntArrow=h-1,this._arrPolylines[l].arrowMarkers[h-1].removeFrom(this._layerPaint),this._arrPolylines[l].arrowMarkers[h-1]=u}if(h<this._arrPolylines[l].circleCoords.length-1){var d=this._polylineArc(s,this._arrPolylines[l].circleCoords[h+1]);Array.prototype.splice.apply(c,[h*(a-1),a].concat(d)),(u=this._drawArrow(d)).cntLine=l,u.cntArrow=h,this._arrPolylines[l].arrowMarkers[h].removeFrom(this._layerPaint),this._arrPolylines[l].arrowMarkers[h]=u}this._arrPolylines[l].polylinePath.setLatLngs(c),h>=0&&this._arrPolylines[l].tooltips[h].setLatLng(s);var m=0;this._arrPolylines[l].tooltips.map(function(t,e){if(e>=1){var i=this._arrPolylines[l].circleCoords[e-1].distanceTo(this._arrPolylines[l].circleCoords[e]),n=this._arrPolylines[l].circleCoords[e-1],o=this._arrPolylines[l].circleCoords[e];m+=i,this._arrPolylines[l].distance=m;var r=this._arrPolylines[l].tooltips[e-1];this._updateTooltip(t,r,m,i,n,o)}}.bind(this)),this._map.on("mouseup",this._dragCircleMouseup,this)},_resumeFirstpointMousemove:function(t){var e=this._lineNr;this._map.on("click",this._resumeFirstpointClick,this);var i=t.latlng;this._rubberlinePath2.setLatLngs(this._polylineArc(i,currentCircleCoords)),this._tooltipNew.setLatLng(i);var n=0,o=i.distanceTo(this._arrPolylines[e].circleCoords[0]),r=i,s=this._arrPolylines[e].circleCoords[0];n+=o;var a=this._tooltipNew,l=this._arrPolylines[e].tooltips[0];this._updateTooltip(l,a,n,o,r,s),this._arrPolylines[e].tooltips.map(function(t,i){if(i>=1){var o=this._arrPolylines[e].circleCoords[i-1].distanceTo(this._arrPolylines[e].circleCoords[i]),r=this._arrPolylines[e].circleCoords[i-1],s=this._arrPolylines[e].circleCoords[i];n+=o;var a=this._arrPolylines[e].tooltips[i-1];this._updateTooltip(t,a,n,o,r,s)}}.bind(this))},_resumeFirstpointClick:function(e){var i=this._lineNr;this._resumeFirstpointFlag=!1,this._map.off("mousemove",this._resumeFirstpointMousemove,this),this._map.off("click",this._resumeFirstpointClick,this),this._layerPaint.removeLayer(this._rubberlinePath2),this._arrPolylines[i].circleMarkers[0].setStyle(this.options.intermedCircle),this._arrPolylines[i].circleMarkers[0].unbindTooltip(),this._arrPolylines[i].circleMarkers[0].bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"});var n=new t.CircleMarker(e.latlng,this.options.startCircle).addTo(this._layerPaint);n.cntLine=i,n.cntCircle=0,n.on("mousedown",this._dragCircle,this),n.bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._arrPolylines[i].circleMarkers.unshift(n),this._arrPolylines[i].circleMarkers.map((function(t,e){t.cntCircle=e})),this._arrPolylines[i].circleCoords.unshift(e.latlng);var o=this._polylineArc(e.latlng,currentCircleCoords),r=this._drawArrow(o);this._arrPolylines[i].arrowMarkers.unshift(r),this._arrPolylines[i].arrowMarkers.map((function(t,e){t.cntLine=i,t.cntArrow=e})),o.pop(),this._arrPolylines[i].polylinePath.setLatLngs(o.concat(this._arrPolylines[i].polylinePath.getLatLngs())),this._arrPolylines[i].tooltips.unshift(this._tooltipNew),this._map.on("mousemove",this._mouseMove,this)},_dragCircle:function(e){var i=this._arcpoints;if(e.originalEvent.ctrlKey){if(this._map.off("click",this._mouseClick,this),0===e.target.cntCircle){this._resumeFirstpointFlag=!0,this._lineNr=e.target.cntLine;var n=this._lineNr;this._circleNr=e.target.cntCircle,currentCircleCoords=e.latlng,this._arrPolylines[n].circleMarkers[0].setStyle(this.options.currentCircle),this._rubberlinePath2=t.polyline([],{color:this.options.tempLine.color,weight:this.options.tempLine.weight,interactive:!1,dashArray:"8,8"}).addTo(this._layerPaint).bringToBack(),this._tooltipNew=t.marker(currentCircleCoords,{icon:t.divIcon({className:"polyline-measure-tooltip",iconAnchor:[-4,-4]}),interactive:!1}),this._tooltipNew.addTo(this._layerPaint);var o="";!0===this.options.showBearings&&(o=o+this.options.bearingTextIn+":---°<br>"+this.options.bearingTextOut+":---°"),o+='<div class="polyline-measure-tooltip-difference">+0</div>',o+='<div class="polyline-measure-tooltip-total">0</div>',this._tooltipNew._icon.innerHTML=o,this._map.off("mousemove",this._mouseMove,this),this._map.on("mousemove",this._resumeFirstpointMousemove,this)}}else{if(e.originalEvent.shiftKey){this._lineNr=e.target.cntLine,n=this._lineNr,this._circleNr=e.target.cntCircle;var r=this._circleNr;if(this._arrPolylines[n]){if(2===this._arrPolylines[n].circleMarkers.length)return this._layerPaint.removeLayer(this._arrPolylines[n].circleMarkers[1]),this._layerPaint.removeLayer(this._arrPolylines[n].tooltips[1]),this._layerPaint.removeLayer(this._arrPolylines[n].circleMarkers[0]),this._layerPaint.removeLayer(this._arrPolylines[n].tooltips[0]),this._layerPaint.removeLayer(this._arrPolylines[n].arrowMarkers[0]),this._layerPaint.removeLayer(this._arrPolylines[n].polylinePath),this._map.fire("polylinemeasure:remove",e),void this._map.fire("polylinemeasure:change",this._arrPolylines[this._lineNr]);this._arrPolylines[n].circleCoords.splice(r,1),this._arrPolylines[n].circleMarkers[r].removeFrom(this._layerPaint),this._arrPolylines[n].circleMarkers.splice(r,1),this._arrPolylines[n].circleMarkers.map((function(t,e){t.cntCircle=e}));var s=this._arrPolylines[n].polylinePath.getLatLngs();if(this._arrPolylines[n].tooltips[r].removeFrom(this._layerPaint),this._arrPolylines[n].tooltips.splice(r,1),!this._arrPolylines[n].circleMarkers.length)return this._arrPolylines.splice(n,1),void this._arrPolylines.forEach((function(t,e){t.circleMarkers.map((function(t){t.cntLine=e})),t.arrowMarkers.map((function(t){t.cntLine=e}))}));if(0===r)this._arrPolylines[n].circleMarkers[0].setStyle(this.options.startCircle),s.splice(0,i-1),this._arrPolylines[n].circleMarkers[0].bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._arrPolylines[n].arrowMarkers[r].removeFrom(this._layerPaint),this._arrPolylines[n].arrowMarkers.splice(0,1),o="",!0===this.options.showBearings&&(o=this.options.bearingTextIn+":---°<br>"+this.options.bearingTextOut+":---°"),o+='<div class="polyline-measure-tooltip-difference">+0</div>',o+='<div class="polyline-measure-tooltip-total">0</div>',this._arrPolylines[n].tooltips[0]._icon.innerHTML=o;else if(r===this._arrPolylines[n].circleCoords.length)this._arrPolylines[n].circleMarkers[r-1].on("click",this._resumePolylinePath,this),this._arrPolylines[n].circleMarkers[r-1].bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._arrPolylines[n].circleMarkers.slice(-1)[0].setStyle(this.options.endCircle),this._arrPolylines[n].tooltips.slice(-1)[0]._icon.classList.add("polyline-measure-tooltip-end"),s.splice(-(i-1),i-1),this._arrPolylines[n].arrowMarkers[r-1].removeFrom(this._layerPaint),this._arrPolylines[n].arrowMarkers.splice(-1,1);else{newLineSegment=this._polylineArc(this._arrPolylines[n].circleCoords[r-1],this._arrPolylines[n].circleCoords[r]),Array.prototype.splice.apply(s,[(r-1)*(i-1),2*i-1].concat(newLineSegment)),this._arrPolylines[n].arrowMarkers[r-1].removeFrom(this._layerPaint),this._arrPolylines[n].arrowMarkers[r].removeFrom(this._layerPaint);var a=this._drawArrow(newLineSegment);this._arrPolylines[n].arrowMarkers.splice(r-1,2,a)}this._arrPolylines[n].polylinePath.setLatLngs(s),this._arrPolylines[n].arrowMarkers.map((function(t,e){t.cntLine=n,t.cntArrow=e}));var l=0;this._arrPolylines[n].tooltips.map(function(t,e){if(e>=1){var i=this._arrPolylines[n].circleCoords[e-1].distanceTo(this._arrPolylines[n].circleCoords[e]),o=this._arrPolylines[n].circleCoords[e-1],r=this._arrPolylines[n].circleCoords[e];l+=i,this._arrPolylines[n].distance=l;var s=this._arrPolylines[n].tooltips[e-1];this._updateTooltip(t,s,l,i,o,r)}}.bind(this))}else{if(this._cntCircle--,1===this._currentLine.circleMarkers.length)return void this._currentLine.finalize();this._currentLine.circleCoords.splice(r,1),this._currentLine.circleMarkers[r].removeFrom(this._layerPaint),this._currentLine.circleMarkers.splice(r,1),this._currentLine.circleMarkers.map((function(t,e){t.cntCircle=e})),s=this._currentLine.polylinePath.getLatLngs(),this._currentLine.tooltips[r].removeFrom(this._layerPaint),this._currentLine.tooltips.splice(r,1),0===r?(1===this._currentLine.circleMarkers.length?this._currentLine.circleMarkers[0].setStyle(this.options.currentCircle):this._currentLine.circleMarkers[0].setStyle(this.options.startCircle),s.splice(0,i-1),this._currentLine.circleMarkers[0].bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._currentLine.arrowMarkers[r].removeFrom(this._layerPaint),this._currentLine.arrowMarkers.splice(0,1),o="",!0===this.options.showBearings&&(o=this.options.bearingTextIn+":---°<br>"+this.options.bearingTextOut+":---°"),o+='<div class="polyline-measure-tooltip-difference">+0</div>',o+='<div class="polyline-measure-tooltip-total">0</div>',this._currentLine.tooltips[0]._icon.innerHTML=o):r===this._currentLine.circleCoords.length?(this._currentLine.circleMarkers[r-1].on("click",this._resumePolylinePath,this),this._currentLine.circleMarkers[r-1].bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._currentLine.circleMarkers.slice(-1)[0].setStyle(this.options.currentCircle),this._currentLine.tooltips.slice(-1)[0]._icon.classList.add("polyline-measure-tooltip-end"),s.splice(-(i-1),i-1),this._currentLine.arrowMarkers[r-1].removeFrom(this._layerPaint),this._currentLine.arrowMarkers.splice(-1,1)):(newLineSegment=this._polylineArc(this._currentLine.circleCoords[r-1],this._currentLine.circleCoords[r]),Array.prototype.splice.apply(s,[(r-1)*(i-1),2*i-1].concat(newLineSegment)),this._currentLine.arrowMarkers[r-1].removeFrom(this._layerPaint),this._currentLine.arrowMarkers[r].removeFrom(this._layerPaint),a=this._drawArrow(newLineSegment),this._currentLine.arrowMarkers.splice(r-1,2,a)),this._currentLine.polylinePath.setLatLngs(s),this._currentLine.arrowMarkers.map((function(t,e){t.cntLine=n,t.cntArrow=e}));var h=0;this._currentLine.tooltips.map(function(t,i,n){if(i>=1){var o,r,s=this._currentLine.tooltips[i-1],a=this._currentLine.circleCoords[i-1];i===n.length-1?(o=this._currentLine.circleCoords[i-1].distanceTo(e.latlng),r=e.latlng,this._updateTooltip(t,s,h+o,o,a,r)):(o=this._currentLine.circleCoords[i-1].distanceTo(this._currentLine.circleCoords[i]),r=this._currentLine.circleCoords[i],h+=o,this._updateTooltip(t,s,h,o,a,r))}}.bind(this)),this._currentLine.distance=h}return this._map.fire("polylinemeasure:remove",e),void this._map.fire("polylinemeasure:change",this._arrPolylines[this._lineNr])}this._e1=e,this._measuring&&0===this._cntCircle&&(this._map.dragging.disable(),this._map.off("mousemove",this._mouseMove,this),this._map.off("click",this._mouseClick,this),this._mouseStartingLat=e.latlng.lat,this._mouseStartingLng=e.latlng.lng,this._circleStartingLat=e.target._latlng.lat,this._circleStartingLng=e.target._latlng.lng,this._map.on("mousemove",this._dragCircleMousemove,this))}},seed:function(e){e.forEach((e=>{this._toggleMeasure(),this._startLine(e[0]),e.forEach(((i,n)=>{const o=t.latLng(i);this._mouseMove({latLng:o}),this._currentLine.addPoint(o),n===e.length-1&&(this._finishPolylinePath(),this._toggleMeasure())}))}))}}),t.Map.mergeOptions({PolylineMeasureControl:!1}),t.Map.addInitHook((function(){this.options.polylineMeasureControl&&(this.PMControl=new t.Control.PolylineMeasure,this.addControl(this.PMControl))})),t.control.polylineMeasure=function(e){return new t.Control.PolylineMeasure(e)},t.Control.PolylineMeasure})?n.apply(e,o):n)||(t.exports=r)},481:function(t,e){ /* @preserve * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade */ !function(t){"use strict";var e="1.9.4";function i(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++)for(e in o=arguments[i])t[e]=o[e];return t}var n=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function o(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var r=0;function s(t){return"_leaflet_id"in t||(t._leaflet_id=++r),t._leaflet_id}function a(t,e,i){var n,o,r,s;return s=function(){n=!1,o&&(r.apply(i,o),o=!1)},r=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(s,e),n=!0)},r}function l(t,e,i){var n=e[1],o=e[0],r=n-o;return t===n&&i?t:((t-o)%r+r)%r+o}function h(){return!1}function c(t,e){if(!1===e)return t;var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function p(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function u(t){return p(t).split(/\s+/)}function d(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?n(t.options):{}),e)t.options[i]=e[i];return t.options}function m(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}var f=/\{ *([\w_ -]+) *\}/g;function g(t,e){return t.replace(f,(function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(e)),n}))}var _=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function v(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var y="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function b(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var x=0;function k(t){var e=+new Date,i=Math.max(0,16-(e-x));return x=e+i,window.setTimeout(t,i)}var w=window.requestAnimationFrame||b("RequestAnimationFrame")||k,M=window.cancelAnimationFrame||b("CancelAnimationFrame")||b("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function C(t,e,i){if(!i||w!==k)return w.call(window,o(t,e));t.call(e)}function P(t){t&&M.call(window,t)}var S={__proto__:null,extend:i,create:n,bind:o,get lastId(){return r},stamp:s,throttle:a,wrapNum:l,falseFn:h,formatNum:c,trim:p,splitWords:u,setOptions:d,getParamString:m,template:g,isArray:_,indexOf:v,emptyImageUrl:y,requestFn:w,cancelFn:M,requestAnimFrame:C,cancelAnimFrame:P};function T(){}function A(t){if("undefined"!=typeof L&&L&&L.Mixin){t=_(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}T.extend=function(t){var e=function(){d(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},o=e.__super__=this.prototype,r=n(o);for(var s in r.constructor=e,e.prototype=r,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(e[s]=this[s]);return t.statics&&i(e,t.statics),t.includes&&(A(t.includes),i.apply(null,[r].concat(t.includes))),i(r,t),delete r.statics,delete r.includes,r.options&&(r.options=o.options?n(o.options):{},i(r.options,t.options)),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){o.callInitHooks&&o.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=r._initHooks.length;t<e;t++)r._initHooks[t].call(this)}},e},T.include=function(t){var e=this.prototype.options;return i(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},T.mergeOptions=function(t){return i(this.prototype.options,t),this},T.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var D={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,r=(t=u(t)).length;o<r;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(arguments.length)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else{t=u(t);for(var o=1===arguments.length,r=0,s=t.length;r<s;r++)o?this._off(t[r]):this._off(t[r],e,i)}else delete this._events;return this},_on:function(t,e,i,n){if("function"==typeof e){if(!1===this._listens(t,e,i)){i===this&&(i=void 0);var o={fn:e,ctx:i};n&&(o.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(o)}}else console.warn("wrong listener type: "+typeof e)},_off:function(t,e,i){var n,o,r;if(this._events&&(n=this._events[t]))if(1!==arguments.length)if("function"==typeof e){var s=this._listens(t,e,i);if(!1!==s){var a=n[s];this._firingCount&&(a.fn=h,this._events[t]=n=n.slice()),n.splice(s,1)}}else console.warn("wrong listener type: "+typeof e);else{if(this._firingCount)for(o=0,r=n.length;o<r;o++)n[o].fn=h;delete this._events[t]}},fire:function(t,e,n){if(!this.listens(t,n))return this;var o=i({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var s=0,a=r.length;s<a;s++){var l=r[s],h=l.fn;l.once&&this.off(t,h,l.ctx),h.call(l.ctx||this,o)}this._firingCount--}}return n&&this._propagateEvent(o),this},listens:function(t,e,i,n){"string"!=typeof t&&console.warn('"string" type argument expected');var o=e;"function"!=typeof e&&(n=!!e,o=void 0,i=void 0);var r=this._events&&this._events[t];if(r&&r.length&&!1!==this._listens(t,o,i))return!0;if(n)for(var s in this._eventParents)if(this._eventParents[s].listens(t,e,i,n))return!0;return!1},_listens:function(t,e,i){if(!this._events)return!1;var n=this._events[t]||[];if(!e)return!!n.length;i===this&&(i=void 0);for(var o=0,r=n.length;o<r;o++)if(n[o].fn===e&&n[o].ctx===i)return o;return!1},once:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e,!0);else for(var o=0,r=(t=u(t)).length;o<r;o++)this._on(t[o],e,i,!0);return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[s(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[s(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,i({layer:t.target,propagatedFrom:t.target},t),!0)}};D.addEventListener=D.on,D.removeEventListener=D.clearAllEventListeners=D.off,D.addOneTimeEventListener=D.once,D.fireEvent=D.fire,D.hasEventListeners=D.listens;var E=T.extend(D);function O(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var I=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function B(t,e,i){return t instanceof O?t:_(t)?new O(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new O(t.x,t.y):new O(t,e,i)}function R(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function z(t,e){return!t||t instanceof R?t:new R(t,e)}function F(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function j(t,e){return t instanceof F?t:new F(t,e)}function N(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function U(t,e,i){return t instanceof N?t:_(t)&&"object"!=typeof t[0]?3===t.length?new N(t[0],t[1],t[2]):2===t.length?new N(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new N(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new N(t,e,i)}O.prototype={clone:function(){return new O(this.x,this.y)},add:function(t){return this.clone()._add(B(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(B(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new O(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new O(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=I(this.x),this.y=I(this.y),this},distanceTo:function(t){var e=(t=B(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=B(t)).x===this.x&&t.y===this.y},contains:function(t){return t=B(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+c(this.x)+", "+c(this.y)+")"}},R.prototype={extend:function(t){var e,i;if(!t)return this;if(t instanceof O||"number"==typeof t[0]||"x"in t)e=i=B(t);else if(e=(t=z(t)).min,i=t.max,!e||!i)return this;return this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(i.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(i.y,this.max.y)):(this.min=e.clone(),this.max=i.clone()),this},getCenter:function(t){return B((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return B(this.min.x,this.max.y)},getTopRight:function(){return B(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof O?B(t):z(t))instanceof R?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=z(t);var e=this.min,i=this.max,n=t.min,o=t.max,r=o.x>=e.x&&n.x<=i.x,s=o.y>=e.y&&n.y<=i.y;return r&&s},overlaps:function(t){t=z(t);var e=this.min,i=this.max,n=t.min,o=t.max,r=o.x>e.x&&n.x<i.x,s=o.y>e.y&&n.y<i.y;return r&&s},isValid:function(){return!(!this.min||!this.max)},pad:function(t){var e=this.min,i=this.max,n=Math.abs(e.x-i.x)*t,o=Math.abs(e.y-i.y)*t;return z(B(e.x-n,e.y-o),B(i.x+n,i.y+o))},equals:function(t){return!!t&&(t=z(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight()))}},F.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof N)e=t,i=t;else{if(!(t instanceof F))return t?this.extend(U(t)||j(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new N(e.lat,e.lng),this._northEast=new N(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new F(new N(e.lat-n,e.lng-o),new N(i.lat+n,i.lng+o))},getCenter:function(){return new N((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 N(this.getNorth(),this.getWest())},getSouthEast:function(){return new N(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof N||"lat"in t?U(t):j(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof F?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=j(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>=e.lat&&n.lat<=i.lat,s=o.lng>=e.lng&&n.lng<=i.lng;return r&&s},overlaps:function(t){t=j(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>e.lat&&n.lat<i.lat,s=o.lng>e.lng&&n.lng<i.lng;return r&&s},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=j(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},N.prototype={equals:function(t,e){return!!t&&(t=U(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+c(this.lat,t)+", "+c(this.lng,t)+")"},distanceTo:function(t){return Z.distance(this,U(t))},wrap:function(){return Z.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return j([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new N(this.lat,this.lng,this.alt)}};var G,H={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new R(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?l(t.lng,this.wrapLng,!0):t.lng;return new N(this.wrapLat?l(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,o=e.lng-i.lng;if(0===n&&0===o)return t;var r=t.getSouthWest(),s=t.getNorthEast();return new F(new N(r.lat-n,r.lng-o),new N(s.lat-n,s.lng-o))}},Z=i({},H,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,r=Math.sin((e.lat-t.lat)*i/2),s=Math.sin((e.lng-t.lng)*i/2),a=r*r+Math.cos(n)*Math.cos(o)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),V=6378137,W={R:V,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=Math.sin(n*e);return new O(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new N((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(G=V*Math.PI,new R([-G,-G],[G,G]))};function q(t,e,i,n){if(_(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=n}function $(t,e,i,n){return new q(t,e,i,n)}q.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new O((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=i({},Z,{code:"EPSG:3857",projection:W,transformation:function(){var t=.5/(Math.PI*W.R);return $(t,.5,-t,.5)}()}),Y=i({},K,{code:"EPSG:900913"});function J(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function X(t,e){var i,n,o,r,s,a,l="";for(i=0,o=t.length;i<o;i++){for(n=0,r=(s=t[i]).length;n<r;n++)l+=(n?"L":"M")+(a=s[n]).x+" "+a.y;l+=e?Ft.svg?"z":"x":""}return l||"M0 0"}var Q,tt=document.documentElement.style,et="ActiveXObject"in window,it=et&&!document.addEventListener,nt="msLaunchUri"in navigator&&!("documentMode"in document),ot=zt("webkit"),rt=zt("android"),st=zt("android 2")||zt("android 3"),at=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),lt=rt&&zt("Google")&&at<537&&!("AudioNode"in window),ht=!!window.opera,ct=!nt&&zt("chrome"),pt=zt("gecko")&&!ot&&!ht&&!et,ut=!ct&&zt("safari"),dt=zt("phantom"),mt="OTransition"in tt,ft=0===navigator.platform.indexOf("Win"),gt=et&&"transition"in tt,_t="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!st,vt="MozPerspective"in tt,yt=!window.L_DISABLE_3D&&(gt||_t||vt)&&!mt&&!dt,bt="undefined"!=typeof orientation||zt("mobile"),xt=bt&&ot,kt=bt&&_t,Lt=!window.PointerEvent&&window.MSPointerEvent,wt=!(!window.PointerEvent&&!Lt),Mt="ontouchstart"in window||!!window.TouchEvent,Ct=!window.L_NO_TOUCH&&(Mt||wt),Pt=bt&&ht,St=bt&&pt,Tt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,At=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",h,e),window.removeEventListener("testPassiveEventSupport",h,e)}catch(t){}return t}(),Dt=!!document.createElement("canvas").getContext,Et=!(!document.createElementNS||!J("svg").createSVGRect),Ot=!!Et&&((Q=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===(Q.firstChild&&Q.firstChild.namespaceURI)),It=!Et&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),Bt=0===navigator.platform.indexOf("Mac"),Rt=0===navigator.platform.indexOf("Linux");function zt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Ft={ie:et,ielt9:it,edge:nt,webkit:ot,android:rt,android23:st,androidStock:lt,opera:ht,chrome:ct,gecko:pt,safari:ut,phantom:dt,opera12:mt,win:ft,ie3d:gt,webkit3d:_t,gecko3d:vt,any3d:yt,mobile:bt,mobileWebkit:xt,mobileWebkit3d:kt,msPointer:Lt,pointer:wt,touch:Ct,touchNative:Mt,mobileOpera:Pt,mobileGecko:St,retina:Tt,passiveEvents:At,canvas:Dt,svg:Et,vml:It,inlineSvg:Ot,mac:Bt,linux:Rt},jt=Ft.msPointer?"MSPointerDown":"pointerdown",Nt=Ft.msPointer?"MSPointerMove":"pointermove",Ut=Ft.msPointer?"MSPointerUp":"pointerup",Gt=Ft.msPointer?"MSPointerCancel":"pointercancel",Ht={touchstart:jt,touchmove:Nt,touchend:Ut,touchcancel:Gt},Zt={touchstart:te,touchmove:Qt,touchend:Qt,touchcancel:Qt},Vt={},Wt=!1;function qt(t,e,i){return"touchstart"===e&&Xt(),Zt[e]?(i=Zt[e].bind(this,i),t.addEventListener(Ht[e],i,!1),i):(console.warn("wrong event specified:",e),h)}function $t(t,e,i){Ht[e]?t.removeEventListener(Ht[e],i,!1):console.warn("wrong event specified:",e)}function Kt(t){Vt[t.pointerId]=t}function Yt(t){Vt[t.pointerId]&&(Vt[t.pointerId]=t)}function Jt(t){delete Vt[t.pointerId]}function Xt(){Wt||(document.addEventListener(jt,Kt,!0),document.addEventListener(Nt,Yt,!0),document.addEventListener(Ut,Jt,!0),document.addEventListener(Gt,Jt,!0),Wt=!0)}function Qt(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],Vt)e.touches.push(Vt[i]);e.changedTouches=[e],t(e)}}function te(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&Ke(e),Qt(t,e)}function ee(t){var e,i,n={};for(i in t)e=t[i],n[i]=e&&e.bind?e.bind(t):e;return t=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var ie=200;function ne(t,e){t.addEventListener("dblclick",e);var i,n=0;function o(t){if(1===t.detail){if("mouse"!==t.pointerType&&(!t.sourceCapabilities||t.sourceCapabilities.firesTouchEvents)){var o=Je(t);if(!o.some((function(t){return t instanceof HTMLLabelElement&&t.attributes.for}))||o.some((function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement}))){var r=Date.now();r-n<=ie?2==++i&&e(ee(t)):i=1,n=r}}}else i=t.detail}return t.addEventListener("click",o),{dblclick:e,simDblclick:o}}function oe(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var re,se,ae,le,he,ce=Pe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),pe=Pe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ue="webkitTransition"===pe||"OTransition"===pe?pe+"End":"transitionend";function de(t){return"string"==typeof t?document.getElementById(t):t}function me(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function fe(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function ge(t){var e=t.parentNode;e&&e.removeChild(t)}function _e(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ve(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ye(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function be(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=we(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function xe(t,e){if(void 0!==t.classList)for(var i=u(e),n=0,o=i.length;n<o;n++)t.classList.add(i[n]);else if(!be(t,e)){var r=we(t);Le(t,(r?r+" ":"")+e)}}function ke(t,e){void 0!==t.classList?t.classList.remove(e):Le(t,p((" "+we(t)+" ").replace(" "+e+" "," ")))}function Le(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function we(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function Me(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&Ce(t,e)}function Ce(t,e){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}function Pe(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Se(t,e,i){var n=e||new O(0,0);t.style[ce]=(Ft.ie3d?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function Te(t,e){t._leaflet_pos=e,Ft.any3d?Se(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Ae(t){return t._leaflet_pos||new O(0,0)}if("onselectstart"in document)re=function(){je(window,"selectstart",Ke)},se=function(){Ue(window,"selectstart",Ke)};else{var De=Pe(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);re=function(){if(De){var t=document.documentElement.style;ae=t[De],t[De]="none"}},se=function(){De&&(document.documentElement.style[De]=ae,ae=void 0)}}function Ee(){je(window,"dragstart",Ke)}function Oe(){Ue(window,"dragstart",Ke)}function Ie(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Be(),le=t,he=t.style.outlineStyle,t.style.outlineStyle="none",je(window,"keydown",Be))}function Be(){le&&(le.style.outlineStyle=he,le=void 0,he=void 0,Ue(window,"keydown",Be))}function Re(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function ze(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Fe={__proto__:null,TRANSFORM:ce,TRANSITION:pe,TRANSITION_END:ue,get:de,getStyle:me,create:fe,remove:ge,empty:_e,toFront:ve,toBack:ye,hasClass:be,addClass:xe,removeClass:ke,setClass:Le,getClass:we,setOpacity:Me,testProp:Pe,setTransform:Se,setPosition:Te,getPosition:Ae,get disableTextSelection(){return re},get enableTextSelection(){return se},disableImageDrag:Ee,enableImageDrag:Oe,preventOutline:Ie,restoreOutline:Be,getSizedParentNode:Re,getScale:ze};function je(t,e,i,n){if(e&&"object"==typeof e)for(var o in e)Ze(t,o,e[o],i);else for(var r=0,s=(e=u(e)).length;r<s;r++)Ze(t,e[r],i,n);return this}var Ne="_leaflet_events";function Ue(t,e,i,n){if(1===arguments.length)Ge(t),delete t[Ne];else if(e&&"object"==typeof e)for(var o in e)Ve(t,o,e[o],i);else if(e=u(e),2===arguments.length)Ge(t,(function(t){return-1!==v(e,t)}));else for(var r=0,s=e.length;r<s;r++)Ve(t,e[r],i,n);return this}function Ge(t,e){for(var i in t[Ne]){var n=i.split(/\d/)[0];e&&!e(n)||Ve(t,n,null,null,i)}}var He={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ze(t,e,i,n){var o=e+s(i)+(n?"_"+s(n):"");if(t[Ne]&&t[Ne][o])return this;var r=function(e){return i.call(n||t,e||window.event)},a=r;!Ft.touchNative&&Ft.pointer&&0===e.indexOf("touch")?r=qt(t,e,r):Ft.touch&&"dblclick"===e?r=ne(t,r):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(He[e]||e,r,!!Ft.passiveEvents&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?(r=function(e){e=e||window.event,ei(t,e)&&a(e)},t.addEventListener(He[e],r,!1)):t.addEventListener(e,a,!1):t.attachEvent("on"+e,r),t[Ne]=t[Ne]||{},t[Ne][o]=r}function Ve(t,e,i,n,o){o=o||e+s(i)+(n?"_"+s(n):"");var r=t[Ne]&&t[Ne][o];if(!r)return this;!Ft.touchNative&&Ft.pointer&&0===e.indexOf("touch")?$t(t,e,r):Ft.touch&&"dblclick"===e?oe(t,r):"removeEventListener"in t?t.removeEventListener(He[e]||e,r,!1):t.detachEvent("on"+e,r),t[Ne][o]=null}function We(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function qe(t){return Ze(t,"wheel",We),this}function $e(t){return je(t,"mousedown touchstart dblclick contextmenu",We),t._leaflet_disable_click=!0,this}function Ke(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ye(t){return Ke(t),We(t),this}function Je(t){if(t.composedPath)return t.composedPath();for(var e=[],i=t.target;i;)e.push(i),i=i.parentNode;return e}function Xe(t,e){if(!e)return new O(t.clientX,t.clientY);var i=ze(e),n=i.boundingClientRect;return new O((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var Qe=Ft.linux&&Ft.chrome?window.devicePixelRatio:Ft.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function ti(t){return Ft.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Qe:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function ei(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}var ii={__proto__:null,on:je,off:Ue,stopPropagation:We,disableScrollPropagation:qe,disableClickPropagation:$e,preventDefault:Ke,stop:Ye,getPropagationPath:Je,getMousePosition:Xe,getWheelDelta:ti,isExternalTarget:ei,addListener:je,removeListener:Ue},ni=E.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Ae(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=C(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Te(this._el,i),this.fire("step")},_complete:function(){P(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),oi=E.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=d(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=o(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(U(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=pe&&Ft.any3d&&!Ft.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),je(this._proxy,ue,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,n){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(U(t),e,this.options.maxBounds),n=n||{},this._stop(),this._loaded&&!n.reset&&!0!==n&&(void 0!==n.animate&&(n.zoom=i({animate:n.animate},n.zoom),n.pan=i({animate:n.animate,duration:n.duration},n.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e,n.pan&&n.pan.noMoveStart),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(Ft.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(Ft.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),r=(t instanceof O?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),s=this.containerPointToLatLng(o.add(r));return this.setView(s,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():j(t);var i=B(e.paddingTopLeft||e.padding||[0,0]),n=B(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var r=n.subtract(i).divideBy(2),s=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o);return{center:this.unproject(s.add(a).divideBy(2).add(r),o),zoom:o}},fitBounds:function(t,e){if(!(t=j(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=B(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ni,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){xe(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!Ft.any3d)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),o=this.project(t),r=this.getSize(),s=this._zoom;t=U(t),e=void 0===e?s:e;var a=Math.max(r.x,r.y),l=a*this.getZoomScale(s,e),h=o.distanceTo(n)||1,c=1.42,p=c*c;function u(t){var e=(l*l-a*a+(t?-1:1)*p*p*h*h)/(2*(t?l:a)*p*h),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function d(t){return(Math.exp(t)-Math.exp(-t))/2}function m(t){return(Math.exp(t)+Math.exp(-t))/2}function f(t){return d(t)/m(t)}var g=u(0);function _(t){return a*(m(g)/m(g+c*t))}function v(t){return a*(m(g)*f(g+c*t)-d(g))/p}function y(t){return 1-Math.pow(1-t,1.5)}var b=Date.now(),x=(u(1)-g)/c,k=i.duration?1e3*i.duration:1e3*x*.8;function L(){var i=(Date.now()-b)/k,r=y(i)*x;i<=1?(this._flyToFrame=C(L,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(v(r)/h)),s),this.getScaleZoom(a/_(r),s),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),L.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return t=j(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,j(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=B((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=B(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),r=this.project(t),s=this.getPixelBounds(),a=z([s.min.add(i),s.max.subtract(n)]),l=a.getSize();if(!a.contains(r)){this._enforcingBounds=!0;var h=r.subtract(a.getCenter()),c=a.extend(r).getSize().subtract(l);o.x+=h.x<0?-c.x:c.x,o.y+=h.y<0?-c.y:c.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),r=e.divideBy(2).round(),s=n.divideBy(2).round(),a=r.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:n})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o(this._handleGeolocationResponse,this),n=o(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,n,t):navigator.geolocation.getCurrentPosition(e,n,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new N(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var r={latlng:e,bounds:i,timestamp:t.timestamp};for(var s in t.coords)"number"==typeof t.coords[s]&&(r[s]=t.coords[s]);this.fire("locationfound",r)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ge(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(P(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ge(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=fe("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new F(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=j(t),i=B(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),r=this.getMaxZoom(),s=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=z(this.project(a,n),this.project(s,n)).getSize(),c=Ft.any3d?this.options.zoomSnap:1,p=l.x/h.x,u=l.y/h.y,d=e?Math.max(p,u):Math.min(p,u);return n=this.getScaleZoom(d,n),c&&(n=Math.round(n/(c/100))*(c/100),n=e?Math.ceil(n/c)*c:Math.floor(n/c)*c),Math.max(o,Math.min(r,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new O(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new R(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(U(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(B(t),e)},layerPointToLatLng:function(t){var e=B(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(U(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(U(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(j(t))},distance:function(t,e){return this.options.crs.distance(U(t),U(e))},containerPointToLayerPoint:function(t){return B(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return B(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(B(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(U(t)))},mouseEventToContainerPoint:function(t){return Xe(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=de(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");je(e,"scroll",this._onScroll,this),this._containerId=s(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ft.any3d,xe(t,"leaflet-container"+(Ft.touch?" leaflet-touch":"")+(Ft.retina?" leaflet-retina":"")+(Ft.ielt9?" leaflet-oldie":"")+(Ft.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=me(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Te(this._mapPane,new O(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(xe(t.markerPane,"leaflet-zoom-hide"),xe(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){Te(this._mapPane,new O(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return P(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Te(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[s(this._container)]=this;var e=t?Ue:je;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Ft.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){P(this._resizeRequest),this._resizeRequest=C((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,r=t.target||t.srcElement,a=!1;r;){if((i=this._targets[s(r)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(o&&!ei(r,t))break;if(n.push(i),o)break}if(r===this._container)break;r=r.parentNode}return n.length||a||o||!this.listens(e,!0)||(n=[this]),n},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var i=t.type;"mousedown"===i&&Ie(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,n){if("click"===t.type){var o=i({},t);o.type="preclick",this._fireDOMEvent(o,o.type,n)}var r=this._findEventTargets(t,e);if(n){for(var s=[],a=0;a<n.length;a++)n[a].listens(e,!0)&&s.push(n[a]);r=s.concat(r)}if(r.length){"contextmenu"===e&&Ke(t);var l=r[0],h={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var c=l.getLatLng&&(!l._radius||l._radius<=10);h.containerPoint=c?this.latLngToContainerPoint(l.getLatLng()):this.mouseEventToContainerPoint(t),h.layerPoint=this.containerPointToLayerPoint(h.containerPoint),h.latlng=c?l.getLatLng():this.layerPointToLatLng(h.layerPoint)}for(a=0;a<r.length;a++)if(r[a].fire(e,h,!0),h.originalEvent._stopped||!1===r[a].options.bubblingMouseEvents&&-1!==v(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Ae(this._mapPane)||new O(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return z([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),o=this.getSize().divideBy(2),r=new R(n.subtract(o),n.add(o)),s=this._getBoundsOffset(r,i,e);return Math.abs(s.x)<=1&&Math.abs(s.y)<=1?t:this.unproject(n.add(s),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new R(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=z(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),r=n.max.subtract(t.max);return new O(this._rebound(o.x,-r.x),this._rebound(o.y,-r.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=Ft.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ke(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=fe("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=ce,i=this._proxy.style[e];Se(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ge(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Se(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(C((function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,xe(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ke(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function ri(t,e){return new oi(t,e)}var si=T.extend({options:{position:"topright"},initialize:function(t){d(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return xe(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ge(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ai=function(t){return new si(t)};oi.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=fe("div",e+"control-container",this._container);function n(n,o){var r=e+n+" "+e+o;t[n+o]=fe("div",r,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ge(this._controlCorners[t]);ge(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var li=si.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in d(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return si.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(s(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){xe(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(xe(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ke(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ke(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=fe("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),$e(e),qe(e);var n=this._section=fe("section",t+"-list");i&&(this._map.on("click",this.collapse,this),je(e,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var o=this._layersLink=fe("a",t+"-toggle",e);o.href="#",o.title="Layers",o.setAttribute("role","button"),je(o,{keydown:function(t){13===t.keyCode&&this._expandSafely()},click:function(t){Ke(t),this._expandSafely()}},this),i||this.expand(),this._baseLayersList=fe("div",t+"-base",n),this._separator=fe("div",t+"-separator",n),this._overlaysList=fe("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&s(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(o((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;_e(this._baseLayersList),_e(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,o=0;for(i=0;i<this._layers.length;i++)n=this._layers[i],this._addItem(n),e=e||n.overlay,t=t||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&o>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(s(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+s(this),n),this._layerControlInputs.push(e),e.layerId=s(t.layer),je(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var r=document.createElement("span");return i.appendChild(r),r.appendChild(e),r.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var r=i.length-1;r>=0;r--)t=i[r],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(r=0;r<o.length;r++)this._map.hasLayer(o[r])&&this._map.removeLayer(o[r]);for(r=0;r<n.length;r++)this._map.hasLayer(n[r])||this._map.addLayer(n[r]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;o>=0;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,je(t,"click",Ke),this.expand();var e=this;setTimeout((function(){Ue(t,"click",Ke),e._preventClick=!1}))}}),hi=function(t,e,i){return new li(t,e,i)},ci=si.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=fe("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var r=fe("a",i,n);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),$e(r),je(r,"click",Ye),je(r,"click",o,this),je(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ke(this._zoomInButton,e),ke(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(xe(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(xe(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});oi.mergeOptions({zoomControl:!0}),oi.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new ci,this.addControl(this.zoomControl))}));var pi=function(t){return new ci(t)},ui=si.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=fe("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=fe("div",e,i)),t.imperial&&(this._iScale=fe("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(e=o/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),di=function(t){return new ui(t)},mi='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',fi=si.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Ft.inlineSvg?mi+" ":"")+"Leaflet</a>"},initialize:function(t){d(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=fe("div","leaflet-control-attribution"),$e(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",(function(){this.removeAttribution(t.layer.getAttribution())}),this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' <span aria-hidden="true">|</span> ')}}});oi.mergeOptions({attributionControl:!0}),oi.addInitHook((function(){this.options.attributionControl&&(new fi).addTo(this)}));var gi=function(t){return new fi(t)};si.Layers=li,si.Zoom=ci,si.Scale=ui,si.Attribution=fi,ai.layers=hi,ai.zoom=pi,ai.scale=di,ai.attribution=gi;var _i=T.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});_i.addTo=function(t,e){return t.addHandler(e,this),this};var vi={Events:D},yi=Ft.touch?"touchstart mousedown":"mousedown",bi=E.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){d(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(je(this._dragStartTarget,yi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(bi._dragging===this&&this.finishDrag(!0),Ue(this._dragStartTarget,yi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!be(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)bi._dragging===this&&this.finishDrag();else if(!(bi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(bi._dragging=this,this._preventOutline&&Ie(this._element),Ee(),re(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Re(this._element);this._startPoint=new O(e.clientX,e.clientY),this._startPos=Ae(this._element),this._parentScale=ze(i);var n="mousedown"===t.type;je(document,n?"mousemove":"touchmove",this._onMove,this),je(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new O(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,Ke(t),this._moved||(this.fire("dragstart"),this._moved=!0,xe(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),xe(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,this._lastEvent=t,this._updatePosition()))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Te(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){ke(document.body,"leaflet-dragging"),this._lastTarget&&(ke(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Ue(document,"mousemove touchmove",this._onMove,this),Ue(document,"mouseup touchend touchcancel",this._onUp,this),Oe(),se();var e=this._moved&&this._moving;this._moving=!1,bi._dragging=!1,e&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function xi(t,e,i){var n,o,r,s,a,l,h,c,p,u=[1,4,2,8];for(o=0,h=t.length;o<h;o++)t[o]._code=Ii(t[o],e);for(s=0;s<4;s++){for(c=u[s],n=[],o=0,r=(h=t.length)-1;o<h;r=o++)a=t[o],l=t[r],a._code&c?l._code&c||((p=Oi(l,a,c,e,i))._code=Ii(p,e),n.push(p)):(l._code&c&&((p=Oi(l,a,c,e,i))._code=Ii(p,e),n.push(p)),n.push(a));t=n}return t}function ki(t,e){var i,n,o,r,s,a,l,h,c;if(!t||0===t.length)throw new Error("latlngs not passed");zi(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var p=U([0,0]),u=j(t);u.getNorthWest().distanceTo(u.getSouthWest())*u.getNorthEast().distanceTo(u.getNorthWest())<1700&&(p=Li(t));var d=t.length,m=[];for(i=0;i<d;i++){var f=U(t[i]);m.push(e.project(U([f.lat-p.lat,f.lng-p.lng])))}for(a=l=h=0,i=0,n=d-1;i<d;n=i++)o=m[i],r=m[n],s=o.y*r.x-r.y*o.x,l+=(o.x+r.x)*s,h+=(o.y+r.y)*s,a+=3*s;c=0===a?m[0]:[l/a,h/a];var g=e.unproject(B(c));return U([g.lat+p.lat,g.lng+p.lng])}function Li(t){for(var e=0,i=0,n=0,o=0;o<t.length;o++){var r=U(t[o]);e+=r.lat,i+=r.lng,n++}return U([e/n,i/n])}var wi,Mi={__proto__:null,clipPolygon:xi,polygonCenter:ki,centroid:Li};function Ci(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Ti(t=Di(t,i),i)}function Pi(t,e,i){return Math.sqrt(Ri(t,e,i,!0))}function Si(t,e,i){return Ri(t,e,i)}function Ti(t,e){var i=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);n[0]=n[i-1]=1,Ai(t,n,e,0,i-1);var o,r=[];for(o=0;o<i;o++)n[o]&&r.push(t[o]);return r}function Ai(t,e,i,n,o){var r,s,a,l=0;for(s=n+1;s<=o-1;s++)(a=Ri(t[s],t[n],t[o],!0))>l&&(r=s,l=a);l>i&&(e[r]=1,Ai(t,e,i,n,r),Ai(t,e,i,r,o))}function Di(t,e){for(var i=[t[0]],n=1,o=0,r=t.length;n<r;n++)Bi(t[n],t[o])>e&&(i.push(t[n]),o=n);return o<r-1&&i.push(t[r-1]),i}function Ei(t,e,i,n,o){var r,s,a,l=n?wi:Ii(t,i),h=Ii(e,i);for(wi=h;;){if(!(l|h))return[t,e];if(l&h)return!1;a=Ii(s=Oi(t,e,r=l||h,i,o),i),r===l?(t=s,l=a):(e=s,h=a)}}function Oi(t,e,i,n,o){var r,s,a=e.x-t.x,l=e.y-t.y,h=n.min,c=n.max;return 8&i?(r=t.x+a*(c.y-t.y)/l,s=c.y):4&i?(r=t.x+a*(h.y-t.y)/l,s=h.y):2&i?(r=c.x,s=t.y+l*(c.x-t.x)/a):1&i&&(r=h.x,s=t.y+l*(h.x-t.x)/a),new O(r,s,o)}function Ii(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Bi(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Ri(t,e,i,n){var o,r=e.x,s=e.y,a=i.x-r,l=i.y-s,h=a*a+l*l;return h>0&&((o=((t.x-r)*a+(t.y-s)*l)/h)>1?(r=i.x,s=i.y):o>0&&(r+=a*o,s+=l*o)),a=t.x-r,l=t.y-s,n?a*a+l*l:new O(r,s)}function zi(t){return!_(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Fi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),zi(t)}function ji(t,e){var i,n,o,r,s,a,l,h;if(!t||0===t.length)throw new Error("latlngs not passed");zi(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var c=U([0,0]),p=j(t);p.getNorthWest().distanceTo(p.getSouthWest())*p.getNorthEast().distanceTo(p.getNorthWest())<1700&&(c=Li(t));var u=t.length,d=[];for(i=0;i<u;i++){var m=U(t[i]);d.push(e.project(U([m.lat-c.lat,m.lng-c.lng])))}for(i=0,n=0;i<u-1;i++)n+=d[i].distanceTo(d[i+1])/2;if(0===n)h=d[0];else for(i=0,r=0;i<u-1;i++)if(s=d[i],a=d[i+1],(r+=o=s.distanceTo(a))>n){l=(r-n)/o,h=[a.x-l*(a.x-s.x),a.y-l*(a.y-s.y)];break}var f=e.unproject(B(h));return U([f.lat+c.lat,f.lng+c.lng])}var Ni={__proto__:null,simplify:Ci,pointToSegmentDistance:Pi,closestPointOnSegment:Si,clipSegment:Ei,_getEdgeIntersection:Oi,_getBitCode:Ii,_sqClosestPointOnSegment:Ri,isFlat:zi,_flat:Fi,polylineCenter:ji},Ui={project:function(t){return new O(t.lng,t.lat)},unproject:function(t){return new N(t.y,t.x)},bounds:new R([-180,-90],[180,90])},Gi={R:6378137,R_MINOR:6356752.314245179,bounds:new R([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,r=Math.sqrt(1-o*o),s=r*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-s)/(1+s),r/2);return n=-i*Math.log(Math.max(a,1e-10)),new O(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,r=Math.sqrt(1-o*o),s=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(s),l=0,h=.1;l<15&&Math.abs(h)>1e-7;l++)e=r*Math.sin(a),e=Math.pow((1-e)/(1+e),r/2),a+=h=Math.PI/2-2*Math.atan(s*e)-a;return new N(a*i,t.x*i/n)}},Hi={__proto__:null,LonLat:Ui,Mercator:Gi,SphericalMercator:W},Zi=i({},Z,{code:"EPSG:3395",projection:Gi,transformation:function(){var t=.5/(Math.PI*Gi.R);return $(t,.5,-t,.5)}()}),Vi=i({},Z,{code:"EPSG:4326",projection:Ui,transformation:$(1/180,1,-1/180,.5)}),Wi=i({},H,{projection:Ui,transformation:$(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});H.Earth=Z,H.EPSG3395=Zi,H.EPSG3857=K,H.EPSG900913=Y,H.EPSG4326=Vi,H.Simple=Wi;var qi=E.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[s(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[s(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});oi.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=s(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=s(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return s(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?_(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[s(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=s(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),e=void 0===o.maxZoom?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var $i=qi.extend({initialize:function(t,e){var i,n;if(d(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return s(t)}}),Ki=function(t,e){return new $i(t,e)},Yi=$i.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),$i.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),$i.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new F;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Ji=function(t,e){return new Yi(t,e)},Xi=T.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){d(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(n,t),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),n},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"];"number"==typeof n&&(n=[n,n]);var o=B(n),r=B("shadow"===e&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),r&&(t.style.marginLeft=-r.x+"px",t.style.marginTop=-r.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Ft.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Qi(t){return new Xi(t)}var tn=Xi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return"string"!=typeof tn.imagePath&&(tn.imagePath=this._detectIconPath()),(this.options.imagePath||tn.imagePath)+Xi.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){var e=function(t,e,i){var n=e.exec(t);return n&&n[i]};return(t=e(t,/^url\((['"])?(.+)\1\)$/,2))&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=fe("div","leaflet-default-icon-path",document.body),e=me(t,"background-image")||me(t,"backgroundImage");if(document.body.removeChild(t),e=this._stripUrl(e))return e;var i=document.querySelector('link[href$="leaflet.css"]');return i?i.href.substring(0,i.href.length-11-1):""}}),en=_i.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new bi(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),xe(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ke(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,r=Ae(e._icon),s=i.getPixelBounds(),a=i.getPixelOrigin(),l=z(s.min._subtract(a).add(o),s.max._subtract(a).subtract(o));if(!l.contains(r)){var h=B((Math.max(l.max.x,r.x)-l.max.x)/(s.max.x-l.max.x)-(Math.min(l.min.x,r.x)-l.min.x)/(s.min.x-l.min.x),(Math.max(l.max.y,r.y)-l.max.y)/(s.max.y-l.max.y)-(Math.min(l.min.y,r.y)-l.min.y)/(s.min.y-l.min.y)).multiplyBy(n);i.panBy(h,{animate:!1}),this._draggable._newPos._add(h),this._draggable._startPos._add(h),Te(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=C(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(P(this._panRequest),this._panRequest=C(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=Ae(e._icon),o=e._map.layerPointToLatLng(n);i&&Te(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){P(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),nn=qi.extend({options:{icon:new tn,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){d(this,e),this._latlng=U(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=U(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),xe(i,e),t.keyboard&&(i.tabIndex="0",i.setAttribute("role","button")),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&je(i,"focus",this._panOnFocus,this);var o=t.icon.createShadow(this._shadow),r=!1;o!==this._shadow&&(this._removeShadow(),r=!0),o&&(xe(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&r&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ue(this._icon,"focus",this._panOnFocus,this),ge(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ge(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Te(this._icon,t),this._shadow&&Te(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(xe(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),en)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new en(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&Me(this._icon,t),this._shadow&&Me(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t=this._map;if(t){var e=this.options.icon.options,i=e.iconSize?B(e.iconSize):B(0,0),n=e.iconAnchor?B(e.iconAnchor):B(0,0);t.panInside(this._latlng,{paddingTopLeft:n,paddingBottomRight:i.subtract(n)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function on(t,e){return new nn(t,e)}var rn=qi.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return d(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),sn=rn.extend({options:{fill:!0,radius:10},initialize:function(t,e){d(this,e),this._latlng=U(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=U(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return rn.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),n=[t+i,e+i];this._pxBounds=new R(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function an(t,e){return new sn(t,e)}var ln=sn.extend({initialize:function(t,e,n){if("number"==typeof e&&(e=i({},n,{radius:e})),d(this,e),this._latlng=U(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new F(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:rn.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===Z.distance){var o=Math.PI/180,r=this._mRadius/Z.R/o,s=i.project([e+r,t]),a=i.project([e-r,t]),l=s.add(a).divideBy(2),h=i.unproject(l).lat,c=Math.acos((Math.cos(r*o)-Math.sin(e*o)*Math.sin(h*o))/(Math.cos(e*o)*Math.cos(h*o)))/o;(isNaN(c)||0===c)&&(c=r/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(c)?0:l.x-i.project([h,t-c]).x,this._radiusY=l.y-s.y}else{var p=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(p).x}this._updateBounds()}});function hn(t,e,i){return new ln(t,e,i)}var cn=rn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){d(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,n=1/0,o=null,r=Ri,s=0,a=this._parts.length;s<a;s++)for(var l=this._parts[s],h=1,c=l.length;h<c;h++){var p=r(t,e=l[h-1],i=l[h],!0);p<n&&(n=p,o=r(t,e,i))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return ji(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=U(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new F,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return zi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=zi(t),n=0,o=t.length;n<o;n++)i?(e[n]=U(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new R;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new O(t,t);this._rawPxBounds&&(this._pxBounds=new R([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)]))},_projectLatlngs:function(t,e,i){var n,o,r=t[0]instanceof N,s=t.length;if(r){for(o=[],n=0;n<s;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<s;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,n,o,r,s,a,l=this._parts;for(e=0,n=0,o=this._rings.length;e<o;e++)for(i=0,r=(a=this._rings[e]).length;i<r-1;i++)(s=Ei(a[i],a[i+1],t,i,!0))&&(l[n]=l[n]||[],l[n].push(s[0]),s[1]===a[i+1]&&i!==r-2||(l[n].push(s[1]),n++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=Ci(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,r,s,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,r=this._parts.length;i<r;i++)for(n=0,o=(s=(a=this._parts[i]).length)-1;n<s;o=n++)if((e||0!==n)&&Pi(t,a[o],a[n])<=l)return!0;return!1}});function pn(t,e){return new cn(t,e)}cn._flat=Fi;var un=cn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return ki(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(t){var e=cn.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof N&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){cn.prototype._setLatLngs.call(this,t),zi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return zi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new O(e,e);if(t=new R(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,r=this._rings.length;o<r;o++)(n=xi(this._rings[o],t,!0)).length&&this._parts.push(n)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,r,s,a,l,h=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(r=0,s=(l=(e=this._parts[o]).length)-1;r<l;s=r++)i=e[r],n=e[s],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(h=!h);return h||cn.prototype._containsPoint.call(this,t,!0)}});function dn(t,e){return new un(t,e)}var mn=Yi.extend({initialize:function(t,e){d(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=_(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var r=this.options;if(r.filter&&!r.filter(t))return this;var s=fn(t,r);return s?(s.feature=kn(t),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=i({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function fn(t,e){var i,n,o,r,s="Feature"===t.type?t.geometry:t,a=s?s.coordinates:null,l=[],h=e&&e.pointToLayer,c=e&&e.coordsToLatLng||_n;if(!a&&!s)return null;switch(s.type){case"Point":return gn(h,t,i=c(a),e);case"MultiPoint":for(o=0,r=a.length;o<r;o++)i=c(a[o]),l.push(gn(h,t,i,e));return new Yi(l);case"LineString":case"MultiLineString":return n=vn(a,"LineString"===s.type?0:1,c),new cn(n,e);case"Polygon":case"MultiPolygon":return n=vn(a,"Polygon"===s.type?1:2,c),new un(n,e);case"GeometryCollection":for(o=0,r=s.geometries.length;o<r;o++){var p=fn({geometry:s.geometries[o],type:"Feature",properties:t.properties},e);p&&l.push(p)}return new Yi(l);case"FeatureCollection":for(o=0,r=s.features.length;o<r;o++){var u=fn(s.features[o],e);u&&l.push(u)}return new Yi(l);default:throw new Error("Invalid GeoJSON object.")}}function gn(t,e,i,n){return t?t(e,i):new nn(i,n&&n.markersInheritOptions&&n)}function _n(t){return new N(t[1],t[0],t[2])}function vn(t,e,i){for(var n,o=[],r=0,s=t.length;r<s;r++)n=e?vn(t[r],e-1,i):(i||_n)(t[r]),o.push(n);return o}function yn(t,e){return void 0!==(t=U(t)).alt?[c(t.lng,e),c(t.lat,e),c(t.alt,e)]:[c(t.lng,e),c(t.lat,e)]}function bn(t,e,i,n){for(var o=[],r=0,s=t.length;r<s;r++)o.push(e?bn(t[r],zi(t[r])?0:e-1,i,n):yn(t[r],n));return!e&&i&&o.length>0&&o.push(o[0].slice()),o}function xn(t,e){return t.feature?i({},t.feature,{geometry:e}):kn(e)}function kn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var Ln={toGeoJSON:function(t){return xn(this,{type:"Point",coordinates:yn(this.getLatLng(),t)})}};function wn(t,e){return new mn(t,e)}nn.include(Ln),ln.include(Ln),sn.include(Ln),cn.include({toGeoJSON:function(t){var e=!zi(this._latlngs);return xn(this,{type:(e?"Multi":"")+"LineString",coordinates:bn(this._latlngs,e?1:0,!1,t)})}}),un.include({toGeoJSON:function(t){var e=!zi(this._latlngs),i=e&&!zi(this._latlngs[0]),n=bn(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),xn(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),$i.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),xn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(i)n.push(o.geometry);else{var r=kn(o);"FeatureCollection"===r.type?n.push.apply(n,r.features):n.push(r)}}})),i?xn(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var Mn=wn,Cn=qi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=j(e),d(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(xe(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ge(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ve(this._image),this},bringToBack:function(){return this._map&&ye(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=j(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:fe("img");xe(e,"leaflet-image-layer"),this._zoomAnimated&&xe(e,"leaflet-zoom-animated"),this.options.className&&xe(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onload=o(this.fire,this,"load"),e.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Se(this._image,i,e)},_reset:function(){var t=this._image,e=new R(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Te(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){Me(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Pn=function(t,e,i){return new Cn(t,e,i)},Sn=Cn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:fe("video");if(xe(e,"leaflet-image-layer"),this._zoomAnimated&&xe(e,"leaflet-zoom-animated"),this.options.className&&xe(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onloadeddata=o(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],r=0;r<i.length;r++)n.push(i[r].src);this._url=i.length>0?n:[e.src]}else{_(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;s<this._url.length;s++){var a=fe("source");a.src=this._url[s],e.appendChild(a)}}}});function Tn(t,e,i){return new Sn(t,e,i)}var An=Cn.extend({_initImage:function(){var t=this._image=this._url;xe(t,"leaflet-image-layer"),this._zoomAnimated&&xe(t,"leaflet-zoom-animated"),this.options.className&&xe(t,this.options.className),t.onselectstart=h,t.onmousemove=h}});function Dn(t,e,i){return new An(t,e,i)}var En=qi.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,e){t&&(t instanceof N||_(t))?(this._latlng=U(t),d(this,e)):(d(this,t),this._source=e),this.options.content&&(this._content=this.options.content)},openOn:function(t){return(t=arguments.length?t:this._source._map).hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&Me(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&Me(this._container,1),this.bringToFront(),this.options.interactive&&(xe(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(Me(this._container,0),this._removeTimeout=setTimeout(o(ge,void 0,this._container),200)):ge(this._container),this.options.interactive&&(ke(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=U(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ve(this._container),this},bringToBack:function(){return this._map&&ye(this._container),this},_prepareOpen:function(t){var e=this._source;if(!e._map)return!1;if(e instanceof Yi){e=null;var i=this._source._layers;for(var n in i)if(i[n]._map){e=i[n];break}if(!e)return!1;this._source=e}if(!t)if(e.getCenter)t=e.getCenter();else if(e.getLatLng)t=e.getLatLng();else{if(!e.getBounds)throw new Error("Unable to get source layer LatLng.");t=e.getBounds().getCenter()}return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=B(this.options.offset),i=this._getAnchor();this._zoomAnimated?Te(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}});oi.include({_initOverlay:function(t,e,i,n){var o=e;return o instanceof t||(o=new t(n).setContent(e)),i&&o.setLatLng(i),o}}),qi.include({_initOverlay:function(t,e,i,n){var o=i;return o instanceof t?(d(o,n),o._source=this):(o=e&&!n?e:new t(n,this)).setContent(i),o}});var On=En.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return!(t=arguments.length?t:this._source._map).hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,En.prototype.openOn.call(this,t)},onAdd:function(t){En.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof rn||this._source.on("preclick",We))},onRemove:function(t){En.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof rn||this._source.off("preclick",We))},getEvents:function(){var t=En.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",e=this._container=fe("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=fe("div",t+"-content-wrapper",e);if(this._contentNode=fe("div",t+"-content",i),$e(e),qe(this._contentNode),je(e,"contextmenu",We),this._tipContainer=fe("div",t+"-tip-container",e),this._tip=fe("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=fe("a",t+"-close-button",e);n.setAttribute("role","button"),n.setAttribute("aria-label","Close popup"),n.href="#close",n.innerHTML='<span aria-hidden="true">×</span>',je(n,"click",(function(t){Ke(t),this.close()}),this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,o=this.options.maxHeight,r="leaflet-popup-scrolled";o&&n>o?(e.height=o+"px",xe(t,r)):ke(t,r),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Te(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,e=parseInt(me(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new O(this._containerLeft,-i-this._containerBottom);o._add(Ae(this._container));var r=t.layerPointToContainerPoint(o),s=B(this.options.autoPanPadding),a=B(this.options.autoPanPaddingTopLeft||s),l=B(this.options.autoPanPaddingBottomRight||s),h=t.getSize(),c=0,p=0;r.x+n+l.x>h.x&&(c=r.x+n-h.x+l.x),r.x-c-a.x<0&&(c=r.x-a.x),r.y+i+l.y>h.y&&(p=r.y+i-h.y+l.y),r.y-p-a.y<0&&(p=r.y-a.y),(c||p)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([c,p]))}},_getAnchor:function(){return B(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),In=function(t,e){return new On(t,e)};oi.mergeOptions({closePopupOnClick:!0}),oi.include({openPopup:function(t,e,i){return this._initOverlay(On,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),qi.include({bindPopup:function(t,e){return this._popup=this._initOverlay(On,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Yi||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){Ye(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof rn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Bn=En.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){En.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){En.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=En.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=fe("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+s(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,o=this._container,r=n.latLngToContainerPoint(n.getCenter()),s=n.layerPointToContainerPoint(t),a=this.options.direction,l=o.offsetWidth,h=o.offsetHeight,c=B(this.options.offset),p=this._getAnchor();"top"===a?(e=l/2,i=h):"bottom"===a?(e=l/2,i=0):"center"===a?(e=l/2,i=h/2):"right"===a?(e=0,i=h/2):"left"===a?(e=l,i=h/2):s.x<r.x?(a="right",e=0,i=h/2):(a="left",e=l+2*(c.x+p.x),i=h/2),t=t.subtract(B(e,i,!0)).add(c).add(p),ke(o,"leaflet-tooltip-right"),ke(o,"leaflet-tooltip-left"),ke(o,"leaflet-tooltip-top"),ke(o,"leaflet-tooltip-bottom"),xe(o,"leaflet-tooltip-"+a),Te(o,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&Me(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return B(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Rn=function(t,e){return new Bn(t,e)};oi.include({openTooltip:function(t,e,i){return this._initOverlay(Bn,t,e,i).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),qi.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Bn,this._tooltip,t,e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,i.click=this._openTooltip,this._map?this._addFocusListeners():i.add=this._addFocusListeners),this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t){return this._tooltip&&(this instanceof Yi||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var e="function"==typeof t.getElement&&t.getElement();e&&(je(e,"focus",(function(){this._tooltip._source=t,this.openTooltip()}),this),je(e,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){var e="function"==typeof t.getElement&&t.getElement();e&&e.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){if(this._tooltip&&this._map)if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var e=this;this._map.once("moveend",(function(){e._openOnceFlag=!1,e._openTooltip(t)}))}else this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,n=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),n=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(n)}});var zn=Xi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(_e(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var n=B(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Fn(t){return new zn(t)}Xi.Default=tn;var jn=qi.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Ft.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){d(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ge(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(ve(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(ye(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var t=this._clampZoom(this._map.getZoom());t!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()}return this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof O?t:new O(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,r=i.length;o<r;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Ft.ielt9){Me(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var o=this._tiles[n];if(o.current&&o.loaded){var r=Math.min(1,(t-o.loaded)/200);Me(o.el,r),r<1?e=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(P(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this))}},_onOpaqueTile:h,_initContainer:function(){this._container||(this._container=fe("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ge(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=fe("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),h(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:h,_onRemoveLevel:h,_onCreateLevel:h,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var n=e.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ge(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var o=Math.floor(t/2),r=Math.floor(e/2),s=i-1,a=new O(+o,+r);a.z=+s;var l=this._tileCoordsToKey(a),h=this._tiles[l];return h&&h.active?(h.retain=!0,!0):(h&&h.loaded&&(h.retain=!0),s>n&&this._retainParent(o,r,s,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var r=2*e;r<2*e+2;r++){var s=new O(o,r);s.z=i+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<n&&this._retainChildren(o,r,i+1,n))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=Math.round(e);o=void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom?void 0:this._clampZoom(o);var r=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!r||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();Ft.any3d?Se(t.el,o,n):Te(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),n=e.getZoomScale(i,this._tileZoom),o=e.project(t,this._tileZoom).floor(),r=e.getSize().divideBy(2*n);return new R(o.subtract(r),o.add(r))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(n),r=o.getCenter(),s=[],a=this.options.keepBuffer,l=new R(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var h in this._tiles){var c=this._tiles[h].coords;c.z===this._tileZoom&&l.contains(new O(c.x,c.y))||(this._tiles[h].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var p=o.min.y;p<=o.max.y;p++)for(var u=o.min.x;u<=o.max.x;u++){var d=new O(u,p);if(d.z=this._tileZoom,this._isValidTile(d)){var m=this._tiles[this._tileCoordsToKey(d)];m?m.current=!0:s.push(d)}}if(s.sort((function(t,e){return t.distanceTo(r)-e.distanceTo(r)})),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var f=document.createDocumentFragment();for(u=0;u<s.length;u++)this._addTile(s[u],f);this._level.el.appendChild(f)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return j(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new F(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new O(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ge(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){xe(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=h,t.onmousemove=h,Ft.ielt9&&this.options.opacity<1&&Me(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),o(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&C(o(this._tileReady,this,t,null,r)),Te(r,i),this._tiles[n]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(Me(i.el,0),P(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(xe(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ft.ielt9||!this._map._fadeAnimated?C(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new O(this._wrapX?l(t.x,this._wrapX):t.x,this._wrapY?l(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new R(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Nn(t){return new jn(t)}var Un=jn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=d(this,e)).detectRetina&&Ft.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return je(i,"load",o(this._tileOnLoad,this,e,i)),je(i,"error",o(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Ft.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=n),e["-y"]=n}return g(this._url,i(e,this.options))},_tileOnLoad:function(t,e){Ft.ielt9?setTimeout(o(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=h,e.onerror=h,!e.complete)){e.src=y;var i=this._tiles[t].coords;ge(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",y),jn.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==y))return jn.prototype._tileReady.call(this,t,e,i)}});function Gn(t,e){return new Un(t,e)}var Hn=Un.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var n=i({},this.defaultWmsParams);for(var o in e)o in this.options||(n[o]=e[o]);var r=(e=d(this,e)).detectRetina&&Ft.retina?2:1,s=this.getTileSize();n.width=s.x*r,n.height=s.y*r,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,Un.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=z(i.project(e[0]),i.project(e[1])),o=n.min,r=n.max,s=(this._wmsVersion>=1.3&&this._crs===Vi?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),a=Un.prototype.getTileUrl.call(this,t);return a+m(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});function Zn(t,e){return new Hn(t,e)}Un.WMS=Hn,Gn.wms=Zn;var Vn=qi.extend({options:{padding:.1},initialize:function(t){d(this,t),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),xe(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),r=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));Ft.any3d?Se(this._container,r,i):Te(this._container,r)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new R(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Wn=Vn.extend({options:{tolerance:0},getEvents:function(){var t=Vn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Vn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");je(t,"mousemove",this._onMouseMove,this),je(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),je(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){P(this._redrawRequest),delete this._ctx,ge(this._container),Ue(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Vn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Ft.retina?2:1;Te(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Ft.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Vn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[s(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[s(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),o=[];for(i=0;i<n.length;i++){if(e=Number(n[i]),isNaN(e))return;o.push(e)}t.options._dashArray=o}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||C(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new R,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,r,s=t._parts,a=s.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(n=0,o=s[i].length;n<o;n++)r=s[i][n],l[n?"lineTo":"moveTo"](r.x,r.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||n)/n;1!==o&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!==o&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&("click"!==t.type&&"preclick"!==t.type||!this._map._draggableMoved(e))&&(i=e);this._fireEvent(!!i&&[i],t)},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ke(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,n,r=this._drawFirst;r;r=r.next)(i=r.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(xe(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(o((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;i&&(i.prev=n,n?n.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;n&&(n.next=i,i?i.prev=n:n&&(this._drawLast=n),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function qn(t){return Ft.canvas?new Wn(t):null}var $n=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Kn={_initContainer:function(){this._container=fe("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Vn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=$n("shape");xe(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=$n("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ge(e),t.removeInteractiveTarget(e),delete this._layers[s(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=$n("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=_(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=$n("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){ve(t._container)},_bringToBack:function(t){ye(t._container)}},Yn=Ft.vml?$n:J,Jn=Vn.extend({_initContainer:function(){this._container=Yn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Yn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ge(this._container),Ue(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){Vn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Te(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Yn("path");t.options.className&&xe(e,t.options.className),t.options.interactive&&xe(e,"leaflet-interactive"),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ge(t._path),t.removeInteractiveTarget(t._path),delete this._layers[s(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,X(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){ve(t._path)},_bringToBack:function(t){ye(t._path)}});function Xn(t){return Ft.svg||Ft.vml?new Jn(t):null}Ft.vml&&Jn.include(Kn),oi.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&qn(t)||Xn(t)}});var Qn=un.extend({initialize:function(t,e){un.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=j(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function to(t,e){return new Qn(t,e)}Jn.create=Yn,Jn.pointsToPath=X,mn.geometryToLayer=fn,mn.coordsToLatLng=_n,mn.coordsToLatLngs=vn,mn.latLngToCoords=yn,mn.latLngsToCoords=bn,mn.getFeature=xn,mn.asFeature=kn,oi.mergeOptions({boxZoom:!0});var eo=_i.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){je(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ue(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ge(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),re(),Ee(),this._startPoint=this._map.mouseEventToContainerPoint(t),je(document,{contextmenu:Ye,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=fe("div","leaflet-zoom-box",this._container),xe(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new R(this._point,this._startPoint),i=e.getSize();Te(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ge(this._box),ke(this._container,"leaflet-crosshair")),se(),Oe(),Ue(document,{contextmenu:Ye,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var e=new F(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});oi.addInitHook("addHandler","boxZoom",eo),oi.mergeOptions({doubleClickZoom:!0});var io=_i.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});oi.addInitHook("addHandler","doubleClickZoom",io),oi.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var no=_i.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new bi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}xe(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ke(this._map._container,"leaflet-grab"),ke(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=j(this._map.options.maxBounds);this._offsetLimit=z(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,r=(n+e+i)%t-e-i,s=Math.abs(o+i)<Math.abs(r+i)?o:r;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(t){var e=this._map,i=e.options,n=!i.inertia||t.noInertia||this._times.length<2;if(e.fire("dragend",t),n)e.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),r=(this._lastTime-this._times[0])/1e3,s=i.easeLinearity,a=o.multiplyBy(s/r),l=a.distanceTo([0,0]),h=Math.min(i.inertiaMaxSpeed,l),c=a.multiplyBy(h/l),p=h/(i.inertiaDeceleration*s),u=c.multiplyBy(-p/2).round();u.x||u.y?(u=e._limitOffset(u,e.options.maxBounds),C((function(){e.panBy(u,{duration:p,easeLinearity:s,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});oi.addInitHook("addHandler","dragging",no),oi.mergeOptions({keyboard:!0,keyboardPanDelta:80});var oo=_i.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),je(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ue(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,n=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(n,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;e<i;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;e<i;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;e<i;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;e<i;e++)n[o.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;e<i;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;e<i;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){je(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ue(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,n=this._map;if(i in this._panKeys){if(!n._panAnim||!n._panAnim._inProgress)if(e=this._panKeys[i],t.shiftKey&&(e=B(e).multiplyBy(3)),n.options.maxBounds&&(e=n._limitOffset(B(e),n.options.maxBounds)),n.options.worldCopyJump){var o=n.wrapLatLng(n.unproject(n.project(n.getCenter()).add(e)));n.panTo(o)}else n.panBy(e)}else if(i in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}Ye(t)}}});oi.addInitHook("addHandler","keyboard",oo),oi.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var ro=_i.extend({addHooks:function(){je(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ue(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=ti(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var n=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o(this._performZoom,this),n),Ye(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var n=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,r=i?Math.ceil(o/i)*i:o,s=t._limitZoom(e+(this._delta>0?r:-r))-e;this._delta=0,this._startTime=null,s&&("center"===t.options.scrollWheelZoom?t.setZoom(e+s):t.setZoomAround(this._lastMousePos,e+s))}});oi.addInitHook("addHandler","scrollWheelZoom",ro);var so=600;oi.mergeOptions({tapHold:Ft.touchNative&&Ft.safari&&Ft.mobile,tapTolerance:15});var ao=_i.extend({addHooks:function(){je(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ue(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new O(e.clientX,e.clientY),this._holdTimeout=setTimeout(o((function(){this._cancel(),this._isTapValid()&&(je(document,"touchend",Ke),je(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))}),this),so),je(document,"touchend touchcancel contextmenu",this._cancel,this),je(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){Ue(document,"touchend",Ke),Ue(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),Ue(document,"touchend touchcancel contextmenu",this._cancel,this),Ue(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new O(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});oi.addInitHook("addHandler","tapHold",ao),oi.mergeOptions({touchZoom:Ft.touch,bounceAtZoomLimits:!0});var lo=_i.extend({addHooks:function(){xe(this._map._container,"leaflet-touch-zoom"),je(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ke(this._map._container,"leaflet-touch-zoom"),Ue(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),je(document,"touchmove",this._onTouchMove,this),je(document,"touchend touchcancel",this._onTouchEnd,this),Ke(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),r=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&r<1||this._zoom>e.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var s=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===s.x&&0===s.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),P(this._animRequest);var a=o(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=C(a,this,!0),Ke(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,P(this._animRequest),Ue(document,"touchmove",this._onTouchMove,this),Ue(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});oi.addInitHook("addHandler","touchZoom",lo),oi.BoxZoom=eo,oi.DoubleClickZoom=io,oi.Drag=no,oi.Keyboard=oo,oi.ScrollWheelZoom=ro,oi.TapHold=ao,oi.TouchZoom=lo,t.Bounds=R,t.Browser=Ft,t.CRS=H,t.Canvas=Wn,t.Circle=ln,t.CircleMarker=sn,t.Class=T,t.Control=si,t.DivIcon=zn,t.DivOverlay=En,t.DomEvent=ii,t.DomUtil=Fe,t.Draggable=bi,t.Evented=E,t.FeatureGroup=Yi,t.GeoJSON=mn,t.GridLayer=jn,t.Handler=_i,t.Icon=Xi,t.ImageOverlay=Cn,t.LatLng=N,t.LatLngBounds=F,t.Layer=qi,t.LayerGroup=$i,t.LineUtil=Ni,t.Map=oi,t.Marker=nn,t.Mixin=vi,t.Path=rn,t.Point=O,t.PolyUtil=Mi,t.Polygon=un,t.Polyline=cn,t.Popup=On,t.PosAnimation=ni,t.Projection=Hi,t.Rectangle=Qn,t.Renderer=Vn,t.SVG=Jn,t.SVGOverlay=An,t.TileLayer=Un,t.Tooltip=Bn,t.Transformation=q,t.Util=S,t.VideoOverlay=Sn,t.bind=o,t.bounds=z,t.canvas=qn,t.circle=hn,t.circleMarker=an,t.control=ai,t.divIcon=Fn,t.extend=i,t.featureGroup=Ji,t.geoJSON=wn,t.geoJson=Mn,t.gridLayer=Nn,t.icon=Qi,t.imageOverlay=Pn,t.latLng=U,t.latLngBounds=j,t.layerGroup=Ki,t.map=ri,t.marker=on,t.point=B,t.polygon=dn,t.polyline=pn,t.popup=In,t.rectangle=to,t.setOptions=d,t.stamp=s,t.svg=Xn,t.svgOverlay=Dn,t.tileLayer=Gn,t.tooltip=Rn,t.transformation=$,t.version=e,t.videoOverlay=Tn;var ho=window.L;t.noConflict=function(){return window.L=ho,this},window.L=t}(e)},873:function(t,e){var i,n,o,r=function(){var t=function(t,e){var i=t,n=c[e],o=null,r=0,s=null,a=[],l={},h=function(t,e){o=function(t){for(var e=new Array(t),i=0;i<t;i+=1){e[i]=new Array(t);for(var n=0;n<t;n+=1)e[i][n]=null}return e}(r=4*i+17),p(0,0),p(r-7,0),p(0,r-7),d(),u(),f(t,e),i>=7&&m(t),null==s&&(s=_(i,n,a)),g(s,e)},p=function(t,e){for(var i=-1;i<=7;i+=1)if(!(t+i<=-1||r<=t+i))for(var n=-1;n<=7;n+=1)e+n<=-1||r<=e+n||(o[t+i][e+n]=0<=i&&i<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==i||6==i)||2<=i&&i<=4&&2<=n&&n<=4)},u=function(){for(var t=8;t<r-8;t+=1)null==o[t][6]&&(o[t][6]=t%2==0);for(var e=8;e<r-8;e+=1)null==o[6][e]&&(o[6][e]=e%2==0)},d=function(){for(var t=y.getPatternPosition(i),e=0;e<t.length;e+=1)for(var n=0;n<t.length;n+=1){var r=t[e],s=t[n];if(null==o[r][s])for(var a=-2;a<=2;a+=1)for(var l=-2;l<=2;l+=1)o[r+a][s+l]=-2==a||2==a||-2==l||2==l||0==a&&0==l}},m=function(t){for(var e=y.getBCHTypeNumber(i),n=0;n<18;n+=1){var s=!t&&1==(e>>n&1);o[Math.floor(n/3)][n%3+r-8-3]=s}for(n=0;n<18;n+=1){s=!t&&1==(e>>n&1);o[n%3+r-8-3][Math.floor(n/3)]=s}},f=function(t,e){for(var i=n<<3|e,s=y.getBCHTypeInfo(i),a=0;a<15;a+=1){var l=!t&&1==(s>>a&1);a<6?o[a][8]=l:a<8?o[a+1][8]=l:o[r-15+a][8]=l}for(a=0;a<15;a+=1){l=!t&&1==(s>>a&1);a<8?o[8][r-a-1]=l:a<9?o[8][15-a-1+1]=l:o[8][15-a-1]=l}o[r-8][8]=!t},g=function(t,e){for(var i=-1,n=r-1,s=7,a=0,l=y.getMaskFunction(e),h=r-1;h>0;h-=2)for(6==h&&(h-=1);;){for(var c=0;c<2;c+=1)if(null==o[n][h-c]){var p=!1;a<t.length&&(p=1==(t[a]>>>s&1)),l(n,h-c)&&(p=!p),o[n][h-c]=p,-1==(s-=1)&&(a+=1,s=7)}if((n+=i)<0||r<=n){n-=i,i=-i;break}}},_=function(t,e,i){for(var n=k.getRSBlocks(t,e),o=L(),r=0;r<i.length;r+=1){var s=i[r];o.put(s.getMode(),4),o.put(s.getLength(),y.getLengthInBits(s.getMode(),t)),s.write(o)}var a=0;for(r=0;r<n.length;r+=1)a+=n[r].dataCount;if(o.getLengthInBits()>8*a)throw"code length overflow. ("+o.getLengthInBits()+">"+8*a+")";for(o.getLengthInBits()+4<=8*a&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*a||(o.put(236,8),o.getLengthInBits()>=8*a));)o.put(17,8);return function(t,e){for(var i=0,n=0,o=0,r=new Array(e.length),s=new Array(e.length),a=0;a<e.length;a+=1){var l=e[a].dataCount,h=e[a].totalCount-l;n=Math.max(n,l),o=Math.max(o,h),r[a]=new Array(l);for(var c=0;c<r[a].length;c+=1)r[a][c]=255&t.getBuffer()[c+i];i+=l;var p=y.getErrorCorrectPolynomial(h),u=x(r[a],p.getLength()-1).mod(p);for(s[a]=new Array(p.getLength()-1),c=0;c<s[a].length;c+=1){var d=c+u.getLength()-s[a].length;s[a][c]=d>=0?u.getAt(d):0}}var m=0;for(c=0;c<e.length;c+=1)m+=e[c].totalCount;var f=new Array(m),g=0;for(c=0;c<n;c+=1)for(a=0;a<e.length;a+=1)c<r[a].length&&(f[g]=r[a][c],g+=1);for(c=0;c<o;c+=1)for(a=0;a<e.length;a+=1)c<s[a].length&&(f[g]=s[a][c],g+=1);return f}(o,n)};l.addData=function(t,e){var i=null;switch(e=e||"Byte"){case"Numeric":i=w(t);break;case"Alphanumeric":i=M(t);break;case"Byte":i=C(t);break;case"Kanji":i=P(t);break;default:throw"mode:"+e}a.push(i),s=null},l.isDark=function(t,e){if(t<0||r<=t||e<0||r<=e)throw t+","+e;return o[t][e]},l.getModuleCount=function(){return r},l.make=function(){if(i<1){for(var t=1;t<40;t++){for(var e=k.getRSBlocks(t,n),o=L(),r=0;r<a.length;r++){var s=a[r];o.put(s.getMode(),4),o.put(s.getLength(),y.getLengthInBits(s.getMode(),t)),s.write(o)}var c=0;for(r=0;r<e.length;r++)c+=e[r].dataCount;if(o.getLengthInBits()<=8*c)break}i=t}h(!1,function(){for(var t=0,e=0,i=0;i<8;i+=1){h(!0,i);var n=y.getLostPoint(l);(0==i||t>n)&&(t=n,e=i)}return e}())},l.createTableTag=function(t,e){t=t||2;var i="";i+='<table style="',i+=" border-width: 0px; border-style: none;",i+=" border-collapse: collapse;",i+=" padding: 0px; margin: "+(e=void 0===e?4*t:e)+"px;",i+='">',i+="<tbody>";for(var n=0;n<l.getModuleCount();n+=1){i+="<tr>";for(var o=0;o<l.getModuleCount();o+=1)i+='<td style="',i+=" border-width: 0px; border-style: none;",i+=" border-collapse: collapse;",i+=" padding: 0px; margin: 0px;",i+=" width: "+t+"px;",i+=" height: "+t+"px;",i+=" background-color: ",i+=l.isDark(n,o)?"#000000":"#ffffff",i+=";",i+='"/>';i+="</tr>"}return i+="</tbody>",i+="</table>"},l.createSvgTag=function(t,e,i,n){var o={};"object"==typeof arguments[0]&&(t=(o=arguments[0]).cellSize,e=o.margin,i=o.alt,n=o.title),t=t||2,e=void 0===e?4*t:e,(i="string"==typeof i?{text:i}:i||{}).text=i.text||null,i.id=i.text?i.id||"qrcode-description":null,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-title":null;var r,s,a,h,c=l.getModuleCount()*t+2*e,p="";for(h="l"+t+",0 0,"+t+" -"+t+",0 0,-"+t+"z ",p+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',p+=o.scalable?"":' width="'+c+'px" height="'+c+'px"',p+=' viewBox="0 0 '+c+" "+c+'" ',p+=' preserveAspectRatio="xMinYMin meet"',p+=n.text||i.text?' role="img" aria-labelledby="'+v([n.id,i.id].join(" ").trim())+'"':"",p+=">",p+=n.text?'<title id="'+v(n.id)+'">'+v(n.text)+"</title>":"",p+=i.text?'<description id="'+v(i.id)+'">'+v(i.text)+"</description>":"",p+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',p+='<path d="',s=0;s<l.getModuleCount();s+=1)for(a=s*t+e,r=0;r<l.getModuleCount();r+=1)l.isDark(s,r)&&(p+="M"+(r*t+e)+","+a+h);return p+='" stroke="transparent" fill="black"/>',p+="</svg>"},l.createDataURL=function(t,e){t=t||2,e=void 0===e?4*t:e;var i=l.getModuleCount()*t+2*e,n=e,o=i-e;return A(i,i,(function(e,i){if(n<=e&&e<o&&n<=i&&i<o){var r=Math.floor((e-n)/t),s=Math.floor((i-n)/t);return l.isDark(s,r)?0:1}return 1}))},l.createImgTag=function(t,e,i){t=t||2,e=void 0===e?4*t:e;var n=l.getModuleCount()*t+2*e,o="";return o+="<img",o+=' src="',o+=l.createDataURL(t,e),o+='"',o+=' width="',o+=n,o+='"',o+=' height="',o+=n,o+='"',i&&(o+=' alt="',o+=v(i),o+='"'),o+="/>"};var v=function(t){for(var e="",i=0;i<t.length;i+=1){var n=t.charAt(i);switch(n){case"<":e+="<";break;case">":e+=">";break;case"&":e+="&";break;case'"':e+=""";break;default:e+=n}}return e};return l.createASCII=function(t,e){if((t=t||1)<2)return function(t){t=void 0===t?2:t;var e,i,n,o,r,s=1*l.getModuleCount()+2*t,a=t,h=s-t,c={"██":"█","█ ":"▀"," █":"▄"," ":" "},p={"██":"▀","█ ":"▀"," █":" "," ":" "},u="";for(e=0;e<s;e+=2){for(n=Math.floor((e-a)/1),o=Math.floor((e+1-a)/1),i=0;i<s;i+=1)r="█",a<=i&&i<h&&a<=e&&e<h&&l.isDark(n,Math.floor((i-a)/1))&&(r=" "),a<=i&&i<h&&a<=e+1&&e+1<h&&l.isDark(o,Math.floor((i-a)/1))?r+=" ":r+="█",u+=t<1&&e+1>=h?p[r]:c[r];u+="\n"}return s%2&&t>0?u.substring(0,u.length-s-1)+Array(s+1).join("▀"):u.substring(0,u.length-1)}(e);t-=1,e=void 0===e?2*t:e;var i,n,o,r,s=l.getModuleCount()*t+2*e,a=e,h=s-e,c=Array(t+1).join("██"),p=Array(t+1).join(" "),u="",d="";for(i=0;i<s;i+=1){for(o=Math.floor((i-a)/t),d="",n=0;n<s;n+=1)r=1,a<=n&&n<h&&a<=i&&i<h&&l.isDark(o,Math.floor((n-a)/t))&&(r=0),d+=r?c:p;for(o=0;o<t;o+=1)u+=d+"\n"}return u.substring(0,u.length-1)},l.renderTo2dContext=function(t,e){e=e||2;for(var i=l.getModuleCount(),n=0;n<i;n++)for(var o=0;o<i;o++)t.fillStyle=l.isDark(n,o)?"black":"white",t.fillRect(n*e,o*e,e,e)},l};t.stringToBytes=(t.stringToBytesFuncs={default:function(t){for(var e=[],i=0;i<t.length;i+=1){var n=t.charCodeAt(i);e.push(255&n)}return e}}).default,t.createStringToBytes=function(t,e){var i=function(){for(var i=T(t),n=function(){var t=i.read();if(-1==t)throw"eof";return t},o=0,r={};;){var s=i.read();if(-1==s)break;var a=n(),l=n()<<8|n();r[String.fromCharCode(s<<8|a)]=l,o+=1}if(o!=e)throw o+" != "+e;return r}(),n="?".charCodeAt(0);return function(t){for(var e=[],o=0;o<t.length;o+=1){var r=t.charCodeAt(o);if(r<128)e.push(r);else{var s=i[t.charAt(o)];"number"==typeof s?(255&s)==s?e.push(s):(e.push(s>>>8),e.push(255&s)):e.push(n)}}return e}};var e,i,n,o,r,s=1,a=2,l=4,h=8,c={L:1,M:0,Q:3,H:2},p=0,u=1,d=2,m=3,f=4,g=5,_=6,v=7,y=(e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],i=1335,n=7973,r=function(t){for(var e=0;0!=t;)e+=1,t>>>=1;return e},(o={}).getBCHTypeInfo=function(t){for(var e=t<<10;r(e)-r(i)>=0;)e^=i<<r(e)-r(i);return 21522^(t<<10|e)},o.getBCHTypeNumber=function(t){for(var e=t<<12;r(e)-r(n)>=0;)e^=n<<r(e)-r(n);return t<<12|e},o.getPatternPosition=function(t){return e[t-1]},o.getMaskFunction=function(t){switch(t){case p:return function(t,e){return(t+e)%2==0};case u:return function(t,e){return t%2==0};case d:return function(t,e){return e%3==0};case m:return function(t,e){return(t+e)%3==0};case f:return function(t,e){return(Math.floor(t/2)+Math.floor(e/3))%2==0};case g:return function(t,e){return t*e%2+t*e%3==0};case _:return function(t,e){return(t*e%2+t*e%3)%2==0};case v:return function(t,e){return(t*e%3+(t+e)%2)%2==0};default:throw"bad maskPattern:"+t}},o.getErrorCorrectPolynomial=function(t){for(var e=x([1],0),i=0;i<t;i+=1)e=e.multiply(x([1,b.gexp(i)],0));return e},o.getLengthInBits=function(t,e){if(1<=e&&e<10)switch(t){case s:return 10;case a:return 9;case l:case h:return 8;default:throw"mode:"+t}else if(e<27)switch(t){case s:return 12;case a:return 11;case l:return 16;case h:return 10;default:throw"mode:"+t}else{if(!(e<41))throw"type:"+e;switch(t){case s:return 14;case a:return 13;case l:return 16;case h:return 12;default:throw"mode:"+t}}},o.getLostPoint=function(t){for(var e=t.getModuleCount(),i=0,n=0;n<e;n+=1)for(var o=0;o<e;o+=1){for(var r=0,s=t.isDark(n,o),a=-1;a<=1;a+=1)if(!(n+a<0||e<=n+a))for(var l=-1;l<=1;l+=1)o+l<0||e<=o+l||0==a&&0==l||s==t.isDark(n+a,o+l)&&(r+=1);r>5&&(i+=3+r-5)}for(n=0;n<e-1;n+=1)for(o=0;o<e-1;o+=1){var h=0;t.isDark(n,o)&&(h+=1),t.isDark(n+1,o)&&(h+=1),t.isDark(n,o+1)&&(h+=1),t.isDark(n+1,o+1)&&(h+=1),0!=h&&4!=h||(i+=3)}for(n=0;n<e;n+=1)for(o=0;o<e-6;o+=1)t.isDark(n,o)&&!t.isDark(n,o+1)&&t.isDark(n,o+2)&&t.isDark(n,o+3)&&t.isDark(n,o+4)&&!t.isDark(n,o+5)&&t.isDark(n,o+6)&&(i+=40);for(o=0;o<e;o+=1)for(n=0;n<e-6;n+=1)t.isDark(n,o)&&!t.isDark(n+1,o)&&t.isDark(n+2,o)&&t.isDark(n+3,o)&&t.isDark(n+4,o)&&!t.isDark(n+5,o)&&t.isDark(n+6,o)&&(i+=40);var c=0;for(o=0;o<e;o+=1)for(n=0;n<e;n+=1)t.isDark(n,o)&&(c+=1);return i+=Math.abs(100*c/e/e-50)/5*10},o),b=function(){for(var t=new Array(256),e=new Array(256),i=0;i<8;i+=1)t[i]=1<<i;for(i=8;i<256;i+=1)t[i]=t[i-4]^t[i-5]^t[i-6]^t[i-8];for(i=0;i<255;i+=1)e[t[i]]=i;var n={glog:function(t){if(t<1)throw"glog("+t+")";return e[t]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return t[e]}};return n}();function x(t,e){if(void 0===t.length)throw t.length+"/"+e;var i=function(){for(var i=0;i<t.length&&0==t[i];)i+=1;for(var n=new Array(t.length-i+e),o=0;o<t.length-i;o+=1)n[o]=t[o+i];return n}(),n={getAt:function(t){return i[t]},getLength:function(){return i.length},multiply:function(t){for(var e=new Array(n.getLength()+t.getLength()-1),i=0;i<n.getLength();i+=1)for(var o=0;o<t.getLength();o+=1)e[i+o]^=b.gexp(b.glog(n.getAt(i))+b.glog(t.getAt(o)));return x(e,0)},mod:function(t){if(n.getLength()-t.getLength()<0)return n;for(var e=b.glog(n.getAt(0))-b.glog(t.getAt(0)),i=new Array(n.getLength()),o=0;o<n.getLength();o+=1)i[o]=n.getAt(o);for(o=0;o<t.getLength();o+=1)i[o]^=b.gexp(b.glog(t.getAt(o))+e);return x(i,0).mod(t)}};return n}var k=function(){var t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e=function(t,e){var i={};return i.totalCount=t,i.dataCount=e,i},i={};return i.getRSBlocks=function(i,n){var o=function(e,i){switch(i){case c.L:return t[4*(e-1)+0];case c.M:return t[4*(e-1)+1];case c.Q:return t[4*(e-1)+2];case c.H:return t[4*(e-1)+3];default:return}}(i,n);if(void 0===o)throw"bad rs block @ typeNumber:"+i+"/errorCorrectionLevel:"+n;for(var r=o.length/3,s=[],a=0;a<r;a+=1)for(var l=o[3*a+0],h=o[3*a+1],p=o[3*a+2],u=0;u<l;u+=1)s.push(e(h,p));return s},i}(),L=function(){var t=[],e=0,i={getBuffer:function(){return t},getAt:function(e){var i=Math.floor(e/8);return 1==(t[i]>>>7-e%8&1)},put:function(t,e){for(var n=0;n<e;n+=1)i.putBit(1==(t>>>e-n-1&1))},getLengthInBits:function(){return e},putBit:function(i){var n=Math.floor(e/8);t.length<=n&&t.push(0),i&&(t[n]|=128>>>e%8),e+=1}};return i},w=function(t){var e=s,i=t,n={getMode:function(){return e},getLength:function(t){return i.length},write:function(t){for(var e=i,n=0;n+2<e.length;)t.put(o(e.substring(n,n+3)),10),n+=3;n<e.length&&(e.length-n==1?t.put(o(e.substring(n,n+1)),4):e.length-n==2&&t.put(o(e.substring(n,n+2)),7))}},o=function(t){for(var e=0,i=0;i<t.length;i+=1)e=10*e+r(t.charAt(i));return e},r=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+t};return n},M=function(t){var e=a,i=t,n={getMode:function(){return e},getLength:function(t){return i.length},write:function(t){for(var e=i,n=0;n+1<e.length;)t.put(45*o(e.charAt(n))+o(e.charAt(n+1)),11),n+=2;n<e.length&&t.put(o(e.charAt(n)),6)}},o=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);if("A"<=t&&t<="Z")return t.charCodeAt(0)-"A".charCodeAt(0)+10;switch(t){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+t}};return n},C=function(e){var i=l,n=t.stringToBytes(e),o={getMode:function(){return i},getLength:function(t){return n.length},write:function(t){for(var e=0;e<n.length;e+=1)t.put(n[e],8)}};return o},P=function(e){var i=h,n=t.stringToBytesFuncs.SJIS;if(!n)throw"sjis not supported.";!function(t,e){var i=n("友");if(2!=i.length||38726!=(i[0]<<8|i[1]))throw"sjis not supported."}();var o=n(e),r={getMode:function(){return i},getLength:function(t){return~~(o.length/2)},write:function(t){for(var e=o,i=0;i+1<e.length;){var n=(255&e[i])<<8|255&e[i+1];if(33088<=n&&n<=40956)n-=33088;else{if(!(57408<=n&&n<=60351))throw"illegal char at "+(i+1)+"/"+n;n-=49472}n=192*(n>>>8&255)+(255&n),t.put(n,13),i+=2}if(i<e.length)throw"illegal char at "+(i+1)}};return r},S=function(){var t=[],e={writeByte:function(e){t.push(255&e)},writeShort:function(t){e.writeByte(t),e.writeByte(t>>>8)},writeBytes:function(t,i,n){i=i||0,n=n||t.length;for(var o=0;o<n;o+=1)e.writeByte(t[o+i])},writeString:function(t){for(var i=0;i<t.length;i+=1)e.writeByte(t.charCodeAt(i))},toByteArray:function(){return t},toString:function(){var e="";e+="[";for(var i=0;i<t.length;i+=1)i>0&&(e+=","),e+=t[i];return e+="]"}};return e},T=function(t){var e=t,i=0,n=0,o=0,r={read:function(){for(;o<8;){if(i>=e.length){if(0==o)return-1;throw"unexpected end of file./"+o}var t=e.charAt(i);if(i+=1,"="==t)return o=0,-1;t.match(/^\s$/)||(n=n<<6|s(t.charCodeAt(0)),o+=6)}var r=n>>>o-8&255;return o-=8,r}},s=function(t){if(65<=t&&t<=90)return t-65;if(97<=t&&t<=122)return t-97+26;if(48<=t&&t<=57)return t-48+52;if(43==t)return 62;if(47==t)return 63;throw"c:"+t};return r},A=function(t,e,i){for(var n=function(t,e){var i=t,n=e,o=new Array(t*e),r={setPixel:function(t,e,n){o[e*i+t]=n},write:function(t){t.writeString("GIF87a"),t.writeShort(i),t.writeShort(n),t.writeByte(128),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(255),t.writeByte(255),t.writeByte(255),t.writeString(","),t.writeShort(0),t.writeShort(0),t.writeShort(i),t.writeShort(n),t.writeByte(0);var e=s(2);t.writeByte(2);for(var o=0;e.length-o>255;)t.writeByte(255),t.writeBytes(e,o,255),o+=255;t.writeByte(e.length-o),t.writeBytes(e,o,e.length-o),t.writeByte(0),t.writeString(";")}},s=function(t){for(var e=1<<t,i=1+(1<<t),n=t+1,r=a(),s=0;s<e;s+=1)r.add(String.fromCharCode(s));r.add(String.fromCharCode(e)),r.add(String.fromCharCode(i));var l,h,c,p=S(),u=(l=p,h=0,c=0,{write:function(t,e){if(t>>>e!=0)throw"length over";for(;h+e>=8;)l.writeByte(255&(t<<h|c)),e-=8-h,t>>>=8-h,c=0,h=0;c|=t<<h,h+=e},flush:function(){h>0&&l.writeByte(c)}});u.write(e,n);var d=0,m=String.fromCharCode(o[d]);for(d+=1;d<o.length;){var f=String.fromCharCode(o[d]);d+=1,r.contains(m+f)?m+=f:(u.write(r.indexOf(m),n),r.size()<4095&&(r.size()==1<<n&&(n+=1),r.add(m+f)),m=f)}return u.write(r.indexOf(m),n),u.write(i,n),u.flush(),p.toByteArray()},a=function(){var t={},e=0,i={add:function(n){if(i.contains(n))throw"dup key:"+n;t[n]=e,e+=1},size:function(){return e},indexOf:function(e){return t[e]},contains:function(e){return void 0!==t[e]}};return i};return r}(t,e),o=0;o<e;o+=1)for(var r=0;r<t;r+=1)n.setPixel(r,o,i(r,o));var s=S();n.write(s);for(var a=function(){var t=0,e=0,i=0,n="",o={},r=function(t){n+=String.fromCharCode(s(63&t))},s=function(t){if(t<0);else{if(t<26)return 65+t;if(t<52)return t-26+97;if(t<62)return t-52+48;if(62==t)return 43;if(63==t)return 47}throw"n:"+t};return o.writeByte=function(n){for(t=t<<8|255&n,e+=8,i+=1;e>=6;)r(t>>>e-6),e-=6},o.flush=function(){if(e>0&&(r(t<<6-e),t=0,e=0),i%3!=0)for(var o=3-i%3,s=0;s<o;s+=1)n+="="},o.toString=function(){return n},o}(),l=s.toByteArray(),h=0;h<l.length;h+=1)a.writeByte(l[h]);return a.flush(),"data:image/gif;base64,"+a};return t}();r.stringToBytesFuncs["UTF-8"]=function(t){return function(t){for(var e=[],i=0;i<t.length;i++){var n=t.charCodeAt(i);n<128?e.push(n):n<2048?e.push(192|n>>6,128|63&n):n<55296||n>=57344?e.push(224|n>>12,128|n>>6&63,128|63&n):(i++,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return e}(t)},n=[],void 0===(o="function"==typeof(i=function(){return r})?i.apply(e,n):i)||(t.exports=o)},458:function(t,e,i){var n,o,r; /*! * Select2 4.0.13 * https://select2.github.io * * Released under the MIT license * https://github.com/select2/select2/blob/master/LICENSE.md */o=[i(669)],n=function(t){var e=function(){if(t&&t.fn&&t.fn.select2&&t.fn.select2.amd)var e=t.fn.select2.amd;var i,n,o;return e&&e.requirejs||(e?n=e:e={},function(t){var e,r,s,a,l={},h={},c={},p={},u=Object.prototype.hasOwnProperty,d=[].slice,m=/\.js$/;function f(t,e){return u.call(t,e)}function g(t,e){var i,n,o,r,s,a,l,h,p,u,d,f=e&&e.split("/"),g=c.map,_=g&&g["*"]||{};if(t){for(s=(t=t.split("/")).length-1,c.nodeIdCompat&&m.test(t[s])&&(t[s]=t[s].replace(m,"")),"."===t[0].charAt(0)&&f&&(t=f.slice(0,f.length-1).concat(t)),p=0;p<t.length;p++)if("."===(d=t[p]))t.splice(p,1),p-=1;else if(".."===d){if(0===p||1===p&&".."===t[2]||".."===t[p-1])continue;p>0&&(t.splice(p-1,2),p-=2)}t=t.join("/")}if((f||_)&&g){for(p=(i=t.split("/")).length;p>0;p-=1){if(n=i.slice(0,p).join("/"),f)for(u=f.length;u>0;u-=1)if((o=g[f.slice(0,u).join("/")])&&(o=o[n])){r=o,a=p;break}if(r)break;!l&&_&&_[n]&&(l=_[n],h=p)}!r&&l&&(r=l,a=h),r&&(i.splice(0,a,r),t=i.join("/"))}return t}function _(e,i){return function(){var n=d.call(arguments,0);return"string"!=typeof n[0]&&1===n.length&&n.push(null),r.apply(t,n.concat([e,i]))}}function v(t){return function(e){return g(e,t)}}function y(t){return function(e){l[t]=e}}function b(i){if(f(h,i)){var n=h[i];delete h[i],p[i]=!0,e.apply(t,n)}if(!f(l,i)&&!f(p,i))throw new Error("No "+i);return l[i]}function x(t){var e,i=t?t.indexOf("!"):-1;return i>-1&&(e=t.substring(0,i),t=t.substring(i+1,t.length)),[e,t]}function k(t){return t?x(t):[]}function L(t){return function(){return c&&c.config&&c.config[t]||{}}}s=function(t,e){var i,n=x(t),o=n[0],r=e[1];return t=n[1],o&&(i=b(o=g(o,r))),o?t=i&&i.normalize?i.normalize(t,v(r)):g(t,r):(o=(n=x(t=g(t,r)))[0],t=n[1],o&&(i=b(o))),{f:o?o+"!"+t:t,n:t,pr:o,p:i}},a={require:function(t){return _(t)},exports:function(t){var e=l[t];return void 0!==e?e:l[t]={}},module:function(t){return{id:t,uri:"",exports:l[t],config:L(t)}}},e=function(e,i,n,o){var r,c,u,d,m,g,v,x=[],L=typeof n;if(g=k(o=o||e),"undefined"===L||"function"===L){for(i=!i.length&&n.length?["require","exports","module"]:i,m=0;m<i.length;m+=1)if("require"===(c=(d=s(i[m],g)).f))x[m]=a.require(e);else if("exports"===c)x[m]=a.exports(e),v=!0;else if("module"===c)r=x[m]=a.module(e);else if(f(l,c)||f(h,c)||f(p,c))x[m]=b(c);else{if(!d.p)throw new Error(e+" missing "+c);d.p.load(d.n,_(o,!0),y(c),{}),x[m]=l[c]}u=n?n.apply(l[e],x):void 0,e&&(r&&r.exports!==t&&r.exports!==l[e]?l[e]=r.exports:u===t&&v||(l[e]=u))}else e&&(l[e]=n)},i=n=r=function(i,n,o,l,h){if("string"==typeof i)return a[i]?a[i](n):b(s(i,k(n)).f);if(!i.splice){if((c=i).deps&&r(c.deps,c.callback),!n)return;n.splice?(i=n,n=o,o=null):i=t}return n=n||function(){},"function"==typeof o&&(o=l,l=h),l?e(t,i,n,o):setTimeout((function(){e(t,i,n,o)}),4),r},r.config=function(t){return r(t)},i._defined=l,(o=function(t,e,i){if("string"!=typeof t)throw new Error("See almond README: incorrect module build, no module name");e.splice||(i=e,e=[]),f(l,t)||f(h,t)||(h[t]=[t,e,i])}).amd={jQuery:!0}}(),e.requirejs=i,e.require=n,e.define=o),e.define("almond",(function(){})),e.define("jquery",[],(function(){var e=t||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e})),e.define("select2/utils",["jquery"],(function(t){var e={};function i(t){var e=t.prototype,i=[];for(var n in e)"function"==typeof e[n]&&"constructor"!==n&&i.push(n);return i}e.Extend=function(t,e){var i={}.hasOwnProperty;function n(){this.constructor=t}for(var o in e)i.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},e.Decorate=function(t,e){var n=i(e),o=i(t);function r(){var i=Array.prototype.unshift,n=e.prototype.constructor.length,o=t.prototype.constructor;n>0&&(i.call(arguments,t.prototype.constructor),o=e.prototype.constructor),o.apply(this,arguments)}function s(){this.constructor=r}e.displayName=t.displayName,r.prototype=new s;for(var a=0;a<o.length;a++){var l=o[a];r.prototype[l]=t.prototype[l]}for(var h=function(t){var i=function(){};t in r.prototype&&(i=r.prototype[t]);var n=e.prototype[t];return function(){return Array.prototype.unshift.call(arguments,i),n.apply(this,arguments)}},c=0;c<n.length;c++){var p=n[c];r.prototype[p]=h(p)}return r};var n=function(){this.listeners={}};n.prototype.on=function(t,e){this.listeners=this.listeners||{},t in this.listeners?this.listeners[t].push(e):this.listeners[t]=[e]},n.prototype.trigger=function(t){var e=Array.prototype.slice,i=e.call(arguments,1);this.listeners=this.listeners||{},null==i&&(i=[]),0===i.length&&i.push({}),i[0]._type=t,t in this.listeners&&this.invoke(this.listeners[t],e.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},n.prototype.invoke=function(t,e){for(var i=0,n=t.length;i<n;i++)t[i].apply(this,e)},e.Observable=n,e.generateChars=function(t){for(var e="",i=0;i<t;i++)e+=Math.floor(36*Math.random()).toString(36);return e},e.bind=function(t,e){return function(){t.apply(e,arguments)}},e._convertData=function(t){for(var e in t){var i=e.split("-"),n=t;if(1!==i.length){for(var o=0;o<i.length;o++){var r=i[o];(r=r.substring(0,1).toLowerCase()+r.substring(1))in n||(n[r]={}),o==i.length-1&&(n[r]=t[e]),n=n[r]}delete t[e]}}return t},e.hasScroll=function(e,i){var n=t(i),o=i.style.overflowX,r=i.style.overflowY;return(o!==r||"hidden"!==r&&"visible"!==r)&&("scroll"===o||"scroll"===r||n.innerHeight()<i.scrollHeight||n.innerWidth()<i.scrollWidth)},e.escapeMarkup=function(t){var e={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof t?t:String(t).replace(/[&<>"'\/\\]/g,(function(t){return e[t]}))},e.appendMany=function(e,i){if("1.7"===t.fn.jquery.substr(0,3)){var n=t();t.map(i,(function(t){n=n.add(t)})),i=n}e.append(i)},e.__cache={};var o=0;return e.GetUniqueElementId=function(t){var e=t.getAttribute("data-select2-id");return null==e&&(t.id?(e=t.id,t.setAttribute("data-select2-id",e)):(t.setAttribute("data-select2-id",++o),e=o.toString())),e},e.StoreData=function(t,i,n){var o=e.GetUniqueElementId(t);e.__cache[o]||(e.__cache[o]={}),e.__cache[o][i]=n},e.GetData=function(i,n){var o=e.GetUniqueElementId(i);return n?e.__cache[o]&&null!=e.__cache[o][n]?e.__cache[o][n]:t(i).data(n):e.__cache[o]},e.RemoveData=function(t){var i=e.GetUniqueElementId(t);null!=e.__cache[i]&&delete e.__cache[i],t.removeAttribute("data-select2-id")},e})),e.define("select2/results",["jquery","./utils"],(function(t,e){function i(t,e,n){this.$element=t,this.data=n,this.options=e,i.__super__.constructor.call(this)}return e.Extend(i,e.Observable),i.prototype.render=function(){var e=t('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e,e},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(e){var i=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=t('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),o=this.options.get("translations").get(e.message);n.append(i(o(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(t){this.hideLoading();var e=[];if(null!=t.results&&0!==t.results.length){t.results=this.sort(t.results);for(var i=0;i<t.results.length;i++){var n=t.results[i],o=this.option(n);e.push(o)}this.$results.append(e)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},i.prototype.position=function(t,e){e.find(".select2-results").append(t)},i.prototype.sort=function(t){return this.options.get("sorter")(t)},i.prototype.highlightFirstItem=function(){var t=this.$results.find(".select2-results__option[aria-selected]"),e=t.filter("[aria-selected=true]");e.length>0?e.first().trigger("mouseenter"):t.first().trigger("mouseenter"),this.ensureHighlightVisible()},i.prototype.setClasses=function(){var i=this;this.data.current((function(n){var o=t.map(n,(function(t){return t.id.toString()}));i.$results.find(".select2-results__option[aria-selected]").each((function(){var i=t(this),n=e.GetData(this,"data"),r=""+n.id;null!=n.element&&n.element.selected||null==n.element&&t.inArray(r,o)>-1?i.attr("aria-selected","true"):i.attr("aria-selected","false")}))}))},i.prototype.showLoading=function(t){this.hideLoading();var e={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(t)},i=this.option(e);i.className+=" loading-results",this.$results.prepend(i)},i.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},i.prototype.option=function(i){var n=document.createElement("li");n.className="select2-results__option";var o={role:"option","aria-selected":"false"},r=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var s in(null!=i.element&&r.call(i.element,":disabled")||null==i.element&&i.disabled)&&(delete o["aria-selected"],o["aria-disabled"]="true"),null==i.id&&delete o["aria-selected"],null!=i._resultId&&(n.id=i._resultId),i.title&&(n.title=i.title),i.children&&(o.role="group",o["aria-label"]=i.text,delete o["aria-selected"]),o){var a=o[s];n.setAttribute(s,a)}if(i.children){var l=t(n),h=document.createElement("strong");h.className="select2-results__group",t(h),this.template(i,h);for(var c=[],p=0;p<i.children.length;p++){var u=i.children[p],d=this.option(u);c.push(d)}var m=t("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});m.append(c),l.append(h),l.append(m)}else this.template(i,n);return e.StoreData(n,"data",i),n},i.prototype.bind=function(i,n){var o=this,r=i.id+"-results";this.$results.attr("id",r),i.on("results:all",(function(t){o.clear(),o.append(t.data),i.isOpen()&&(o.setClasses(),o.highlightFirstItem())})),i.on("results:append",(function(t){o.append(t.data),i.isOpen()&&o.setClasses()})),i.on("query",(function(t){o.hideMessages(),o.showLoading(t)})),i.on("select",(function(){i.isOpen()&&(o.setClasses(),o.options.get("scrollAfterSelect")&&o.highlightFirstItem())})),i.on("unselect",(function(){i.isOpen()&&(o.setClasses(),o.options.get("scrollAfterSelect")&&o.highlightFirstItem())})),i.on("open",(function(){o.$results.attr("aria-expanded","true"),o.$results.attr("aria-hidden","false"),o.setClasses(),o.ensureHighlightVisible()})),i.on("close",(function(){o.$results.attr("aria-expanded","false"),o.$results.attr("aria-hidden","true"),o.$results.removeAttr("aria-activedescendant")})),i.on("results:toggle",(function(){var t=o.getHighlightedResults();0!==t.length&&t.trigger("mouseup")})),i.on("results:select",(function(){var t=o.getHighlightedResults();if(0!==t.length){var i=e.GetData(t[0],"data");"true"==t.attr("aria-selected")?o.trigger("close",{}):o.trigger("select",{data:i})}})),i.on("results:previous",(function(){var t=o.getHighlightedResults(),e=o.$results.find("[aria-selected]"),i=e.index(t);if(!(i<=0)){var n=i-1;0===t.length&&(n=0);var r=e.eq(n);r.trigger("mouseenter");var s=o.$results.offset().top,a=r.offset().top,l=o.$results.scrollTop()+(a-s);0===n?o.$results.scrollTop(0):a-s<0&&o.$results.scrollTop(l)}})),i.on("results:next",(function(){var t=o.getHighlightedResults(),e=o.$results.find("[aria-selected]"),i=e.index(t)+1;if(!(i>=e.length)){var n=e.eq(i);n.trigger("mouseenter");var r=o.$results.offset().top+o.$results.outerHeight(!1),s=n.offset().top+n.outerHeight(!1),a=o.$results.scrollTop()+s-r;0===i?o.$results.scrollTop(0):s>r&&o.$results.scrollTop(a)}})),i.on("results:focus",(function(t){t.element.addClass("select2-results__option--highlighted")})),i.on("results:message",(function(t){o.displayMessage(t)})),t.fn.mousewheel&&this.$results.on("mousewheel",(function(t){var e=o.$results.scrollTop(),i=o.$results.get(0).scrollHeight-e+t.deltaY,n=t.deltaY>0&&e-t.deltaY<=0,r=t.deltaY<0&&i<=o.$results.height();n?(o.$results.scrollTop(0),t.preventDefault(),t.stopPropagation()):r&&(o.$results.scrollTop(o.$results.get(0).scrollHeight-o.$results.height()),t.preventDefault(),t.stopPropagation())})),this.$results.on("mouseup",".select2-results__option[aria-selected]",(function(i){var n=t(this),r=e.GetData(this,"data");"true"!==n.attr("aria-selected")?o.trigger("select",{originalEvent:i,data:r}):o.options.get("multiple")?o.trigger("unselect",{originalEvent:i,data:r}):o.trigger("close",{})})),this.$results.on("mouseenter",".select2-results__option[aria-selected]",(function(i){var n=e.GetData(this,"data");o.getHighlightedResults().removeClass("select2-results__option--highlighted"),o.trigger("results:focus",{data:n,element:t(this)})}))},i.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},i.prototype.destroy=function(){this.$results.remove()},i.prototype.ensureHighlightVisible=function(){var t=this.getHighlightedResults();if(0!==t.length){var e=this.$results.find("[aria-selected]").index(t),i=this.$results.offset().top,n=t.offset().top,o=this.$results.scrollTop()+(n-i),r=n-i;o-=2*t.outerHeight(!1),e<=2?this.$results.scrollTop(0):(r>this.$results.outerHeight()||r<0)&&this.$results.scrollTop(o)}},i.prototype.template=function(e,i){var n=this.options.get("templateResult"),o=this.options.get("escapeMarkup"),r=n(e,i);null==r?i.style.display="none":"string"==typeof r?i.innerHTML=o(r):t(i).append(r)},i})),e.define("select2/keys",[],(function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}})),e.define("select2/selection/base",["jquery","../utils","../keys"],(function(t,e,i){function n(t,e){this.$element=t,this.options=e,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var i=t('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=e.GetData(this.$element[0],"old-tabindex")?this._tabindex=e.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),i.attr("title",this.$element.attr("title")),i.attr("tabindex",this._tabindex),i.attr("aria-disabled","false"),this.$selection=i,i},n.prototype.bind=function(t,e){var n=this,o=t.id+"-results";this.container=t,this.$selection.on("focus",(function(t){n.trigger("focus",t)})),this.$selection.on("blur",(function(t){n._handleBlur(t)})),this.$selection.on("keydown",(function(t){n.trigger("keypress",t),t.which===i.SPACE&&t.preventDefault()})),t.on("results:focus",(function(t){n.$selection.attr("aria-activedescendant",t.data._resultId)})),t.on("selection:update",(function(t){n.update(t.data)})),t.on("open",(function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",o),n._attachCloseHandler(t)})),t.on("close",(function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(t)})),t.on("enable",(function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")})),t.on("disable",(function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")}))},n.prototype._handleBlur=function(e){var i=this;window.setTimeout((function(){document.activeElement==i.$selection[0]||t.contains(i.$selection[0],document.activeElement)||i.trigger("blur",e)}),1)},n.prototype._attachCloseHandler=function(i){t(document.body).on("mousedown.select2."+i.id,(function(i){var n=t(i.target).closest(".select2");t(".select2.select2-container--open").each((function(){this!=n[0]&&e.GetData(this,"element").select2("close")}))}))},n.prototype._detachCloseHandler=function(e){t(document.body).off("mousedown.select2."+e.id)},n.prototype.position=function(t,e){e.find(".selection").append(t)},n.prototype.destroy=function(){this._detachCloseHandler(this.container)},n.prototype.update=function(t){throw new Error("The `update` method must be defined in child classes.")},n.prototype.isEnabled=function(){return!this.isDisabled()},n.prototype.isDisabled=function(){return this.options.get("disabled")},n})),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],(function(t,e,i,n){function o(){o.__super__.constructor.apply(this,arguments)}return i.Extend(o,e),o.prototype.render=function(){var t=o.__super__.render.call(this);return t.addClass("select2-selection--single"),t.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),t},o.prototype.bind=function(t,e){var i=this;o.__super__.bind.apply(this,arguments);var n=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",n).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",n),this.$selection.on("mousedown",(function(t){1===t.which&&i.trigger("toggle",{originalEvent:t})})),this.$selection.on("focus",(function(t){})),this.$selection.on("blur",(function(t){})),t.on("focus",(function(e){t.isOpen()||i.$selection.trigger("focus")}))},o.prototype.clear=function(){var t=this.$selection.find(".select2-selection__rendered");t.empty(),t.removeAttr("title")},o.prototype.display=function(t,e){var i=this.options.get("templateSelection");return this.options.get("escapeMarkup")(i(t,e))},o.prototype.selectionContainer=function(){return t("<span></span>")},o.prototype.update=function(t){if(0!==t.length){var e=t[0],i=this.$selection.find(".select2-selection__rendered"),n=this.display(e,i);i.empty().append(n);var o=e.title||e.text;o?i.attr("title",o):i.removeAttr("title")}else this.clear()},o})),e.define("select2/selection/multiple",["jquery","./base","../utils"],(function(t,e,i){function n(t,e){n.__super__.constructor.apply(this,arguments)}return i.Extend(n,e),n.prototype.render=function(){var t=n.__super__.render.call(this);return t.addClass("select2-selection--multiple"),t.html('<ul class="select2-selection__rendered"></ul>'),t},n.prototype.bind=function(e,o){var r=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",(function(t){r.trigger("toggle",{originalEvent:t})})),this.$selection.on("click",".select2-selection__choice__remove",(function(e){if(!r.isDisabled()){var n=t(this).parent(),o=i.GetData(n[0],"data");r.trigger("unselect",{originalEvent:e,data:o})}}))},n.prototype.clear=function(){var t=this.$selection.find(".select2-selection__rendered");t.empty(),t.removeAttr("title")},n.prototype.display=function(t,e){var i=this.options.get("templateSelection");return this.options.get("escapeMarkup")(i(t,e))},n.prototype.selectionContainer=function(){return t('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},n.prototype.update=function(t){if(this.clear(),0!==t.length){for(var e=[],n=0;n<t.length;n++){var o=t[n],r=this.selectionContainer(),s=this.display(o,r);r.append(s);var a=o.title||o.text;a&&r.attr("title",a),i.StoreData(r[0],"data",o),e.push(r)}var l=this.$selection.find(".select2-selection__rendered");i.appendMany(l,e)}},n})),e.define("select2/selection/placeholder",["../utils"],(function(t){function e(t,e,i){this.placeholder=this.normalizePlaceholder(i.get("placeholder")),t.call(this,e,i)}return e.prototype.normalizePlaceholder=function(t,e){return"string"==typeof e&&(e={id:"",text:e}),e},e.prototype.createPlaceholder=function(t,e){var i=this.selectionContainer();return i.html(this.display(e)),i.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),i},e.prototype.update=function(t,e){var i=1==e.length&&e[0].id!=this.placeholder.id;if(e.length>1||i)return t.call(this,e);this.clear();var n=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(n)},e})),e.define("select2/selection/allowClear",["jquery","../keys","../utils"],(function(t,e,i){function n(){}return n.prototype.bind=function(t,e,i){var n=this;t.call(this,e,i),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",(function(t){n._handleClear(t)})),e.on("keypress",(function(t){n._handleKeyboardClear(t,e)}))},n.prototype._handleClear=function(t,e){if(!this.isDisabled()){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){e.stopPropagation();var o=i.GetData(n[0],"data"),r=this.$element.val();this.$element.val(this.placeholder.id);var s={data:o};if(this.trigger("clear",s),s.prevented)this.$element.val(r);else{for(var a=0;a<o.length;a++)if(s={data:o[a]},this.trigger("unselect",s),s.prevented)return void this.$element.val(r);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},n.prototype._handleKeyboardClear=function(t,i,n){n.isOpen()||i.which!=e.DELETE&&i.which!=e.BACKSPACE||this._handleClear(i)},n.prototype.update=function(e,n){if(e.call(this,n),!(this.$selection.find(".select2-selection__placeholder").length>0||0===n.length)){var o=this.options.get("translations").get("removeAllItems"),r=t('<span class="select2-selection__clear" title="'+o()+'">×</span>');i.StoreData(r[0],"data",n),this.$selection.find(".select2-selection__rendered").prepend(r)}},n})),e.define("select2/selection/search",["jquery","../utils","../keys"],(function(t,e,i){function n(t,e,i){t.call(this,e,i)}return n.prototype.render=function(e){var i=t('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>');this.$searchContainer=i,this.$search=i.find("input");var n=e.call(this);return this._transferTabIndex(),n},n.prototype.bind=function(t,n,o){var r=this,s=n.id+"-results";t.call(this,n,o),n.on("open",(function(){r.$search.attr("aria-controls",s),r.$search.trigger("focus")})),n.on("close",(function(){r.$search.val(""),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")})),n.on("enable",(function(){r.$search.prop("disabled",!1),r._transferTabIndex()})),n.on("disable",(function(){r.$search.prop("disabled",!0)})),n.on("focus",(function(t){r.$search.trigger("focus")})),n.on("results:focus",(function(t){t.data._resultId?r.$search.attr("aria-activedescendant",t.data._resultId):r.$search.removeAttr("aria-activedescendant")})),this.$selection.on("focusin",".select2-search--inline",(function(t){r.trigger("focus",t)})),this.$selection.on("focusout",".select2-search--inline",(function(t){r._handleBlur(t)})),this.$selection.on("keydown",".select2-search--inline",(function(t){if(t.stopPropagation(),r.trigger("keypress",t),r._keyUpPrevented=t.isDefaultPrevented(),t.which===i.BACKSPACE&&""===r.$search.val()){var n=r.$searchContainer.prev(".select2-selection__choice");if(n.length>0){var o=e.GetData(n[0],"data");r.searchRemoveChoice(o),t.preventDefault()}}})),this.$selection.on("click",".select2-search--inline",(function(t){r.$search.val()&&t.stopPropagation()}));var a=document.documentMode,l=a&&a<=11;this.$selection.on("input.searchcheck",".select2-search--inline",(function(t){l?r.$selection.off("input.search input.searchcheck"):r.$selection.off("keyup.search")})),this.$selection.on("keyup.search input.search",".select2-search--inline",(function(t){if(l&&"input"===t.type)r.$selection.off("input.search input.searchcheck");else{var e=t.which;e!=i.SHIFT&&e!=i.CTRL&&e!=i.ALT&&e!=i.TAB&&r.handleSearch(t)}}))},n.prototype._transferTabIndex=function(t){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},n.prototype.createPlaceholder=function(t,e){this.$search.attr("placeholder",e.text)},n.prototype.update=function(t,e){var i=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),t.call(this,e),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),i&&this.$search.trigger("focus")},n.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},n.prototype.searchRemoveChoice=function(t,e){this.trigger("unselect",{data:e}),this.$search.val(e.text),this.handleSearch()},n.prototype.resizeSearch=function(){this.$search.css("width","25px");var t="";t=""!==this.$search.attr("placeholder")?this.$selection.find(".select2-selection__rendered").width():.75*(this.$search.val().length+1)+"em",this.$search.css("width",t)},n})),e.define("select2/selection/eventRelay",["jquery"],(function(t){function e(){}return e.prototype.bind=function(e,i,n){var o=this,r=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],s=["opening","closing","selecting","unselecting","clearing"];e.call(this,i,n),i.on("*",(function(e,i){if(-1!==t.inArray(e,r)){i=i||{};var n=t.Event("select2:"+e,{params:i});o.$element.trigger(n),-1!==t.inArray(e,s)&&(i.prevented=n.isDefaultPrevented())}}))},e})),e.define("select2/translation",["jquery","require"],(function(t,e){function i(t){this.dict=t||{}}return i.prototype.all=function(){return this.dict},i.prototype.get=function(t){return this.dict[t]},i.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},i._cache={},i.loadPath=function(t){if(!(t in i._cache)){var n=e(t);i._cache[t]=n}return new i(i._cache[t])},i})),e.define("select2/diacritics",[],(function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}})),e.define("select2/data/base",["../utils"],(function(t){function e(t,i){e.__super__.constructor.call(this)}return t.Extend(e,t.Observable),e.prototype.current=function(t){throw new Error("The `current` method must be defined in child classes.")},e.prototype.query=function(t,e){throw new Error("The `query` method must be defined in child classes.")},e.prototype.bind=function(t,e){},e.prototype.destroy=function(){},e.prototype.generateResultId=function(e,i){var n=e.id+"-result-";return n+=t.generateChars(4),null!=i.id?n+="-"+i.id.toString():n+="-"+t.generateChars(4),n},e})),e.define("select2/data/select",["./base","../utils","jquery"],(function(t,e,i){function n(t,e){this.$element=t,this.options=e,n.__super__.constructor.call(this)}return e.Extend(n,t),n.prototype.current=function(t){var e=[],n=this;this.$element.find(":selected").each((function(){var t=i(this),o=n.item(t);e.push(o)})),t(e)},n.prototype.select=function(t){var e=this;if(t.selected=!0,i(t.element).is("option"))return t.element.selected=!0,void this.$element.trigger("input").trigger("change");if(this.$element.prop("multiple"))this.current((function(n){var o=[];(t=[t]).push.apply(t,n);for(var r=0;r<t.length;r++){var s=t[r].id;-1===i.inArray(s,o)&&o.push(s)}e.$element.val(o),e.$element.trigger("input").trigger("change")}));else{var n=t.id;this.$element.val(n),this.$element.trigger("input").trigger("change")}},n.prototype.unselect=function(t){var e=this;if(this.$element.prop("multiple")){if(t.selected=!1,i(t.element).is("option"))return t.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current((function(n){for(var o=[],r=0;r<n.length;r++){var s=n[r].id;s!==t.id&&-1===i.inArray(s,o)&&o.push(s)}e.$element.val(o),e.$element.trigger("input").trigger("change")}))}},n.prototype.bind=function(t,e){var i=this;this.container=t,t.on("select",(function(t){i.select(t.data)})),t.on("unselect",(function(t){i.unselect(t.data)}))},n.prototype.destroy=function(){this.$element.find("*").each((function(){e.RemoveData(this)}))},n.prototype.query=function(t,e){var n=[],o=this;this.$element.children().each((function(){var e=i(this);if(e.is("option")||e.is("optgroup")){var r=o.item(e),s=o.matches(t,r);null!==s&&n.push(s)}})),e({results:n})},n.prototype.addOptions=function(t){e.appendMany(this.$element,t)},n.prototype.option=function(t){var n;t.children?(n=document.createElement("optgroup")).label=t.text:void 0!==(n=document.createElement("option")).textContent?n.textContent=t.text:n.innerText=t.text,void 0!==t.id&&(n.value=t.id),t.disabled&&(n.disabled=!0),t.selected&&(n.selected=!0),t.title&&(n.title=t.title);var o=i(n),r=this._normalizeItem(t);return r.element=n,e.StoreData(n,"data",r),o},n.prototype.item=function(t){var n={};if(null!=(n=e.GetData(t[0],"data")))return n;if(t.is("option"))n={id:t.val(),text:t.text(),disabled:t.prop("disabled"),selected:t.prop("selected"),title:t.prop("title")};else if(t.is("optgroup")){n={text:t.prop("label"),children:[],title:t.prop("title")};for(var o=t.children("option"),r=[],s=0;s<o.length;s++){var a=i(o[s]),l=this.item(a);r.push(l)}n.children=r}return(n=this._normalizeItem(n)).element=t[0],e.StoreData(t[0],"data",n),n},n.prototype._normalizeItem=function(t){t!==Object(t)&&(t={id:t,text:t});var e={selected:!1,disabled:!1};return null!=(t=i.extend({},{text:""},t)).id&&(t.id=t.id.toString()),null!=t.text&&(t.text=t.text.toString()),null==t._resultId&&t.id&&null!=this.container&&(t._resultId=this.generateResultId(this.container,t)),i.extend({},e,t)},n.prototype.matches=function(t,e){return this.options.get("matcher")(t,e)},n})),e.define("select2/data/array",["./select","../utils","jquery"],(function(t,e,i){function n(t,e){this._dataToConvert=e.get("data")||[],n.__super__.constructor.call(this,t,e)}return e.Extend(n,t),n.prototype.bind=function(t,e){n.__super__.bind.call(this,t,e),this.addOptions(this.convertToOptions(this._dataToConvert))},n.prototype.select=function(t){var e=this.$element.find("option").filter((function(e,i){return i.value==t.id.toString()}));0===e.length&&(e=this.option(t),this.addOptions(e)),n.__super__.select.call(this,t)},n.prototype.convertToOptions=function(t){var n=this,o=this.$element.find("option"),r=o.map((function(){return n.item(i(this)).id})).get(),s=[];function a(t){return function(){return i(this).val()==t.id}}for(var l=0;l<t.length;l++){var h=this._normalizeItem(t[l]);if(i.inArray(h.id,r)>=0){var c=o.filter(a(h)),p=this.item(c),u=i.extend(!0,{},h,p),d=this.option(u);c.replaceWith(d)}else{var m=this.option(h);if(h.children){var f=this.convertToOptions(h.children);e.appendMany(m,f)}s.push(m)}}return s},n})),e.define("select2/data/ajax",["./array","../utils","jquery"],(function(t,e,i){function n(t,e){this.ajaxOptions=this._applyDefaults(e.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,t,e)}return e.Extend(n,t),n.prototype._applyDefaults=function(t){var e={data:function(t){return i.extend({},t,{q:t.term})},transport:function(t,e,n){var o=i.ajax(t);return o.then(e),o.fail(n),o}};return i.extend({},e,t,!0)},n.prototype.processResults=function(t){return t},n.prototype.query=function(t,e){var n=this;null!=this._request&&(i.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var o=i.extend({type:"GET"},this.ajaxOptions);function r(){var r=o.transport(o,(function(o){var r=n.processResults(o,t);n.options.get("debug")&&window.console&&console.error&&(r&&r.results&&i.isArray(r.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),e(r)}),(function(){(!("status"in r)||0!==r.status&&"0"!==r.status)&&n.trigger("results:message",{message:"errorLoading"})}));n._request=r}"function"==typeof o.url&&(o.url=o.url.call(this.$element,t)),"function"==typeof o.data&&(o.data=o.data.call(this.$element,t)),this.ajaxOptions.delay&&null!=t.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(r,this.ajaxOptions.delay)):r()},n})),e.define("select2/data/tags",["jquery"],(function(t){function e(e,i,n){var o=n.get("tags"),r=n.get("createTag");void 0!==r&&(this.createTag=r);var s=n.get("insertTag");if(void 0!==s&&(this.insertTag=s),e.call(this,i,n),t.isArray(o))for(var a=0;a<o.length;a++){var l=o[a],h=this._normalizeItem(l),c=this.option(h);this.$element.append(c)}}return e.prototype.query=function(t,e,i){var n=this;function o(t,r){for(var s=t.results,a=0;a<s.length;a++){var l=s[a],h=null!=l.children&&!o({results:l.children},!0);if((l.text||"").toUpperCase()===(e.term||"").toUpperCase()||h)return!r&&(t.data=s,void i(t))}if(r)return!0;var c=n.createTag(e);if(null!=c){var p=n.option(c);p.attr("data-select2-tag",!0),n.addOptions([p]),n.insertTag(s,c)}t.results=s,i(t)}this._removeOldTags(),null!=e.term&&null==e.page?t.call(this,e,o):t.call(this,e,i)},e.prototype.createTag=function(e,i){var n=t.trim(i.term);return""===n?null:{id:n,text:n}},e.prototype.insertTag=function(t,e,i){e.unshift(i)},e.prototype._removeOldTags=function(e){this.$element.find("option[data-select2-tag]").each((function(){this.selected||t(this).remove()}))},e})),e.define("select2/data/tokenizer",["jquery"],(function(t){function e(t,e,i){var n=i.get("tokenizer");void 0!==n&&(this.tokenizer=n),t.call(this,e,i)}return e.prototype.bind=function(t,e,i){t.call(this,e,i),this.$search=e.dropdown.$search||e.selection.$search||i.find(".select2-search__field")},e.prototype.query=function(e,i,n){var o=this;function r(e){var i=o._normalizeItem(e);if(!o.$element.find("option").filter((function(){return t(this).val()===i.id})).length){var n=o.option(i);n.attr("data-select2-tag",!0),o._removeOldTags(),o.addOptions([n])}s(i)}function s(t){o.trigger("select",{data:t})}i.term=i.term||"";var a=this.tokenizer(i,this.options,r);a.term!==i.term&&(this.$search.length&&(this.$search.val(a.term),this.$search.trigger("focus")),i.term=a.term),e.call(this,i,n)},e.prototype.tokenizer=function(e,i,n,o){for(var r=n.get("tokenSeparators")||[],s=i.term,a=0,l=this.createTag||function(t){return{id:t.term,text:t.term}};a<s.length;){var h=s[a];if(-1!==t.inArray(h,r)){var c=s.substr(0,a),p=l(t.extend({},i,{term:c}));null!=p?(o(p),s=s.substr(a+1)||"",a=0):a++}else a++}return{term:s}},e})),e.define("select2/data/minimumInputLength",[],(function(){function t(t,e,i){this.minimumInputLength=i.get("minimumInputLength"),t.call(this,e,i)}return t.prototype.query=function(t,e,i){e.term=e.term||"",e.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:e.term,params:e}}):t.call(this,e,i)},t})),e.define("select2/data/maximumInputLength",[],(function(){function t(t,e,i){this.maximumInputLength=i.get("maximumInputLength"),t.call(this,e,i)}return t.prototype.query=function(t,e,i){e.term=e.term||"",this.maximumInputLength>0&&e.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:e.term,params:e}}):t.call(this,e,i)},t})),e.define("select2/data/maximumSelectionLength",[],(function(){function t(t,e,i){this.maximumSelectionLength=i.get("maximumSelectionLength"),t.call(this,e,i)}return t.prototype.bind=function(t,e,i){var n=this;t.call(this,e,i),e.on("select",(function(){n._checkIfMaximumSelected()}))},t.prototype.query=function(t,e,i){var n=this;this._checkIfMaximumSelected((function(){t.call(n,e,i)}))},t.prototype._checkIfMaximumSelected=function(t,e){var i=this;this.current((function(t){var n=null!=t?t.length:0;i.maximumSelectionLength>0&&n>=i.maximumSelectionLength?i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):e&&e()}))},t})),e.define("select2/dropdown",["jquery","./utils"],(function(t,e){function i(t,e){this.$element=t,this.options=e,i.__super__.constructor.call(this)}return e.Extend(i,e.Observable),i.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e,e},i.prototype.bind=function(){},i.prototype.position=function(t,e){},i.prototype.destroy=function(){this.$dropdown.remove()},i})),e.define("select2/dropdown/search",["jquery","../utils"],(function(t,e){function i(){}return i.prototype.render=function(e){var i=e.call(this),n=t('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=n,this.$search=n.find("input"),i.prepend(n),i},i.prototype.bind=function(e,i,n){var o=this,r=i.id+"-results";e.call(this,i,n),this.$search.on("keydown",(function(t){o.trigger("keypress",t),o._keyUpPrevented=t.isDefaultPrevented()})),this.$search.on("input",(function(e){t(this).off("keyup")})),this.$search.on("keyup input",(function(t){o.handleSearch(t)})),i.on("open",(function(){o.$search.attr("tabindex",0),o.$search.attr("aria-controls",r),o.$search.trigger("focus"),window.setTimeout((function(){o.$search.trigger("focus")}),0)})),i.on("close",(function(){o.$search.attr("tabindex",-1),o.$search.removeAttr("aria-controls"),o.$search.removeAttr("aria-activedescendant"),o.$search.val(""),o.$search.trigger("blur")})),i.on("focus",(function(){i.isOpen()||o.$search.trigger("focus")})),i.on("results:all",(function(t){null!=t.query.term&&""!==t.query.term||(o.showSearch(t)?o.$searchContainer.removeClass("select2-search--hide"):o.$searchContainer.addClass("select2-search--hide"))})),i.on("results:focus",(function(t){t.data._resultId?o.$search.attr("aria-activedescendant",t.data._resultId):o.$search.removeAttr("aria-activedescendant")}))},i.prototype.handleSearch=function(t){if(!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},i.prototype.showSearch=function(t,e){return!0},i})),e.define("select2/dropdown/hidePlaceholder",[],(function(){function t(t,e,i,n){this.placeholder=this.normalizePlaceholder(i.get("placeholder")),t.call(this,e,i,n)}return t.prototype.append=function(t,e){e.results=this.removePlaceholder(e.results),t.call(this,e)},t.prototype.normalizePlaceholder=function(t,e){return"string"==typeof e&&(e={id:"",text:e}),e},t.prototype.removePlaceholder=function(t,e){for(var i=e.slice(0),n=e.length-1;n>=0;n--){var o=e[n];this.placeholder.id===o.id&&i.splice(n,1)}return i},t})),e.define("select2/dropdown/infiniteScroll",["jquery"],(function(t){function e(t,e,i,n){this.lastParams={},t.call(this,e,i,n),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(t,e){this.$loadingMore.remove(),this.loading=!1,t.call(this,e),this.showLoadingMore(e)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(t,e,i){var n=this;t.call(this,e,i),e.on("query",(function(t){n.lastParams=t,n.loading=!0})),e.on("query:append",(function(t){n.lastParams=t,n.loading=!0})),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=t.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&e&&this.$results.offset().top+this.$results.outerHeight(!1)+50>=this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)&&this.loadMore()},e.prototype.loadMore=function(){this.loading=!0;var e=t.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(t,e){return e.pagination&&e.pagination.more},e.prototype.createLoadingMore=function(){var e=t('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),i=this.options.get("translations").get("loadingMore");return e.html(i(this.lastParams)),e},e})),e.define("select2/dropdown/attachBody",["jquery","../utils"],(function(t,e){function i(e,i,n){this.$dropdownParent=t(n.get("dropdownParent")||document.body),e.call(this,i,n)}return i.prototype.bind=function(t,e,i){var n=this;t.call(this,e,i),e.on("open",(function(){n._showDropdown(),n._attachPositioningHandler(e),n._bindContainerResultHandlers(e)})),e.on("close",(function(){n._hideDropdown(),n._detachPositioningHandler(e)})),this.$dropdownContainer.on("mousedown",(function(t){t.stopPropagation()}))},i.prototype.destroy=function(t){t.call(this),this.$dropdownContainer.remove()},i.prototype.position=function(t,e,i){e.attr("class",i.attr("class")),e.removeClass("select2"),e.addClass("select2-container--open"),e.css({position:"absolute",top:-999999}),this.$container=i},i.prototype.render=function(e){var i=t("<span></span>"),n=e.call(this);return i.append(n),this.$dropdownContainer=i,i},i.prototype._hideDropdown=function(t){this.$dropdownContainer.detach()},i.prototype._bindContainerResultHandlers=function(t,e){if(!this._containerResultsHandlersBound){var i=this;e.on("results:all",(function(){i._positionDropdown(),i._resizeDropdown()})),e.on("results:append",(function(){i._positionDropdown(),i._resizeDropdown()})),e.on("results:message",(function(){i._positionDropdown(),i._resizeDropdown()})),e.on("select",(function(){i._positionDropdown(),i._resizeDropdown()})),e.on("unselect",(function(){i._positionDropdown(),i._resizeDropdown()})),this._containerResultsHandlersBound=!0}},i.prototype._attachPositioningHandler=function(i,n){var o=this,r="scroll.select2."+n.id,s="resize.select2."+n.id,a="orientationchange.select2."+n.id,l=this.$container.parents().filter(e.hasScroll);l.each((function(){e.StoreData(this,"select2-scroll-position",{x:t(this).scrollLeft(),y:t(this).scrollTop()})})),l.on(r,(function(i){var n=e.GetData(this,"select2-scroll-position");t(this).scrollTop(n.y)})),t(window).on(r+" "+s+" "+a,(function(t){o._positionDropdown(),o._resizeDropdown()}))},i.prototype._detachPositioningHandler=function(i,n){var o="scroll.select2."+n.id,r="resize.select2."+n.id,s="orientationchange.select2."+n.id;this.$container.parents().filter(e.hasScroll).off(o),t(window).off(o+" "+r+" "+s)},i.prototype._positionDropdown=function(){var e=t(window),i=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),o=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var s={height:this.$container.outerHeight(!1)};s.top=r.top,s.bottom=r.top+s.height;var a={height:this.$dropdown.outerHeight(!1)},l={top:e.scrollTop(),bottom:e.scrollTop()+e.height()},h=l.top<r.top-a.height,c=l.bottom>r.bottom+a.height,p={left:r.left,top:s.bottom},u=this.$dropdownParent;"static"===u.css("position")&&(u=u.offsetParent());var d={top:0,left:0};(t.contains(document.body,u[0])||u[0].isConnected)&&(d=u.offset()),p.top-=d.top,p.left-=d.left,i||n||(o="below"),c||!h||i?!h&&c&&i&&(o="below"):o="above",("above"==o||i&&"below"!==o)&&(p.top=s.top-d.top-a.height),null!=o&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+o),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+o)),this.$dropdownContainer.css(p)},i.prototype._resizeDropdown=function(){var t={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(t.minWidth=t.width,t.position="relative",t.width="auto"),this.$dropdown.css(t)},i.prototype._showDropdown=function(t){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},i})),e.define("select2/dropdown/minimumResultsForSearch",[],(function(){function t(e){for(var i=0,n=0;n<e.length;n++){var o=e[n];o.children?i+=t(o.children):i++}return i}function e(t,e,i,n){this.minimumResultsForSearch=i.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),t.call(this,e,i,n)}return e.prototype.showSearch=function(e,i){return!(t(i.data.results)<this.minimumResultsForSearch)&&e.call(this,i)},e})),e.define("select2/dropdown/selectOnClose",["../utils"],(function(t){function e(){}return e.prototype.bind=function(t,e,i){var n=this;t.call(this,e,i),e.on("close",(function(t){n._handleSelectOnClose(t)}))},e.prototype._handleSelectOnClose=function(e,i){if(i&&null!=i.originalSelect2Event){var n=i.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}var o=this.getHighlightedResults();if(!(o.length<1)){var r=t.GetData(o[0],"data");null!=r.element&&r.element.selected||null==r.element&&r.selected||this.trigger("select",{data:r})}},e})),e.define("select2/dropdown/closeOnSelect",[],(function(){function t(){}return t.prototype.bind=function(t,e,i){var n=this;t.call(this,e,i),e.on("select",(function(t){n._selectTriggered(t)})),e.on("unselect",(function(t){n._selectTriggered(t)}))},t.prototype._selectTriggered=function(t,e){var i=e.originalEvent;i&&(i.ctrlKey||i.metaKey)||this.trigger("close",{originalEvent:i,originalSelect2Event:e})},t})),e.define("select2/i18n/en",[],(function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(t){var e=t.input.length-t.maximum,i="Please delete "+e+" character";return 1!=e&&(i+="s"),i},inputTooShort:function(t){return"Please enter "+(t.minimum-t.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(t){var e="You can only select "+t.maximum+" item";return 1!=t.maximum&&(e+="s"),e},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}})),e.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],(function(t,e,i,n,o,r,s,a,l,h,c,p,u,d,m,f,g,_,v,y,b,x,k,L,w,M,C,P,S){function T(){this.reset()}return T.prototype.apply=function(c){if(null==(c=t.extend(!0,{},this.defaults,c)).dataAdapter){if(null!=c.ajax?c.dataAdapter=m:null!=c.data?c.dataAdapter=d:c.dataAdapter=u,c.minimumInputLength>0&&(c.dataAdapter=h.Decorate(c.dataAdapter,_)),c.maximumInputLength>0&&(c.dataAdapter=h.Decorate(c.dataAdapter,v)),c.maximumSelectionLength>0&&(c.dataAdapter=h.Decorate(c.dataAdapter,y)),c.tags&&(c.dataAdapter=h.Decorate(c.dataAdapter,f)),null==c.tokenSeparators&&null==c.tokenizer||(c.dataAdapter=h.Decorate(c.dataAdapter,g)),null!=c.query){var p=e(c.amdBase+"compat/query");c.dataAdapter=h.Decorate(c.dataAdapter,p)}if(null!=c.initSelection){var S=e(c.amdBase+"compat/initSelection");c.dataAdapter=h.Decorate(c.dataAdapter,S)}}if(null==c.resultsAdapter&&(c.resultsAdapter=i,null!=c.ajax&&(c.resultsAdapter=h.Decorate(c.resultsAdapter,L)),null!=c.placeholder&&(c.resultsAdapter=h.Decorate(c.resultsAdapter,k)),c.selectOnClose&&(c.resultsAdapter=h.Decorate(c.resultsAdapter,C))),null==c.dropdownAdapter){if(c.multiple)c.dropdownAdapter=b;else{var T=h.Decorate(b,x);c.dropdownAdapter=T}if(0!==c.minimumResultsForSearch&&(c.dropdownAdapter=h.Decorate(c.dropdownAdapter,M)),c.closeOnSelect&&(c.dropdownAdapter=h.Decorate(c.dropdownAdapter,P)),null!=c.dropdownCssClass||null!=c.dropdownCss||null!=c.adaptDropdownCssClass){var A=e(c.amdBase+"compat/dropdownCss");c.dropdownAdapter=h.Decorate(c.dropdownAdapter,A)}c.dropdownAdapter=h.Decorate(c.dropdownAdapter,w)}if(null==c.selectionAdapter){if(c.multiple?c.selectionAdapter=o:c.selectionAdapter=n,null!=c.placeholder&&(c.selectionAdapter=h.Decorate(c.selectionAdapter,r)),c.allowClear&&(c.selectionAdapter=h.Decorate(c.selectionAdapter,s)),c.multiple&&(c.selectionAdapter=h.Decorate(c.selectionAdapter,a)),null!=c.containerCssClass||null!=c.containerCss||null!=c.adaptContainerCssClass){var D=e(c.amdBase+"compat/containerCss");c.selectionAdapter=h.Decorate(c.selectionAdapter,D)}c.selectionAdapter=h.Decorate(c.selectionAdapter,l)}c.language=this._resolveLanguage(c.language),c.language.push("en");for(var E=[],O=0;O<c.language.length;O++){var I=c.language[O];-1===E.indexOf(I)&&E.push(I)}return c.language=E,c.translations=this._processTranslations(c.language,c.debug),c},T.prototype.reset=function(){function e(t){function e(t){return p[t]||t}return t.replace(/[^\u0000-\u007E]/g,e)}function i(n,o){if(""===t.trim(n.term))return o;if(o.children&&o.children.length>0){for(var r=t.extend(!0,{},o),s=o.children.length-1;s>=0;s--)null==i(n,o.children[s])&&r.children.splice(s,1);return r.children.length>0?r:i(n,r)}var a=e(o.text).toUpperCase(),l=e(n.term).toUpperCase();return a.indexOf(l)>-1?o:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:h.escapeMarkup,language:{},matcher:i,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(t){return t},templateResult:function(t){return t.text},templateSelection:function(t){return t.text},theme:"default",width:"resolve"}},T.prototype.applyFromElement=function(t,e){var i=t.language,n=this.defaults.language,o=e.prop("lang"),r=e.closest("[lang]").prop("lang"),s=Array.prototype.concat.call(this._resolveLanguage(o),this._resolveLanguage(i),this._resolveLanguage(n),this._resolveLanguage(r));return t.language=s,t},T.prototype._resolveLanguage=function(e){if(!e)return[];if(t.isEmptyObject(e))return[];if(t.isPlainObject(e))return[e];var i;i=t.isArray(e)?e:[e];for(var n=[],o=0;o<i.length;o++)if(n.push(i[o]),"string"==typeof i[o]&&i[o].indexOf("-")>0){var r=i[o].split("-")[0];n.push(r)}return n},T.prototype._processTranslations=function(e,i){for(var n=new c,o=0;o<e.length;o++){var r=new c,s=e[o];if("string"==typeof s)try{r=c.loadPath(s)}catch(t){try{s=this.defaults.amdLanguageBase+s,r=c.loadPath(s)}catch(t){i&&window.console&&console.warn&&console.warn('Select2: The language file for "'+s+'" could not be automatically loaded. A fallback will be used instead.')}}else r=t.isPlainObject(s)?new c(s):s;n.extend(r)}return n},T.prototype.set=function(e,i){var n={};n[t.camelCase(e)]=i;var o=h._convertData(n);t.extend(!0,this.defaults,o)},new T})),e.define("select2/options",["require","jquery","./defaults","./utils"],(function(t,e,i,n){function o(e,o){if(this.options=e,null!=o&&this.fromElement(o),null!=o&&(this.options=i.applyFromElement(this.options,o)),this.options=i.apply(this.options),o&&o.is("input")){var r=t(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=n.Decorate(this.options.dataAdapter,r)}}return o.prototype.fromElement=function(t){var i=["select2"];null==this.options.multiple&&(this.options.multiple=t.prop("multiple")),null==this.options.disabled&&(this.options.disabled=t.prop("disabled")),null==this.options.dir&&(t.prop("dir")?this.options.dir=t.prop("dir"):t.closest("[dir]").prop("dir")?this.options.dir=t.closest("[dir]").prop("dir"):this.options.dir="ltr"),t.prop("disabled",this.options.disabled),t.prop("multiple",this.options.multiple),n.GetData(t[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),n.StoreData(t[0],"data",n.GetData(t[0],"select2Tags")),n.StoreData(t[0],"tags",!0)),n.GetData(t[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),t.attr("ajax--url",n.GetData(t[0],"ajaxUrl")),n.StoreData(t[0],"ajax-Url",n.GetData(t[0],"ajaxUrl")));var o={};function r(t,e){return e.toUpperCase()}for(var s=0;s<t[0].attributes.length;s++){var a=t[0].attributes[s].name,l="data-";if(a.substr(0,l.length)==l){var h=a.substring(l.length),c=n.GetData(t[0],h);o[h.replace(/-([a-z])/g,r)]=c}}e.fn.jquery&&"1."==e.fn.jquery.substr(0,2)&&t[0].dataset&&(o=e.extend(!0,{},t[0].dataset,o));var p=e.extend(!0,{},n.GetData(t[0]),o);for(var u in p=n._convertData(p))e.inArray(u,i)>-1||(e.isPlainObject(this.options[u])?e.extend(this.options[u],p[u]):this.options[u]=p[u]);return this},o.prototype.get=function(t){return this.options[t]},o.prototype.set=function(t,e){this.options[t]=e},o})),e.define("select2/core",["jquery","./options","./utils","./keys"],(function(t,e,i,n){var o=function(t,n){null!=i.GetData(t[0],"select2")&&i.GetData(t[0],"select2").destroy(),this.$element=t,this.id=this._generateId(t),n=n||{},this.options=new e(n,t),o.__super__.constructor.call(this);var r=t.attr("tabindex")||0;i.StoreData(t[0],"old-tabindex",r),t.attr("tabindex","-1");var s=this.options.get("dataAdapter");this.dataAdapter=new s(t,this.options);var a=this.render();this._placeContainer(a);var l=this.options.get("selectionAdapter");this.selection=new l(t,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,a);var h=this.options.get("dropdownAdapter");this.dropdown=new h(t,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,a);var c=this.options.get("resultsAdapter");this.results=new c(t,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var p=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current((function(t){p.trigger("selection:update",{data:t})})),t.addClass("select2-hidden-accessible"),t.attr("aria-hidden","true"),this._syncAttributes(),i.StoreData(t[0],"select2",this),t.data("select2",this)};return i.Extend(o,i.Observable),o.prototype._generateId=function(t){return"select2-"+(null!=t.attr("id")?t.attr("id"):null!=t.attr("name")?t.attr("name")+"-"+i.generateChars(2):i.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},o.prototype._placeContainer=function(t){t.insertAfter(this.$element);var e=this._resolveWidth(this.$element,this.options.get("width"));null!=e&&t.css("width",e)},o.prototype._resolveWidth=function(t,e){var i=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==e){var n=this._resolveWidth(t,"style");return null!=n?n:this._resolveWidth(t,"element")}if("element"==e){var o=t.outerWidth(!1);return o<=0?"auto":o+"px"}if("style"==e){var r=t.attr("style");if("string"!=typeof r)return null;for(var s=r.split(";"),a=0,l=s.length;a<l;a+=1){var h=s[a].replace(/\s/g,"").match(i);if(null!==h&&h.length>=1)return h[1]}return null}return"computedstyle"==e?window.getComputedStyle(t[0]).width:e},o.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},o.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",(function(){t.dataAdapter.current((function(e){t.trigger("selection:update",{data:e})}))})),this.$element.on("focus.select2",(function(e){t.trigger("focus",e)})),this._syncA=i.bind(this._syncAttributes,this),this._syncS=i.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=e?(this._observer=new e((function(e){t._syncA(),t._syncS(null,e)})),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},o.prototype._registerDataEvents=function(){var t=this;this.dataAdapter.on("*",(function(e,i){t.trigger(e,i)}))},o.prototype._registerSelectionEvents=function(){var e=this,i=["toggle","focus"];this.selection.on("toggle",(function(){e.toggleDropdown()})),this.selection.on("focus",(function(t){e.focus(t)})),this.selection.on("*",(function(n,o){-1===t.inArray(n,i)&&e.trigger(n,o)}))},o.prototype._registerDropdownEvents=function(){var t=this;this.dropdown.on("*",(function(e,i){t.trigger(e,i)}))},o.prototype._registerResultsEvents=function(){var t=this;this.results.on("*",(function(e,i){t.trigger(e,i)}))},o.prototype._registerEvents=function(){var t=this;this.on("open",(function(){t.$container.addClass("select2-container--open")})),this.on("close",(function(){t.$container.removeClass("select2-container--open")})),this.on("enable",(function(){t.$container.removeClass("select2-container--disabled")})),this.on("disable",(function(){t.$container.addClass("select2-container--disabled")})),this.on("blur",(function(){t.$container.removeClass("select2-container--focus")})),this.on("query",(function(e){t.isOpen()||t.trigger("open",{}),this.dataAdapter.query(e,(function(i){t.trigger("results:all",{data:i,query:e})}))})),this.on("query:append",(function(e){this.dataAdapter.query(e,(function(i){t.trigger("results:append",{data:i,query:e})}))})),this.on("keypress",(function(e){var i=e.which;t.isOpen()?i===n.ESC||i===n.TAB||i===n.UP&&e.altKey?(t.close(e),e.preventDefault()):i===n.ENTER?(t.trigger("results:select",{}),e.preventDefault()):i===n.SPACE&&e.ctrlKey?(t.trigger("results:toggle",{}),e.preventDefault()):i===n.UP?(t.trigger("results:previous",{}),e.preventDefault()):i===n.DOWN&&(t.trigger("results:next",{}),e.preventDefault()):(i===n.ENTER||i===n.SPACE||i===n.DOWN&&e.altKey)&&(t.open(),e.preventDefault())}))},o.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},o.prototype._isChangeMutation=function(e,i){var n=!1,o=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(i)if(i.addedNodes&&i.addedNodes.length>0)for(var r=0;r<i.addedNodes.length;r++)i.addedNodes[r].selected&&(n=!0);else i.removedNodes&&i.removedNodes.length>0?n=!0:t.isArray(i)&&t.each(i,(function(t,e){if(o._isChangeMutation(t,e))return n=!0,!1}));else n=!0;return n}},o.prototype._syncSubtree=function(t,e){var i=this._isChangeMutation(t,e),n=this;i&&this.dataAdapter.current((function(t){n.trigger("selection:update",{data:t})}))},o.prototype.trigger=function(t,e){var i=o.__super__.trigger,n={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===e&&(e={}),t in n){var r=n[t],s={prevented:!1,name:t,args:e};if(i.call(this,r,s),s.prevented)return void(e.prevented=!0)}i.call(this,t,e)},o.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},o.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},o.prototype.close=function(t){this.isOpen()&&this.trigger("close",{originalEvent:t})},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},o.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},o.prototype.focus=function(t){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},o.prototype.enable=function(t){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=t&&0!==t.length||(t=[!0]);var e=!t[0];this.$element.prop("disabled",e)},o.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current((function(e){t=e})),t},o.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var i=e[0];t.isArray(i)&&(i=t.map(i,(function(t){return t.toString()}))),this.$element.val(i).trigger("input").trigger("change")},o.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",i.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),i.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},o.prototype.render=function(){var e=t('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),i.StoreData(e[0],"element",this.$element),e},o})),e.define("jquery-mousewheel",["jquery"],(function(t){return t})),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],(function(t,e,i,n,o){if(null==t.fn.select2){var r=["open","close","destroy"];t.fn.select2=function(e){if("object"==typeof(e=e||{}))return this.each((function(){var n=t.extend(!0,{},e);new i(t(this),n)})),this;if("string"==typeof e){var n,s=Array.prototype.slice.call(arguments,1);return this.each((function(){var t=o.GetData(this,"select2");null==t&&window.console&&console.error&&console.error("The select2('"+e+"') method was called on an element that is not using Select2."),n=t[e].apply(t,s)})),t.inArray(e,r)>-1?this:n}throw new Error("Invalid arguments for Select2: "+e)}}return null==t.fn.select2.defaults&&(t.fn.select2.defaults=n),i})),{define:e.define,require:e.require}}(),i=e.require("jquery.select2");return t.fn.select2.amd=e,i},void 0===(r="function"==typeof n?n.apply(e,o):n)||(t.exports=r)},655:function(t,e,i){var n,o,r;!function(s){"use strict";o=[i(669)],n=function(t,e){var i={beforeShow:d,move:d,change:d,show:d,hide:d,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!0,showInitial:!1,showPalette:!1,showPaletteOnly:!1,hideAfterPaletteSelect:!1,togglePaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",togglePaletteMoreText:"more",togglePaletteLessText:"less",clearText:"Clear Color Selection",noColorSelectedText:"No Color Selected",preferredFormat:!1,className:"",containerClassName:"",replacerClassName:"",showAlpha:!1,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:!1,offset:null},n=[],o=!!/msie/i.exec(window.navigator.userAgent),r=function(){function t(t,e){return!!~(""+t).indexOf(e)}var e=document.createElement("div").style;return e.cssText="background-color:rgba(0,0,0,.5)",t(e.backgroundColor,"rgba")||t(e.backgroundColor,"hsla")}(),s=["<div class='sp-replacer'>","<div class='sp-preview'><div class='sp-preview-inner'></div></div>","<div class='sp-dd'>▼</div>","</div>"].join(""),a=function(){var t="";if(o)for(var e=1;e<=6;e++)t+="<div class='sp-"+e+"'></div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'></div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'></button>","</div>","</div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'></div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'></div>","</div>","</div>","</div>","<div class='sp-clear sp-clear-display'>","</div>","<div class='sp-hue'>","<div class='sp-slider'></div>",t,"</div>","</div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>","</div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false' />","</div>","<div class='sp-initial sp-thumb sp-cf'></div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'></a>","<button type='button' class='sp-choose'></button>","</div>","</div>","</div>"].join("")}();function l(e,i,n,o){for(var s=[],a=0;a<e.length;a++){var l=e[a];if(l){var h=tinycolor(l),c=h.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light";c+=tinycolor.equals(i,l)?" sp-thumb-active":"";var p=h.toString(o.preferredFormat||"rgb"),u=r?"background-color:"+h.toRgbString():"filter:"+h.toFilter();s.push('<span title="'+p+'" data-color="'+h.toRgbString()+'" class="'+c+'"><span class="sp-thumb-inner" style="'+u+';"></span></span>')}else{var d="sp-clear-display";s.push(t("<div />").append(t('<span data-color="" style="background-color:transparent;" class="'+d+'"></span>').attr("title",o.noColorSelectedText)).html())}}return"<div class='sp-cf "+n+"'>"+s.join("")+"</div>"}function h(){for(var t=0;t<n.length;t++)n[t]&&n[t].hide()}function c(e,n){var o=t.extend({},i,e);return o.callbacks={move:f(o.move,n),change:f(o.change,n),show:f(o.show,n),hide:f(o.hide,n),beforeShow:f(o.beforeShow,n)},o}function p(i,p){var d=c(p,i),f=d.flat,y=d.showSelectionPalette,b=d.localStorageKey,x=d.theme,k=d.callbacks,L=_(Zt,10),w=!1,M=!1,C=0,P=0,S=0,T=0,A=0,D=0,E=0,O=0,I=0,B=0,R=1,z=[],F=[],j={},N=d.selectionPalette.slice(0),U=d.maxSelectionSize,G="sp-dragging",H=null,Z=i.ownerDocument,V=(Z.body,t(i)),W=!1,q=t(a,Z).addClass(x),$=q.find(".sp-picker-container"),K=q.find(".sp-color"),Y=q.find(".sp-dragger"),J=q.find(".sp-hue"),X=q.find(".sp-slider"),Q=q.find(".sp-alpha-inner"),tt=q.find(".sp-alpha"),et=q.find(".sp-alpha-handle"),it=q.find(".sp-input"),nt=q.find(".sp-palette"),ot=q.find(".sp-initial"),rt=q.find(".sp-cancel"),st=q.find(".sp-clear"),at=q.find(".sp-choose"),lt=q.find(".sp-palette-toggle"),ht=V.is("input"),ct=ht&&"color"===V.attr("type")&&v(),pt=ht&&!f,ut=pt?t(s).addClass(x).addClass(d.className).addClass(d.replacerClassName):t([]),dt=pt?ut:V,mt=ut.find(".sp-preview-inner"),ft=d.color||ht&&V.val(),gt=!1,_t=d.preferredFormat,vt=!d.showButtons||d.clickoutFiresChange,yt=!ft,bt=d.allowEmpty&&!ct;function xt(){if(d.showPaletteOnly&&(d.showPalette=!0),lt.text(d.showPaletteOnly?d.togglePaletteMoreText:d.togglePaletteLessText),d.palette){z=d.palette.slice(0),F=t.isArray(z[0])?z:[z],j={};for(var e=0;e<F.length;e++)for(var i=0;i<F[e].length;i++){var n=tinycolor(F[e][i]).toRgbString();j[n]=!0}}q.toggleClass("sp-flat",f),q.toggleClass("sp-input-disabled",!d.showInput),q.toggleClass("sp-alpha-enabled",d.showAlpha),q.toggleClass("sp-clear-enabled",bt),q.toggleClass("sp-buttons-disabled",!d.showButtons),q.toggleClass("sp-palette-buttons-disabled",!d.togglePaletteOnly),q.toggleClass("sp-palette-disabled",!d.showPalette),q.toggleClass("sp-palette-only",d.showPaletteOnly),q.toggleClass("sp-initial-disabled",!d.showInitial),q.addClass(d.className).addClass(d.containerClassName),Zt()}function kt(){if(o&&q.find("*:not(input)").attr("unselectable","on"),xt(),pt&&V.after(ut).hide(),bt||st.hide(),f)V.after(q).hide();else{var e="parent"===d.appendTo?V.parent():t(d.appendTo);1!==e.length&&(e=t("body")),e.append(q)}function i(e){return e.data&&e.data.ignore?(zt(t(e.target).closest(".sp-thumb-el").data("color")),Nt()):(zt(t(e.target).closest(".sp-thumb-el").data("color")),Nt(),d.hideAfterPaletteSelect?(Ht(!0),Bt()):Ht()),!1}Lt(),dt.on("click.spectrum touchstart.spectrum",(function(e){W||Dt(),e.stopPropagation(),t(e.target).is("input")||e.preventDefault()})),(V.is(":disabled")||!0===d.disabled)&&$t(),q.click(m),it.change(At),it.on("paste",(function(){setTimeout(At,1)})),it.keydown((function(t){13==t.keyCode&&At()})),rt.text(d.cancelText),rt.on("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),Rt(),Bt()})),st.attr("title",d.clearText),st.on("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),yt=!0,Nt(),f&&Ht(!0)})),at.text(d.chooseText),at.on("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),o&&it.is(":focus")&&it.trigger("change"),jt()&&(Ht(!0),Bt())})),lt.text(d.showPaletteOnly?d.togglePaletteMoreText:d.togglePaletteLessText),lt.on("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),d.showPaletteOnly=!d.showPaletteOnly,d.showPaletteOnly||f||q.css("left","-="+($.outerWidth(!0)+5)),xt()})),g(tt,(function(t,e,i){R=t/A,yt=!1,i.shiftKey&&(R=Math.round(10*R)/10),Nt()}),St,Tt),g(J,(function(t,e){O=parseFloat(e/T),yt=!1,d.showAlpha||(R=1),Nt()}),St,Tt),g(K,(function(t,e,i){if(i.shiftKey){if(!H){var n=I*C,o=P-B*P,r=Math.abs(t-n)>Math.abs(e-o);H=r?"x":"y"}}else H=null;var s=!H||"y"===H;(!H||"x"===H)&&(I=parseFloat(t/C)),s&&(B=parseFloat((P-e)/P)),yt=!1,d.showAlpha||(R=1),Nt()}),St,Tt),ft?(zt(ft),Ut(),_t=d.preferredFormat||tinycolor(ft).format,wt(ft)):Ut(),f&&Et();var n=o?"mousedown.spectrum":"click.spectrum touchstart.spectrum";nt.on(n,".sp-thumb-el",i),ot.on(n,".sp-thumb-el:nth-child(1)",{ignore:!0},i)}function Lt(){if(b&&window.localStorage){try{var e=window.localStorage[b].split(",#");e.length>1&&(delete window.localStorage[b],t.each(e,(function(t,e){wt(e)})))}catch(t){}try{N=window.localStorage[b].split(";")}catch(t){}}}function wt(e){if(y){var i=tinycolor(e).toRgbString();if(!j[i]&&-1===t.inArray(i,N))for(N.push(i);N.length>U;)N.shift();if(b&&window.localStorage)try{window.localStorage[b]=N.join(";")}catch(t){}}}function Mt(){var t=[];if(d.showPalette)for(var e=0;e<N.length;e++){var i=tinycolor(N[e]).toRgbString();j[i]||t.push(N[e])}return t.reverse().slice(0,d.maxSelectionSize)}function Ct(){var e=Ft(),i=t.map(F,(function(t,i){return l(t,e,"sp-palette-row sp-palette-row-"+i,d)}));Lt(),N&&i.push(l(Mt(),e,"sp-palette-row sp-palette-row-selection",d)),nt.html(i.join(""))}function Pt(){if(d.showInitial){var t=gt,e=Ft();ot.html(l([t,e],e,"sp-palette-row-initial",d))}}function St(){(P<=0||C<=0||T<=0)&&Zt(),M=!0,q.addClass(G),H=null,V.trigger("dragstart.spectrum",[Ft()])}function Tt(){M=!1,q.removeClass(G),V.trigger("dragstop.spectrum",[Ft()])}function At(){var t=it.val();if(null!==t&&""!==t||!bt){var e=tinycolor(t);e.isValid()?(zt(e),Nt(),Ht()):it.addClass("sp-validation-error")}else zt(null),Nt(),Ht()}function Dt(){w?Bt():Et()}function Et(){var e=t.Event("beforeShow.spectrum");w?Zt():(V.trigger(e,[Ft()]),!1===k.beforeShow(Ft())||e.isDefaultPrevented()||(h(),w=!0,t(Z).on("keydown.spectrum",Ot),t(Z).on("click.spectrum",It),t(window).on("resize.spectrum",L),ut.addClass("sp-active"),q.removeClass("sp-hidden"),Zt(),Ut(),gt=Ft(),Pt(),k.show(gt),V.trigger("show.spectrum",[gt])))}function Ot(t){27===t.keyCode&&Bt()}function It(t){2!=t.button&&(M||(vt?Ht(!0):Rt(),Bt()))}function Bt(){w&&!f&&(w=!1,t(Z).off("keydown.spectrum",Ot),t(Z).off("click.spectrum",It),t(window).off("resize.spectrum",L),ut.removeClass("sp-active"),q.addClass("sp-hidden"),k.hide(Ft()),V.trigger("hide.spectrum",[Ft()]))}function Rt(){zt(gt,!0),Ht(!0)}function zt(t,e){var i,n;tinycolor.equals(t,Ft())?Ut():(!t&&bt?yt=!0:(yt=!1,n=(i=tinycolor(t)).toHsv(),O=n.h%360/360,I=n.s,B=n.v,R=n.a),Ut(),i&&i.isValid()&&!e&&(_t=d.preferredFormat||i.getFormat()))}function Ft(t){return t=t||{},bt&&yt?null:tinycolor.fromRatio({h:O,s:I,v:B,a:Math.round(1e3*R)/1e3},{format:t.format||_t})}function jt(){return!it.hasClass("sp-validation-error")}function Nt(){Ut(),k.move(Ft()),V.trigger("move.spectrum",[Ft()])}function Ut(){it.removeClass("sp-validation-error"),Gt();var t=tinycolor.fromRatio({h:O,s:1,v:1});K.css("background-color",t.toHexString());var e=_t;R<1&&(0!==R||"name"!==e)&&("hex"!==e&&"hex3"!==e&&"hex6"!==e&&"name"!==e||(e="rgb"));var i=Ft({format:e}),n="";if(mt.removeClass("sp-clear-display"),mt.css("background-color","transparent"),!i&&bt)mt.addClass("sp-clear-display");else{var s=i.toHexString(),a=i.toRgbString();if(r||1===i.alpha?mt.css("background-color",a):(mt.css("background-color","transparent"),mt.css("filter",i.toFilter())),d.showAlpha){var l=i.toRgb();l.a=0;var h=tinycolor(l).toRgbString(),c="linear-gradient(left, "+h+", "+s+")";o?Q.css("filter",tinycolor(h).toFilter({gradientType:1},s)):(Q.css("background","-webkit-"+c),Q.css("background","-moz-"+c),Q.css("background","-ms-"+c),Q.css("background","linear-gradient(to right, "+h+", "+s+")"))}n=i.toString(e)}d.showInput&&it.val(n),d.showPalette&&Ct(),Pt()}function Gt(){var t=I,e=B;if(bt&&yt)et.hide(),X.hide(),Y.hide();else{et.show(),X.show(),Y.show();var i=t*C,n=P-e*P;i=Math.max(-S,Math.min(C-S,i-S)),n=Math.max(-S,Math.min(P-S,n-S)),Y.css({top:n+"px",left:i+"px"});var o=R*A;et.css({left:o-D/2+"px"});var r=O*T;X.css({top:r-E+"px"})}}function Ht(t){var e=Ft(),i="",n=!tinycolor.equals(e,gt);e&&(i=e.toString(_t),wt(e)),ht&&V.val(i),t&&n&&(k.change(e),V.trigger("change",[e]))}function Zt(){w&&(C=K.width(),P=K.height(),S=Y.height(),J.width(),T=J.height(),E=X.height(),A=tt.width(),D=et.width(),f||(q.css("position","absolute"),d.offset?q.offset(d.offset):q.offset(u(q,dt))),Gt(),d.showPalette&&Ct(),V.trigger("reflow.spectrum"))}function Vt(){V.show(),dt.off("click.spectrum touchstart.spectrum"),q.remove(),ut.remove(),n[Yt.id]=null}function Wt(i,n){return i===e?t.extend({},d):n===e?d[i]:(d[i]=n,"preferredFormat"===i&&(_t=d.preferredFormat),void xt())}function qt(){W=!1,V.attr("disabled",!1),dt.removeClass("sp-disabled")}function $t(){Bt(),W=!0,V.attr("disabled",!0),dt.addClass("sp-disabled")}function Kt(t){d.offset=t,Zt()}kt();var Yt={show:Et,hide:Bt,toggle:Dt,reflow:Zt,option:Wt,enable:qt,disable:$t,offset:Kt,set:function(t){zt(t),Ht()},get:Ft,destroy:Vt,container:q};return Yt.id=n.push(Yt)-1,Yt}function u(e,i){var n=0,o=e.outerWidth(),r=e.outerHeight(),s=i.outerHeight(),a=e[0].ownerDocument,l=a.documentElement,h=l.clientWidth+t(a).scrollLeft(),c=l.clientHeight+t(a).scrollTop(),p=i.offset(),u=p.left,d=p.top;return d+=s,u-=Math.min(u,u+o>h&&h>o?Math.abs(u+o-h):0),{top:d-=Math.min(d,d+r>c&&c>r?Math.abs(r+s-n):n),bottom:p.bottom,left:u,right:p.right,width:p.width,height:p.height}}function d(){}function m(t){t.stopPropagation()}function f(t,e){var i=Array.prototype.slice,n=i.call(arguments,2);return function(){return t.apply(e,n.concat(i.call(arguments)))}}function g(e,i,n,r){i=i||function(){},n=n||function(){},r=r||function(){};var s=document,a=!1,l={},h=0,c=0,p="ontouchstart"in window,u={};function d(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function m(t){if(a){if(o&&s.documentMode<9&&!t.button)return g();var n=t.originalEvent&&t.originalEvent.touches&&t.originalEvent.touches[0],r=n&&n.pageX||t.pageX,u=n&&n.pageY||t.pageY,m=Math.max(0,Math.min(r-l.left,c)),f=Math.max(0,Math.min(u-l.top,h));p&&d(t),i.apply(e,[m,f,t])}}function f(i){(i.which?3==i.which:2==i.button)||a||!1!==n.apply(e,arguments)&&(a=!0,h=t(e).height(),c=t(e).width(),l=t(e).offset(),t(s).on(u),t(s.body).addClass("sp-dragging"),m(i),d(i))}function g(){a&&(t(s).off(u),t(s.body).removeClass("sp-dragging"),setTimeout((function(){r.apply(e,arguments)}),0)),a=!1}u.selectstart=d,u.dragstart=d,u["touchmove mousemove"]=m,u["touchend mouseup"]=g,t(e).on("touchstart mousedown",f)}function _(t,e,i){var n;return function(){var o=this,r=arguments,s=function(){n=null,t.apply(o,r)};i&&clearTimeout(n),!i&&n||(n=setTimeout(s,e))}}function v(){return t.fn.spectrum.inputTypeColorSupport()}var y="spectrum.id";t.fn.spectrum=function(e,i){if("string"==typeof e){var o=this,r=Array.prototype.slice.call(arguments,1);return this.each((function(){var i=n[t(this).data(y)];if(i){var s=i[e];if(!s)throw new Error("Spectrum: no such method: '"+e+"'");"get"==e?o=i.get():"container"==e?o=i.container:"option"==e?o=i.option.apply(i,r):"destroy"==e?(i.destroy(),t(this).removeData(y)):s.apply(i,r)}})),o}return this.spectrum("destroy").each((function(){var i=p(this,t.extend({},t(this).data(),e));t(this).data(y,i.id)}))},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=g,t.fn.spectrum.defaults=i,t.fn.spectrum.inputTypeColorSupport=function e(){if(void 0===e._cachedResult){var i=t("<input type='color'/>")[0];e._cachedResult="color"===i.type&&""!==i.value}return e._cachedResult},t.spectrum={},t.spectrum.localization={},t.spectrum.palettes={},t.fn.spectrum.processNativeColorInputs=function(){var e=t("input[type=color]");e.length&&!v()&&e.spectrum({preferredFormat:"hex6"})},function(){var t=/^[\s,#]+/,e=/\s+$/,i=0,n=Math,o=n.round,r=n.min,s=n.max,a=n.random,l=function(t,e){if(e=e||{},(t=t||"")instanceof l)return t;if(!(this instanceof l))return new l(t,e);var n=h(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=o(1e3*this._a)/1e3,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=o(this._r)),this._g<1&&(this._g=o(this._g)),this._b<1&&(this._b=o(this._b)),this._ok=n.ok,this._tc_id=i++};function h(t){var e={r:0,g:0,b:0},i=1,n=!1,o=!1;return"string"==typeof t&&(t=q(t)),"object"==typeof t&&(t.hasOwnProperty("r")&&t.hasOwnProperty("g")&&t.hasOwnProperty("b")?(e=c(t.r,t.g,t.b),n=!0,o="%"===String(t.r).substr(-1)?"prgb":"rgb"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("v")?(t.s=N(t.s),t.v=N(t.v),e=m(t.h,t.s,t.v),n=!0,o="hsv"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("l")&&(t.s=N(t.s),t.l=N(t.l),e=u(t.h,t.s,t.l),n=!0,o="hsl"),t.hasOwnProperty("a")&&(i=t.a)),i=O(i),{ok:n,format:t.format||o,r:r(255,s(e.r,0)),g:r(255,s(e.g,0)),b:r(255,s(e.b,0)),a:i}}function c(t,e,i){return{r:255*I(t,255),g:255*I(e,255),b:255*I(i,255)}}function p(t,e,i){t=I(t,255),e=I(e,255),i=I(i,255);var n,o,a=s(t,e,i),l=r(t,e,i),h=(a+l)/2;if(a==l)n=o=0;else{var c=a-l;switch(o=h>.5?c/(2-a-l):c/(a+l),a){case t:n=(e-i)/c+(e<i?6:0);break;case e:n=(i-t)/c+2;break;case i:n=(t-e)/c+4}n/=6}return{h:n,s:o,l:h}}function u(t,e,i){var n,o,r;function s(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}if(t=I(t,360),e=I(e,100),i=I(i,100),0===e)n=o=r=i;else{var a=i<.5?i*(1+e):i+e-i*e,l=2*i-a;n=s(l,a,t+1/3),o=s(l,a,t),r=s(l,a,t-1/3)}return{r:255*n,g:255*o,b:255*r}}function d(t,e,i){t=I(t,255),e=I(e,255),i=I(i,255);var n,o,a=s(t,e,i),l=r(t,e,i),h=a,c=a-l;if(o=0===a?0:c/a,a==l)n=0;else{switch(a){case t:n=(e-i)/c+(e<i?6:0);break;case e:n=(i-t)/c+2;break;case i:n=(t-e)/c+4}n/=6}return{h:n,s:o,v:h}}function m(t,e,i){t=6*I(t,360),e=I(e,100),i=I(i,100);var o=n.floor(t),r=t-o,s=i*(1-e),a=i*(1-r*e),l=i*(1-(1-r)*e),h=o%6;return{r:255*[i,a,s,s,l,i][h],g:255*[l,i,i,a,s,s][h],b:255*[s,s,l,i,i,a][h]}}function f(t,e,i,n){var r=[j(o(t).toString(16)),j(o(e).toString(16)),j(o(i).toString(16))];return n&&r[0].charAt(0)==r[0].charAt(1)&&r[1].charAt(0)==r[1].charAt(1)&&r[2].charAt(0)==r[2].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function g(t,e,i,n){return[j(U(n)),j(o(t).toString(16)),j(o(e).toString(16)),j(o(i).toString(16))].join("")}function _(t,e){e=0===e?0:e||10;var i=l(t).toHsl();return i.s-=e/100,i.s=B(i.s),l(i)}function v(t,e){e=0===e?0:e||10;var i=l(t).toHsl();return i.s+=e/100,i.s=B(i.s),l(i)}function y(t){return l(t).desaturate(100)}function b(t,e){e=0===e?0:e||10;var i=l(t).toHsl();return i.l+=e/100,i.l=B(i.l),l(i)}function x(t,e){e=0===e?0:e||10;var i=l(t).toRgb();return i.r=s(0,r(255,i.r-o(-e/100*255))),i.g=s(0,r(255,i.g-o(-e/100*255))),i.b=s(0,r(255,i.b-o(-e/100*255))),l(i)}function k(t,e){e=0===e?0:e||10;var i=l(t).toHsl();return i.l-=e/100,i.l=B(i.l),l(i)}function L(t,e){var i=l(t).toHsl(),n=(o(i.h)+e)%360;return i.h=n<0?360+n:n,l(i)}function w(t){var e=l(t).toHsl();return e.h=(e.h+180)%360,l(e)}function M(t){var e=l(t).toHsl(),i=e.h;return[l(t),l({h:(i+120)%360,s:e.s,l:e.l}),l({h:(i+240)%360,s:e.s,l:e.l})]}function C(t){var e=l(t).toHsl(),i=e.h;return[l(t),l({h:(i+90)%360,s:e.s,l:e.l}),l({h:(i+180)%360,s:e.s,l:e.l}),l({h:(i+270)%360,s:e.s,l:e.l})]}function P(t){var e=l(t).toHsl(),i=e.h;return[l(t),l({h:(i+72)%360,s:e.s,l:e.l}),l({h:(i+216)%360,s:e.s,l:e.l})]}function S(t,e,i){e=e||6,i=i||30;var n=l(t).toHsl(),o=360/i,r=[l(t)];for(n.h=(n.h-(o*e>>1)+720)%360;--e;)n.h=(n.h+o)%360,r.push(l(n));return r}function T(t,e){e=e||6;for(var i=l(t).toHsv(),n=i.h,o=i.s,r=i.v,s=[],a=1/e;e--;)s.push(l({h:n,s:o,v:r})),r=(r+a)%1;return s}l.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},setAlpha:function(t){return this._a=O(t),this._roundA=o(1e3*this._a)/1e3,this},toHsv:function(){var t=d(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=d(this._r,this._g,this._b),e=o(360*t.h),i=o(100*t.s),n=o(100*t.v);return 1==this._a?"hsv("+e+", "+i+"%, "+n+"%)":"hsva("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=p(this._r,this._g,this._b),e=o(360*t.h),i=o(100*t.s),n=o(100*t.l);return 1==this._a?"hsl("+e+", "+i+"%, "+n+"%)":"hsla("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return f(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(){return g(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:o(this._r),g:o(this._g),b:o(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+o(this._r)+", "+o(this._g)+", "+o(this._b)+")":"rgba("+o(this._r)+", "+o(this._g)+", "+o(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:o(100*I(this._r,255))+"%",g:o(100*I(this._g,255))+"%",b:o(100*I(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+o(100*I(this._r,255))+"%, "+o(100*I(this._g,255))+"%, "+o(100*I(this._b,255))+"%)":"rgba("+o(100*I(this._r,255))+"%, "+o(100*I(this._g,255))+"%, "+o(100*I(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(D[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+g(this._r,this._g,this._b,this._a),i=e,n=this._gradientType?"GradientType = 1, ":"";t&&(i=l(t).toHex8String());return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+i+")"},toString:function(t){var e=!!t;t=t||this._format;var i=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"name"!==t?("rgb"===t&&(i=this.toRgbString()),"prgb"===t&&(i=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(i=this.toHexString()),"hex3"===t&&(i=this.toHexString(!0)),"hex8"===t&&(i=this.toHex8String()),"name"===t&&(i=this.toName()),"hsl"===t&&(i=this.toHslString()),"hsv"===t&&(i=this.toHsvString()),i||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},_applyModification:function(t,e){var i=t.apply(null,[this].concat([].slice.call(e)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(x,arguments)},darken:function(){return this._applyModification(k,arguments)},desaturate:function(){return this._applyModification(_,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(L,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(w,arguments)},monochromatic:function(){return this._applyCombination(T,arguments)},splitcomplement:function(){return this._applyCombination(P,arguments)},triad:function(){return this._applyCombination(M,arguments)},tetrad:function(){return this._applyCombination(C,arguments)}},l.fromRatio=function(t,e){if("object"==typeof t){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]="a"===n?t[n]:N(t[n]));t=i}return l(t,e)},l.equals=function(t,e){return!(!t||!e)&&l(t).toRgbString()==l(e).toRgbString()},l.random=function(){return l.fromRatio({r:a(),g:a(),b:a()})},l.mix=function(t,e,i){i=0===i?0:i||50;var n,o=l(t).toRgb(),r=l(e).toRgb(),s=i/100,a=2*s-1,h=r.a-o.a,c=1-(n=((n=a*h==-1?a:(a+h)/(1+a*h))+1)/2),p={r:r.r*n+o.r*c,g:r.g*n+o.g*c,b:r.b*n+o.b*c,a:r.a*s+o.a*(1-s)};return l(p)},l.readability=function(t,e){var i=l(t),n=l(e),o=i.toRgb(),r=n.toRgb(),s=i.getBrightness(),a=n.getBrightness(),h=Math.max(o.r,r.r)-Math.min(o.r,r.r)+Math.max(o.g,r.g)-Math.min(o.g,r.g)+Math.max(o.b,r.b)-Math.min(o.b,r.b);return{brightness:Math.abs(s-a),color:h}},l.isReadable=function(t,e){var i=l.readability(t,e);return i.brightness>125&&i.color>500},l.mostReadable=function(t,e){for(var i=null,n=0,o=!1,r=0;r<e.length;r++){var s=l.readability(t,e[r]),a=s.brightness>125&&s.color>500,h=s.brightness/125*3+s.color/500;(a&&!o||a&&o&&h>n||!a&&!o&&h>n)&&(o=a,n=h,i=l(e[r]))}return i};var A=l.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},D=l.hexNames=E(A);function E(t){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[t[i]]=i);return e}function O(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function I(t,e){z(t)&&(t="100%");var i=F(t);return t=r(e,s(0,parseFloat(t))),i&&(t=parseInt(t*e,10)/100),n.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function B(t){return r(1,s(0,t))}function R(t){return parseInt(t,16)}function z(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function F(t){return"string"==typeof t&&-1!=t.indexOf("%")}function j(t){return 1==t.length?"0"+t:""+t}function N(t){return t<=1&&(t=100*t+"%"),t}function U(t){return Math.round(255*parseFloat(t)).toString(16)}function G(t){return R(t)/255}var H,Z,V,W=(Z="[\\s|\\(]+("+(H="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+H+")[,|\\s]+("+H+")\\s*\\)?",V="[\\s|\\(]+("+H+")[,|\\s]+("+H+")[,|\\s]+("+H+")[,|\\s]+("+H+")\\s*\\)?",{rgb:new RegExp("rgb"+Z),rgba:new RegExp("rgba"+V),hsl:new RegExp("hsl"+Z),hsla:new RegExp("hsla"+V),hsv:new RegExp("hsv"+Z),hsva:new RegExp("hsva"+V),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function q(i){i=i.replace(t,"").replace(e,"").toLowerCase();var n,o=!1;if(A[i])i=A[i],o=!0;else if("transparent"==i)return{r:0,g:0,b:0,a:0,format:"name"};return(n=W.rgb.exec(i))?{r:n[1],g:n[2],b:n[3]}:(n=W.rgba.exec(i))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=W.hsl.exec(i))?{h:n[1],s:n[2],l:n[3]}:(n=W.hsla.exec(i))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=W.hsv.exec(i))?{h:n[1],s:n[2],v:n[3]}:(n=W.hsva.exec(i))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=W.hex8.exec(i))?{a:G(n[1]),r:R(n[2]),g:R(n[3]),b:R(n[4]),format:o?"name":"hex8"}:(n=W.hex6.exec(i))?{r:R(n[1]),g:R(n[2]),b:R(n[3]),format:o?"name":"hex"}:!!(n=W.hex3.exec(i))&&{r:R(n[1]+""+n[1]),g:R(n[2]+""+n[2]),b:R(n[3]+""+n[3]),format:o?"name":"hex"}}window.tinycolor=l}(),t((function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()}))},void 0===(r="function"==typeof n?n.apply(e,o):n)||(t.exports=r)}()},669:function(t){"use strict";t.exports=jQuery}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var r=e[n]={exports:{}};return t[n].call(r.exports,r,r.exports,i),r.exports}i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,{a:e}),e},i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";function t(t){t=t||{},this.settings={timeMovingThreshold:t.timeMovingThreshold||15e3,eleGainThreshold:t.eleGainThreshold||5},this.xml=null,this.metadata={},this.waypoints=[],this.routes=[],this.tracks=[]}t.prototype.parse=function(t){var e=this,i=new DOMParser;this.xml=i.parseFromString(t,"text/xml");var n=this.xml.querySelector("metadata");null!==n&&(this.metadata=this.parseMetadataType(n));for(var o=[].slice.call(this.xml.querySelectorAll("wpt")),r=0;r<o.length;r++){var s=o[r],a=e.parseWptType(s,!0);e.waypoints.push(a)}for(var l=[].slice.call(this.xml.querySelectorAll("rte")),h=0;h<l.length;h++){var c=l[h],p=e.parseRteType(c);if(!p.points.length)return;p.time=e.calcTime(p.points),p.distance=e.calcDistance(p.points),p.elevation=e.calcElevation(p.points),p.heartRate=e.calcHeartRate(p.points),e.routes.push(p)}for(var u=[].slice.call(this.xml.querySelectorAll("trk")),d=0;d<u.length;d++){var m=u[d],f=e.parseTrkType(m);if(!f.points.length)return;f.time=e.calcTime(f.points),f.distance=e.calcDistance(f.points),f.elevation=e.calcElevation(f.points),f.heartRate=e.calcHeartRate(f.points),e.tracks.push(f)}},t.prototype.getFirstTagValue=function(t,e){var i=t.querySelectorAll(e);return i.length?i[0].textContent:null},t.prototype.getFirstTagValueNs=function(t,e,i){var n=t.getElementsByTagNameNS(e,i);return n.length?n[0].textContent:null},t.prototype.getTpxValue=function(t,e){var i=this.getFirstTagValueNs(t,"http://www.garmin.com/xmlschemas/TrackPointExtension/v1",e);return null===i&&(i=this.getFirstTagValueNs(t,"http://www.garmin.com/xmlschemas/TrackPointExtension/v2",e)),i},t.prototype.parseLinks=function(t){for(var e=[],i=[].slice.call(t.querySelectorAll("link")),n=0;n<i.length;n++){var o=i[n],r=this.parseLinkType(o);e.push(r)}return e},t.prototype.parseRtepts=function(t){for(var e=[],i=[].slice.call(t.querySelectorAll("rtept")),n=0;n<i.length;n++){var o=i[n],r=this.parseWptType(o,!1);e.push(r)}return e},t.prototype.parseTrkpts=function(t){for(var e=[],i=[].slice.call(t.querySelectorAll("trkpt")),n=0;n<i.length;n++){var o=i[n],r=this.parseWptType(o,!1);e.push(r)}return e},t.prototype.parseTrksegs=function(t){for(var e=this,i=[],n=[].slice.call(t.querySelectorAll("trkseg")),o=0;o<n.length;o++){var r=n[o],s=e.parseTrksegType(r,!1);s.time=e.calcTime(s.points),s.distance=e.calcDistance(s.points),s.elevation=e.calcElevation(s.points),s.heartRate=e.calcHeartRate(s.points),i.push(s)}return i},t.prototype.parseWptTypeExtensions=function(t){return{tpx:this.parseTrackPointExtensionType(t)}},t.prototype.parseLinkType=function(t){return{href:t.getAttribute("href"),text:this.getFirstTagValue(t,"text"),type:this.getFirstTagValue(t,"type")}},t.prototype.parseMetadataType=function(t){return{name:this.getFirstTagValue(t,"name"),desc:this.getFirstTagValue(t,"desc"),time:Date.parse(this.getFirstTagValue(t,"time")),links:this.parseLinks(t)}},t.prototype.parseWptType=function(t,e){var i={lat:parseFloat(t.getAttribute("lat")),lon:parseFloat(t.getAttribute("lon")),ele:parseFloat(this.getFirstTagValue(t,"ele")),time:Date.parse(this.getFirstTagValue(t,"time")),extension:this.parseWptTypeExtensions(t)};return e&&(i.name=this.getFirstTagValue(t,"name"),i.cmt=this.getFirstTagValue(t,"cmt"),i.desc=this.getFirstTagValue(t,"desc"),i.links=this.parseLinks(t)),i},t.prototype.parseRteType=function(t){return{name:this.getFirstTagValue(t,"name"),cmt:this.getFirstTagValue(t,"cmt"),desc:this.getFirstTagValue(t,"desc"),src:this.getFirstTagValue(t,"src"),number:this.getFirstTagValue(t,"number"),type:this.getFirstTagValue(t,"type"),links:this.parseLinks(t),points:this.parseRtepts(t),extensions:this.parseMmpExtensionType(t,["color","weight","opacity"])}},t.prototype.parseTrkType=function(t){return{name:this.getFirstTagValue(t,"name"),cmt:this.getFirstTagValue(t,"cmt"),desc:this.getFirstTagValue(t,"desc"),src:this.getFirstTagValue(t,"src"),number:this.getFirstTagValue(t,"number"),type:this.getFirstTagValue(t,"type"),links:this.parseLinks(t),points:this.parseTrkpts(t),segments:this.parseTrksegs(t),extensions:this.parseMmpExtensionType(t,["color","weight","opacity"])}},t.prototype.parseTrksegType=function(t){return{points:this.parseTrkpts(t),extensions:this.parseMmpExtensionType(t,["color","weight","opacity"])}},t.prototype.parseMmpExtensionType=function(t,e){var i=t.querySelector("extensions");if(null===i||i.parentNode!==t)return{};for(var n={},o=0;o<e.length;o++){var r=e[o];n[r]=this.getFirstTagValueNs(i,"https://www.mapsmarker.com/GPX/1/",r)}return n},t.prototype.parseTrackPointExtensionType=function(t){var e=t.querySelector("TrackPointExtension");return null===e?{}:{atemp:parseFloat(this.getTpxValue(e,"atemp")),wtemp:parseFloat(this.getTpxValue(e,"wtemp")),depth:parseFloat(this.getTpxValue(e,"depth")),hr:parseInt(this.getTpxValue(e,"hr")),cad:parseInt(this.getTpxValue(e,"cad")),speed:parseFloat(this.getTpxValue(e,"speed")),course:parseFloat(this.getTpxValue(e,"course")),bearing:parseFloat(this.getTpxValue(e,"bearing"))}},t.prototype.calcTime=function(t){var e=0,i=0;t[0].elapsed=e;for(var n=0;n<t.length-1;n++){var o=t[n+1].time-t[n].time;isNaN(o)||(e+=o,o<this.settings.timeMovingThreshold&&(i+=o)),t[n+1].elapsed=e}return{start:t[0].time,end:t[t.length-1].time,total:e,moving:i}},t.prototype.calcDistance=function(t){var e=0;t[0].dist=e;for(var i=0;i<t.length-1;i++){e+=this.calcDistanceBetween(t[i],t[i+1]),t[i+1].dist=e}return{total:e}},t.prototype.calcDistanceBetween=function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,r=Math.sin((e.lat-t.lat)*i/2),s=Math.sin((e.lon-t.lon)*i/2),a=r*r+Math.cos(n)*Math.cos(o)*s*s;return 6371e3*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))},t.prototype.calcElevation=function(t){for(var e=[],i=0,n=0,o=null,r=0;r<t.length;r++){var s=t[r].ele;if(isNaN(s))t[r].gain=Math.abs(i),t[r].loss=Math.abs(n);else if(null!==o){var a=s-o;Math.abs(a)>=5&&(a>0?i+=a:a<0&&(n+=a),o=s,e.push(s)),t[r].gain=Math.abs(i),t[r].loss=Math.abs(n)}else e.push(s),o=s,t[r].gain=Math.abs(i),t[r].loss=Math.abs(n)}return{max:Math.max.apply(null,e),min:Math.min.apply(null,e),gain:Math.abs(i),loss:Math.abs(n),avg:e.reduce((function(t,e){return t+e}),0)/e.length}},t.prototype.calcHeartRate=function(t){for(var e=[],i=0;i<t.length;i++){var n=t[i].extension;void 0!==n.tpx&&n.tpx.hr&&e.push(n.tpx.hr)}return{max:Math.max.apply(null,e),min:Math.min.apply(null,e),avg:e.reduce((function(t,e){return t+e}),0)/e.length}};var e=t; /*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License */ function n(t){return t+.5|0}const o=(t,e,i)=>Math.max(Math.min(t,i),e);function r(t){return o(n(2.55*t),0,255)}function s(t){return o(n(255*t),0,255)}function a(t){return o(n(t/2.55)/100,0,1)}function l(t){return o(n(100*t),0,100)}const h={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},c=[..."0123456789ABCDEF"],p=t=>c[15&t],u=t=>c[(240&t)>>4]+c[15&t],d=t=>(240&t)>>4==(15&t);function m(t){var e=(t=>d(t.r)&&d(t.g)&&d(t.b)&&d(t.a))(t)?p:u;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const f=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function g(t,e,i){const n=e*Math.min(i,1-i),o=(e,o=(e+t/30)%12)=>i-n*Math.max(Math.min(o-3,9-o,1),-1);return[o(0),o(8),o(4)]}function _(t,e,i){const n=(n,o=(n+t/60)%6)=>i-i*e*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function v(t,e,i){const n=g(t,1,.5);let o;for(e+i>1&&(o=1/(e+i),e*=o,i*=o),o=0;o<3;o++)n[o]*=1-e-i,n[o]+=e;return n}function y(t){const e=t.r/255,i=t.g/255,n=t.b/255,o=Math.max(e,i,n),r=Math.min(e,i,n),s=(o+r)/2;let a,l,h;return o!==r&&(h=o-r,l=s>.5?h/(2-o-r):h/(o+r),a=function(t,e,i,n,o){return t===o?(e-i)/n+(e<i?6:0):e===o?(i-t)/n+2:(t-e)/n+4}(e,i,n,h,o),a=60*a+.5),[0|a,l||0,s]}function b(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(s)}function x(t,e,i){return b(g,t,e,i)}function k(t){return(t%360+360)%360}function L(t){const e=f.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?r(+e[5]):s(+e[5]));const o=k(+e[2]),a=+e[3]/100,l=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return b(v,t,e,i)}(o,a,l):"hsv"===e[1]?function(t,e,i){return b(_,t,e,i)}(o,a,l):x(o,a,l),{r:i[0],g:i[1],b:i[2],a:n}}const w={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},M={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let C;function P(t){C||(C=function(){const t={},e=Object.keys(M),i=Object.keys(w);let n,o,r,s,a;for(n=0;n<e.length;n++){for(s=a=e[n],o=0;o<i.length;o++)r=i[o],a=a.replace(r,w[r]);r=parseInt(M[s],16),t[a]=[r>>16&255,r>>8&255,255&r]}return t}(),C.transparent=[0,0,0,0]);const e=C[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const S=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const T=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,A=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function D(t,e,i){if(t){let n=y(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=x(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function E(t,e){return t?Object.assign(e||{},t):t}function O(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=s(t[3]))):(e=E(t,{r:0,g:0,b:0,a:1})).a=s(e.a),e}function I(t){return"r"===t.charAt(0)?function(t){const e=S.exec(t);let i,n,s,a=255;if(e){if(e[7]!==i){const t=+e[7];a=e[8]?r(t):o(255*t,0,255)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?r(i):o(i,0,255)),n=255&(e[4]?r(n):o(n,0,255)),s=255&(e[6]?r(s):o(s,0,255)),{r:i,g:n,b:s,a:a}}}(t):L(t)}class B{constructor(t){if(t instanceof B)return t;const e=typeof t;let i;var n,o,r;"object"===e?i=O(t):"string"===e&&(r=(n=t).length,"#"===n[0]&&(4===r||5===r?o={r:255&17*h[n[1]],g:255&17*h[n[2]],b:255&17*h[n[3]],a:5===r?17*h[n[4]]:255}:7!==r&&9!==r||(o={r:h[n[1]]<<4|h[n[2]],g:h[n[3]]<<4|h[n[4]],b:h[n[5]]<<4|h[n[6]],a:9===r?h[n[7]]<<4|h[n[8]]:255})),i=o||P(t)||I(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=E(this._rgb);return t&&(t.a=a(t.a)),t}set rgb(t){this._rgb=O(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${a(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?m(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=y(t),i=e[0],n=l(e[1]),o=l(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${o}%, ${a(t.a)})`:`hsl(${i}, ${n}%, ${o}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,s=2*r-1,a=i.a-n.a,l=((s*a==-1?s:(s+a)/(1+s*a))+1)/2;o=1-l,i.r=255&l*i.r+o*n.r+.5,i.g=255&l*i.g+o*n.g+.5,i.b=255&l*i.b+o*n.b+.5,i.a=r*i.a+(1-r)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const n=A(a(t.r)),o=A(a(t.g)),r=A(a(t.b));return{r:s(T(n+i*(A(a(e.r))-n))),g:s(T(o+i*(A(a(e.g))-o))),b:s(T(r+i*(A(a(e.b))-r))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new B(this.rgb)}alpha(t){return this._rgb.a=s(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=n(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return D(this._rgb,2,t),this}darken(t){return D(this._rgb,2,-t),this}saturate(t){return D(this._rgb,1,t),this}desaturate(t){return D(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=y(t);i[0]=k(i[0]+e),i=x(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}} /*! * Chart.js v4.4.1 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License */ function R(){}const z=(()=>{let t=0;return()=>t++})();function F(t){return null==t}function j(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function N(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function U(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function G(t,e){return U(t)?t:e}function H(t,e){return void 0===t?e:t}const Z=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function V(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function W(t,e,i,n){let o,r,s;if(j(t))if(r=t.length,n)for(o=r-1;o>=0;o--)e.call(i,t[o],o);else for(o=0;o<r;o++)e.call(i,t[o],o);else if(N(t))for(s=Object.keys(t),r=s.length,o=0;o<r;o++)e.call(i,t[s[o]],s[o])}function q(t,e){let i,n,o,r;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(o=t[i],r=e[i],o.datasetIndex!==r.datasetIndex||o.index!==r.index)return!1;return!0}function $(t){if(j(t))return t.map($);if(N(t)){const e=Object.create(null),i=Object.keys(t),n=i.length;let o=0;for(;o<n;++o)e[i[o]]=$(t[i[o]]);return e}return t}function K(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function Y(t,e,i,n){if(!K(t))return;const o=e[t],r=i[t];N(o)&&N(r)?J(o,r,n):e[t]=$(r)}function J(t,e,i){const n=j(e)?e:[e],o=n.length;if(!N(t))return t;const r=(i=i||{}).merger||Y;let s;for(let e=0;e<o;++e){if(s=n[e],!N(s))continue;const o=Object.keys(s);for(let e=0,n=o.length;e<n;++e)r(o[e],t,s,i)}return t}function X(t,e){return J(t,e,{merger:Q})}function Q(t,e,i){if(!K(t))return;const n=e[t],o=i[t];N(n)&&N(o)?X(n,o):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=$(o))}const tt={"":t=>t,x:t=>t.x,y:t=>t.y};function et(t,e){const i=tt[e]||(tt[e]=function(t){const e=function(t){const e=t.split("."),i=[];let n="";for(const t of e)n+=t,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function it(t){return t.charAt(0).toUpperCase()+t.slice(1)}const nt=t=>void 0!==t,ot=t=>"function"==typeof t,rt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};const st=Math.PI,at=2*st,lt=at+st,ht=Number.POSITIVE_INFINITY,ct=st/180,pt=st/2,ut=st/4,dt=2*st/3,mt=Math.log10,ft=Math.sign;function gt(t,e,i){return Math.abs(t-e)<i}function _t(t){const e=Math.round(t);t=gt(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(mt(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function vt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function yt(t,e,i){let n,o,r;for(n=0,o=t.length;n<o;n++)r=t[n][i],isNaN(r)||(e.min=Math.min(e.min,r),e.max=Math.max(e.max,r))}function bt(t){return t*(st/180)}function xt(t){return t*(180/st)}function kt(t){if(!U(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function Lt(t,e){const i=e.x-t.x,n=e.y-t.y,o=Math.sqrt(i*i+n*n);let r=Math.atan2(n,i);return r<-.5*st&&(r+=at),{angle:r,distance:o}}function wt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Mt(t,e){return(t-e+lt)%at-st}function Ct(t){return(t%at+at)%at}function Pt(t,e,i,n){const o=Ct(t),r=Ct(e),s=Ct(i),a=Ct(r-o),l=Ct(s-o),h=Ct(o-r),c=Ct(o-s);return o===r||o===s||n&&r===s||a>l&&h<c}function St(t,e,i){return Math.max(e,Math.min(i,t))}function Tt(t,e,i,n=1e-6){return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function At(t,e,i){i=i||(i=>t[i]<e);let n,o=t.length-1,r=0;for(;o-r>1;)n=r+o>>1,i(n)?r=n:o=n;return{lo:r,hi:o}}const Dt=(t,e,i,n)=>At(t,i,n?n=>{const o=t[n][e];return o<i||o===i&&t[n+1][e]===i}:n=>t[n][e]<i),Et=(t,e,i)=>At(t,i,(n=>t[n][e]>=i));const Ot=["push","pop","shift","splice","unshift"];function It(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,o=n.indexOf(e);-1!==o&&n.splice(o,1),n.length>0||(Ot.forEach((e=>{delete t[e]})),delete t._chartjs)}const Bt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Rt(t,e){let i=[],n=!1;return function(...o){i=o,n||(n=!0,Bt.call(window,(()=>{n=!1,t.apply(e,i)})))}}const zt=t=>"start"===t?"left":"end"===t?"right":"center",Ft=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function jt(t,e,i){const n=e.length;let o=0,r=n;if(t._sorted){const{iScale:s,_parsed:a}=t,l=s.axis,{min:h,max:c,minDefined:p,maxDefined:u}=s.getUserBounds();p&&(o=St(Math.min(Dt(a,l,h).lo,i?n:Dt(e,l,s.getPixelForValue(h)).lo),0,n-1)),r=u?St(Math.max(Dt(a,s.axis,c,!0).hi+1,i?0:Dt(e,l,s.getPixelForValue(c),!0).hi+1),o,n)-o:n-o}return{start:o,count:r}}function Nt(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,o={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=o,!0;const r=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,o),r}const Ut=t=>0===t||1===t,Gt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*at/i),Ht=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*at/i)+1,Zt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*pt),easeOutSine:t=>Math.sin(t*pt),easeInOutSine:t=>-.5*(Math.cos(st*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Ut(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ut(t)?t:Gt(t,.075,.3),easeOutElastic:t=>Ut(t)?t:Ht(t,.075,.3),easeInOutElastic(t){const e=.1125;return Ut(t)?t:t<.5?.5*Gt(2*t,e,.45):.5+.5*Ht(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Zt.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Zt.easeInBounce(2*t):.5*Zt.easeOutBounce(2*t-1)+.5};function Vt(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Wt(t){return Vt(t)?t:new B(t)}function qt(t){return Vt(t)?t:new B(t).saturate(.5).darken(.1).hexString()}const $t=["x","y","borderWidth","radius","tension"],Kt=["color","borderColor","backgroundColor"];const Yt=new Map;function Jt(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=Yt.get(i);return n||(n=new Intl.NumberFormat(t,e),Yt.set(i,n)),n}(e,i).format(t)}const Xt={values(t){return j(t)?t:""+t},numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let o,r=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(o="scientific"),r=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const s=mt(Math.abs(r)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:o,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Jt(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(mt(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?Xt.numeric.call(this,t,e,i):""}};var Qt={formatters:Xt};const te=Object.create(null),ee=Object.create(null);function ie(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;e<n;++e){const n=i[e];t=t[n]||(t[n]=Object.create(null))}return t}function ne(t,e,i){return"string"==typeof e?J(ie(t,e),i):J(ie(t,""),e)}class oe{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>qt(e.backgroundColor),this.hoverBorderColor=(t,e)=>qt(e.borderColor),this.hoverColor=(t,e)=>qt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return ne(this,t,e)}get(t){return ie(this,t)}describe(t,e){return ne(ee,t,e)}override(t,e){return ne(te,t,e)}route(t,e,i,n){const o=ie(this,t),r=ie(this,i),s="_"+e;Object.defineProperties(o,{[s]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[s],e=r[n];return N(t)?Object.assign({},e,t):H(t,e)},set(t){this[s]=t}}})}apply(t){t.forEach((t=>t(this)))}}var re=new oe({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Kt},numbers:{type:"number",properties:$t}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Qt.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function se(t,e,i,n,o){let r=e[o];return r||(r=e[o]=t.measureText(o).width,i.push(o)),r>n&&(n=r),n}function ae(t,e,i){const n=t.currentDevicePixelRatio,o=0!==i?Math.max(i/2,.5):0;return Math.round((e-o)*n)/n+o}function le(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function he(t,e,i,n){ce(t,e,i,n,null)}function ce(t,e,i,n,o){let r,s,a,l,h,c,p,u;const d=e.pointStyle,m=e.rotation,f=e.radius;let g=(m||0)*ct;if(d&&"object"==typeof d&&(r=d.toString(),"[object HTMLImageElement]"===r||"[object HTMLCanvasElement]"===r))return t.save(),t.translate(i,n),t.rotate(g),t.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),void t.restore();if(!(isNaN(f)||f<=0)){switch(t.beginPath(),d){default:o?t.ellipse(i,n,o/2,f,0,0,at):t.arc(i,n,f,0,at),t.closePath();break;case"triangle":c=o?o/2:f,t.moveTo(i+Math.sin(g)*c,n-Math.cos(g)*f),g+=dt,t.lineTo(i+Math.sin(g)*c,n-Math.cos(g)*f),g+=dt,t.lineTo(i+Math.sin(g)*c,n-Math.cos(g)*f),t.closePath();break;case"rectRounded":h=.516*f,l=f-h,s=Math.cos(g+ut)*l,p=Math.cos(g+ut)*(o?o/2-h:l),a=Math.sin(g+ut)*l,u=Math.sin(g+ut)*(o?o/2-h:l),t.arc(i-p,n-a,h,g-st,g-pt),t.arc(i+u,n-s,h,g-pt,g),t.arc(i+p,n+a,h,g,g+pt),t.arc(i-u,n+s,h,g+pt,g+st),t.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*f,c=o?o/2:l,t.rect(i-c,n-l,2*c,2*l);break}g+=ut;case"rectRot":p=Math.cos(g)*(o?o/2:f),s=Math.cos(g)*f,a=Math.sin(g)*f,u=Math.sin(g)*(o?o/2:f),t.moveTo(i-p,n-a),t.lineTo(i+u,n-s),t.lineTo(i+p,n+a),t.lineTo(i-u,n+s),t.closePath();break;case"crossRot":g+=ut;case"cross":p=Math.cos(g)*(o?o/2:f),s=Math.cos(g)*f,a=Math.sin(g)*f,u=Math.sin(g)*(o?o/2:f),t.moveTo(i-p,n-a),t.lineTo(i+p,n+a),t.moveTo(i+u,n-s),t.lineTo(i-u,n+s);break;case"star":p=Math.cos(g)*(o?o/2:f),s=Math.cos(g)*f,a=Math.sin(g)*f,u=Math.sin(g)*(o?o/2:f),t.moveTo(i-p,n-a),t.lineTo(i+p,n+a),t.moveTo(i+u,n-s),t.lineTo(i-u,n+s),g+=ut,p=Math.cos(g)*(o?o/2:f),s=Math.cos(g)*f,a=Math.sin(g)*f,u=Math.sin(g)*(o?o/2:f),t.moveTo(i-p,n-a),t.lineTo(i+p,n+a),t.moveTo(i+u,n-s),t.lineTo(i-u,n+s);break;case"line":s=o?o/2:Math.cos(g)*f,a=Math.sin(g)*f,t.moveTo(i-s,n-a),t.lineTo(i+s,n+a);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(g)*(o?o/2:f),n+Math.sin(g)*f);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function pe(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function ue(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function de(t){t.restore()}function me(t,e,i,n,o){if(!e)return t.lineTo(i.x,i.y);if("middle"===o){const n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===o!=!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function fe(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function ge(t,e,i,n,o){if(o.strikethrough||o.underline){const r=t.measureText(n),s=e-r.actualBoundingBoxLeft,a=e+r.actualBoundingBoxRight,l=i-r.actualBoundingBoxAscent,h=i+r.actualBoundingBoxDescent,c=o.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=o.decorationWidth||2,t.moveTo(s,c),t.lineTo(a,c),t.stroke()}}function _e(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function ve(t,e,i,n,o,r={}){const s=j(e)?e:[e],a=r.strokeWidth>0&&""!==r.strokeColor;let l,h;for(t.save(),t.font=o.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),F(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,r),l=0;l<s.length;++l)h=s[l],r.backdrop&&_e(t,r.backdrop),a&&(r.strokeColor&&(t.strokeStyle=r.strokeColor),F(r.strokeWidth)||(t.lineWidth=r.strokeWidth),t.strokeText(h,i,n,r.maxWidth)),t.fillText(h,i,n,r.maxWidth),ge(t,i,n,h,r),n+=Number(o.lineHeight);t.restore()}function ye(t,e){const{x:i,y:n,w:o,h:r,radius:s}=e;t.arc(i+s.topLeft,n+s.topLeft,s.topLeft,1.5*st,st,!0),t.lineTo(i,n+r-s.bottomLeft),t.arc(i+s.bottomLeft,n+r-s.bottomLeft,s.bottomLeft,st,pt,!0),t.lineTo(i+o-s.bottomRight,n+r),t.arc(i+o-s.bottomRight,n+r-s.bottomRight,s.bottomRight,pt,0,!0),t.lineTo(i+o,n+s.topRight),t.arc(i+o-s.topRight,n+s.topRight,s.topRight,0,-pt,!0),t.lineTo(i+s.topLeft,n)}const be=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,xe=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ke(t,e){const i=(""+t).match(be);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const Le=t=>+t||0;function we(t,e){const i={},n=N(e),o=n?Object.keys(e):e,r=N(t)?n?i=>H(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of o)i[t]=Le(r(t));return i}function Me(t){return we(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Ce(t){return we(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Pe(t){const e=Me(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Se(t,e){t=t||{},e=e||re.font;let i=H(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=H(t.style,e.style);n&&!(""+n).match(xe)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const o={family:H(t.family,e.family),lineHeight:ke(H(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:H(t.weight,e.weight),string:""};return o.string=function(t){return!t||F(t.size)||F(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(o),o}function Te(t,e,i,n){let o,r,s,a=!0;for(o=0,r=t.length;o<r;++o)if(s=t[o],void 0!==s&&(void 0!==e&&"function"==typeof s&&(s=s(e),a=!1),void 0!==i&&j(s)&&(s=s[i%s.length],a=!1),void 0!==s))return n&&!a&&(n.cacheable=!1),s}function Ae(t,e){return Object.assign(Object.create(t),e)}function De(t,e=[""],i,n,o=(()=>t[0])){const r=i||t;void 0===n&&(n=Ge("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:r,_fallback:n,_getTarget:o,override:i=>De([i,...t],e,r,n)};return new Proxy(s,{deleteProperty(e,i){return delete e[i],delete e._keys,delete t[0][i],!0},get(i,n){return Re(i,n,(()=>function(t,e,i,n){let o;for(const r of e)if(o=Ge(Ie(r,t),i),void 0!==o)return Be(t,o)?Ne(i,n,t,o):o}(n,e,t,i)))},getOwnPropertyDescriptor(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(t,e){return He(t).includes(e)},ownKeys(t){return He(t)},set(t,e,i){const n=t._storage||(t._storage=o());return t[e]=n[e]=i,delete t._keys,!0}})}function Ee(t,e,i,n){const o={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Oe(t,n),setContext:e=>Ee(t,e,i,n),override:o=>Ee(t.override(o),e,i,n)};return new Proxy(o,{deleteProperty(e,i){return delete e[i],delete t[i],!0},get(t,e,i){return Re(t,e,(()=>function(t,e,i){const{_proxy:n,_context:o,_subProxy:r,_descriptors:s}=t;let a=n[e];ot(a)&&s.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:o,_context:r,_subProxy:s,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(r,s||n);a.delete(t),Be(t,l)&&(l=Ne(o._scopes,o,t,l));return l}(e,a,t,i));j(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:o,_context:r,_subProxy:s,_descriptors:a}=i;if(void 0!==r.index&&n(t))return e[r.index%e.length];if(N(e[0])){const i=e,n=o._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=Ne(n,o,t,l);e.push(Ee(i,r,s&&s[t],a))}}return e}(e,a,t,s.isIndexable));Be(e,a)&&(a=Ee(a,o,r&&r[e],s));return a}(t,e,i)))},getOwnPropertyDescriptor(e,i){return e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(e,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(e,i,n){return t[i]=n,delete e[i],!0}})}function Oe(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:o=e.allKeys}=t;return{allKeys:o,scriptable:i,indexable:n,isScriptable:ot(i)?i:()=>i,isIndexable:ot(n)?n:()=>n}}const Ie=(t,e)=>t?t+it(e):e,Be=(t,e)=>N(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Re(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function ze(t,e,i){return ot(t)?t(e,i):t}const Fe=(t,e)=>!0===t?e:"string"==typeof t?et(e,t):void 0;function je(t,e,i,n,o){for(const r of e){const e=Fe(i,r);if(e){t.add(e);const r=ze(e._fallback,i,o);if(void 0!==r&&r!==i&&r!==n)return r}else if(!1===e&&void 0!==n&&i!==n)return null}return!1}function Ne(t,e,i,n){const o=e._rootScopes,r=ze(e._fallback,i,n),s=[...t,...o],a=new Set;a.add(n);let l=Ue(a,s,i,r||i,n);return null!==l&&((void 0===r||r===i||(l=Ue(a,s,r,l,n),null!==l))&&De(Array.from(a),[""],o,r,(()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const o=n[e];if(j(o)&&N(i))return i;return o||{}}(e,i,n))))}function Ue(t,e,i,n,o){for(;i;)i=je(t,e,i,n,o);return i}function Ge(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function He(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}const Ze=Number.EPSILON||1e-14,Ve=(t,e)=>e<t.length&&!t[e].skip&&t[e],We=t=>"x"===t?"y":"x";function qe(t,e,i,n){const o=t.skip?e:t,r=e,s=i.skip?e:i,a=wt(r,o),l=wt(s,r);let h=a/(a+l),c=l/(a+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const p=n*h,u=n*c;return{previous:{x:r.x-p*(s.x-o.x),y:r.y-p*(s.y-o.y)},next:{x:r.x+u*(s.x-o.x),y:r.y+u*(s.y-o.y)}}}function $e(t,e="x"){const i=We(e),n=t.length,o=Array(n).fill(0),r=Array(n);let s,a,l,h=Ve(t,0);for(s=0;s<n;++s)if(a=l,l=h,h=Ve(t,s+1),l){if(h){const t=h[e]-l[e];o[s]=0!==t?(h[i]-l[i])/t:0}r[s]=a?h?ft(o[s-1])!==ft(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}!function(t,e,i){const n=t.length;let o,r,s,a,l,h=Ve(t,0);for(let c=0;c<n-1;++c)l=h,h=Ve(t,c+1),l&&h&&(gt(e[c],0,Ze)?i[c]=i[c+1]=0:(o=i[c]/e[c],r=i[c+1]/e[c],a=Math.pow(o,2)+Math.pow(r,2),a<=9||(s=3/Math.sqrt(a),i[c]=o*s*e[c],i[c+1]=r*s*e[c])))}(t,o,r),function(t,e,i="x"){const n=We(i),o=t.length;let r,s,a,l=Ve(t,0);for(let h=0;h<o;++h){if(s=a,a=l,l=Ve(t,h+1),!a)continue;const o=a[i],c=a[n];s&&(r=(o-s[i])/3,a[`cp1${i}`]=o-r,a[`cp1${n}`]=c-r*e[h]),l&&(r=(l[i]-o)/3,a[`cp2${i}`]=o+r,a[`cp2${n}`]=c+r*e[h])}}(t,r,e)}function Ke(t,e,i){return Math.max(Math.min(t,i),e)}function Ye(t,e,i,n,o){let r,s,a,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)$e(t,o);else{let i=n?t[t.length-1]:t[0];for(r=0,s=t.length;r<s;++r)a=t[r],l=qe(i,a,t[Math.min(r+1,s-(n?0:1))%s],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,i=a}e.capBezierPoints&&function(t,e){let i,n,o,r,s,a=pe(t[0],e);for(i=0,n=t.length;i<n;++i)s=r,r=a,a=i<n-1&&pe(t[i+1],e),r&&(o=t[i],s&&(o.cp1x=Ke(o.cp1x,e.left,e.right),o.cp1y=Ke(o.cp1y,e.top,e.bottom)),a&&(o.cp2x=Ke(o.cp2x,e.left,e.right),o.cp2y=Ke(o.cp2y,e.top,e.bottom)))}(t,i)}function Je(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Xe(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function Qe(t,e,i){let n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}const ti=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);const ei=["top","right","bottom","left"];function ii(t,e,i){const n={};i=i?"-"+i:"";for(let o=0;o<4;o++){const r=ei[o];n[r]=parseFloat(t[e+"-"+r+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const ni=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function oi(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,o=ti(i),r="border-box"===o.boxSizing,s=ii(o,"padding"),a=ii(o,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:o,offsetY:r}=n;let s,a,l=!1;if(ni(o,r,t.target))s=o,a=r;else{const t=e.getBoundingClientRect();s=n.clientX-t.left,a=n.clientY-t.top,l=!0}return{x:s,y:a,box:l}}(t,i),p=s.left+(c&&a.left),u=s.top+(c&&a.top);let{width:d,height:m}=e;return r&&(d-=s.width+a.width,m-=s.height+a.height),{x:Math.round((l-p)/d*i.width/n),y:Math.round((h-u)/m*i.height/n)}}const ri=t=>Math.round(10*t)/10;function si(t,e,i,n){const o=ti(t),r=ii(o,"margin"),s=Qe(o.maxWidth,t,"clientWidth")||ht,a=Qe(o.maxHeight,t,"clientHeight")||ht,l=function(t,e,i){let n,o;if(void 0===e||void 0===i){const r=Xe(t);if(r){const t=r.getBoundingClientRect(),s=ti(r),a=ii(s,"border","width"),l=ii(s,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=Qe(s.maxWidth,r,"clientWidth"),o=Qe(s.maxHeight,r,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||ht,maxHeight:o||ht}}(t,e,i);let{width:h,height:c}=l;if("content-box"===o.boxSizing){const t=ii(o,"border","width"),e=ii(o,"padding");h-=e.width+t.width,c-=e.height+t.height}h=Math.max(0,h-r.width),c=Math.max(0,n?h/n:c-r.height),h=ri(Math.min(h,s,l.maxWidth)),c=ri(Math.min(c,a,l.maxHeight)),h&&!c&&(c=ri(h/2));return(void 0!==e||void 0!==i)&&n&&l.height&&c>l.height&&(c=l.height,h=ri(Math.floor(c*n))),{width:h,height:c}}function ai(t,e,i){const n=e||1,o=Math.floor(t.height*n),r=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const s=t.canvas;return s.style&&(i||!s.style.height&&!s.style.width)&&(s.style.height=`${t.height}px`,s.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||s.height!==o||s.width!==r)&&(t.currentDevicePixelRatio=n,s.height=o,s.width=r,t.ctx.setTransform(n,0,0,n,0,0),!0)}const li=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Je()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function hi(t,e){const i=function(t,e){return ti(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function ci(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function pi(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function ui(t,e,i,n){const o={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},s=ci(t,o,i),a=ci(o,r,i),l=ci(r,e,i),h=ci(s,a,i),c=ci(a,l,i);return ci(h,c,i)}function di(t,e,i){return t?function(t,e){return{x(i){return t+t+e-i},setWidth(t){e=t},textAlign(t){return"center"===t?t:"right"===t?"left":"right"},xPlus(t,e){return t-e},leftForLtr(t,e){return t-e}}}(e,i):{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}}function mi(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function fi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function gi(t){return"angle"===t?{between:Pt,compare:Mt,normalize:Ct}:{between:Tt,compare:(t,e)=>t-e,normalize:t=>t}}function _i({start:t,end:e,count:i,loop:n,style:o}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:o}}function vi(t,e,i){if(!i)return[t];const{property:n,start:o,end:r}=i,s=e.length,{compare:a,between:l,normalize:h}=gi(n),{start:c,end:p,loop:u,style:d}=function(t,e,i){const{property:n,start:o,end:r}=i,{between:s,normalize:a}=gi(n),l=e.length;let h,c,{start:p,end:u,loop:d}=t;if(d){for(p+=l,u+=l,h=0,c=l;h<c&&s(a(e[p%l][n]),o,r);++h)p--,u--;p%=l,u%=l}return u<p&&(u+=l),{start:p,end:u,loop:d,style:t.style}}(t,e,i),m=[];let f,g,_,v=!1,y=null;const b=()=>v||l(o,_,f)&&0!==a(o,_),x=()=>!v||0===a(r,f)||l(r,_,f);for(let t=c,i=c;t<=p;++t)g=e[t%s],g.skip||(f=h(g[n]),f!==_&&(v=l(f,o,r),null===y&&b()&&(y=0===a(f,o)?t:i),null!==y&&x()&&(m.push(_i({start:y,end:t,loop:u,count:s,style:d})),y=null),i=t,_=f));return null!==y&&m.push(_i({start:y,end:p,loop:u,count:s,style:d})),m}function yi(t,e){const i=[],n=t.segments;for(let o=0;o<n.length;o++){const r=vi(n[o],t.points,e);r.length&&i.push(...r)}return i}function bi(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const o=t._chart.getContext(),r=xi(t.options),{_datasetIndex:s,options:{spanGaps:a}}=t,l=i.length,h=[];let c=r,p=e[0].start,u=p;function d(t,e,n,o){const r=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=r;for(;i[e%l].skip;)e+=r;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:n,style:o}),c=o,p=e%l)}}for(const t of e){p=a?p:t.start;let e,r=i[p%l];for(u=p+1;u<=t.end;u++){const a=i[u%l];e=xi(n.setContext(Ae(o,{type:"segment",p0:r,p1:a,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:s}))),ki(e,c)&&d(p,u-1,t.loop,c),r=a,c=e}p<u-1&&d(p,u-1,t.loop,c)}return h}(t,e,i,n):e}function xi(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function ki(t,e){if(!e)return!1;const i=[],n=function(t,e){return Vt(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,n)!==JSON.stringify(e,n)} /*! * Chart.js v4.4.1 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License */ class Li{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const o=e.listeners[n],r=e.duration;o.forEach((n=>n({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)})))}_refresh(){this._request||(this._running=!0,this._request=Bt.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,n)=>{if(!i.running||!i.items.length)return;const o=i.items;let r,s=o.length-1,a=!1;for(;s>=0;--s)r=o[s],r._active?(r._total>i.duration&&(i.duration=r._total),r.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),o.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=o.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var wi=new Li;const Mi="transparent",Ci={boolean(t,e,i){return i>.5?e:t},color(t,e,i){const n=Wt(t||Mi),o=n.valid&&Wt(e||Mi);return o&&o.valid?o.mix(n,i).hexString():e},number(t,e,i){return t+(e-t)*i}};class Pi{constructor(t,e,i,n){const o=e[i];n=Te([t.to,n,o,t.from]);const r=Te([t.from,o,n]);this._active=!0,this._fn=t.fn||Ci[t.type||typeof r],this._easing=Zt[t.easing]||Zt.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Te([t.to,e,n,t.from]),this._from=Te([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,o=this._from,r=this._loop,s=this._to;let a;if(this._active=o!==s&&(r||e<i),!this._active)return this._target[n]=s,void this._notify(!0);e<0?this._target[n]=o:(a=e/i%2,a=r&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(o,s,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class Si{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!N(t))return;const e=Object.keys(re.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach((n=>{const o=t[n];if(!N(o))return;const r={};for(const t of e)r[t]=o[t];(j(o.properties)&&o.properties||[n]).forEach((t=>{t!==n&&i.has(t)||i.set(t,r)}))}))}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!n)return[];const o=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e<n.length;e++){const o=t[n[e]];o&&o.active()&&i.push(o.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),o}_createAnimations(t,e){const i=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),s=Date.now();let a;for(a=r.length-1;a>=0;--a){const l=r[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const h=e[l];let c=o[l];const p=i.get(l);if(c){if(p&&c.active()){c.update(p,h,s);continue}c.cancel()}p&&p.duration?(o[l]=c=new Pi(p,t,l,h),n.push(c)):t[l]=h}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(wi.add(this._chart,i),!0):void 0}}function Ti(t,e){const i=t&&t.options||{},n=i.reverse,o=void 0===i.min?e:0,r=void 0===i.max?e:0;return{start:n?r:o,end:n?o:r}}function Ai(t,e){const i=[],n=t._getSortedDatasetMetas(e);let o,r;for(o=0,r=n.length;o<r;++o)i.push(n[o].index);return i}function Di(t,e,i,n={}){const o=t.keys,r="single"===n.mode;let s,a,l,h;if(null!==e){for(s=0,a=o.length;s<a;++s){if(l=+o[s],l===i){if(n.all)continue;break}h=t.values[l],U(h)&&(r||0===e||ft(e)===ft(h))&&(e+=h)}return e}}function Ei(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function Oi(t,e,i){const n=t[e]||(t[e]={});return n[i]||(n[i]={})}function Ii(t,e,i,n){for(const o of e.getMatchingVisibleMetas(n).reverse()){const e=t[o.index];if(i&&e>0||!i&&e<0)return o.index}return null}function Bi(t,e){const{chart:i,_cachedMeta:n}=t,o=i._stacks||(i._stacks={}),{iScale:r,vScale:s,index:a}=n,l=r.axis,h=s.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(r,s,n),p=e.length;let u;for(let t=0;t<p;++t){const i=e[t],{[l]:r,[h]:p}=i;u=(i._stacks||(i._stacks={}))[h]=Oi(o,c,r),u[a]=p,u._top=Ii(u,s,!0,n.type),u._bottom=Ii(u,s,!1,n.type);(u._visualValues||(u._visualValues={}))[a]=p}}function Ri(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function zi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i],void 0!==e[n]._visualValues&&void 0!==e[n]._visualValues[i]&&delete e[n]._visualValues[i]}}}const Fi=t=>"reset"===t||"none"===t,ji=(t,e)=>e?t:Object.assign({},t);class Ni{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ei(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&zi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,o=e.xAxisID=H(i.xAxisID,Ri(t,"x")),r=e.yAxisID=H(i.yAxisID,Ri(t,"y")),s=e.rAxisID=H(i.rAxisID,Ri(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,o,r,s),h=e.vAxisID=n(a,r,o,s);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(s),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&It(this._data,this),t._stacked&&zi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(N(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n],i[n]={x:r,y:t[r]};return i}(e);else if(i!==e){if(i){It(i,this);const t=this._cachedMeta;zi(t),t._parsed=[]}e&&Object.isExtensible(e)&&(o=this,(n=e)._chartjs?n._chartjs.listeners.push(o):(Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[o]}}),Ot.forEach((t=>{const e="_onData"+it(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const o=i.apply(this,t);return n._chartjs.listeners.forEach((i=>{"function"==typeof i[e]&&i[e](...t)})),o}})})))),this._syncList=[],this._data=e}var n,o}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Ei(e.vScale,e),e.stack!==i.stack&&(n=!0,zi(e),e.stack=i.stack),this._resyncElements(t),(n||o!==e._stacked)&&Bi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:o,_stacked:r}=i,s=o.axis;let a,l,h,c=0===t&&e===n.length||i._sorted,p=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,h=n;else{h=j(n[t])?this.parseArrayData(i,n,t,e):N(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const o=()=>null===l[s]||p&&l[s]<p[s];for(a=0;a<e;++a)i._parsed[a+t]=l=h[a],c&&(o()&&(c=!1),p=l);i._sorted=c}r&&Bi(this,h)}parsePrimitiveData(t,e,i,n){const{iScale:o,vScale:r}=t,s=o.axis,a=r.axis,l=o.getLabels(),h=o===r,c=new Array(n);let p,u,d;for(p=0,u=n;p<u;++p)d=p+i,c[p]={[s]:h||o.parse(l[d],d),[a]:r.parse(e[d],d)};return c}parseArrayData(t,e,i,n){const{xScale:o,yScale:r}=t,s=new Array(n);let a,l,h,c;for(a=0,l=n;a<l;++a)h=a+i,c=e[h],s[a]={x:o.parse(c[0],h),y:r.parse(c[1],h)};return s}parseObjectData(t,e,i,n){const{xScale:o,yScale:r}=t,{xAxisKey:s="x",yAxisKey:a="y"}=this._parsing,l=new Array(n);let h,c,p,u;for(h=0,c=n;h<c;++h)p=h+i,u=e[p],l[h]={x:o.parse(et(u,s),p),y:r.parse(et(u,a),p)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,o=this._cachedMeta,r=e[t.axis];return Di({keys:Ai(n,!0),values:e._stacks[t.axis]._visualValues},r,o.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const o=i[e.axis];let r=null===o?NaN:o;const s=n&&i._stacks[e.axis];n&&s&&(n.values=s,r=Di(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,o=i._sorted&&t===i.iScale,r=n.length,s=this._getOtherScale(t),a=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:Ai(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=function(t){const{min:e,max:i,minDefined:n,maxDefined:o}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:o?i:Number.POSITIVE_INFINITY}}(s);let p,u;function d(){u=n[p];const e=u[s.axis];return!U(u[t.axis])||h>e||c<e}for(p=0;p<r&&(d()||(this.updateRangeFromParsed(l,t,u,a),!o));++p);if(o)for(p=r-1;p>=0;--p)if(!d()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],U(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,n,o;return N(t)?(e=t.top,i=t.right,n=t.bottom,o=t.left):e=i=n=o=t,{top:e,right:i,bottom:n,left:o,disabled:!1===t}}(H(this.options.clip,function(t,e,i){if(!1===i)return!1;const n=Ti(t,i),o=Ti(e,i);return{top:o.end,right:n.end,bottom:o.start,left:n.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],o=e.chartArea,r=[],s=this._drawStart||0,a=this._drawCount||n.length-s,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,o,s,a),h=s;h<s+a;++h){const e=n[h];e.hidden||(e.active&&l?r.push(e):e.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];o=e.$context||(e.$context=function(t,e,i){return Ae(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=function(t,e){return Ae(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n="active"===e,o=this._cachedDataOpts,r=t+"-"+e,s=o[r],a=this.enableOptionSharing&&nt(i);if(s)return ji(s,a);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=n?[`${t}Hover`,"hover",t,""]:[t,""],p=l.getOptionScopes(this.getDataset(),h),u=Object.keys(re.elements[t]),d=l.resolveNamedOptions(p,u,(()=>this.getContext(i,n,e)),c);return d.$shared&&(d.$shared=a,o[r]=Object.freeze(ji(d,a))),d}_resolveAnimations(t,e,i){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,s=o[r];if(s)return s;let a;if(!1!==n.options.animation){const n=this.chart.config,o=n.datasetAnimationScopeKeys(this._type,e),r=n.getOptionScopes(this.getDataset(),o);a=n.createResolver(r,this.getContext(t,i,e))}const l=new Si(n,a&&a.animations);return a&&a._cacheable&&(o[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Fi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:r}}updateElement(t,e,i,n){Fi(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Fi(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,i=!0){const n=this._cachedMeta,o=n.data,r=t+e;let s;const a=t=>{for(t.length+=e,s=t.length-1;s>=r;s--)t[s]=t[s-e]};for(a(o),s=t;s<r;++s)o[s]=new this.dataElementType;this._parsing&&a(n._parsed),this.parse(t,e),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&zi(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class Ui extends Ni{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:o}=e,r=this.getParsed(t),s=n.getLabelForValue(r.x),a=o.getLabelForValue(r.y);return{label:i[t]||"",value:"("+s+", "+a+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,n=this.chart._animationsDisabled;let{start:o,count:r}=jt(e,i,n);if(this._drawStart=o,this._drawCount=r,Nt(e)&&(o=0,r=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:r}=e;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!r._decimated,o.points=i;const s=this.resolveDatasetElementOptions(t);s.segment=this.options.segment,this.updateElement(o,void 0,{animated:!n,options:s},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,o,r,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,n){const o="reset"===n,{iScale:r,vScale:s,_stacked:a,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,n),c=this.getSharedOptions(h),p=this.includeOptions(n,c),u=r.axis,d=s.axis,{spanGaps:m,segment:f}=this.options,g=vt(m)?m:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||"none"===n;let v=e>0&&this.getParsed(e-1);for(let h=e;h<e+i;++h){const e=t[h],i=this.getParsed(h),m=_?e:{},y=F(i[d]),b=m[u]=r.getPixelForValue(i[u],h),x=m[d]=o||y?s.getBasePixel():s.getPixelForValue(a?this.applyStack(s,i,a):i[d],h);m.skip=isNaN(b)||isNaN(x)||y,m.stop=h>0&&Math.abs(i[u]-v[u])>g,f&&(m.parsed=i,m.raw=l.data[h]),p&&(m.options=c||this.resolveDataElementOptions(h,e.active?"active":n)),_||this.updateElement(e,h,m,n),v=i}this.updateSharedOptions(c,n,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,o,r)/2}}function Gi(t,e,i,n){const{controller:o,data:r,_sorted:s}=t,a=o._cachedMeta.iScale;if(a&&e===a.axis&&"r"!==e&&s&&r.length){const t=a._reversePixels?Et:Dt;if(!n)return t(r,e,i);if(o._sharedOptions){const n=r[0],o="function"==typeof n.getRange&&n.getRange(e);if(o){const n=t(r,e,i-o),s=t(r,e,i+o);return{lo:n.lo,hi:s.hi}}}}return{lo:0,hi:r.length-1}}function Hi(t,e,i,n,o){const r=t.getSortedVisibleDatasetMetas(),s=i[e];for(let t=0,i=r.length;t<i;++t){const{index:i,data:a}=r[t],{lo:l,hi:h}=Gi(r[t],e,s,o);for(let t=l;t<=h;++t){const e=a[t];e.skip||n(e,i,t)}}}function Zi(t,e,i,n,o){const r=[];if(!o&&!t.isPointInArea(e))return r;return Hi(t,i,e,(function(i,s,a){(o||pe(i,t.chartArea,0))&&i.inRange(e.x,e.y,n)&&r.push({element:i,datasetIndex:s,index:a})}),!0),r}function Vi(t,e,i,n,o,r){let s=[];const a=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){const o=e?Math.abs(t.x-n.x):0,r=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}(i);let l=Number.POSITIVE_INFINITY;return Hi(t,i,e,(function(i,h,c){const p=i.inRange(e.x,e.y,o);if(n&&!p)return;const u=i.getCenterPoint(o);if(!(!!r||t.isPointInArea(u))&&!p)return;const d=a(e,u);d<l?(s=[{element:i,datasetIndex:h,index:c}],l=d):d===l&&s.push({element:i,datasetIndex:h,index:c})})),s}function Wi(t,e,i,n,o,r){return r||t.isPointInArea(e)?"r"!==i||n?Vi(t,e,i,n,o,r):function(t,e,i,n){let o=[];return Hi(t,i,e,(function(t,i,r){const{startAngle:s,endAngle:a}=t.getProps(["startAngle","endAngle"],n),{angle:l}=Lt(t,{x:e.x,y:e.y});Pt(l,s,a)&&o.push({element:t,datasetIndex:i,index:r})})),o}(t,e,i,o):[]}function qi(t,e,i,n,o){const r=[],s="x"===i?"inXRange":"inYRange";let a=!1;return Hi(t,i,e,((t,n,l)=>{t[s](e[i],o)&&(r.push({element:t,datasetIndex:n,index:l}),a=a||t.inRange(e.x,e.y,o))})),n&&!a?[]:r}var $i={evaluateInteractionItems:Hi,modes:{index(t,e,i,n){const o=oi(e,t),r=i.axis||"x",s=i.includeInvisible||!1,a=i.intersect?Zi(t,o,r,n,s):Wi(t,o,r,!1,n,s),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,n){const o=oi(e,t),r=i.axis||"xy",s=i.includeInvisible||!1;let a=i.intersect?Zi(t,o,r,n,s):Wi(t,o,r,!1,n,s);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;t<i.length;++t)a.push({element:i[t],datasetIndex:e,index:t})}return a},point(t,e,i,n){return Zi(t,oi(e,t),i.axis||"xy",n,i.includeInvisible||!1)},nearest(t,e,i,n){const o=oi(e,t),r=i.axis||"xy",s=i.includeInvisible||!1;return Wi(t,o,r,i.intersect,n,s)},x(t,e,i,n){return qi(t,oi(e,t),"x",i.intersect,n)},y(t,e,i,n){return qi(t,oi(e,t),"y",i.intersect,n)}}};const Ki=["left","top","right","bottom"];function Yi(t,e){return t.filter((t=>t.pos===e))}function Ji(t,e){return t.filter((t=>-1===Ki.indexOf(t.pos)&&t.box.axis===e))}function Xi(t,e){return t.sort(((t,i)=>{const n=e?i:t,o=e?t:i;return n.weight===o.weight?n.index-o.index:n.weight-o.weight}))}function Qi(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:o}=i;if(!t||!Ki.includes(n))continue;const r=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:o}=e;let r,s,a;for(r=0,s=t.length;r<s;++r){a=t[r];const{fullSize:s}=a.box,l=i[a.stack],h=l&&a.stackWeight/l.weight;a.horizontal?(a.width=h?h*n:s&&e.availableWidth,a.height=o):(a.width=n,a.height=h?h*o:s&&e.availableHeight)}return i}function tn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function en(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function nn(t,e,i,n){const{pos:o,box:r}=i,s=t.maxPadding;if(!N(o)){i.size&&(t[o]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?r.height:r.width),i.size=e.size/e.count,t[o]+=i.size}r.getPadding&&en(s,r.getPadding());const a=Math.max(0,e.outerWidth-tn(s,t,"left","right")),l=Math.max(0,e.outerHeight-tn(s,t,"top","bottom")),h=a!==t.w,c=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}function on(t,e){const i=e.maxPadding;function n(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{n[t]=Math.max(e[t],i[t])})),n}return n(t?["left","right"]:["top","bottom"])}function rn(t,e,i,n){const o=[];let r,s,a,l,h,c;for(r=0,s=t.length,h=0;r<s;++r){a=t[r],l=a.box,l.update(a.width||e.w,a.height||e.h,on(a.horizontal,e));const{same:s,other:p}=nn(e,i,a,n);h|=s&&o.length,c=c||p,l.fullSize||o.push(a)}return h&&rn(o,e,i,n)||c}function sn(t,e,i,n,o){t.top=i,t.left=e,t.right=e+n,t.bottom=i+o,t.width=n,t.height=o}function an(t,e,i,n){const o=i.padding;let{x:r,y:s}=e;for(const a of t){const t=a.box,l=n[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/l.weight||1;if(a.horizontal){const n=e.w*h,r=l.size||t.height;nt(l.start)&&(s=l.start),t.fullSize?sn(t,o.left,s,i.outerWidth-o.right-o.left,r):sn(t,e.left+l.placed,s,n,r),l.start=s,l.placed+=n,s=t.bottom}else{const n=e.h*h,s=l.size||t.width;nt(l.start)&&(r=l.start),t.fullSize?sn(t,r,o.top,s,i.outerHeight-o.bottom-o.top):sn(t,r,e.top+l.placed,s,n),l.start=r,l.placed+=n,r=t.right}}e.x=r,e.y=s}var ln={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,n){if(!t)return;const o=Pe(t.options.layout.padding),r=Math.max(e-o.width,0),s=Math.max(i-o.height,0),a=function(t){const e=function(t){const e=[];let i,n,o,r,s,a;for(i=0,n=(t||[]).length;i<n;++i)o=t[i],({position:r,options:{stack:s,stackWeight:a=1}}=o),e.push({index:i,box:o,pos:r,horizontal:o.isHorizontal(),weight:o.weight,stack:s&&r+s,stackWeight:a});return e}(t),i=Xi(e.filter((t=>t.box.fullSize)),!0),n=Xi(Yi(e,"left"),!0),o=Xi(Yi(e,"right")),r=Xi(Yi(e,"top"),!0),s=Xi(Yi(e,"bottom")),a=Ji(e,"x"),l=Ji(e,"y");return{fullSize:i,leftAndTop:n.concat(r),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:Yi(e,"chartArea"),vertical:n.concat(o).concat(l),horizontal:r.concat(s).concat(a)}}(t.boxes),l=a.vertical,h=a.horizontal;W(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,p=Object.freeze({outerWidth:e,outerHeight:i,padding:o,availableWidth:r,availableHeight:s,vBoxMaxWidth:r/2/c,hBoxMaxHeight:s/2}),u=Object.assign({},o);en(u,Pe(n));const d=Object.assign({maxPadding:u,w:r,h:s,x:o.left,y:o.top},o),m=Qi(l.concat(h),p);rn(a.fullSize,d,p,m),rn(l,d,p,m),rn(h,d,p,m)&&rn(l,d,p,m),function(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(d),an(a.leftAndTop,d,p,m),d.x+=d.w,d.y+=d.h,an(a.rightAndBottom,d,p,m),t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},W(a.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})}))}};class hn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class cn extends hn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pn="$chartjs",un={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},dn=t=>null===t||""===t;const mn=!!li&&{passive:!0};function fn(t,e,i){t.canvas.removeEventListener(e,i,mn)}function gn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function _n(t,e,i){const n=t.canvas,o=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||gn(i.addedNodes,n),e=e&&!gn(i.removedNodes,n);e&&i()}));return o.observe(document,{childList:!0,subtree:!0}),o}function vn(t,e,i){const n=t.canvas,o=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||gn(i.removedNodes,n),e=e&&!gn(i.addedNodes,n);e&&i()}));return o.observe(document,{childList:!0,subtree:!0}),o}const yn=new Map;let bn=0;function xn(){const t=window.devicePixelRatio;t!==bn&&(bn=t,yn.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function kn(t,e,i){const n=t.canvas,o=n&&Xe(n);if(!o)return;const r=Rt(((t,e)=>{const n=o.clientWidth;i(t,e),n<o.clientWidth&&i()}),window),s=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||r(i,n)}));return s.observe(o),function(t,e){yn.size||window.addEventListener("resize",xn),yn.set(t,e)}(t,r),s}function Ln(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){yn.delete(t),yn.size||window.removeEventListener("resize",xn)}(t)}function wn(t,e,i){const n=t.canvas,o=Rt((e=>{null!==t.ctx&&i(function(t,e){const i=un[t.type]||t.type,{x:n,y:o}=oi(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==o?o:null}}(e,t))}),t);return function(t,e,i){t.addEventListener(e,i,mn)}(n,e,o),o}class Mn extends hn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),o=t.getAttribute("width");if(t[pn]={initial:{height:n,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",dn(o)){const e=hi(t,"width");void 0!==e&&(t.width=e)}if(dn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=hi(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[pn])return!1;const i=e[pn].initial;["height","width"].forEach((t=>{const n=i[t];F(n)?e.removeAttribute(t):e.setAttribute(t,n)}));const n=i.style||{};return Object.keys(n).forEach((t=>{e.style[t]=n[t]})),e.width=e.width,delete e[pn],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),o={attach:_n,detach:vn,resize:kn}[e]||wn;n[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:Ln,detach:Ln,resize:Ln}[e]||fn)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return si(t,e,i,n)}isAttached(t){const e=Xe(t);return!(!e||!e.isConnected)}}class Cn{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return vt(this.x)&&vt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach((t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),n}}function Pn(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),o=t._maxLength/i;return Math.floor(Math.min(n,o))}(t),o=Math.min(i.maxTicksLimit||n,n),r=i.major.enabled?function(t){const e=[];let i,n;for(i=0,n=t.length;i<n;i++)t[i].major&&e.push(i);return e}(e):[],s=r.length,a=r[0],l=r[s-1],h=[];if(s>o)return function(t,e,i,n){let o,r=0,s=i[0];for(n=Math.ceil(n),o=0;o<t.length;o++)o===s&&(e.push(t[o]),r++,s=i[r*n])}(e,h,r,s/o),h;const c=function(t,e,i){const n=function(t){const e=t.length;let i,n;if(e<2)return!1;for(n=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==n)return!1;return n}(t),o=e.length/i;if(!n)return Math.max(o,1);const r=function(t){const e=[],i=Math.sqrt(t);let n;for(n=1;n<i;n++)t%n==0&&(e.push(n),e.push(t/n));return i===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}(n);for(let t=0,e=r.length-1;t<e;t++){const e=r[t];if(e>o)return e}return Math.max(o,1)}(r,e,o);if(s>0){let t,i;const n=s>1?Math.round((l-a)/(s-1)):null;for(Sn(e,h,c,F(n)?0:a-n,a),t=0,i=s-1;t<i;t++)Sn(e,h,c,r[t],r[t+1]);return Sn(e,h,c,l,F(n)?e.length:l+n),h}return Sn(e,h,c),h}function Sn(t,e,i,n,o){const r=H(n,0),s=Math.min(H(o,t.length),t.length);let a,l,h,c=0;for(i=Math.ceil(i),o&&(a=o-n,i=a/Math.floor(a/i)),h=r;h<0;)c++,h=Math.round(r+c*i);for(l=Math.max(r,0);l<s;l++)l===h&&(e.push(t[l]),c++,h=Math.round(r+c*i))}const Tn=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,An=(t,e)=>Math.min(e||t,t);function Dn(t,e){const i=[],n=t.length/e,o=t.length;let r=0;for(;r<o;r+=n)i.push(t[Math.floor(r)]);return i}function En(t,e,i){const n=t.ticks.length,o=Math.min(e,n-1),r=t._startPixel,s=t._endPixel,a=1e-6;let l,h=t.getPixelForTick(o);if(!(i&&(l=1===n?Math.max(h-r,s-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(o-1))/2,h+=o<e?l:-l,h<r-a||h>s+a)))return h}function On(t){return t.drawTicks?t.tickLength:0}function In(t,e){if(!t.display)return 0;const i=Se(t.font,e),n=Pe(t.padding);return(j(t.text)?t.text.length:1)*i.lineHeight+n.height}function Bn(t,e,i){let n=zt(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Rn extends Cn{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=G(t,Number.POSITIVE_INFINITY),e=G(e,Number.NEGATIVE_INFINITY),i=G(i,Number.POSITIVE_INFINITY),n=G(n,Number.NEGATIVE_INFINITY),{min:G(t,i),max:G(e,n),minDefined:U(t),maxDefined:U(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:o,maxDefined:r}=this.getUserBounds();if(o&&r)return{min:i,max:n};const s=this.getMatchingVisibleMetas();for(let a=0,l=s.length;a<l;++a)e=s[a].controller.getMinMax(this,t),o||(i=Math.min(i,e.min)),r||(n=Math.max(n,e.max));return i=r&&i>n?n:i,n=o&&i>n?i:n,{min:G(i,G(n,i)),max:G(n,G(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){V(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:o,ticks:r}=this.options,s=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:o}=t,r=Z(e,(o-n)/2),s=(t,e)=>i&&0===t?0:t+e;return{min:s(n,-Math.abs(r)),max:s(o,r)}}(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=s<this.ticks.length;this._convertTicksToLabels(a?Dn(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(this.ticks=Pn(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){V(this.options.afterUpdate,[this])}beforeSetDimensions(){V(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){V(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),V(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){V(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,o;for(i=0,n=t.length;i<n;i++)o=t[i],o.label=V(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){V(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){V(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=An(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let r,s,a,l=n;if(!this._isVisible()||!e.display||n>=o||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const h=this._getLabelSizes(),c=h.widest.width,p=h.highest.height,u=St(this.chart.width-c,0,this.maxWidth);r=t.offset?this.maxWidth/i:u/(i-1),c+6>r&&(r=u/(i-(t.offset?.5:1)),s=this.maxHeight-On(t.grid)-e.padding-In(t.title,this.chart.options.font),a=Math.sqrt(c*c+p*p),l=xt(Math.min(Math.asin(St((h.highest.height+6)/r,-1,1)),Math.asin(St(s/a,-1,1))-Math.asin(St(p/a,-1,1)))),l=Math.max(n,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){V(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){V(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:o}}=this,r=this._isVisible(),s=this.isHorizontal();if(r){const r=In(n,e.options.font);if(s?(t.width=this.maxWidth,t.height=On(o)+r):(t.height=this.maxHeight,t.width=On(o)+r),i.display&&this.ticks.length){const{first:e,last:n,widest:o,highest:r}=this._getLabelSizes(),a=2*i.padding,l=bt(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(s){const e=i.mirror?0:c*o.width+h*r.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:h*o.width+c*r.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,c,h)}}this._handleMargins(),s?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:o,padding:r},position:s}=this.options,a=0!==this.labelRotation,l="top"!==s&&"x"===this.axis;if(this.isHorizontal()){const s=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,p=0;a?l?(c=n*t.width,p=i*e.height):(c=i*t.height,p=n*e.width):"start"===o?p=e.width:"end"===o?c=t.width:"inner"!==o&&(c=t.width/2,p=e.width/2),this.paddingLeft=Math.max((c-s+r)*this.width/(this.width-s),0),this.paddingRight=Math.max((p-h+r)*this.width/(this.width-h),0)}else{let i=e.height/2,n=t.height/2;"start"===o?(i=0,n=t.height):"end"===o&&(i=e.height,n=0),this.paddingTop=i+r,this.paddingBottom=n+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){V(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)F(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Dn(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:n,_longestTextCache:o}=this,r=[],s=[],a=Math.floor(e/An(e,i));let l,h,c,p,u,d,m,f,g,_,v,y=0,b=0;for(l=0;l<e;l+=a){if(p=t[l].label,u=this._resolveTickFontOptions(l),n.font=d=u.string,m=o[d]=o[d]||{data:{},gc:[]},f=u.lineHeight,g=_=0,F(p)||j(p)){if(j(p))for(h=0,c=p.length;h<c;++h)v=p[h],F(v)||j(v)||(g=se(n,m.data,m.gc,g,v),_+=f)}else g=se(n,m.data,m.gc,g,p),_=f;r.push(g),s.push(_),y=Math.max(g,y),b=Math.max(_,b)}!function(t,e){W(t,(t=>{const i=t.gc,n=i.length/2;let o;if(n>e){for(o=0;o<n;++o)delete t.data[i[o]];i.splice(0,n)}}))}(o,e);const x=r.indexOf(y),k=s.indexOf(b),L=t=>({width:r[t]||0,height:s[t]||0});return{first:L(0),last:L(e-1),widest:L(x),highest:L(k),widths:r,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return St(this._alignToPixels?ae(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return Ae(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=Ae(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=bt(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,s=o?o.widest.width+r:0,a=o?o.highest.height+r:0;return this.isHorizontal()?a*i>s*n?s/i:a/n:a*n<s*i?a/i:s/n}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:o,position:r,border:s}=n,a=o.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),c=On(o),p=[],u=s.setContext(this.getContext()),d=u.display?u.width:0,m=d/2,f=function(t){return ae(i,t,d)};let g,_,v,y,b,x,k,L,w,M,C,P;if("top"===r)g=f(this.bottom),x=this.bottom-c,L=g-m,M=f(t.top)+m,P=t.bottom;else if("bottom"===r)g=f(this.top),M=t.top,P=f(t.bottom)-m,x=g+m,L=this.top+c;else if("left"===r)g=f(this.right),b=this.right-c,k=g-m,w=f(t.left)+m,C=t.right;else if("right"===r)g=f(this.left),w=t.left,C=f(t.right)-m,b=g+m,k=this.left+c;else if("x"===e){if("center"===r)g=f((t.top+t.bottom)/2+.5);else if(N(r)){const t=Object.keys(r)[0],e=r[t];g=f(this.chart.scales[t].getPixelForValue(e))}M=t.top,P=t.bottom,x=g+m,L=x+c}else if("y"===e){if("center"===r)g=f((t.left+t.right)/2);else if(N(r)){const t=Object.keys(r)[0],e=r[t];g=f(this.chart.scales[t].getPixelForValue(e))}b=g-m,k=b-c,w=t.left,C=t.right}const S=H(n.ticks.maxTicksLimit,h),T=Math.max(1,Math.ceil(h/S));for(_=0;_<h;_+=T){const t=this.getContext(_),e=o.setContext(t),n=s.setContext(t),r=e.lineWidth,h=e.color,c=n.dash||[],u=n.dashOffset,d=e.tickWidth,m=e.tickColor,f=e.tickBorderDash||[],g=e.tickBorderDashOffset;v=En(this,_,a),void 0!==v&&(y=ae(i,v,r),l?b=k=w=C=y:x=L=M=P=y,p.push({tx1:b,ty1:x,tx2:k,ty2:L,x1:w,y1:M,x2:C,y2:P,width:r,color:h,borderDash:c,borderDashOffset:u,tickWidth:d,tickColor:m,tickBorderDash:f,tickBorderDashOffset:g}))}return this._ticksLength=h,this._borderValue=g,p}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:o}=i,r=this.isHorizontal(),s=this.ticks,{align:a,crossAlign:l,padding:h,mirror:c}=o,p=On(i.grid),u=p+h,d=c?-h:u,m=-bt(this.labelRotation),f=[];let g,_,v,y,b,x,k,L,w,M,C,P,S="middle";if("top"===n)x=this.bottom-d,k=this._getXAxisLabelAlignment();else if("bottom"===n)x=this.top+d,k=this._getXAxisLabelAlignment();else if("left"===n){const t=this._getYAxisLabelAlignment(p);k=t.textAlign,b=t.x}else if("right"===n){const t=this._getYAxisLabelAlignment(p);k=t.textAlign,b=t.x}else if("x"===e){if("center"===n)x=(t.top+t.bottom)/2+u;else if(N(n)){const t=Object.keys(n)[0],e=n[t];x=this.chart.scales[t].getPixelForValue(e)+u}k=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===n)b=(t.left+t.right)/2-u;else if(N(n)){const t=Object.keys(n)[0],e=n[t];b=this.chart.scales[t].getPixelForValue(e)}k=this._getYAxisLabelAlignment(p).textAlign}"y"===e&&("start"===a?S="top":"end"===a&&(S="bottom"));const T=this._getLabelSizes();for(g=0,_=s.length;g<_;++g){v=s[g],y=v.label;const t=o.setContext(this.getContext(g));L=this.getPixelForTick(g)+o.labelOffset,w=this._resolveTickFontOptions(g),M=w.lineHeight,C=j(y)?y.length:1;const e=C/2,i=t.color,a=t.textStrokeColor,h=t.textStrokeWidth;let p,u=k;if(r?(b=L,"inner"===k&&(u=g===_-1?this.options.reverse?"left":"right":0===g?this.options.reverse?"right":"left":"center"),P="top"===n?"near"===l||0!==m?-C*M+M/2:"center"===l?-T.highest.height/2-e*M+M:-T.highest.height+M/2:"near"===l||0!==m?M/2:"center"===l?T.highest.height/2-e*M:T.highest.height-C*M,c&&(P*=-1),0===m||t.showLabelBackdrop||(b+=M/2*Math.sin(m))):(x=L,P=(1-C)*M/2),t.showLabelBackdrop){const e=Pe(t.backdropPadding),i=T.heights[g],n=T.widths[g];let o=P-e.top,r=0-e.left;switch(S){case"middle":o-=i/2;break;case"bottom":o-=i}switch(k){case"center":r-=n/2;break;case"right":r-=n;break;case"inner":g===_-1?r-=n:g>0&&(r-=n/2)}p={left:r,top:o,width:n+e.width,height:i+e.height,color:t.backdropColor}}f.push({label:y,font:w,textOffset:P,options:{rotation:m,color:i,strokeColor:a,strokeWidth:h,textAlign:u,textBaseline:S,translation:[b,x],backdrop:p}})}return f}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-bt(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:o}}=this.options,r=t+o,s=this._getLabelSizes().widest.width;let a,l;return"left"===e?n?(l=this.right+o,"near"===i?a="left":"center"===i?(a="center",l+=s/2):(a="right",l+=s)):(l=this.right-r,"near"===i?a="right":"center"===i?(a="center",l-=s/2):(a="left",l=this.left)):"right"===e?n?(l=this.left+o,"near"===i?a="right":"center"===i?(a="center",l-=s/2):(a="left",l-=s)):(l=this.left+r,"near"===i?a="left":"center"===i?(a="center",l+=s/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const s=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(o=0,r=n.length;o<r;++o){const t=n[o];e.drawOnChartArea&&s({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&s({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:n}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const s=n.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let l,h,c,p;this.isHorizontal()?(l=ae(t,this.left,r)-r/2,h=ae(t,this.right,s)+s/2,c=p=a):(c=ae(t,this.top,r)-r/2,p=ae(t,this.bottom,s)+s/2,l=h=a),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(l,c),e.lineTo(h,p),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&ue(e,i);const n=this.getLabelItems(t);for(const t of n){const i=t.options,n=t.font;ve(e,t.label,0,t.textOffset,n,i)}i&&de(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const o=Se(i.font),r=Pe(i.padding),s=i.align;let a=o.lineHeight/2;"bottom"===e||"center"===e||N(e)?(a+=r.bottom,j(i.text)&&(a+=o.lineHeight*(i.text.length-1))):a+=r.top;const{titleX:l,titleY:h,maxWidth:c,rotation:p}=function(t,e,i,n){const{top:o,left:r,bottom:s,right:a,chart:l}=t,{chartArea:h,scales:c}=l;let p,u,d,m=0;const f=s-o,g=a-r;if(t.isHorizontal()){if(u=Ft(n,r,a),N(i)){const t=Object.keys(i)[0],n=i[t];d=c[t].getPixelForValue(n)+f-e}else d="center"===i?(h.bottom+h.top)/2+f-e:Tn(t,i,e);p=a-r}else{if(N(i)){const t=Object.keys(i)[0],n=i[t];u=c[t].getPixelForValue(n)-g+e}else u="center"===i?(h.left+h.right)/2-g+e:Tn(t,i,e);d=Ft(n,s,o),m="left"===i?-pt:pt}return{titleX:u,titleY:d,maxWidth:p,rotation:m}}(this,a,e,s);ve(t,i.text,0,0,o,{color:i.color,maxWidth:c,rotation:p,textAlign:Bn(s,e,n),textBaseline:"middle",translation:[l,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=H(t.grid&&t.grid.z,-1),n=H(t.border&&t.border.z,0);return this._isVisible()&&this.draw===Rn.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const r=e[o];r[i]!==this.id||t&&r.type!==t||n.push(r)}return n}_resolveTickFontOptions(t){return Se(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class zn{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const n=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,function(t,e,i){const n=J(Object.create(null),[i?re.get(i):{},re.get(e),t.defaults]);re.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((i=>{const n=i.split("."),o=n.pop(),r=[t].concat(n).join("."),s=e[i].split("."),a=s.pop(),l=s.join(".");re.route(r,o,l,a)}))}(e,t.defaultRoutes);t.descriptors&&re.describe(e,t.descriptors)}(t,r,i),this.override&&re.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in re[n]&&(delete re[n][i],this.override&&delete te[i])}}class Fn{constructor(){this.controllers=new zn(Ni,"datasets",!0),this.elements=new zn(Cn,"elements"),this.plugins=new zn(Object,"plugins"),this.scales=new zn(Rn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):W(e,(e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)}))}))}_exec(t,e,i){const n=it(t);V(i["before"+n],[],i),e[t](i),V(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var jn=new Fn;class Nn{constructor(){this._init=[]}notify(t,e,i,n){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,i);return"afterDestroy"===e&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,i,n){n=n||{};for(const o of t){const t=o.plugin;if(!1===V(t[i],[e,n,o.options],t)&&n.cancelable)return!1}return!0}invalidate(){F(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,n=H(i.options&&i.options.plugins,{}),o=function(t){const e={},i=[],n=Object.keys(jn.plugins.items);for(let t=0;t<n.length;t++)i.push(jn.getPlugin(n[t]));const o=t.plugins||[];for(let t=0;t<o.length;t++){const n=o[t];-1===i.indexOf(n)&&(i.push(n),e[n.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==n||e?function(t,{plugins:e,localIds:i},n,o){const r=[],s=t.getContext();for(const a of e){const e=a.id,l=Un(n[e],o);null!==l&&r.push({plugin:a,options:Gn(t.config,{plugin:a,local:i[e]},l,s)})}return r}(t,o,n,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Un(t,e){return e||!1!==t?!0===t?{}:t:null}function Gn(t,{plugin:e,local:i},n,o){const r=t.pluginScopeKeys(e),s=t.getOptionScopes(n,r);return i&&e.defaults&&s.push(e.defaults),t.createResolver(s,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Hn(t,e){const i=re.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Zn(t){if("x"===t||"y"===t||"r"===t)return t}function Vn(t,...e){if(Zn(t))return t;for(const n of e){const e=n.axis||("top"===(i=n.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&Zn(t[0].toLowerCase());if(e)return e}var i;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Wn(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function qn(t,e){const i=te[t.type]||{scales:{}},n=e.scales||{},o=Hn(t.type,e),r=Object.create(null);return Object.keys(n).forEach((e=>{const s=n[e];if(!N(s))return console.error(`Invalid scale configuration for scale: ${e}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const a=Vn(e,s,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return Wn(t,"x",i[0])||Wn(t,"y",i[0])}return{}}(e,t),re.scales[s.type]),l=function(t,e){return t===e?"_index_":"_value_"}(a,o),h=i.scales||{};r[e]=X(Object.create(null),[{axis:a},s,h[a],h[l]])})),t.data.datasets.forEach((i=>{const o=i.type||t.type,s=i.indexAxis||Hn(o,e),a=(te[o]||{}).scales||{};Object.keys(a).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,s),o=i[e+"AxisID"]||e;r[o]=r[o]||Object.create(null),X(r[o],[{axis:e},n[o],a[t]])}))})),Object.keys(r).forEach((t=>{const e=r[t];X(e,[re.scales[e.type],re.scale])})),r}function $n(t){const e=t.options||(t.options={});e.plugins=H(e.plugins,{}),e.scales=qn(t,e)}function Kn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Yn=new Map,Jn=new Set;function Xn(t,e){let i=Yn.get(t);return i||(i=e(),Yn.set(t,i),Jn.add(i)),i}const Qn=(t,e,i)=>{const n=et(e,i);void 0!==n&&t.add(n)};class to{constructor(t){this._config=function(t){return(t=t||{}).data=Kn(t.data),$n(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Kn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),$n(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Xn(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Xn(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Xn(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Xn(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:o}=this,r=this._cachedScopes(t,i),s=r.get(e);if(s)return s;const a=new Set;e.forEach((e=>{t&&(a.add(t),e.forEach((e=>Qn(a,t,e)))),e.forEach((t=>Qn(a,n,t))),e.forEach((t=>Qn(a,te[o]||{},t))),e.forEach((t=>Qn(a,re,t))),e.forEach((t=>Qn(a,ee,t)))}));const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),Jn.has(e)&&r.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,te[e]||{},re.datasets[e]||{},{type:e},re,ee]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:s}=eo(this._resolverCache,t,n);let a=r;if(function(t,e){const{isScriptable:i,isIndexable:n}=Oe(t);for(const o of e){const e=i(o),r=n(o),s=(r||e)&&t[o];if(e&&(ot(s)||io(s))||r&&j(s))return!0}return!1}(r,e)){o.$shared=!1;a=Ee(r,i=ot(i)?i():i,this.createResolver(t,i,s))}for(const t of e)o[t]=a[t];return o}createResolver(t,e,i=[""],n){const{resolver:o}=eo(this._resolverCache,t,i);return N(e)?Ee(o,e,void 0,n):o}}function eo(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const o=i.join();let r=n.get(o);if(!r){r={resolver:De(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},n.set(o,r)}return r}const io=t=>N(t)&&Object.getOwnPropertyNames(t).some((e=>ot(t[e])));const no=["top","bottom","left","right","chartArea"];function oo(t,e){return"top"===t||"bottom"===t||-1===no.indexOf(t)&&"x"===e}function ro(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function so(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),V(i&&i.onComplete,[t],e)}function ao(t){const e=t.chart,i=e.options.animation;V(i&&i.onProgress,[t],e)}function lo(t){return Je()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ho={},co=t=>{const e=lo(t);return Object.values(ho).filter((t=>t.canvas===e)).pop()};function po(t,e,i){const n=Object.keys(t);for(const o of n){const n=+o;if(n>=e){const r=t[o];delete t[o],(i>0||n>e)&&(t[n+i]=r)}}}function uo(t,e,i){return t.options.clip?t[i]:e[i]}class mo{static defaults=re;static instances=ho;static overrides=te;static registry=jn;static version="4.4.1";static getChart=co;static register(...t){jn.add(...t),fo()}static unregister(...t){jn.remove(...t),fo()}constructor(t,e){const i=this.config=new to(e),n=lo(t),o=co(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Je()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?cn:Mn}(n)),this.platform.updateConfig(i);const s=this.platform.acquireContext(n,r.aspectRatio),a=s&&s.canvas,l=a&&a.height,h=a&&a.width;this.id=z(),this.ctx=s,this.canvas=a,this.width=h,this.height=l,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Nn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}((t=>this.update(t)),r.resizeDelay||0),this._dataChanges=[],ho[this.id]=this,s&&a?(wi.listen(this,"complete",so),wi.listen(this,"progress",ao),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return F(t)?e&&o?o:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return jn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ai(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return le(this.canvas,this.ctx),this}stop(){return wi.stop(this),this}resize(t,e){wi.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),s=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,ai(this,s,!0)&&(this.notifyPlugins("resize",{size:r}),V(i.onResize,[this,r],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){W(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let o=[];e&&(o=o.concat(Object.keys(e).map((t=>{const i=e[t],n=Vn(t,i),o="r"===n,r="x"===n;return{options:i,dposition:o?"chartArea":r?"bottom":"left",dtype:o?"radialLinear":r?"category":"linear"}})))),W(o,(e=>{const o=e.options,r=o.id,s=Vn(r,o),a=H(o.type,e.dtype);void 0!==o.position&&oo(o.position,s)===oo(e.dposition)||(o.position=e.dposition),n[r]=!0;let l=null;if(r in i&&i[r].type===a)l=i[r];else{l=new(jn.getScale(a))({id:r,type:a,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(o,t)})),W(n,((t,e)=>{t||delete i[e]})),W(i,(t=>{ln.configure(this,t,t.options),ln.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(ro("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const n=e[i];let o=this.getDatasetMeta(i);const r=n.type||this.config.type;if(o.type&&o.type!==r&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=r,o.indexAxis=n.indexAxis||Hn(r,this.options),o.order=n.order||0,o.index=i,o.label=""+n.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const e=jn.getController(r),{datasetElementType:n,dataElementType:s}=re.datasets[r];Object.assign(e,{dataElementType:jn.getElement(s),datasetElementType:n&&jn.getElement(n)}),o.controller=new e(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){W(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!n&&-1===o.indexOf(e);e.buildOrUpdateElements(i),r=Math.max(+e.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),n||W(o,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ro("z","_idx"));const{_active:s,_lastEvent:a}=this;a?this._eventHandler(a,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){W(this.scales,(t=>{ln.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);rt(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:o}of e){po(t,n,"_removeElements"===i?-o:o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),n=i(0);for(let t=1;t<e;t++)if(!rt(n,i(t)))return;return Array.from(n).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;ln.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],W(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,ot(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(wi.has(this)?this.attached&&!wi.running(this)&&wi.start(this):(this.draw(),so({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];t&&!o.visible||i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,o=function(t,e){const{xScale:i,yScale:n}=t;return i&&n?{left:uo(i,e,"left"),right:uo(i,e,"right"),top:uo(n,e,"top"),bottom:uo(n,e,"bottom")}:e}(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(n&&ue(e,{left:!1===i.left?0:o.left-i.left,right:!1===i.right?this.width:o.right+i.right,top:!1===i.top?0:o.top-i.top,bottom:!1===i.bottom?this.height:o.bottom+i.bottom}),t.controller.draw(),n&&de(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return pe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const o=$i.modes[e];return"function"==typeof o?o(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter((t=>t&&t._dataset===e)).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=Ae(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);nt(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update((e=>e.datasetIndex===t?n:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),wi.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),le(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete ho[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};W(this.options.events,(t=>i(t,n)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},o=(t,e)=>{this.canvas&&this.resize(t,e)};let r;const s=()=>{n("attach",s),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),i("attach",s)},e.isAttached(this.canvas)?s():r()}unbindEvents(){W(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},W(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let o,r,s,a;for("dataset"===e&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),s=0,a=t.length;s<a;++s){r=t[s];const e=r&&this.getDatasetMeta(r.datasetIndex).controller;e&&e[n+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!q(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const n=this.options.hover,o=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),r=o(e,t),s=i?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),s.length&&n.mode&&this.updateHoverStyle(s,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:o}=this,r=e,s=this._getActiveElements(t,n,i,r),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,V(o.onHover,[t,s,this],this),a&&V(o.onClick,[t,s,this],this));const h=!q(s,n);return(h||e)&&(this._active=s,this._updateHoverStyles(s,n,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}function fo(){return W(mo.instances,(t=>t._plugins.invalidate()))}function go(t,e,i=e){t.lineCap=H(i.borderCapStyle,e.borderCapStyle),t.setLineDash(H(i.borderDash,e.borderDash)),t.lineDashOffset=H(i.borderDashOffset,e.borderDashOffset),t.lineJoin=H(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=H(i.borderWidth,e.borderWidth),t.strokeStyle=H(i.borderColor,e.borderColor)}function _o(t,e,i){t.lineTo(i.x,i.y)}function vo(t,e,i={}){const n=t.length,{start:o=0,end:r=n-1}=i,{start:s,end:a}=e,l=Math.max(o,s),h=Math.min(r,a),c=o<s&&r<s||o>a&&r>a;return{count:n,start:l,loop:e.loop,ilen:h<l&&!c?n+h-l:h-l}}function yo(t,e,i,n){const{points:o,options:r}=e,{count:s,start:a,loop:l,ilen:h}=vo(o,i,n),c=function(t){return t.stepped?me:t.tension||"monotone"===t.cubicInterpolationMode?fe:_o}(r);let p,u,d,{move:m=!0,reverse:f}=n||{};for(p=0;p<=h;++p)u=o[(a+(f?h-p:p))%s],u.skip||(m?(t.moveTo(u.x,u.y),m=!1):c(t,d,u,f,r.stepped),d=u);return l&&(u=o[(a+(f?h:0))%s],c(t,d,u,f,r.stepped)),!!l}function bo(t,e,i,n){const o=e.points,{count:r,start:s,ilen:a}=vo(o,i,n),{move:l=!0,reverse:h}=n||{};let c,p,u,d,m,f,g=0,_=0;const v=t=>(s+(h?a-t:t))%r,y=()=>{d!==m&&(t.lineTo(g,m),t.lineTo(g,d),t.lineTo(g,f))};for(l&&(p=o[v(0)],t.moveTo(p.x,p.y)),c=0;c<=a;++c){if(p=o[v(c)],p.skip)continue;const e=p.x,i=p.y,n=0|e;n===u?(i<d?d=i:i>m&&(m=i),g=(_*g+e)/++_):(y(),t.lineTo(e,i),u=n,_=0,d=m=i),f=i}y()}function xo(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?bo:yo}const ko="function"==typeof Path2D;function Lo(t,e,i,n){ko&&!e.options.segment?function(t,e,i,n){let o=e._path;o||(o=e._path=new Path2D,e.path(o,i,n)&&o.closePath()),go(t,e.options),t.stroke(o)}(t,e,i,n):function(t,e,i,n){const{segments:o,options:r}=e,s=xo(e);for(const a of o)go(t,r,a.style),t.beginPath(),s(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}class wo extends Cn{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;Ye(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,o=i.length;if(!o)return[];const r=!!t._loop,{start:s,end:a}=function(t,e,i,n){let o=0,r=e-1;if(i&&!n)for(;o<e&&!t[o].skip;)o++;for(;o<e&&t[o].skip;)o++;for(o%=e,i&&(r+=o);r>o&&t[r%e].skip;)r--;return r%=e,{start:o,end:r}}(i,o,r,n);return bi(t,!0===n?[{start:s,end:a,loop:r}]:function(t,e,i,n){const o=t.length,r=[];let s,a=e,l=t[e];for(s=e+1;s<=i;++s){const i=t[s%o];i.skip||i.stop?l.skip||(n=!1,r.push({start:e%o,end:(s-1)%o,loop:n}),e=a=i.stop?s:null):(a=s,l.skip&&(e=s)),l=i}return null!==a&&r.push({start:e%o,end:a%o,loop:n}),r}(i,s,a<s?a+o:a,!!t._fullLoop&&0===s&&a===o-1),i,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],o=this.points,r=yi(this,{property:e,start:n,end:n});if(!r.length)return;const s=[],a=function(t){return t.stepped?pi:t.tension||"monotone"===t.cubicInterpolationMode?ui:ci}(i);let l,h;for(l=0,h=r.length;l<h;++l){const{start:h,end:c}=r[l],p=o[h],u=o[c];if(p===u){s.push(p);continue}const d=a(p,u,Math.abs((n-p[e])/(u[e]-p[e])),i.stepped);d[e]=t[e],s.push(d)}return 1===s.length?s[0]:s}pathSegment(t,e,i){return xo(this)(t,this,e,i)}path(t,e,i){const n=this.segments,o=xo(this);let r=this._loop;e=e||0,i=i||this.points.length-e;for(const s of n)r&=o(t,this,s,{start:e,end:e+i-1});return!!r}draw(t,e,i,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Lo(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Mo(t,e,i,n){const o=t.options,{[i]:r}=t.getProps([i],n);return Math.abs(e-r)<o.radius+o.hitRadius}class Co extends Cn{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:o,y:r}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return Mo(this,t,"x",e)}inYRange(t,e){return Mo(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!pe(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,he(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Po(t,e,i,n){if(n)return;let o=e[t],r=i[t];return"angle"===t&&(o=Ct(o),r=Ct(r)),{property:t,start:o,end:r}}function So(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function To(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ao(t,e){let i=[],n=!1;return j(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:n=null}=t||{},o=e.points,r=[];return e.segments.forEach((({start:t,end:e})=>{e=So(t,e,o);const s=o[t],a=o[e];null!==n?(r.push({x:s.x,y:n}),r.push({x:a.x,y:n})):null!==i&&(r.push({x:i,y:s.y}),r.push({x:i,y:a.y}))})),r}(t,e),i.length?new wo({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Do(t){return t&&!1!==t.fill}function Eo(t,e,i){let n=t[e].fill;const o=[e];let r;if(!i)return n;for(;!1!==n&&-1===o.indexOf(n);){if(!U(n))return n;if(r=t[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function Oo(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=H(i&&i.target,i);void 0===n&&(n=!!e.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(t);if(N(n))return!isNaN(n.value)&&n;let o=parseFloat(n);return U(o)&&Math.floor(o)===o?function(t,e,i,n){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=n)return!1;return i}(n[0],e,o,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Io(t,e,i){const n=[];for(let o=0;o<i.length;o++){const r=i[o],{first:s,last:a,point:l}=Bo(r,e,"x");if(!(!l||s&&a))if(s)n.unshift(l);else if(t.push(l),!a)break}t.push(...n)}function Bo(t,e,i){const n=t.interpolate(e,i);if(!n)return{};const o=n[i],r=t.segments,s=t.points;let a=!1,l=!1;for(let t=0;t<r.length;t++){const e=r[t],n=s[e.start][i],h=s[e.end][i];if(Tt(o,n,h)){a=o===n,l=o===h;break}}return{first:a,last:l,point:n}}class Ro{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:o,radius:r}=this;return e=e||{start:0,end:at},t.arc(n,o,r,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,o=t.angle;return{x:e+Math.cos(o)*n,y:i+Math.sin(o)*n,angle:o}}}function zo(t){const{chart:e,fill:i,line:n}=t;if(U(i))return function(t,e){const i=t.getDatasetMeta(e),n=i&&t.isDatasetVisible(e);return n?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:n}=t,o=[],r=n.segments,s=n.points,a=function(t,e){const i=[],n=t.getMatchingVisibleMetas("line");for(let t=0;t<n.length;t++){const o=n[t];if(o.index===e)break;o.hidden||i.unshift(o.dataset)}return i}(e,i);a.push(Ao({x:null,y:e.bottom},n));for(let t=0;t<r.length;t++){const e=r[t];for(let t=e.start;t<=e.end;t++)Io(o,s[t],a)}return new wo({points:o,options:{}})}(t);if("shape"===i)return!0;const o=function(t){const e=t.scale||{};if(e.getPointPositionForValue)return function(t){const{scale:e,fill:i}=t,n=e.options,o=e.getLabels().length,r=n.reverse?e.max:e.min,s=function(t,e,i){let n;return n="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:N(t)?t.value:e.getBaseValue(),n}(i,e,r),a=[];if(n.grid.circular){const t=e.getPointPositionForValue(0,r);return new Ro({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(s)})}for(let t=0;t<o;++t)a.push(e.getPointPositionForValue(t,s));return a}(t);return function(t){const{scale:e={},fill:i}=t,n=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:N(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(U(n)){const t=e.isHorizontal();return{x:t?n:null,y:t?null:n}}return null}(t)}(t);return o instanceof Ro?o:Ao(o,n)}function Fo(t,e,i){const n=zo(e),{line:o,scale:r,axis:s}=e,a=o.options,l=a.fill,h=a.backgroundColor,{above:c=h,below:p=h}=l||{};n&&o.points.length&&(ue(t,i),function(t,e){const{line:i,target:n,above:o,below:r,area:s,scale:a}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&r!==o&&(jo(t,n,s.top),No(t,{line:i,target:n,color:o,scale:a,property:l}),t.restore(),t.save(),jo(t,n,s.bottom));No(t,{line:i,target:n,color:r,scale:a,property:l}),t.restore()}(t,{line:o,target:n,above:c,below:p,area:i,scale:r,axis:s}),de(t))}function jo(t,e,i){const{segments:n,points:o}=e;let r=!0,s=!1;t.beginPath();for(const a of n){const{start:n,end:l}=a,h=o[n],c=o[So(n,l,o)];r?(t.moveTo(h.x,h.y),r=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),s=!!e.pathSegment(t,a,{move:s}),s?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function No(t,e){const{line:i,target:n,property:o,color:r,scale:s}=e,a=function(t,e,i){const n=t.segments,o=t.points,r=e.points,s=[];for(const t of n){let{start:n,end:a}=t;a=So(n,a,o);const l=Po(i,o[n],o[a],t.loop);if(!e.segments){s.push({source:t,target:l,start:o[n],end:o[a]});continue}const h=yi(e,l);for(const e of h){const n=Po(i,r[e.start],r[e.end],e.loop),a=vi(t,o,n);for(const t of a)s.push({source:t,target:e,start:{[i]:To(l,n,"start",Math.max)},end:{[i]:To(l,n,"end",Math.min)}})}}return s}(i,n,o);for(const{source:e,target:l,start:h,end:c}of a){const{style:{backgroundColor:a=r}={}}=e,p=!0!==n;t.save(),t.fillStyle=a,Uo(t,s,p&&Po(o,h,c)),t.beginPath();const u=!!i.pathSegment(t,e);let d;if(p){u?t.closePath():Go(t,n,c,o);const e=!!n.pathSegment(t,l,{move:u,reverse:!0});d=u&&e,d||Go(t,n,h,o)}t.closePath(),t.fill(d?"evenodd":"nonzero"),t.restore()}}function Uo(t,e,i){const{top:n,bottom:o}=e.chart.chartArea,{property:r,start:s,end:a}=i||{};"x"===r&&(t.beginPath(),t.rect(s,n,a-s,o-n),t.clip())}function Go(t,e,i,n){const o=e.interpolate(i,n);o&&t.lineTo(o.x,o.y)}var Ho={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,o=[];let r,s,a,l;for(s=0;s<n;++s)r=t.getDatasetMeta(s),a=r.dataset,l=null,a&&a.options&&a instanceof wo&&(l={visible:t.isDatasetVisible(s),index:s,fill:Oo(a,s,n),chart:t,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,o.push(l);for(s=0;s<n;++s)l=o[s],l&&!1!==l.fill&&(l.fill=Eo(o,s,i.propagate))},beforeDraw(t,e,i){const n="beforeDraw"===i.drawTime,o=t.getSortedVisibleDatasetMetas(),r=t.chartArea;for(let e=o.length-1;e>=0;--e){const i=o[e].$filler;i&&(i.line.updateControlPoints(r,i.axis),n&&i.fill&&Fo(t.ctx,i,r))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;Do(i)&&Fo(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;Do(n)&&"beforeDatasetDraw"===i.drawTime&&Fo(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};new WeakMap;const Zo={average(t){if(!t.length)return!1;let e,i,n=0,o=0,r=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();n+=t.x,o+=t.y,++r}}return{x:n/r,y:o/r}},nearest(t,e){if(!t.length)return!1;let i,n,o,r=e.x,s=e.y,a=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){const n=t[i].element;if(n&&n.hasValue()){const t=wt(e,n.getCenterPoint());t<a&&(a=t,o=n)}}if(o){const t=o.tooltipPosition();r=t.x,s=t.y}return{x:r,y:s}}};function Vo(t,e){return e&&(j(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Wo(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function qo(t,e){const{element:i,datasetIndex:n,index:o}=e,r=t.getDatasetMeta(n).controller,{label:s,value:a}=r.getLabelAndValue(o);return{chart:t,label:s,parsed:r.getParsed(o),raw:t.data.datasets[n].data[o],formattedValue:a,dataset:r.getDataset(),dataIndex:o,datasetIndex:n,element:i}}function $o(t,e){const i=t.chart.ctx,{body:n,footer:o,title:r}=t,{boxWidth:s,boxHeight:a}=e,l=Se(e.bodyFont),h=Se(e.titleFont),c=Se(e.footerFont),p=r.length,u=o.length,d=n.length,m=Pe(e.padding);let f=m.height,g=0,_=n.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(_+=t.beforeBody.length+t.afterBody.length,p&&(f+=p*h.lineHeight+(p-1)*e.titleSpacing+e.titleMarginBottom),_){f+=d*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(_-d)*l.lineHeight+(_-1)*e.bodySpacing}u&&(f+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let v=0;const y=function(t){g=Math.max(g,i.measureText(t).width+v)};return i.save(),i.font=h.string,W(t.title,y),i.font=l.string,W(t.beforeBody.concat(t.afterBody),y),v=e.displayColors?s+2+e.boxPadding:0,W(n,(t=>{W(t.before,y),W(t.lines,y),W(t.after,y)})),v=0,i.font=c.string,W(t.footer,y),i.restore(),g+=m.width,{width:g,height:f}}function Ko(t,e,i,n){const{x:o,width:r}=i,{width:s,chartArea:{left:a,right:l}}=t;let h="center";return"center"===n?h=o<=(a+l)/2?"left":"right":o<=r/2?h="left":o>=s-r/2&&(h="right"),function(t,e,i,n){const{x:o,width:r}=n,s=i.caretSize+i.caretPadding;return"left"===t&&o+r+s>e.width||"right"===t&&o-r-s<0||void 0}(h,t,e,i)&&(h="center"),h}function Yo(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Ko(t,e,i,n),yAlign:n}}function Jo(t,e,i,n){const{caretSize:o,caretPadding:r,cornerRadius:s}=t,{xAlign:a,yAlign:l}=i,h=o+r,{topLeft:c,topRight:p,bottomLeft:u,bottomRight:d}=Ce(s);let m=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const f=function(t,e,i){let{y:n,height:o}=t;return"top"===e?n+=i:n-="bottom"===e?o+i:o/2,n}(e,l,h);return"center"===l?"left"===a?m+=h:"right"===a&&(m-=h):"left"===a?m-=Math.max(c,u)+o:"right"===a&&(m+=Math.max(p,d)+o),{x:St(m,0,n.width-e.width),y:St(f,0,n.height-e.height)}}function Xo(t,e,i){const n=Pe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Qo(t){return Vo([],Wo(t))}function tr(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const er={beforeTitle:R,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return i[e.dataIndex]}return""},afterTitle:R,beforeBody:R,beforeLabel:R,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return F(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:R,afterBody:R,beforeFooter:R,footer:R,afterFooter:R};function ir(t,e,i,n){const o=t[e].call(i,n);return void 0===o?er[e].call(i,n):o}class nr extends Cn{static positioners=Zo;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,o=new Si(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,Ae(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,n=ir(i,"beforeTitle",this,t),o=ir(i,"title",this,t),r=ir(i,"afterTitle",this,t);let s=[];return s=Vo(s,Wo(n)),s=Vo(s,Wo(o)),s=Vo(s,Wo(r)),s}getBeforeBody(t,e){return Qo(ir(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return W(t,(t=>{const e={before:[],lines:[],after:[]},o=tr(i,t);Vo(e.before,Wo(ir(o,"beforeLabel",this,t))),Vo(e.lines,ir(o,"label",this,t)),Vo(e.after,Wo(ir(o,"afterLabel",this,t))),n.push(e)})),n}getAfterBody(t,e){return Qo(ir(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=ir(i,"beforeFooter",this,t),o=ir(i,"footer",this,t),r=ir(i,"afterFooter",this,t);let s=[];return s=Vo(s,Wo(n)),s=Vo(s,Wo(o)),s=Vo(s,Wo(r)),s}_createItems(t){const e=this._active,i=this.chart.data,n=[],o=[],r=[];let s,a,l=[];for(s=0,a=e.length;s<a;++s)l.push(qo(this.chart,e[s]));return t.filter&&(l=l.filter(((e,n,o)=>t.filter(e,n,o,i)))),t.itemSort&&(l=l.sort(((e,n)=>t.itemSort(e,n,i)))),W(l,(e=>{const i=tr(t.callbacks,e);n.push(ir(i,"labelColor",this,e)),o.push(ir(i,"labelPointStyle",this,e)),r.push(ir(i,"labelTextColor",this,e))})),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(n.length){const t=Zo[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const e=this._size=$o(this,i),s=Object.assign({},t,e),a=Yo(this.chart,i,s),l=Jo(i,s,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,o={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(o={opacity:0});this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const o=this.getCaretPosition(t,i,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:s}=i,{topLeft:a,topRight:l,bottomLeft:h,bottomRight:c}=Ce(s),{x:p,y:u}=t,{width:d,height:m}=e;let f,g,_,v,y,b;return"center"===o?(y=u+m/2,"left"===n?(f=p,g=f-r,v=y+r,b=y-r):(f=p+d,g=f+r,v=y-r,b=y+r),_=f):(g="left"===n?p+Math.max(a,h)+r:"right"===n?p+d-Math.max(l,c)-r:this.caretX,"top"===o?(v=u,y=v-r,f=g-r,_=g+r):(v=u+m,y=v+r,f=g+r,_=g-r),b=v),{x1:f,x2:g,x3:_,y1:v,y2:y,y3:b}}drawTitle(t,e,i){const n=this.title,o=n.length;let r,s,a;if(o){const l=di(i.rtl,this.x,this.width);for(t.x=Xo(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=Se(i.titleFont),s=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,a=0;a<o;++a)e.fillText(n[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s,a+1===o&&(t.y+=i.titleMarginBottom-s)}}_drawColorBox(t,e,i,n,o){const r=this.labelColors[i],s=this.labelPointStyles[i],{boxHeight:a,boxWidth:l}=o,h=Se(o.bodyFont),c=Xo(this,"left",o),p=n.x(c),u=a<h.lineHeight?(h.lineHeight-a)/2:0,d=e.y+u;if(o.usePointStyle){const e={radius:Math.min(l,a)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},i=n.leftForLtr(p,l)+l/2,h=d+a/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,he(t,e,i,h),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,he(t,e,i,h)}else{t.lineWidth=N(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const e=n.leftForLtr(p,l),i=n.leftForLtr(n.xPlus(p,1),l-2),s=Ce(r.borderRadius);Object.values(s).some((t=>0!==t))?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ye(t,{x:e,y:d,w:l,h:a,radius:s}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ye(t,{x:i,y:d+1,w:l-2,h:a-2,radius:s}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,d,l,a),t.strokeRect(e,d,l,a),t.fillStyle=r.backgroundColor,t.fillRect(i,d+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:s,boxHeight:a,boxWidth:l,boxPadding:h}=i,c=Se(i.bodyFont);let p=c.lineHeight,u=0;const d=di(i.rtl,this.x,this.width),m=function(i){e.fillText(i,d.x(t.x+u),t.y+p/2),t.y+=p+o},f=d.textAlign(r);let g,_,v,y,b,x,k;for(e.textAlign=r,e.textBaseline="middle",e.font=c.string,t.x=Xo(this,f,i),e.fillStyle=i.bodyColor,W(this.beforeBody,m),u=s&&"right"!==f?"center"===r?l/2+h:l+2+h:0,y=0,x=n.length;y<x;++y){for(g=n[y],_=this.labelTextColors[y],e.fillStyle=_,W(g.before,m),v=g.lines,s&&v.length&&(this._drawColorBox(e,t,y,d,i),p=Math.max(c.lineHeight,a)),b=0,k=v.length;b<k;++b)m(v[b]),p=c.lineHeight;W(g.after,m)}u=0,p=c.lineHeight,W(this.afterBody,m),t.y-=o}drawFooter(t,e,i){const n=this.footer,o=n.length;let r,s;if(o){const a=di(i.rtl,this.x,this.width);for(t.x=Xo(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=a.textAlign(i.footerAlign),e.textBaseline="middle",r=Se(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,s=0;s<o;++s)e.fillText(n[s],a.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:o,yAlign:r}=this,{x:s,y:a}=t,{width:l,height:h}=i,{topLeft:c,topRight:p,bottomLeft:u,bottomRight:d}=Ce(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(s+c,a),"top"===r&&this.drawCaret(t,e,i,n),e.lineTo(s+l-p,a),e.quadraticCurveTo(s+l,a,s+l,a+p),"center"===r&&"right"===o&&this.drawCaret(t,e,i,n),e.lineTo(s+l,a+h-d),e.quadraticCurveTo(s+l,a+h,s+l-d,a+h),"bottom"===r&&this.drawCaret(t,e,i,n),e.lineTo(s+u,a+h),e.quadraticCurveTo(s,a+h,s,a+h-u),"center"===r&&"left"===o&&this.drawCaret(t,e,i,n),e.lineTo(s,a+c),e.quadraticCurveTo(s,a,s+c,a),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,o=i&&i.y;if(n||o){const i=Zo[t.position].call(this,this._active,this._eventPosition);if(!i)return;const r=this._size=$o(this,t),s=Object.assign({},i,this._size),a=Yo(e,t,s),l=Jo(t,s,a,e);n._to===l.x&&o._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=r.width,this.height=r.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=Pe(e.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&s&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,n,e),mi(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),fi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),o=!q(i,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),s=this._positionChanged(r,t),a=e||!q(r,o)||s;return a&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const o=this.options;if("mouseout"===t.type)return[];if(!n)return e.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:n,options:o}=this,r=Zo[o.position].call(this,t,e);return!1!==r&&(i!==r.x||n!==r.y)}}var or={id:"tooltip",_element:nr,positioners:Zo,afterInit(t,e,i){i&&(t.tooltip=new nr({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:er},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function rr(t,e){const i=[],{bounds:n,step:o,min:r,max:s,precision:a,count:l,maxTicks:h,maxDigits:c,includeBounds:p}=t,u=o||1,d=h-1,{min:m,max:f}=e,g=!F(r),_=!F(s),v=!F(l),y=(f-m)/(c+1);let b,x,k,L,w=_t((f-m)/d/u)*u;if(w<1e-14&&!g&&!_)return[{value:m},{value:f}];L=Math.ceil(f/w)-Math.floor(m/w),L>d&&(w=_t(L*w/d/u)*u),F(a)||(b=Math.pow(10,a),w=Math.ceil(w*b)/b),"ticks"===n?(x=Math.floor(m/w)*w,k=Math.ceil(f/w)*w):(x=m,k=f),g&&_&&o&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((s-r)/o,w/1e3)?(L=Math.round(Math.min((s-r)/w,h)),w=(s-r)/L,x=r,k=s):v?(x=g?r:x,k=_?s:k,L=l-1,w=(k-x)/L):(L=(k-x)/w,L=gt(L,Math.round(L),w/1e3)?Math.round(L):Math.ceil(L));const M=Math.max(kt(w),kt(x));b=Math.pow(10,F(a)?M:a),x=Math.round(x*b)/b,k=Math.round(k*b)/b;let C=0;for(g&&(p&&x!==r?(i.push({value:r}),x<r&&C++,gt(Math.round((x+C*w)*b)/b,r,sr(r,y,t))&&C++):x<r&&C++);C<L;++C){const t=Math.round((x+C*w)*b)/b;if(_&&t>s)break;i.push({value:t})}return _&&p&&k!==s?i.length&>(i[i.length-1].value,s,sr(s,y,t))?i[i.length-1].value=s:i.push({value:s}):_&&k!==s||i.push({value:k}),i}function sr(t,e,{horizontal:i,minRotation:n}){const o=bt(n),r=(i?Math.sin(o):Math.cos(o))||.001,s=.75*e*(""+t).length;return Math.min(e/r,s)}class ar extends Rn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return F(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const r=t=>n=e?n:t,s=t=>o=i?o:t;if(t){const t=ft(n),e=ft(o);t<0&&e<0?s(0):t>0&&e>0&&r(0)}if(n===o){let e=0===o?1:Math.abs(.05*o);s(o+e),t||r(n-e)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=rr({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&yt(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Jt(t,this.chart.options.locale,this.options.ticks.format)}}class lr extends ar{static id="linear";static defaults={ticks:{callback:Qt.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=U(t)?t:0,this.max=U(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=bt(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Qt.formatters.logarithmic;Qt.formatters.numeric;var hr=i(481),cr=i.n(hr),pr=window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest,ur=""===document.documentElement.style.pointerEvents,dr={cors:pr,pointerEvents:ur},mr={attributionWidthOffset:55},fr=0;function gr(t){var e="";for(var i in t.f=t.f||"json",t)if(Object.prototype.hasOwnProperty.call(t,i)){var n,o=t[i],r=Object.prototype.toString.call(o);e.length&&(e+="&"),n="[object Array]"===r?"[object Object]"===Object.prototype.toString.call(o[0])?JSON.stringify(o):o.join(","):"[object Object]"===r?JSON.stringify(o):"[object Date]"===r?o.valueOf():o,e+=encodeURIComponent(i)+"="+encodeURIComponent(n)}return e.replaceAll("'","%27")}function _r(t,e){var i=new window.XMLHttpRequest;return i.onerror=function(n){i.onreadystatechange=hr.Util.falseFn,t.call(e,{error:{code:500,message:"XMLHttpRequest error"}},null)},i.onreadystatechange=function(){var n,o;if(4===i.readyState){try{n=JSON.parse(i.responseText)}catch(t){n=null,o={code:500,message:"Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."}}!o&&n.error&&(o=n.error,n=null),i.onerror=hr.Util.falseFn,t.call(e,o,n)}},i.ontimeout=function(){this.onerror()},i}function vr(t,e,i,n){var o=_r(i,n);return o.open("GET",t+"?"+gr(e),!0),null!=n&&void 0!==n.options&&(o.timeout=n.options.timeout,n.options.withCredentials&&(o.withCredentials=!0)),o.send(null),o}function yr(t,e,i,n){var o=gr(e),r=_r(i,n),s=(t+"?"+o).length;if(s<=2e3&&dr.cors?r.open("GET",t+"?"+o):s>2e3&&dr.cors&&(r.open("POST",t),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8")),null!=n&&void 0!==n.options&&(r.timeout=n.options.timeout,n.options.withCredentials&&(r.withCredentials=!0)),s<=2e3&&dr.cors)r.send(null);else{if(!(s>2e3&&dr.cors))return s<=2e3&&!dr.cors?br(t,e,i,n):void kr("a request to "+t+" was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy https://developers.arcgis.com/esri-leaflet/api-reference/request/");r.send(o)}return r}function br(t,e,i,n){window._EsriLeafletCallbacks=window._EsriLeafletCallbacks||{};var o="c"+fr;e.callback="window._EsriLeafletCallbacks."+o,window._EsriLeafletCallbacks[o]=function(t){if(!0!==window._EsriLeafletCallbacks[o]){var e,r=Object.prototype.toString.call(t);"[object Object]"!==r&&"[object Array]"!==r&&(e={error:{code:500,message:"Expected array or object as JSONP response"}},t=null),!e&&t.error&&(e=t,t=null),i.call(n,e,t),window._EsriLeafletCallbacks[o]=!0}};var r=hr.DomUtil.create("script",null,document.body);return r.type="text/javascript",r.src=t+"?"+gr(e),r.id=o,r.onerror=function(t){if(t&&!0!==window._EsriLeafletCallbacks[o]){i.call(n,{error:{code:500,message:"An unknown error occurred"}}),window._EsriLeafletCallbacks[o]=!0}},hr.DomUtil.addClass(r,"esri-leaflet-jsonp"),fr++,{id:o,url:r.src,abort:function(){window._EsriLeafletCallbacks._callback[o]({code:0,message:"Request aborted."})}}}var xr=dr.cors?vr:br;function kr(){console&&console.warn&&console.warn.apply(console,arguments)}xr.CORS=vr,xr.JSONP=br;var Lr={request:yr,get:xr,post:function(t,e,i,n){var o=_r(i,n);return o.open("POST",t),null!=n&&void 0!==n.options&&(o.timeout=n.options.timeout),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),o.send(gr(e)),o}},wr=Lr,Mr=function(t,e,i,n){var o=(n[0]-i[0])*(t[1]-i[1])-(n[1]-i[1])*(t[0]-i[0]),r=(e[0]-t[0])*(t[1]-i[1])-(e[1]-t[1])*(t[0]-i[0]),s=(n[1]-i[1])*(e[0]-t[0])-(n[0]-i[0])*(e[1]-t[1]);if(0!==s){var a=o/s,l=r/s;if(a>=0&&a<=1&&l>=0&&l<=1)return!0}return!1},Cr=function(t,e){for(var i=0;i<t.length-1;i++)for(var n=0;n<e.length-1;n++)if(Mr(t[i],t[i+1],e[n],e[n+1]))return!0;return!1},Pr=function(t){return function(t,e){for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}(t[0],t[t.length-1])||t.push(t[0]),t},Sr=function(t){for(var e,i=0,n=0,o=t.length,r=t[n];n<o-1;n++)i+=((e=t[n+1])[0]-r[0])*(e[1]+r[1]),r=e;return i>=0},Tr=function(t){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},Ar=function(t,e){var i=Cr(t,e),n=function(t,e){for(var i=!1,n=-1,o=t.length,r=o-1;++n<o;r=n)(t[n][1]<=e[1]&&e[1]<t[r][1]||t[r][1]<=e[1]&&e[1]<t[n][1])&&e[0]<(t[r][0]-t[n][0])*(e[1]-t[n][1])/(t[r][1]-t[n][1])+t[n][0]&&(i=!i);return i}(t,e[0]);return!(i||!n)},Dr=function t(e,i){var n={};if(e.features){n.type="FeatureCollection",n.features=[];for(var o=0;o<e.features.length;o++)n.features.push(t(e.features[o],i))}if("number"==typeof e.x&&"number"==typeof e.y&&(n.type="Point",n.coordinates=[e.x,e.y],"number"==typeof e.z&&n.coordinates.push(e.z)),e.points&&(n.type="MultiPoint",n.coordinates=e.points.slice(0)),e.paths&&(1===e.paths.length?(n.type="LineString",n.coordinates=e.paths[0].slice(0)):(n.type="MultiLineString",n.coordinates=e.paths.slice(0))),e.rings&&(n=function(t){for(var e,i,n,o=[],r=[],s=0;s<t.length;s++){var a=Pr(t[s].slice(0));if(!(a.length<4))if(Sr(a)){var l=[a.slice().reverse()];o.push(l)}else r.push(a.slice().reverse())}for(var h=[];r.length;){n=r.pop();var c=!1;for(e=o.length-1;e>=0;e--)if(i=o[e][0],Ar(i,n)){o[e].push(n),c=!0;break}c||h.push(n)}for(;h.length;){n=h.pop();var p=!1;for(e=o.length-1;e>=0;e--)if(i=o[e][0],Cr(i,n)){o[e].push(n),p=!0;break}p||o.push([n.reverse()])}return 1===o.length?{type:"Polygon",coordinates:o[0]}:{type:"MultiPolygon",coordinates:o}}(e.rings.slice(0))),"number"==typeof e.xmin&&"number"==typeof e.ymin&&"number"==typeof e.xmax&&"number"==typeof e.ymax&&(n.type="Polygon",n.coordinates=[[[e.xmax,e.ymax],[e.xmin,e.ymax],[e.xmin,e.ymin],[e.xmax,e.ymin],[e.xmax,e.ymax]]]),(e.geometry||e.attributes)&&(n.type="Feature",n.geometry=e.geometry?t(e.geometry):null,n.properties=e.attributes?Tr(e.attributes):null,e.attributes))try{n.id=function(t,e){for(var i=e?[e,"OBJECTID","FID"]:["OBJECTID","FID"],n=0;n<i.length;n++){var o=i[n];if(o in t&&("string"==typeof t[o]||"number"==typeof t[o]))return t[o]}throw Error("No valid id attribute found")}(e.attributes,i)}catch(t){}return JSON.stringify(n.geometry)===JSON.stringify({})&&(n.geometry=null),e.spatialReference&&e.spatialReference.wkid&&4326!==e.spatialReference.wkid&&console.warn("Object converted in non-standard crs - "+JSON.stringify(e.spatialReference)),n},Er=function(t){var e=[],i=t.slice(0),n=Pr(i.shift().slice(0));if(n.length>=4){Sr(n)||n.reverse(),e.push(n);for(var o=0;o<i.length;o++){var r=Pr(i[o].slice(0));r.length>=4&&(Sr(r)&&r.reverse(),e.push(r))}}return e},Or=function t(e,i){i=i||"OBJECTID";var n,o={wkid:4326},r={};switch(e.type){case"Point":r.x=e.coordinates[0],r.y=e.coordinates[1],null!=e.coordinates[2]&&(r.z=e.coordinates[2]),r.spatialReference=o;break;case"MultiPoint":r.points=e.coordinates.slice(0),null!=e.coordinates[0][2]&&(r.hasZ=!0),r.spatialReference=o;break;case"LineString":r.paths=[e.coordinates.slice(0)],null!=e.coordinates[0][2]&&(r.hasZ=!0),r.spatialReference=o;break;case"MultiLineString":r.paths=e.coordinates.slice(0),null!=e.coordinates[0][0][2]&&(r.hasZ=!0),r.spatialReference=o;break;case"Polygon":r.rings=Er(e.coordinates.slice(0)),null!=e.coordinates[0][0][2]&&(r.hasZ=!0),r.spatialReference=o;break;case"MultiPolygon":r.rings=function(t){for(var e=[],i=0;i<t.length;i++)for(var n=Er(t[i]),o=n.length-1;o>=0;o--){var r=n[o].slice(0);e.push(r)}return e}(e.coordinates.slice(0)),null!=e.coordinates[0][0][0][2]&&(r.hasZ=!0),r.spatialReference=o;break;case"Feature":e.geometry&&(r.geometry=t(e.geometry,i)),r.attributes=e.properties?Tr(e.properties):{},e.id&&(r.attributes[i]=e.id);break;case"FeatureCollection":for(r=[],n=0;n<e.features.length;n++)r.push(t(e.features[n],i));break;case"GeometryCollection":for(r=[],n=0;n<e.geometries.length;n++)r.push(t(e.geometries[n],i))}return r},Ir='Powered by <a href="https://www.esri.com">Esri</a>';function Br(t,e){return Or(t,e)}function Rr(t,e){return Dr(t,e)}function zr(t){if("NaN"!==t.xmin&&"NaN"!==t.ymin&&"NaN"!==t.xmax&&"NaN"!==t.ymax){var e=(0,hr.latLng)(t.ymin,t.xmin),i=(0,hr.latLng)(t.ymax,t.xmax);return(0,hr.latLngBounds)(e,i)}return null}function Fr(t){return{xmin:(t=(0,hr.latLngBounds)(t)).getSouthWest().lng,ymin:t.getSouthWest().lat,xmax:t.getNorthEast().lng,ymax:t.getNorthEast().lat,spatialReference:{wkid:4326}}}var jr=/^(OBJECTID|FID|OID|ID)$/i;function Nr(t){var e;if(t.objectIdFieldName)e=t.objectIdFieldName;else if(t.fields){for(var i=0;i<=t.fields.length-1;i++)if("esriFieldTypeOID"===t.fields[i].type){e=t.fields[i].name;break}if(!e)for(i=0;i<=t.fields.length-1;i++)if(t.fields[i].name.match(jr)){e=t.fields[i].name;break}}return e}function Ur(t){for(var e in t.attributes)if(e.match(jr))return e}function Gr(t,e){var i,n=t.features||t.results,o=n&&n.length;i=e||Nr(t);var r={type:"FeatureCollection",features:[]};if(o)for(var s=n.length-1;s>=0;s--){var a=Rr(n[s],i||Ur(n[s]));r.features.push(a)}return r}function Hr(t){return"/"!==(t=hr.Util.trim(t))[t.length-1]&&(t+="/"),t}function Zr(t){if(-1!==t.url.indexOf("?")){t.requestParams=t.requestParams||{};var e=t.url.substring(t.url.indexOf("?")+1);t.url=t.url.split("?")[0],t.requestParams=JSON.parse('{"'+decodeURI(e).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')}return t.url=Hr(t.url.split("?")[0]),t}function Vr(t){return/^(?!.*utility\.arcgis\.com).*\.arcgis\.com.*FeatureServer/i.test(t)}function Wr(t){var e;switch(t){case"Point":e="esriGeometryPoint";break;case"MultiPoint":e="esriGeometryMultipoint";break;case"LineString":case"MultiLineString":e="esriGeometryPolyline";break;case"Polygon":case"MultiPolygon":e="esriGeometryPolygon"}return e}function qr(t){return t.getSize().x-mr.attributionWidthOffset+"px"}function $r(t){if(t.attributionControl){if(t.attributionControl._esriAttributionLayerCount||(t.attributionControl._esriAttributionLayerCount=0),0===t.attributionControl._esriAttributionLayerCount){if(!t.attributionControl._esriAttributionAddedOnce){var e=document.createElement("style");e.type="text/css",e.innerHTML=".esri-truncated-attribution:hover {white-space: normal;}",document.getElementsByTagName("head")[0].appendChild(e);var i=document.createElement("style");i.type="text/css",i.innerHTML=".esri-truncated-attribution {vertical-align: -3px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: inline-block;transition: 0s white-space;transition-delay: 1s;max-width: "+qr(t)+";}",document.getElementsByTagName("head")[0].appendChild(i),t.on("resize",(function(e){t.attributionControl&&(t.attributionControl._container.style.maxWidth=qr(e.target))})),t.attributionControl._esriAttributionAddedOnce=!0}hr.DomUtil.addClass(t.attributionControl._container,"esri-truncated-attribution:hover"),hr.DomUtil.addClass(t.attributionControl._container,"esri-truncated-attribution")}t.attributionControl._esriAttributionLayerCount=t.attributionControl._esriAttributionLayerCount+1}}function Kr(t){t.attributionControl&&(t.attributionControl._esriAttributionLayerCount&&1===t.attributionControl._esriAttributionLayerCount&&(hr.DomUtil.removeClass(t.attributionControl._container,"esri-truncated-attribution:hover"),hr.DomUtil.removeClass(t.attributionControl._container,"esri-truncated-attribution")),t.attributionControl._esriAttributionLayerCount=t.attributionControl._esriAttributionLayerCount-1)}function Yr(t){var e={geometry:null,geometryType:null};return t instanceof hr.LatLngBounds?(e.geometry=Fr(t),e.geometryType="esriGeometryEnvelope",e):(t.getLatLng&&(t=t.getLatLng()),t instanceof hr.LatLng&&(t={type:"Point",coordinates:[t.lng,t.lat]}),t instanceof hr.GeoJSON&&(t=t.getLayers()[0].feature.geometry,e.geometry=Br(t),e.geometryType=Wr(t.type)),t.toGeoJSON&&(t=t.toGeoJSON()),"Feature"===t.type&&(t=t.geometry),"Point"===t.type||"LineString"===t.type||"Polygon"===t.type||"MultiPolygon"===t.type?(e.geometry=Br(t),e.geometryType=Wr(t.type),e):void kr("invalid geometry passed to spatial query. Should be L.LatLng, L.LatLngBounds, L.Marker or a GeoJSON Point, Line, Polygon or MultiPolygon object"))}function Jr(t,e){dr.cors&&yr(t,{},hr.Util.bind((function(t,i){if(!t){e._esriAttributions=[];for(var n=0;n<i.contributors.length;n++)for(var o=i.contributors[n],r=0;r<o.coverageAreas.length;r++){var s=o.coverageAreas[r],a=(0,hr.latLng)(s.bbox[0],s.bbox[1]),l=(0,hr.latLng)(s.bbox[2],s.bbox[3]);e._esriAttributions.push({attribution:o.attribution,score:s.score,bounds:(0,hr.latLngBounds)(a,l),minZoom:s.zoomMin,maxZoom:s.zoomMax})}e._esriAttributions.sort((function(t,e){return e.score-t.score})),Xr({target:e})}}),this))}function Xr(t){var e=t.target,i=e._esriAttributions;if(e&&e.attributionControl){var n=e.attributionControl._container.querySelector(".esri-dynamic-attribution");if(n&&i){for(var o="",r=e.getBounds(),s=(0,hr.latLngBounds)(r.getSouthWest().wrap(),r.getNorthEast().wrap()),a=e.getZoom(),l=0;l<i.length;l++){var h=i[l],c=h.attribution;!o.match(c)&&h.bounds.intersects(s)&&a>=h.minZoom&&a<=h.maxZoom&&(o+=", "+c)}o=Ir+" | "+o.substr(2),n.innerHTML=o,n.style.maxWidth=qr(e),e.fire("attributionupdated",{attribution:o})}}}var Qr={warn:kr,cleanUrl:Hr,getUrlParams:Zr,isArcgisOnline:Vr,geojsonTypeToArcGIS:Wr,responseToFeatureCollection:Gr,geojsonToArcGIS:Br,arcgisToGeoJSON:Rr,boundsToExtent:Fr,extentToBounds:zr,calcAttributionWidth:qr,setEsriAttribution:$r,removeEsriAttribution:Kr,_setGeometry:Yr,_getAttributionData:Jr,_updateMapAttribution:Xr,_findIdAttributeFromFeature:Ur,_findIdAttributeFromResponse:Nr},ts=hr.Class.extend({options:{proxy:!1,useCors:pr},generateSetter:function(t,e){return hr.Util.bind((function(e){return this.params[t]=e,this}),e)},initialize:function(t){if(t.request&&t.options?(this._service=t,hr.Util.setOptions(this,t.options)):(hr.Util.setOptions(this,t),this.options.url=Hr(t.url)),this.params=hr.Util.extend({},this.params||{}),this.setters)for(var e in this.setters){var i=this.setters[e];this[e]=this.generateSetter(i,this)}},token:function(t){return this._service?this._service.authenticate(t):this.params.token=t,this},apikey:function(t){return this.token(t)},format:function(t){return this.params.returnUnformattedValues=!t,this},request:function(t,e){return this.options.requestParams&&hr.Util.extend(this.params,this.options.requestParams),this._service?this._service.request(this.path,this.params,t,e):this._request("request",this.path,this.params,t,e)},_request:function(t,e,i,n,o){var r=this.options.proxy?this.options.proxy+"?"+this.options.url+e:this.options.url+e;return"get"!==t&&"request"!==t||this.options.useCors?wr[t](r,i,n,o):wr.get.JSONP(r,i,n,o)}});var es=ts.extend({setters:{offset:"resultOffset",limit:"resultRecordCount",fields:"outFields",precision:"geometryPrecision",featureIds:"objectIds",returnGeometry:"returnGeometry",returnM:"returnM",transform:"datumTransformation",token:"token"},path:"query",params:{returnGeometry:!0,where:"1=1",outSR:4326,outFields:"*"},within:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelContains",this},intersects:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelIntersects",this},contains:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelWithin",this},crosses:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelCrosses",this},touches:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelTouches",this},overlaps:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelOverlaps",this},bboxIntersects:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelEnvelopeIntersects",this},indexIntersects:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelIndexIntersects",this},nearby:function(t,e){return t=(0,hr.latLng)(t),this.params.geometry=[t.lng,t.lat],this.params.geometryType="esriGeometryPoint",this.params.spatialRel="esriSpatialRelIntersects",this.params.units="esriSRUnit_Meter",this.params.distance=e,this.params.inSR=4326,this},where:function(t){return this.params.where=t,this},between:function(t,e){return this.params.time=[t.valueOf(),e.valueOf()],this},simplify:function(t,e){var i=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=i/t.getSize().y*e,this},orderBy:function(t,e){return e=e||"ASC",this.params.orderByFields=this.params.orderByFields?this.params.orderByFields+",":"",this.params.orderByFields+=[t,e].join(" "),this},run:function(t,e){return this._cleanParams(),this.options.isModern||Vr(this.options.url)&&void 0===this.options.isModern?(this.params.f="geojson",this.request((function(i,n){this._trapSQLerrors(i),t.call(e,i,n,n)}),this)):this.request((function(i,n){this._trapSQLerrors(i),t.call(e,i,n&&Gr(n),n)}),this)},count:function(t,e){return this._cleanParams(),this.params.returnCountOnly=!0,this.request((function(e,i){t.call(this,e,i&&i.count,i)}),e)},ids:function(t,e){return this._cleanParams(),this.params.returnIdsOnly=!0,this.request((function(e,i){t.call(this,e,i&&i.objectIds,i)}),e)},bounds:function(t,e){return this._cleanParams(),this.params.returnExtentOnly=!0,this.request((function(i,n){n&&n.extent&&zr(n.extent)?t.call(e,i,zr(n.extent),n):(i={message:"Invalid Bounds"},t.call(e,i,null,n))}),e)},distinct:function(){return this.params.returnGeometry=!1,this.params.returnDistinctValues=!0,this},pixelSize:function(t){var e=(0,hr.point)(t);return this.params.pixelSize=[e.x,e.y],this},layer:function(t){return this.path=t+"/query",this},_trapSQLerrors:function(t){t&&"400"===t.code&&kr("one common syntax error in query requests is encasing string values in double quotes instead of single quotes")},_cleanParams:function(){delete this.params.returnIdsOnly,delete this.params.returnExtentOnly,delete this.params.returnCountOnly},_setGeometryParams:function(t){this.params.inSR=4326;var e=Yr(t);this.params.geometry=e.geometry,this.params.geometryType=e.geometryType}});var is=function(t){return new es(t)},ns=ts.extend({setters:{contains:"contains",text:"searchText",fields:"searchFields",spatialReference:"sr",sr:"sr",layers:"layers",returnGeometry:"returnGeometry",maxAllowableOffset:"maxAllowableOffset",precision:"geometryPrecision",dynamicLayers:"dynamicLayers",returnZ:"returnZ",returnM:"returnM",gdbVersion:"gdbVersion",token:"token"},path:"find",params:{sr:4326,contains:!0,returnGeometry:!0,returnZ:!0,returnM:!1},layerDefs:function(t,e){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[t,e].join(":"),this},simplify:function(t,e){var i=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=i/t.getSize().y*e,this},run:function(t,e){return this.request((function(i,n){t.call(e,i,n&&Gr(n),n)}),e)}});var os=function(t){return new ns(t)},rs=ts.extend({path:"identify",between:function(t,e){return this.params.time=[t.valueOf(),e.valueOf()],this}});var ss=rs.extend({setters:{layers:"layers",precision:"geometryPrecision",tolerance:"tolerance",returnGeometry:"returnGeometry"},params:{sr:4326,layers:"all",tolerance:3,returnGeometry:!0},on:function(t){var e=Fr(t.getBounds()),i=t.getSize();return this.params.imageDisplay=[i.x,i.y,96],this.params.mapExtent=[e.xmin,e.ymin,e.xmax,e.ymax],this},at:function(t){return 2===t.length&&(t=(0,hr.latLng)(t)),this._setGeometryParams(t),this},layerDef:function(t,e){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[t,e].join(":"),this},simplify:function(t,e){var i=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=i/t.getSize().y*e,this},run:function(t,e){return this.request((function(i,n){if(i)t.call(e,i,void 0,n);else{var o=Gr(n);n.results=n.results.reverse();for(var r=0;r<o.features.length;r++){o.features[r].layerId=n.results[r].layerId}t.call(e,void 0,o,n)}}))},_setGeometryParams:function(t){var e=Yr(t);this.params.geometry=e.geometry,this.params.geometryType=e.geometryType}});var as=function(t){return new ss(t)},ls=rs.extend({setters:{setMosaicRule:"mosaicRule",setRenderingRule:"renderingRule",setPixelSize:"pixelSize",returnCatalogItems:"returnCatalogItems",returnGeometry:"returnGeometry"},params:{returnGeometry:!1},at:function(t){return t=(0,hr.latLng)(t),this.params.geometry=JSON.stringify({x:t.lng,y:t.lat,spatialReference:{wkid:4326}}),this.params.geometryType="esriGeometryPoint",this},getMosaicRule:function(){return this.params.mosaicRule},getRenderingRule:function(){return this.params.renderingRule},getPixelSize:function(){return this.params.pixelSize},run:function(t,e){return this.request((function(i,n){t.call(e,i,n&&this._responseToGeoJSON(n),n)}),this)},_responseToGeoJSON:function(t){var e=t.location,i=t.catalogItems,n=t.catalogItemVisibilities,o={pixel:{type:"Feature",geometry:{type:"Point",coordinates:[e.x,e.y]},crs:{type:"EPSG",properties:{code:e.spatialReference.wkid}},properties:{OBJECTID:t.objectId,name:t.name,value:t.value},id:t.objectId}};if(t.properties&&t.properties.Values&&(o.pixel.properties.values=t.properties.Values),i&&i.features&&(o.catalogItems=Gr(i),n&&n.length===o.catalogItems.features.length))for(var r=n.length-1;r>=0;r--)o.catalogItems.features[r].properties.catalogItemVisibility=n[r];return o}});var hs=function(t){return new ls(t)},cs=hr.Evented.extend({options:{proxy:!1,useCors:pr,timeout:0},initialize:function(t){t=t||{},this._requestQueue=[],this._authenticating=!1,hr.Util.setOptions(this,t),this.options.url=Hr(this.options.url)},get:function(t,e,i,n){return this._request("get",t,e,i,n)},post:function(t,e,i,n){return this._request("post",t,e,i,n)},request:function(t,e,i,n){return this._request("request",t,e,i,n)},metadata:function(t,e){return this._request("get","",{},t,e)},authenticate:function(t){return this._authenticating=!1,this.options.token=t,this._runQueue(),this},getTimeout:function(){return this.options.timeout},setTimeout:function(t){this.options.timeout=t},_request:function(t,e,i,n,o){this.fire("requeststart",{url:this.options.url+e,params:i,method:t},!0);var r=this._createServiceCallback(t,e,i,n,o);if(this.options.token&&(i.token=this.options.token),this.options.requestParams&&hr.Util.extend(i,this.options.requestParams),!this._authenticating){var s=this.options.proxy?this.options.proxy+"?"+this.options.url+e:this.options.url+e;return"get"!==t&&"request"!==t||this.options.useCors?wr[t](s,i,r,o):wr.get.JSONP(s,i,r,o)}this._requestQueue.push([t,e,i,n,o])},_createServiceCallback:function(t,e,i,n,o){return hr.Util.bind((function(r,s){!r||499!==r.code&&498!==r.code||(this._authenticating=!0,this._requestQueue.push([t,e,i,n,o]),this.fire("authenticationrequired",{authenticate:hr.Util.bind(this.authenticate,this)},!0),r.authenticate=hr.Util.bind(this.authenticate,this)),n.call(o,r,s),r?this.fire("requesterror",{url:this.options.url+e,params:i,message:r.message,code:r.code,method:t},!0):this.fire("requestsuccess",{url:this.options.url+e,params:i,response:s,method:t},!0),this.fire("requestend",{url:this.options.url+e,params:i,method:t},!0)}),this)},_runQueue:function(){for(var t=this._requestQueue.length-1;t>=0;t--){var e=this._requestQueue[t];this[e.shift()].apply(this,e)}this._requestQueue=[]}});var ps=cs.extend({identify:function(){return as(this)},find:function(){return os(this)},query:function(){return is(this)}});var us=function(t){return new ps(t)},ds=cs.extend({query:function(){return is(this)},identify:function(){return hs(this)}});var ms=function(t){return new ds(t)},fs=cs.extend({options:{idAttribute:"OBJECTID"},query:function(){return is(this)},addFeature:function(t,e,i){this.addFeatures(t,e,i)},addFeatures:function(t,e,i){for(var n=t.features?t.features:[t],o=n.length-1;o>=0;o--)delete n[o].id;return t=Br(t),t=n.length>1?t:[t],this.post("addFeatures",{features:t},(function(t,n){var o=n&&n.addResults?n.addResults.length>1?n.addResults:n.addResults[0]:void 0;e&&e.call(i,t||n.addResults[0].error,o)}),i)},updateFeature:function(t,e,i){this.updateFeatures(t,e,i)},updateFeatures:function(t,e,i){var n=t.features?t.features:[t];return t=Br(t,this.options.idAttribute),t=n.length>1?t:[t],this.post("updateFeatures",{features:t},(function(t,n){var o=n&&n.updateResults?n.updateResults.length>1?n.updateResults:n.updateResults[0]:void 0;e&&e.call(i,t||n.updateResults[0].error,o)}),i)},deleteFeature:function(t,e,i){this.deleteFeatures(t,e,i)},deleteFeatures:function(t,e,i){return this.post("deleteFeatures",{objectIds:t},(function(t,n){var o=n&&n.deleteResults?n.deleteResults.length>1?n.deleteResults:n.deleteResults[0]:void 0;e&&e.call(i,t||n.deleteResults[0].error,o)}),i)}});var gs=function(t){return new fs(t)},_s="https:"!==window.location.protocol?"http:":"https:",vs=hr.TileLayer.extend({statics:{TILES:{Streets:{urlTemplate:_s+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/World_Street_Map"}},Topographic:{urlTemplate:_s+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/World_Topo_Map"}},Oceans:{urlTemplate:_s+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/Ocean_Basemap"}},OceansLabels:{urlTemplate:_s+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:ur?"esri-labels":"tilePane",attribution:""}},NationalGeographic:{urlTemplate:_s+"//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"National Geographic, DeLorme, HERE, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, increment P Corp."}},DarkGray:{urlTemplate:_s+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"HERE, DeLorme, MapmyIndia, © OpenStreetMap contributors"}},DarkGrayLabels:{urlTemplate:_s+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:ur?"esri-labels":"tilePane",attribution:""}},Gray:{urlTemplate:_s+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"HERE, DeLorme, MapmyIndia, © OpenStreetMap contributors"}},GrayLabels:{urlTemplate:_s+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:ur?"esri-labels":"tilePane",attribution:""}},Imagery:{urlTemplate:_s+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community",attributionUrl:"https://static.arcgis.com/attribution/World_Imagery"}},ImageryLabels:{urlTemplate:_s+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:ur?"esri-labels":"tilePane",attribution:""}},ImageryTransportation:{urlTemplate:_s+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:ur?"esri-labels":"tilePane",attribution:""}},ShadedRelief:{urlTemplate:_s+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"USGS"}},ShadedReliefLabels:{urlTemplate:_s+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:12,subdomains:["server","services"],pane:ur?"esri-labels":"tilePane",attribution:""}},Terrain:{urlTemplate:_s+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"USGS, NOAA"}},TerrainLabels:{urlTemplate:_s+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],pane:ur?"esri-labels":"tilePane",attribution:""}},USATopo:{urlTemplate:_s+"//{s}.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:15,subdomains:["server","services"],attribution:"USGS, National Geographic Society, i-cubed"}},ImageryClarity:{urlTemplate:_s+"//clarity.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,attribution:"Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community"}},Physical:{urlTemplate:_s+"//{s}.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:8,subdomains:["server","services"],attribution:"U.S. National Park Service"}},ImageryFirefly:{urlTemplate:_s+"//fly.maptiles.arcgis.com/arcgis/rest/services/World_Imagery_Firefly/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,attribution:"Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community",attributionUrl:"https://static.arcgis.com/attribution/World_Imagery"}}}},initialize:function(t,e){var i;if("object"==typeof t&&t.urlTemplate&&t.options)i=t;else{if("string"!=typeof t||!vs.TILES[t])throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of "Streets", "Topographic", "Oceans", "OceansLabels", "NationalGeographic", "Physical", "Gray", "GrayLabels", "DarkGray", "DarkGrayLabels", "Imagery", "ImageryLabels", "ImageryTransportation", "ImageryClarity", "ImageryFirefly", ShadedRelief", "ShadedReliefLabels", "Terrain", "TerrainLabels" or "USATopo"');i=vs.TILES[t]}var n=hr.Util.extend(i.options,e);hr.Util.setOptions(this,n),this.options.ignoreDeprecationWarning||console.warn("WARNING: L.esri.BasemapLayer uses data services that are in mature support and are not being updated. Please use L.esri.Vector.vectorBasemapLayer instead. More info: https://esriurl.com/esri-leaflet-basemap"),this.options.token&&-1===i.urlTemplate.indexOf("token=")&&(i.urlTemplate+="?token="+this.options.token),this.options.proxy&&(i.urlTemplate=this.options.proxy+"?"+i.urlTemplate),hr.TileLayer.prototype.initialize.call(this,i.urlTemplate,n)},onAdd:function(t){$r(t),"esri-labels"===this.options.pane&&this._initPane(),this.options.attributionUrl&&Jr((this.options.proxy?this.options.proxy+"?":"")+this.options.attributionUrl,t),t.on("moveend",Xr),hr.TileLayer.prototype.onAdd.call(this,t)},onRemove:function(t){Kr(t),t.off("moveend",Xr),hr.TileLayer.prototype.onRemove.call(this,t)},_initPane:function(){if(!this._map.getPane(this.options.pane)){var t=this._map.createPane(this.options.pane);t.style.pointerEvents="none",t.style.zIndex=500}},getAttribution:function(){if(this.options.attribution)var t='<span class="esri-dynamic-attribution">'+this.options.attribution+"</span>";return t}});function ys(t,e){return new vs(t,e)}var bs=hr.TileLayer.extend({options:{zoomOffsetAllowance:.1,errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEABAMAAACuXLVVAAAAA1BMVEUzNDVszlHHAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAAAAAAAAAB6mUWpAAAADZJREFUeJztwQEBAAAAgiD/r25IQAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7waBAAABw08RwAAAAABJRU5ErkJggg=="},statics:{MercatorZoomLevels:{0:156543.033928,1:78271.5169639999,2:39135.7584820001,3:19567.8792409999,4:9783.93962049996,5:4891.96981024998,6:2445.98490512499,7:1222.99245256249,8:611.49622628138,9:305.748113140558,10:152.874056570411,11:76.4370282850732,12:38.2185141425366,13:19.1092570712683,14:9.55462853563415,15:4.77731426794937,16:2.38865713397468,17:1.19432856685505,18:.597164283559817,19:.298582141647617,20:.14929107082381,21:.07464553541191,22:.0373227677059525,23:.0186613838529763}},initialize:function(t){t=Zr(t=hr.Util.setOptions(this,t)),this.tileUrl=(t.proxy?t.proxy+"?":"")+t.url+"tile/{z}/{y}/{x}"+(t.requestParams&&Object.keys(t.requestParams).length>0?hr.Util.getParamString(t.requestParams):""),-1!==t.url.indexOf("{s}")&&t.subdomains&&(t.url=t.url.replace("{s}",t.subdomains[0])),this.service=us(t),this.service.addEventParent(this),new RegExp(/tiles.arcgis(online)?\.com/g).test(t.url)&&(this.tileUrl=this.tileUrl.replace("://tiles","://tiles{s}"),t.subdomains=["1","2","3","4"]),this.options.token&&(this.tileUrl+="?token="+this.options.token),hr.TileLayer.prototype.initialize.call(this,this.tileUrl,t)},getTileUrl:function(t){var e=this._getZoomForUrl();return hr.Util.template(this.tileUrl,hr.Util.extend({s:this._getSubdomain(t),x:t.x,y:t.y,z:this._lodMap&&void 0!==this._lodMap[e]?this._lodMap[e]:e},this.options))},createTile:function(t,e){var i=document.createElement("img");return hr.DomEvent.on(i,"load",hr.Util.bind(this._tileOnLoad,this,e,i)),hr.DomEvent.on(i,"error",hr.Util.bind(this._tileOnError,this,e,i)),this.options.crossOrigin&&(i.crossOrigin=""),i.alt="",!this._lodMap||this._lodMap&&void 0!==this._lodMap[this._getZoomForUrl()]?i.src=this.getTileUrl(t):this.once("lodmap",(function(){i.src=this.getTileUrl(t)}),this),i},onAdd:function(t){$r(t),this._lodMap||this.metadata((function(e,i){if(!e&&i.spatialReference){var n=i.spatialReference.latestWkid||i.spatialReference.wkid;if(!this.options.attribution&&t.attributionControl&&i.copyrightText&&(this.options.attribution=i.copyrightText,t.attributionControl.addAttribution(this.getAttribution())),t.options.crs!==hr.CRS.EPSG3857||102100!==n&&3857!==n)t.options.crs&&t.options.crs.code&&t.options.crs.code.indexOf(n)>-1||kr("L.esri.TiledMapLayer is using a non-mercator spatial reference. Support may be available through Proj4Leaflet https://developers.arcgis.com/esri-leaflet/samples/non-mercator-projection/");else{this._lodMap={};for(var o=i.tileInfo.lods,r=bs.MercatorZoomLevels,s=0;s<o.length;s++){var a=o[s];for(var l in r){var h=r[l];if(this._withinPercentage(a.resolution,h,this.options.zoomOffsetAllowance)){this._lodMap[l]=a.level;break}}}this.fire("lodmap")}}}),this),hr.TileLayer.prototype.onAdd.call(this,t)},onRemove:function(t){Kr(t),hr.TileLayer.prototype.onRemove.call(this,t)},metadata:function(t,e){return this.service.metadata(t,e),this},identify:function(){return this.service.identify()},find:function(){return this.service.find()},query:function(){return this.service.query()},authenticate:function(t){var e="?token="+t;return this.tileUrl=this.options.token?this.tileUrl.replace(/\?token=(.+)/g,e):this.tileUrl+e,this.options.token=t,this.service.authenticate(t),this},_withinPercentage:function(t,e,i){return Math.abs(t/e-1)<i}});var xs=hr.ImageOverlay.extend({onAdd:function(t){this._topLeft=t.getPixelBounds().min,hr.ImageOverlay.prototype.onAdd.call(this,t)},_reset:function(){this._map.options.crs===hr.CRS.EPSG3857?hr.ImageOverlay.prototype._reset.call(this):hr.DomUtil.setPosition(this._image,this._topLeft.subtract(this._map.getPixelOrigin()))}}),ks=hr.Layer.extend({options:{opacity:1,position:"front",f:"image",useCors:pr,attribution:null,interactive:!1,alt:""},onAdd:function(t){$r(t),this.options.zIndex&&(this.options.position=null),this._update=hr.Util.throttle(this._update,this.options.updateInterval,this),t.on("moveend",this._update,this),this._currentImage&&this._currentImage._bounds.equals(this._map.getBounds())?t.addLayer(this._currentImage):this._currentImage&&(this._map.removeLayer(this._currentImage),this._currentImage=null),this._update(),this._popup&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this)),this.metadata((function(e,i){!e&&!this.options.attribution&&t.attributionControl&&i.copyrightText&&(this.options.attribution=i.copyrightText,t.attributionControl.addAttribution(this.getAttribution()))}),this)},onRemove:function(t){Kr(t),this._currentImage&&this._map.removeLayer(this._currentImage),this._popup&&(this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._map.off("moveend",this._update,this)},bindPopup:function(t,e){return this._shouldRenderPopup=!1,this._lastClick=!1,this._popup=(0,hr.popup)(e),this._popupFunction=t,this._map&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this)),this},unbindPopup:function(){return this._map&&(this._map.closePopup(this._popup),this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._popup=!1,this},bringToFront:function(){return this.options.position="front",this._currentImage&&(this._currentImage.bringToFront(),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this.options.position="back",this._currentImage&&(this._currentImage.bringToBack(),this._setAutoZIndex(Math.min)),this},setZIndex:function(t){return this.options.zIndex=t,this._currentImage&&this._currentImage.setZIndex(t),this},_setAutoZIndex:function(t){if(this._currentImage){for(var e,i=this._currentImage.getPane().children,n=-t(-1/0,1/0),o=0,r=i.length;o<r;o++)e=i[o].style.zIndex,i[o]!==this._currentImage._image&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this.setZIndex(this.options.zIndex))}},getAttribution:function(){return this.options.attribution},getOpacity:function(){return this.options.opacity},setOpacity:function(t){return this.options.opacity=t,this._currentImage&&this._currentImage.setOpacity(t),this},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(t,e){return this.options.from=t,this.options.to=e,this._update(),this},metadata:function(t,e){return this.service.metadata(t,e),this},authenticate:function(t){return this.service.authenticate(t),this},redraw:function(){this._update()},_renderImage:function(t,e,i){if(this._map){if(i&&(t="data:"+i+";base64,"+t),!t)return;var n=new xs(t,e,{opacity:0,crossOrigin:this.options.withCredentials?"use-credentials":this.options.useCors,alt:this.options.alt,pane:this.options.pane||this.getPane(),interactive:this.options.interactive}).addTo(this._map),o=function(){this._map.removeLayer(n),this.fire("error"),n.off("load",r,this)},r=function(t){if(n.off("error",o,this),this._map){var i=t.target,r=this._currentImage;i._bounds.equals(e)&&i._bounds.equals(this._map.getBounds())?(this._currentImage=i,"front"===this.options.position?this.bringToFront():"back"===this.options.position&&this.bringToBack(),this.options.zIndex&&this.setZIndex(this.options.zIndex),this._map&&this._currentImage._map?this._currentImage.setOpacity(this.options.opacity):this._currentImage._map.removeLayer(this._currentImage),r&&this._map&&this._map.removeLayer(r),r&&r._map&&r._map.removeLayer(r)):this._map.removeLayer(i)}this.fire("load",{bounds:e})};n.once("error",o,this),n.once("load",r,this)}},_update:function(){if(this._map){var t=this._map.getZoom(),e=this._map.getBounds();if(!(this._animatingZoom||this._map._panTransition&&this._map._panTransition._inProgress))if(t>this.options.maxZoom||t<this.options.minZoom)this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null);else{var i=this._buildExportParams();hr.Util.extend(i,this.options.requestParams),i?(this._requestExport(i,e),this.fire("loading",{bounds:e})):this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null)}}},_renderPopup:function(t,e,i,n){if(t=(0,hr.latLng)(t),this._shouldRenderPopup&&this._lastClick.equals(t)){var o=this._popupFunction(e,i,n);o&&this._popup.setLatLng(t).setContent(o).openOn(this._map)}},_resetPopupState:function(t){this._shouldRenderPopup=!1,this._lastClick=t.latlng},_calculateBbox:function(){var t=this._map.getPixelBounds(),e=this._map.unproject(t.getBottomLeft()),i=this._map.unproject(t.getTopRight()),n=this._map.options.crs.project(i),o=this._map.options.crs.project(e),r=(0,hr.bounds)(n,o);return[r.getBottomLeft().x,r.getBottomLeft().y,r.getTopRight().x,r.getTopRight().y].join(",")},_calculateImageSize:function(){var t=this._map.getPixelBounds(),e=this._map.getSize(),i=this._map.unproject(t.getBottomLeft()),n=this._map.unproject(t.getTopRight()),o=this._map.latLngToLayerPoint(n).y,r=this._map.latLngToLayerPoint(i).y;return(o>0||r<e.y)&&(e.y=r-o),e.x+","+e.y}});ks.extend({options:{updateInterval:150,format:"jpgpng",transparent:!0,f:"image"},query:function(){return this.service.query()},identify:function(){return this.service.identify()},initialize:function(t){t=Zr(t),this.service=ms(t),this.service.addEventParent(this),hr.Util.setOptions(this,t)},setPixelType:function(t){return this.options.pixelType=t,this._update(),this},getPixelType:function(){return this.options.pixelType},setBandIds:function(t){return hr.Util.isArray(t)?this.options.bandIds=t.join(","):this.options.bandIds=t.toString(),this._update(),this},getBandIds:function(){return this.options.bandIds},setNoData:function(t,e){return hr.Util.isArray(t)?this.options.noData=t.join(","):this.options.noData=t.toString(),e&&(this.options.noDataInterpretation=e),this._update(),this},getNoData:function(){return this.options.noData},getNoDataInterpretation:function(){return this.options.noDataInterpretation},setRenderingRule:function(t){this.options.renderingRule=t,this._update()},getRenderingRule:function(){return this.options.renderingRule},setMosaicRule:function(t){this.options.mosaicRule=t,this._update()},getMosaicRule:function(){return this.options.mosaicRule},_getPopupData:function(t){var e=hr.Util.bind((function(e,i,n){e||setTimeout(hr.Util.bind((function(){this._renderPopup(t.latlng,e,i,n)}),this),300)}),this),i=this.identify().at(t.latlng);this.options.mosaicRule&&i.setMosaicRule(this.options.mosaicRule),i.run(e),this._shouldRenderPopup=!0,this._lastClick=t.latlng},_buildExportParams:function(){var t=parseInt(this._map.options.crs.code.split(":")[1],10),e={bbox:this._calculateBbox(),size:this._calculateImageSize(),format:this.options.format,transparent:this.options.transparent,bboxSR:t,imageSR:t};return this.options.from&&this.options.to&&(e.time=this.options.from.valueOf()+","+this.options.to.valueOf()),this.options.pixelType&&(e.pixelType=this.options.pixelType),this.options.interpolation&&(e.interpolation=this.options.interpolation),this.options.compressionQuality&&(e.compressionQuality=this.options.compressionQuality),this.options.bandIds&&(e.bandIds=this.options.bandIds),(0===this.options.noData||this.options.noData)&&(e.noData=this.options.noData),this.options.noDataInterpretation&&(e.noDataInterpretation=this.options.noDataInterpretation),this.service.options.token&&(e.token=this.service.options.token),this.options.renderingRule&&(e.renderingRule=JSON.stringify(this.options.renderingRule)),this.options.mosaicRule&&(e.mosaicRule=JSON.stringify(this.options.mosaicRule)),e},_requestExport:function(t,e){if("json"===this.options.f)this.service.request("exportImage",t,(function(t,i){t||(this.options.token&&(i.href+="?token="+this.options.token),this.options.proxy&&(i.href=this.options.proxy+"?"+i.href),this._renderImage(i.href,e))}),this);else{t.f="image";var i=this.options.url+"exportImage"+hr.Util.getParamString(t);this.options.proxy&&(i=this.options.proxy+"?"+i),this._renderImage(i,e)}}});ks.extend({options:{updateInterval:150,layers:!1,layerDefs:!1,timeOptions:!1,format:"png32",transparent:!0,f:"json"},initialize:function(t){t=Zr(t),this.service=us(t),this.service.addEventParent(this),hr.Util.setOptions(this,t)},getDynamicLayers:function(){return this.options.dynamicLayers},setDynamicLayers:function(t){return this.options.dynamicLayers=t,this._update(),this},getLayers:function(){return this.options.layers},setLayers:function(t){return this.options.layers=t,this._update(),this},getLayerDefs:function(){return this.options.layerDefs},setLayerDefs:function(t){return this.options.layerDefs=t,this._update(),this},getTimeOptions:function(){return this.options.timeOptions},setTimeOptions:function(t){return this.options.timeOptions=t,this._update(),this},query:function(){return this.service.query()},identify:function(){return this.service.identify()},find:function(){return this.service.find()},_getPopupData:function(t){var e,i=hr.Util.bind((function(e,i,n){e||setTimeout(hr.Util.bind((function(){this._renderPopup(t.latlng,e,i,n)}),this),300)}),this);if((e=this.options.popup?this.options.popup.on(this._map).at(t.latlng):this.identify().on(this._map).at(t.latlng)).params.maxAllowableOffset||e.simplify(this._map,.5),this.options.popup&&this.options.popup.params&&this.options.popup.params.layers||(this.options.layers?e.layers("visible:"+this.options.layers.join(",")):e.layers("visible")),this.options.layerDefs&&"string"!=typeof this.options.layerDefs&&!e.params.layerDefs)for(var n in this.options.layerDefs)Object.prototype.hasOwnProperty.call(this.options.layerDefs,n)&&e.layerDef(n,this.options.layerDefs[n]);e.run(i),this._shouldRenderPopup=!0,this._lastClick=t.latlng},_buildExportParams:function(){var t=parseInt(this._map.options.crs.code.split(":")[1],10),e={bbox:this._calculateBbox(),size:this._calculateImageSize(),dpi:96,format:this.options.format,transparent:this.options.transparent,bboxSR:t,imageSR:t};if(this.options.dynamicLayers&&(e.dynamicLayers=this.options.dynamicLayers),this.options.layers){if(0===this.options.layers.length)return;e.layers="show:"+this.options.layers.join(",")}return this.options.layerDefs&&(e.layerDefs="string"==typeof this.options.layerDefs?this.options.layerDefs:JSON.stringify(this.options.layerDefs)),this.options.timeOptions&&(e.timeOptions=JSON.stringify(this.options.timeOptions)),this.options.from&&this.options.to&&(e.time=this.options.from.valueOf()+","+this.options.to.valueOf()),this.service.options.token&&(e.token=this.service.options.token),this.options.proxy&&(e.proxy=this.options.proxy),this.options.disableCache&&(e._ts=Date.now()),e},_requestExport:function(t,e){if("json"===this.options.f)this.service.request("export",t,(function(t,i){t||(this.options.token&&i.href&&(i.href+="?token="+this.options.token),this.options.proxy&&i.href&&(i.href=this.options.proxy+"?"+i.href),i.href?this._renderImage(i.href,e):this._renderImage(i.imageData,e,i.contentType))}),this);else{t.f="image";var i=this.options.url+"export"+hr.Util.getParamString(t);this.options.proxy&&(i=this.options.proxy+"?"+i),this._renderImage(i,e)}}});var Ls=hr.Layer.extend({options:{cellSize:512,updateWhenIdle:hr.Browser.mobile,updateInterval:150,noWrap:!1,keepBuffer:1.5},initialize:function(t){hr.Util.setOptions(this,t)},onAdd:function(t){this._cells={},this._activeCells={},this._resetView(),this._update()},onRemove:function(t){this._removeAllCells(),this._cellZoom=void 0},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllCells(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=hr.Util.throttle(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),t},createCell:function(){return document.createElement("div")},removeCell:function(){},reuseCell:function(){},cellLeave:function(){},cellEnter:function(){},getCellSize:function(){var t=this.options.cellSize;return t instanceof hr.Point?t:new hr.Point(t,t)},_pruneCells:function(){if(this._map){var t,e;for(t in this._cells)(e=this._cells[t]).retain=e.current;for(t in this._cells)if((e=this._cells[t]).current&&!e.active){var i=e.coords;this._retainParent(i.x,i.y,i.z,i.z-5)||this._retainChildren(i.x,i.y,i.z,i.z+2)}for(t in this._cells)this._cells[t].retain||this._removeCell(t)}},_removeAllCells:function(){for(var t in this._cells)this._removeCell(t)},_invalidateAll:function(){this._removeAllCells(),this._cellZoom=void 0},_retainParent:function(t,e,i,n){var o=Math.floor(t/2),r=Math.floor(e/2),s=i-1,a=new hr.Point(+o,+r);a.z=+s;var l=this._cellCoordsToKey(a),h=this._cells[l];return h&&h.active?(h.retain=!0,!0):(h&&h.loaded&&(h.retain=!0),s>n&&this._retainParent(o,r,s,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var r=2*e;r<2*e+2;r++){var s=new hr.Point(o,r);s.z=i+1;var a=this._cellCoordsToKey(s),l=this._cells[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<n&&this._retainChildren(o,r,i+1,n))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);e||this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_setView:function(t,e,i,n){var o=Math.round(e);n||(this._cellZoom=o,this._abortLoading&&this._abortLoading(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneCells(),this._noPrune=!!i)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._cellSize=this.getCellSize(),n=this._cellZoom,o=this._map.getPixelWorldBounds(this._cellZoom);o&&(this._globalCellRange=this._pxBoundsToCellRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(t){t&&(t.pinch||t.flyTo)||!this._map||this._map._animatingZoom||this._update()},_getCelldPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),n=e.getZoomScale(i,this._cellZoom),o=e.project(t,this._cellZoom).floor(),r=e.getSize().divideBy(2*n);return new hr.Bounds(o.subtract(r),o.add(r))},_update:function(t){var e=this._map;if(e){var i=Math.round(e.getZoom());void 0===t&&(t=e.getCenter());var n=this._getCelldPixelBounds(t),o=this._pxBoundsToCellRange(n),r=o.getCenter(),s=[],a=this.options.keepBuffer,l=new hr.Bounds(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of cells");for(var h in this._cells){var c=this._cells[h].coords;c.z===this._cellZoom&&l.contains(new hr.Point(c.x,c.y))||(this._cells[h].current=!1)}if(Math.abs(i-this._cellZoom)>1)this._setView(t,i);else{for(var p=o.min.y;p<=o.max.y;p++)for(var u=o.min.x;u<=o.max.x;u++){var d=new hr.Point(u,p);if(d.z=this._cellZoom,this._isValidCell(d)){var m=this._cells[this._cellCoordsToKey(d)];m?m.current=!0:s.push(d)}}if(s.sort((function(t,e){return t.distanceTo(r)-e.distanceTo(r)})),0!==s.length)for(this._loading||(this._loading=!0),u=0;u<s.length;u++){var f=this._cellCoordsToKey(s[u]),g=this._keyToCellCoords(f);this._activeCells[g]?this._reuseCell(s[u]):this._createCell(s[u])}}}},_isValidCell:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalCellRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._cellCoordsToBounds(t);return(0,hr.toLatLngBounds)(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._cellCoordsToBounds(this._keyToCellCoords(t))},_cellCoordsToNwSe:function(t){var e=this._map,i=this.getCellSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_cellCoordsToBounds:function(t){var e=this._cellCoordsToNwSe(t),i=new hr.LatLngBounds(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_cellCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToCellCoords:function(t){var e=t.split(":"),i=new hr.Point(+e[0],+e[1]);return i.z=+e[2],i},_removeCell:function(t){var e=this._cells[t];if(e){var i=this._keyToCellCoords(t),n=this._wrapCoords(i),o=this._cellCoordsToBounds(this._wrapCoords(i));e.current=!1,delete this._cells[t],this._activeCells[t]=e,this.cellLeave(o,n,t),this.fire("cellleave",{key:t,coords:n,bounds:o})}},_reuseCell:function(t){var e=this._cellCoordsToKey(t);this._cells[e]=this._activeCells[e],this._cells[e].current=!0;var i=this._wrapCoords(t),n=this._cellCoordsToBounds(this._wrapCoords(t));this.cellEnter(n,i,e),this.fire("cellenter",{key:e,coords:i,bounds:n})},_createCell:function(t){var e=this._cellCoordsToKey(t),i=this._wrapCoords(t),n=this._cellCoordsToBounds(this._wrapCoords(t));this.createCell(n,i,e),this.fire("cellcreate",{key:e,coords:i,bounds:n}),this._cells[e]={coords:t,current:!0},hr.Util.requestAnimFrame(this._pruneCells,this)},_cellReady:function(t,e,i){var n=this._cellCoordsToKey(t);(i=this._cells[n])&&(i.loaded=+new Date,i.active=!0)},_getCellPos:function(t){return t.scaleBy(this.getCellSize())},_wrapCoords:function(t){var e=new hr.Point(this._wrapX?hr.Util.wrapNum(t.x,this._wrapX):t.x,this._wrapY?hr.Util.wrapNum(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToCellRange:function(t){var e=this.getCellSize();return new hr.Bounds(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))}});function ws(t){this.values=[].concat(t||[])}ws.prototype.query=function(t){var e=this.getIndex(t);return this.values[e]},ws.prototype.getIndex=function(t){this.dirty&&this.sort();for(var e,i,n=0,o=this.values.length-1;n<=o;)if(e=(n+o)/2|0,+(i=this.values[Math.round(e)]).value<+t)n=e+1;else{if(!(+i.value>+t))return e;o=e-1}return Math.abs(~o)},ws.prototype.between=function(t,e){var i=this.getIndex(t),n=this.getIndex(e);if(0===i&&0===n)return[];for(;this.values[i-1]&&this.values[i-1].value===t;)i--;for(;this.values[n+1]&&this.values[n+1].value===e;)n++;return this.values[n]&&this.values[n].value===e&&this.values[n+1]&&n++,this.values.slice(i,n)},ws.prototype.insert=function(t){return this.values.splice(this.getIndex(t.value),0,t),this},ws.prototype.bulkAdd=function(t,e){return this.values=this.values.concat([].concat(t||[])),e?this.sort():this.dirty=!0,this},ws.prototype.sort=function(){return this.values.sort((function(t,e){return+e.value-+t.value})).reverse(),this.dirty=!1,this};var Ms=ws,Cs=Ls.extend({options:{attribution:null,where:"1=1",fields:["*"],from:!1,to:!1,timeField:!1,timeFilterMode:"server",simplifyFactor:0,precision:6,fetchAllFeatures:!1},initialize:function(t){if(Ls.prototype.initialize.call(this,t),t=Zr(t),t=hr.Util.setOptions(this,t),this.service=gs(t),this.service.addEventParent(this),"*"!==this.options.fields[0]){for(var e=!1,i=0;i<this.options.fields.length;i++)this.options.fields[i].match(/^(OBJECTID|FID|OID|ID)$/i)&&(e=!0);!1===e&&kr("no known esriFieldTypeOID field detected in fields Array. Please add an attribute field containing unique IDs to ensure the layer can be drawn correctly.")}this.options.timeField.start&&this.options.timeField.end?(this._startTimeIndex=new Ms,this._endTimeIndex=new Ms):this.options.timeField&&(this._timeIndex=new Ms),this._cache={},this._currentSnapshot=[],this._activeRequests=0},onAdd:function(t){return $r(t),this.service.metadata((function(e,i){if(!e){var n=i.supportedQueryFormats,o=!1;(!1===this.service.options.isModern||this.options.fetchAllFeatures)&&(o=!0),!o&&n&&-1!==n.indexOf("geoJSON")&&(this.service.options.isModern=!0),i.objectIdField&&(this.service.options.idAttribute=i.objectIdField),!this.options.attribution&&t.attributionControl&&i.copyrightText&&(this.options.attribution=i.copyrightText,t.attributionControl.addAttribution(this.getAttribution()))}}),this),t.on("zoomend",this._handleZoomChange,this),Ls.prototype.onAdd.call(this,t)},onRemove:function(t){return Kr(t),t.off("zoomend",this._handleZoomChange,this),Ls.prototype.onRemove.call(this,t)},getAttribution:function(){return this.options.attribution},createCell:function(t,e){this._visibleZoom()&&this._requestFeatures(t,e)},_requestFeatures:function(t,e,i,n){this._activeRequests++,n=n||0;var o=this.options.where;return 1===this._activeRequests&&this.fire("loading",{bounds:t},!0),this._buildQuery(t,n).run((function(r,s,a){a&&a.exceededTransferLimit&&this.fire("drawlimitexceeded"),this.options.where===o&&(!r&&s&&s.features.length&&hr.Util.requestAnimFrame(hr.Util.bind((function(){this._addFeatures(s.features,e),this._postProcessFeatures(t)}),this)),r||!s||s.features.length||this._postProcessFeatures(t),r&&this._postProcessFeatures(t),i&&i.call(this,r,s),a&&(a.exceededTransferLimit||a.properties&&a.properties.exceededTransferLimit)&&this.options.fetchAllFeatures&&this._requestFeatures(t,e,i,n+s.features.length))}),this)},_postProcessFeatures:function(t){this._activeRequests--,this._activeRequests<=0&&this.fire("load",{bounds:t})},_cacheKey:function(t){return t.z+":"+t.x+":"+t.y},_addFeatures:function(t,e){if(e){var i=this._cacheKey(e);this._cache[i]=this._cache[i]||[]}for(var n=t.length-1;n>=0;n--){var o=t[n].id;-1===this._currentSnapshot.indexOf(o)&&this._currentSnapshot.push(o),void 0!==i&&-1===this._cache[i].indexOf(o)&&this._cache[i].push(o)}this.options.timeField&&this._buildTimeIndexes(t),this.createLayers(t)},_buildQuery:function(t,e){var i=this.service.query().intersects(t).where(this.options.where).fields(this.options.fields).precision(this.options.precision);return this.options.fetchAllFeatures&&!isNaN(parseInt(e))&&(i=i.offset(e)),i.params.resultType="tile",this.options.requestParams&&hr.Util.extend(i.params,this.options.requestParams),this.options.simplifyFactor&&i.simplify(this._map,this.options.simplifyFactor),"server"===this.options.timeFilterMode&&this.options.from&&this.options.to&&i.between(this.options.from,this.options.to),i},setWhere:function(t,e,i){this.options.where=t&&t.length?t:"1=1";for(var n=[],o=[],r=0,s=null,a=hr.Util.bind((function(a,l){if(a&&(s=a),l)for(var h=l.features.length-1;h>=0;h--)o.push(l.features[h].id);--r<=0&&this._visibleZoom()&&t===this.options.where&&(this._currentSnapshot=o,hr.Util.requestAnimFrame(hr.Util.bind((function(){this.removeLayers(n),this.addLayers(o),e&&e.call(i,s)}),this)))}),this),l=this._currentSnapshot.length-1;l>=0;l--)n.push(this._currentSnapshot[l]);for(var h in this._cache={},this._cells){r++;var c=this._keyToCellCoords(h),p=this._cellCoordsToBounds(c);this._requestFeatures(p,c,a)}return this},getWhere:function(){return this.options.where},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(t,e,i,n){var o=this.options.from,r=this.options.to,s=0,a=null,l=hr.Util.bind((function(l){l&&(a=l),this._filterExistingFeatures(o,r,t,e),s--,i&&s<=0&&i.call(n,a)}),this);if(this.options.from=t,this.options.to=e,this._filterExistingFeatures(o,r,t,e),"server"===this.options.timeFilterMode)for(var h in this._cells){s++;var c=this._keyToCellCoords(h),p=this._cellCoordsToBounds(c);this._requestFeatures(p,c,l)}return this},refresh:function(){this.setWhere(this.options.where)},_filterExistingFeatures:function(t,e,i,n){var o=t&&e?this._getFeaturesInTimeRange(t,e):this._currentSnapshot,r=this._getFeaturesInTimeRange(i,n);if(r.indexOf)for(var s=0;s<r.length;s++){var a=o.indexOf(r[s]);a>=0&&o.splice(a,1)}hr.Util.requestAnimFrame(hr.Util.bind((function(){this.removeLayers(o),this.addLayers(r)}),this))},_getFeaturesInTimeRange:function(t,e){var i,n=[];if(this.options.timeField.start&&this.options.timeField.end){var o=this._startTimeIndex.between(t,e),r=this._endTimeIndex.between(t,e);i=o.concat(r)}else{if(!this._timeIndex)return kr("You must set timeField in the layer constructor in order to manipulate the start and end time filter."),[];i=this._timeIndex.between(t,e)}for(var s=i.length-1;s>=0;s--)n.push(i[s].id);return n},_buildTimeIndexes:function(t){var e,i;if(this.options.timeField.start&&this.options.timeField.end){var n=[],o=[];for(e=t.length-1;e>=0;e--)i=t[e],n.push({id:i.id,value:new Date(i.properties[this.options.timeField.start])}),o.push({id:i.id,value:new Date(i.properties[this.options.timeField.end])});this._startTimeIndex.bulkAdd(n),this._endTimeIndex.bulkAdd(o)}else{var r=[];for(e=t.length-1;e>=0;e--)i=t[e],r.push({id:i.id,value:new Date(i.properties[this.options.timeField])});this._timeIndex.bulkAdd(r)}},_featureWithinTimeRange:function(t){if(!this.options.from||!this.options.to)return!0;var e=+this.options.from.valueOf(),i=+this.options.to.valueOf();if("string"==typeof this.options.timeField){var n=+t.properties[this.options.timeField];return n>=e&&n<=i}if(this.options.timeField.start&&this.options.timeField.end){var o=+t.properties[this.options.timeField.start],r=+t.properties[this.options.timeField.end];return o>=e&&o<=i||r>=e&&r<=i||o<=e&&r>=i}},_visibleZoom:function(){if(!this._map)return!1;var t=this._map.getZoom();return!(t>this.options.maxZoom||t<this.options.minZoom)},_handleZoomChange:function(){if(this._visibleZoom())for(var t in this._cells){var e=this._cells[t].coords,i=this._cacheKey(e);this._cache[i]&&this.addLayers(this._cache[i])}else this.removeLayers(this._currentSnapshot),this._currentSnapshot=[]},authenticate:function(t){return this.service.authenticate(t),this},metadata:function(t,e){return this.service.metadata(t,e),this},query:function(){return this.service.query()},_getMetadata:function(t){this._metadata?t(undefined,this._metadata):this.metadata(hr.Util.bind((function(e,i){this._metadata=i,t(e,this._metadata)}),this))},addFeature:function(t,e,i){this.addFeatures(t,e,i)},addFeatures:function(t,e,i){this._getMetadata(hr.Util.bind((function(n,o){if(n)e&&e.call(this,n,null);else{var r=t.features?t.features:[t];this.service.addFeatures(t,hr.Util.bind((function(t,n){if(!t){for(var s=r.length-1;s>=0;s--)r[s].properties[o.objectIdField]=r.length>1?n[s].objectId:n.objectId,r[s].id=r.length>1?n[s].objectId:n.objectId;this._addFeatures(r)}e&&e.call(i,t,n)}),this))}}),this))},updateFeature:function(t,e,i){this.updateFeatures(t,e,i)},updateFeatures:function(t,e,i){var n=t.features?t.features:[t];this.service.updateFeatures(t,(function(t,o){if(!t){for(var r=n.length-1;r>=0;r--)this.removeLayers([n[r].id],!0);this._addFeatures(n)}e&&e.call(i,t,o)}),this)},deleteFeature:function(t,e,i){this.deleteFeatures(t,e,i)},deleteFeatures:function(t,e,i){return this.service.deleteFeatures(t,(function(t,n){var o=n.length?n:[n];if(!t&&o.length>0)for(var r=o.length-1;r>=0;r--)this.removeLayers([o[r].objectId],!0);e&&e.call(i,t,n)}),this)}});Cs.extend({options:{cacheLayers:!0},initialize:function(t){t.apikey&&(t.token=t.apikey),Cs.prototype.initialize.call(this,t),this._originalStyle=this.options.style,this._layers={}},onRemove:function(t){for(var e in this._layers)t.removeLayer(this._layers[e]),this.fire("removefeature",{feature:this._layers[e].feature,permanent:!1},!0);return Cs.prototype.onRemove.call(this,t)},createNewLayer:function(t){var e=hr.GeoJSON.geometryToLayer(t,this.options);return e&&(e.defaultOptions=e.options),e},_updateLayer:function(t,e){var i=[],n=this.options.coordsToLatLng||hr.GeoJSON.coordsToLatLng;switch(e.properties&&(t.feature.properties=e.properties),e.geometry.type){case"Point":i=hr.GeoJSON.coordsToLatLng(e.geometry.coordinates),t.setLatLng(i);break;case"LineString":i=hr.GeoJSON.coordsToLatLngs(e.geometry.coordinates,0,n),t.setLatLngs(i);break;case"MultiLineString":case"Polygon":i=hr.GeoJSON.coordsToLatLngs(e.geometry.coordinates,1,n),t.setLatLngs(i);break;case"MultiPolygon":i=hr.GeoJSON.coordsToLatLngs(e.geometry.coordinates,2,n),t.setLatLngs(i)}this.redraw(t.feature.id)},createLayers:function(t){for(var e=t.length-1;e>=0;e--){var i,n=t[e],o=this._layers[n.id];!this._visibleZoom()||!o||this._map.hasLayer(o)||this.options.timeField&&!this._featureWithinTimeRange(n)||(this._map.addLayer(o),this.fire("addfeature",{feature:o.feature},!0)),o&&(o.setLatLngs||o.setLatLng)&&this._updateLayer(o,n),o||((i=this.createNewLayer(n))?(i.feature=n,i.addEventParent(this),this.options.onEachFeature&&this.options.onEachFeature(i.feature,i),this._layers[i.feature.id]=i,this.setFeatureStyle(i.feature.id,this.options.style),this.fire("createfeature",{feature:i.feature},!0),this._visibleZoom()&&(!this.options.timeField||this.options.timeField&&this._featureWithinTimeRange(n))&&this._map.addLayer(i)):kr("invalid GeoJSON encountered"))}},addLayers:function(t){for(var e=t.length-1;e>=0;e--){var i=this._layers[t[e]];!i||this.options.timeField&&!this._featureWithinTimeRange(i.feature)||(this._map.addLayer(i),this.fire("addfeature",{feature:i.feature},!0))}},removeLayers:function(t,e){for(var i=t.length-1;i>=0;i--){var n=t[i],o=this._layers[n];o&&(this.fire("removefeature",{feature:o.feature,permanent:e},!0),this._map.removeLayer(o)),o&&e&&delete this._layers[n]}},cellEnter:function(t,e){this._visibleZoom()&&!this._zooming&&this._map&&hr.Util.requestAnimFrame(hr.Util.bind((function(){var t=this._cacheKey(e),i=this._cellCoordsToKey(e),n=this._cache[t];this._activeCells[i]&&n&&this.addLayers(n)}),this))},cellLeave:function(t,e){this._zooming||hr.Util.requestAnimFrame(hr.Util.bind((function(){if(this._map){var t=this._cacheKey(e),i=this._cellCoordsToKey(e),n=this._cache[t],o=this._map.getBounds();if(!this._activeCells[i]&&n){for(var r=!0,s=0;s<n.length;s++){var a=this._layers[n[s]];a&&a.getBounds&&o.intersects(a.getBounds())&&(r=!1)}r&&this.removeLayers(n,!this.options.cacheLayers),!this.options.cacheLayers&&r&&(delete this._cache[t],delete this._cells[i],delete this._activeCells[i])}}}),this))},resetStyle:function(){return this.options.style=this._originalStyle,this.eachFeature((function(t){this.resetFeatureStyle(t.feature.id)}),this),this},setStyle:function(t){return this.options.style=t,this.eachFeature((function(e){this.setFeatureStyle(e.feature.id,t)}),this),this},resetFeatureStyle:function(t){var e=this._layers[t],i=this._originalStyle||hr.Path.prototype.options;return e&&(hr.Util.extend(e.options,e.defaultOptions),this.setFeatureStyle(t,i)),this},setFeatureStyle:function(t,e){var i=this._layers[t];return"function"==typeof e&&(e=e(i.feature)),i.setStyle&&i.setStyle(e),this},eachActiveFeature:function(t,e){if(this._map){var i=this._map.getBounds();for(var n in this._layers)-1!==this._currentSnapshot.indexOf(this._layers[n].feature.id)&&("function"==typeof this._layers[n].getLatLng&&i.contains(this._layers[n].getLatLng())||"function"==typeof this._layers[n].getBounds&&i.intersects(this._layers[n].getBounds()))&&t.call(e,this._layers[n])}return this},eachFeature:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getFeature:function(t){return this._layers[t]},bringToBack:function(){this.eachFeature((function(t){t.bringToBack&&t.bringToBack()}))},bringToFront:function(){this.eachFeature((function(t){t.bringToFront&&t.bringToFront()}))},redraw:function(t){return t&&this._redraw(t),this},_redraw:function(t){var e=this._layers[t],i=e.feature;if(e&&e.setIcon&&this.options.pointToLayer&&this.options.pointToLayer){var n=this.options.pointToLayer(i,(0,hr.latLng)(i.geometry.coordinates[1],i.geometry.coordinates[0])).options.icon;e.setIcon(n)}if(e&&e.setStyle&&this.options.pointToLayer){var o=this.options.pointToLayer(i,(0,hr.latLng)(i.geometry.coordinates[1],i.geometry.coordinates[0])).options;this.setFeatureStyle(i.id,o)}e&&e.setStyle&&this.options.style&&this.resetFeatureStyle(i.id)},openPopup(t){return this._popup&&this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map),this},openTooltip(t){return this._tooltip&&this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this)),this}});i(389),i(769),i(891);cr().TileLayer.HERE=cr().TileLayer.extend({options:{subdomains:"1234",minZoom:2,maxZoom:18,scheme:"normal.day",resource:"maptile",mapId:"newest",format:"png8",apiKey:"",appId:"",appCode:""},initialize:function(t){var e=(t=cr().setOptions(this,t)).scheme.split(".")[0];if(t.tileResolution=256,cr().Browser.retina&&(t.tileResolution=512),t.apiKey)var i=".maps.ls.hereapi.com",n="/{resource}/2.1/{resource}/{mapId}/{scheme}/{z}/{x}/{y}/{tileResolution}/{format}?apiKey={apiKey}",o="/maptile/2.1/copyright/{mapId}?apiKey={apiKey}";else i=".maps.api.here.com",n="/{resource}/2.1/{resource}/{mapId}/{scheme}/{z}/{x}/{y}/{tileResolution}/{format}?app_id={appId}&app_code={appCode}",o="/maptile/2.1/copyright/{mapId}?app_id={appId}&app_code={appCode}";var r="base";"satellite"!=e&&"terrain"!=e&&"hybrid"!=e||(r="aerial"),-1!==t.scheme.indexOf(".traffic.")&&(r="traffic");var s="https://{s}."+r+i+n;this._attributionUrl=cr().Util.template("https://1."+r+i+o,this.options),cr().TileLayer.prototype.initialize.call(this,s,t),this._attributionText=""},onAdd:function(t){cr().TileLayer.prototype.onAdd.call(this,t),this._attributionText="",this._attributionBBoxes||this._fetchAttributionBBoxes()},onRemove:function(t){cr().TileLayer.prototype.onRemove.call(this,t),void 0!==this._map.attributionControl&&this._map.attributionControl.removeAttribution(this._attributionText),this._map.off("moveend zoomend resetview",this._findCopyrightBBox,this)},_fetchAttributionBBoxes:function(){var t=new XMLHttpRequest;t.onreadystatechange=cr().bind((function(){4==t.readyState&&200==t.status&&this._parseAttributionBBoxes(JSON.parse(t.responseText))}),this),t.open("GET",this._attributionUrl,!0),t.send()},_parseAttributionBBoxes:function(t){if(this._map){for(var e=t[this.options.scheme.split(".")[0]]||t.normal,i=0;i<e.length;i++)if(e[i].boxes)for(var n=0;n<e[i].boxes.length;n++){var o=e[i].boxes[n];e[i].boxes[n]=cr().latLngBounds([[o[0],o[1]],[o[2],o[3]]])}this._map.on("moveend zoomend resetview",this._findCopyrightBBox,this),this._attributionProviders=e,this._findCopyrightBBox()}},_findCopyrightBBox:function(){if(this._map){for(var t=this._attributionProviders,e=[],i=this._map.getZoom(),n=this._map.getBounds(),o=0;o<t.length;o++){if(t[o].minLevel<i&&t[o].maxLevel>i&&!t[o].boxes){e.push(t[o]);break}for(var r=0;r<t[o].boxes.length;r++){var s=t[o].boxes[r];if(n.overlaps(s)){e.push(t[o]);break}}}var a=['<a href="https://legal.here.com/terms/serviceterms/gb/">HERE maps</a>'];for(o=0;o<e.length;o++){var l=e[o];a.push('<abbr title="'+l.alt+'">'+l.label+"</abbr>")}var h="© "+a.join(", ")+". ";h!==this._attributionText&&void 0!==this._map.attributionControl&&(this._map.attributionControl.removeAttribution(this._attributionText),this._map.attributionControl.addAttribution(this._attributionText=h))}}}),cr().tileLayer.here=function(t){return new(cr().TileLayer.HERE)(t)},cr().TileLayer.TomTom=cr().TileLayer.extend({options:{apiKey:"",style:"main",subdomains:"abcd",minNativeZoom:0,maxNativeZoom:22},initialize:function(t){var e="https://{s}.api.tomtom.com/map/1/tile/basic/"+(t=cr().setOptions(this,t)).style+"/{z}/{x}/{y}.png?key="+t.apiKey;cr().TileLayer.prototype.initialize.call(this,e,t),this._copyright=cr().DomUtil.create("div","tomtom-copyright"),this._copyrightClose=cr().DomUtil.create("button","tomtom-copyright-close",this._copyright),this._copyrightContent=cr().DomUtil.create("div","tomtom-copyright-content",this._copyright),cr().DomEvent.on(this._copyrightClose,"click",(function(t){t.preventDefault(),t.stopPropagation(),this._hideCopyright()}),this),this._attributionText='<a class="tomtom-attribution" href="#">© 1992 - '+(new Date).getFullYear()+" TomTom.</a>"},onAdd:function(t){cr().TileLayer.prototype.onAdd.call(this,t),this._addAttribution(),this._map.on("click",this._hideCopyright,this)},onRemove:function(t){cr().TileLayer.prototype.onRemove.call(this,t),this._hideCopyright(),this._removeAttribution(),this._map.off("click",this._hideCopyright,this)},_addAttribution:function(){if(void 0!==this._map.attributionControl){this._map.attributionControl.addAttribution(this._attributionText);var t=this._map.attributionControl.getContainer().querySelector(".tomtom-attribution");null!==t&&cr().DomEvent.on(t,"click",(function(t){t.preventDefault(),t.stopPropagation(),this._showCopyright()}),this)}},_removeAttribution:function(){void 0!==this._map.attributionControl&&this._map.attributionControl.removeAttribution(this._attributionText)},_showCopyright:function(){var t=this._map.getContainer();null===t.querySelector(".tomtom-copyright")&&t.appendChild(this._copyright);var e,i,n,o,r=this._map.getBounds(),s=r.getNorthEast().wrap(),a=r.getSouthWest().wrap();a.lng<s.lng?(e=a.lng,i=s.lng):(e=s.lng,i=a.lng),a.lat<s.lat?(n=a.lat,o=s.lat):(n=s.lat,o=a.lat);var l="https://api.tomtom.com/map/1/copyrights/"+e+"/"+n+"/"+i+"/"+o+".json?key="+this.options.apiKey,h=new XMLHttpRequest;h.onreadystatechange=cr().bind((function(){if(h.readyState===XMLHttpRequest.DONE&&200===h.status){for(var t=JSON.parse(h.responseText),e="<h4>General Copyrights:</h4>",i=0;i<t.generalCopyrights.length;i++)e+="<p>"+t.generalCopyrights[i]+"</p>";for(i=0;i<t.regions.length;i++){var n=t.regions[i];e+="<h4>"+n.country.label+":</h4>";for(var o=0;o<n.copyrights.length;o++)e+="<p>"+n.copyrights[o]+"</p>"}this._copyrightContent.innerHTML=e}}),this),h.open("GET",l,!0),h.send()},_hideCopyright:function(){this._copyright.remove()}}),cr().tileLayer.tomTom=function(t,e){return new(cr().TileLayer.TomTom)(t,e)};i(157),i(882),i(189),i(395),i(245);function Ps(t){return Ps="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(t)}function Ss(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function Ts(t){return 4!==(t=(t=t.replace(/[^0-9.,-]/g,"")).split(",")).length?null:(t.map(parseFloat),[[t[0],t[1]],[t[2],t[3]]])}function As(t,e,i,n){return t.sort((function(t,o){var r,s;return"desc"===i?(r=o[e],s=t[e]):(r=t[e],s=o[e]),n?r-s:r.localeCompare(s,void 0,{numeric:!0,sensitivity:"base"})})),t}function Ds(t,e){var i,n,o,r,s,a;return n=(i=Math.floor(t))%1e3,o=(i=Math.floor(i/1e3))%60,r=(i=Math.floor(i/60))%60,s=(i=Math.floor(i/60))%24,a=i=Math.floor(i/24),e?(n="",o+='"'):(n+='"',o+="."),t>6e4?r+="'":r="",t>36e5?s+=":":s="",t>864e5?a+=".":a="",a+s+r+o+n}function Es(t,e){var i=Math.pow(10,e);return Math.round(t*i)/i}function Os(t,e,i){if(isNaN(t))return"N/A";var n,o,r,s,a;switch(e?(n=1.609344,o="km",r="mi"):(n=.3048,o="m",r="ft"),"imperial"===i||"imperial-metric"===i?(s=t*n,a=t):(s=t,a=t/n),s=Es(s,2)+" "+o,a=Es(a,2)+" "+r,i){case"imperial":return a;case"metric-imperial":return s+" ("+a+")";case"imperial-metric":return a+" ("+s+")";default:return s}}function Is(t){try{var e=JSON.parse(t);if(e&&"object"===Ps(e))return e}catch(t){return t}return!1}function Bs(t){return new Promise((function(e,i){var n=new XMLHttpRequest;if(n.open(t.type,t.url,!0),n.onload=function(){200===n.status?e(n.responseText):i(new Error("XHR request failed with error "+n.status+" ("+n.statusText+")"))},n.onerror=function(){i(new Error("XHR request failed with an unknown error"))},t.beforeSend&&t.beforeSend(n),t.data){var o=new FormData;Object.keys(t.data).forEach((function(e){o.append(e,t.data[e])})),n.send(o)}else n.send(null)}))}cr().Control.ResetView=cr().Control.extend({options:{position:"topleft",onDemand:!1,coordinates:null,zoom:null,title:""},onAdd:function(t){var e=cr().DomUtil.create("div","leaflet-control-reset-view leaflet-bar"),i=this.options;return i.onDemand&&(e.style.display="none",t.on("movestart",(function(){e.style.display="block"}))),null===i.coordinates&&(i.coordinates=t.getCenter()),null===i.zoom&&(i.zoom=t.getZoom()),this._createButton("",i.title,"leaflet-control-reset-view-button leaflet-bar-part",e,this._resetView),e},_createButton:function(t,e,i,n,o){var r=cr().DomUtil.create("a",i,n);r.innerHTML=t,r.href="#",r.title=e,cr().DomEvent.disableClickPropagation(r),cr().DomEvent.on(r,"click",cr().DomEvent.stop),cr().DomEvent.on(r,"click",o,this),cr().DomEvent.on(r,"click",this._refocusOnMap,this)},_resetView:function(){this._map.stop(),this.options.onDemand&&this._map.once("moveend",(function(){this._container.style.display="none"}),this),this._map.setView(this.options.coordinates,this.options.zoom,{animate:!0})}}),cr().control.resetView=function(t){return new(cr().Control.ResetView)(t)},cr().Control.Filters=cr().Control.extend({options:{mmp:null,collapsed:!0,position:"topright",buttons:!0,allText:"All",noneText:"None"},initialize:function(t){cr().Util.setOptions(this,t)},onAdd:function(t){this._map=t;var e=this.options.mmp,i=this.options.collapsed,n="mmp-control-filters",o=this._container=cr().DomUtil.create("div",n);o.setAttribute("aria-haspopup",!0),cr().DomEvent.disableClickPropagation(o),cr().DomEvent.disableScrollPropagation(o),i&&(this._map.on("click",this.collapse,this),cr().Browser.android||cr().DomEvent.on(o,{mouseenter:this.expand,mouseleave:this.collapse},this));var r=cr().DomUtil.create("a",n+"-toggle",o);r.href="#",r.title="Filters",cr().Browser.touch?(cr().DomEvent.on(r,"click",cr().DomEvent.stop),cr().DomEvent.on(r,"click",this.expand,this)):cr().DomEvent.on(r,"focus",this.expand,this);var s=this._form=cr().DomUtil.create("form",n+"-list",o);if(this.options.buttons){var a=cr().DomUtil.create("div","mmp-control-filters-buttons",s),l=cr().DomUtil.create("a",null,a);l.innerHTML=this.options.allText,l.href="#",l.title=this.options.allText,cr().DomEvent.disableClickPropagation(l),cr().DomEvent.on(l,"click",cr().DomEvent.stop),cr().DomEvent.on(l,"click",(function(){this._batchSelect(!0)}),this);var h=cr().DomUtil.create("a",null,a);h.innerHTML=this.options.noneText,h.href="#",h.title=this.options.noneText,cr().DomEvent.disableClickPropagation(h),cr().DomEvent.on(h,"click",cr().DomEvent.stop),cr().DomEvent.on(h,"click",(function(){this._batchSelect(!1)}),this)}var c=[];Object.keys(e.settings.filtersDetails).forEach((function(t){var i=e.settings.filtersDetails[t];if(void 0!==e.groups[t]){var n=0;Object.keys(e.markers).forEach((function(i){-1!==e.markers[i].feature.properties.maps.indexOf(t)&&n++})),c.push({index:i.index,id:t,icon:i.icon,name:i.name,count:n})}})),c="id"===e.settings.filtersOrderBy?As(c,"id",e.settings.filtersSortOrder,!0):"name"===e.settings.filtersOrderBy?As(c,"name",e.settings.filtersSortOrder,!1):"count"===e.settings.filtersOrderBy?As(c,"count",e.settings.filtersSortOrder,!0):As(c,"index",e.settings.filtersSortOrder,!0);for(var p=0;p<c.length;p++){var u=cr().DomUtil.create("label",null,s),d=cr().DomUtil.create("input",n+"-selector",u);d.type="checkbox",d.value=c[p].id,void 0!==e.groups[c[p].id]&&e.groups[c[p].id].active&&(d.checked=!0);var m=cr().DomUtil.create("span",null,u),f="";if(e.settings.filtersIcon)f+='<img class="mmp-filter-icon" src="'+(c[p].icon?mmpVars.iconsUrl+c[p].icon:mmpVars.pluginUrl+"images/leaflet/marker.png")+'" />';e.settings.filtersName&&(f+=c[p].name),e.settings.filtersCount&&(f+=" ["+c[p].count+"]"),m.innerHTML=f;var g=this;cr().DomEvent.on(d,"click",(function(){void 0!==e.groups[this.value]&&(e.groups[this.value].active=this.checked),g._update(),t.fire("filterclick")}),d)}return i||this.expand(),o},expand:function(){cr().DomUtil.addClass(this._container,"mmp-control-filters-expanded"),this._form.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._form.clientHeight?(cr().DomUtil.addClass(this._form,"mmp-control-filters-scrollbar"),this._form.style.height=t+"px"):cr().DomUtil.removeClass(this._form,"mmp-control-filters-scrollbar"),this},collapse:function(){return cr().DomUtil.removeClass(this._container,"mmp-control-filters-expanded"),this},_batchSelect:function(t){for(var e=this.options.mmp,i=this._container.getElementsByClassName("mmp-control-filters-selector"),n=i.length-1;n>=0;n--)i[n].checked=t,void 0!==e.groups[i[n].value]&&(e.groups[i[n].value].active=t);this._update(),this._map.fire("filterclick")},_update:function(){var t=this.options.mmp;if("map"===t.type&&t.settings.list)t.getList();else{var e=t.getActiveMarkers();t.drawMarkers(e)}t.drawGeoJson()}}),cr().control.filters=function(t){return new(cr().Control.Filters)(t)},cr().Control.Gpx=cr().Control.extend({options:{mmp:null,collapsed:!0,position:"topleft"},initialize:function(t){cr().Util.setOptions(this,t)},onAdd:function(t){this._map=t;var e=this.options.mmp,i=this.options.collapsed,n="mmp-control-tracks",o=this._container=cr().DomUtil.create("div",n);o.setAttribute("aria-haspopup",!0),cr().DomEvent.disableClickPropagation(o),cr().DomEvent.disableScrollPropagation(o),i&&(this._map.on("click",this.collapse,this),cr().Browser.android||cr().DomEvent.on(o,{mouseenter:this.expand,mouseleave:this.collapse},this));var r=cr().DomUtil.create("a",n+"-toggle",o);r.href="#",r.title="Tracks",cr().Browser.touch?(cr().DomEvent.on(r,"click",cr().DomEvent.stop),cr().DomEvent.on(r,"click",this.expand,this)):cr().DomEvent.on(r,"focus",this.expand,this);var s,a=this._form=cr().DomUtil.create("form",n+"-list",o);for(s=0;s<e.gpx.tracks.length;s++){var l=cr().DomUtil.create("label",null,a),h=cr().DomUtil.create("input",n+"-selector",l);h.type="radio",h.name="mmp-gpx-tracks",h.value=s,0===s&&(h.checked=!0),cr().DomUtil.create("span",null,l).innerHTML=e.gpx.tracks[s].name?e.gpx.tracks[s].name:"Unnamed Track",cr().DomEvent.on(h,"click",(function(){var i=parseInt(this.value);t._activeTrack=i,t.fitBounds(e.gpxTracks[i].getBounds(),{padding:[10,10]}),e.updateElevationChart(!0)}),h)}return i||this.expand(),o},expand:function(){cr().DomUtil.addClass(this._container,"mmp-control-tracks-expanded"),this._form.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._form.clientHeight?(cr().DomUtil.addClass(this._form,"mmp-control-tracks-scrollbar"),this._form.style.height=t+"px"):cr().DomUtil.removeClass(this._form,"mmp-control-tracks-scrollbar"),this},collapse:function(){return cr().DomUtil.removeClass(this._container,"mmp-control-tracks-expanded"),this}}),cr().control.gpx=function(t){return new(cr().Control.Gpx)(t)};i(423);var Rs=i(748),zs=i.n(Rs);var Fs=function(t){var e=this;this.selector=t.selector||"#address",this.beforeSend=t.beforeSend||function(){},this.error=t.error||function(){},this.selected=t.selected||function(){},this.provider=t.provider||"none",this.typingDelay=t.typingDelay||400,this.minChars=t.minChars||3,this.autocomplete,this.init=function(){document.querySelector(e.selector)&&(e.autocomplete=new(zs())({name:"mmp-autocomplete",selector:e.selector,debounce:e.typingDelay,threshold:e.minChars,data:{src:function(t){return cr().DomUtil.removeClass(e.autocomplete.input,"results-error"),cr().DomUtil.addClass(e.autocomplete.input,"results-loading"),e.beforeSend(),Bs({type:"POST",url:mmpVars.ajaxurl,data:{action:"mmp_geocoding",provider:e.provider,query:t}}).then((function(t){return(t=JSON.parse(t)).success?t.results:(cr().DomUtil.addClass(e.autocomplete.input,"results-error"),void e.error(""+t.message))})).catch((function(t){cr().DomUtil.addClass(e.autocomplete.input,"results-error"),e.error(""+t)})).finally((function(){cr().DomUtil.removeClass(e.autocomplete.input,"results-loading")}))},keys:["address"],cache:!1},searchEngine:function(t,e){return e},resultsList:{element:function(t,i){if(!i.results.length){var n=document.createElement("div");n.setAttribute("class",e.autocomplete.name+"_no-results"),n.innerHTML="<span>No results</span>",t.prepend(n)}var o=cr().DomUtil.create("div",e.autocomplete.name+"_footer",t);switch(e.provider){case"locationiq":o.innerHTML='<a href="https://www.mapsmarker.com/locationiq-geocoding/" target="_blank"><img class="logo-locationiq" src="'+mmpVars.pluginUrl+'images/options/locationiq-logo.png" /></a>';break;case"mapquest":o.innerHTML='<a href="https://www.mapsmarker.com/mapquest-geocoding/" target="_blank"><img class="logo-mapquest" src="'+mmpVars.pluginUrl+'images/geocoding/mapquest-logo.png" /></a>';break;case"google":o.innerHTML='<a href="https://www.mapsmarker.com/google-geocoding/ target="_blank"><img class="logo-google" src="'+mmpVars.pluginUrl+'images/geocoding/powered-by-google.png" /></a>';break;case"tomtom":o.innerHTML='<a href="https://www.mapsmarker.com/tomtom-geocoding/" target="_blank"><img class="logo-tomtom" src="'+mmpVars.pluginUrl+'images/geocoding/tomtom-logo.png" /></a>';break;default:o.innerHTML=""}},maxResults:10,noResults:!0},resultItem:{element:function(t,i){t.innerHTML='<span class="'+e.autocomplete.name+'_icon"></span><span class="'+e.autocomplete.name+'_address">'+i.value.address+"</span>"},highlight:!1},events:{input:{init:function(t){t.srcElement.setAttribute("autocomplete","off")},focus:function(){e.autocomplete.open()},selection:function(t){var i=t.detail.selection.value;e.autocomplete.input.value=i.address,e.autocomplete.input.blur(),i.placeId?Bs({type:"POST",url:mmpVars.ajaxurl,data:{action:"mmp_google_places",placeId:i.placeId}}).then((function(t){(t=JSON.parse(t)).success&&e.selected(t.lat,t.lon,i.value)})).catch((function(){})):e.selected(i.lat,i.lon,i.value)}}}}))}};function js(t){return js="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},js(t)}function Ns(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Us(n.key),n)}}function Us(t){var e=function(t,e){if("object"!=js(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=js(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==js(e)?e:String(e)}function Gs(t,e,i){return e=Vs(e),function(t,e){if(e&&("object"===js(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Hs()?Reflect.construct(e,i||[],Vs(t).constructor):e.apply(t,i))}function Hs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Hs=function(){return!!t})()}function Zs(){return Zs="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Vs(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:i):o.value}},Zs.apply(this,arguments)}function Vs(t){return Vs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vs(t)}function Ws(t,e){return Ws=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ws(t,e)}function qs(t){var i=this;this.uid=t.uid,this.type=t.type,this.id=t.id,this.lazy=t.lazy,this.customMarkers=t.marker||t.markers,this.settings=t.overrides||{},this.highlight=t.highlight||{},this.fitMarkers=t.fitMarkers||!1,this.containers={},this.map={},this.groups={},this.markers={},this.markerGroup={},this.geoJson={},this.geoJsonGroup={},this.tooltips={},this.basemaps={},this.minimaps={},this.overlays={},this.controls={},this.gpx={},this.gpxChart={},this.gpxTracks={},this.gpxWaypoints={},this.chartLayers={},this.listeners={},this.list={page:1,term:null,sort:null,order:null,lat:null,lng:null,zoom:null,radius:0,located:!1,geocoding:{},marker:{},circle:{},fitVisible:!1,highlight:null},this.on=function(t,e){i.listeners[t]instanceof Array||(i.listeners[t]=[]),-1===i.listeners[t].indexOf(e)&&i.listeners[t].push(e)},this.off=function(t,e){if(i.listeners[t]instanceof Array){var n=i.listeners[t].indexOf(e);-1!==n&&i.listeners[t].splice(n,1)}},this.fire=function(t,e){if(i.listeners[t]instanceof Array)for(var n=0;n<i.listeners[t].length;n++)i.listeners[t][n].call(i,e)},this.checkInvalidateSize=function(){var t=Ss(i.containers.main);!i.mapVisible&&t&&(i.map.invalidateSize(),void 0!==i.controls.minimap&&i.controls.minimap._miniMap.invalidateSize()),i.mapVisible=t},this.addLoading=function(t){if(!t.getElementsByClassName("mmp-loading-spinner").length){var e=cr().DomUtil.create("div","mmp-loading-spinner"),i=cr().DomUtil.create("div","rect-wrap");e.appendChild(i);for(var n=1;n<=5;n++){var o=cr().DomUtil.create("div","rect"+n);i.appendChild(o)}t.appendChild(e)}},this.removeLoading=function(t){for(var e=t.getElementsByClassName("mmp-loading-spinner"),i=0;i<e.length;i++)e[i].remove()},this.showMapModal=function(t,e){void 0!==i.containers.mapModal&&i.containers.mapModal.remove(),i.containers.mapModal=cr().DomUtil.create("div","mmp-map-modal"),i.containers.mapModal.addEventListener("click",(function(t){t.target===this&&this.remove()}));var n=cr().DomUtil.create("div","mmp-map-modal-content",i.containers.mapModal),o=cr().DomUtil.create("span","mmp-map-modal-close",n);o.innerHTML="×",o.addEventListener("click",(function(t){t.target===this&&i.containers.mapModal.remove()}));var r=cr().DomUtil.create("div","mmp-map-modal-header",n);cr().DomUtil.create("p","mmp-map-modal-title",r).innerHTML=t;var s=cr().DomUtil.create("div","mmp-map-modal-body",n);"string"==typeof e?cr().DomUtil.create("p","mmp-map-modal-message",s).innerHTML=e:s.appendChild(e);i.containers.mapWrap.appendChild(i.containers.mapModal)},this.getDirectionsLink=function(t,e,n,o){var r=i.settings,s="";switch(t){case"googlemaps":s="https://www.google.com/maps/dir/?api=1&destination="+(o||e+","+n),r.directionsGoogleTravelMode&&(s+="&travelmode="+r.directionsGoogleTravelMode);break;case"ors":s="https://classic-maps.openrouteservice.org/directions?a=null,null,"+e+","+n,s+="&b="+("Bicycle"===r.directionsOrsType?"1a":"Pedestrian"===r.directionsOrsType?"2":"HeavyVehicle"===r.directionsOrsType?"4a":"0"),s+="&c="+("Shortest"===r.directionsOrsRoute?"1":"0");break;case"bingmaps":s="https://www.bing.com/maps/default.aspx?v=2&rtp=pos___e_~pos."+e+"_"+n+(o?"_"+o:"")}return s},this.getApiLink=function(t,e,n){n=n||{},!mmpVars.language||"geojson"!==t&&"kml"!==t&&"georss"!==t||(n.lang=mmpVars.language);var o=mmpVars.apiUrl;switch(t){case"editMap":o=mmpVars.adminUrl+"admin.php?page=mapsmarkerpro_map&id="+e;break;case"editMarker":o=mmpVars.adminUrl+"admin.php?page=mapsmarkerpro_marker&id="+e;break;case"fs":o+="fullscreen/"+e+"/";break;case"gpx":o=mmpVars.baseUrl+"index.php?mapsmarkerpro=download_gpx&url="+i.settings.gpxUrl;break;case"geojson":o+="export/geojson/"+e+"/";break;case"kml":o+="export/kml/"+e+"/";break;case"georss":o+="export/georss/"+e+"/"}return Object.keys(n).length&&(o+="?",Object.keys(n).forEach((function(t){o+=t+"="+n[t]+"&"})),o=o.slice(0,-1)),o},this.addApiLink=function(t,e,i,n){var o=cr().DomUtil.create("a","mmp-api-icon "+i,n);o.href=t,o.rel="nofollow",o.target="_blank",o.title=e},this.addShareLink=function(t,e){var n=cr().DomUtil.create("i","mmp-api-icon mmp-api-icon-share",e);n.title=mmpL10n.api.share,n.addEventListener("click",(function(){i.containers.main.scrollIntoView(),i.openShareModal(t)}))},this.openShareModal=function(t){var e,n=i.settings;n.apiFullscreen&&"fs"===n.shareUrl?e=i.getApiLink("fs",i.id,{marker:t}):((e=new URL(window.location)).searchParams.delete("marker"),e.searchParams.set("markerid",t),e=e.toString());var o=cr().DomUtil.create("div",null);n.shareFacebook&&o.appendChild(i.getShareLink("facebook",e,n.shareText)),n.shareTwitter&&o.appendChild(i.getShareLink("twitter",e,n.shareText)),n.shareLinkedIn&&o.appendChild(i.getShareLink("linkedin",e,n.shareText)),n.shareWhatsApp&&o.appendChild(i.getShareLink("whatsapp",e,n.shareText)),n.shareEmail&&o.appendChild(i.getShareLink("email",e,n.shareText));var r=cr().DomUtil.create("div","mmp-share-modal-url",o),s=cr().DomUtil.create("input",null,r);s.setAttribute("type","text"),s.setAttribute("value",e),s.addEventListener("click",(function(){this.select()})),i.showMapModal(mmpL10n.api.share,o)},this.getShareLink=function(t,e,i){e=encodeURIComponent(e),i=encodeURIComponent(i);var n=cr().DomUtil.create("a","mmp-share-button-link");n.setAttribute("target","_blank"),n.setAttribute("rel","noopener");var o=cr().DomUtil.create("div","mmp-share-button",n),r=cr().DomUtil.create("div","mmp-share-button-icon",o),s=cr().SVG.create("svg");s.setAttribute("viewBox","0 0 24 24"),r.appendChild(s);var a=cr().SVG.create("path");switch(s.appendChild(a),t){case"facebook":n.setAttribute("href","https://www.facebook.com/sharer.php?u="+e),cr().DomUtil.addClass(o,"mmp-share-button-facebook"),a.setAttribute("d","M18.77 7.46H14.5v-1.9c0-.9.6-1.1 1-1.1h3V.5h-4.33C10.24.5 9.5 3.44 9.5 5.32v2.15h-3v4h3v12h5v-12h3.85l.42-4z");break;case"twitter":n.setAttribute("href","https://twitter.com/share?text="+i+"&url="+e+"&via=mapsmarker"),cr().DomUtil.addClass(o,"mmp-share-button-twitter"),a.setAttribute("d","M23.44 4.83c-.8.37-1.5.38-2.22.02.93-.56.98-.96 1.32-2.02-.88.52-1.86.9-2.9 1.1-.82-.88-2-1.43-3.3-1.43-2.5 0-4.55 2.04-4.55 4.54 0 .36.03.7.1 1.04-3.77-.2-7.12-2-9.36-4.75-.4.67-.6 1.45-.6 2.3 0 1.56.8 2.95 2 3.77-.74-.03-1.44-.23-2.05-.57v.06c0 2.2 1.56 4.03 3.64 4.44-.67.2-1.37.2-2.06.08.58 1.8 2.26 3.12 4.25 3.16C5.78 18.1 3.37 18.74 1 18.46c2 1.3 4.4 2.04 6.97 2.04 8.35 0 12.92-6.92 12.92-12.93 0-.2 0-.4-.02-.6.9-.63 1.96-1.22 2.56-2.14z");break;case"linkedin":n.setAttribute("href","https://www.linkedin.com/shareArticle?title="+i+"&url="+e),cr().DomUtil.addClass(o,"mmp-share-button-linkedin"),a.setAttribute("d","M6.5 21.5h-5v-13h5v13zM4 6.5C2.5 6.5 1.5 5.3 1.5 4s1-2.4 2.5-2.4c1.6 0 2.5 1 2.6 2.5 0 1.4-1 2.5-2.6 2.5zm11.5 6c-1 0-2 1-2 2v7h-5v-13h5V10s1.6-1.5 4-1.5c3 0 5 2.2 5 6.3v6.7h-5v-7c0-1-1-2-2-2z");break;case"whatsapp":cr().Browser.mobile?n.setAttribute("href","whatsapp://send?text="+i+" "+e):n.setAttribute("href","https://api.whatsapp.com/send?text="+i+" "+e),cr().DomUtil.addClass(o,"mmp-share-button-whatsapp"),a.setAttribute("d","M20.1 3.9C17.9 1.7 15 .5 12 .5 5.8.5.7 5.6.7 11.9c0 2 .5 3.9 1.5 5.6L.6 23.4l6-1.6c1.6.9 3.5 1.3 5.4 1.3 6.3 0 11.4-5.1 11.4-11.4-.1-2.8-1.2-5.7-3.3-7.8zM12 21.4c-1.7 0-3.3-.5-4.8-1.3l-.4-.2-3.5 1 1-3.4L4 17c-1-1.5-1.4-3.2-1.4-5.1 0-5.2 4.2-9.4 9.4-9.4 2.5 0 4.9 1 6.7 2.8 1.8 1.8 2.8 4.2 2.8 6.7-.1 5.2-4.3 9.4-9.5 9.4zm5.1-7.1c-.3-.1-1.7-.9-1.9-1-.3-.1-.5-.1-.7.1-.2.3-.8 1-.9 1.1-.2.2-.3.2-.6.1s-1.2-.5-2.3-1.4c-.9-.8-1.4-1.7-1.6-2-.2-.3 0-.5.1-.6s.3-.3.4-.5c.2-.1.3-.3.4-.5.1-.2 0-.4 0-.5C10 9 9.3 7.6 9 7c-.1-.4-.4-.3-.5-.3h-.6s-.4.1-.7.3c-.3.3-1 1-1 2.4s1 2.8 1.1 3c.1.2 2 3.1 4.9 4.3.7.3 1.2.5 1.6.6.7.2 1.3.2 1.8.1.6-.1 1.7-.7 1.9-1.3.2-.7.2-1.2.2-1.3-.1-.3-.3-.4-.6-.5z");break;case"email":i?n.setAttribute("href","mailto:?subject="+i+"&body="+e):n.setAttribute("href","mailto:?body="+e),n.setAttribute("target","_self"),cr().DomUtil.addClass(o,"mmp-share-button-email"),a.setAttribute("d","M22 4H2C.9 4 0 4.9 0 6v12c0 1.1.9 2 2 2h20c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM7.25 14.43l-3.5 2c-.08.05-.17.07-.25.07-.17 0-.34-.1-.43-.25-.14-.24-.06-.55.18-.68l3.5-2c.24-.14.55-.06.68.18.14.24.06.55-.18.68zm4.75.07c-.1 0-.2-.03-.27-.08l-8.5-5.5c-.23-.15-.3-.46-.15-.7.15-.22.46-.3.7-.14L12 13.4l8.23-5.32c.23-.15.54-.08.7.15.14.23.07.54-.16.7l-8.5 5.5c-.08.04-.17.07-.27.07zm8.93 1.75c-.1.16-.26.25-.43.25-.08 0-.17-.02-.25-.07l-3.5-2c-.24-.13-.32-.44-.18-.68s.44-.32.68-.18l3.5 2c.24.13.32.44.18.68z");break;default:return null}return n},this.getActiveMarkers=function(){var t=i.settings,e=[];return Object.keys(i.markers).forEach((function(n){var o=i.markers[n],r=o.feature.properties.maps;if("map"!==i.type||t.filtersAllMarkers)e.push(o);else{var s=!1;"and"===t.filtersLogic?(s=!0,Object.keys(i.groups).forEach((function(t){t!==i.id&&i.groups[t].active&&-1===r.indexOf(t)&&(s=!1)}))):Object.keys(i.groups).forEach((function(t){i.groups[t].active&&-1!==r.indexOf(t)&&(s=!0)})),s&&-1===e.indexOf(o)&&e.push(o)}})),e},this.checkPopupSize=function(t){var e=i.settings;i.containers.map.offsetWidth<e.popupMaxWidth?(t.options.minWidth=i.containers.map.offsetWidth-50,t.options.maxWidth=i.containers.map.offsetWidth-50):(t.options.minWidth=e.popupMinWidth,t.options.maxWidth=e.popupMaxWidth),i.containers.map.offsetHeight<e.popupMaxHeight?t.options.maxHeight=i.containers.map.offsetHeight-50:t.options.maxHeight=e.popupMaxHeight,t.update()},this.loadPopup=function(t,e){return new Promise((function(n,o){var r=t.getPopup();if(void 0!==r)if(e||!r.getContent()){var s=cr().DomUtil.create("div","mmp-popup");cr().DomUtil.create("img","mmp-popup-loading",s).src=mmpVars.pluginUrl+"images/icons/paging-ajax-loader.gif",r.setContent(s);var a="";new Promise((function(e,n){t instanceof cr().Marker?t.feature.properties.popup?(a=i.getMarkerPopup(t),e()):i.getPopups(t.feature.properties.id).then((function(){a=i.getMarkerPopup(t),e()})).catch((function(){n()})):t instanceof cr().Path?(a=i.getGeoJsonPopup(t),e()):n()})).then((function(){var t=a.getElementsByTagName("img"),e=Array.prototype.slice.call(t);Promise.all(e.map(i.imgLoaded)).then((function(){r.setContent(a),n(r)}))})).catch((function(){o()}))}else n(r);else o()}))},this.getMarkerPopup=function(t){var e=i.settings,n=t.feature.properties,o=cr().DomUtil.create("div","mmp-popup");if(o.id="mmp-popup-"+n.id,e.popupMarkername&&n.name){var r=cr().DomUtil.create("div","mmp-popup-name",o);r.innerHTML=n.name,r.style.borderBottom="1px solid #f0f0e7"}n.popup&&(cr().DomUtil.create("div","mmp-popup-text",o).innerHTML=n.popup);if(n.address&&e.popupAddress||e.popupCoordinates||e.popupDirections||e.popupShare){var s=cr().DomUtil.create("div","mmp-popup-location",o);if(s.style.borderTop="1px solid #f0f0e7",e.popupShare&&i.addShareLink(n.id,s),e.popupDirections){var a=i.getDirectionsLink(e.directionsProvider,t.getLatLng().lat,t.getLatLng().lng,n.address);i.addApiLink(a,mmpL10n.api.dir,"mmp-api-icon-directions",s)}if(n.address&&e.popupAddress)cr().DomUtil.create("span","mmp-popup-location-address",s).innerHTML+=n.address;if(e.popupCoordinates){var l=cr().DomUtil.create("span","mmp-popup-location-coordinates",s);n.address&&e.popupAddress?l.innerHTML+=" ("+t.getLatLng().lat+", "+t.getLatLng().lng+")":l.innerHTML+=t.getLatLng().lat+", "+t.getLatLng().lng}}return o},this.getGeoJsonPopup=function(t){var e=i.settings,n=cr().DomUtil.create("div","mmp-popup");if(e.popupMarkername&&t.options.name){var o=cr().DomUtil.create("div","mmp-popup-name",n);o.innerHTML=t.options.name,o.style.borderBottom="1px solid #f0f0e7"}t.options.popup&&(cr().DomUtil.create("div","mmp-popup-text",n).innerHTML=t.options.popup);return n},this.imgLoaded=function(t){if(t.src)return new Promise((function(e){t.addEventListener("load",e),t.addEventListener("error",e),t.loading&&"lazy"===t.loading&&(t.loading="eager")}))},this.updatePopups=function(){var t=i.settings;Object.keys(i.markers).forEach((function(e){var n=i.markers[e],o=n.getPopup();void 0!==o&&(o.setContent(""),o.options.minWidth=t.popupMinWidth,o.options.maxWidth=t.popupMaxWidth,o.options.maxHeight=t.popupMaxHeight,o.isOpen()&&i.updatePopup(n))}))},this.updatePopup=function(t,e){var n=i.settings,o=t.getPopup(),r=t.feature.properties;!o&&t.feature.properties.popup?t.bindPopup("",i.popup):!o||r.popup||r.address&&n.popupAddress||n.popupCoordinates||n.popupDirections||(t.closePopup(),t.unbindPopup()),i.loadPopup(t,e).then((function(t){i.checkPopupSize(t),n.popupCenterOnMap&&i.centerPopup(t)})).catch((function(){}))},this.centerPopup=function(t){if(t.isOpen()){var e=t.getLatLng(),n=i.map.project(e),o=t._container.clientHeight;n.y-=o/2;var r=i.map.unproject(n);i.map.panTo(r,{animate:!0})}},this.openMarker=function(t){t.isPopupOpen()?i.updatePopup(t):t.openPopup()},this.highlightMarker=function(t,e,n,o){if(t instanceof cr().Marker||void 0!==(t=i.markers[t])){var r=t.feature.properties;if(r.link)i.openLink(r.link,r.blank);else{e&&i.containers.main.scrollIntoView();var s=t.getLatLng(),a=n&&i.map.getZoom()<r.zoom?r.zoom:void 0;i.map.once("moveend",(function(){i.markerGroup instanceof cr().MarkerClusterGroup?i.markerGroup.zoomToShowLayer(t,(function(){var e=t.getLatLng(),n=n&&i.map.getZoom()<n?n:void 0;i.map.once("moveend",(function(){o&&i.openMarker(t)})),i.map.setView(e,n)})):o&&i.openMarker(t)})),i.map.setView(s,a)}}},this.openLink=function(t,e){var i="1"===e?"_blank":"_self";window.open(t,i)},this.showError=function(t){if(i.containers.main.innerHTML="",cr().DomUtil.addClass(i.containers.main,"mmp-map-error"),mmpVars.isAdmin){var e=cr().DomUtil.create("pre","mmp-map-error-debug",i.containers.main);e.innerHTML='Unable to load Maps Marker Pro map.\nSee <a href="https://www.mapsmarker.com/map-loading-issues/" target="_blank">https://www.mapsmarker.com/map-loading-issues/</a> for possible solutions.\nPlease include the URL to the map and the information below if opening a support ticket.\n\n',e.appendChild(document.createTextNode(t.stack))}else{cr().DomUtil.create("p","mmp-map-error-msg",i.containers.main).innerHTML="The map could not be loaded. Please contact the site owner."}},this.logError=function(t){console.error("[Maps Marker Pro] "+t)},this.main=function(){i.containers.main=document.getElementById("maps-marker-pro-"+i.uid),i.containers.main?i.lazy?"function"==typeof IntersectionObserver?new IntersectionObserver(i.lazyLoadHandler,{root:null,rootMargin:"0px",threshold:0}).observe(i.containers.main):i.lazyLoadHandlerFallback():i.load():"function"==typeof MutationObserver?new MutationObserver(i.deferredLoadHandler).observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):i.logError("Unable to find map container")},this.load=function(){if(void 0===window.L||void 0===window.L.map||window.L.version!==cr().version){var t=new Error("Incorrect or missing Leaflet library");return i.logError("Error loading map ("+t.message+")"),void i.showError(t)}if(i.addLoading(i.containers.main),"function"==typeof URL){var e=new URL(window.location),n=parseInt(e.searchParams.get("marker"));isNaN(n)&&(n=parseInt(e.searchParams.get("markerid"))),isNaN(n)||(i.highlight={id:n,zoom:!1,open:!0})}for(var o=document.getElementsByClassName("mmp-highlight"),r=0;r<o.length;r++){var s=o[r].dataset;s.uid&&s.uid!==i.uid||(s.map&&s.map!==i.id||o[r].addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation();var e=this.dataset,n=e.marker||null,o=!e.scroll||"false"!==e.scroll,r=!(!e.zoom||"true"!==e.zoom),s=!e.open||"false"!==e.open;i.highlightMarker(n,o,r,s)})))}for(var a=0;a<qs.callbacks.length;a++){var l=qs.callbacks[a];"function"==typeof l&&l(i)}i.loadSettings().then((function(){return i.init(),i.loadResources()})).then((function(){i.loadControls(),i.removeLoading(i.containers.main),i.highlight.id?i.highlightMarker(i.highlight.id,!!i.highlight.scroll,!!i.highlight.zoom,!!i.highlight.open):i.fitMarkers&&!i.map.getBounds().contains(i.markerGroup.getBounds())&&i.fitVisibleMarkers(i.loadControls)})).catch((function(t){i.logError("Error loading map ("+t.message+")"),i.showError(t)}))},this.init=function(){i.containers.mapWrap=document.getElementById("mmp-map-wrap-"+i.uid),i.containers.mapWrap||(i.containers.mapWrap=cr().DomUtil.create("div","mmp-map-wrap",i.containers.main),i.containers.mapWrap.id="mmp-map-wrap-"+i.uid),i.loadPanel(),i.loadMap(),i.loadChart(),i.loadList(),i.setLayout(),window.addEventListener("resize",i.setLayoutThrottled),"function"==typeof IntersectionObserver?new IntersectionObserver(i.visibilityDetectionHandler,{root:null,rootMargin:"0px",threshold:0}).observe(i.containers.main):i.visibilityDetectionHandlerFallback(),i.loadBasemaps(),i.loadOverlays()},this.setLayout=function(){var t=i.settings;i.containers.main.style.width=t.width+t.widthUnit,i.containers.map.style.height=t.height+t.heightUnit,t.responsive&&"px"===t.widthUnit&&("100%"!==i.containers.main.style.width&&i.containers.main.parentNode.offsetWidth<t.width?i.containers.main.style.width="100%":"100%"===i.containers.main.style.width&&i.containers.main.parentNode.offsetWidth>t.width&&(i.containers.main.style.width=t.width+"px")),void 0!==i.containers.list&&(t.list>0?1===t.list||-1===i.containers.main.style.width.indexOf("px")&&i.containers.main.offsetWidth<t.listWidth+t.listBreakpoint?(cr().DomUtil.removeClass(i.containers.main,"mmp-list-right"),cr().DomUtil.removeClass(i.containers.main,"mmp-list-left"),cr().DomUtil.addClass(i.containers.main,"mmp-list-below")):(cr().DomUtil.removeClass(i.containers.main,"mmp-list-below"),2===t.list?(cr().DomUtil.removeClass(i.containers.main,"mmp-list-left"),cr().DomUtil.addClass(i.containers.main,"mmp-list-right")):3===t.list&&(cr().DomUtil.removeClass(i.containers.main,"mmp-list-right"),cr().DomUtil.addClass(i.containers.main,"mmp-list-left"))):(cr().DomUtil.removeClass(i.containers.main,"mmp-list-below"),cr().DomUtil.removeClass(i.containers.main,"mmp-list-right"),cr().DomUtil.removeClass(i.containers.main,"mmp-list-left"))),i.map.invalidateSize()},this.setLayoutThrottled=cr().Util.throttle(i.setLayout,200,this),this.loadSettings=function(){return new Promise((function(t,e){Bs({type:"POST",url:mmpVars.ajaxurl,data:{action:"mmp_map_settings",type:i.type,id:i.id,marker:i.customMarkers||null,highlight:i.highlight.id||null,lang:mmpVars.language}}).then((function(n){(n=Is(n))instanceof Error?e(n):n.success||e(new Error(n.data));var o=n.data;Object.keys(i.settings).forEach((function(t){o[t]=i.settings[t]})),i.settings=o,o.callback&&"function"==typeof window[o.callback]&&window[o.callback](i),i.fire("settingsloaded",i.settings),t()})).catch((function(t){i.logError("Error loading settings ("+t.message+")"),e(t)}))}))},this.loadPanel=function(){var t=i.settings;if(i.containers.panel=document.getElementById("mmp-panel-"+i.uid),t.panel){var e=cr().DomUtil.create("div","mmp-panel");e.id="mmp-panel-"+i.uid,e.style.backgroundColor=t.panelColor,cr().DomUtil.create("div","mmp-panel-text",e).innerHTML=t.name;var n=cr().DomUtil.create("div","mmp-panel-api",e);"map"===i.type&&(t.panelEdit&&i.addApiLink(i.getApiLink("editMap",i.id),mmpL10n.api.editMap,"mmp-api-icon-edit",n),t.apiFullscreen&&t.panelFs&&i.addApiLink(i.getApiLink("fs",i.id),mmpL10n.api.fs,"mmp-api-icon-fullscreen",n),t.panelGpx&&t.gpxUrl&&i.addApiLink(i.getApiLink("gpx",i.id),mmpL10n.gpx.metaDownload,"mmp-api-icon-gpx",n),t.apiExport&&t.panelGeoJson&&i.addApiLink(i.getApiLink("geojson",i.id),mmpL10n.api.geoJson,"mmp-api-icon-geojson",n),t.apiExport&&t.panelKml&&i.addApiLink(i.getApiLink("kml",i.id),mmpL10n.api.kml,"mmp-api-icon-kml",n),t.apiExport&&t.panelGeoRss&&i.addApiLink(i.getApiLink("georss",i.id),mmpL10n.api.geoRss,"mmp-api-icon-georss",n)),i.containers.panel?i.containers.panel.parentNode.replaceChild(e,i.containers.panel):i.containers.mapWrap.insertBefore(e,i.containers.map),i.containers.panel=e,i.fire("panelloaded",i.map)}else i.containers.panel&&(i.containers.panel.remove(),i.containers.panel=null)},this.loadMap=function(){var t=i.settings;"function"==typeof i.map.remove&&i.map.remove(),i.map={};var e=cr().DomUtil.create("div","mmp-map");e.id="mmp-map-"+i.uid,e.style.height=t.height+t.heightUnit,i.containers.map=document.getElementById("mmp-map-"+i.uid),i.containers.map?i.containers.map.parentNode.replaceChild(e,i.containers.map):i.containers.mapWrap.insertBefore(e,i.containers.chartWrap),i.containers.map=e,i.map=cr().map(i.containers.map,{center:[t.lat,t.lng],zoom:t.zoom,minZoom:t.minZoom,maxZoom:t.maxZoom,zoomSnap:t.zoomStep,zoomDelta:t.zoomStep,maxBounds:Ts(t.maxBounds),maxBoundsViscosity:1,gestureHandling:t.gestureHandling,gestureHandlingOptions:{text:{touch:mmpL10n.interaction.gestureTouch,scroll:mmpL10n.interaction.gestureScroll,scrollMac:mmpL10n.interaction.gestureScrollMac},duration:1e3},dragging:t.dragging,inertia:t.inertia,inertiaDeceleration:t.inertiaDeceleration,inertiaMaxSpeed:t.inertiaMaxSpeed,keyboard:t.keyboard,keyboardPanDelta:t.keyboardPanDelta,scrollWheelZoom:t.scrollWheelZoom,doubleClickZoom:t.doubleClickZoom,touchZoom:t.touchZoom,boxzoom:t.boxzoom,bounceAtZoomLimits:t.bounceAtZoomLimits,worldCopyJump:t.worldCopyJump,attributionControl:!1,zoomControl:!1,closePopupOnClick:t.popupAutoClose}),i.map._activeTrack=0,i.fire("maploaded",i.map)},this.loadChart=function(){var t=i.settings;if("function"==typeof i.gpxChart.destroy&&i.gpxChart.destroy(),i.gpxChart={},i.containers.chartWrap=document.getElementById("mmp-chart-wrap-"+i.uid),t.gpxUrl&&t.gpxChart){var e=cr().DomUtil.create("div","mmp-gpx-chart-wrap");e.id="mmp-chart-wrap-"+i.uid,e.style.height=t.gpxChartHeight+"px",e.style.position="relative",e.style.minWidth=0;var n=cr().DomUtil.create("canvas","mmp-gpx-chart",e);n.id="mmp-gpx-chart-"+i.uid,i.containers.chartWrap?i.containers.chartWrap.parentNode.replaceChild(e,i.containers.chartWrap):i.containers.mapWrap.appendChild(e),i.containers.chartWrap=e,i.containers.chart=n,i.fire("chartloaded",i.gpxChart)}else i.containers.chartWrap&&(i.containers.chartWrap.remove(),i.containers.chartWrap=null,i.containers.chart=null)},this.loadList=function(){var t=i.settings;if(i.containers.list=document.getElementById("mmp-list-"+i.uid),"map"!==i.type&&"custom"!==i.type||!t.list)i.containers.list&&(i.containers.list.remove(),i.containers.list=null);else{var e=cr().DomUtil.create("div","mmp-list");if(e.id="mmp-list-"+i.uid,e.style.flexBasis=t.listWidth+"px",i.list.sort=t.listOrderBy,i.list.order=t.listSortOrder,t.listSearch){var n=cr().DomUtil.create("div","mmp-list-header",e),o=cr().DomUtil.create("div","mmp-list-header-left",n),r=cr().DomUtil.create("div","mmp-list-search-wrap",o),s=cr().DomUtil.create("input","mmp-list-search",r);s.id="list-search-"+i.uid,s.type="search",s.placeholder=mmpL10n.list.search;var a=cr().DomUtil.create("div","mmp-list-search-clear",r);a.style.display="none",a.addEventListener("click",(function(){var t=document.getElementById("list-search-"+i.uid);t&&(t.value=""),this.style.display="none",i.getList({page:1,term:null})}));var l=cr().DomUtil.create("div","mmp-list-header-right",n),h=cr().DomUtil.create("select","mmp-list-sort",l),c=[];t.listOrderById&&c.push("id"),t.listOrderByName&&c.push("name"),t.listOrderByAddress&&c.push("address"),t.listOrderByDistance&&c.push("distance"),t.listOrderByIcon&&c.push("icon"),t.listOrderByPublished&&c.push("publish"),t.listOrderByUpdated&&c.push("modified");for(var p=0;p<c.length;p++){var u=cr().DomUtil.create("option",null,h);u.value=c[p],c[p]===t.listOrderBy&&(u.defaultSelected=!0),u.innerHTML=mmpL10n.list[c[p]]}s.addEventListener("keyup",(function(e){this.value?a.style.display="inline-block":a.style.display="none","Enter"===e.key&&i.getList({page:1,term:this.value,fitVisible:t.listFitVisible})})),h.addEventListener("change",(function(){i.getList({page:1,sort:this.value})})),cr().DomUtil.create("i","mmp-list-order mmp-"+t.listSortOrder,l).addEventListener("click",(function(){var t=cr().DomUtil.hasClass(this,"mmp-desc")?"asc":"desc";cr().DomUtil.removeClass(this,"mmp-asc"),cr().DomUtil.removeClass(this,"mmp-desc"),cr().DomUtil.addClass(this,"mmp-"+t),i.getList({page:1,order:t})}))}if(t.listLocation&&"none"!==t.geocodingProvider){var d=cr().DomUtil.create("div","mmp-list-header",e),m=cr().DomUtil.create("div","mmp-list-header-left",d),f=cr().DomUtil.create("div","mmp-list-search-wrap",m),g=cr().DomUtil.create("input","mmp-list-location",f);g.id="list-address-"+i.uid,g.type="text",g.placeholder=mmpL10n.list.location,g.addEventListener("keyup",(function(){this.value?_.style.display="inline-block":_.style.display="none"}));var _=cr().DomUtil.create("div","mmp-list-location-clear",f);_.style.display="none",_.addEventListener("click",(function(){var t=document.getElementById("list-address-"+i.uid);t&&(cr().DomUtil.removeClass(t,"results-loading"),cr().DomUtil.removeClass(t,"results-error"),t.value=""),this.style.display="none",i.list.located||i.getList({page:1,lat:null,lng:null})}));var v=cr().DomUtil.create("div","mmp-list-header-right",d),y=cr().DomUtil.create("select","mmp-list-radius",v),b=[0,5,10,15,20,25,50,100,200,500];for(p=0;p<b.length;p++){var x=cr().DomUtil.create("option",null,y);x.value=b[p],b[p]<=0?x.innerHTML=mmpL10n.list.noLimit:"imperial"===t.listDistanceUnit?x.innerHTML=b[p]+" mi":"metric-imperial"===t.listDistanceUnit?x.innerHTML=b[p]+" km ("+(b[p]/1.609344).toFixed(t.listDistancePrecision)+" mi)":"imperial-metric"===t.listDistanceUnit?x.innerHTML=b[p]+" mi ("+(1.609344*b[p]).toFixed(t.listDistancePrecision)+" km)":x.innerHTML=b[p]+" km"}y.addEventListener("change",(function(){i.getList({page:1,radius:y.value})}))}i.containers.listBody=cr().DomUtil.create("div","mmp-list-body",e),i.containers.listFooter=cr().DomUtil.create("div","mmp-list-footer",e),i.containers.list?i.containers.list.parentNode.replaceChild(e,i.containers.list):i.containers.main.appendChild(e),i.containers.list=e,t.listLocation&&"none"!==t.geocodingProvider&&(i.list.geocoding=new Fs({selector:"#list-address-"+i.uid,error:function(t){i.showMapModal(mmpL10n.list.locationError,t)},selected:function(e,n){void 0!==i.controls.locate&&i.controls.locate.stop(),i.getList({page:1,lat:e,lng:n,zoom:t.listGeocodingZoom})},provider:i.settings.geocodingProvider,typingDelay:i.settings.geocodingTypingDelay,minChars:i.settings.geocodingMinChars}),i.list.geocoding.init())}},this.loadBasemaps=function(){var t=i.settings;Object.keys(i.basemaps).forEach((function(t){i.map.removeLayer(i.basemaps[t])})),i.basemaps={},i.minimaps={},!t.basemaps.length&&t.fallbackBasemap&&(t.basemaps=[t.fallbackBasemap]);for(var e=0;e<t.basemaps.length;e++){var n=t.basemaps[e];if(1===n.type){if(n.options.bounds&&"string"==typeof n.options.bounds){var o=Ts(n.options.bounds);n.options.rasterTiles?n.options.bounds=[i.map.unproject(cr().point(o[0][1],o[0][0]),n.options.maxNativeZoom),i.map.unproject(cr().point(o[1][1],o[1][0]),n.options.maxNativeZoom)]:n.options.bounds=o}n.options.minZoom=t.minZoom,n.options.maxZoom=t.maxZoom,n.options.errorTileUrl=void 0===n.options.errorTiles&&t.errorTiles||n.options.errorTiles?t.errorTileUrl:null,n.options.edgeBufferTiles=t.basemapEdgeBufferTiles,n.wms?(i.basemaps[n.name]=cr().tileLayer.wms(n.url,n.options),i.minimaps[n.name]=cr().tileLayer.wms(n.url,n.options)):(i.basemaps[n.name]=cr().tileLayer(n.url,n.options),i.minimaps[n.name]=cr().tileLayer(n.url,n.options))}else if(2===n.type&&t.googleApiKey)n.options.styles=t.basemapGoogleStyles,n.options.minZoom=t.minZoom,n.options.maxZoom=t.maxZoom,n.options.edgeBufferTiles=0,i.basemaps[n.name]=new(cr().gridLayer.googleMutant)(n.options),i.minimaps[n.name]=new(cr().gridLayer.googleMutant)(n.options);else if(3===n.type&&t.bingApiKey)n.options.bingMapsKey=t.bingApiKey,n.options.culture=t.basemapBingCulture,n.options.minZoom=t.minZoom,n.options.maxZoom=t.maxZoom,n.options.errorTileUrl=t.errorTiles?t.errorTileUrl:null,n.options.edgeBufferTiles=t.basemapEdgeBufferTiles,i.basemaps[n.name]=cr().tileLayer.bing(n.options),i.minimaps[n.name]=cr().tileLayer.bing(n.options);else if(4===n.type&&(t.hereApiKey||t.hereAppId&&t.hereAppCode))n.options.apiKey=t.hereApiKey,n.options.appId=t.hereAppId,n.options.appCode=t.hereAppCode,n.options.minZoom=t.minZoom,n.options.maxZoom=t.maxZoom,n.options.errorTileUrl=t.errorTiles?t.errorTileUrl:null,n.options.edgeBufferTiles=t.basemapEdgeBufferTiles,i.basemaps[n.name]=cr().tileLayer.here(n.options),i.minimaps[n.name]=cr().tileLayer.here(n.options);else if(5===n.type&&t.tomApiKey)n.options.apiKey=t.tomApiKey,n.options.minZoom=t.minZoom,n.options.maxZoom=t.maxZoom,n.options.errorTileUrl=t.errorTiles?t.errorTileUrl:null,n.options.edgeBufferTiles=t.basemapEdgeBufferTiles,i.basemaps[n.name]=cr().tileLayer.tomTom(n.options),i.minimaps[n.name]=cr().tileLayer.tomTom(n.options);else{if(6!==n.type)continue;n.options.minZoom=t.minZoom,n.options.maxZoom=t.maxZoom,n.options.errorTileUrl=void 0===n.options.errorTiles&&t.errorTiles||n.options.errorTiles?t.errorTileUrl:null,n.options.edgeBufferTiles=t.basemapEdgeBufferTiles,n.labels?(i.basemaps[n.name]=cr().layerGroup([ys(n.key,n.options),ys(n.labels,n.options)]),i.minimaps[n.name]=cr().layerGroup([ys(n.key,n.options),ys(n.labels,n.options)])):(i.basemaps[n.name]=ys(n.key,n.options),i.minimaps[n.name]=ys(n.key,n.options))}i.basemaps[n.name].mmp_id=n.id,i.minimaps[n.name].mmp_id=n.id}var r=Object.keys(i.basemaps);if(r.length){var s=r[0];for(e=0;e<r.length;e++){var a=r[e];if(i.basemaps[a].mmp_id===t.basemapDefault){s=a;break}}i.basemaps[s].addTo(i.map)}i.fire("basemapsloaded",i.basemaps)},this.loadOverlays=function(){var t=i.settings;Object.keys(i.overlays).forEach((function(t){i.map.removeLayer(i.overlays[t])})),i.overlays={};for(var e=0;e<t.overlays.length;e++){var n=t.overlays[e];if(n.options.bounds&&"string"==typeof n.options.bounds){var o=Ts(n.options.bounds);n.options.rasterTiles?n.options.bounds=[i.map.unproject(cr().point(o[0][1],o[0][0]),n.options.maxNativeZoom),i.map.unproject(cr().point(o[1][1],o[1][0]),n.options.maxNativeZoom)]:n.options.bounds=o}n.options.minZoom=t.minZoom,n.options.maxZoom=t.maxZoom,n.options.errorTileUrl=void 0===n.options.errorTiles||n.options.errorTiles?t.errorTileUrl:null,n.options.edgeBufferTiles=t.basemapEdgeBufferTiles,n.wms?i.overlays[n.name]=cr().tileLayer.wms(n.url,n.options):i.overlays[n.name]=cr().tileLayer(n.url,n.options),-1!==t.overlaysActive.indexOf(n.id)&&i.overlays[n.name].addTo(i.map)}i.fire("overlaysloaded",i.overlays)},this.loadResources=function(){var t=i.settings;return i.groups={},i.groups[i.id]={active:!0},Object.keys(t.filtersDetails).forEach((function(e){i.groups[e]={active:t.filtersDetails[e].active}})),Promise.all([i.getMarkers(),i.getGeoJson(),i.getGpx()])},this.getMarkers=function(){var t=i.settings,e=[];return t.filtersAllMarkers||(e.push(i.id),Object.keys(t.filtersDetails).forEach((function(t){e.push(t)}))),new Promise((function(n,o){Bs({type:"POST",url:mmpVars.ajaxurl,data:{action:"mmp_map_markers",type:i.type,id:e,custom:i.customMarkers,lang:mmpVars.language}}).then((function(e){(e=Is(e))instanceof Error?o(e):e.success||o(new Error(e.data)),i.addMarkers(e.data),"map"!==i.type&&"custom"!==i.type||!t.list?(i.drawMarkers(),n()):i.getList({highlight:i.highlight.id||!1}).then((function(){n()})).catch((function(t){o(t)}))})).catch((function(t){i.logError("Error loading markers ("+t.message+")"),o(t)}))}))},this.addMarkers=function(t){var e=i.settings;i.markers={},i.tooltip={direction:e.tooltipDirection,permanent:e.tooltipPermanent,sticky:e.tooltipSticky,opacity:e.tooltipOpacity,className:"mmp-marker-tooltip"},i.popup={minWidth:e.popupMinWidth,maxWidth:e.popupMaxWidth,maxHeight:e.popupMaxHeight,autoPan:!e.popupCenterOnMap,closeButton:e.popupCloseButton,autoClose:e.popupAutoClose},cr().geoJSON(t,{pointToLayer:function(t,i){return cr().marker(i,{icon:cr().icon({iconUrl:t.properties.icon?mmpVars.iconsUrl+t.properties.icon:mmpVars.pluginUrl+"images/leaflet/marker.png",iconSize:e.iconSize,iconAnchor:e.iconAnchor,popupAnchor:e.popupAnchor,className:"mmp-marker-icon mmp-marker-icon-"+t.properties.id}),opacity:e.markerOpacity})},onEachFeature:function(t,n){var o=t.properties;o.name&&(i.tooltips[o.id]=o.name,!e.tooltip||!e.tooltipPermanent&&cr().Browser.mobile||n.bindTooltip(i.tooltips[o.id],i.tooltip)),o.link?(n.on("click",(function(){i.openLink(this.feature.properties.link,this.feature.properties.blank)})),n.on("keypress",(function(t){"Enter"===t.key&&i.openLink(this.feature.properties.link,this.feature.properties.blank)}))):(!1!==o.popup||o.address&&e.popupAddress||e.popupCoordinates||e.popupDirections)&&n.bindPopup("",i.popup),n.on("popupopen",i.openPopupHandler),e.popupOpenOnHover?n.on("mouseover",i.openOnHoverHandler):n.off("mouseover",i.openOnHoverHandler),i.markers[o.id]=n}}),i.fire("markersloaded",i.markers)},this.drawMarkers=function(t){t=t||i.getActiveMarkers();var e=i.settings;"function"==typeof i.markerGroup.remove&&i.markerGroup.remove(),i.markerGroup={},e.clustering?i.markerGroup=cr().markerClusterGroup({showCoverageOnHover:e.showCoverageOnHover,disableClusteringAtZoom:e.disableClusteringAtZoom||null,maxClusterRadius:e.maxClusterRadius,singleMarkerMode:e.singleMarkerMode,spiderfyDistanceMultiplier:e.spiderfyDistanceMultiplier,spiderfyOnEveryZoom:e.spiderfyOnEveryZoom,chunkedLoading:!1}):i.markerGroup=cr().featureGroup(),i.markerGroup.addTo(i.map);for(var n=0;n<t.length;n++)i.markerGroup.hasLayer(t[n])||i.markerGroup.addLayer(t[n])},this.getGeoJson=function(){var t=[i.id];return!i.settings.filtersAllMarkers&&i.settings.filtersGeoJson&&Object.keys(i.settings.filtersDetails).forEach((function(e){t.push(e)})),new Promise((function(e,n){Bs({type:"POST",url:mmpVars.ajaxurl,data:{action:"mmp_map_geojson",type:i.type,id:t,lang:mmpVars.language}}).then((function(t){(t=Is(t))instanceof Error?n(t):t.success||n(new Error(t.data)),i.addGeoJson(t.data),e()})).catch((function(t){i.logError("Error loading GeoJSON ("+t.message+")"),n(t)}))}))},this.parseGeoJson=function(t){return cr().geoJSON(t,{pointToLayer:function(t,e){if(t.properties.radius)return cr().circle(e,t.properties.radius)},style:function(t){if(!t.properties)return{};var e={};return Object.keys(t.properties).forEach((function(i){switch(i){case"weight":e[i]=parseInt(t.properties[i]);break;case"opacity":case"fillOpacity":e[i]=parseFloat(t.properties[i]);break;default:e[i]=t.properties[i]}})),e},onEachFeature:function(t,e){e.options.popup&&e.bindPopup("",i.popup),e.on("popupopen",i.openPopupHandler)}})},this.addGeoJson=function(t){"function"==typeof i.geoJsonGroup.remove&&i.geoJsonGroup.remove(),i.geoJson={},i.geoJsonGroup={},i.geoJson[i.id]=cr().geoJSON(),t&&(Object.keys(t).forEach((function(e){void 0===t[e].features?i.geoJson[e]=cr().geoJSON():i.geoJson[e]=i.parseGeoJson(t[e])})),i.drawGeoJson(),i.fire("geojsonloaded",i.geoJson))},this.drawGeoJson=function(){"function"==typeof i.geoJsonGroup.remove&&i.geoJsonGroup.remove(),i.geoJsonGroup=cr().featureGroup(),i.geoJsonGroup.addTo(i.map),Object.keys(i.groups).forEach((function(t){i.groups[t].active&&void 0!==i.geoJson[t]&&i.geoJsonGroup.addLayer(i.geoJson[t])}))},this.getPopups=function(t){return new Promise((function(e,n){Bs({type:"POST",url:mmpVars.ajaxurl,data:{action:"mmp_marker_popups",id:t,lang:mmpVars.language}}).then((function(t){(t=Is(t))instanceof Error?n(t):t.success||n(new Error(t.data));for(var o=t.data,r=0;r<o.length;r++){var s=o[r];i.markers[s.id].feature.properties.popup=s.popup}e()})).catch((function(t){i.logError("Error retrieving popups ("+t.message+")"),n(t)}))}))},this.getList=function(t){t=t||{};var e=i.settings;if(("map"===i.type||"custom"===i.type)&&e.list){for(var n=["page","term","sort","order","lat","lng","zoom","radius","fitVisible","highlight"],o=0;o<n.length;o++){var r=n[o];void 0!==t[r]&&(i.list[r]=t[r])}var s=[];return"map"===i.type?e.filtersAllMarkers||Object.keys(i.groups).forEach((function(t){"and"===e.filtersLogic&&t===i.id||i.groups[t].active&&s.push(t)})):s=i.customMarkers,new Promise((function(t,n){Bs({type:"POST",url:mmpVars.ajaxurl,data:{action:"mmp_map_marker_list",type:i.type,id:s,logic:e.filtersLogic,page:i.list.page,term:i.list.term||"",sort:i.list.sort,order:i.list.order,lat:i.list.lat||"",lng:i.list.lng||"",radius:"imperial"===e.listDistanceUnit||"imperial-metric"===e.listDistanceUnit?1609.344*i.list.radius:1e3*i.list.radius,lang:mmpVars.language}}).then((function(e){(e=Is(e))instanceof Error?n(e):e.success||n(new Error(e.data));for(var o=e.data,r=[],s=0;s<o.length;s++)void 0!==i.markers[o[s]]&&r.push(i.markers[o[s]]);i.updateMarkerAndCircle(),i.showList(r),i.drawMarkers(r),i.list.fitVisible&&(i.fitVisibleMarkers(),i.list.fitVisble=!1),t()})).catch((function(t){i.logError("Error retrieving marker list ("+t.message+")"),n(t)}))}))}},this.showList=function(t){var e=i.settings,n=t.length>e.listLimit?e.listLimit:t.length,o=Math.ceil(t.length/e.listLimit);if(i.list.highlight){var r=t.findIndex((function(t){return t.feature.properties.id==i.list.highlight}));-1!==r?i.list.page=Math.ceil((r+1)/e.listLimit):i.list.highlight=null}i.list.page=i.list.page>o?o:i.list.page,i.list.page<=0&&(i.list.page=1);for(var s=i.list.page===o?t.length:n*i.list.page,a=[],l=(i.list.page-1)*n;l<s;l++)null===t[l].feature.properties.popup&&a.push(t[l].feature.properties.id);a.length?i.getPopups(a).then((function(){i.renderList(t)})).catch((function(){})):i.renderList(t)},this.renderList=function(t){var e=i.settings;i.containers.listBody.innerHTML="";var n=t.length>e.listLimit?e.listLimit:t.length,o=Math.ceil(t.length/e.listLimit);i.list.page=i.list.page>o?o:i.list.page,i.list.page<=0&&(i.list.page=1);for(var r=i.list.page===o?t.length:n*i.list.page,s=(i.list.page-1)*n;s<r;s++){var a=cr().DomUtil.create("div","mmp-list-row",i.containers.listBody);if(a.id="mmp-list-row-"+t[s].feature.properties.id,e.listIcon){var l=cr().DomUtil.create("div","mmp-list-row-icon",a),h=cr().DomUtil.create("div","mmp-list-icon",l),c=cr().DomUtil.create("img",null,h);t[s].feature.properties.icon?c.src=mmpVars.iconsUrl+t[s].feature.properties.icon:c.src=mmpVars.pluginUrl+"images/leaflet/marker.png",c.style.width=e.iconSize[0]+"px",c.style.height=e.iconSize[1]+"px"}var p=cr().DomUtil.create("div","mmp-list-row-info",a),u=cr().DomUtil.create("div","mmp-list-row-header",p);if(e.listName||e.listDate)var d=cr().DomUtil.create("div","mmp-list-row-header-left",u);if(e.listName){var m=cr().DomUtil.create("div","mmp-list-name",d);m.innerHTML=t[s].feature.properties.name,"none"!==e.listAction&&(m.tabIndex=0,function(n){var o=i.containers.main.getBoundingClientRect().top<0,r="setviewzoom"===e.listAction||"popupzoom"===e.listAction,s="popup"===e.listAction||"popupzoom"===e.listAction;cr().DomEvent.on(m,"click",(function(){i.highlightMarker(t[n],o,r,s)})),cr().DomEvent.on(m,"keypress",(function(e){"Enter"===e.key&&i.highlightMarker(t[n],o,r,s)}))}(s))}if(e.listDate){var f=cr().DomUtil.create("div","mmp-list-date",d),g=e.listDatePrefix?mmpL10n.list.publish+": ":"",_=e.listDatePrefix?mmpL10n.list.modified+": ":"";"published"===e.listDateType?"date"===e.listDateFormat?f.innerHTML=g+t[s].feature.properties.published_local_date:"time"===e.listDateFormat?f.innerHTML=g+t[s].feature.properties.published_local_time:f.innerHTML=g+t[s].feature.properties.published_local_date+" "+t[s].feature.properties.published_local_time:"updated"===e.listDateType?"date"===e.listDateFormat?f.innerHTML=_+t[s].feature.properties.modified_local_date:"time"===e.listDateFormat?f.innerHTML=_+t[s].feature.properties.modified_local_time:f.innerHTML=_+t[s].feature.properties.modified_local_date+" "+t[s].feature.properties.modified_local_time:"date"===e.listDateFormat?f.innerHTML=g+t[s].feature.properties.published_local_date+"<br />"+_+t[s].feature.properties.modified_local_date:"time"===e.listDateFormat?f.innerHTML=g+t[s].feature.properties.published_local_time+"<br />"+_+t[s].feature.properties.modified_local_time:f.innerHTML=g+t[s].feature.properties.published_local_date+" "+t[s].feature.properties.published_local_time+"<br />"+_+t[s].feature.properties.modified_local_date+" "+t[s].feature.properties.modified_local_time}var v=cr().DomUtil.create("div","mmp-list-row-header-right",u),y=cr().DomUtil.create("div","mmp-list-api",v);if(t[s].feature.properties.edit&&i.addApiLink(i.getApiLink("editMarker",t[s].feature.properties.id),mmpL10n.api.editMarker,"mmp-api-icon-edit",y),e.listDir){var b=i.getDirectionsLink(e.directionsProvider,t[s].getLatLng().lat,t[s].getLatLng().lng,t[s].feature.properties.address);i.addApiLink(b,mmpL10n.api.dir,"mmp-api-icon-directions",y)}e.apiFullscreen&&e.listFs&&i.addApiLink(i.getApiLink("fs",i.id,{marker:t[s].feature.properties.id}),mmpL10n.api.fs,"mmp-api-icon-fullscreen",y),e.listShare&&i.addShareLink(t[s].feature.properties.id,y);var x=cr().DomUtil.create("div","mmp-list-row-body",p);if(e.listPopup&&t[s].feature.properties.popup)cr().DomUtil.create("div","mmp-list-popup",x).innerHTML=t[s].feature.properties.popup;var k=cr().DomUtil.create("div","mmp-list-row-footer",p);if(e.listAddress&&t[s].feature.properties.address)cr().DomUtil.create("span","mmp-list-address",k).innerHTML=t[s].feature.properties.address;if(e.listCoordinates){var L=cr().DomUtil.create("span","mmp-list-coordinates",k);t[s].feature.properties.address&&e.listAddress?L.innerHTML+=" ("+t[s].getLatLng().lat+", "+t[s].getLatLng().lng+")":L.innerHTML+=t[s].getLatLng().lat+", "+t[s].getLatLng().lng}if(e.listDistance&&null!==i.list.lat&&null!==i.list.lng){var w=cr().latLng(i.list.lat,i.list.lng),M=t[s].getLatLng(),C=cr().latLng(w).distanceTo(M),P=cr().DomUtil.create("div","mmp-list-distance",y);"imperial"===e.listDistanceUnit?P.innerHTML=(C/1609.344).toFixed(e.listDistancePrecision)+" mi":"metric-imperial"===e.listDistanceUnit?P.innerHTML=(C/1e3).toFixed(e.listDistancePrecision)+" km ("+(C/1609.344).toFixed(e.listDistancePrecision)+" mi)":"imperial-metric"===e.listDistanceUnit?P.innerHTML=(C/1609.344).toFixed(e.listDistancePrecision)+" mi ("+(C/1e3).toFixed(e.listDistancePrecision)+" km)":P.innerHTML=(C/1e3).toFixed(e.listDistancePrecision)+" km"}}if(i.list.highlight){var S=document.getElementById("mmp-list-row-"+i.list.highlight);S&&(i.containers.listBody.scrollTop=S.offsetTop-i.containers.listBody.offsetTop),i.list.highlight=null}i.containers.listFooter.innerHTML="";var T=cr().DomUtil.create("div","mmp-list-count",i.containers.listFooter);if(0===t.length?T.innerHTML=mmpL10n.list.noResults:1===t.length?T.innerHTML=mmpL10n.list.oneResult:T.innerHTML=t.length+" "+mmpL10n.list.results,t.length>e.listLimit){var A=cr().DomUtil.create("div","mmp-list-nav",i.containers.listFooter),D=cr().DomUtil.create("button",null,A);D.innerHTML="«",D.addEventListener("click",(function(){i.list.page=1,i.showList(t)}));var E=cr().DomUtil.create("button",null,A);E.innerHTML="‹",E.addEventListener("click",(function(){i.list.page=1===i.list.page?1:i.list.page-1,i.showList(t)}));var O=cr().DomUtil.create("button",null,A);O.innerHTML="›",O.addEventListener("click",(function(){i.list.page=i.list.page===o?o:i.list.page+1,i.showList(t)}));var I=cr().DomUtil.create("button",null,A);I.innerHTML="»",I.addEventListener("click",(function(){i.list.page=o,i.showList(t)}));var B=cr().DomUtil.create("div","mmp-list-page",i.containers.listFooter),R=cr().DomUtil.create("input",null,B);R.type="search",R.value=i.list.page,B.appendChild(document.createTextNode(" / "+o)),B.addEventListener("keyup",(function(e){"Enter"===e.key&&(i.list.page=Math.abs(parseInt(R.value)),i.showList(t))}))}i.fire("listupdated",i.map)},this.updateMarkerAndCircle=function(){var t=i.settings;if("function"==typeof i.list.marker.remove&&(i.list.marker.remove(),i.list.marker={}),"function"==typeof i.list.circle.remove&&(i.list.circle.remove(),i.list.circle={}),null!==i.list.lat&&null!==i.list.lng){var e=cr().latLng([i.list.lat,i.list.lng]);if(t.listGeocodingShowMarker&&(i.list.marker=cr().marker(e,{icon:cr().icon({iconUrl:t.listGeocodingMarkerIcon?mmpVars.iconsUrl+t.listGeocodingMarkerIcon:mmpVars.pluginUrl+"images/leaflet/pin.png",iconSize:t.iconSize,iconAnchor:t.iconAnchor,popupAnchor:t.popupAnchor})}).addTo(i.map)),i.list.radius<=0)i.list.zoom?i.map.setView(e,i.list.zoom):i.map.panTo(e);else{var n=i.list.radius;"imperial"===t.listDistanceUnit||"imperial-metric"===t.listDistanceUnit?n*=1609.344:n*=1e3,t.listGeocodingDrawCircle&&(i.list.circle=cr().circle(e,{interactive:!1,radius:n,stroke:t.listGeocodingStroke,color:t.listGeocodingColor,weight:t.listGeocodingWeight,fill:t.listGeocodingFill,fillColor:t.listGeocodingFillColor,fillOpacity:t.listGeocodingFillOpacity}).addTo(i.map)),i.map.fitBounds(e.toBounds(2*n))}i.list.zoom=null}},this.loadControls=function(){var t=i.settings;if(void 0!==i.controls.locate&&i.controls.locate.stop(),Object.keys(i.controls).forEach((function(t){i.controls[t].remove()})),i.controls={},i.controls.attribution=cr().control.attribution({position:t.attributionPosition,prefix:t.attributionPrefix}),i.controls.attribution.mmpIndex=t.attributionIndex,i.controls.attribution._esriAttributionAdded=!0,"hidden"!==t.geocodingControlPosition&&"none"!==t.geocodingProvider){var e=null;t.geocodingControlShowMarker&&(e=cr().icon({iconUrl:t.geocodingControlMarkerIcon?mmpVars.iconsUrl+t.geocodingControlMarkerIcon:mmpVars.pluginUrl+"images/leaflet/pin.png",iconSize:t.iconSize,iconAnchor:t.iconAnchor,popupAnchor:t.popupAnchor})),i.controls.geocoding=cr().control.mmpGeocoding({mmp:i,collapsed:"collapsed"===t.geocodingControlCollapsed||"collapsed-mobile"===t.geocodingControlCollapsed&&cr().Browser.mobile,position:t.geocodingControlPosition,provider:t.geocodingProvider,typingDelay:t.geocodingTypingDelay,minChars:t.geocodingMinChars,icon:e,titleText:mmpL10n.control.geocodingTitle,errorText:mmpL10n.control.geocodingError}),i.controls.geocoding.mmpIndex=t.geocodingControlIndex}if("hidden"!==t.zoomControlPosition&&(i.controls.zoom=cr().control.zoom({position:t.zoomControlPosition,zoomInTitle:mmpL10n.control.zoomIn,zoomOutTitle:mmpL10n.control.zoomOut}),i.controls.zoom.mmpIndex=t.zoomControlIndex),"hidden"!==t.fullscreenPosition&&(i.controls.fullscreen=cr().control.fullscreen({position:t.fullscreenPosition,title:{false:mmpL10n.control.fullscreenFalse,true:mmpL10n.control.fullscreenTrue}}),i.controls.fullscreen.mmpIndex=t.fullscreenIndex),"hidden"!==t.resetPosition&&(i.controls.reset=cr().control.resetView({position:t.resetPosition,onDemand:t.resetOnDemand,title:mmpL10n.control.reset}),i.controls.reset.mmpIndex=t.resetIndex),"hidden"!==t.locatePosition&&(i.controls.locate=cr().control.locate({locateOptions:{enableHighAccuracy:!0},position:t.locatePosition,drawCircle:t.locateDrawCircle,drawMarker:t.locateDrawMarker,setView:t.locateSetView,keepCurrentZoomLevel:t.locateKeepCurrentZoomLevel,clickBehavior:{inView:t.locateClickBehaviorInView,outOfView:t.locateClickBehaviorOutOfView},icon:"icon-pin",iconLoading:"icon-spinner",metric:t.locateMetric,showPopup:t.locateShowPopup,strings:{title:mmpL10n.control.locateTitle,metersUnit:mmpL10n.control.locateMetersUnit,feetUnit:mmpL10n.control.locateFeetUnit,popup:mmpL10n.control.locatePopup,outsideMapBoundsMsg:mmpL10n.control.locateOutsideMapBoundsMsg},onLocationError:function(t){var e=mmpL10n.control.locateErrorUnknown;1===t.code?e=mmpL10n.control.locateErrorDenied:2===t.code?e=mmpL10n.control.locateErrorUnavailable:3===t.code&&(e=mmpL10n.control.locateErrorTimeout),i.showMapModal(mmpL10n.control.locateError,e)},onLocationOutsideMapBounds:function(t){t.stop(),i.showMapModal(mmpL10n.control.locateError,t.options.strings.outsideMapBoundsMsg)}}),i.controls.locate.mmpIndex=t.locateIndex),"hidden"!==t.measurePosition&&(i.controls.measure=cr().control.polylineMeasure({position:t.measurePosition,unit:"imperial"===t.measureUnit?"landmiles":"metres",showBearings:t.measureShowBearings,distanceShowSameUnit:!1,clearMeasurementsOnStop:t.measureClearMeasurementsOnStop,showClearControl:t.measureShowClearControl,showUnitControl:t.measureShowUnitControl,measureControlTitleOn:mmpL10n.control.measureOn,measureControlTitleOff:mmpL10n.control.measureOff,bearingTextIn:mmpL10n.control.measureIn,bearingTextOut:mmpL10n.control.measureOut,clearControlTitle:mmpL10n.control.measureClear,unitControlTitle:{text:mmpL10n.control.measureChangeUnits,metres:mmpL10n.control.measureMeters,landmiles:mmpL10n.control.measureMiles,nauticalmiles:mmpL10n.control.measureNauticalMiles},tooltipTextFinish:mmpL10n.control.measureFinish+"<br />",tooltipTextDelete:mmpL10n.control.measureDelete,tooltipTextMove:mmpL10n.control.measureMove+"<br />",tooltipTextResume:"<br />"+mmpL10n.control.measureResume,tooltipTextAdd:mmpL10n.control.measureAdd}),i.controls.measure.mmpIndex=t.measureIndex),"hidden"!==t.scalePosition&&(i.controls.scale=cr().control.scale({position:t.scalePosition,maxWidth:t.scaleMaxWidth,metric:t.scaleMetric,imperial:t.scaleImperial}),i.controls.scale.mmpIndex=t.scaleIndex),"hidden"!==t.layersPosition&&(Object.keys(i.basemaps).length>1||Object.keys(i.overlays).length)&&(i.controls.layers=cr().control.layers(null,null,{position:t.layersPosition,collapsed:"collapsed"===t.layersCollapsed||"collapsed-mobile"===t.layersCollapsed&&cr().Browser.mobile}),Object.keys(i.basemaps).forEach((function(t){i.controls.layers.addBaseLayer(i.basemaps[t],t)})),Object.keys(i.overlays).forEach((function(t){i.controls.layers.addOverlay(i.overlays[t],t)})),i.controls.layers.mmpIndex=t.layersIndex),"hidden"!==t.filtersPosition&&"map"===i.type&&Object.keys(t.filtersDetails).length&&!t.filtersAllMarkers&&(i.controls.filters=cr().control.filters({mmp:i,position:t.filtersPosition,collapsed:"collapsed"===t.filtersCollapsed||"collapsed-mobile"===t.filtersCollapsed&&cr().Browser.mobile,buttons:t.filtersButtons,allText:mmpL10n.control.filtersAll,noneText:mmpL10n.control.filtersNone}),i.controls.filters.mmpIndex=t.filtersIndex),"hidden"!==t.gpxControlPosition&&void 0!==i.gpx.tracks&&i.gpx.tracks.length>1&&(i.controls.gpx=cr().control.gpx({mmp:i,collapsed:"collapsed"===t.gpxControlCollapsed||"collapsed-mobile"===t.gpxControlCollapsed&&cr().Browser.mobile,position:t.gpxControlPosition}),i.controls.gpx.mmpIndex=t.gpxControlIndex),"hidden"!==t.minimapPosition&&Object.keys(i.minimaps).length){var n=cr().tileLayer("");Object.keys(i.basemaps).forEach((function(t){i.map.hasLayer(i.basemaps[t])&&(n=i.minimaps[t])})),i.controls.minimap=new(cr().Control.MiniMap)(n,{position:t.minimapPosition,width:t.minimapWidth,height:t.minimapHeight,collapsedWidth:t.minimapCollapsedWidth,collapsedHeight:t.minimapCollapsedHeight,zoomLevelOffset:t.minimapZoomLevelOffset,zoomLevelFixed:t.minimapZoomLevelFixed||null,toggleDisplay:!0,autoToggleDisplay:!1,minimized:"collapsed"===t.minimapMinimized||"collapsed-mobile"===t.minimapMinimized&&cr().Browser.mobile,strings:{hideText:mmpL10n.control.minimapHideText,showText:mmpL10n.control.minimapShowText},mapOptions:{attributionControl:!1}}),i.controls.minimap.mmpIndex=t.minimapIndex}var o=[];Object.keys(i.controls).forEach((function(t){o.push(i.controls[t])})),o.sort((function(t,e){return t.mmpIndex-e.mmpIndex}));for(var r=0;r<o.length;r++)o[r].addTo(i.map);Object.keys(i.basemaps).forEach((function(t){var e=i.basemaps[t];i.map.hasLayer(e)&&(e instanceof cr().TileLayer.HERE?e._findCopyrightBBox():e instanceof cr().TileLayer.TomTom?e._addAttribution():e instanceof vs&&Qr._updateMapAttribution({target:i.map}))})),t.attributionCondensed&&(cr().DomUtil.removeClass(i.controls.attribution.getContainer(),"leaflet-control-attribution"),cr().DomUtil.addClass(i.controls.attribution.getContainer(),"mmp-control-attribution")),void 0!==i.controls.minimap?i.map.on("baselayerchange",i.updateMinimapHandler):i.map.off("baselayerchange",i.updateMinimapHandler),void 0!==i.controls.locate?(i.map.on("locationfound",i.updateLocationHandler),i.map.on("locatedeactivate",i.locateDeactivateHandler),!i.settings.locateAutostart||i.highlight.id||i.fitMarkers||i.controls.locate.start()):(i.map.off("locationfound",i.updateLocationHandler),i.map.off("locatedeactivate",i.locateDeactivateHandler)),i.fire("controlsloaded",i.controls)},this.getGpx=function(){var t=i.settings;return t.gpxUrl?new Promise((function(n){Bs({type:"GET",url:t.gpxUrl}).then((function(t){if(i.gpx=new e,i.gpx.parse(t),!i.gpx.tracks.length){for(var o=0;o<i.gpx.routes.length;o++){var r=i.gpx.routes[o];r.segments=[{points:r.points,extensions:r.extensions,time:r.time,distance:r.distance,elevation:r.elevation}],i.gpx.tracks.push(r)}i.gpx.routes=[]}i.addGpx(),n()})).catch((function(t){i.logError("Error loading GPX ("+t.message+")"),i.showMapModal(mmpL10n.gpx.loadingError,mmpL10n.gpx.loadingErrorMsg),n()}))})):Promise.resolve()},this.addGpx=function(){var t=i.settings;if(void 0!==i.gpxGroup&&"function"==typeof i.gpxGroup.remove&&i.gpxGroup.remove(),i.gpxGroup=cr().featureGroup(),i.gpxTracks={},i.map._activeTrack=0,void 0!==i.gpx.tracks&&i.gpx.tracks.length){for(var e=[],n=0;n<i.gpx.tracks.length;n++)for(var o=i.gpx.tracks[n],r=0;r<o.segments.length;r++){var s=o.segments[r];e[n]=cr().polyline([],{interactive:!0,smoothFactor:t.gpxTrackSmoothFactor,color:o.extensions.color||s.extensions.color||t.gpxTrackColor,weight:parseInt(o.extensions.weight||s.extensions.weight||t.gpxTrackWeight),opacity:parseFloat(o.extensions.opacity||s.extensions.opacity||t.gpxTrackOpacity)});for(var a=0;a<s.points.length;a++){var l=s.points[a].lat,h=s.points[a].lon;e[n].addLatLng([l,h])}e[n].addTo(i.gpxGroup)}i.gpxTracks=e}i.setTrackIcons(),i.setIntervalMarkers(),i.setTrackMeta(),i.setWaypoints(),i.gpxGroup.addTo(i.map),i.fire("gpxloaded",i.gpxTracks),i.loadChart(),i.addElevationChart()},this.getGpxName=function(t){return!(void 0===i.gpx.tracks[t]||!i.gpx.tracks[t].name)&&i.gpx.tracks[t].name},this.getGpxStartTime=function(t){return!(void 0===i.gpx.tracks[t]||!i.gpx.tracks[t].time.start)&&new Date(i.gpx.tracks[t].time.start).toUTCString()},this.getGpxEndTime=function(t){return!(void 0===i.gpx.tracks[t]||!i.gpx.tracks[t].time.end)&&new Date(i.gpx.tracks[t].time.end).toUTCString()},this.getGpxTimeTotal=function(t,e){return!(void 0===i.gpx.tracks[t]||!i.gpx.tracks[t].time.total)&&Ds(i.gpx.tracks[t].time.total,e)},this.getGpxTimeMoving=function(t,e){return!(void 0===i.gpx.tracks[t]||!i.gpx.tracks[t].time.moving)&&Ds(i.gpx.tracks[t].time.moving,e)},this.getGpxDistance=function(t,e){if(e=e||"metric",void 0===i.gpx.tracks[t]||!i.gpx.tracks[t].distance.total)return!1;switch(e){case"imperial":return(i.gpx.tracks[t].distance.total/1609.344).toFixed(2)+" mi";case"metric-imperial":return(i.gpx.tracks[t].distance.total/1e3).toFixed(2)+" km ("+(i.gpx.tracks[t].distance.total/1609.344).toFixed(2)+" mi)";case"imperial-metric":return(i.gpx.tracks[t].distance.total/1609.344).toFixed(2)+" mi ("+(i.gpx.tracks[t].distance.total/1e3).toFixed(2)+" km)";default:return(i.gpx.tracks[t].distance.total/1e3).toFixed(2)+" km"}},this.getGpxPace=function(t,e,n){if(e=e||"metric",void 0===i.gpx.tracks[t]||!i.gpx.tracks[t].time.moving||!i.gpx.tracks[t].distance.total)return!1;switch(e){case"imperial":return Ds(i.gpx.tracks[t].time.moving/(i.gpx.tracks[t].distance.total/1609.344),n)+"/mi";case"metric-imperial":return Ds(i.gpx.tracks[t].time.moving/(i.gpx.tracks[t].distance.total/1e3),n)+"/km ("+Ds(i.gpx.tracks[t].time.moving/(i.gpx.tracks[t].distance.total/1609.344),n)+"/mi)";case"imperial-metric":return Ds(i.gpx.tracks[t].time.moving/(i.gpx.tracks[t].distance.total/1609.344),n)+"/mi ("+Ds(i.gpx.tracks[t].time.moving/(i.gpx.tracks[t].distance.total/1e3),n)+"/km)";default:return Ds(i.gpx.tracks[t].time.moving/(i.gpx.tracks[t].distance.total/1e3),n)+"/km"}},this.getGpxHeartRate=function(t){return!(void 0===i.gpx.tracks[t]||!i.gpx.tracks[t].heartRate.avg)&&i.gpx.tracks[t].heartRate.avg.toFixed(0)+" bpm"},this.getGpxElevation=function(t,e){if(e=e||"metric",void 0===i.gpx.tracks[t]||!i.gpx.tracks[t].elevation.gain&&!i.gpx.tracks[t].elevation.loss)return!1;var n=i.gpx.tracks[t].elevation.gain-i.gpx.tracks[t].elevation.loss;switch(e){case"imperial":return"+"+(i.gpx.tracks[t].elevation.gain/.3048).toFixed(0)+" ft -"+(i.gpx.tracks[t].elevation.loss/.3048).toFixed(0)+" ft Δ "+(n/.3048).toFixed(0)+" ft";case"metric-imperial":return"+"+i.gpx.tracks[t].elevation.gain.toFixed(0)+" m -"+i.gpx.tracks[t].elevation.loss.toFixed(0)+" m Δ "+n.toFixed(0)+" m (+"+(i.gpx.tracks[t].elevation.gain/.3048).toFixed(0)+" ft -"+(i.gpx.tracks[t].elevation.loss/.3048).toFixed(0)+" ft Δ "+(n/.3048).toFixed(0)+" ft)";case"imperial-metric":return"+"+(i.gpx.tracks[t].elevation.gain/.3048).toFixed(0)+" ft -"+(i.gpx.tracks[t].elevation.loss/.3048).toFixed(0)+" ft Δ "+(n/.3048).toFixed(0)+" ft (+"+i.gpx.tracks[t].elevation.gain.toFixed(0)+" m -"+i.gpx.tracks[t].elevation.loss.toFixed(0)+" m Δ "+n.toFixed(0)+" m)";default:return"+"+i.gpx.tracks[t].elevation.gain.toFixed(0)+" m -"+i.gpx.tracks[t].elevation.loss.toFixed(0)+" m Δ "+n.toFixed(0)+" m"}},this.setTrackStyle=function(){var t=i.settings;Object.keys(i.gpxTracks).forEach((function(e){i.gpxTracks[e].setStyle({color:t.gpxTrackColor,weight:t.gpxTrackWeight,opacity:t.gpxTrackOpacity})}))},this.setTrackIcons=function(){var t=i.settings;void 0!==i.gpx.tracks&&Object.keys(i.gpx.tracks).forEach((function(e){if(void 0!==i.gpx.tracks[e].startIcon&&i.gpx.tracks[e].startIcon&&i.gpx.tracks[e].startIcon.remove(),void 0!==i.gpx.tracks[e].endIcon&&i.gpx.tracks[e].endIcon&&i.gpx.tracks[e].endIcon.remove(),t.gpxShowStartIcon&&(i.gpx.tracks[e].startIcon=cr().marker([i.gpx.tracks[e].points[0].lat,i.gpx.tracks[e].points[0].lon],{interactive:!1,icon:cr().icon({iconUrl:t.gpxStartIcon?mmpVars.iconsUrl+t.gpxStartIcon:mmpVars.pluginUrl+"images/leaflet/gpx-start.png",iconSize:t.iconSize,iconAnchor:t.iconAnchor,popupAnchor:t.popupAnchor,className:"mmp-gpx-icon mmp-gpx-icon-start"})}).addTo(i.gpxGroup)),t.gpxShowEndIcon){var n=i.gpx.tracks[e].points.length-1;i.gpx.tracks[e].endIcon=cr().marker([i.gpx.tracks[e].points[n].lat,i.gpx.tracks[e].points[n].lon],{interactive:!1,icon:cr().icon({iconUrl:t.gpxEndIcon?mmpVars.iconsUrl+t.gpxEndIcon:mmpVars.pluginUrl+"images/leaflet/gpx-end.png",iconSize:t.iconSize,iconAnchor:t.iconAnchor,popupAnchor:t.popupAnchor,className:"mmp-gpx-icon mmp-gpx-icon-end"})}).addTo(i.gpxGroup)}}))},this.setIntervalMarkers=function(){var t=i.settings;if(void 0!==i.gpx.tracks&&(Object.keys(i.gpx.tracks).forEach((function(t){if(void 0!==i.gpx.tracks[t].intervalMarkers&&i.gpx.tracks[t].intervalMarkers.length)for(var e=i.gpx.tracks[t].intervalMarkers,n=0;n<e.length;n++)e[n].remove()})),t.gpxIntervalMarkers))for(var e="imperial"===t.gpxMetaUnits||"imperial-metric"===t.gpxMetaUnits?1609.344:1e3,n=i.gpx.tracks,o=0;o<n.length;o++){n[o].intervalMarkers=[];for(var r=1,s=n[o].points,a=0;a<s.length;a++){var l=s[a];if(l.dist>=r*e){var h=cr().marker([l.lat,l.lon],{interactive:!1,icon:cr().divIcon({className:"mmp-interval-marker",html:"<span>"+r+"</span>"})}).addTo(i.map);n[o].intervalMarkers.push(h),r++}}}},this.setTrackMeta=function(){var t=i.settings;Object.keys(i.gpxTracks).forEach((function(e){if(!t.gpxMeta)return i.gpxTracks[e].closePopup(),void i.gpxTracks[e].unbindPopup();for(var n=cr().DomUtil.create("div","mmp-gpx-meta"),o=[{show:t.gpxMetaName,title:mmpL10n.gpx.metaName,value:i.getGpxName(e)},{show:t.gpxMetaStart,title:mmpL10n.gpx.metaStart,value:i.getGpxStartTime(e)},{show:t.gpxMetaEnd,title:mmpL10n.gpx.metaEnd,value:i.getGpxEndTime(e)},{show:t.gpxMetaTotal,title:mmpL10n.gpx.metaTotal,value:i.getGpxTimeTotal(e)},{show:t.gpxMetaMoving,title:mmpL10n.gpx.metaMoving,value:i.getGpxTimeMoving(e)},{show:t.gpxMetaDistance,title:mmpL10n.gpx.metaDistance,value:i.getGpxDistance(e,t.gpxMetaUnits)},{show:t.gpxMetaPace,title:mmpL10n.gpx.metaPace,value:i.getGpxPace(e,t.gpxMetaUnits)},{show:t.gpxMetaHeartRate,title:mmpL10n.gpx.metaHeartRate,value:i.getGpxHeartRate(e)},{show:t.gpxMetaElevation,title:mmpL10n.gpx.metaElevation,value:i.getGpxElevation(e,t.gpxMetaUnits)}],r=0;r<o.length;r++)!o[r].show||t.gpxMetaHideMissing&&!1===o[r].value||(!1===o[r].value&&(o[r].value="N/A"),n.innerHTML+="<strong>"+o[r].title+":</strong> "+o[r].value+"<br />");t.gpxMetaDownload&&(n.innerHTML+='<a href="'+mmpVars.baseUrl+"index.php?mapsmarkerpro=download_gpx&url="+i.settings.gpxUrl+'"><img src="'+mmpVars.pluginUrl+'images/icons/download-gpx.png" /> '+mmpL10n.gpx.metaDownload+"</a><br />"),t.gpxMetaDesc&&i.gpx.tracks[e].desc&&(n.innerHTML&&(n.innerHTML+="<br />"),n.innerHTML+=i.gpx.tracks[e].desc),void 0!==i.gpxTracks[e].getPopup()&&i.gpxTracks[e].getPopup()?i.gpxTracks[e].setPopupContent(n):i.gpxTracks[e].bindPopup(n)}))},this.setWaypoints=function(){var t,e=i.settings;for(t=0;t<i.gpxWaypoints.length;t++)i.gpxWaypoints[t].remove();if(i.gpxWaypoints=[],e.gpxWaypoints&&void 0!==i.gpx.waypoints)for(t=0;t<i.gpx.waypoints.length;t++){var n=cr().circleMarker([i.gpx.waypoints[t].lat,i.gpx.waypoints[t].lon],{interactive:!0,radius:e.gpxWaypointsRadius,stroke:e.gpxWaypointsStroke,color:e.gpxWaypointsColor,weight:e.gpxWaypointsWeight,fillColor:e.gpxWaypointsFillColor,fillOpacity:e.gpxWaypointsFillOpacity}).addTo(i.gpxGroup);if(i.gpx.waypoints[t].name&&n.bindTooltip(i.gpx.waypoints[t].name,{className:"mmp-waypoint-tooltip"}),i.gpx.waypoints[t].desc){var o=cr().DomUtil.create("div","mmp-gpx-waypoint");o.innerHTML=i.gpx.waypoints[t].desc,n.bindPopup(o)}i.gpxWaypoints.push(n)}},this.setWaypointStyle=function(){for(var t=i.settings,e=0;e<i.gpxWaypoints.length;e++)i.gpxWaypoints[e].setStyle({radius:t.gpxWaypointsRadius,stroke:t.gpxWaypointsStroke,color:t.gpxWaypointsColor,weight:t.gpxWaypointsWeight,fillColor:t.gpxWaypointsFillColor,fillOpacity:t.gpxWaypointsFillOpacity})},this.generateChartData=function(){var t,e;"imperial"===i.settings.gpxChartUnits||"imperial-metric"===i.settings.gpxChartUnits?(t=1609.433,e=.3048):(t=1e3,e=1);var n=isNaN(parseFloat(i.settings.gpxChartYOffset))?0:parseFloat(i.settings.gpxChartYOffset);return i.gpx.tracks[i.map._activeTrack].points.map((function(i){return{x:i.dist/t,y:i.ele/e+n}}))},this.updateElevationChart=function(t){var e=i.settings;if(i.gpxChart instanceof mo){if(t){var n=i.generateChartData();i.gpxChart.data.datasets[0].data=n,i.gpxChart.options.scales.x.max=n[n.length-1].x}i.gpxChart.data.datasets[0].borderWidth=e.gpxChartLineWidth,i.gpxChart.data.datasets[0].borderColor=e.gpxChartLineColor,i.gpxChart.data.datasets[0].fill=!!e.gpxChartFill&&"origin",i.gpxChart.data.datasets[0].backgroundColor=e.gpxChartFillColor,i.gpxChart.options.scales.y.grid.color=e.gpxChartGridLinesColor,i.gpxChart.options.scales.y.min=isNaN(parseInt(e.gpxChartYMin))?void 0:parseInt(e.gpxChartYMin),i.gpxChart.options.scales.y.max=isNaN(parseInt(e.gpxChartYMax))?void 0:parseInt(e.gpxChartYMax),i.gpxChart.options.scales.y.reverse=e.gpxChartReverseY,i.gpxChart.options.scales.y.ticks.color=e.gpxChartTicksFontColor,i.gpxChart.options.scales.x.grid.color=e.gpxChartGridLinesColor,i.gpxChart.options.scales.x.reverse=e.gpxChartReverseX,i.gpxChart.options.scales.x.ticks.color=e.gpxChartTicksFontColor,i.gpxChart.options.chartArea.backgroundColor=e.gpxChartBgColor,i.gpxChart.options.plugins.tooltip.backgroundColor=e.gpxChartTooltipBgColor,i.gpxChart.options.plugins.tooltip.bodyColor=e.gpxChartTooltipFontColor,i.gpxChart.options.indicator.lineWidth=e.gpxChartIndicatorLineWidth,i.gpxChart.options.indicator.lineColor=e.gpxChartIndicatorLineColor,i.gpxChart.update()}},this.updateElevationChartThrottled=cr().Util.throttle(i.updateElevationChart,100,this),this.addElevationChart=function(){var t=i.settings;if(i.settings.gpxChart&&void 0!==i.gpx.tracks&&i.gpx.tracks.length){void 0===i.containers.chartWrap&&i.loadChart();var e=i.generateChartData(),n=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Gs(this,e,arguments)}var i,n,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ws(t,e)}(e,t),i=e,n=[{key:"draw",value:function(){Zs(Vs(e.prototype),"draw",this).call(this,arguments);var t=this.chart.config.options.mmp;if(this.chart.tooltip._active&&this.chart.tooltip._active.length&&void 0!==this.chart.scales.y){var i=this.chart.ctx,n=t.map._activeTrack,o=this.chart.tooltip.dataPoints[0],r=o.dataIndex,s=o.element.x,a=this.chart.scales.y.top,l=this.chart.scales.y.bottom;this.chart.config.options.indicator&&this.chart.config.options.indicator.lineWidth&&this.chart.config.options.indicator.lineColor&&(i.save(),i.beginPath(),i.moveTo(s,a),i.lineTo(s,l),i.lineWidth=this.chart.config.options.indicator.lineWidth,i.strokeStyle=this.chart.config.options.indicator.lineColor,i.stroke(),i.restore()),t.settings.gpxChartLocator&&void 0!==t.chartLayers.locator&&(t.chartLayers.locator.setLatLng([t.gpx.tracks[n].points[r].lat,t.gpx.tracks[n].points[r].lon]),t.map.hasLayer(t.chartLayers.locator)||t.chartLayers.locator.addTo(t.map))}else void 0!==t.chartLayers.locator&&t.map.hasLayer(t.chartLayers.locator)&&t.chartLayers.locator.remove()}}],n&&Ns(i.prototype,n),o&&Ns(i,o),Object.defineProperty(i,"prototype",{writable:!1}),e}(Ui);n.id="scatterIndicator",n.defaults=Ui.defaults,mo.register(Co,wo,Ui,lr,n,Ho,or),i.gpxChart=new mo("mmp-gpx-chart-"+i.uid,{plugins:[{beforeDraw:function(t){if(t.config.options.chartArea&&t.config.options.chartArea.backgroundColor){var e=t.ctx,i=t.chartArea;e.save(),e.fillStyle=t.config.options.chartArea.backgroundColor,e.fillRect(i.left,i.top,i.right-i.left,i.bottom-i.top),e.restore()}}},{afterDraw:function(t){if(!t.data.datasets[0].data.filter((function(t){return!isNaN(t.y)})).length){var e=t.ctx,i=t.width,n=t.height;t.clear(),e.save(),e.fillStyle="rgba(0, 0, 0, 1)",e.textAlign="center",e.textBaseline="middle",e.fillText(mmpL10n.gpx.noElevationData,i/2,n/2),e.restore()}}}],type:"scatterIndicator",data:{datasets:[{data:e,pointRadius:0,showLine:!0,spanGaps:!0,lineTension:t.gpxChartLineTension,borderCapStyle:"round",borderWidth:t.gpxChartLineWidth,borderColor:t.gpxChartLineColor,fill:!!t.gpxChartFill&&"origin",backgroundColor:t.gpxChartFillColor}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},layout:{padding:{top:10}},scales:{x:{grid:{color:t.gpxChartGridLinesColor},ticks:{callback:function(e){return Os(e,!0,t.gpxChartUnits)},autoSkip:!1,color:t.gpxChartTicksFontColor},min:0,max:e[e.length-1].x,reverse:t.gpxChartReverseX},y:{grid:{color:t.gpxChartGridLinesColor},ticks:{callback:function(e){return Os(e,!1,t.gpxChartUnits)},color:t.gpxChartTicksFontColor},min:isNaN(parseInt(t.gpxChartYMin))?void 0:parseInt(t.gpxChartYMin),max:isNaN(parseInt(t.gpxChartYMax))?void 0:parseInt(t.gpxChartYMax),reverse:t.gpxChartReverseY}},chartArea:{backgroundColor:t.gpxChartBgColor},plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(e){var i=e.dataIndex,n=e.dataset.data[i].y,o=e.dataset.data[i].x;return[mmpL10n.gpx.metaElevation+": "+Os(n,!1,t.gpxChartUnits),mmpL10n.gpx.metaDistance+": "+Os(o,!0,t.gpxChartUnits)]}},animation:{duration:250},mode:"index",intersect:!1,displayColors:!1,backgroundColor:t.gpxChartTooltipBgColor,bodyColor:t.gpxChartTooltipFontColor}},indicator:{lineWidth:t.gpxChartIndicatorLineWidth,lineColor:t.gpxChartIndicatorLineColor},mmp:i}}),void 0!==i.chartLayers&&Object.keys(i.chartLayers).forEach((function(t){i.chartLayers[t].remove()})),i.chartLayers={},i.chartLayers.locator=cr().circleMarker([0,0]),i.setChartStyle()}},this.setChartStyle=function(){var t=i.settings;t.gpxChart&&void 0!==i.chartLayers&&(Object.keys(i.chartLayers).forEach((function(t){i.chartLayers[t].remove()})),i.chartLayers.locator.setStyle({interactive:!1,radius:t.gpxChartLocatorRadius,stroke:t.gpxChartLocatorStroke,color:t.gpxChartLocatorColor,weight:t.gpxChartLocatorWeight,fillColor:t.gpxChartLocatorFillColor,fillOpacity:t.gpxChartLocatorFillOpacity}))},this.fitVisibleMarkers=function(t){var e=i.markerGroup.getBounds();e.isValid()&&("function"==typeof t&&i.map.once("moveend",t),i.map.fitBounds(e))},this.fitGeoJson=function(t){var e=i.geoJson[i.id].getLayer(t);if(void 0!==e){var n=e.getBounds();n.isValid()&&i.map.fitBounds(n)}},this.deferredLoadHandler=function(t,e){t.forEach((function(t){if("childList"===t.type&&t.addedNodes.length)for(var n=0;n<t.addedNodes.length;n++){if(t.addedNodes[n].id==="maps-marker-pro-"+i.uid)return e.disconnect(),void i.main()}}))},this.lazyLoadHandler=function(t,e){for(var n=0;n<t.length;n++){var o=t[n];if(o.target===i.containers.main&&o.isIntersecting)return e.disconnect(),void i.load()}},this.lazyLoadHandlerFallback=function(){if(!(Ss(i.containers.main)&&(t=i.containers.main,e=t.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,o=window.innerWidth||document.documentElement.clientWidth,e.left<=o&&e.right>=0&&e.top<=n&&e.bottom>=0)))return setTimeout(i.lazyLoadHandlerFallback,250);var t,e,n,o;i.load()},this.visibilityDetectionHandler=function(t){for(var e=0;e<t.length;e++){t[e].target===i.containers.main&&i.checkInvalidateSize()}},this.visibilityDetectionHandlerFallback=function(){i.checkInvalidateSize(),setTimeout(i.visibilityDetectionHandlerFallback,250)},this.openPopupHandler=function(t){var e=i.settings,n=t.target.getPopup();void 0!==n&&i.loadPopup(t.target).then((function(){i.checkPopupSize(n),e.popupCenterOnMap&&i.centerPopup(n),i.fire("popupopen",n)})).catch((function(){}))},this.openOnHoverHandler=function(t){t.target.openPopup()},this.updateListHandler=function(){i.getList()},this.updateMinimapHandler=function(t){i.controls.minimap.changeLayer(i.minimaps[t.name])},this.updateLocationHandler=function(t){if(!i.list.located){i.list.located=!0;var e=document.getElementById("list-address-"+i.uid);e&&(e.value="",e.dispatchEvent(new Event("keyup"))),i.getList({lat:t.latitude,lng:t.longitude})}},this.locateDeactivateHandler=function(){i.list.located&&(i.list.located=!1,i.getList({lat:null,lng:null}))},this.main()}cr().Control.MmpGeocoding=cr().Control.extend({options:{mmp:null,collapsed:!0,position:"topleft",provider:"none",typingDelay:400,minChars:3,icon:null,titleText:"",errorText:""},onAdd:function(t){this._map=t;var e=this.options,i="leaflet-control-mmp-geocoding";e.icon?this._marker=cr().marker([0,0],{icon:e.icon}):this._marker=null;var n=cr().DomUtil.create("div",i);cr().DomEvent.disableClickPropagation(n);var o=cr().DomUtil.create("div",i+"-input-container",n),r=cr().DomUtil.create("input",i+"-input",o);r.id=i+"-input-"+e.mmp.uid,r.type="text",r.title=e.titleText,r.placeholder=e.titleText,cr().DomEvent.on(r,"keyup",this._onKeyUp,this);var s=this._clearButton=cr().DomUtil.create("div",i+"-clear",o);return s.style.display="none",cr().DomEvent.on(s,"mousedown",this._onMouseDown,this),cr().DomEvent.on(s,"click",this.clear,this),e.collapsed&&(cr().DomEvent.on(r,"focus",this.expand,this),cr().DomEvent.on(r,"blur",this.collapse,this)),this._geocoding=new Fs({selector:"#"+i+"-input-"+e.mmp.uid,beforeSend:this._beforeSend.bind(this),error:this._onError.bind(this),selected:this._onSelected.bind(this),provider:e.provider,typingDelay:e.typingDelay,minChars:e.minChars}),n},addTo:function(t){return cr().Control.prototype.addTo.call(this,t),this._geocoding.init(),this.options.collapsed||this.expand(),this},expand:function(){cr().DomUtil.removeClass(this._container,"leaflet-control-mmp-geocoding-collapsed"),cr().DomUtil.addClass(this._container,"leaflet-control-mmp-geocoding-expanded")},collapse:function(){cr().DomUtil.removeClass(this._container,"leaflet-control-mmp-geocoding-expanded"),cr().DomUtil.addClass(this._container,"leaflet-control-mmp-geocoding-collapsed")},clear:function(){this._marker&&this._marker.remove(),this._geocoding.autocomplete.input.value="",this._clearButton.style.display="none",this._geocoding.autocomplete.close()},_onKeyUp:function(){this._geocoding.autocomplete.input.value?this._clearButton.style.display="inline-block":this._clearButton.style.display="none"},_onMouseDown:function(t){t.preventDefault()},_beforeSend:function(){},_onError:function(t){this.options.mmp.showMapModal(this.options.errorText,t)},_onSelected:function(t,e,i){var n=this.options.mmp;void 0!==n.controls.locate&&n.controls.locate.stop(),this._marker&&(this._marker.remove(),this._marker.options.title=i,this._marker.setLatLng([t,e]),this._marker.addTo(this._map)),this._map.setView([t,e]),this._geocoding.autocomplete.input.blur()}}),cr().control.mmpGeocoding=function(t){return new(cr().Control.MmpGeocoding)(t)},qs.callbacks=[],qs.init=function(){Object.keys(window.mapsMarkerPro).forEach((function(t){window.mapsMarkerPro[t]instanceof qs||(window.mapsMarkerPro[t]=new qs(window.mapsMarkerPro[t]))}))};var $s=qs;i(655),i(458),i(10);cr().PM.setOptIn(!0);var Ks=function(){!function(t){var e=t("#mapSettings").serialize(),i=wp.media({title:mmpAdminL10n.map.chooseGpx,button:{text:mmpAdminL10n.map.choose},library:{type:["application/gpx","application/gpx+xml"]},multiple:!1}),n=new Fs({selector:"#address",beforeSend:function(){t("#geocodingError").empty()},error:function(e){t("#geocodingError").html(e)},selected:function(e,i){mmpAdmin.map.panTo([e,i]),t("#lat").val(e.toFixed(6)),t("#lng").val(i.toFixed(6))},provider:t("#geocodingProvider").val(),typingDelay:mmpAdmin.settings.geocodingTypingDelay,minChars:mmpAdmin.settings.geocodingMinChars});function o(){var e=t("#advancedSettings").prop("checked");t(".mmp-advanced").each((function(){e?t(this).show():t(this).hide()}))}function r(){t("#filtersAllMarkers").prop("checked")?t("#filtersWrap").hide():t("#filtersWrap").show()}function s(){return new Promise((function(t){var e=T();mmpAdmin.loadResources().then((function(){mmpAdmin.geoJson[mmpAdmin.id]=mmpAdmin.parseGeoJson(e),mmpAdmin.drawGeoJson(),mmpAdmin.loadControls(),A(),t()}))}))}function a(t){mmpAdmin.settings.panelColor=t,mmpAdmin.loadPanel()}function l(t){mmpAdmin.settings.listGeocodingColor=t,mmpAdmin.updateCircle()}function h(t){mmpAdmin.settings.listGeocodingFillColor=t,mmpAdmin.updateCircle()}function c(t){mmpAdmin.settings.gpxTrackColor=t,mmpAdmin.setTrackStyle()}function p(t){mmpAdmin.settings.gpxWaypointsColor=t,mmpAdmin.setWaypointStyle()}function u(t){mmpAdmin.settings.gpxWaypointsFillColor=t,mmpAdmin.setWaypointStyle()}function d(t){mmpAdmin.settings.gpxChartLocatorColor=t,mmpAdmin.setChartStyle()}function m(t){mmpAdmin.settings.gpxChartLocatorFillColor=t,mmpAdmin.setChartStyle()}function f(e){var i=mmpMapVars.availableBasemaps[e];if(void 0!==i){var n=t('<li class="mmp-basemap" data-id="'+e+'"></li>'),o=t("<div></div>");n.append(o);var r=t('<input type="hidden" name="basemaps[]" value="'+e+'" />');o.append(r);var s=t('<img class="mmp-handle mmp-align-middle" src="'+mmpVars.pluginUrl+'images/icons/handle.png" />');o.append(s);var a=t('<input type="radio" name="basemapDefault" value="'+e+'" />');a.on("change",(function(){mmpAdmin.settings.basemapDefault=t(this).val().toString(),mmpAdmin.loadBasemaps(),mmpAdmin.loadControls()})),a.prop("checked",e===mmpAdmin.settings.basemapDefault),o.append(" ").append(a);var l=t('<input type="text" class="mmp-align-middle" value="'+i.name+'" disabled="disabled" />');o.append(" ").append(l);var h=t('<i class="dashicons dashicons-no mmp-remove-basemap"></i>');h.on("click",(function(){t(this).parent().parent().remove(),g(),_()})),o.append(" ").append(h),t("#basemapList").append(n)}}function g(){var e=[];t(".mmp-basemap").each((function(){e.push(t(this).data("id").toString())}));var i=t("#basemapsList");i.empty(),Object.keys(mmpMapVars.availableBasemaps).forEach((function(n){if(-1===e.indexOf(n)){var o=mmpMapVars.availableBasemaps[n],r=t('<option value="'+n+'">'+o.name+"</option>");i.append(r)}})),t("#basemapsList option").length?t("#basemapsAdd").prop("disabled",!1):t("#basemapsAdd").prop("disabled",!0)}function _(){mmpAdmin.settings.basemaps=[],t("#basemapList li").each((function(){var e=t(this).data("id").toString(),i=mmpMapVars.availableBasemaps[e];void 0!==i&&mmpAdmin.settings.basemaps.push(i)})),mmpAdmin.loadBasemaps(),mmpAdmin.loadControls()}function v(e){var i=mmpMapVars.availableOverlays[e];if(void 0!==i){var n=t('<li class="mmp-overlay" data-id="'+e+'"></li>'),o=t("<div></div>");n.append(o);var r=t('<input type="hidden" name="overlays[]" value="'+e+'" />');o.append(r);var s=t('<img class="mmp-handle mmp-align-middle" src="'+mmpVars.pluginUrl+'images/icons/handle.png" />');o.append(s);var a=t('<input type="checkbox" name="overlaysActive[]" value="'+e+'" />');a.on("change",(function(){mmpAdmin.settings.overlaysActive=[],t('input[name="overlaysActive[]"]:checked').each((function(){mmpAdmin.settings.overlaysActive.push(t(this).val().toString())})),mmpAdmin.loadOverlays(),mmpAdmin.loadControls()})),a.prop("checked",-1!==mmpAdmin.settings.overlaysActive.indexOf(e)),o.append(" ").append(a);var l=t('<input type="text" class="mmp-align-middle" value="'+i.name+'" disabled="disabled" />');o.append(" ").append(l);var h=t('<i class="dashicons dashicons-no mmp-remove-overlay"></i>');h.on("click",(function(){t(this).parent().parent().remove(),y(),b()})),o.append(" ").append(h),t("#overlayList").append(n)}}function y(){var e=[];t(".mmp-overlay").each((function(){e.push(t(this).data("id").toString())}));var i=t("#overlaysList");i.empty(),Object.keys(mmpMapVars.availableOverlays).forEach((function(n){if(-1===e.indexOf(n)){var o=mmpMapVars.availableOverlays[n],r=t('<option value="'+n+'">'+o.name+"</option>");i.append(r)}})),t("#overlaysList option").length?t("#overlaysAdd").prop("disabled",!1):t("#overlaysAdd").prop("disabled",!0)}function b(){mmpAdmin.settings.overlays=[],t("#overlayList li").each((function(){var e=t(this).data("id").toString(),i=mmpMapVars.availableOverlays[e];void 0!==i&&mmpAdmin.settings.overlays.push(i)})),mmpAdmin.loadOverlays(),mmpAdmin.loadControls()}function x(e,i){var n=void 0===i.active||!!i.active,o=i.icon||"",r=i.name||"",a=t('<li class="mmp-filter" data-id="'+e+'"></li>'),l=t("<div></div>");a.append(l);var h=t('<img class="mmp-handle mmp-align-middle" src="'+mmpVars.pluginUrl+'images/icons/handle.png" />');l.append(h);var c=t('<label class="mmp-align-middle"><div class="switch"><input type="checkbox" name="filtersList['+e+'][active]"'+(n?' checked="checked"':"")+' /><span class="slider"></span></div></label>');t("input",c).on("change",(function(){var e=t(this).closest("li").data("id"),i=t(this).prop("checked");t(".mmp-control-filters-selector[value="+e+"]").prop("checked",i),void 0!==mmpAdmin.groups[e]&&(mmpAdmin.groups[e].active=i),mmpAdmin.drawMarkers(),mmpAdmin.drawGeoJson()})),l.append(" ").append(c);var p=t('<input type="hidden" name="filtersList['+e+'][icon]" value="'+o+'" />');l.append(p);var u=o?mmpVars.iconsUrl+o:mmpVars.pluginUrl+"images/leaflet/marker.png",d=t('<img class="mmp-filter-icon mmp-align-middle" src="'+u+'" />');d.on("click",(function(){t("#iconTarget").val(t(this).parent().parent().data("id")),t("#icons").show()})),l.append(" ").append(d);var m=t('<input type="text" class="mmp-align-middle" name="filtersList['+e+'][name]" value="'+r+'" />');m.on("change",(function(){w(),mmpAdmin.loadControls()})),l.append(" ").append(m);var f=t('<i class="dashicons dashicons-no mmp-remove-filter"></i>');f.on("click",(function(){t(this).parent().parent().remove(),k(),w(),s()})),l.append(" ").append(f),t("#filterList").append(a)}function k(){var e=[];t(".mmp-filter").each((function(){e.push(t(this).data("id"))})),t("#filtersMapList option").each((function(){var i=t(this).val()==mmpAdmin.id||-1!==t.inArray(parseInt(t(this).val()),e);t(this).prop("disabled",i)}));var i=!1;t("#filtersMapList option").each((function(){if(!t(this).prop("disabled"))return i=!0,t(this).prop("selected",!0),!1})),i?t("#filtersAdd").prop("disabled",!1):(t("#filtersAdd").prop("disabled",!0),t("#filtersMapList option").prop("selected",!1)),t("#filtersMapList").select2({width:"300px"})}function L(){mmpAdmin.settings.geocodingControlMarkerIcon=t("#geocodingControlMarkerIcon").val(),void 0!==mmpAdmin.controls.geocoding&&mmpAdmin.controls.geocoding._marker&&mmpAdmin.controls.geocoding._marker.remove()}function w(){var e={};t("#filterList li").each((function(i){var n=t(this).data("id");e[n]={index:i,active:t('input[name="filtersList['+n+'][active]"]').prop("checked"),name:t('input[name="filtersList['+n+'][name]"]').val(),icon:t('input[name="filtersList['+n+'][icon]"]').val()}})),mmpAdmin.settings.filtersDetails=e}function M(){mmpAdmin.settings.listGeocodingMarkerIcon=t("#listGeocodingMarkerIcon").val(),mmpAdmin.getList()}function C(){mmpAdmin.settings.gpxStartIcon=t("#gpxStartIcon").val(),mmpAdmin.settings.gpxEndIcon=t("#gpxEndIcon").val(),mmpAdmin.setTrackIcons()}function P(e){void 0!==mmpAdmin.map.pm&&(e?(mmpAdmin.map.pm.addControls({position:"topleft",drawMarker:!1,drawCircleMarker:!1,drawText:!1}),mmpAdmin.settings.filtersGeoJson=!1,s().then((function(){mmpAdmin.geoJson[mmpAdmin.id].eachLayer((function(t){t.options.pmIgnore=!1,cr().PM.reInitLayer(t)}))}))):(mmpAdmin.map.pm.removeControls(),mmpAdmin.settings.filtersGeoJson=t("#filtersGeoJson").prop("checked"),s()))}function S(){void 0!==mmpAdmin.map.pm&&mmpAdmin.map.pm.setPathOptions({stroke:t("#drawStroke").prop("checked"),color:t("#drawStrokeColor").val(),weight:parseInt(t("#drawStrokeWeight").val()),opacity:parseFloat(t("#drawStrokeOpacity").val()),lineCap:t("#drawLineCap").val(),lineJoin:t("#drawLineJoin").val(),fill:t("#drawFill").prop("checked"),fillColor:t("#drawFillColor").val(),fillOpacity:parseFloat(t("#drawFillOpacity").val()),fillRule:t("#drawFillRule").val()})}function T(){var t={type:"FeatureCollection",features:[]};return mmpAdmin.geoJson[mmpAdmin.id].eachLayer((function(e){try{var i=e.toGeoJSON()}catch(t){return}void 0===i.properties&&(i.properties={}),e instanceof cr().Circle?i.properties.radius=e.getRadius():e instanceof cr().Rectangle&&(i.properties.rectangle=!0);for(var n=["name","stroke","color","weight","opacity","lineCap","lineJoin","fill","fillColor","fillOpacity","fillRule","popup"],o=0;o<n.length;o++)void 0!==e.options[n[o]]&&(i.properties[n[o]]=e.options[n[o]]);t.features.push(i)})),t}function A(){t("#geoJson").empty(),t("#shapesSelectAll").prop("checked",!1),mmpAdmin.geoJson[mmpAdmin.id].eachLayer(E),t('input[name="shapesSelected[]"]').length?t("#shapesList").show():t("#shapesList").hide(),t('input[name="shapesSelected[]"]').on("change",(function(){var e=!0;t('input[name="shapesSelected[]"]').each((function(i,n){e=e&&t(n).prop("checked")})),t("#shapesSelectAll").prop("checked",e)}))}function D(t){var e=!1;return t instanceof cr().Circle?e="Circle":t instanceof cr().Rectangle?e="Rectangle":t instanceof cr().Polygon?e="Polygon":t instanceof cr().Polyline&&(e="Polyline"),e}function E(e){var i=cr().stamp(e),n=D(e),o=t('<li class="mmp-shape" data-id="'+i+'"></li>'),r=t("<div></div>");o.append(r);var s=t('<input type="checkbox" name="shapesSelected[]" value="'+i+'" />');r.append(s);var a=t('<img class="mmp-shape-icon mmp-align-middle" src="'+mmpVars.pluginUrl+"images/icons/geojson-"+n.toLowerCase()+'.svg" />');r.append(a);var l=t('<input type="text" class="mmp-align-middle" value="'+e.options.name+'" />');l.on("change",(function(){var e=t(this).parent().parent().data("id"),i=mmpAdmin.geoJson[mmpAdmin.id].getLayer(e);void 0!==i&&(i.options.name=t(this).val(),mmpAdmin.updatePopup(i,!0))})),r.append(" ").append(l);var h=t('<img class="mmp-align-middle mmp-clickable" src="'+mmpVars.pluginUrl+'images/icons/jump-to.png" />');h.on("click",(function(){mmpAdmin.fitGeoJson(i)})),r.append(" ").append(h);var c=t('<img class="mmp-align-middle mmp-clickable" src="'+mmpVars.pluginUrl+'images/icons/edit-layer.png" />');c.on("click",(function(){R(),t("#shapeId").val(i);var e=mmpAdmin.geoJson[mmpAdmin.id].getLayer(t("#shapeId").val());void 0!==e&&(B(e.options),t("#shapeBackup").val(JSON.stringify(I())),t("#editShape").appendTo(t(this).parent()),t("#editShape").slideDown(500))})),r.append(" ").append(c),t("#geoJson").append(o)}function O(){var e=mmpAdmin.geoJson[mmpAdmin.id].getLayer(t("#shapeId").val());void 0!==e&&e.setStyle(I())}function I(){return{stroke:t("#editDrawStroke").prop("checked"),color:t("#editDrawStrokeColor").val(),weight:parseInt(t("#editDrawStrokeWeight").val()),opacity:parseFloat(t("#editDrawStrokeOpacity").val()),lineCap:t("#editDrawLineCap").val(),lineJoin:t("#editDrawLineJoin").val(),fill:t("#editDrawFill").prop("checked"),fillColor:t("#editDrawFillColor").val(),fillOpacity:parseFloat(t("#editDrawFillOpacity").val()),fillRule:t("#editDrawFillRule").val(),popup:t("#editDrawPopup").val()}}function B(e){t("#editDrawStroke").prop("checked",e.stroke),t("#editDrawStrokeColor").spectrum("set",e.color),t("#editDrawStrokeWeight").val(e.weight),t("#editDrawStrokeOpacity").val(e.opacity),t('#editDrawLineCap option[value="'+e.lineCap+'"]').prop("selected",!0),t('#editDrawLineJoin option[value="'+e.lineJoin+'"]').prop("selected",!0),t("#editDrawFill").prop("checked",e.fill),t("#editDrawFillColor").spectrum("set",e.fillColor),t("#editDrawFillOpacity").val(e.fillOpacity),t('#editDrawFillRule option[value="'+e.fillRule+'"]').prop("selected",!0),t("#editDrawPopup").val(e.popup)}function R(){var e=t("#shapeBackup").val();e&&(B(JSON.parse(e)),O(),t("#shapeBackup").val(""))}function z(t){void 0!==t[0]&&mmpAdmin.map.fitBounds(t[0].getBounds(),{padding:[10,10]})}i.on("select",(function(){var e=i.state().get("selection").first().toJSON();t("#gpxUrl").val(e.url),t("#updateGpx").trigger("click")})),mmpAdmin.on("settingsloaded",(function(e){t("#filterList").empty(),Object.keys(e.filtersDetails).forEach((function(t){x(t,e.filtersDetails[t])})),k(),w(),t("#basemapList").empty();for(var i=0;i<e.basemaps.length;i++)f(e.basemaps[i].id);g(),t("#overlayList").empty();for(i=0;i<e.overlays.length;i++)v(e.overlays[i].id);y()})),mmpAdmin.on("basemapsloaded",(function(e){t("input[name=basemapDefault]:checked").length||t.each(e,(function(e,i){if(mmpAdmin.map.hasLayer(i))return mmpAdmin.settings.basemapDefault=i.mmp_id,t('input[name=basemapDefault][value="'+i.mmp_id+'"]').prop("checked",!0),!1}))})),mmpAdmin.on("maploaded",(function(){mmpAdmin.map.options.pmIgnore=!1,cr().PM.reInitLayer(mmpAdmin.map),mmpAdmin.map.on("moveend",(function(){t("#lat").val(mmpAdmin.map.getCenter().lat.toFixed(6)),t("#lng").val(mmpAdmin.map.getCenter().lng.toFixed(6))})),mmpAdmin.map.on("zoomend",(function(){t("#zoom").val(mmpAdmin.map.getZoom().toFixed(1))})),mmpAdmin.on("controlsloaded",(function(){e=t("#mapSettings").serialize(),t(".leaflet-control-layers-base .leaflet-control-layers-selector").on("change",(function(){t(".mmp-basemap").each((function(e,i){var n=t("input[type=text]",i).val();if(mmpAdmin.map.hasLayer(mmpAdmin.basemaps[n]))return t("input[type=radio]",i).prop("checked",!0),!1}))})),t(".leaflet-control-layers-overlays .leaflet-control-layers-selector").on("change",(function(){t(".mmp-overlay").each((function(e,i){var n=t("input[type=text]",i).val(),o=mmpAdmin.map.hasLayer(mmpAdmin.overlays[n]);t("input[type=checkbox]",i).prop("checked",o)}))})),t(".mmp-control-filters-selector").on("change",(function(){var e=t(this).val(),i=t(this).prop("checked");t('input[name="filtersList['+e+'][active]"]').prop("checked",i)}))})),mmpAdmin.map.on("pm:create",(function(e){e.layer.options.pmIgnore=!1,cr().PM.reInitLayer(e.layer),R(),t("#editShape").hide(),t("#editShape").appendTo(t("#mmp-tabDraw-settings"));var i=D(e.layer).toLowerCase();e.layer.options.name=mmpAdminL10n.geoJson[i],mmpAdmin.geoJson[mmpAdmin.id].addLayer(e.layer),A()})),mmpAdmin.map.on("pm:remove",(function(e){R(),t("#editShape").hide(),t("#editShape").appendTo(t("#mmp-tabDraw-settings")),mmpAdmin.geoJson[mmpAdmin.id].removeLayer(e.layer),A()})),mmpAdmin.map.on("pm:cut",(function(e){R(),t("#editShape").hide(),t("#editShape").appendTo(t("#mmp-tabDraw-settings")),mmpAdmin.geoJson[mmpAdmin.id].removeLayer(e.originalLayer),e.layer.options.name=e.originalLayer.options.name||"",mmpAdmin.geoJson[mmpAdmin.id].addLayer(e.layer),A()})),r(),S()})),mmpAdmin.on("geojsonloaded",(function(){A()})),t("#chooseGpx").on("click",(function(){i.open()})),t("#tabMap, #tabLayers, #tabControl, #tabMarker, #tabFilter, #tabList, #tabShare, #tabInteraction, #tabGpx, #tabDraw").on("click",(function(){!function(e){var i=t(".mmp-tablink.active").first().attr("id");t(".mmp-tab").each((function(){t(this).hide()})),t(".mmp-tablink").each((function(){t(this).removeClass("active")})),t("#mmp-"+e.attr("id")+"-settings").show(),e.addClass("active");var n="tabDraw"===e.attr("id");n&&"tabDraw"!==i?P(!0):n||"tabDraw"!==i||P(!1)}(t(this))})),t("#tabMap").trigger("click"),t("#advancedSettings").on("change",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_advanced_map_settings_state",nonce:t("#nonce").val(),state:t("#advancedSettings").prop("checked")?1:0},beforeSend:o})})),t("#deleteMap").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_delete_map_direct",nonce:t("#nonce").val(),con:0,id:t("#id").val()}}).done((function(i){if(i.success){if(!confirm(i.data.message))return;t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_delete_map_direct",nonce:t("#nonce").val(),con:1,id:i.data.id}}).done((function(i){i.success&&(e=t("#mapSettings").serialize(),window.location.href=mmpVars.adminUrl+"admin.php?page=mapsmarkerpro_maps")}))}}))})),t("#panelColor").spectrum({preferredFormat:"hex3",showInput:!0,show:function(){t(this).data("changed",!1),t("#panel").prop("checked",!0),t("#panel").trigger("change")},move:function(t){a(t.toHexString("hex3"))},change:function(e){t(this).data("changed",!0),a(e.toHexString("hex3"))},hide:function(e){t(this).data("changed")?a(e.toHexString("hex3")):a(t(this).val())}}),t("#gpxTrackColor").spectrum({preferredFormat:"hex3",showInput:!0,show:function(){t(this).data("changed",!1)},move:function(t){c(t.toHexString("hex3"))},change:function(e){t(this).data("changed",!0),c(e.toHexString("hex3"))},hide:function(e){t(this).data("changed")?c(e.toHexString("hex3")):c(t(this).val())}}),t("#gpxWaypointsColor").spectrum({preferredFormat:"hex3",showInput:!0,show:function(){t(this).data("changed",!1),t("#gpxWaypoints").prop("checked",!0),t("#gpxWaypoints").trigger("change"),t("#gpxWaypointsStroke").prop("checked",!0),t("#gpxWaypointsStroke").trigger("change")},move:function(t){p(t.toHexString("hex3"))},change:function(e){t(this).data("changed",!0),p(e.toHexString("hex3"))},hide:function(e){t(this).data("changed")?p(e.toHexString("hex3")):p(t(this).val())}}),t("#gpxWaypointsFillColor").spectrum({preferredFormat:"hex3",showInput:!0,show:function(){t(this).data("changed",!1),t("#gpxWaypoints").prop("checked",!0),t("#gpxWaypoints").trigger("change")},move:function(t){u(t.toHexString("hex3"))},change:function(e){t(this).data("changed",!0),u(e.toHexString("hex3"))},hide:function(e){t(this).data("changed")?u(e.toHexString("hex3")):u(t(this).val())}}),t("#mapSettings").on("submit",(function(i){i.preventDefault(),i.stopPropagation(),t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_save_map",nonce:t("input[name=nonce]").val(),settings:t("#mapSettings").serialize(),geoJson:JSON.stringify(T())},beforeSend:function(){var e;e=t("#save"),t("#save").prop("disabled",!0),t(e).addClass("mmp-button-loading")}}).done((function(i){i.success?(e=t("#mapSettings").serialize(),"new"===t("#id").val()?(localStorage.setItem("saved",!0),window.location.href=mmpVars.adminUrl+"admin.php?page=mapsmarkerpro_map&id="+i.data.id):t('<div class="notice notice-success"><p>'+i.data.message+"</p></div>").insertBefore(".mmp-main").delay(5e3).fadeOut(500,(function(){t(this).remove()}))):t('<div class="notice notice-error"><p>'+i.data+"</p></div>").insertBefore(".mmp-main").delay(5e3).fadeOut(500,(function(){t(this).remove()}))})).fail((function(e,i,n){t('<div class="notice notice-error"><p>'+mmpAdminL10n.global.ajaxError+" ("+n+")</p></div>").insertBefore(".mmp-main").delay(5e3).fadeOut(500,(function(){t(this).remove()}))})).always((function(){var e;e=t("#save"),t(e).removeClass("mmp-button-loading"),t("#save").prop("disabled",!1),t(".mmp-wrap")[0].scrollIntoView()}))})),t("#saveDefaultsLink").on("click",(function(e){e.preventDefault(),e.stopPropagation(),t(this).hide(),t(".mmp-save-defaults").show()})),t("#saveDefaultsConfirm").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_save_map_defaults",nonce:t("input[name=nonce]").val(),settings:t("#mapSettings").serialize()},beforeSend:function(){t("#saveDefaultsConfirm").prop("disabled",!0),t("#saveDefaultsCancel").prop("disabled",!0),t(".mmp-save-defaults").addClass("mmp-save-defaults-loading")}}).always((function(){t(".mmp-save-defaults").removeClass("mmp-save-defaults-loading"),t(".mmp-save-defaults").fadeOut(500,(function(){t("#saveDefaultsConfirm").prop("disabled",!1),t("#saveDefaultsCancel").prop("disabled",!1),t("#saveDefaultsLink").show()}))}))})),t("#saveDefaultsCancel").on("click",(function(){t(".mmp-save-defaults").hide(),t("#saveDefaultsLink").show()})),t("#fitMarkers").on("click",(function(){mmpAdmin.fitVisibleMarkers()})),t("#name").on("change",(function(){mmpAdmin.settings.name=t(this).val().replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"),mmpAdmin.loadPanel()})),t("#width, input[name=widthUnit], #height, input[name=heightUnit]").on("change",(function(){t("#widthUnitPct").prop("checked")&&t("#width").val()>100&&t("#width").val(100),mmpAdmin.settings.width=parseInt(t("#width").val()),mmpAdmin.settings.widthUnit=t("input[name=widthUnit]:checked").val(),mmpAdmin.settings.height=parseInt(t("#height").val()),mmpAdmin.settings.heightUnit=t("input[name=heightUnit]:checked").val(),mmpAdmin.setLayout()})),t("#lat, #lng").on("change",(function(){var e=parseFloat(t("#lat").val()),i=parseFloat(t("#lng").val());mmpAdmin.map.panTo([e,i])})),t("#zoom, #minZoom, #maxZoom, #zoomStep").on("change",(function(){mmpAdmin.map.options.minZoom=parseFloat(t("#minZoom").val()),mmpAdmin.map.options.maxZoom=parseFloat(t("#maxZoom").val()),mmpAdmin.map.options.zoomSnap=parseFloat(t("#zoomStep").val()),mmpAdmin.map.options.zoomDelta=parseFloat(t("#zoomStep").val()),mmpAdmin.map.setZoom(parseFloat(t("#zoom").val()))})),t("#maxBounds").on("change",(function(){mmpAdmin.map.setMaxBounds(Ts(t("#maxBounds").val()))})),t("#restrictView").on("click",(function(){var e;t("#minZoom").val(mmpAdmin.map.getZoom()),mmpAdmin.map.options.minZoom=parseFloat(t("#minZoom").val()),t("#maxBounds").val([(e=mmpAdmin.map.getBounds()).getSouth(),e.getWest(),e.getNorth(),e.getEast()].join(",")),mmpAdmin.map.setMaxBounds(Ts(t("#maxBounds").val()))})),t("#panel").on("change",(function(){mmpAdmin.settings.panel=t(this).prop("checked"),mmpAdmin.loadPanel()})),t("#panelFs, #panelGpx, #panelGeoJson, #panelKml, #panelGeoRss").on("change",(function(){mmpAdmin.settings[t(this).attr("id")]=t(this).prop("checked"),mmpAdmin.loadPanel()})),t("#basemapList").sortable({handle:".mmp-handle",update:_}),t("#basemapsAdd").on("click",(function(){f(t("#basemapsList").val()),g(),_()})),t("#overlayList").sortable({handle:".mmp-handle",update:b}),t("#overlaysAdd").on("click",(function(){v(t("#overlaysList").val()),y(),b()})),t("input[name=attributionPosition], #attributionIndex, #attributionCondensed").on("change",(function(){mmpAdmin.settings.attributionPosition=t("input[name=attributionPosition]:checked").val(),mmpAdmin.settings.attributionIndex=t("#attributionIndex").val(),mmpAdmin.settings.attributionCondensed=t("#attributionCondensed").prop("checked"),mmpAdmin.loadControls()})),t("input[name=geocodingControlPosition], #geocodingControlIndex, #geocodingControlCollapsed").on("change",(function(){mmpAdmin.settings.geocodingControlPosition=t("input[name=geocodingControlPosition]:checked").val(),mmpAdmin.settings.geocodingControlIndex=t("#geocodingControlIndex").val(),mmpAdmin.settings.geocodingControlCollapsed=t("#geocodingControlCollapsed").val(),void 0!==mmpAdmin.controls.geocoding&&mmpAdmin.controls.geocoding._marker&&mmpAdmin.controls.geocoding._marker.remove(),mmpAdmin.loadControls()})),t("#geocodingControlShowMarker").on("change",(function(){mmpAdmin.settings.geocodingControlShowMarker=t("#geocodingControlShowMarker").prop("checked"),L(),mmpAdmin.loadControls()})),t(".mmp-geocoding-control-icon").on("click",(function(){t("#iconTarget").val("geocoding-control"),t("#icons").show()})),t("input[name=zoomControlPosition], #zoomControlIndex").on("change",(function(){mmpAdmin.settings.zoomControlPosition=t("input[name=zoomControlPosition]:checked").val(),mmpAdmin.settings.zoomControlIndex=t("#zoomControlIndex").val(),mmpAdmin.loadControls()})),t("input[name=fullscreenPosition], #fullscreenIndex").on("change",(function(){mmpAdmin.settings.fullscreenPosition=t("input[name=fullscreenPosition]:checked").val(),mmpAdmin.settings.fullscreenIndex=t("#fullscreenIndex").val(),mmpAdmin.loadControls()})),t("input[name=resetPosition], #resetIndex, #resetOnDemand").on("change",(function(){mmpAdmin.settings.resetPosition=t("input[name=resetPosition]:checked").val(),mmpAdmin.settings.resetIndex=t("#resetIndex").val(),mmpAdmin.settings.resetOnDemand=t("#resetOnDemand").prop("checked"),mmpAdmin.loadControls()})),t("input[name=locatePosition], #locateIndex").on("change",(function(){mmpAdmin.settings.locatePosition=t("input[name=locatePosition]:checked").val(),mmpAdmin.settings.locateIndex=t("#locateIndex").val(),mmpAdmin.loadControls()})),t("input[name=measurePosition], #measureIndex").on("change",(function(){mmpAdmin.settings.measurePosition=t("input[name=measurePosition]:checked").val(),mmpAdmin.settings.measureIndex=t("#measureIndex").val(),void 0!==mmpAdmin.controls.measure&&mmpAdmin.controls.measure._clearAllMeasurements(),mmpAdmin.loadControls()})),t("#measureUnit, #measureShowBearings, #measureClearMeasurementsOnStop, #measureShowClearControl, #measureShowUnitControl").on("change",(function(){mmpAdmin.settings.measureUnit=t("#measureUnit").val(),mmpAdmin.settings.measureShowBearings=t("#measureShowBearings").prop("checked"),mmpAdmin.settings.measureClearMeasurementsOnStop=t("#measureClearMeasurementsOnStop").prop("checked"),mmpAdmin.settings.measureShowClearControl=t("#measureShowClearControl").prop("checked"),mmpAdmin.settings.measureShowUnitControl=t("#measureShowUnitControl").prop("checked"),void 0!==mmpAdmin.controls.measure&&mmpAdmin.controls.measure._clearAllMeasurements(),mmpAdmin.loadControls()})),t("input[name=scalePosition], #scaleIndex").on("change",(function(){mmpAdmin.settings.scalePosition=t("input[name=scalePosition]:checked").val(),mmpAdmin.settings.scaleIndex=t("#scaleIndex").val(),mmpAdmin.loadControls()})),t("#scaleMaxWidth, #scaleMetric, #scaleImperial").on("change",(function(){mmpAdmin.settings.scaleMaxWidth=t("#scaleMaxWidth").val(),mmpAdmin.settings.scaleMetric=t("#scaleMetric").prop("checked"),mmpAdmin.settings.scaleImperial=t("#scaleImperial").prop("checked"),mmpAdmin.loadControls()})),t("input[name=layersPosition], #layersIndex, #layersCollapsed").on("change",(function(){mmpAdmin.settings.layersPosition=t("input[name=layersPosition]:checked").val(),mmpAdmin.settings.layersIndex=t("#layersIndex").val(),mmpAdmin.settings.layersCollapsed=t("#layersCollapsed").val(),mmpAdmin.loadControls()})),t("input[name=filtersPosition], #filtersIndex, #filtersCollapsed, #filtersOrderBy, #filtersSortOrder").on("change",(function(){t("#filtersSortOrder").prop("disabled","custom"===t("#filtersOrderBy").val()),mmpAdmin.settings.filtersPosition=t("input[name=filtersPosition]:checked").val(),mmpAdmin.settings.filtersIndex=t("#filtersIndex").val(),mmpAdmin.settings.filtersCollapsed=t("#filtersCollapsed").val(),mmpAdmin.settings.filtersOrderBy=t("#filtersOrderBy").val(),mmpAdmin.settings.filtersSortOrder=t("#filtersSortOrder").val(),mmpAdmin.loadControls()})),t("input[name=gpxControlPosition], #gpxControlIndex, #gpxControlCollapsed").on("change",(function(){mmpAdmin.settings.gpxControlPosition=t("input[name=gpxControlPosition]:checked").val(),mmpAdmin.settings.gpxControlIndex=t("#gpxControlIndex").val(),mmpAdmin.settings.gpxControlCollapsed=t("#gpxControlCollapsed").val(),mmpAdmin.loadControls()})),t("#filtersButtons, #filtersIcon, #filtersName, #filtersCount").on("change",(function(){mmpAdmin.settings[t(this).attr("id")]=t(this).prop("checked"),mmpAdmin.loadControls()})),t("input[name=minimapPosition], #minimapIndex, #minimapWidth, #minimapHeight, #minimapCollapsedWidth, #minimapCollapsedHeight, #minimapZoomLevelOffset, #minimapZoomLevelFixed, #minimapMinimized").on("change",(function(){mmpAdmin.settings.minimapPosition=t("input[name=minimapPosition]:checked").val(),mmpAdmin.settings.minimapIndex=t("#minimapIndex").val(),mmpAdmin.settings.minimapWidth=t("#minimapWidth").val(),mmpAdmin.settings.minimapHeight=t("#minimapHeight").val(),mmpAdmin.settings.minimapCollapsedWidth=t("#minimapCollapsedWidth").val(),mmpAdmin.settings.minimapCollapsedHeight=t("#minimapCollapsedHeight").val(),mmpAdmin.settings.minimapZoomLevelOffset=parseFloat(t("#minimapZoomLevelOffset").val()),mmpAdmin.settings.minimapZoomLevelFixed=parseFloat(t("#minimapZoomLevelFixed").val())||null,mmpAdmin.settings.minimapMinimized=t("#minimapMinimized").val(),mmpAdmin.loadControls()})),t("#filtersAllMarkers").on("change",(function(){mmpAdmin.settings.filtersAllMarkers=t(this).prop("checked"),r(),s()})),t("#filtersGeoJson").on("change",(function(){mmpAdmin.settings.filtersGeoJson=t(this).prop("checked"),s()})),t("#filterList").sortable({handle:".mmp-handle",update:function(){w(),mmpAdmin.loadControls()}}),t(".mmp-gpx-start-icon").on("click",(function(){t("#iconTarget").val("gpx-start"),t("#icons").show()})),t(".mmp-gpx-end-icon").on("click",(function(){t("#iconTarget").val("gpx-end"),t("#icons").show()})),t("#iconsList img").on("click",(function(){var e=t("#iconTarget").val(),i=t(this).attr("src"),n=t(this).data("icon");"gpx-start"===e?(t("#gpxStartIcon").val(n),t(".mmp-gpx-start-icon").attr("src",i),C()):"gpx-end"===e?(t("#gpxEndIcon").val(n),t(".mmp-gpx-end-icon").attr("src",i),C()):"geocoding-control"===e?(t("#geocodingControlMarkerIcon").val(n),t(".mmp-geocoding-control-icon").attr("src",i),L(),mmpAdmin.loadControls()):"list-geocoding"===e?(t("#listGeocodingMarkerIcon").val(n),t(".mmp-list-geocoding-icon").attr("src",i),M()):(t('input[name="filtersList['+e+'][icon]"]').val(n),t('.mmp-filter[data-id="'+e+'"] .mmp-filter-icon').attr("src",i),w(),mmpAdmin.loadControls()),t("#icons").hide()})),t("#filtersAdd").on("click",(function(){var e=t("#filtersMapList option:checked").text().replace(/\[(.+)\] /,"").replace(/ \((.+)\)$/,"");x(t("#filtersMapList").val(),{name:e}),k(),w(),s()})),k(),t(".mmp-remove-filter").on("click",(function(){t(this).parent().parent().remove(),k(),w()})),t("#markerOpacity").on("change",(function(){Object.keys(mmpAdmin.markers).forEach((function(e){mmpAdmin.markers[e].setOpacity(parseFloat(t("#markerOpacity").val()))}))})),t("#tooltip").on("change",(function(){var e=t(this).prop("checked");Object.keys(mmpAdmin.markers).forEach((function(t){mmpAdmin.markers[t].unbindTooltip(),e&&void 0!==mmpAdmin.tooltips[t]&&mmpAdmin.markers[t].bindTooltip(mmpAdmin.tooltips[t],mmpAdmin.tooltip)}))})),t("#tooltipDirection, #tooltipPermanent, #tooltipSticky, #tooltipOpacity").on("change",(function(){mmpAdmin.tooltip.direction=t("#tooltipDirection").val(),mmpAdmin.tooltip.permanent=t("#tooltipPermanent").prop("checked"),mmpAdmin.tooltip.sticky=t("#tooltipSticky").prop("checked"),mmpAdmin.tooltip.opacity=parseFloat(t("#tooltipOpacity").val()),t("#tooltip").trigger("change")})),t("#popupCenterOnMap, #popupMarkername, #popupAddress, #popupCoordinates, #popupDirections, #popupShare, #popupMinWidth, #popupMaxWidth, #popupMaxHeight").on("change",(function(){mmpAdmin.settings.popupCenterOnMap=t("#popupCenterOnMap").prop("checked"),mmpAdmin.settings.popupMarkername=t("#popupMarkername").prop("checked"),mmpAdmin.settings.popupAddress=t("#popupAddress").prop("checked"),mmpAdmin.settings.popupCoordinates=t("#popupCoordinates").prop("checked"),mmpAdmin.settings.popupDirections=t("#popupDirections").prop("checked"),mmpAdmin.settings.popupShare=t("#popupShare").prop("checked"),mmpAdmin.settings.popupMinWidth=parseInt(t("#popupMinWidth").val()),mmpAdmin.settings.popupMaxWidth=parseInt(t("#popupMaxWidth").val()),mmpAdmin.settings.popupMaxHeight=parseInt(t("#popupMaxHeight").val()),mmpAdmin.updatePopups()})),t("#showCoverageOnHover, #spiderfyDistanceMultiplier, #spiderfyOnEveryZoom").on("change",(function(){mmpAdmin.settings.clustering&&(mmpAdmin.markerGroup.remove(),mmpAdmin.markerGroup.options.showCoverageOnHover=t("#showCoverageOnHover").prop("checked"),mmpAdmin.markerGroup.options.spiderfyDistanceMultiplier=parseFloat(t("#spiderfyDistanceMultiplier").val()),mmpAdmin.markerGroup.options.spiderfyOnEveryZoom=t("#spiderfyOnEveryZoom").prop("checked"),mmpAdmin.markerGroup.addTo(mmpAdmin.map))})),t("#list, #listWidth, #listBreakpoint").on("change",(function(){var e=mmpAdmin.settings.list,i=parseInt(t("#list").val());mmpAdmin.settings.list=i;var n=parseInt(t("#listWidth").val());mmpAdmin.settings.listWidth=n,mmpAdmin.containers.list&&(mmpAdmin.containers.list.style.flexBasis=n+"px"),mmpAdmin.settings.listBreakpoint=parseInt(t("#listBreakpoint").val()),mmpAdmin.setLayout(),(0===e&&i>0||e>0&&0===i)&&(mmpAdmin.loadList(),mmpAdmin.getList(),mmpAdmin.setLayout())})),t("#listFitVisible, #listSearch, #listIcon, #listName, #listDate, #listDatePrefix, #listPopup, #listAddress, #listCoordinates, #listDistance").on("change",(function(){mmpAdmin.settings[t(this).attr("id")]=t(this).prop("checked"),mmpAdmin.loadList(),mmpAdmin.getList()})),t("#listDateType, #listDateFormat").on("change",(function(){mmpAdmin.settings.listDateType=t("#listDateType").val(),mmpAdmin.settings.listDateFormat=t("#listDateFormat").val(),mmpAdmin.loadList(),mmpAdmin.getList()})),t("#listDir, #listFs, #listShare").on("change",(function(){mmpAdmin.settings.listDir=t("#listDir").prop("checked"),mmpAdmin.settings.listFs=t("#listFs").prop("checked"),mmpAdmin.settings.listShare=t("#listShare").prop("checked"),mmpAdmin.loadList(),mmpAdmin.getList()})),t("#listDistanceUnit, #listDistancePrecision, #listOrderBy, #listSortOrder, #listLimit, #listAction").on("change",(function(){mmpAdmin.settings.listDistanceUnit=t("#listDistanceUnit").val(),mmpAdmin.settings.listDistancePrecision=parseInt(t("#listDistancePrecision").val()),mmpAdmin.settings.listOrderBy=t("#listOrderBy").val(),mmpAdmin.settings.listSortOrder=t("#listSortOrder").val(),mmpAdmin.settings.listLimit=parseInt(t("#listLimit").val()),mmpAdmin.settings.listAction=t("#listAction").val(),mmpAdmin.loadList(),mmpAdmin.getList()})),t("#listOrderById, #listOrderByName, #listOrderByAddress, #listOrderByDistance, #listOrderByIcon, #listOrderByPublished, #listOrderByUpdated").on("change",(function(){mmpAdmin.settings[t(this).attr("id")]=t(this).prop("checked"),mmpAdmin.loadList(),mmpAdmin.getList()})),t("#listLocation").on("change",(function(){mmpAdmin.settings.listLocation=t(this).prop("checked"),mmpAdmin.loadList(),mmpAdmin.getList()})),t("#listGeocodingShowMarker").on("change",(function(){mmpAdmin.settings.listGeocodingShowMarker=t("#listGeocodingShowMarker").prop("checked"),M()})),t(".mmp-list-geocoding-icon").on("click",(function(){t("#iconTarget").val("list-geocoding"),t("#icons").show()})),t("#listGeocodingZoom").on("change",(function(){mmpAdmin.settings.listGeocodingZoom=parseFloat(t(this).val())})),t("#listGeocodingDrawCircle").on("change",(function(){mmpAdmin.settings.listGeocodingDrawCircle=t(this).prop("checked"),mmpAdmin.updateCircle()})),t("#listGeocodingStroke").on("change",(function(){mmpAdmin.settings.listGeocodingStroke=t(this).prop("checked"),mmpAdmin.updateCircle()})),t("#listGeocodingWeight").on("change",(function(){mmpAdmin.settings.listGeocodingWeight=parseInt(t(this).val()),mmpAdmin.updateCircle()})),t("#listGeocodingColor").spectrum({preferredFormat:"hex3",showInput:!0,show:function(){t(this).data("changed",!1)},move:function(t){l(t.toHexString("hex3"))},change:function(e){t(this).data("changed",!0),l(e.toHexString("hex3"))},hide:function(e){t(this).data("changed")?l(e.toHexString("hex3")):l(t(this).val())}}),t("#listGeocodingFill").on("change",(function(){mmpAdmin.settings.listGeocodingFill=t(this).prop("checked"),mmpAdmin.updateCircle()})),t("#listGeocodingFillColor").spectrum({preferredFormat:"hex3",showInput:!0,show:function(){t(this).data("changed",!1)},move:function(t){h(t.toHexString("hex3"))},change:function(e){t(this).data("changed",!0),h(e.toHexString("hex3"))},hide:function(e){t(this).data("changed")?h(e.toHexString("hex3")):h(t(this).val())}}),t("#listGeocodingFillOpacity").on("change",(function(){mmpAdmin.settings.listGeocodingFillOpacity=parseFloat(t(this).val()),mmpAdmin.updateCircle()})),t("#shareUrl, #shareText, #shareFacebook, #shareTwitter, #shareLinkedIn, #shareWhatsApp, #shareEmail").on("change",(function(){mmpAdmin.settings.shareUrl=t("#shareUrl").val(),mmpAdmin.settings.shareText=t("#shareText").val(),mmpAdmin.settings.popupShare=t("#popupShare").prop("checked"),mmpAdmin.settings.listShare=t("#listShare").prop("checked"),mmpAdmin.settings.shareFacebook=t("#shareFacebook").prop("checked"),mmpAdmin.settings.shareTwitter=t("#shareTwitter").prop("checked"),mmpAdmin.settings.shareLinkedIn=t("#shareLinkedIn").prop("checked"),mmpAdmin.settings.shareWhatsApp=t("#shareWhatsApp").prop("checked"),mmpAdmin.settings.shareEmail=t("#shareEmail").prop("checked")})),t("#responsive").on("change",(function(){mmpAdmin.settings.responsive=t(this).prop("checked"),mmpAdmin.setLayout()})),t("#boxZoom").on("change",(function(){t(this).prop("checked")?mmpAdmin.map.boxZoom.enable():mmpAdmin.map.boxZoom.disable()})),t("#doubleClickZoom").on("change",(function(){t(this).prop("checked")?mmpAdmin.map.doubleClickZoom.enable():mmpAdmin.map.doubleClickZoom.disable()})),t("#dragging").on("change",(function(){t(this).prop("checked")?mmpAdmin.map.dragging.enable():mmpAdmin.map.dragging.disable()})),t("#inertia, #inertiaDeceleration, #inertiaMaxSpeed").on("change",(function(){mmpAdmin.map.options.inertia=t("#inertia").prop("checked"),mmpAdmin.map.options.inertiaDeceleration=parseInt(t("#inertiaDeceleration").val()),mmpAdmin.map.options.inertiaMaxSpeed=parseInt(t("#inertiaMaxSpeed").val())})),t("#keyboard").on("change",(function(){t(this).prop("checked")?mmpAdmin.map.keyboard.enable():mmpAdmin.map.keyboard.disable()})),t("#scrollWheelZoom").on("change",(function(){t(this).prop("checked")?mmpAdmin.map.scrollWheelZoom.enable():mmpAdmin.map.scrollWheelZoom.disable()})),t("#touchZoom").on("change",(function(){t(this).prop("checked")?mmpAdmin.map.touchZoom.enable():mmpAdmin.map.touchZoom.disable()})),t("#updateGpx").on("click",(function(){var e=t("#gpxUrl").val();mmpAdmin.settings.gpxUrl=e,e?(mmpAdmin.on("gpxloaded",z),mmpAdmin.getGpx().then(mmpAdmin.loadControls)):(mmpAdmin.off("gpxloaded",z),mmpAdmin.gpx={},mmpAdmin.addGpx(),mmpAdmin.loadControls())})),t("#gpxShowStartIcon, #gpxShowEndIcon").on("change",(function(){mmpAdmin.settings.gpxShowStartIcon=t("#gpxShowStartIcon").prop("checked"),mmpAdmin.settings.gpxShowEndIcon=t("#gpxShowEndIcon").prop("checked"),mmpAdmin.setTrackIcons()})),t("#gpxIntervalMarkers").on("change",(function(){mmpAdmin.settings.gpxIntervalMarkers=t(this).prop("checked"),mmpAdmin.setIntervalMarkers()})),t("#gpxTrackWeight").on("change",(function(){mmpAdmin.settings.gpxTrackWeight=parseInt(t(this).val()),mmpAdmin.setTrackStyle()})),t("#gpxTrackOpacity").on("change",(function(){mmpAdmin.settings.gpxTrackOpacity=parseFloat(t(this).val()),mmpAdmin.setTrackStyle()})),t("#gpxMeta, #gpxMetaUnits, #gpxMetaHideMissing").on("change",(function(){mmpAdmin.settings.gpxMeta=t("#gpxMeta").prop("checked"),mmpAdmin.settings.gpxMetaUnits=t("#gpxMetaUnits").val(),mmpAdmin.settings.gpxMetaHideMissing=t("#gpxMetaHideMissing").prop("checked"),mmpAdmin.setTrackMeta()})),t("#gpxMetaName, #gpxMetaDesc, #gpxMetaStart, #gpxMetaEnd, #gpxMetaTotal, #gpxMetaMoving, #gpxMetaDistance, #gpxMetaPace, #gpxMetaHeartRate, #gpxMetaElevation, #gpxMetaDownload").on("change",(function(){mmpAdmin.settings[t(this).attr("id")]=t(this).prop("checked"),mmpAdmin.setTrackMeta()})),t("#gpxWaypoints").on("change",(function(){mmpAdmin.settings.gpxWaypoints=t(this).prop("checked"),mmpAdmin.setWaypoints()})),t("#gpxWaypointsRadius").on("change",(function(){mmpAdmin.settings.gpxWaypointsRadius=parseInt(t(this).val()),mmpAdmin.setWaypointStyle()})),t("#gpxWaypointsStroke").on("change",(function(){mmpAdmin.settings.gpxWaypointsStroke=t(this).prop("checked"),mmpAdmin.setWaypointStyle()})),t("#gpxWaypointsWeight").on("change",(function(){mmpAdmin.settings.gpxWaypointsWeight=parseInt(t(this).val()),mmpAdmin.setWaypointStyle()})),t("#gpxWaypointsFillOpacity").on("change",(function(){mmpAdmin.settings.gpxWaypointsFillOpacity=parseFloat(t(this).val()),mmpAdmin.setWaypointStyle()})),t("#gpxChart").on("change",(function(){mmpAdmin.settings.gpxChart=t(this).prop("checked"),mmpAdmin.loadChart(),mmpAdmin.addElevationChart()})),t("#gpxChartUnits, #gpxChartYOffset").on("change",(function(){mmpAdmin.settings.gpxChartUnits=t(this).val(),mmpAdmin.settings.gpxChartYOffset=t("#gpxChartYOffset").val(),mmpAdmin.updateElevationChart(!0)})),t("#gpxChartHeight").on("change",(function(){var e=parseInt(t(this).val());mmpAdmin.settings.gpxChartHeight=e,mmpAdmin.containers.chartWrap&&(mmpAdmin.containers.chartWrap.style.height=e+"px")})),t("#gpxChartReverseX, #gpxChartReverseY").on("change",(function(){mmpAdmin.settings.gpxChartReverseX=t("#gpxChartReverseX").prop("checked"),mmpAdmin.settings.gpxChartReverseY=t("#gpxChartReverseY").prop("checked"),mmpAdmin.updateElevationChart()})),t("#gpxChartYMin, #gpxChartYMax").on("change",(function(){mmpAdmin.settings.gpxChartYMin=t("#gpxChartYMin").val(),mmpAdmin.settings.gpxChartYMax=t("#gpxChartYMax").val(),mmpAdmin.updateElevationChart()})),t("#gpxChartBgColor").spectrum({preferredFormat:"rgb",showAlpha:!0,showInput:!0,show:function(){t(this).data("changed",!1)},move:function(t){mmpAdmin.settings.gpxChartBgColor=t.toRgbString(),mmpAdmin.updateElevationChartThrottled()},change:function(e){t(this).data("changed",!0),mmpAdmin.settings.gpxChartBgColor=e.toRgbString(),mmpAdmin.updateElevationChartThrottled()},hide:function(e){t(this).data("changed")?mmpAdmin.settings.gpxChartBgColor=e.toRgbString():mmpAdmin.settings.gpxChartBgColor=t(this).val(),mmpAdmin.updateElevationChartThrottled()}}),t("#gpxChartGridLinesColor").spectrum({preferredFormat:"rgb",showAlpha:!0,showInput:!0,show:function(){t(this).data("changed",!1)},move:function(t){mmpAdmin.settings.gpxChartGridLinesColor=t.toRgbString(),mmpAdmin.updateElevationChartThrottled()},change:function(e){t(this).data("changed",!0),mmpAdmin.settings.gpxChartGridLinesColor=e.toRgbString(),mmpAdmin.updateElevationChartThrottled()},hide:function(e){t(this).data("changed")?mmpAdmin.settings.gpxChartGridLinesColor=e.toRgbString():mmpAdmin.settings.gpxChartGridLinesColor=t(this).val(),mmpAdmin.updateElevationChartThrottled()}}),t("#gpxChartTicksFontColor").spectrum({preferredFormat:"rgb",showAlpha:!0,showInput:!0,show:function(){t(this).data("changed",!1)},move:function(t){mmpAdmin.settings.gpxChartTicksFontColor=t.toRgbString(),mmpAdmin.updateElevationChartThrottled()},change:function(e){t(this).data("changed",!0),mmpAdmin.settings.gpxChartTicksFontColor=e.toRgbString(),mmpAdmin.updateElevationChartThrottled()},hide:function(e){t(this).data("changed")?mmpAdmin.settings.gpxChartTicksFontColor=e.toRgbString():mmpAdmin.settings.gpxChartTicksFontColor=t(this).val(),mmpAdmin.updateElevationChartThrottled()}}),t("#gpxChartLineWidth").on("change",(function(){mmpAdmin.settings.gpxChartLineWidth=parseInt(t(this).val()),mmpAdmin.updateElevationChartThrottled()})),t("#gpxChartLineColor").spectrum({preferredFormat:"rgb",showAlpha:!0,showInput:!0,show:function(){t(this).data("changed",!1)},move:function(t){mmpAdmin.settings.gpxChartLineColor=t.toRgbString(),mmpAdmin.updateElevationChartThrottled()},change:function(e){t(this).data("changed",!0),mmpAdmin.settings.gpxChartLineColor=e.toRgbString(),mmpAdmin.updateElevationChartThrottled()},hide:function(e){t(this).data("changed")?mmpAdmin.settings.gpxChartLineColor=e.toRgbString():mmpAdmin.settings.gpxChartLineColor=t(this).val(),mmpAdmin.updateElevationChartThrottled()}}),t("#gpxChartFill").on("change",(function(){mmpAdmin.settings.gpxChartFill=t(this).prop("checked"),mmpAdmin.updateElevationChartThrottled()})),t("#gpxChartFillColor").spectrum({preferredFormat:"rgb",showAlpha:!0,showInput:!0,show:function(){t(this).data("changed",!1)},move:function(t){mmpAdmin.settings.gpxChartFillColor=t.toRgbString(),mmpAdmin.updateElevationChartThrottled()},change:function(e){t(this).data("changed",!0),mmpAdmin.settings.gpxChartFillColor=e.toRgbString(),mmpAdmin.updateElevationChartThrottled()},hide:function(e){t(this).data("changed")?mmpAdmin.settings.gpxChartFillColor=e.toRgbString():mmpAdmin.settings.gpxChartFillColor=t(this).val(),mmpAdmin.updateElevationChartThrottled()}}),t("#gpxChartTooltipBgColor").spectrum({preferredFormat:"rgb",showAlpha:!0,showInput:!0,show:function(){t(this).data("changed",!1)},move:function(t){mmpAdmin.settings.gpxChartTooltipBgColor=t.toRgbString(),mmpAdmin.updateElevationChartThrottled()},change:function(e){t(this).data("changed",!0),mmpAdmin.settings.gpxChartTooltipBgColor=e.toRgbString(),mmpAdmin.updateElevationChartThrottled()},hide:function(e){t(this).data("changed")?mmpAdmin.settings.gpxChartTooltipBgColor=e.toRgbString():mmpAdmin.settings.gpxChartTooltipBgColor=t(this).val(),mmpAdmin.updateElevationChartThrottled()}}),t("#gpxChartTooltipFontColor").spectrum({preferredFormat:"rgb",showAlpha:!0,showInput:!0,show:function(){t(this).data("changed",!1)},move:function(t){mmpAdmin.settings.gpxChartTooltipFontColor=t.toRgbString(),mmpAdmin.updateElevationChartThrottled()},change:function(e){t(this).data("changed",!0),mmpAdmin.settings.gpxChartTooltipFontColor=e.toRgbString(),mmpAdmin.updateElevationChartThrottled()},hide:function(e){t(this).data("changed")?mmpAdmin.settings.gpxChartTooltipFontColor=e.toRgbString():mmpAdmin.settings.gpxChartTooltipFontColor=t(this).val(),mmpAdmin.updateElevationChartThrottled()}}),t("#gpxChartIndicatorLineWidth").on("change",(function(){mmpAdmin.settings.gpxChartIndicatorLineWidth=parseInt(t(this).val()),mmpAdmin.updateElevationChartThrottled()})),t("#gpxChartIndicatorLineColor").spectrum({preferredFormat:"rgb",showAlpha:!0,showInput:!0,show:function(){t(this).data("changed",!1)},move:function(t){mmpAdmin.settings.gpxChartIndicatorLineColor=t.toRgbString(),mmpAdmin.updateElevationChartThrottled()},change:function(e){t(this).data("changed",!0),mmpAdmin.settings.gpxChartIndicatorLineColor=e.toRgbString(),mmpAdmin.updateElevationChartThrottled()},hide:function(e){t(this).data("changed")?mmpAdmin.settings.gpxChartIndicatorLineColor=e.toRgbString():mmpAdmin.settings.gpxChartIndicatorLineColor=t(this).val(),mmpAdmin.updateElevationChartThrottled()}}),t("#gpxChartLocator").on("change",(function(){mmpAdmin.settings.gpxChartLocator=t(this).prop("checked")})),t("#gpxChartLocatorRadius").on("change",(function(){mmpAdmin.settings.gpxChartLocatorRadius=parseInt(t(this).val()),mmpAdmin.setChartStyle()})),t("#gpxChartLocatorStroke").on("change",(function(){mmpAdmin.settings.gpxChartLocatorStroke=t(this).prop("checked"),mmpAdmin.setChartStyle()})),t("#gpxChartLocatorColor").spectrum({preferredFormat:"hex3",showInput:!0,show:function(){t(this).data("changed",!1)},move:function(t){d(t.toHexString("hex3"))},change:function(e){t(this).data("changed",!0),d(e.toHexString("hex3"))},hide:function(e){t(this).data("changed")?d(e.toHexString("hex3")):d(t(this).val())}}),t("#gpxChartLocatorWeight").on("change",(function(){mmpAdmin.settings.gpxChartLocatorWeight=parseInt(t(this).val()),mmpAdmin.setChartStyle()})),t("#gpxChartLocatorFillColor").spectrum({preferredFormat:"hex3",showInput:!0,show:function(){t(this).data("changed",!1)},move:function(t){m(t.toHexString("hex3"))},change:function(e){t(this).data("changed",!0),m(e.toHexString("hex3"))},hide:function(e){t(this).data("changed")?m(e.toHexString("hex3")):m(t(this).val())}}),t("#gpxChartLocatorFillOpacity").on("change",(function(){mmpAdmin.settings.gpxChartLocatorFillOpacity=parseFloat(t(this).val()),mmpAdmin.setChartStyle()})),t("#addGeoJson").on("click",(function(){t("#geoJsonModal").slideDown(500)})),t("#geoJsonCancel").on("click",(function(){t(".mmp-json-error").remove(),t("#geoJsonText").val(""),t("#geoJsonModal").slideUp(500)})),t("#geoJsonSave").on("click",(function(){t(".mmp-json-error").remove();var e=Is(t("#geoJsonText").val());if(e instanceof Error||!1===e)t('<div class="notice notice-error mmp-json-error"><p>'+mmpAdminL10n.map.invalidJson+"</p></div>").prependTo("#geoJsonModal").delay(5e3).fadeOut(500,(function(){t(this).remove()}));else{try{!function(t){cr().geoJSON(t,{pointToLayer:function(t,e){if(t.properties.radius)return cr().circle(e,t.properties.radius)},style:function(t){for(var e=I(),i=["stroke","color","weight","opacity","lineCap","lineJoin","fill","fillColor","fillOpacity","fillRule"],n=0;n<i.length;n++){var o=i[n];if(void 0!==t.properties[o])switch(o){case"weight":e[o]=parseInt(t.properties[o]);break;case"opacity":case"fillOpacity":e[o]=parseFloat(t.properties[o]);break;default:e[o]=t.properties[o]}}return e},onEachFeature:function(t,e){var i=D(e);!1!==i&&(e instanceof cr().Polyline&&!t.geometry.coordinates.length||(!(e instanceof cr().Polygon)||t.geometry.coordinates.length&&t.geometry.coordinates[0].length&&null!==t.geometry.coordinates[0][0])&&(e.options.name=t.properties.name||mmpAdminL10n.geoJson[i.toLowerCase()],e.options.popup=t.properties.popup||"",e.addTo(mmpAdmin.map),e.addTo(mmpAdmin.geoJson[mmpAdmin.id])))}}),A()}(e)}catch(e){return void t('<div class="notice notice-error mmp-json-error"><p>'+mmpAdminL10n.map.invalidGeoJson+"</p></div>").prependTo("#geoJsonModal").delay(5e3).fadeOut(500,(function(){t(this).remove()}))}t("#geoJsonText").val(""),t("#geoJsonModal").slideUp(500)}})),t("#drawStrokeColor").spectrum({preferredFormat:"hex3",showInput:!0,show:function(){t("#drawStroke").prop("checked",!0),t("#drawStroke").trigger("change")},change:function(e){t("#drawStrokeColor").val(e.toHexString("hex3")),S()}}),t("#editDrawStrokeColor").spectrum({preferredFormat:"hex3",showInput:!0,show:function(){t("#editDrawStroke").prop("checked",!0),t("#editDrawStroke").trigger("change")},move:function(e){t("#editDrawStrokeColor").val(e.toHexString("hex3")),O()},change:function(e){t("#editDrawStrokeColor").val(e.toHexString("hex3")),O()},hide:function(e){t("#editDrawStrokeColor").val(e.toHexString("hex3")),O()}}),t("#drawFillColor").spectrum({preferredFormat:"hex3",showInput:!0,show:function(){t("#drawFill").prop("checked",!0),t("#drawFill").trigger("change")},change:function(e){t("#drawFillColor").val(e.toHexString("hex3")),S()}}),t("#editDrawFillColor").spectrum({preferredFormat:"hex3",showInput:!0,show:function(){t("#editDrawFill").prop("checked",!0),t("#editDrawFill").trigger("change")},move:function(e){t("#editDrawFillColor").val(e.toHexString("hex3")),O()},change:function(e){t("#editDrawFillColor").val(e.toHexString("hex3")),O()},hide:function(e){t("#editDrawFillColor").val(e.toHexString("hex3")),O()}}),t("#drawStroke, #drawStrokeWeight, #drawStrokeOpacity, #drawLineCap, #drawLineJoin, #drawFill, #drawFillOpacity, #drawFillRule").on("change",(function(){S()})),t("#editDrawStroke, #editDrawStrokeWeight, #editDrawStrokeOpacity, #editDrawLineCap, #editDrawLineJoin, #editDrawFill, #editDrawFillOpacity, #editDrawFillRule").on("change",(function(){O()})),t("#editDrawCancel").on("click",(function(){R(),t("#editShape").slideUp(500)})),t("#editDrawSave").on("click",(function(){O();var e=mmpAdmin.geoJson[mmpAdmin.id].getLayer(t("#shapeId").val());void 0!==e&&(e.options.popup=t("#editDrawPopup").val(),mmpAdmin.updatePopup(e,!0)),t("#shapeBackup").val(""),t("#editShape").slideUp(500)})),t("#editDrawDelete").on("click",(function(){R();var e=mmpAdmin.geoJson[mmpAdmin.id].getLayer(t("#shapeId").val());void 0!==e&&(t("#editShape").hide(),t("#editShape").appendTo(t("#mmp-tabDraw-settings")),mmpAdmin.geoJson[mmpAdmin.id].removeLayer(e),A())})),t("#shapesSelectAll").on("click",(function(){t('input[name="shapesSelected[]"]').each((function(e,i){t(i).prop("checked",t("#shapesSelectAll").prop("checked"))}))})),t("#shapesDeleteSelected").on("click",(function(){R(),t("#editShape").hide(),t("#editShape").appendTo(t("#mmp-tabDraw-settings")),t('input[name="shapesSelected[]"]:checked').each((function(e,i){mmpAdmin.geoJson[mmpAdmin.id].removeLayer(parseInt(t(i).val()))})),A()})),t(".mmp-admin-modal, .mmp-admin-modal-close").on("click",(function(e){e.target===this&&t("#icons").hide()})),t("#geocodingProvider").on("change",(function(){n.provider=t("#geocodingProvider").val(),n.autocomplete.start(),n.autocomplete.input.focus()})),t(".mmp-shortcode").on("click",(function(){t(this).trigger("select")})),o(),n.init(),window.onbeforeunload=function(){return e!==t("#mapSettings").serialize()?"":null},localStorage.getItem("saved")&&(t('<div class="notice notice-success"><p>'+mmpAdminL10n.map.saved+"</p></div>").insertBefore(".mmp-main").delay(5e3).fadeOut(500,(function(){t(this).remove()})),localStorage.removeItem("saved")),t("#save").prop("disabled",!1)}(jQuery)},Ys=i(873),Js=i.n(Ys);var Xs=function(){!function(t){t("#select-all").on("click",(function(){var e=t(this).prop("checked");t('.mmp-table input[name="selected[]"]').each((function(i,n){t(n).prop("checked",e)}))})),t('input[name="selected[]"]').on("change",(function(){var e=!0;t('input[name="selected[]"]').each((function(i,n){e=e&&t(n).prop("checked")})),t("#select-all").prop("checked",e)})),t(".mmp-table .mmp-delete").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_delete_map",nonce:t(this).data("nonce"),id:t(this).data("id"),con:0}}).done((function(e){if(e.success){if(!confirm(e.data.message))return;t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_delete_map",nonce:e.data.nonce,id:e.data.id,con:1}}).done((function(){window.location.reload()}))}}))})),t(".mmp-table .mmp-shortcode").on("click",(function(){t(this).trigger("select")})),t(".mmp-table .mmp-qrcode-link").on("click",(function(e){e.preventDefault(),e.stopPropagation();var i=Js()(0,"H"),n=t(this).data("url");i.addData(n),i.make();var o=i.createDataURL(8,0),r=t(this).data("id"),s=t("#qrcode_"+r),a=t('<a href="'+o+'" download="qr-code-map-'+r+'.gif"><img src="'+o+'" /></a>');s.html(a),t("img",s).trigger("click")})),t("#bulk-actions").on("submit",(function(e){var i;e.preventDefault(),e.stopPropagation();var n=t("input[name=bulk-action]:checked").val(),o=t("#assign-target").val();switch(n){case"duplicate":i=mmpAdminL10n.maps.bulkDuplicate;break;case"duplicate-assign":i=mmpAdminL10n.maps.bulkDuplicateAssign;break;case"delete":i=mmpAdminL10n.maps.bulkDelete;break;case"delete-assign":i=mmpAdminL10n.maps.bulkDeleteAssign.replace("{map}",o);break;case"delete-delete":i=mmpAdminL10n.maps.bulkDeleteDelete;break;default:return}if(confirm(i)){var r=[];t('input[name="selected[]"]:checked').each((function(){r.push(t(this).val())})),t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_bulk_action_maps",nonce:t("#bulk-action-nonce").val(),bulkAction:n,assignTarget:o,selected:r.join(",")}}).done((function(){window.location.reload()}))}})),t("#adv-settings").on("submit",(function(e){e.preventDefault(),e.stopPropagation(),t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_maps_screen_options",nonce:t("#screenoptionnonce").val(),hiddenColumns:t(".mmp-maps-column").not(":checked").map((function(){return t(this).val()})).get(),perPage:t("#maps-per-page").val()}}).done((function(){window.location.reload()}))}))}(jQuery)},Qs=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ta={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(t){return"undefined"!=typeof console&&console.warn(t)},getWeek:function(t){var e=new Date(t.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var i=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},ea={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var e=t%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},ia=ea,na=function(t,e){return void 0===e&&(e=2),("000"+t).slice(-1*e)},oa=function(t){return!0===t?1:0};function ra(t,e){var i;return function(){var n=this,o=arguments;clearTimeout(i),i=setTimeout((function(){return t.apply(n,o)}),e)}}var sa=function(t){return t instanceof Array?t:[t]};function aa(t,e,i){if(!0===i)return t.classList.add(e);t.classList.remove(e)}function la(t,e,i){var n=window.document.createElement(t);return e=e||"",i=i||"",n.className=e,void 0!==i&&(n.textContent=i),n}function ha(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ca(t,e){return e(t)?t:t.parentNode?ca(t.parentNode,e):void 0}function pa(t,e){var i=la("div","numInputWrapper"),n=la("input","numInput "+t),o=la("span","arrowUp"),r=la("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?n.type="number":(n.type="text",n.pattern="\\d*"),void 0!==e)for(var s in e)n.setAttribute(s,e[s]);return i.appendChild(n),i.appendChild(o),i.appendChild(r),i}function ua(t){try{return"function"==typeof t.composedPath?t.composedPath()[0]:t.target}catch(e){return t.target}}var da=function(){},ma=function(t,e,i){return i.months[e?"shorthand":"longhand"][t]},fa={D:da,F:function(t,e,i){t.setMonth(i.months.longhand.indexOf(e))},G:function(t,e){t.setHours((t.getHours()>=12?12:0)+parseFloat(e))},H:function(t,e){t.setHours(parseFloat(e))},J:function(t,e){t.setDate(parseFloat(e))},K:function(t,e,i){t.setHours(t.getHours()%12+12*oa(new RegExp(i.amPM[1],"i").test(e)))},M:function(t,e,i){t.setMonth(i.months.shorthand.indexOf(e))},S:function(t,e){t.setSeconds(parseFloat(e))},U:function(t,e){return new Date(1e3*parseFloat(e))},W:function(t,e,i){var n=parseInt(e),o=new Date(t.getFullYear(),0,2+7*(n-1),0,0,0,0);return o.setDate(o.getDate()-o.getDay()+i.firstDayOfWeek),o},Y:function(t,e){t.setFullYear(parseFloat(e))},Z:function(t,e){return new Date(e)},d:function(t,e){t.setDate(parseFloat(e))},h:function(t,e){t.setHours((t.getHours()>=12?12:0)+parseFloat(e))},i:function(t,e){t.setMinutes(parseFloat(e))},j:function(t,e){t.setDate(parseFloat(e))},l:da,m:function(t,e){t.setMonth(parseFloat(e)-1)},n:function(t,e){t.setMonth(parseFloat(e)-1)},s:function(t,e){t.setSeconds(parseFloat(e))},u:function(t,e){return new Date(parseFloat(e))},w:da,y:function(t,e){t.setFullYear(2e3+parseFloat(e))}},ga={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},_a={Z:function(t){return t.toISOString()},D:function(t,e,i){return e.weekdays.shorthand[_a.w(t,e,i)]},F:function(t,e,i){return ma(_a.n(t,e,i)-1,!1,e)},G:function(t,e,i){return na(_a.h(t,e,i))},H:function(t){return na(t.getHours())},J:function(t,e){return void 0!==e.ordinal?t.getDate()+e.ordinal(t.getDate()):t.getDate()},K:function(t,e){return e.amPM[oa(t.getHours()>11)]},M:function(t,e){return ma(t.getMonth(),!0,e)},S:function(t){return na(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,e,i){return i.getWeek(t)},Y:function(t){return na(t.getFullYear(),4)},d:function(t){return na(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return na(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,e){return e.weekdays.longhand[t.getDay()]},m:function(t){return na(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}},va=function(t){var e=t.config,i=void 0===e?ta:e,n=t.l10n,o=void 0===n?ea:n,r=t.isMobile,s=void 0!==r&&r;return function(t,e,n){var r=n||o;return void 0===i.formatDate||s?e.split("").map((function(e,n,o){return _a[e]&&"\\"!==o[n-1]?_a[e](t,r,i):"\\"!==e?e:""})).join(""):i.formatDate(t,e,r)}},ya=function(t){var e=t.config,i=void 0===e?ta:e,n=t.l10n,o=void 0===n?ea:n;return function(t,e,n,r){if(0===t||t){var s,a=r||o,l=t;if(t instanceof Date)s=new Date(t.getTime());else if("string"!=typeof t&&void 0!==t.toFixed)s=new Date(t);else if("string"==typeof t){var h=e||(i||ta).dateFormat,c=String(t).trim();if("today"===c)s=new Date,n=!0;else if(i&&i.parseDate)s=i.parseDate(t,h);else if(/Z$/.test(c)||/GMT$/.test(c))s=new Date(t);else{for(var p=void 0,u=[],d=0,m=0,f="";d<h.length;d++){var g=h[d],_="\\"===g,v="\\"===h[d-1]||_;if(ga[g]&&!v){f+=ga[g];var y=new RegExp(f).exec(t);y&&(p=!0)&&u["Y"!==g?"push":"unshift"]({fn:fa[g],val:y[++m]})}else _||(f+=".")}s=i&&i.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),u.forEach((function(t){var e=t.fn,i=t.val;return s=e(s,i,a)||s})),s=p?s:void 0}}if(s instanceof Date&&!isNaN(s.getTime()))return!0===n&&s.setHours(0,0,0,0),s;i.errorHandler(new Error("Invalid date provided: "+l))}}};function ba(t,e,i){return void 0===i&&(i=!0),!1!==i?new Date(t.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):t.getTime()-e.getTime()}var xa=function(t,e,i){return t>Math.min(e,i)&&t<Math.max(e,i)},ka=function(t,e,i){return 3600*t+60*e+i},La=function(t){var e=Math.floor(t/3600),i=(t-3600*e)/60;return[e,i,t-3600*e-60*i]},wa={DAY:864e5};function Ma(t){var e=t.defaultHour,i=t.defaultMinute,n=t.defaultSeconds;if(void 0!==t.minDate){var o=t.minDate.getHours(),r=t.minDate.getMinutes(),s=t.minDate.getSeconds();e<o&&(e=o),e===o&&i<r&&(i=r),e===o&&i===r&&n<s&&(n=t.minDate.getSeconds())}if(void 0!==t.maxDate){var a=t.maxDate.getHours(),l=t.maxDate.getMinutes();(e=Math.min(e,a))===a&&(i=Math.min(l,i)),e===a&&i===l&&(n=t.maxDate.getSeconds())}return{hours:e,minutes:i,seconds:n}}i(990);var Ca=function(){return Ca=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ca.apply(this,arguments)},Pa=function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<i;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,o++)n[o]=r[s];return n},Sa=300;function Ta(t,e){var i={config:Ca(Ca({},ta),Da.defaultConfig),l10n:ia};function n(){var t;return(null===(t=i.calendarContainer)||void 0===t?void 0:t.getRootNode()).activeElement||document.activeElement}function o(t){return t.bind(i)}function r(){var t=i.config;!1===t.weekNumbers&&1===t.showMonths||!0!==t.noCalendar&&window.requestAnimationFrame((function(){if(void 0!==i.calendarContainer&&(i.calendarContainer.style.visibility="hidden",i.calendarContainer.style.display="block"),void 0!==i.daysContainer){var e=(i.days.offsetWidth+1)*t.showMonths;i.daysContainer.style.width=e+"px",i.calendarContainer.style.width=e+(void 0!==i.weekWrapper?i.weekWrapper.offsetWidth:0)+"px",i.calendarContainer.style.removeProperty("visibility"),i.calendarContainer.style.removeProperty("display")}}))}function s(t){if(0===i.selectedDates.length){var e=void 0===i.config.minDate||ba(new Date,i.config.minDate)>=0?new Date:new Date(i.config.minDate.getTime()),n=Ma(i.config);e.setHours(n.hours,n.minutes,n.seconds,e.getMilliseconds()),i.selectedDates=[e],i.latestSelectedDateObj=e}void 0!==t&&"blur"!==t.type&&function(t){t.preventDefault();var e="keydown"===t.type,n=ua(t),o=n;void 0!==i.amPM&&n===i.amPM&&(i.amPM.textContent=i.l10n.amPM[oa(i.amPM.textContent===i.l10n.amPM[0])]);var r=parseFloat(o.getAttribute("min")),s=parseFloat(o.getAttribute("max")),a=parseFloat(o.getAttribute("step")),l=parseInt(o.value,10),h=t.delta||(e?38===t.which?1:-1:0),c=l+a*h;if(void 0!==o.value&&2===o.value.length){var p=o===i.hourElement,u=o===i.minuteElement;c<r?(c=s+c+oa(!p)+(oa(p)&&oa(!i.amPM)),u&&f(void 0,-1,i.hourElement)):c>s&&(c=o===i.hourElement?c-s-oa(!i.amPM):r,u&&f(void 0,1,i.hourElement)),i.amPM&&p&&(1===a?c+l===23:Math.abs(c-l)>a)&&(i.amPM.textContent=i.l10n.amPM[oa(i.amPM.textContent===i.l10n.amPM[0])]),o.value=na(c)}}(t);var o=i._input.value;a(),Q(),i._input.value!==o&&i._debouncedChange()}function a(){if(void 0!==i.hourElement&&void 0!==i.minuteElement){var t,e,n=(parseInt(i.hourElement.value.slice(-2),10)||0)%24,o=(parseInt(i.minuteElement.value,10)||0)%60,r=void 0!==i.secondElement?(parseInt(i.secondElement.value,10)||0)%60:0;void 0!==i.amPM&&(t=n,e=i.amPM.textContent,n=t%12+12*oa(e===i.l10n.amPM[1]));var s=void 0!==i.config.minTime||i.config.minDate&&i.minDateHasTime&&i.latestSelectedDateObj&&0===ba(i.latestSelectedDateObj,i.config.minDate,!0),a=void 0!==i.config.maxTime||i.config.maxDate&&i.maxDateHasTime&&i.latestSelectedDateObj&&0===ba(i.latestSelectedDateObj,i.config.maxDate,!0);if(void 0!==i.config.maxTime&&void 0!==i.config.minTime&&i.config.minTime>i.config.maxTime){var l=ka(i.config.minTime.getHours(),i.config.minTime.getMinutes(),i.config.minTime.getSeconds()),c=ka(i.config.maxTime.getHours(),i.config.maxTime.getMinutes(),i.config.maxTime.getSeconds()),p=ka(n,o,r);if(p>c&&p<l){var u=La(l);n=u[0],o=u[1],r=u[2]}}else{if(a){var d=void 0!==i.config.maxTime?i.config.maxTime:i.config.maxDate;(n=Math.min(n,d.getHours()))===d.getHours()&&(o=Math.min(o,d.getMinutes())),o===d.getMinutes()&&(r=Math.min(r,d.getSeconds()))}if(s){var m=void 0!==i.config.minTime?i.config.minTime:i.config.minDate;(n=Math.max(n,m.getHours()))===m.getHours()&&o<m.getMinutes()&&(o=m.getMinutes()),o===m.getMinutes()&&(r=Math.max(r,m.getSeconds()))}}h(n,o,r)}}function l(t){var e=t||i.latestSelectedDateObj;e&&e instanceof Date&&h(e.getHours(),e.getMinutes(),e.getSeconds())}function h(t,e,n){void 0!==i.latestSelectedDateObj&&i.latestSelectedDateObj.setHours(t%24,e,n||0,0),i.hourElement&&i.minuteElement&&!i.isMobile&&(i.hourElement.value=na(i.config.time_24hr?t:(12+t)%12+12*oa(t%12==0)),i.minuteElement.value=na(e),void 0!==i.amPM&&(i.amPM.textContent=i.l10n.amPM[oa(t>=12)]),void 0!==i.secondElement&&(i.secondElement.value=na(n)))}function c(t){var e=ua(t),i=parseInt(e.value)+(t.delta||0);(i/1e3>1||"Enter"===t.key&&!/[^\d]/.test(i.toString()))&&A(i)}function p(t,e,n,o){return e instanceof Array?e.forEach((function(e){return p(t,e,n,o)})):t instanceof Array?t.forEach((function(t){return p(t,e,n,o)})):(t.addEventListener(e,n,o),void i._handlers.push({remove:function(){return t.removeEventListener(e,n,o)}}))}function u(){$("onChange")}function d(t,e){var n=void 0!==t?i.parseDate(t):i.latestSelectedDateObj||(i.config.minDate&&i.config.minDate>i.now?i.config.minDate:i.config.maxDate&&i.config.maxDate<i.now?i.config.maxDate:i.now),o=i.currentYear,r=i.currentMonth;try{void 0!==n&&(i.currentYear=n.getFullYear(),i.currentMonth=n.getMonth())}catch(t){t.message="Invalid date supplied: "+n,i.config.errorHandler(t)}e&&i.currentYear!==o&&($("onYearChange"),k()),!e||i.currentYear===o&&i.currentMonth===r||$("onMonthChange"),i.redraw()}function m(t){var e=ua(t);~e.className.indexOf("arrow")&&f(t,e.classList.contains("arrowUp")?1:-1)}function f(t,e,i){var n=t&&ua(t),o=i||n&&n.parentNode&&n.parentNode.firstChild,r=K("increment");r.delta=e,o&&o.dispatchEvent(r)}function g(t,e,n,o){var r=D(e,!0),s=la("span",t,e.getDate().toString());return s.dateObj=e,s.$i=o,s.setAttribute("aria-label",i.formatDate(e,i.config.ariaDateFormat)),-1===t.indexOf("hidden")&&0===ba(e,i.now)&&(i.todayDateElem=s,s.classList.add("today"),s.setAttribute("aria-current","date")),r?(s.tabIndex=-1,Y(e)&&(s.classList.add("selected"),i.selectedDateElem=s,"range"===i.config.mode&&(aa(s,"startRange",i.selectedDates[0]&&0===ba(e,i.selectedDates[0],!0)),aa(s,"endRange",i.selectedDates[1]&&0===ba(e,i.selectedDates[1],!0)),"nextMonthDay"===t&&s.classList.add("inRange")))):s.classList.add("flatpickr-disabled"),"range"===i.config.mode&&function(t){return!("range"!==i.config.mode||i.selectedDates.length<2)&&(ba(t,i.selectedDates[0])>=0&&ba(t,i.selectedDates[1])<=0)}(e)&&!Y(e)&&s.classList.add("inRange"),i.weekNumbers&&1===i.config.showMonths&&"prevMonthDay"!==t&&o%7==6&&i.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+i.config.getWeek(e)+"</span>"),$("onDayCreate",s),s}function _(t){t.focus(),"range"===i.config.mode&&B(t)}function v(t){for(var e=t>0?0:i.config.showMonths-1,n=t>0?i.config.showMonths:-1,o=e;o!=n;o+=t)for(var r=i.daysContainer.children[o],s=t>0?0:r.children.length-1,a=t>0?r.children.length:-1,l=s;l!=a;l+=t){var h=r.children[l];if(-1===h.className.indexOf("hidden")&&D(h.dateObj))return h}}function y(t,e){var o=n(),r=E(o||document.body),s=void 0!==t?t:r?o:void 0!==i.selectedDateElem&&E(i.selectedDateElem)?i.selectedDateElem:void 0!==i.todayDateElem&&E(i.todayDateElem)?i.todayDateElem:v(e>0?1:-1);void 0===s?i._input.focus():r?function(t,e){for(var n=-1===t.className.indexOf("Month")?t.dateObj.getMonth():i.currentMonth,o=e>0?i.config.showMonths:-1,r=e>0?1:-1,s=n-i.currentMonth;s!=o;s+=r)for(var a=i.daysContainer.children[s],l=n-i.currentMonth===s?t.$i+e:e<0?a.children.length-1:0,h=a.children.length,c=l;c>=0&&c<h&&c!=(e>0?h:-1);c+=r){var p=a.children[c];if(-1===p.className.indexOf("hidden")&&D(p.dateObj)&&Math.abs(t.$i-c)>=Math.abs(e))return _(p)}i.changeMonth(r),y(v(r),0)}(s,e):_(s)}function b(t,e){for(var n=(new Date(t,e,1).getDay()-i.l10n.firstDayOfWeek+7)%7,o=i.utils.getDaysInMonth((e-1+12)%12,t),r=i.utils.getDaysInMonth(e,t),s=window.document.createDocumentFragment(),a=i.config.showMonths>1,l=a?"prevMonthDay hidden":"prevMonthDay",h=a?"nextMonthDay hidden":"nextMonthDay",c=o+1-n,p=0;c<=o;c++,p++)s.appendChild(g("flatpickr-day "+l,new Date(t,e-1,c),0,p));for(c=1;c<=r;c++,p++)s.appendChild(g("flatpickr-day",new Date(t,e,c),0,p));for(var u=r+1;u<=42-n&&(1===i.config.showMonths||p%7!=0);u++,p++)s.appendChild(g("flatpickr-day "+h,new Date(t,e+1,u%r),0,p));var d=la("div","dayContainer");return d.appendChild(s),d}function x(){if(void 0!==i.daysContainer){ha(i.daysContainer),i.weekNumbers&&ha(i.weekNumbers);for(var t=document.createDocumentFragment(),e=0;e<i.config.showMonths;e++){var n=new Date(i.currentYear,i.currentMonth,1);n.setMonth(i.currentMonth+e),t.appendChild(b(n.getFullYear(),n.getMonth()))}i.daysContainer.appendChild(t),i.days=i.daysContainer.firstChild,"range"===i.config.mode&&1===i.selectedDates.length&&B()}}function k(){if(!(i.config.showMonths>1||"dropdown"!==i.config.monthSelectorType)){var t=function(t){return!(void 0!==i.config.minDate&&i.currentYear===i.config.minDate.getFullYear()&&t<i.config.minDate.getMonth())&&!(void 0!==i.config.maxDate&&i.currentYear===i.config.maxDate.getFullYear()&&t>i.config.maxDate.getMonth())};i.monthsDropdownContainer.tabIndex=-1,i.monthsDropdownContainer.innerHTML="";for(var e=0;e<12;e++)if(t(e)){var n=la("option","flatpickr-monthDropdown-month");n.value=new Date(i.currentYear,e).getMonth().toString(),n.textContent=ma(e,i.config.shorthandCurrentMonth,i.l10n),n.tabIndex=-1,i.currentMonth===e&&(n.selected=!0),i.monthsDropdownContainer.appendChild(n)}}}function L(){var t,e=la("div","flatpickr-month"),n=window.document.createDocumentFragment();i.config.showMonths>1||"static"===i.config.monthSelectorType?t=la("span","cur-month"):(i.monthsDropdownContainer=la("select","flatpickr-monthDropdown-months"),i.monthsDropdownContainer.setAttribute("aria-label",i.l10n.monthAriaLabel),p(i.monthsDropdownContainer,"change",(function(t){var e=ua(t),n=parseInt(e.value,10);i.changeMonth(n-i.currentMonth),$("onMonthChange")})),k(),t=i.monthsDropdownContainer);var o=pa("cur-year",{tabindex:"-1"}),r=o.getElementsByTagName("input")[0];r.setAttribute("aria-label",i.l10n.yearAriaLabel),i.config.minDate&&r.setAttribute("min",i.config.minDate.getFullYear().toString()),i.config.maxDate&&(r.setAttribute("max",i.config.maxDate.getFullYear().toString()),r.disabled=!!i.config.minDate&&i.config.minDate.getFullYear()===i.config.maxDate.getFullYear());var s=la("div","flatpickr-current-month");return s.appendChild(t),s.appendChild(o),n.appendChild(s),e.appendChild(n),{container:e,yearElement:r,monthElement:t}}function w(){ha(i.monthNav),i.monthNav.appendChild(i.prevMonthNav),i.config.showMonths&&(i.yearElements=[],i.monthElements=[]);for(var t=i.config.showMonths;t--;){var e=L();i.yearElements.push(e.yearElement),i.monthElements.push(e.monthElement),i.monthNav.appendChild(e.container)}i.monthNav.appendChild(i.nextMonthNav)}function M(){i.weekdayContainer?ha(i.weekdayContainer):i.weekdayContainer=la("div","flatpickr-weekdays");for(var t=i.config.showMonths;t--;){var e=la("div","flatpickr-weekdaycontainer");i.weekdayContainer.appendChild(e)}return C(),i.weekdayContainer}function C(){if(i.weekdayContainer){var t=i.l10n.firstDayOfWeek,e=Pa(i.l10n.weekdays.shorthand);t>0&&t<e.length&&(e=Pa(e.splice(t,e.length),e.splice(0,t)));for(var n=i.config.showMonths;n--;)i.weekdayContainer.children[n].innerHTML="\n <span class='flatpickr-weekday'>\n "+e.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function P(t,e){void 0===e&&(e=!0);var n=e?t:t-i.currentMonth;n<0&&!0===i._hidePrevMonthArrow||n>0&&!0===i._hideNextMonthArrow||(i.currentMonth+=n,(i.currentMonth<0||i.currentMonth>11)&&(i.currentYear+=i.currentMonth>11?1:-1,i.currentMonth=(i.currentMonth+12)%12,$("onYearChange"),k()),x(),$("onMonthChange"),J())}function S(t){return i.calendarContainer.contains(t)}function T(t){if(i.isOpen&&!i.config.inline){var e=ua(t),n=S(e),o=!(e===i.input||e===i.altInput||i.element.contains(e)||t.path&&t.path.indexOf&&(~t.path.indexOf(i.input)||~t.path.indexOf(i.altInput)))&&!n&&!S(t.relatedTarget),r=!i.config.ignoredFocusElements.some((function(t){return t.contains(e)}));o&&r&&(i.config.allowInput&&i.setDate(i._input.value,!1,i.config.altInput?i.config.altFormat:i.config.dateFormat),void 0!==i.timeContainer&&void 0!==i.minuteElement&&void 0!==i.hourElement&&""!==i.input.value&&void 0!==i.input.value&&s(),i.close(),i.config&&"range"===i.config.mode&&1===i.selectedDates.length&&i.clear(!1))}}function A(t){if(!(!t||i.config.minDate&&t<i.config.minDate.getFullYear()||i.config.maxDate&&t>i.config.maxDate.getFullYear())){var e=t,n=i.currentYear!==e;i.currentYear=e||i.currentYear,i.config.maxDate&&i.currentYear===i.config.maxDate.getFullYear()?i.currentMonth=Math.min(i.config.maxDate.getMonth(),i.currentMonth):i.config.minDate&&i.currentYear===i.config.minDate.getFullYear()&&(i.currentMonth=Math.max(i.config.minDate.getMonth(),i.currentMonth)),n&&(i.redraw(),$("onYearChange"),k())}}function D(t,e){var n;void 0===e&&(e=!0);var o=i.parseDate(t,void 0,e);if(i.config.minDate&&o&&ba(o,i.config.minDate,void 0!==e?e:!i.minDateHasTime)<0||i.config.maxDate&&o&&ba(o,i.config.maxDate,void 0!==e?e:!i.maxDateHasTime)>0)return!1;if(!i.config.enable&&0===i.config.disable.length)return!0;if(void 0===o)return!1;for(var r=!!i.config.enable,s=null!==(n=i.config.enable)&&void 0!==n?n:i.config.disable,a=0,l=void 0;a<s.length;a++){if("function"==typeof(l=s[a])&&l(o))return r;if(l instanceof Date&&void 0!==o&&l.getTime()===o.getTime())return r;if("string"==typeof l){var h=i.parseDate(l,void 0,!0);return h&&h.getTime()===o.getTime()?r:!r}if("object"==typeof l&&void 0!==o&&l.from&&l.to&&o.getTime()>=l.from.getTime()&&o.getTime()<=l.to.getTime())return r}return!r}function E(t){return void 0!==i.daysContainer&&(-1===t.className.indexOf("hidden")&&-1===t.className.indexOf("flatpickr-disabled")&&i.daysContainer.contains(t))}function O(t){var e=t.target===i._input,n=i._input.value.trimEnd()!==X();!e||!n||t.relatedTarget&&S(t.relatedTarget)||i.setDate(i._input.value,!0,t.target===i.altInput?i.config.altFormat:i.config.dateFormat)}function I(e){var o=ua(e),r=i.config.wrap?t.contains(o):o===i._input,l=i.config.allowInput,h=i.isOpen&&(!l||!r),c=i.config.inline&&r&&!l;if(13===e.keyCode&&r){if(l)return i.setDate(i._input.value,!0,o===i.altInput?i.config.altFormat:i.config.dateFormat),i.close(),o.blur();i.open()}else if(S(o)||h||c){var p=!!i.timeContainer&&i.timeContainer.contains(o);switch(e.keyCode){case 13:p?(e.preventDefault(),s(),G()):H(e);break;case 27:e.preventDefault(),G();break;case 8:case 46:r&&!i.config.allowInput&&(e.preventDefault(),i.clear());break;case 37:case 39:if(p||r)i.hourElement&&i.hourElement.focus();else{e.preventDefault();var u=n();if(void 0!==i.daysContainer&&(!1===l||u&&E(u))){var d=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),P(d),y(v(1),0)):y(void 0,d)}}break;case 38:case 40:e.preventDefault();var m=40===e.keyCode?1:-1;i.daysContainer&&void 0!==o.$i||o===i.input||o===i.altInput?e.ctrlKey?(e.stopPropagation(),A(i.currentYear-m),y(v(1),0)):p||y(void 0,7*m):o===i.currentYearElement?A(i.currentYear-m):i.config.enableTime&&(!p&&i.hourElement&&i.hourElement.focus(),s(e),i._debouncedChange());break;case 9:if(p){var f=[i.hourElement,i.minuteElement,i.secondElement,i.amPM].concat(i.pluginElements).filter((function(t){return t})),g=f.indexOf(o);if(-1!==g){var _=f[g+(e.shiftKey?-1:1)];e.preventDefault(),(_||i._input).focus()}}else!i.config.noCalendar&&i.daysContainer&&i.daysContainer.contains(o)&&e.shiftKey&&(e.preventDefault(),i._input.focus())}}if(void 0!==i.amPM&&o===i.amPM)switch(e.key){case i.l10n.amPM[0].charAt(0):case i.l10n.amPM[0].charAt(0).toLowerCase():i.amPM.textContent=i.l10n.amPM[0],a(),Q();break;case i.l10n.amPM[1].charAt(0):case i.l10n.amPM[1].charAt(0).toLowerCase():i.amPM.textContent=i.l10n.amPM[1],a(),Q()}(r||S(o))&&$("onKeyDown",e)}function B(t,e){if(void 0===e&&(e="flatpickr-day"),1===i.selectedDates.length&&(!t||t.classList.contains(e)&&!t.classList.contains("flatpickr-disabled"))){for(var n=t?t.dateObj.getTime():i.days.firstElementChild.dateObj.getTime(),o=i.parseDate(i.selectedDates[0],void 0,!0).getTime(),r=Math.min(n,i.selectedDates[0].getTime()),s=Math.max(n,i.selectedDates[0].getTime()),a=!1,l=0,h=0,c=r;c<s;c+=wa.DAY)D(new Date(c),!0)||(a=a||c>r&&c<s,c<o&&(!l||c>l)?l=c:c>o&&(!h||c<h)&&(h=c));Array.from(i.rContainer.querySelectorAll("*:nth-child(-n+"+i.config.showMonths+") > ."+e)).forEach((function(e){var r=e.dateObj.getTime(),s=l>0&&r<l||h>0&&r>h;if(s)return e.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(t){e.classList.remove(t)}));a&&!s||(["startRange","inRange","endRange","notAllowed"].forEach((function(t){e.classList.remove(t)})),void 0!==t&&(t.classList.add(n<=i.selectedDates[0].getTime()?"startRange":"endRange"),o<n&&r===o?e.classList.add("startRange"):o>n&&r===o&&e.classList.add("endRange"),r>=l&&(0===h||r<=h)&&xa(r,o,n)&&e.classList.add("inRange")))}))}}function R(){!i.isOpen||i.config.static||i.config.inline||N()}function z(t){return function(e){var n=i.config["_"+t+"Date"]=i.parseDate(e,i.config.dateFormat),o=i.config["_"+("min"===t?"max":"min")+"Date"];void 0!==n&&(i["min"===t?"minDateHasTime":"maxDateHasTime"]=n.getHours()>0||n.getMinutes()>0||n.getSeconds()>0),i.selectedDates&&(i.selectedDates=i.selectedDates.filter((function(t){return D(t)})),i.selectedDates.length||"min"!==t||l(n),Q()),i.daysContainer&&(U(),void 0!==n?i.currentYearElement[t]=n.getFullYear().toString():i.currentYearElement.removeAttribute(t),i.currentYearElement.disabled=!!o&&void 0!==n&&o.getFullYear()===n.getFullYear())}}function F(){return i.config.wrap?t.querySelector("[data-input]"):t}function j(){"object"!=typeof i.config.locale&&void 0===Da.l10ns[i.config.locale]&&i.config.errorHandler(new Error("flatpickr: invalid locale "+i.config.locale)),i.l10n=Ca(Ca({},Da.l10ns.default),"object"==typeof i.config.locale?i.config.locale:"default"!==i.config.locale?Da.l10ns[i.config.locale]:void 0),ga.D="("+i.l10n.weekdays.shorthand.join("|")+")",ga.l="("+i.l10n.weekdays.longhand.join("|")+")",ga.M="("+i.l10n.months.shorthand.join("|")+")",ga.F="("+i.l10n.months.longhand.join("|")+")",ga.K="("+i.l10n.amPM[0]+"|"+i.l10n.amPM[1]+"|"+i.l10n.amPM[0].toLowerCase()+"|"+i.l10n.amPM[1].toLowerCase()+")",void 0===Ca(Ca({},e),JSON.parse(JSON.stringify(t.dataset||{}))).time_24hr&&void 0===Da.defaultConfig.time_24hr&&(i.config.time_24hr=i.l10n.time_24hr),i.formatDate=va(i),i.parseDate=ya({config:i.config,l10n:i.l10n})}function N(t){if("function"!=typeof i.config.position){if(void 0!==i.calendarContainer){$("onPreCalendarPosition");var e=t||i._positionElement,n=Array.prototype.reduce.call(i.calendarContainer.children,(function(t,e){return t+e.offsetHeight}),0),o=i.calendarContainer.offsetWidth,r=i.config.position.split(" "),s=r[0],a=r.length>1?r[1]:null,l=e.getBoundingClientRect(),h=window.innerHeight-l.bottom,c="above"===s||"below"!==s&&h<n&&l.top>n,p=window.pageYOffset+l.top+(c?-n-2:e.offsetHeight+2);if(aa(i.calendarContainer,"arrowTop",!c),aa(i.calendarContainer,"arrowBottom",c),!i.config.inline){var u=window.pageXOffset+l.left,d=!1,m=!1;"center"===a?(u-=(o-l.width)/2,d=!0):"right"===a&&(u-=o-l.width,m=!0),aa(i.calendarContainer,"arrowLeft",!d&&!m),aa(i.calendarContainer,"arrowCenter",d),aa(i.calendarContainer,"arrowRight",m);var f=window.document.body.offsetWidth-(window.pageXOffset+l.right),g=u+o>window.document.body.offsetWidth,_=f+o>window.document.body.offsetWidth;if(aa(i.calendarContainer,"rightMost",g),!i.config.static)if(i.calendarContainer.style.top=p+"px",g)if(_){var v=function(){for(var t=null,e=0;e<document.styleSheets.length;e++){var i=document.styleSheets[e];if(i.cssRules){try{i.cssRules}catch(t){continue}t=i;break}}return null!=t?t:(n=document.createElement("style"),document.head.appendChild(n),n.sheet);var n}();if(void 0===v)return;var y=window.document.body.offsetWidth,b=Math.max(0,y/2-o/2),x=v.cssRules.length,k="{left:"+l.left+"px;right:auto;}";aa(i.calendarContainer,"rightMost",!1),aa(i.calendarContainer,"centerMost",!0),v.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+k,x),i.calendarContainer.style.left=b+"px",i.calendarContainer.style.right="auto"}else i.calendarContainer.style.left="auto",i.calendarContainer.style.right=f+"px";else i.calendarContainer.style.left=u+"px",i.calendarContainer.style.right="auto"}}}else i.config.position(i,t)}function U(){i.config.noCalendar||i.isMobile||(k(),J(),x())}function G(){i._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(i.close,0):i.close()}function H(t){t.preventDefault(),t.stopPropagation();var e=ca(ua(t),(function(t){return t.classList&&t.classList.contains("flatpickr-day")&&!t.classList.contains("flatpickr-disabled")&&!t.classList.contains("notAllowed")}));if(void 0!==e){var n=e,o=i.latestSelectedDateObj=new Date(n.dateObj.getTime()),r=(o.getMonth()<i.currentMonth||o.getMonth()>i.currentMonth+i.config.showMonths-1)&&"range"!==i.config.mode;if(i.selectedDateElem=n,"single"===i.config.mode)i.selectedDates=[o];else if("multiple"===i.config.mode){var s=Y(o);s?i.selectedDates.splice(parseInt(s),1):i.selectedDates.push(o)}else"range"===i.config.mode&&(2===i.selectedDates.length&&i.clear(!1,!1),i.latestSelectedDateObj=o,i.selectedDates.push(o),0!==ba(o,i.selectedDates[0],!0)&&i.selectedDates.sort((function(t,e){return t.getTime()-e.getTime()})));if(a(),r){var l=i.currentYear!==o.getFullYear();i.currentYear=o.getFullYear(),i.currentMonth=o.getMonth(),l&&($("onYearChange"),k()),$("onMonthChange")}if(J(),x(),Q(),r||"range"===i.config.mode||1!==i.config.showMonths?void 0!==i.selectedDateElem&&void 0===i.hourElement&&i.selectedDateElem&&i.selectedDateElem.focus():_(n),void 0!==i.hourElement&&void 0!==i.hourElement&&i.hourElement.focus(),i.config.closeOnSelect){var h="single"===i.config.mode&&!i.config.enableTime,c="range"===i.config.mode&&2===i.selectedDates.length&&!i.config.enableTime;(h||c)&&G()}u()}}i.parseDate=ya({config:i.config,l10n:i.l10n}),i._handlers=[],i.pluginElements=[],i.loadedPlugins=[],i._bind=p,i._setHoursFromDate=l,i._positionCalendar=N,i.changeMonth=P,i.changeYear=A,i.clear=function(t,e){void 0===t&&(t=!0);void 0===e&&(e=!0);i.input.value="",void 0!==i.altInput&&(i.altInput.value="");void 0!==i.mobileInput&&(i.mobileInput.value="");i.selectedDates=[],i.latestSelectedDateObj=void 0,!0===e&&(i.currentYear=i._initialDate.getFullYear(),i.currentMonth=i._initialDate.getMonth());if(!0===i.config.enableTime){var n=Ma(i.config);h(n.hours,n.minutes,n.seconds)}i.redraw(),t&&$("onChange")},i.close=function(){i.isOpen=!1,i.isMobile||(void 0!==i.calendarContainer&&i.calendarContainer.classList.remove("open"),void 0!==i._input&&i._input.classList.remove("active"));$("onClose")},i.onMouseOver=B,i._createElement=la,i.createDay=g,i.destroy=function(){void 0!==i.config&&$("onDestroy");for(var t=i._handlers.length;t--;)i._handlers[t].remove();if(i._handlers=[],i.mobileInput)i.mobileInput.parentNode&&i.mobileInput.parentNode.removeChild(i.mobileInput),i.mobileInput=void 0;else if(i.calendarContainer&&i.calendarContainer.parentNode)if(i.config.static&&i.calendarContainer.parentNode){var e=i.calendarContainer.parentNode;if(e.lastChild&&e.removeChild(e.lastChild),e.parentNode){for(;e.firstChild;)e.parentNode.insertBefore(e.firstChild,e);e.parentNode.removeChild(e)}}else i.calendarContainer.parentNode.removeChild(i.calendarContainer);i.altInput&&(i.input.type="text",i.altInput.parentNode&&i.altInput.parentNode.removeChild(i.altInput),delete i.altInput);i.input&&(i.input.type=i.input._type,i.input.classList.remove("flatpickr-input"),i.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(t){try{delete i[t]}catch(t){}}))},i.isEnabled=D,i.jumpToDate=d,i.updateValue=Q,i.open=function(t,e){void 0===e&&(e=i._positionElement);if(!0===i.isMobile){if(t){t.preventDefault();var n=ua(t);n&&n.blur()}return void 0!==i.mobileInput&&(i.mobileInput.focus(),i.mobileInput.click()),void $("onOpen")}if(i._input.disabled||i.config.inline)return;var o=i.isOpen;i.isOpen=!0,o||(i.calendarContainer.classList.add("open"),i._input.classList.add("active"),$("onOpen"),N(e));!0===i.config.enableTime&&!0===i.config.noCalendar&&(!1!==i.config.allowInput||void 0!==t&&i.timeContainer.contains(t.relatedTarget)||setTimeout((function(){return i.hourElement.select()}),50))},i.redraw=U,i.set=function(t,e){if(null!==t&&"object"==typeof t)for(var n in Object.assign(i.config,t),t)void 0!==Z[n]&&Z[n].forEach((function(t){return t()}));else i.config[t]=e,void 0!==Z[t]?Z[t].forEach((function(t){return t()})):Qs.indexOf(t)>-1&&(i.config[t]=sa(e));i.redraw(),Q(!0)},i.setDate=function(t,e,n){void 0===e&&(e=!1);void 0===n&&(n=i.config.dateFormat);if(0!==t&&!t||t instanceof Array&&0===t.length)return i.clear(e);V(t,n),i.latestSelectedDateObj=i.selectedDates[i.selectedDates.length-1],i.redraw(),d(void 0,e),l(),0===i.selectedDates.length&&i.clear(!1);Q(e),e&&$("onChange")},i.toggle=function(t){if(!0===i.isOpen)return i.close();i.open(t)};var Z={locale:[j,C],showMonths:[w,r,M],minDate:[d],maxDate:[d],positionElement:[q],clickOpens:[function(){!0===i.config.clickOpens?(p(i._input,"focus",i.open),p(i._input,"click",i.open)):(i._input.removeEventListener("focus",i.open),i._input.removeEventListener("click",i.open))}]};function V(t,e){var n=[];if(t instanceof Array)n=t.map((function(t){return i.parseDate(t,e)}));else if(t instanceof Date||"number"==typeof t)n=[i.parseDate(t,e)];else if("string"==typeof t)switch(i.config.mode){case"single":case"time":n=[i.parseDate(t,e)];break;case"multiple":n=t.split(i.config.conjunction).map((function(t){return i.parseDate(t,e)}));break;case"range":n=t.split(i.l10n.rangeSeparator).map((function(t){return i.parseDate(t,e)}))}else i.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(t)));i.selectedDates=i.config.allowInvalidPreload?n:n.filter((function(t){return t instanceof Date&&D(t,!1)})),"range"===i.config.mode&&i.selectedDates.sort((function(t,e){return t.getTime()-e.getTime()}))}function W(t){return t.slice().map((function(t){return"string"==typeof t||"number"==typeof t||t instanceof Date?i.parseDate(t,void 0,!0):t&&"object"==typeof t&&t.from&&t.to?{from:i.parseDate(t.from,void 0),to:i.parseDate(t.to,void 0)}:t})).filter((function(t){return t}))}function q(){i._positionElement=i.config.positionElement||i._input}function $(t,e){if(void 0!==i.config){var n=i.config[t];if(void 0!==n&&n.length>0)for(var o=0;n[o]&&o<n.length;o++)n[o](i.selectedDates,i.input.value,i,e);"onChange"===t&&(i.input.dispatchEvent(K("change")),i.input.dispatchEvent(K("input")))}}function K(t){var e=document.createEvent("Event");return e.initEvent(t,!0,!0),e}function Y(t){for(var e=0;e<i.selectedDates.length;e++){var n=i.selectedDates[e];if(n instanceof Date&&0===ba(n,t))return""+e}return!1}function J(){i.config.noCalendar||i.isMobile||!i.monthNav||(i.yearElements.forEach((function(t,e){var n=new Date(i.currentYear,i.currentMonth,1);n.setMonth(i.currentMonth+e),i.config.showMonths>1||"static"===i.config.monthSelectorType?i.monthElements[e].textContent=ma(n.getMonth(),i.config.shorthandCurrentMonth,i.l10n)+" ":i.monthsDropdownContainer.value=n.getMonth().toString(),t.value=n.getFullYear().toString()})),i._hidePrevMonthArrow=void 0!==i.config.minDate&&(i.currentYear===i.config.minDate.getFullYear()?i.currentMonth<=i.config.minDate.getMonth():i.currentYear<i.config.minDate.getFullYear()),i._hideNextMonthArrow=void 0!==i.config.maxDate&&(i.currentYear===i.config.maxDate.getFullYear()?i.currentMonth+1>i.config.maxDate.getMonth():i.currentYear>i.config.maxDate.getFullYear()))}function X(t){var e=t||(i.config.altInput?i.config.altFormat:i.config.dateFormat);return i.selectedDates.map((function(t){return i.formatDate(t,e)})).filter((function(t,e,n){return"range"!==i.config.mode||i.config.enableTime||n.indexOf(t)===e})).join("range"!==i.config.mode?i.config.conjunction:i.l10n.rangeSeparator)}function Q(t){void 0===t&&(t=!0),void 0!==i.mobileInput&&i.mobileFormatStr&&(i.mobileInput.value=void 0!==i.latestSelectedDateObj?i.formatDate(i.latestSelectedDateObj,i.mobileFormatStr):""),i.input.value=X(i.config.dateFormat),void 0!==i.altInput&&(i.altInput.value=X(i.config.altFormat)),!1!==t&&$("onValueUpdate")}function tt(t){var e=ua(t),n=i.prevMonthNav.contains(e),o=i.nextMonthNav.contains(e);n||o?P(n?-1:1):i.yearElements.indexOf(e)>=0?e.select():e.classList.contains("arrowUp")?i.changeYear(i.currentYear+1):e.classList.contains("arrowDown")&&i.changeYear(i.currentYear-1)}return function(){i.element=i.input=t,i.isOpen=!1,function(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],r=Ca(Ca({},JSON.parse(JSON.stringify(t.dataset||{}))),e),s={};i.config.parseDate=r.parseDate,i.config.formatDate=r.formatDate,Object.defineProperty(i.config,"enable",{get:function(){return i.config._enable},set:function(t){i.config._enable=W(t)}}),Object.defineProperty(i.config,"disable",{get:function(){return i.config._disable},set:function(t){i.config._disable=W(t)}});var a="time"===r.mode;if(!r.dateFormat&&(r.enableTime||a)){var l=Da.defaultConfig.dateFormat||ta.dateFormat;s.dateFormat=r.noCalendar||a?"H:i"+(r.enableSeconds?":S":""):l+" H:i"+(r.enableSeconds?":S":"")}if(r.altInput&&(r.enableTime||a)&&!r.altFormat){var h=Da.defaultConfig.altFormat||ta.altFormat;s.altFormat=r.noCalendar||a?"h:i"+(r.enableSeconds?":S K":" K"):h+" h:i"+(r.enableSeconds?":S":"")+" K"}Object.defineProperty(i.config,"minDate",{get:function(){return i.config._minDate},set:z("min")}),Object.defineProperty(i.config,"maxDate",{get:function(){return i.config._maxDate},set:z("max")});var c=function(t){return function(e){i.config["min"===t?"_minTime":"_maxTime"]=i.parseDate(e,"H:i:S")}};Object.defineProperty(i.config,"minTime",{get:function(){return i.config._minTime},set:c("min")}),Object.defineProperty(i.config,"maxTime",{get:function(){return i.config._maxTime},set:c("max")}),"time"===r.mode&&(i.config.noCalendar=!0,i.config.enableTime=!0);Object.assign(i.config,s,r);for(var p=0;p<n.length;p++)i.config[n[p]]=!0===i.config[n[p]]||"true"===i.config[n[p]];Qs.filter((function(t){return void 0!==i.config[t]})).forEach((function(t){i.config[t]=sa(i.config[t]||[]).map(o)})),i.isMobile=!i.config.disableMobile&&!i.config.inline&&"single"===i.config.mode&&!i.config.disable.length&&!i.config.enable&&!i.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(p=0;p<i.config.plugins.length;p++){var u=i.config.plugins[p](i)||{};for(var d in u)Qs.indexOf(d)>-1?i.config[d]=sa(u[d]).map(o).concat(i.config[d]):void 0===r[d]&&(i.config[d]=u[d])}r.altInputClass||(i.config.altInputClass=F().className+" "+i.config.altInputClass);$("onParseConfig")}(),j(),function(){if(i.input=F(),!i.input)return void i.config.errorHandler(new Error("Invalid input element specified"));i.input._type=i.input.type,i.input.type="text",i.input.classList.add("flatpickr-input"),i._input=i.input,i.config.altInput&&(i.altInput=la(i.input.nodeName,i.config.altInputClass),i._input=i.altInput,i.altInput.placeholder=i.input.placeholder,i.altInput.disabled=i.input.disabled,i.altInput.required=i.input.required,i.altInput.tabIndex=i.input.tabIndex,i.altInput.type="text",i.input.setAttribute("type","hidden"),!i.config.static&&i.input.parentNode&&i.input.parentNode.insertBefore(i.altInput,i.input.nextSibling));i.config.allowInput||i._input.setAttribute("readonly","readonly");q()}(),function(){i.selectedDates=[],i.now=i.parseDate(i.config.now)||new Date;var t=i.config.defaultDate||("INPUT"!==i.input.nodeName&&"TEXTAREA"!==i.input.nodeName||!i.input.placeholder||i.input.value!==i.input.placeholder?i.input.value:null);t&&V(t,i.config.dateFormat);i._initialDate=i.selectedDates.length>0?i.selectedDates[0]:i.config.minDate&&i.config.minDate.getTime()>i.now.getTime()?i.config.minDate:i.config.maxDate&&i.config.maxDate.getTime()<i.now.getTime()?i.config.maxDate:i.now,i.currentYear=i._initialDate.getFullYear(),i.currentMonth=i._initialDate.getMonth(),i.selectedDates.length>0&&(i.latestSelectedDateObj=i.selectedDates[0]);void 0!==i.config.minTime&&(i.config.minTime=i.parseDate(i.config.minTime,"H:i"));void 0!==i.config.maxTime&&(i.config.maxTime=i.parseDate(i.config.maxTime,"H:i"));i.minDateHasTime=!!i.config.minDate&&(i.config.minDate.getHours()>0||i.config.minDate.getMinutes()>0||i.config.minDate.getSeconds()>0),i.maxDateHasTime=!!i.config.maxDate&&(i.config.maxDate.getHours()>0||i.config.maxDate.getMinutes()>0||i.config.maxDate.getSeconds()>0)}(),i.utils={getDaysInMonth:function(t,e){return void 0===t&&(t=i.currentMonth),void 0===e&&(e=i.currentYear),1===t&&(e%4==0&&e%100!=0||e%400==0)?29:i.l10n.daysInMonth[t]}},i.isMobile||function(){var t=window.document.createDocumentFragment();if(i.calendarContainer=la("div","flatpickr-calendar"),i.calendarContainer.tabIndex=-1,!i.config.noCalendar){if(t.appendChild((i.monthNav=la("div","flatpickr-months"),i.yearElements=[],i.monthElements=[],i.prevMonthNav=la("span","flatpickr-prev-month"),i.prevMonthNav.innerHTML=i.config.prevArrow,i.nextMonthNav=la("span","flatpickr-next-month"),i.nextMonthNav.innerHTML=i.config.nextArrow,w(),Object.defineProperty(i,"_hidePrevMonthArrow",{get:function(){return i.__hidePrevMonthArrow},set:function(t){i.__hidePrevMonthArrow!==t&&(aa(i.prevMonthNav,"flatpickr-disabled",t),i.__hidePrevMonthArrow=t)}}),Object.defineProperty(i,"_hideNextMonthArrow",{get:function(){return i.__hideNextMonthArrow},set:function(t){i.__hideNextMonthArrow!==t&&(aa(i.nextMonthNav,"flatpickr-disabled",t),i.__hideNextMonthArrow=t)}}),i.currentYearElement=i.yearElements[0],J(),i.monthNav)),i.innerContainer=la("div","flatpickr-innerContainer"),i.config.weekNumbers){var e=function(){i.calendarContainer.classList.add("hasWeeks");var t=la("div","flatpickr-weekwrapper");t.appendChild(la("span","flatpickr-weekday",i.l10n.weekAbbreviation));var e=la("div","flatpickr-weeks");return t.appendChild(e),{weekWrapper:t,weekNumbers:e}}(),n=e.weekWrapper,o=e.weekNumbers;i.innerContainer.appendChild(n),i.weekNumbers=o,i.weekWrapper=n}i.rContainer=la("div","flatpickr-rContainer"),i.rContainer.appendChild(M()),i.daysContainer||(i.daysContainer=la("div","flatpickr-days"),i.daysContainer.tabIndex=-1),x(),i.rContainer.appendChild(i.daysContainer),i.innerContainer.appendChild(i.rContainer),t.appendChild(i.innerContainer)}i.config.enableTime&&t.appendChild(function(){i.calendarContainer.classList.add("hasTime"),i.config.noCalendar&&i.calendarContainer.classList.add("noCalendar");var t=Ma(i.config);i.timeContainer=la("div","flatpickr-time"),i.timeContainer.tabIndex=-1;var e=la("span","flatpickr-time-separator",":"),n=pa("flatpickr-hour",{"aria-label":i.l10n.hourAriaLabel});i.hourElement=n.getElementsByTagName("input")[0];var o=pa("flatpickr-minute",{"aria-label":i.l10n.minuteAriaLabel});i.minuteElement=o.getElementsByTagName("input")[0],i.hourElement.tabIndex=i.minuteElement.tabIndex=-1,i.hourElement.value=na(i.latestSelectedDateObj?i.latestSelectedDateObj.getHours():i.config.time_24hr?t.hours:function(t){switch(t%24){case 0:case 12:return 12;default:return t%12}}(t.hours)),i.minuteElement.value=na(i.latestSelectedDateObj?i.latestSelectedDateObj.getMinutes():t.minutes),i.hourElement.setAttribute("step",i.config.hourIncrement.toString()),i.minuteElement.setAttribute("step",i.config.minuteIncrement.toString()),i.hourElement.setAttribute("min",i.config.time_24hr?"0":"1"),i.hourElement.setAttribute("max",i.config.time_24hr?"23":"12"),i.hourElement.setAttribute("maxlength","2"),i.minuteElement.setAttribute("min","0"),i.minuteElement.setAttribute("max","59"),i.minuteElement.setAttribute("maxlength","2"),i.timeContainer.appendChild(n),i.timeContainer.appendChild(e),i.timeContainer.appendChild(o),i.config.time_24hr&&i.timeContainer.classList.add("time24hr");if(i.config.enableSeconds){i.timeContainer.classList.add("hasSeconds");var r=pa("flatpickr-second");i.secondElement=r.getElementsByTagName("input")[0],i.secondElement.value=na(i.latestSelectedDateObj?i.latestSelectedDateObj.getSeconds():t.seconds),i.secondElement.setAttribute("step",i.minuteElement.getAttribute("step")),i.secondElement.setAttribute("min","0"),i.secondElement.setAttribute("max","59"),i.secondElement.setAttribute("maxlength","2"),i.timeContainer.appendChild(la("span","flatpickr-time-separator",":")),i.timeContainer.appendChild(r)}i.config.time_24hr||(i.amPM=la("span","flatpickr-am-pm",i.l10n.amPM[oa((i.latestSelectedDateObj?i.hourElement.value:i.config.defaultHour)>11)]),i.amPM.title=i.l10n.toggleTitle,i.amPM.tabIndex=-1,i.timeContainer.appendChild(i.amPM));return i.timeContainer}());aa(i.calendarContainer,"rangeMode","range"===i.config.mode),aa(i.calendarContainer,"animate",!0===i.config.animate),aa(i.calendarContainer,"multiMonth",i.config.showMonths>1),i.calendarContainer.appendChild(t);var r=void 0!==i.config.appendTo&&void 0!==i.config.appendTo.nodeType;if((i.config.inline||i.config.static)&&(i.calendarContainer.classList.add(i.config.inline?"inline":"static"),i.config.inline&&(!r&&i.element.parentNode?i.element.parentNode.insertBefore(i.calendarContainer,i._input.nextSibling):void 0!==i.config.appendTo&&i.config.appendTo.appendChild(i.calendarContainer)),i.config.static)){var s=la("div","flatpickr-wrapper");i.element.parentNode&&i.element.parentNode.insertBefore(s,i.element),s.appendChild(i.element),i.altInput&&s.appendChild(i.altInput),s.appendChild(i.calendarContainer)}i.config.static||i.config.inline||(void 0!==i.config.appendTo?i.config.appendTo:window.document.body).appendChild(i.calendarContainer)}(),function(){i.config.wrap&&["open","close","toggle","clear"].forEach((function(t){Array.prototype.forEach.call(i.element.querySelectorAll("[data-"+t+"]"),(function(e){return p(e,"click",i[t])}))}));if(i.isMobile)return void function(){var t=i.config.enableTime?i.config.noCalendar?"time":"datetime-local":"date";i.mobileInput=la("input",i.input.className+" flatpickr-mobile"),i.mobileInput.tabIndex=1,i.mobileInput.type=t,i.mobileInput.disabled=i.input.disabled,i.mobileInput.required=i.input.required,i.mobileInput.placeholder=i.input.placeholder,i.mobileFormatStr="datetime-local"===t?"Y-m-d\\TH:i:S":"date"===t?"Y-m-d":"H:i:S",i.selectedDates.length>0&&(i.mobileInput.defaultValue=i.mobileInput.value=i.formatDate(i.selectedDates[0],i.mobileFormatStr));i.config.minDate&&(i.mobileInput.min=i.formatDate(i.config.minDate,"Y-m-d"));i.config.maxDate&&(i.mobileInput.max=i.formatDate(i.config.maxDate,"Y-m-d"));i.input.getAttribute("step")&&(i.mobileInput.step=String(i.input.getAttribute("step")));i.input.type="hidden",void 0!==i.altInput&&(i.altInput.type="hidden");try{i.input.parentNode&&i.input.parentNode.insertBefore(i.mobileInput,i.input.nextSibling)}catch(t){}p(i.mobileInput,"change",(function(t){i.setDate(ua(t).value,!1,i.mobileFormatStr),$("onChange"),$("onClose")}))}();var t=ra(R,50);i._debouncedChange=ra(u,Sa),i.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&p(i.daysContainer,"mouseover",(function(t){"range"===i.config.mode&&B(ua(t))}));p(i._input,"keydown",I),void 0!==i.calendarContainer&&p(i.calendarContainer,"keydown",I);i.config.inline||i.config.static||p(window,"resize",t);void 0!==window.ontouchstart?p(window.document,"touchstart",T):p(window.document,"mousedown",T);p(window.document,"focus",T,{capture:!0}),!0===i.config.clickOpens&&(p(i._input,"focus",i.open),p(i._input,"click",i.open));void 0!==i.daysContainer&&(p(i.monthNav,"click",tt),p(i.monthNav,["keyup","increment"],c),p(i.daysContainer,"click",H));if(void 0!==i.timeContainer&&void 0!==i.minuteElement&&void 0!==i.hourElement){var e=function(t){return ua(t).select()};p(i.timeContainer,["increment"],s),p(i.timeContainer,"blur",s,{capture:!0}),p(i.timeContainer,"click",m),p([i.hourElement,i.minuteElement],["focus","click"],e),void 0!==i.secondElement&&p(i.secondElement,"focus",(function(){return i.secondElement&&i.secondElement.select()})),void 0!==i.amPM&&p(i.amPM,"click",(function(t){s(t)}))}i.config.allowInput&&p(i._input,"blur",O)}(),(i.selectedDates.length||i.config.noCalendar)&&(i.config.enableTime&&l(i.config.noCalendar?i.latestSelectedDateObj:void 0),Q(!1)),r();var n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!i.isMobile&&n&&N(),$("onReady")}(),i}function Aa(t,e){for(var i=Array.prototype.slice.call(t).filter((function(t){return t instanceof HTMLElement})),n=[],o=0;o<i.length;o++){var r=i[o];try{if(null!==r.getAttribute("data-fp-omit"))continue;void 0!==r._flatpickr&&(r._flatpickr.destroy(),r._flatpickr=void 0),r._flatpickr=Ta(r,e||{}),n.push(r._flatpickr)}catch(t){console.error(t)}}return 1===n.length?n[0]:n}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return Aa(this,t)},HTMLElement.prototype.flatpickr=function(t){return Aa([this],t)});var Da=function(t,e){return"string"==typeof t?Aa(window.document.querySelectorAll(t),e):t instanceof Node?Aa([t],e):Aa(t,e)};Da.defaultConfig={},Da.l10ns={en:Ca({},ia),default:Ca({},ia)},Da.localize=function(t){Da.l10ns.default=Ca(Ca({},Da.l10ns.default),t)},Da.setDefaults=function(t){Da.defaultConfig=Ca(Ca({},Da.defaultConfig),t)},Da.parseDate=ya({}),Da.formatDate=va({}),Da.compareDates=ba,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(t){return Aa(this,t)}),Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof t?parseInt(t,10):t))},"undefined"!=typeof window&&(window.flatpickr=Da);var Ea=function(){var t=this;this.currentValues,this.map,this.basemaps={},this.marker,this.icon,this.geoJson=cr().geoJSON(),this.addressLocation={},function(e){function i(e){e||(e=mmpAdminL10n.marker.popup),"undefined"!=typeof switchEditors&&(e=switchEditors.wpautop(e)),t.marker.setPopupContent(e)}function n(){window.open(e("#link").val(),"_blank")}function o(){"popup"===e("input[name=action]:checked").val()?(e("#link").val(""),e("#link_settings").hide(),e("#editor").show(),void 0!==t.marker&&(t.marker.bindPopup("",t.popup),t.marker.openPopup(),t.marker.off("click",n),i(e("#popup").val()))):(e("#editor").hide(),e("#link_settings").show(),void 0!==t.marker&&(t.marker.closePopup(),t.marker.unbindPopup(),t.marker.on("click",n)))}function r(i){var n=i.lat.toFixed(6),o=i.lng.toFixed(6);n<-90?n=-90:n>90&&(n=90),o<-180?o=-180:o>180&&(o=180),e("#lat").val(n),e("#lng").val(o),t.marker.setLatLng([n,o]),t.map.panTo(t.marker.getLatLng()),t.addressLocation instanceof cr().LatLng&&(t.marker.getLatLng().lat!==t.addressLocation.lat||t.marker.getLatLng().lng!==t.addressLocation.lng?e("#markerLocationWarning").show():e("#markerLocationWarning").hide())}function s(){e("#iconTarget").val(e("input[name=icon]:checked").val()),t.icon.options.iconUrl=e("input[name=icon]:checked+img").attr("src"),t.marker.setIcon(t.icon),e("#uploadFile").val(""),e("#iconSearch").val(""),e("#iconList .mmp-radio").show(),e("#icons").hide()}function a(i){if(t.currentValues=e("#markerSettings").serialize(),t.map=cr().map("maps-marker-pro-marker",{center:[i.lat,i.lng],zoom:i.zoom,minZoom:0,maxZoom:23,zoomSnap:.5,zoomDelta:.5,maxBounds:[[-90,-180],[90,180]],attributionControl:!1}),t.attributionControl=cr().control.attribution({prefix:i.attributionPrefix}).addTo(t.map),t.attributionControl._esriAttributionAdded=!0,e.each(mmpMapVars.availableBasemaps,(function(e,n){if(1===n.type||3===n.type||4===n.type||5===n.type||6===n.type){if(n.options.bounds&&"string"==typeof n.options.bounds){var o=Ts(n.options.bounds);n.options.rasterTiles?n.options.bounds=[t.map.unproject(cr().point(o[0][1],o[0][0]),n.options.maxNativeZoom),t.map.unproject(cr().point(o[1][1],o[1][0]),n.options.maxNativeZoom)]:n.options.bounds=o}else n.options.bounds=[[-90,-180],[90,180]];n.options.minZoom=0,n.options.maxZoom=23,n.options.noWrap=!0}1===n.type?n.wms?t.basemaps[e]=cr().tileLayer.wms(n.url,n.options):t.basemaps[e]=cr().tileLayer(n.url,n.options):2===n.type&&i.googleApiKey?t.basemaps[e]=new(cr().gridLayer.googleMutant)(n.options):3===n.type&&i.bingApiKey?(n.options.bingMapsKey=i.bingApiKey,n.options.culture=i.bingCulture,t.basemaps[e]=cr().tileLayer.bing(n.options)):4===n.type&&(i.hereApiKey||i.hereAppId&&i.hereAppCode)?(n.options.apiKey=i.hereApiKey,n.options.appId=i.hereAppId,n.options.appCode=i.hereAppCode,t.basemaps[e]=cr().tileLayer.here(n.options)):5===n.type&&i.tomApiKey?(n.options.apiKey=i.tomApiKey,t.basemaps[e]=cr().tileLayer.tomTom(n.options)):6===n.type&&(n.labels?t.basemaps[e]=cr().layerGroup([ys(n.key,n.options),ys(n.labels,n.options)]):t.basemaps[e]=ys(n.key,n.options))})),void 0!==t.basemaps[i.basemap])t.basemaps[i.basemap].addTo(t.map);else{var n=Object.keys(t.basemaps);n.length&&t.basemaps[n[0]].addTo(t.map)}t.geoJson=cr().geoJSON(null,{pointToLayer:function(t,e){return cr().marker(e,{pmIgnore:!0,interactive:!1,icon:cr().icon({iconUrl:t.properties.icon,iconSize:i.iconSize,iconAnchor:i.iconAnchor,popupAnchor:i.popupAnchor})})}}).addTo(t.map),t.icon=cr().icon({iconUrl:i.icon?mmpVars.iconsUrl+i.icon:mmpVars.pluginUrl+"images/leaflet/marker.png",iconSize:i.iconSize,iconAnchor:i.iconAnchor,popupAnchor:i.popupAnchor}),t.popup={maxWidth:400,minWidth:200,maxHeight:400,className:"mmp-popup"},t.marker=cr().marker([i.lat,i.lng],{icon:t.icon,draggable:!0}).addTo(t.map),e("#address").val()&&(t.addressLocation=t.marker.getLatLng()),o(),t.map.on("click",(function(t){r(t.latlng)})),t.map.on("zoomend",(function(){e("#zoom").val(t.map.getZoom().toFixed(1))})),t.marker.on("dragend",(function(){r(t.marker.getLatLng())}));var a,l,h={enableTime:!0,time_24hr:(l=mmpAdminL10n.global.timeFormat,!/a(?!\\)/i.test(l.replace(/\\\\/g,""))),altInput:!0,altFormat:(a=mmpAdminL10n.global.dateFormat+" "+mmpAdminL10n.global.timeFormat,a.replace(/G(?!\\)/g,"H").replace(/h(?!\\)/g,"G").replace(/g(?!\\)/g,"h").replace(/S(?!\\)/g,"J").replace(/s(?!\\)/g,"S").replace(/a(?!\\)/g,"K").replace(/A(?!\\)/g,"K")),dateFormat:"Y-m-d H:i:S"},c=e("#publish").flatpickr(h),p=e("#expires").flatpickr(h);e("#publishReset").on("click",(function(){c.setDate(this.dataset.date)})),e("#publishClear").on("click",(function(){c.clear()})),e("#expiresReset").on("click",(function(){p.setDate(this.dataset.date)})),e("#expiresClear").on("click",(function(){p.clear()})),e("#basemap").on("change",(function(){e.each(t.basemaps,(function(t,e){e.remove()})),void 0!==t.basemaps[e(this).val()]&&t.basemaps[e(this).val()].addTo(t.map)})),e("#previewMap").on("change",(function(){e.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_preview_map_markers",nonce:e("input[name=nonce]").val(),id:e("#previewMap").val()},beforeSend:function(){t.geoJson.clearLayers()}}).done((function(i){i.data.features&&(t.geoJson.addData(i.data),e("#previewOpacity").trigger("input"))}))})),e("#previewOpacity").on("input",cr().Util.throttle((function(){var i=parseFloat(e("#previewOpacity").val());t.geoJson.eachLayer((function(t){t.setOpacity(i)}))}),100)),e("#lat, #lng").on("change",(function(){var t=parseFloat(e("#lat").val()),i=parseFloat(e("#lng").val());r(cr().latLng(t,i))})),e("#zoom").on("change",(function(){t.map.setZoom(parseFloat(e("#zoom").val()))})),e("input[name=icon]").on("change",s),e("input[name=action]").on("change",o),e("#markerSettings").on("submit",(function(i){i.preventDefault(),i.stopPropagation(),e.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_save_marker",nonce:e("input[name=nonce]").val(),settings:e("#markerSettings").serialize()},beforeSend:function(){var t;t=e("#save"),e("#save").prop("disabled",!0),e(t).addClass("mmp-button-loading")}}).done((function(i){i.success?(t.currentValues=e("#markerSettings").serialize(),"new"===e("#id").val()?(localStorage.setItem("saved",!0),window.location.href=mmpVars.adminUrl+"admin.php?page=mapsmarkerpro_marker&id="+i.data.id):e('<div class="notice notice-success"><p>'+i.data.message+"</p></div>").insertBefore(".mmp-main").delay(5e3).fadeOut(500,(function(){e(this).remove()}))):e('<div class="notice notice-error"><p>'+i.data+"</p></div>").insertBefore(".mmp-main").delay(5e3).fadeOut(500,(function(){e(this).remove()}))})).fail((function(t,i,n){e('<div class="notice notice-error"><p>'+mmpAdminL10n.global.ajaxError+" ("+n+")</p></div>").insertBefore(".mmp-main").delay(5e3).fadeOut(500,(function(){e(this).remove()}))})).always((function(){var t;t=e("#save"),e(t).removeClass("mmp-button-loading"),e("#save").prop("disabled",!1),e(".mmp-wrap")[0].scrollIntoView()}))})),e("#saveDefaultsLink").on("click",(function(t){t.preventDefault(),t.stopPropagation(),e(this).hide(),e(".mmp-save-defaults").show()})),e("#saveDefaultsConfirm").on("click",(function(){e.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_save_marker_defaults",nonce:e("input[name=nonce]").val(),settings:e("#markerSettings").serialize()},beforeSend:function(){e("#saveDefaultsConfirm").prop("disabled",!0),e("#saveDefaultsCancel").prop("disabled",!0),e(".mmp-save-defaults").addClass("mmp-save-defaults-loading")}}).always((function(){e(".mmp-save-defaults").removeClass("mmp-save-defaults-loading"),e(".mmp-save-defaults").fadeOut(500,(function(){e("#saveDefaultsConfirm").prop("disabled",!1),e("#saveDefaultsCancel").prop("disabled",!1),e("#saveDefaultsLink").show()}))}))})),e("#saveDefaultsCancel").on("click",(function(){e(".mmp-save-defaults").hide(),e("#saveDefaultsLink").show()})),e("#assignedMaps").select2({width:"260px",placeholder:mmpAdminL10n.marker.notAssigned,templateSelection:function(t){var i=e('<a href="'+mmpVars.adminUrl+"admin.php?page=mapsmarkerpro_map&id="+t.id+'" target="_blank">'+mmpAdminL10n.marker.edit+"</a>");return i.on("click",(function(t){t.stopPropagation()})),e("<span>"+t.text+"</span>").append(" (").append(i).append(")")}}),e("#changeIcon").on("click",(function(){e("#iconUpload").hide(),e("#icons").show()})),e("#iconSearch").keyup((function(){var t=e(this).val();e('input[name="icon"]').each((function(){-1===e(this).val().toUpperCase().indexOf(t.toUpperCase())?e(this).parent().hide():e(this).parent().show()}))})),e("#toggleUpload").on("click",(function(){e("#iconUpload").toggle()})),e("#upload").on("click",(function(){var t=e("#uploadFile").prop("files")[0];if(void 0!==t){var i=new FormData;i.append("action","mmp_icon_upload"),i.append("nonce",e("#upload_nonce").val()),i.append("upload",t),e.ajax({type:"POST",url:ajaxurl,processData:!1,contentType:!1,context:this,data:i}).done((function(t){t.success&&(e("#iconList").prepend('<label class="mmp-radio"><input type="radio" name="icon" value="'+t.data.name+'" checked="checked" /><img class="mmp-icon" src="'+t.data.url+'" /></label>'),e("input[name=icon]").on("change",s),e("input[name=icon]").trigger("change"))}))}}));var u=new Fs({selector:"#address",beforeSend:function(){e("#geocodingError").empty()},error:function(t){e("#geocodingError").html(t)},selected:function(e,i){var n=cr().latLng(e.toFixed(6),i.toFixed(6));t.addressLocation=n,r(n)},provider:e("#geocodingProvider").val(),typingDelay:i.geocodingTypingDelay,minChars:i.geocodingMinChars});u.init(),e("#geocodingProvider").on("change",(function(){u.provider=e("#geocodingProvider").val(),u.autocomplete.start(),u.autocomplete.input.focus()})),e("#resetMarkerLocation").on("click",(function(){t.addressLocation instanceof cr().LatLng&&r(t.addressLocation)})),localStorage.getItem("saved")&&(e('<div class="notice notice-success"><p>'+mmpAdminL10n.marker.saved+"</p></div>").insertBefore(".mmp-main").delay(5e3).fadeOut(500,(function(){e(this).remove()})),localStorage.removeItem("saved")),e("#save").prop("disabled",!1)}e(".mmp-delete").on("click",(function(){confirm(mmpAdminL10n.marker.delete)&&e.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_delete_marker_direct",nonce:e("#nonce").val(),id:e("#id").val()}}).done((function(){t.currentValues=e("#markerSettings").serialize(),window.location.href=mmpVars.adminUrl+"admin.php?page=mapsmarkerpro_markers"}))})),e(".mmp-admin-modal, .mmp-admin-modal-close").on("click",(function(t){t.target===this&&e("#icons").hide()})),e("#popup").on("change",(function(){i(e(this).val())})),e("#maps-marker-pro-marker").css({width:"100%",height:"480px"}),e.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_marker_settings",id:e("#id").val(),basemap:e("#basemap").val(),lat:e("#lat").val(),lng:e("#lng").val(),zoom:e("#zoom").val()}}).done((function(t){a(t.data)})),window.onbeforeunload=function(){return t.currentValues!==e("#markerSettings").serialize()?"":null}}(jQuery)};var Oa=function(){!function(t){t("#select-all").on("click",(function(){var e=t(this).prop("checked");t('.mmp-table input[name="selected[]"]').each((function(i,n){t(n).prop("checked",e)}))})),t('input[name="selected[]"]').on("change",(function(){var e=!0;t('input[name="selected[]"]').each((function(i,n){e=e&&t(n).prop("checked")})),t("#select-all").prop("checked",e)})),t(".mmp-table .mmp-delete").on("click",(function(){var e=t(this).data("id");confirm(mmpAdminL10n.markers.delete.replace("{marker}",e))&&t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_delete_marker",nonce:t(this).data("nonce"),id:e}}).done((function(){window.location.reload()}))})),t("#map").select2({width:"200px"}).on("select2:select",(function(){t("#markers_filter").trigger("submit")})),t("#bulk-actions").on("submit",(function(e){var i;e.preventDefault(),e.stopPropagation();var n=t("input[name=bulk-action]:checked").val(),o=t("#assign-target").val();switch(n){case"duplicate":i=mmpAdminL10n.markers.bulkDuplicate;break;case"delete":i=mmpAdminL10n.markers.bulkDelete;break;case"assign":i=mmpAdminL10n.markers.bulkAssign.replace("{map}",o);break;default:return}if(confirm(i)){var r=[];t('input[name="selected[]"]:checked').each((function(){r.push(t(this).val())})),t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_bulk_action_markers",nonce:t("#bulk-action-nonce").val(),bulkAction:n,assignTarget:o,selected:r.join(",")}}).done((function(){window.location.reload()}))}})),t("#adv-settings").on("submit",(function(e){e.preventDefault(),e.stopPropagation(),t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_markers_screen_options",nonce:t("#screenoptionnonce").val(),hiddenColumns:t(".mmp-markers-column",t(this)).not(":checked").map((function(){return t(this).val()})).get(),perPage:t("#markers-per-page").val()}}).done((function(){window.location.reload()}))}))}(jQuery)};var Ia=function(){!function(t){var e=window.location.toString().split("#")[1],i=t("#settings").serialize(),n={},o=[];function r(e){t(".mmp-settings-tab").hide(),t(".mmp-tablink").removeClass("active"),t("#"+e+"_link").addClass("active"),t("#"+e+"_tab").show(),window.location.hash=e}function s(e){t(e).prop("disabled",!0),t(e).addClass("mmp-button-loading")}function a(e){t(e).removeClass("mmp-button-loading"),t(e).prop("disabled",!1)}function l(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_get_custom_layers",nonce:t("input[name=nonce]").val()}}).done((function(e){o=e.data;var i=t("<ul></ul>"),n=t("<ul></ul>");t.each(o,(function(e,o){var r=t("<li></li>"),s=t('<img src="'+mmpVars.pluginUrl+'images/icons/edit-layer.png" />');s.css("margin","0 10px 0 0"),s.css("verticalAlign","middle"),s.css("cursor","pointer"),s.on("click",(function(){var e;e=o.id,t("#customLayerId").val(e),h()})),r.append(s),r.append("[ID "+o.id+"] "+o.name),"1"==o.overlay?n.append(r):i.append(r)})),t("#custom-basemaps").html(i),t("#custom-overlays").html(n)}))}function h(){var e=t("#customLayerId").val(),i={},n={};"0"!=e&&(t.each(o,(function(t,o){if(o.id==e)return i=o,n=JSON.parse(o.options),!1})),"1"==i.overlay?t("#customLayerTypeOverlay").prop("checked",!0):t("#customLayerTypeBasemap").prop("checked",!0),t("#customLayerWms").prop("checked","1"==i.wms),t("#customLayerTms").prop("checked",n.tms),t("#customLayerRasterTiles").prop("checked",n.rasterTiles),t("#customLayerNoWrap").prop("checked",n.noWrap),t("#customLayerErrorTiles").prop("checked",n.errorTiles),t("#customLayerName").val(i.name),t("#customLayerUrl").val(i.url),t("#customLayerSubdomains").val(n.subdomains),t("#customLayerBounds").val(n.bounds),t("#customLayerMinZoom").val(n.minNativeZoom),t("#customLayerMaxZoom").val(n.maxNativeZoom),t("#customLayerOpacity").val(n.opacity),t("#customLayerAttribution").val(n.attribution),"1"==i.wms&&(t("#custom-layer-wms").show(),t("#customLayerTransparent").prop("checked",n.transparent),t("#customLayerUppercase").prop("checked",n.uppercase),t("#customLayerLayers").val(n.layers),t("#customLayerStyles").val(n.styles),t("#customLayerFormat").val(n.format),t("#customLayerVersion").val(n.version))),t("#mmp-custom-layer-modal").show()}t(".mmp-tablink").on("click",(function(){r(t(this).attr("id").replace("_link",""))})),t(".mmp-settings-nav ul li").each((function(){var e=t(this).closest(".mmp-settings-nav-group").find("span").html(),i=t(this).attr("id").replace("_link",""),o=t(this).html(),r=o;t("#"+i+"_tab").find("h3, p, .mmp-settings-desc, .mmp-settings-footnote").each((function(){r=r+" "+t(this).html()})),r=r.replace(/"/g,""),void 0===n[e]&&(n[e]=[]),n[e].push({value:i,search:r,title:o})})),t("#mmp-custom-layer-add").on("click",(function(){t("#customLayerId").val("0"),h()})),t("#customLayerWms").on("change",(function(){t(this).prop("checked")?t("#custom-layer-wms").show():t("#custom-layer-wms").hide()})),t("#settings").on("submit",(function(e){e.preventDefault(),e.stopPropagation();var n=t("#settings").serialize();t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_save_settings",nonce:t("input[name=nonce]").val(),settings:n},beforeSend:function(){s(t("#save"))}}).done((function(e){i=n;var o=e.success?"notice-success":"notice-error";t('<div class="notice '+o+'"><p>'+e.data+"</p></div>").insertBefore("#settings").delay(5e3).fadeOut(500,(function(){t(this).remove()}))})).fail((function(){t('<div class="notice notice-error"><p>'+mmpAdminL10n.global.ajaxError+"</p></div>").insertBefore("#settings").delay(5e3).fadeOut(500,(function(){t(this).remove()}))})).always((function(){a(t("#save")),t(".mmp-wrap")[0].scrollIntoView()}))}));var c=t("<select></select>").attr("id","mmp-select-search-tabs").css("width","300px").append("<option></option>");t.each(n,(function(e,i){var n=t("<optgroup></optgroup>");n.attr("label",e),t.each(i,(function(e,i){var o=t("<option></option>").attr("value",i.value).attr("data-search",i.search).html(i.title);n.append(o)})),c.append(n)})),c.appendTo("#top"),c.select2({placeholder:mmpAdminL10n.settings.search,allowClear:!0,matcher:function(e,i){if(""===t.trim(e.term))return i;if(void 0===i.text||void 0===i.children)return null;var n=[];if(t.each(i.children,(function(i,o){-1===o.text.toUpperCase().indexOf(e.term.toUpperCase())&&-1===t(o.element).data("search").toUpperCase().indexOf(e.term.toUpperCase())||n.push(o)})),n.length){var o=t.extend({},i,!0);return o.children=n,o}return null}}).on("change",(function(){r(t(this).val())})),t(".mmp-admin-modal, .mmp-admin-modal-close").on("click",(function(e){e.target===this&&(t("#mmp-custom-layer-modal").hide(),t("#mmp-custom-layer-form").trigger("reset"),t("#custom-layer-wms").hide())})),t("#mmp-custom-layer-delete").on("click",(function(){t("#mmp-custom-layer-modal").hide(),t("#mmp-custom-layer-form").trigger("reset"),t("#custom-layer-wms").hide(),function(e){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_delete_custom_layer",nonce:t("input[name=nonce]").val(),id:e}}).done((function(){l()}))}(t("#customLayerId").val())})),t("#mmp-custom-layer-save").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_save_custom_layer",nonce:t("input[name=nonce]").val(),settings:t("#mmp-custom-layer-form").serialize()},beforeSend:function(){s(t("#mmp-custom-layer-save"))}}).done((function(){t("#mmp-custom-layer-modal").hide(),t("#mmp-custom-layer-form").trigger("reset"),t("#custom-layer-wms").hide(),l()})).always((function(){a(t("#mmp-custom-layer-save"))}))})),t("#icons_list").select2({width:"300px",placeholder:mmpAdminL10n.settings.selectIcons,templateResult:function(e){return e.id?t('<span><img src="'+mmpVars.iconsUrl+e.element.value+'" class="icons-list-item" /> '+e.text+"</span>"):e.text}}),t("#delete_icons").on("click",(function(){confirm(mmpAdminL10n.settings.confirmDelete)&&t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_delete_icons",nonce:t("input[name=nonce]").val(),icons:t("#icons_list").val()}}).done((function(){t("#icons_list option:selected").remove()}))})),r(void 0!==e?e:t(".mmp-tablink").first().attr("id").replace("_link","")),l(),window.onbeforeunload=function(){return i!==t("#settings").serialize()?"":null},t("#save").prop("disabled",!1)}(jQuery)},Ba=i(576),Ra=i.n(Ba);var za=function(){!function(t){var e=window.location.toString().split("#")[1];function i(e){t(".mmp-tools-tab").hide(),t(".mmp-tablink").removeClass("active"),t("#"+e+"_tab").addClass("active"),t("#"+e+"_tab_content").show(),window.location.hash=e}function n(e){t(e).prop("disabled",!0),t(e).addClass("mmp-button-loading")}function o(e){t(e).removeClass("mmp-button-loading"),t(e).prop("disabled",!1)}function r(e,i){t(e).append('<span class="mmp-error">'+mmpAdminL10n.global.ajaxError+" ("+i.status+" - "+i.statusText+")</span>")}function s(t,e,i,n){var o='<div class="notice '+(t?"notice-success":"notice-error")+'"><p>'+e+"</p></div>";"after"===n?i.after(o):"before"===n?i.before(o):i.append(o)}function a(e){return{type:"POST",url:ajaxurl,dataType:"json",delay:250,data:function(i){return{action:e,nonce:t(this).data("nonce"),term:i.term,page:i.page}},processResults:function(t){return{results:t.data.results,pagination:{more:t.data.more}}}}}function l(){var e=[];t(".mmp-basemap").each((function(){e.push(t(this).data("id").toString())})),t("#basemapsList option").each((function(){var i=-1!==t.inArray(t(this).val().toString(),e);t(this).prop("disabled",i)})),t("#basemapsList option").each((function(){if(!t(this).prop("disabled"))return t(this).prop("selected",!0),!1})),t("#basemapsList option:enabled").length?t("#basemapsAdd").prop("disabled",!1):t("#basemapsAdd").prop("disabled",!0),t("input[name=basemapDefault]:checked").length||t("input[name=basemapDefault]").first().prop("checked",!0)}function h(){var e=[];t(".mmp-overlay").each((function(){e.push(t(this).data("id").toString())})),t("#overlaysList option").each((function(){var i=-1!==t.inArray(t(this).val().toString(),e);t(this).prop("disabled",i)})),t("#overlaysList option").each((function(){if(!t(this).prop("disabled"))return t(this).prop("selected",!0),!1})),t("#overlaysList option:enabled").length?t("#overlaysAdd").prop("disabled",!1):t("#overlaysAdd").prop("disabled",!0)}function c(e){var i=t("#move_markers_source"),n=i.val(),o=t("#move_markers_target"),r=o.val(),s=t("#remove_markers_map"),a=s.val(),l=t("#assign_markers_map"),h=l.val(),c=t("#assign_map"),p=c.val();i.empty(),o.empty(),s.empty(),l.empty(),c.empty(),t.each(e,(function(e,u){i.append(t("<option></option>").attr("value",e).text(u).prop("selected",e==n)),o.append(t("<option></option>").attr("value",e).text(u).prop("selected",e==r)),s.append(t("<option></option>").attr("value",e).text(u).prop("selected",e==a)),l.append(t("<option></option>").attr("value",e).text(u).prop("selected",e==h)),c.append(t("<option></option>").attr("value",e).text(u).prop("selected",e==p))}))}t(".mmp-tablink").on("click",(function(){i(t(this).attr("id").replace("_tab",""))})),t(".mmp-batch-settings-tablink").on("click",(function(){var e=t(this).data("target");t(".mmp-map-batch-settings-group").hide(),t(".mmp-batch-settings-tablink").removeClass("active"),t(this).addClass("active"),t("#"+e+"Content").show()})),t(".batch-settings-check").on("change",(function(){t(this).prop("checked")?t(this).closest(".mmp-map-batch-setting").addClass("mmp-changed"):t(this).closest(".mmp-map-batch-setting").removeClass("mmp-changed"),t(".mmp-batch-settings-tablink").each((function(){var e=t(this).data("target");t(".batch-settings-check:checked",t("#"+e+"Content")).length?t(this).addClass("mmp-changed"):t(this).removeClass("mmp-changed")}))})),t("#mapSettings input, #mapSettings select, #mapSettings textarea").on("change",(function(){var e=t(this).attr("name");t("#"+e+"Check").prop("checked",!0).trigger("change")})),t(".mmp-gpx-start-icon").on("click",(function(){t("#gpxIconTarget").val("gpx-start"),t("#iconsGpx").show()})),t(".mmp-gpx-end-icon").on("click",(function(){t("#gpxIconTarget").val("gpx-end"),t("#iconsGpx").show()})),t("#iconsListGpx img").on("click",(function(){var e=t("#gpxIconTarget").val(),i=t(this).attr("src"),n=t(this).data("icon");"gpx-start"===e?(t("#gpxStartIcon").val(n).trigger("change"),t(".mmp-gpx-start-icon").attr("src",i)):"gpx-end"===e&&(t("#gpxEndIcon").val(n).trigger("change"),t(".mmp-gpx-end-icon").attr("src",i)),t("#iconsGpx").hide()})),t("#batch_settings_maps").select2({width:"400px",ajax:a("mmp_query_maps")}),t("#save_batch_settings").on("click",(function(){confirm(mmpAdminL10n.tools.batchSettings)&&t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_batch_settings",nonce:t(this).data("nonce"),settings:t("#mapSettings").serialize()},beforeSend:function(){n(this)}}).done((function(e){s(e.success,e.data,t("#batch_settings_section"),"after")})).fail((function(){s(!1,mmpAdminL10n.global.ajaxError,t("#batch_settings_section"),"after")})).always((function(){o(this)}))})),t("#basemapList").sortable({handle:".mmp-handle"}),t("#basemapsAdd").on("click",(function(){!function(e,i){var n=t('<li class="mmp-basemap" data-id="'+e+'"></li>'),o=t("<div></div>");n.append(o);var r=t('<input type="hidden" name="basemaps[]" value="'+e+'" />');o.append(r);var s=t('<img class="mmp-handle mmp-align-middle" src="'+mmpVars.pluginUrl+'images/icons/handle.png" />');o.append(s);var a=t('<input type="radio" name="basemapDefault" value="'+e+'" />');o.append(" ").append(a);var h=t('<input type="text" class="mmp-align-middle" value="'+i+'" disabled="disabled" />');o.append(" ").append(h);var c=t('<i class="dashicons dashicons-no mmp-remove-basemap"></i>');c.on("click",(function(){t(this).parent().parent().remove(),l()})),o.append(" ").append(c),t("#basemapList").append(n)}(t("#basemapsList").val(),t("#basemapsList option:checked").text()),l()})),t(".mmp-remove-basemap").on("click",(function(){t(this).parent().parent().remove(),l()})),l(),t("#overlayList").sortable({handle:".mmp-handle"}),t("#overlaysAdd").on("click",(function(){!function(e,i){var n=t('<li class="mmp-overlay" data-id="'+e+'"></li>'),o=t("<div></div>");n.append(o);var r=t('<input type="hidden" name="overlays[]" value="'+e+'" />');o.append(r);var s=t('<img class="mmp-handle mmp-align-middle" src="'+mmpVars.pluginUrl+'images/icons/handle.png" />');o.append(s);var a=t('<input type="checkbox" name="overlaysActive[]" value="'+e+'" />');o.append(" ").append(a);var l=t('<input type="text" class="mmp-align-middle" value="'+i+'" disabled="disabled" />');o.append(" ").append(l);var c=t('<i class="dashicons dashicons-no mmp-remove-overlay"></i>');c.on("click",(function(){t(this).parent().parent().remove(),h()})),o.append(" ").append(c),t("#overlayList").append(n)}(t("#overlaysList").val(),t("#overlaysList option:checked").text()),h()})),t(".mmp-remove-overlay").on("click",(function(){t(this).parent().parent().remove(),h()})),h(),t("#batch_layers_maps").select2({width:"400px",ajax:a("mmp_query_maps")}),t("#save_batch_layers").on("click",(function(){confirm(mmpAdminL10n.tools.batchLayers)&&t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_batch_layers",nonce:t(this).data("nonce"),settings:t("#mapLayers").serialize()},beforeSend:function(){n(this)}}).done((function(e){s(e.success,e.data,t("#batch_layers_section"),"after")})).fail((function(){s(!1,mmpAdminL10n.global.ajaxError,t("#batch_layers_section"),"after")})).always((function(){o(this)}))})),t("#markerIconSelection").on("click",(function(){t("#markerIcons").show()})),t("#markerIconsList img").on("click",(function(){var e=t(this).attr("src");t("#markerIconSelection").attr("src",e),t("#markerIcon").val(e),t("#markerIcons").hide()})),t("#batch_marker_markers").select2({width:"400px",ajax:a("mmp_query_markers")}),t("#batch_marker_maps").select2({width:"400px",ajax:a("mmp_query_maps")}),t("#save_batch_marker").on("click",(function(){confirm(mmpAdminL10n.tools.batchMarker)&&t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_batch_marker",nonce:t(this).data("nonce"),settings:t("#markerSettings").serialize()},beforeSend:function(){n(this)}}).done((function(e){s(e.success,e.data,t("#batch_marker_section"),"after")})).fail((function(){s(!1,mmpAdminL10n.global.ajaxError,t("#batch_marker_section"),"after")})).always((function(){o(this)}))})),t("#sourceIcon").on("click",(function(){t("#replaceIcon").val("0"),t("#icons").show()})),t("#targetIcon").on("click",(function(){t("#replaceIcon").val("1"),t("#icons").show()})),t("#iconsList img").on("click",(function(){var e="0"==t("#replaceIcon").val()?"#sourceIcon":"#targetIcon",i=t(this).attr("src");t(e).attr("src",i),t("#icons").hide()})),t("#replace_icon").on("click",(function(){confirm(mmpAdminL10n.tools.replaceIcon)&&t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_replace_icon",nonce:t(this).data("nonce"),source:t("#sourceIcon").attr("src"),target:t("#targetIcon").attr("src")},beforeSend:function(){n(this)}}).done((function(e){s(e.success,e.data,t("#replace_icon_section"),"after")})).fail((function(){s(!1,mmpAdminL10n.global.ajaxError,t("#replace_icon_section"),"after")})).always((function(){o(this)}))})),t("#backup_start").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_backup",nonce:t("#backup_start").data("nonce")},beforeSend:function(){t("#backup_log").empty(),n(this)}}).done((function(e){e.success?(s(!0,e.data.message,t("#backup_log")),window.location.href=e.data.url):s(!1,e.data,t("#backup_log"))})).fail((function(e){s(!1,mmpAdminL10n.global.ajaxError+" ("+e.status+" - "+e.statusText+")",t("#backup_log"))})).always((function(){o(this)}))})),t("#restore_start").on("click",(function(){var e=t("#backup_file").prop("files")[0];if(void 0!==e){var i=new FormData;i.append("action","mmp_restore"),i.append("nonce",t("#restore_start").data("nonce")),i.append("upload",e),t.ajax({type:"POST",url:ajaxurl,context:this,data:i,processData:!1,contentType:!1,beforeSend:function(){t("#restore_log").empty(),n(this)}}).done((function(e){e.success?(c(e.data.maps),s(!0,e.data.message,t("#restore_log"))):s(!1,e.data,t("#restore_log"))})).fail((function(e){s(!1,mmpAdminL10n.global.ajaxError+" ("+e.status+" - "+e.statusText+")",t("#restore_log"))})).always((function(){o(this)}))}})),t("#backup_file").on("change",(function(){if(t("#restore_start").prop("disabled",!0),t("#restore_log").empty(),this.files.length){var e=(this.files[0].size/1024/1024).toFixed(2)+" MiB",i=(t("#backup_max_size").val()/1024/1024).toFixed(2)+" MiB";i<=0||this.files[0].size<=t("#backup_max_size").val()?t("#restore_start").prop("disabled",!1):s(!1,mmpAdminL10n.tools.maxFileSizeError.replace("{selectedFileSize}",e).replace("{maxFileSize}",i),t("#restore_log"))}})),t("#settings").on("click",(function(){t(this).trigger("select")})),t("#update_settings").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_update_settings",nonce:t(this).data("nonce"),settings:t("#settings").val()},beforeSend:function(){n(this)}}).done((function(e){s(e.success,e.data,t("#update_settings_section"),"after")})).fail((function(){s(!1,mmpAdminL10n.global.ajaxError,t("#update_settings_section"),"after")})).always((function(){o(this)}))})),t("#move_markers_source, #move_markers_target").select2({width:"400px",ajax:a("mmp_query_maps")}),t("#move_markers").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_move_markers",nonce:t(this).data("nonce"),source:t("#move_markers_source").val(),target:t("#move_markers_target").val()},beforeSend:function(){n(this)}}).done((function(e){e.success&&c(e.data.maps),s(e.success,e.data.message,t("#move_markers_section"),"after")})).fail((function(){s(!1,mmpAdminL10n.global.ajaxError,t("#move_markers_section"),"after")})).always((function(){o(this)}))})),t("#remove_markers_map").select2({width:"400px",ajax:a("mmp_query_maps")}),t("#remove_markers").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_remove_markers",nonce:t(this).data("nonce"),map:t("#remove_markers_map").val()},beforeSend:function(){n(this)}}).done((function(e){e.success&&c(e.data.maps),s(e.success,e.data.message,t("#remove_markers_section"),"after")})).fail((function(){s(!1,mmpAdminL10n.global.ajaxError,t("#remove_markers_section"),"after")})).always((function(){o(this)}))})),t("#delete_all_maps_confirm").on("change",(function(){t(this).prop("checked")?t("#delete_all_maps").prop("disabled",!1):t("#delete_all_maps").prop("disabled",!0)})),t("#delete_all_maps").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_delete_all_maps",nonce:t(this).data("nonce"),confirm:t("#delete_all_maps_confirm").prop("checked"),truncate:t("#delete_all_maps_reset_ids").prop("checked")},beforeSend:function(){n(this)}}).done((function(e){s(e.success,e.data,t("#delete_all_maps_section"),"after")})).fail((function(){s(!1,mmpAdminL10n.global.ajaxError,t("#delete_all_maps_section"),"after")})).always((function(){o(this)}))})),t("#delete_all_markers_confirm").on("change",(function(){t(this).prop("checked")?t("#delete_all_markers").prop("disabled",!1):t("#delete_all_markers").prop("disabled",!0)})),t("#delete_all_markers").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_delete_all_markers",nonce:t(this).data("nonce"),confirm:t("#delete_all_markers_confirm").prop("checked"),truncate:t("#delete_all_markers_reset_ids").prop("checked")},beforeSend:function(){n(this)}}).done((function(e){s(e.success,e.data,t("#delete_all_markers_section"),"after")})).fail((function(){s(!1,mmpAdminL10n.global.ajaxError,t("#delete_all_markers_section"),"after")})).always((function(){o(this)}))})),t("#assign_markers_map").select2({width:"400px",ajax:a("mmp_query_maps")}),t("#assign_markers").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_assign_markers",nonce:t(this).data("nonce"),map:t("#assign_markers_map").val()},beforeSend:function(){n(this)}}).done((function(e){e.success&&c(e.data.maps),s(e.success,e.data.message,t("#assign_markers_section"),"after")})).fail((function(){s(!1,mmpAdminL10n.global.ajaxError,t("#assign_markers_section"),"after")})).always((function(){o(this)}))})),t("#register_strings").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_register_strings",nonce:t(this).data("nonce")},beforeSend:function(){n(this)}}).done((function(e){s(e.success,e.data,t("#register_strings_section"),"after")})).fail((function(){s(!1,mmpAdminL10n.global.ajaxError,t("#register_strings_section"),"after")})).always((function(){o(this)}))})),t("input[name=test_mode]").on("change",(function(){"on"===t(this).val()?(t("#test_mode_wrap").attr("class","mmp-test-mode-on"),t("#test_mode_status").html(mmpAdminL10n.tools.testModeOn)):(t("#test_mode_wrap").attr("class","mmp-test-mode-off"),t("#test_mode_status").html(mmpAdminL10n.tools.testModeOff))})),t("#assign_maps").select2({width:"220px",ajax:a("mmp_query_maps")}),t("#import_file").on("change",(function(){if(t("#import_start").prop("disabled",!0),this.files.length){var e=t("#import_max_size").val();e<=0||this.files[0].size<=e?(t("#import_filesize_error").hide(),t("#import_start").prop("disabled",!1)):t("#import_filesize_error").show()}else t("#import_filesize_error").hide()})),t("#import_form").on("submit",(function(e){e.preventDefault(),e.stopPropagation();var i=new FormData(this);t.ajax({type:"POST",url:ajaxurl,context:this,data:i,processData:!1,contentType:!1,beforeSend:function(){n("#import_start"),t("#import_log").empty()}}).done((function(e){if(e.success){var i=e.data.summary+"\n";t.each(e.data.details,(function(t,e){i+="["+t+"] "+e.message+"\n"})),t("#import_log").text(i),c(e.data.maps)}else t("#import_log").append(e.data)})).fail((function(t){r("#import_log",t)})).always((function(){o("#import_start")}))})),t("#export_include, #export_exclude").select2({width:"220px",ajax:a("mmp_query_maps")}),t("#export_form").on("submit",(function(e){e.preventDefault(),e.stopPropagation(),t.ajax({type:"POST",url:ajaxurl,context:this,data:t(this).serialize(),beforeSend:function(){n("#export_start"),t("#export_log").empty()}}).done((function(e){e.success?(t("#export_log").append(e.data.message),window.location.href=e.data.url):t("#export_log").append(e.data)})).fail((function(){r("#export_log",xhr)})).always((function(){o("#export_start")}))})),new(Ra())("#copy_report").on("success",(function(){t("#copy_report_message").show().delay(5e3).fadeOut()})),t("#reset_database_confirm").on("change",(function(){t(this).prop("checked")?t("#reset_database").prop("disabled",!1):t("#reset_database").prop("disabled",!0)})),t("#reset_database").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_reset_database",nonce:t(this).data("nonce"),confirm:t("#reset_database_confirm").prop("checked")},beforeSend:function(){n(this)}}).done((function(e){s(e.success,e.data,t("#reset_database_section"),"after")})).fail((function(){s(!1,mmpAdminL10n.global.ajaxError,t("#reset_database_section"),"after")})).always((function(){o(this)}))})),t("#reset_settings_confirm").on("change",(function(){t(this).prop("checked")?t("#reset_settings").prop("disabled",!1):t("#reset_settings").prop("disabled",!0)})),t("#reset_settings").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_reset_settings",nonce:t(this).data("nonce"),confirm:t("#reset_settings_confirm").prop("checked"),reset:{plugin:t("#reset_plugin_settings").prop("checked"),map:t("#reset_map_settings").prop("checked"),marker:t("#reset_marker_settings").prop("checked")}},beforeSend:function(){n(this)}}).done((function(e){s(e.success,e.data,t("#reset_settings_section"),"after")})).fail((function(){s(!1,mmpAdminL10n.global.ajaxError,t("#reset_settings_section"),"after")})).always((function(){o(this)}))})),t("#data_migration_check").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_check_migration",nonce:t(this).data("nonce")},beforeSend:function(){t(this).prop("disabled",!0),t(this).addClass("mmp-button-loading")}}).done((function(e){t("#migration_log").html(e.data),t(".mmp-migration-shortcode").on("click",(function(){t(this).trigger("select")})),t("#data_migration_start").prop("disabled",!1)})).fail((function(){s(!1,mmpAdminL10n.global.ajaxError,t("#data_migration"),"after")})).always((function(){t(this).removeClass("mmp-button-loading")}))})),t("#data_migration_start").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_data_migration",nonce:t(this).data("nonce")},beforeSend:function(){t(this).prop("disabled",!0),t(this).addClass("mmp-button-loading")}}).done((function(e){s(e.success,e.data,t("#data_migration"),"after")})).fail((function(){s(!1,mmpAdminL10n.global.ajaxError,t("#data_migration"),"after")})).always((function(){t(this).removeClass("mmp-button-loading")}))})),t(".mmp-admin-modal, .mmp-admin-modal-close").on("click",(function(e){e.target===this&&(t("#icons").hide(),t("#iconsGpx").hide(),t("#markerIcons").hide())})),t(window).on("hashchange",(function(){var t=window.location.toString().split("#")[1];void 0!==t&&i(t)})),i(void 0!==e?e:t(".mmp-tablink").first().attr("id").replace("_tab","")),t(".mmp-batch-settings-tablink").first().trigger("click")}(jQuery)};var Fa=function(){!function(t){function e(e){t(".mmp-license-error").remove(),t(".mmp-license-section button").prop("disabled",!0),t(e).addClass("mmp-button-loading")}function i(e){t(e).removeClass("mmp-button-loading"),t(".mmp-license-section button").prop("disabled",!1)}function n(e,i){t(e).closest(".mmp-license-section").after('<div class="notice notice-error mmp-license-error"><p>'+i+"</p></div>")}t("#update_license").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_update_license",nonce:t(this).data("nonce"),key:t("#license_key").val(),multisite:t("#distribute_multisite").prop("checked")?1:0},beforeSend:function(){e(this)}}).done((function(t){t.success?window.location.reload():n(this,t.data)})).fail((function(){n(this,mmpAdminL10n.global.ajaxError)})).always((function(){i(this)}))})),t("#personal_trial_submit").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_register_personal_trial",nonce:t(this).data("nonce"),first_name:t("#personal_trial_first_name").val(),last_name:t("#personal_trial_last_name").val(),email:t("#personal_trial_email").val(),tos:t("#personal_trial_tos").prop("checked")?1:0},beforeSend:function(){e(this)}}).done((function(t){t.success?window.location.reload():n(this,t.data)})).fail((function(){n(this,mmpAdminL10n.global.ajaxError)})).always((function(){i(this)}))})),t("#anonymous_trial_show").on("click",(function(e){e.preventDefault(),e.stopPropagation(),t(this).remove(),t("#anonymous_trial").removeClass("mmp-hidden")})),t("#anonymous_trial_submit").on("click",(function(){t.ajax({type:"POST",url:ajaxurl,context:this,data:{action:"mmp_register_anonymous_trial",nonce:t(this).data("nonce"),tos:t("#anonymous_trial_tos").prop("checked")?1:0},beforeSend:function(){e(this)}}).done((function(t){t.success?window.location.reload():n(this,t.data)})).fail((function(){n(this,mmpAdminL10n.global.ajaxError)})).always((function(){i(this)}))}))}(jQuery)};window.MapsMarkerPro=$s,window.editMapActions=Ks,window.listMapsActions=Xs,window.editMarkerActions=Ea,window.listMarkersActions=Oa,window.settingsActions=Ia,window.toolsActions=za,window.licenseActions=Fa}()}();
Exec