vue-geojson-view-ts 1.3.17 → 1.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +321 -321
- package/dist/components/MapSearchAddress.vue.d.ts +1 -1
- package/dist/data/bolivia.geojson +2084 -2084
- package/dist/data/cities/be.geojson +246 -246
- package/dist/data/cities/cbba.geojson +165 -165
- package/dist/data/cities/ch.geojson +170 -170
- package/dist/data/cities/lp.geojson +314 -314
- package/dist/data/cities/or.geojson +253 -253
- package/dist/data/cities/pd.geojson +164 -164
- package/dist/data/cities/pt.geojson +379 -379
- package/dist/data/cities/sc.geojson +224 -224
- package/dist/data/cities/tj.geojson +86 -86
- package/dist/pin.svg +4 -4
- package/dist/style.css +1 -1
- package/dist/vite-env.d.ts +1 -1
- package/dist/vue-geojson-view-ts.js +15372 -14023
- package/dist/vue-geojson-view-ts.umd.cjs +65 -49
- package/package.json +78 -78
- package/src/components/CoordinatesVerifyPolygon.vue +86 -86
- package/src/components/MapHeatComponent.vue +664 -664
- package/src/components/MapSearchAddress.vue +309 -309
- package/src/components/MapView.vue +715 -716
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
(function(de,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],j):(de=typeof globalThis<"u"?globalThis:de||self,j(de.vueGeojsonViewTs={},de.Vue))})(this,function(de,j){"use strict";var qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yh(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function vh(r){if(r.__esModule)return r;var t=r.default;if(typeof t=="function"){var e=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),e}var xh={exports:{}};function $f(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var $o={exports:{}};const tg=vh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var wh;function Eh(){return wh||(wh=1,function(r,t){(function(e,i){r.exports=i()})(qe,function(){var e=e||function(i,n){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof qe<"u"&&qe.crypto&&(o=qe.crypto),!o&&typeof $f=="function")try{o=tg}catch{}var a=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},h=Object.create||function(){function w(){}return function(b){var T;return w.prototype=b,T=new w,w.prototype=null,T}}(),c={},d=c.lib={},f=d.Base=function(){return{extend:function(w){var b=h(this);return w&&b.mixIn(w),(!b.hasOwnProperty("init")||this.init===b.init)&&(b.init=function(){b.$super.init.apply(this,arguments)}),b.init.prototype=b,b.$super=this,b},create:function(){var w=this.extend();return w.init.apply(w,arguments),w},init:function(){},mixIn:function(w){for(var b in w)w.hasOwnProperty(b)&&(this[b]=w[b]);w.hasOwnProperty("toString")&&(this.toString=w.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),p=d.WordArray=f.extend({init:function(w,b){w=this.words=w||[],b!=n?this.sigBytes=b:this.sigBytes=w.length*4},toString:function(w){return(w||y).stringify(this)},concat:function(w){var b=this.words,T=w.words,P=this.sigBytes,R=w.sigBytes;if(this.clamp(),P%4)for(var I=0;I<R;I++){var O=T[I>>>2]>>>24-I%4*8&255;b[P+I>>>2]|=O<<24-(P+I)%4*8}else for(var U=0;U<R;U+=4)b[P+U>>>2]=T[U>>>2];return this.sigBytes+=R,this},clamp:function(){var w=this.words,b=this.sigBytes;w[b>>>2]&=4294967295<<32-b%4*8,w.length=i.ceil(b/4)},clone:function(){var w=f.clone.call(this);return w.words=this.words.slice(0),w},random:function(w){for(var b=[],T=0;T<w;T+=4)b.push(a());return new p.init(b,w)}}),m=c.enc={},y=m.Hex={stringify:function(w){for(var b=w.words,T=w.sigBytes,P=[],R=0;R<T;R++){var I=b[R>>>2]>>>24-R%4*8&255;P.push((I>>>4).toString(16)),P.push((I&15).toString(16))}return P.join("")},parse:function(w){for(var b=w.length,T=[],P=0;P<b;P+=2)T[P>>>3]|=parseInt(w.substr(P,2),16)<<24-P%8*4;return new p.init(T,b/2)}},v=m.Latin1={stringify:function(w){for(var b=w.words,T=w.sigBytes,P=[],R=0;R<T;R++){var I=b[R>>>2]>>>24-R%4*8&255;P.push(String.fromCharCode(I))}return P.join("")},parse:function(w){for(var b=w.length,T=[],P=0;P<b;P++)T[P>>>2]|=(w.charCodeAt(P)&255)<<24-P%4*8;return new p.init(T,b)}},E=m.Utf8={stringify:function(w){try{return decodeURIComponent(escape(v.stringify(w)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(w){return v.parse(unescape(encodeURIComponent(w)))}},C=d.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(w){typeof w=="string"&&(w=E.parse(w)),this._data.concat(w),this._nDataBytes+=w.sigBytes},_process:function(w){var b,T=this._data,P=T.words,R=T.sigBytes,I=this.blockSize,O=I*4,U=R/O;w?U=i.ceil(U):U=i.max((U|0)-this._minBufferSize,0);var X=U*I,q=i.min(X*4,R);if(X){for(var Y=0;Y<X;Y+=I)this._doProcessBlock(P,Y);b=P.splice(0,X),T.sigBytes-=q}return new p.init(b,q)},clone:function(){var w=f.clone.call(this);return w._data=this._data.clone(),w},_minBufferSize:0});d.Hasher=C.extend({cfg:f.extend(),init:function(w){this.cfg=this.cfg.extend(w),this.reset()},reset:function(){C.reset.call(this),this._doReset()},update:function(w){return this._append(w),this._process(),this},finalize:function(w){w&&this._append(w);var b=this._doFinalize();return b},blockSize:16,_createHelper:function(w){return function(b,T){return new w.init(T).finalize(b)}},_createHmacHelper:function(w){return function(b,T){return new S.HMAC.init(w,T).finalize(b)}}});var S=c.algo={};return c}(Math);return e})}($o)),$o.exports}(function(r,t){(function(e,i){r.exports=i(Eh())})(qe,function(e){return function(){var i=e,n=i.lib,o=n.WordArray,a=i.enc;a.Base64={stringify:function(c){var d=c.words,f=c.sigBytes,p=this._map;c.clamp();for(var m=[],y=0;y<f;y+=3)for(var v=d[y>>>2]>>>24-y%4*8&255,E=d[y+1>>>2]>>>24-(y+1)%4*8&255,C=d[y+2>>>2]>>>24-(y+2)%4*8&255,S=v<<16|E<<8|C,w=0;w<4&&y+w*.75<f;w++)m.push(p.charAt(S>>>6*(3-w)&63));var b=p.charAt(64);if(b)for(;m.length%4;)m.push(b);return m.join("")},parse:function(c){var d=c.length,f=this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var m=0;m<f.length;m++)p[f.charCodeAt(m)]=m}var y=f.charAt(64);if(y){var v=c.indexOf(y);v!==-1&&(d=v)}return h(c,d,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function h(c,d,f){for(var p=[],m=0,y=0;y<d;y++)if(y%4){var v=f[c.charCodeAt(y-1)]<<y%4*2,E=f[c.charCodeAt(y)]>>>6-y%4*2,C=v|E;p[m>>>2]|=C<<24-m%4*8,m++}return o.create(p,m)}}(),e.enc.Base64})})(xh);var eg=xh.exports;const ta=yh(eg);var Lh={exports:{}};(function(r,t){(function(e,i){r.exports=i(Eh())})(qe,function(e){return e.enc.Utf8})})(Lh);var ig=Lh.exports;const bh=yh(ig),ng=(r,t)=>{localStorage.setItem(r,ta.stringify(bh.parse(t)))},ns=r=>{const t=localStorage.getItem(r);return t?ta.parse(t).toString(bh):null},Th=r=>{const t=localStorage.getItem(r);return t?ta.parse(t):null},rs=r=>{localStorage.removeItem(r)};function rg(){const r=document.createElement("div");return r.className="loading-overlay",r.innerHTML="Recuperando Datos de Google Maps",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",r.style.backgroundColor="rgba(255, 255, 255)",r.style.display="flex",r.style.justifyContent="center",r.style.alignItems="center",r.style.color="#000",r.style.fontSize="24px",r.style.zIndex="999999",document.body.appendChild(r),r}function sg(r){r&&r.remove()}const og=()=>{const t=window.location.href.split("?")[1],e=new URLSearchParams(t),i=Object.fromEntries(e.entries());if(i.coordinates){const n=rg();setTimeout(function(){ng("coordinates",i.coordinates.replace("#/",""))},4e3),setTimeout(function(){window.close(),sg(n)},5e3)}},ag=async()=>{window.open("https://www.google.com/maps/?hl=es","Iniciar Sesion Ciudadania Digital","width=700,height=700,resizable=no"),rs("coordinates"),rs("closePopup");var r=!1;const t=setInterval(function(){let n=ns("coordinates"),o=Th("closePopup");(n||o)&&(clearInterval(t),r=!0)},1e3);await(async()=>{for(;!r;)await new Promise(n=>setTimeout(n,100));return!0})();let i=ns("coordinates");if(i){const n=JSON.parse(i);return[parseFloat(n.lat),parseFloat(n.long),parseFloat(n.z)]}},lg=async r=>{window.open(`http://maps.google.com/?q=${r}`,"Iniciar Sesion Ciudadania Digital","width=700,height=700,resizable=no"),rs("coordinates"),rs("closePopup");var t=!1;const e=setInterval(function(){let o=ns("coordinates"),a=Th("closePopup");(o||a)&&(clearInterval(e),t=!0)},1e3);await(async()=>{for(;!t;)await new Promise(o=>setTimeout(o,100));return!0})();let n=ns("coordinates");if(n){const o=JSON.parse(n);return[parseFloat(o.lat),parseFloat(o.long),parseFloat(o.z)]}},ss="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=";var os={exports:{}};/* @preserve
|
|
1
|
+
(function(ye,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],U):(ye=typeof globalThis<"u"?globalThis:ye||self,U(ye.vueGeojsonViewTs={},ye.Vue))})(this,function(ye,U){"use strict";var ri=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zh(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Wh(r){if(r.__esModule)return r;var t=r.default;if(typeof t=="function"){var e=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),e}var Hh={exports:{}};function Mg(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ma={exports:{}};const Sg=Wh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Vh;function Xh(){return Vh||(Vh=1,function(r,t){(function(e,i){r.exports=i()})(ri,function(){var e=e||function(i,n){var s;if(typeof window<"u"&&window.crypto&&(s=window.crypto),typeof self<"u"&&self.crypto&&(s=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(s=globalThis.crypto),!s&&typeof window<"u"&&window.msCrypto&&(s=window.msCrypto),!s&&typeof ri<"u"&&ri.crypto&&(s=ri.crypto),!s&&typeof Mg=="function")try{s=Sg}catch{}var a=function(){if(s){if(typeof s.getRandomValues=="function")try{return s.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof s.randomBytes=="function")try{return s.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},h=Object.create||function(){function E(){}return function(b){var C;return E.prototype=b,C=new E,E.prototype=null,C}}(),c={},d=c.lib={},f=d.Base=function(){return{extend:function(E){var b=h(this);return E&&b.mixIn(E),(!b.hasOwnProperty("init")||this.init===b.init)&&(b.init=function(){b.$super.init.apply(this,arguments)}),b.init.prototype=b,b.$super=this,b},create:function(){var E=this.extend();return E.init.apply(E,arguments),E},init:function(){},mixIn:function(E){for(var b in E)E.hasOwnProperty(b)&&(this[b]=E[b]);E.hasOwnProperty("toString")&&(this.toString=E.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),p=d.WordArray=f.extend({init:function(E,b){E=this.words=E||[],b!=n?this.sigBytes=b:this.sigBytes=E.length*4},toString:function(E){return(E||y).stringify(this)},concat:function(E){var b=this.words,C=E.words,P=this.sigBytes,R=E.sigBytes;if(this.clamp(),P%4)for(var D=0;D<R;D++){var O=C[D>>>2]>>>24-D%4*8&255;b[P+D>>>2]|=O<<24-(P+D)%4*8}else for(var G=0;G<R;G+=4)b[P+G>>>2]=C[G>>>2];return this.sigBytes+=R,this},clamp:function(){var E=this.words,b=this.sigBytes;E[b>>>2]&=4294967295<<32-b%4*8,E.length=i.ceil(b/4)},clone:function(){var E=f.clone.call(this);return E.words=this.words.slice(0),E},random:function(E){for(var b=[],C=0;C<E;C+=4)b.push(a());return new p.init(b,E)}}),_=c.enc={},y=_.Hex={stringify:function(E){for(var b=E.words,C=E.sigBytes,P=[],R=0;R<C;R++){var D=b[R>>>2]>>>24-R%4*8&255;P.push((D>>>4).toString(16)),P.push((D&15).toString(16))}return P.join("")},parse:function(E){for(var b=E.length,C=[],P=0;P<b;P+=2)C[P>>>3]|=parseInt(E.substr(P,2),16)<<24-P%8*4;return new p.init(C,b/2)}},v=_.Latin1={stringify:function(E){for(var b=E.words,C=E.sigBytes,P=[],R=0;R<C;R++){var D=b[R>>>2]>>>24-R%4*8&255;P.push(String.fromCharCode(D))}return P.join("")},parse:function(E){for(var b=E.length,C=[],P=0;P<b;P++)C[P>>>2]|=(E.charCodeAt(P)&255)<<24-P%4*8;return new p.init(C,b)}},w=_.Utf8={stringify:function(E){try{return decodeURIComponent(escape(v.stringify(E)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(E){return v.parse(unescape(encodeURIComponent(E)))}},T=d.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(E){typeof E=="string"&&(E=w.parse(E)),this._data.concat(E),this._nDataBytes+=E.sigBytes},_process:function(E){var b,C=this._data,P=C.words,R=C.sigBytes,D=this.blockSize,O=D*4,G=R/O;E?G=i.ceil(G):G=i.max((G|0)-this._minBufferSize,0);var X=G*D,Y=i.min(X*4,R);if(X){for(var q=0;q<X;q+=D)this._doProcessBlock(P,q);b=P.splice(0,X),C.sigBytes-=Y}return new p.init(b,Y)},clone:function(){var E=f.clone.call(this);return E._data=this._data.clone(),E},_minBufferSize:0});d.Hasher=T.extend({cfg:f.extend(),init:function(E){this.cfg=this.cfg.extend(E),this.reset()},reset:function(){T.reset.call(this),this._doReset()},update:function(E){return this._append(E),this._process(),this},finalize:function(E){E&&this._append(E);var b=this._doFinalize();return b},blockSize:16,_createHelper:function(E){return function(b,C){return new E.init(C).finalize(b)}},_createHmacHelper:function(E){return function(b,C){return new M.HMAC.init(E,C).finalize(b)}}});var M=c.algo={};return c}(Math);return e})}(ma)),ma.exports}(function(r,t){(function(e,i){r.exports=i(Xh())})(ri,function(e){return function(){var i=e,n=i.lib,s=n.WordArray,a=i.enc;a.Base64={stringify:function(c){var d=c.words,f=c.sigBytes,p=this._map;c.clamp();for(var _=[],y=0;y<f;y+=3)for(var v=d[y>>>2]>>>24-y%4*8&255,w=d[y+1>>>2]>>>24-(y+1)%4*8&255,T=d[y+2>>>2]>>>24-(y+2)%4*8&255,M=v<<16|w<<8|T,E=0;E<4&&y+E*.75<f;E++)_.push(p.charAt(M>>>6*(3-E)&63));var b=p.charAt(64);if(b)for(;_.length%4;)_.push(b);return _.join("")},parse:function(c){var d=c.length,f=this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var _=0;_<f.length;_++)p[f.charCodeAt(_)]=_}var y=f.charAt(64);if(y){var v=c.indexOf(y);v!==-1&&(d=v)}return h(c,d,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function h(c,d,f){for(var p=[],_=0,y=0;y<d;y++)if(y%4){var v=f[c.charCodeAt(y-1)]<<y%4*2,w=f[c.charCodeAt(y)]>>>6-y%4*2,T=v|w;p[_>>>2]|=T<<24-_%4*8,_++}return s.create(p,_)}}(),e.enc.Base64})})(Hh);var Pg=Hh.exports;const ya=Zh(Pg);var Yh={exports:{}};(function(r,t){(function(e,i){r.exports=i(Xh())})(ri,function(e){return e.enc.Utf8})})(Yh);var kg=Yh.exports;const Kh=Zh(kg),Rg=(r,t)=>{localStorage.setItem(r,ya.stringify(Kh.parse(t)))},xs=r=>{const t=localStorage.getItem(r);return t?ya.parse(t).toString(Kh):null},qh=r=>{const t=localStorage.getItem(r);return t?ya.parse(t):null},ws=r=>{localStorage.removeItem(r)};function Ag(){const r=document.createElement("div");return r.className="loading-overlay",r.innerHTML="Recuperando Datos de Google Maps",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",r.style.backgroundColor="rgba(255, 255, 255)",r.style.display="flex",r.style.justifyContent="center",r.style.alignItems="center",r.style.color="#000",r.style.fontSize="24px",r.style.zIndex="999999",document.body.appendChild(r),r}function Ig(r){r&&r.remove()}const Dg=()=>{const t=window.location.href.split("?")[1],e=new URLSearchParams(t),i=Object.fromEntries(e.entries());if(i.coordinates){const n=Ag();setTimeout(function(){Rg("coordinates",i.coordinates.replace("#/",""))},4e3),setTimeout(function(){window.close(),Ig(n)},5e3)}},Og=async()=>{window.open("https://www.google.com/maps/?hl=es","Iniciar Sesion Ciudadania Digital","width=700,height=700,resizable=no"),ws("coordinates"),ws("closePopup");var r=!1;const t=setInterval(function(){let n=xs("coordinates"),s=qh("closePopup");(n||s)&&(clearInterval(t),r=!0)},1e3);await(async()=>{for(;!r;)await new Promise(n=>setTimeout(n,100));return!0})();let i=xs("coordinates");if(i){const n=JSON.parse(i);return[parseFloat(n.lat),parseFloat(n.long),parseFloat(n.z)]}},Fg=async r=>{window.open(`http://maps.google.com/?q=${r}`,"Iniciar Sesion Ciudadania Digital","width=700,height=700,resizable=no"),ws("coordinates"),ws("closePopup");var t=!1;const e=setInterval(function(){let s=xs("coordinates"),a=qh("closePopup");(s||a)&&(clearInterval(e),t=!0)},1e3);await(async()=>{for(;!t;)await new Promise(s=>setTimeout(s,100));return!0})();let n=xs("coordinates");if(n){const s=JSON.parse(n);return[parseFloat(s.lat),parseFloat(s.long),parseFloat(s.z)]}},Es="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=";var va={exports:{}};/* @preserve
|
|
2
2
|
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
|
|
3
3
|
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
|
4
|
-
*/var Ch;function Mh(){return Ch||(Ch=1,function(r,t){(function(e,i){i(t)})(qe,function(e){var i="1.9.4";function n(s){var l,u,g,_;for(u=1,g=arguments.length;u<g;u++){_=arguments[u];for(l in _)s[l]=_[l]}return s}var o=Object.create||function(){function s(){}return function(l){return s.prototype=l,new s}}();function a(s,l){var u=Array.prototype.slice;if(s.bind)return s.bind.apply(s,u.call(arguments,1));var g=u.call(arguments,2);return function(){return s.apply(l,g.length?g.concat(u.call(arguments)):arguments)}}var h=0;function c(s){return"_leaflet_id"in s||(s._leaflet_id=++h),s._leaflet_id}function d(s,l,u){var g,_,x,M;return M=function(){g=!1,_&&(x.apply(u,_),_=!1)},x=function(){g?_=arguments:(s.apply(u,arguments),setTimeout(M,l),g=!0)},x}function f(s,l,u){var g=l[1],_=l[0],x=g-_;return s===g&&u?s:((s-_)%x+x)%x+_}function p(){return!1}function m(s,l){if(l===!1)return s;var u=Math.pow(10,l===void 0?6:l);return Math.round(s*u)/u}function y(s){return s.trim?s.trim():s.replace(/^\s+|\s+$/g,"")}function v(s){return y(s).split(/\s+/)}function E(s,l){Object.prototype.hasOwnProperty.call(s,"options")||(s.options=s.options?o(s.options):{});for(var u in l)s.options[u]=l[u];return s.options}function C(s,l,u){var g=[];for(var _ in s)g.push(encodeURIComponent(u?_.toUpperCase():_)+"="+encodeURIComponent(s[_]));return(!l||l.indexOf("?")===-1?"?":"&")+g.join("&")}var S=/\{ *([\w_ -]+) *\}/g;function w(s,l){return s.replace(S,function(u,g){var _=l[g];if(_===void 0)throw new Error("No value provided for variable "+u);return typeof _=="function"&&(_=_(l)),_})}var b=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"};function T(s,l){for(var u=0;u<s.length;u++)if(s[u]===l)return u;return-1}var P="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function R(s){return window["webkit"+s]||window["moz"+s]||window["ms"+s]}var I=0;function O(s){var l=+new Date,u=Math.max(0,16-(l-I));return I=l+u,window.setTimeout(s,u)}var U=window.requestAnimationFrame||R("RequestAnimationFrame")||O,X=window.cancelAnimationFrame||R("CancelAnimationFrame")||R("CancelRequestAnimationFrame")||function(s){window.clearTimeout(s)};function q(s,l,u){if(u&&U===O)s.call(l);else return U.call(window,a(s,l))}function Y(s){s&&X.call(window,s)}var rt={__proto__:null,extend:n,create:o,bind:a,get lastId(){return h},stamp:c,throttle:d,wrapNum:f,falseFn:p,formatNum:m,trim:y,splitWords:v,setOptions:E,getParamString:C,template:w,isArray:b,indexOf:T,emptyImageUrl:P,requestFn:U,cancelFn:X,requestAnimFrame:q,cancelAnimFrame:Y};function pt(){}pt.extend=function(s){var l=function(){E(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},u=l.__super__=this.prototype,g=o(u);g.constructor=l,l.prototype=g;for(var _ in this)Object.prototype.hasOwnProperty.call(this,_)&&_!=="prototype"&&_!=="__super__"&&(l[_]=this[_]);return s.statics&&n(l,s.statics),s.includes&&(V(s.includes),n.apply(null,[g].concat(s.includes))),n(g,s),delete g.statics,delete g.includes,g.options&&(g.options=u.options?o(u.options):{},n(g.options,s.options)),g._initHooks=[],g.callInitHooks=function(){if(!this._initHooksCalled){u.callInitHooks&&u.callInitHooks.call(this),this._initHooksCalled=!0;for(var x=0,M=g._initHooks.length;x<M;x++)g._initHooks[x].call(this)}},l},pt.include=function(s){var l=this.prototype.options;return n(this.prototype,s),s.options&&(this.prototype.options=l,this.mergeOptions(s.options)),this},pt.mergeOptions=function(s){return n(this.prototype.options,s),this},pt.addInitHook=function(s){var l=Array.prototype.slice.call(arguments,1),u=typeof s=="function"?s:function(){this[s].apply(this,l)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(u),this};function V(s){if(!(typeof L>"u"||!L||!L.Mixin)){s=b(s)?s:[s];for(var l=0;l<s.length;l++)s[l]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var H={on:function(s,l,u){if(typeof s=="object")for(var g in s)this._on(g,s[g],l);else{s=v(s);for(var _=0,x=s.length;_<x;_++)this._on(s[_],l,u)}return this},off:function(s,l,u){if(!arguments.length)delete this._events;else if(typeof s=="object")for(var g in s)this._off(g,s[g],l);else{s=v(s);for(var _=arguments.length===1,x=0,M=s.length;x<M;x++)_?this._off(s[x]):this._off(s[x],l,u)}return this},_on:function(s,l,u,g){if(typeof l!="function"){console.warn("wrong listener type: "+typeof l);return}if(this._listens(s,l,u)===!1){u===this&&(u=void 0);var _={fn:l,ctx:u};g&&(_.once=!0),this._events=this._events||{},this._events[s]=this._events[s]||[],this._events[s].push(_)}},_off:function(s,l,u){var g,_,x;if(this._events&&(g=this._events[s],!!g)){if(arguments.length===1){if(this._firingCount)for(_=0,x=g.length;_<x;_++)g[_].fn=p;delete this._events[s];return}if(typeof l!="function"){console.warn("wrong listener type: "+typeof l);return}var M=this._listens(s,l,u);if(M!==!1){var k=g[M];this._firingCount&&(k.fn=p,this._events[s]=g=g.slice()),g.splice(M,1)}}},fire:function(s,l,u){if(!this.listens(s,u))return this;var g=n({},l,{type:s,target:this,sourceTarget:l&&l.sourceTarget||this});if(this._events){var _=this._events[s];if(_){this._firingCount=this._firingCount+1||1;for(var x=0,M=_.length;x<M;x++){var k=_[x],A=k.fn;k.once&&this.off(s,A,k.ctx),A.call(k.ctx||this,g)}this._firingCount--}}return u&&this._propagateEvent(g),this},listens:function(s,l,u,g){typeof s!="string"&&console.warn('"string" type argument expected');var _=l;typeof l!="function"&&(g=!!l,_=void 0,u=void 0);var x=this._events&&this._events[s];if(x&&x.length&&this._listens(s,_,u)!==!1)return!0;if(g){for(var M in this._eventParents)if(this._eventParents[M].listens(s,l,u,g))return!0}return!1},_listens:function(s,l,u){if(!this._events)return!1;var g=this._events[s]||[];if(!l)return!!g.length;u===this&&(u=void 0);for(var _=0,x=g.length;_<x;_++)if(g[_].fn===l&&g[_].ctx===u)return _;return!1},once:function(s,l,u){if(typeof s=="object")for(var g in s)this._on(g,s[g],l,!0);else{s=v(s);for(var _=0,x=s.length;_<x;_++)this._on(s[_],l,u,!0)}return this},addEventParent:function(s){return this._eventParents=this._eventParents||{},this._eventParents[c(s)]=s,this},removeEventParent:function(s){return this._eventParents&&delete this._eventParents[c(s)],this},_propagateEvent:function(s){for(var l in this._eventParents)this._eventParents[l].fire(s.type,n({layer:s.target,propagatedFrom:s.target},s),!0)}};H.addEventListener=H.on,H.removeEventListener=H.clearAllEventListeners=H.off,H.addOneTimeEventListener=H.once,H.fireEvent=H.fire,H.hasEventListeners=H.listens;var G=pt.extend(H);function N(s,l,u){this.x=u?Math.round(s):s,this.y=u?Math.round(l):l}var vt=Math.trunc||function(s){return s>0?Math.floor(s):Math.ceil(s)};N.prototype={clone:function(){return new N(this.x,this.y)},add:function(s){return this.clone()._add(Z(s))},_add:function(s){return this.x+=s.x,this.y+=s.y,this},subtract:function(s){return this.clone()._subtract(Z(s))},_subtract:function(s){return this.x-=s.x,this.y-=s.y,this},divideBy:function(s){return this.clone()._divideBy(s)},_divideBy:function(s){return this.x/=s,this.y/=s,this},multiplyBy:function(s){return this.clone()._multiplyBy(s)},_multiplyBy:function(s){return this.x*=s,this.y*=s,this},scaleBy:function(s){return new N(this.x*s.x,this.y*s.y)},unscaleBy:function(s){return new N(this.x/s.x,this.y/s.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=vt(this.x),this.y=vt(this.y),this},distanceTo:function(s){s=Z(s);var l=s.x-this.x,u=s.y-this.y;return Math.sqrt(l*l+u*u)},equals:function(s){return s=Z(s),s.x===this.x&&s.y===this.y},contains:function(s){return s=Z(s),Math.abs(s.x)<=Math.abs(this.x)&&Math.abs(s.y)<=Math.abs(this.y)},toString:function(){return"Point("+m(this.x)+", "+m(this.y)+")"}};function Z(s,l,u){return s instanceof N?s:b(s)?new N(s[0],s[1]):s==null?s:typeof s=="object"&&"x"in s&&"y"in s?new N(s.x,s.y):new N(s,l,u)}function at(s,l){if(s)for(var u=l?[s,l]:s,g=0,_=u.length;g<_;g++)this.extend(u[g])}at.prototype={extend:function(s){var l,u;if(!s)return this;if(s instanceof N||typeof s[0]=="number"||"x"in s)l=u=Z(s);else if(s=z(s),l=s.min,u=s.max,!l||!u)return this;return!this.min&&!this.max?(this.min=l.clone(),this.max=u.clone()):(this.min.x=Math.min(l.x,this.min.x),this.max.x=Math.max(u.x,this.max.x),this.min.y=Math.min(l.y,this.min.y),this.max.y=Math.max(u.y,this.max.y)),this},getCenter:function(s){return Z((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,s)},getBottomLeft:function(){return Z(this.min.x,this.max.y)},getTopRight:function(){return Z(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(s){var l,u;return typeof s[0]=="number"||s instanceof N?s=Z(s):s=z(s),s instanceof at?(l=s.min,u=s.max):l=u=s,l.x>=this.min.x&&u.x<=this.max.x&&l.y>=this.min.y&&u.y<=this.max.y},intersects:function(s){s=z(s);var l=this.min,u=this.max,g=s.min,_=s.max,x=_.x>=l.x&&g.x<=u.x,M=_.y>=l.y&&g.y<=u.y;return x&&M},overlaps:function(s){s=z(s);var l=this.min,u=this.max,g=s.min,_=s.max,x=_.x>l.x&&g.x<u.x,M=_.y>l.y&&g.y<u.y;return x&&M},isValid:function(){return!!(this.min&&this.max)},pad:function(s){var l=this.min,u=this.max,g=Math.abs(l.x-u.x)*s,_=Math.abs(l.y-u.y)*s;return z(Z(l.x-g,l.y-_),Z(u.x+g,u.y+_))},equals:function(s){return s?(s=z(s),this.min.equals(s.getTopLeft())&&this.max.equals(s.getBottomRight())):!1}};function z(s,l){return!s||s instanceof at?s:new at(s,l)}function Lt(s,l){if(s)for(var u=l?[s,l]:s,g=0,_=u.length;g<_;g++)this.extend(u[g])}Lt.prototype={extend:function(s){var l=this._southWest,u=this._northEast,g,_;if(s instanceof J)g=s,_=s;else if(s instanceof Lt){if(g=s._southWest,_=s._northEast,!g||!_)return this}else return s?this.extend(st(s)||tt(s)):this;return!l&&!u?(this._southWest=new J(g.lat,g.lng),this._northEast=new J(_.lat,_.lng)):(l.lat=Math.min(g.lat,l.lat),l.lng=Math.min(g.lng,l.lng),u.lat=Math.max(_.lat,u.lat),u.lng=Math.max(_.lng,u.lng)),this},pad:function(s){var l=this._southWest,u=this._northEast,g=Math.abs(l.lat-u.lat)*s,_=Math.abs(l.lng-u.lng)*s;return new Lt(new J(l.lat-g,l.lng-_),new J(u.lat+g,u.lng+_))},getCenter:function(){return new J((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 J(this.getNorth(),this.getWest())},getSouthEast:function(){return new J(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(s){typeof s[0]=="number"||s instanceof J||"lat"in s?s=st(s):s=tt(s);var l=this._southWest,u=this._northEast,g,_;return s instanceof Lt?(g=s.getSouthWest(),_=s.getNorthEast()):g=_=s,g.lat>=l.lat&&_.lat<=u.lat&&g.lng>=l.lng&&_.lng<=u.lng},intersects:function(s){s=tt(s);var l=this._southWest,u=this._northEast,g=s.getSouthWest(),_=s.getNorthEast(),x=_.lat>=l.lat&&g.lat<=u.lat,M=_.lng>=l.lng&&g.lng<=u.lng;return x&&M},overlaps:function(s){s=tt(s);var l=this._southWest,u=this._northEast,g=s.getSouthWest(),_=s.getNorthEast(),x=_.lat>l.lat&&g.lat<u.lat,M=_.lng>l.lng&&g.lng<u.lng;return x&&M},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(s,l){return s?(s=tt(s),this._southWest.equals(s.getSouthWest(),l)&&this._northEast.equals(s.getNorthEast(),l)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function tt(s,l){return s instanceof Lt?s:new Lt(s,l)}function J(s,l,u){if(isNaN(s)||isNaN(l))throw new Error("Invalid LatLng object: ("+s+", "+l+")");this.lat=+s,this.lng=+l,u!==void 0&&(this.alt=+u)}J.prototype={equals:function(s,l){if(!s)return!1;s=st(s);var u=Math.max(Math.abs(this.lat-s.lat),Math.abs(this.lng-s.lng));return u<=(l===void 0?1e-9:l)},toString:function(s){return"LatLng("+m(this.lat,s)+", "+m(this.lng,s)+")"},distanceTo:function(s){return Mt.distance(this,st(s))},wrap:function(){return Mt.wrapLatLng(this)},toBounds:function(s){var l=180*s/40075017,u=l/Math.cos(Math.PI/180*this.lat);return tt([this.lat-l,this.lng-u],[this.lat+l,this.lng+u])},clone:function(){return new J(this.lat,this.lng,this.alt)}};function st(s,l,u){return s instanceof J?s:b(s)&&typeof s[0]!="object"?s.length===3?new J(s[0],s[1],s[2]):s.length===2?new J(s[0],s[1]):null:s==null?s:typeof s=="object"&&"lat"in s?new J(s.lat,"lng"in s?s.lng:s.lon,s.alt):l===void 0?null:new J(s,l,u)}var Ft={latLngToPoint:function(s,l){var u=this.projection.project(s),g=this.scale(l);return this.transformation._transform(u,g)},pointToLatLng:function(s,l){var u=this.scale(l),g=this.transformation.untransform(s,u);return this.projection.unproject(g)},project:function(s){return this.projection.project(s)},unproject:function(s){return this.projection.unproject(s)},scale:function(s){return 256*Math.pow(2,s)},zoom:function(s){return Math.log(s/256)/Math.LN2},getProjectedBounds:function(s){if(this.infinite)return null;var l=this.projection.bounds,u=this.scale(s),g=this.transformation.transform(l.min,u),_=this.transformation.transform(l.max,u);return new at(g,_)},infinite:!1,wrapLatLng:function(s){var l=this.wrapLng?f(s.lng,this.wrapLng,!0):s.lng,u=this.wrapLat?f(s.lat,this.wrapLat,!0):s.lat,g=s.alt;return new J(u,l,g)},wrapLatLngBounds:function(s){var l=s.getCenter(),u=this.wrapLatLng(l),g=l.lat-u.lat,_=l.lng-u.lng;if(g===0&&_===0)return s;var x=s.getSouthWest(),M=s.getNorthEast(),k=new J(x.lat-g,x.lng-_),A=new J(M.lat-g,M.lng-_);return new Lt(k,A)}},Mt=n({},Ft,{wrapLng:[-180,180],R:6371e3,distance:function(s,l){var u=Math.PI/180,g=s.lat*u,_=l.lat*u,x=Math.sin((l.lat-s.lat)*u/2),M=Math.sin((l.lng-s.lng)*u/2),k=x*x+Math.cos(g)*Math.cos(_)*M*M,A=2*Math.atan2(Math.sqrt(k),Math.sqrt(1-k));return this.R*A}}),ve=6378137,Ze={R:ve,MAX_LATITUDE:85.0511287798,project:function(s){var l=Math.PI/180,u=this.MAX_LATITUDE,g=Math.max(Math.min(u,s.lat),-u),_=Math.sin(g*l);return new N(this.R*s.lng*l,this.R*Math.log((1+_)/(1-_))/2)},unproject:function(s){var l=180/Math.PI;return new J((2*Math.atan(Math.exp(s.y/this.R))-Math.PI/2)*l,s.x*l/this.R)},bounds:function(){var s=ve*Math.PI;return new at([-s,-s],[s,s])}()};function Di(s,l,u,g){if(b(s)){this._a=s[0],this._b=s[1],this._c=s[2],this._d=s[3];return}this._a=s,this._b=l,this._c=u,this._d=g}Di.prototype={transform:function(s,l){return this._transform(s.clone(),l)},_transform:function(s,l){return l=l||1,s.x=l*(this._a*s.x+this._b),s.y=l*(this._c*s.y+this._d),s},untransform:function(s,l){return l=l||1,new N((s.x/l-this._b)/this._a,(s.y/l-this._d)/this._c)}};function xe(s,l,u,g){return new Di(s,l,u,g)}var Oi=n({},Mt,{code:"EPSG:3857",projection:Ze,transformation:function(){var s=.5/(Math.PI*Ze.R);return xe(s,.5,-s,.5)}()}),We=n({},Oi,{code:"EPSG:900913"});function Fi(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function Se(s,l){var u="",g,_,x,M,k,A;for(g=0,x=s.length;g<x;g++){for(k=s[g],_=0,M=k.length;_<M;_++)A=k[_],u+=(_?"L":"M")+A.x+" "+A.y;u+=l?K.svg?"z":"x":""}return u||"M0 0"}var zi=document.documentElement.style,di="ActiveXObject"in window,Xn=di&&!document.addEventListener,fi="msLaunchUri"in navigator&&!("documentMode"in document),hn=zt("webkit"),Xt=zt("android"),ie=zt("android 2")||zt("android 3"),me=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Pe=Xt&&zt("Google")&&me<537&&!("AudioNode"in window),He=!!window.opera,Ve=!fi&&zt("chrome"),ke=zt("gecko")&&!hn&&!He&&!di,Ni=!Ve&&zt("safari"),cn=zt("phantom"),Wt="OTransition"in zi,Ur=navigator.platform.indexOf("Win")===0,ko=di&&"transition"in zi,jr="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ie,Zr="MozPerspective"in zi,Ro=!window.L_DISABLE_3D&&(ko||jr||Zr)&&!Wt&&!cn,gi=typeof orientation<"u"||zt("mobile"),Ao=gi&&hn,Wr=gi&&jr,Bi=!window.PointerEvent&&window.MSPointerEvent,Gi=!!(window.PointerEvent||Bi),Ui="ontouchstart"in window||!!window.TouchEvent,Io=!window.L_NO_TOUCH&&(Ui||Gi),Do=gi&&He,ne=gi&&ke,ji=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,he=function(){var s=!1;try{var l=Object.defineProperty({},"passive",{get:function(){s=!0}});window.addEventListener("testPassiveEventSupport",p,l),window.removeEventListener("testPassiveEventSupport",p,l)}catch{}return s}(),Re=function(){return!!document.createElement("canvas").getContext}(),Yt=!!(document.createElementNS&&Fi("svg").createSVGRect),Yn=!!Yt&&function(){var s=document.createElement("div");return s.innerHTML="<svg/>",(s.firstChild&&s.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Kn=!Yt&&function(){try{var s=document.createElement("div");s.innerHTML='<v:shape adj="1"/>';var l=s.firstChild;return l.style.behavior="url(#default#VML)",l&&typeof l.adj=="object"}catch{return!1}}(),te=navigator.platform.indexOf("Mac")===0,ce=navigator.platform.indexOf("Linux")===0;function zt(s){return navigator.userAgent.toLowerCase().indexOf(s)>=0}var K={ie:di,ielt9:Xn,edge:fi,webkit:hn,android:Xt,android23:ie,androidStock:Pe,opera:He,chrome:Ve,gecko:ke,safari:Ni,phantom:cn,opera12:Wt,win:Ur,ie3d:ko,webkit3d:jr,gecko3d:Zr,any3d:Ro,mobile:gi,mobileWebkit:Ao,mobileWebkit3d:Wr,msPointer:Bi,pointer:Gi,touch:Io,touchNative:Ui,mobileOpera:Do,mobileGecko:ne,retina:ji,passiveEvents:he,canvas:Re,svg:Yt,vml:Kn,inlineSvg:Yn,mac:te,linux:ce},rf=K.msPointer?"MSPointerDown":"pointerdown",sf=K.msPointer?"MSPointerMove":"pointermove",of=K.msPointer?"MSPointerUp":"pointerup",af=K.msPointer?"MSPointerCancel":"pointercancel",Vl={touchstart:rf,touchmove:sf,touchend:of,touchcancel:af},lf={touchstart:PE,touchmove:Oo,touchend:Oo,touchcancel:Oo},qn={},hf=!1;function bE(s,l,u){return l==="touchstart"&&SE(),lf[l]?(u=lf[l].bind(this,u),s.addEventListener(Vl[l],u,!1),u):(console.warn("wrong event specified:",l),p)}function TE(s,l,u){if(!Vl[l]){console.warn("wrong event specified:",l);return}s.removeEventListener(Vl[l],u,!1)}function CE(s){qn[s.pointerId]=s}function ME(s){qn[s.pointerId]&&(qn[s.pointerId]=s)}function cf(s){delete qn[s.pointerId]}function SE(){hf||(document.addEventListener(rf,CE,!0),document.addEventListener(sf,ME,!0),document.addEventListener(of,cf,!0),document.addEventListener(af,cf,!0),hf=!0)}function Oo(s,l){if(l.pointerType!==(l.MSPOINTER_TYPE_MOUSE||"mouse")){l.touches=[];for(var u in qn)l.touches.push(qn[u]);l.changedTouches=[l],s(l)}}function PE(s,l){l.MSPOINTER_TYPE_TOUCH&&l.pointerType===l.MSPOINTER_TYPE_TOUCH&&Kt(l),Oo(s,l)}function kE(s){var l={},u,g;for(g in s)u=s[g],l[g]=u&&u.bind?u.bind(s):u;return s=l,l.type="dblclick",l.detail=2,l.isTrusted=!1,l._simulated=!0,l}var RE=200;function AE(s,l){s.addEventListener("dblclick",l);var u=0,g;function _(x){if(x.detail!==1){g=x.detail;return}if(!(x.pointerType==="mouse"||x.sourceCapabilities&&!x.sourceCapabilities.firesTouchEvents)){var M=pf(x);if(!(M.some(function(A){return A instanceof HTMLLabelElement&&A.attributes.for})&&!M.some(function(A){return A instanceof HTMLInputElement||A instanceof HTMLSelectElement}))){var k=Date.now();k-u<=RE?(g++,g===2&&l(kE(x))):g=1,u=k}}}return s.addEventListener("click",_),{dblclick:l,simDblclick:_}}function IE(s,l){s.removeEventListener("dblclick",l.dblclick),s.removeEventListener("click",l.simDblclick)}var Xl=No(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Hr=No(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),uf=Hr==="webkitTransition"||Hr==="OTransition"?Hr+"End":"transitionend";function df(s){return typeof s=="string"?document.getElementById(s):s}function Vr(s,l){var u=s.style[l]||s.currentStyle&&s.currentStyle[l];if((!u||u==="auto")&&document.defaultView){var g=document.defaultView.getComputedStyle(s,null);u=g?g[l]:null}return u==="auto"?null:u}function yt(s,l,u){var g=document.createElement(s);return g.className=l||"",u&&u.appendChild(g),g}function kt(s){var l=s.parentNode;l&&l.removeChild(s)}function Fo(s){for(;s.firstChild;)s.removeChild(s.firstChild)}function Jn(s){var l=s.parentNode;l&&l.lastChild!==s&&l.appendChild(s)}function Qn(s){var l=s.parentNode;l&&l.firstChild!==s&&l.insertBefore(s,l.firstChild)}function Yl(s,l){if(s.classList!==void 0)return s.classList.contains(l);var u=zo(s);return u.length>0&&new RegExp("(^|\\s)"+l+"(\\s|$)").test(u)}function ct(s,l){if(s.classList!==void 0)for(var u=v(l),g=0,_=u.length;g<_;g++)s.classList.add(u[g]);else if(!Yl(s,l)){var x=zo(s);Kl(s,(x?x+" ":"")+l)}}function It(s,l){s.classList!==void 0?s.classList.remove(l):Kl(s,y((" "+zo(s)+" ").replace(" "+l+" "," ")))}function Kl(s,l){s.className.baseVal===void 0?s.className=l:s.className.baseVal=l}function zo(s){return s.correspondingElement&&(s=s.correspondingElement),s.className.baseVal===void 0?s.className:s.className.baseVal}function we(s,l){"opacity"in s.style?s.style.opacity=l:"filter"in s.style&&DE(s,l)}function DE(s,l){var u=!1,g="DXImageTransform.Microsoft.Alpha";try{u=s.filters.item(g)}catch{if(l===1)return}l=Math.round(l*100),u?(u.Enabled=l!==100,u.Opacity=l):s.style.filter+=" progid:"+g+"(opacity="+l+")"}function No(s){for(var l=document.documentElement.style,u=0;u<s.length;u++)if(s[u]in l)return s[u];return!1}function un(s,l,u){var g=l||new N(0,0);s.style[Xl]=(K.ie3d?"translate("+g.x+"px,"+g.y+"px)":"translate3d("+g.x+"px,"+g.y+"px,0)")+(u?" scale("+u+")":"")}function Nt(s,l){s._leaflet_pos=l,K.any3d?un(s,l):(s.style.left=l.x+"px",s.style.top=l.y+"px")}function dn(s){return s._leaflet_pos||new N(0,0)}var Xr,Yr,ql;if("onselectstart"in document)Xr=function(){lt(window,"selectstart",Kt)},Yr=function(){St(window,"selectstart",Kt)};else{var Kr=No(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Xr=function(){if(Kr){var s=document.documentElement.style;ql=s[Kr],s[Kr]="none"}},Yr=function(){Kr&&(document.documentElement.style[Kr]=ql,ql=void 0)}}function Jl(){lt(window,"dragstart",Kt)}function Ql(){St(window,"dragstart",Kt)}var Bo,$l;function th(s){for(;s.tabIndex===-1;)s=s.parentNode;s.style&&(Go(),Bo=s,$l=s.style.outlineStyle,s.style.outlineStyle="none",lt(window,"keydown",Go))}function Go(){Bo&&(Bo.style.outlineStyle=$l,Bo=void 0,$l=void 0,St(window,"keydown",Go))}function ff(s){do s=s.parentNode;while((!s.offsetWidth||!s.offsetHeight)&&s!==document.body);return s}function eh(s){var l=s.getBoundingClientRect();return{x:l.width/s.offsetWidth||1,y:l.height/s.offsetHeight||1,boundingClientRect:l}}var OE={__proto__:null,TRANSFORM:Xl,TRANSITION:Hr,TRANSITION_END:uf,get:df,getStyle:Vr,create:yt,remove:kt,empty:Fo,toFront:Jn,toBack:Qn,hasClass:Yl,addClass:ct,removeClass:It,setClass:Kl,getClass:zo,setOpacity:we,testProp:No,setTransform:un,setPosition:Nt,getPosition:dn,get disableTextSelection(){return Xr},get enableTextSelection(){return Yr},disableImageDrag:Jl,enableImageDrag:Ql,preventOutline:th,restoreOutline:Go,getSizedParentNode:ff,getScale:eh};function lt(s,l,u,g){if(l&&typeof l=="object")for(var _ in l)nh(s,_,l[_],u);else{l=v(l);for(var x=0,M=l.length;x<M;x++)nh(s,l[x],u,g)}return this}var Xe="_leaflet_events";function St(s,l,u,g){if(arguments.length===1)gf(s),delete s[Xe];else if(l&&typeof l=="object")for(var _ in l)rh(s,_,l[_],u);else if(l=v(l),arguments.length===2)gf(s,function(k){return T(l,k)!==-1});else for(var x=0,M=l.length;x<M;x++)rh(s,l[x],u,g);return this}function gf(s,l){for(var u in s[Xe]){var g=u.split(/\d/)[0];(!l||l(g))&&rh(s,g,null,null,u)}}var ih={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function nh(s,l,u,g){var _=l+c(u)+(g?"_"+c(g):"");if(s[Xe]&&s[Xe][_])return this;var x=function(k){return u.call(g||s,k||window.event)},M=x;!K.touchNative&&K.pointer&&l.indexOf("touch")===0?x=bE(s,l,x):K.touch&&l==="dblclick"?x=AE(s,x):"addEventListener"in s?l==="touchstart"||l==="touchmove"||l==="wheel"||l==="mousewheel"?s.addEventListener(ih[l]||l,x,K.passiveEvents?{passive:!1}:!1):l==="mouseenter"||l==="mouseleave"?(x=function(k){k=k||window.event,oh(s,k)&&M(k)},s.addEventListener(ih[l],x,!1)):s.addEventListener(l,M,!1):s.attachEvent("on"+l,x),s[Xe]=s[Xe]||{},s[Xe][_]=x}function rh(s,l,u,g,_){_=_||l+c(u)+(g?"_"+c(g):"");var x=s[Xe]&&s[Xe][_];if(!x)return this;!K.touchNative&&K.pointer&&l.indexOf("touch")===0?TE(s,l,x):K.touch&&l==="dblclick"?IE(s,x):"removeEventListener"in s?s.removeEventListener(ih[l]||l,x,!1):s.detachEvent("on"+l,x),s[Xe][_]=null}function fn(s){return s.stopPropagation?s.stopPropagation():s.originalEvent?s.originalEvent._stopped=!0:s.cancelBubble=!0,this}function sh(s){return nh(s,"wheel",fn),this}function qr(s){return lt(s,"mousedown touchstart dblclick contextmenu",fn),s._leaflet_disable_click=!0,this}function Kt(s){return s.preventDefault?s.preventDefault():s.returnValue=!1,this}function gn(s){return Kt(s),fn(s),this}function pf(s){if(s.composedPath)return s.composedPath();for(var l=[],u=s.target;u;)l.push(u),u=u.parentNode;return l}function _f(s,l){if(!l)return new N(s.clientX,s.clientY);var u=eh(l),g=u.boundingClientRect;return new N((s.clientX-g.left)/u.x-l.clientLeft,(s.clientY-g.top)/u.y-l.clientTop)}var FE=K.linux&&K.chrome?window.devicePixelRatio:K.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function mf(s){return K.edge?s.wheelDeltaY/2:s.deltaY&&s.deltaMode===0?-s.deltaY/FE:s.deltaY&&s.deltaMode===1?-s.deltaY*20:s.deltaY&&s.deltaMode===2?-s.deltaY*60:s.deltaX||s.deltaZ?0:s.wheelDelta?(s.wheelDeltaY||s.wheelDelta)/2:s.detail&&Math.abs(s.detail)<32765?-s.detail*20:s.detail?s.detail/-32765*60:0}function oh(s,l){var u=l.relatedTarget;if(!u)return!0;try{for(;u&&u!==s;)u=u.parentNode}catch{return!1}return u!==s}var zE={__proto__:null,on:lt,off:St,stopPropagation:fn,disableScrollPropagation:sh,disableClickPropagation:qr,preventDefault:Kt,stop:gn,getPropagationPath:pf,getMousePosition:_f,getWheelDelta:mf,isExternalTarget:oh,addListener:lt,removeListener:St},yf=G.extend({run:function(s,l,u,g){this.stop(),this._el=s,this._inProgress=!0,this._duration=u||.25,this._easeOutPower=1/Math.max(g||.5,.2),this._startPos=dn(s),this._offset=l.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=q(this._animate,this),this._step()},_step:function(s){var l=+new Date-this._startTime,u=this._duration*1e3;l<u?this._runFrame(this._easeOut(l/u),s):(this._runFrame(1),this._complete())},_runFrame:function(s,l){var u=this._startPos.add(this._offset.multiplyBy(s));l&&u._round(),Nt(this._el,u),this.fire("step")},_complete:function(){Y(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(s){return 1-Math.pow(1-s,this._easeOutPower)}}),mt=G.extend({options:{crs:Oi,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(s,l){l=E(this,l),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(s),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),l.maxBounds&&this.setMaxBounds(l.maxBounds),l.zoom!==void 0&&(this._zoom=this._limitZoom(l.zoom)),l.center&&l.zoom!==void 0&&this.setView(st(l.center),l.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Hr&&K.any3d&&!K.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),lt(this._proxy,uf,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(s,l,u){if(l=l===void 0?this._zoom:this._limitZoom(l),s=this._limitCenter(st(s),l,this.options.maxBounds),u=u||{},this._stop(),this._loaded&&!u.reset&&u!==!0){u.animate!==void 0&&(u.zoom=n({animate:u.animate},u.zoom),u.pan=n({animate:u.animate,duration:u.duration},u.pan));var g=this._zoom!==l?this._tryAnimatedZoom&&this._tryAnimatedZoom(s,l,u.zoom):this._tryAnimatedPan(s,u.pan);if(g)return clearTimeout(this._sizeTimer),this}return this._resetView(s,l,u.pan&&u.pan.noMoveStart),this},setZoom:function(s,l){return this._loaded?this.setView(this.getCenter(),s,{zoom:l}):(this._zoom=s,this)},zoomIn:function(s,l){return s=s||(K.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+s,l)},zoomOut:function(s,l){return s=s||(K.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-s,l)},setZoomAround:function(s,l,u){var g=this.getZoomScale(l),_=this.getSize().divideBy(2),x=s instanceof N?s:this.latLngToContainerPoint(s),M=x.subtract(_).multiplyBy(1-1/g),k=this.containerPointToLatLng(_.add(M));return this.setView(k,l,{zoom:u})},_getBoundsCenterZoom:function(s,l){l=l||{},s=s.getBounds?s.getBounds():tt(s);var u=Z(l.paddingTopLeft||l.padding||[0,0]),g=Z(l.paddingBottomRight||l.padding||[0,0]),_=this.getBoundsZoom(s,!1,u.add(g));if(_=typeof l.maxZoom=="number"?Math.min(l.maxZoom,_):_,_===1/0)return{center:s.getCenter(),zoom:_};var x=g.subtract(u).divideBy(2),M=this.project(s.getSouthWest(),_),k=this.project(s.getNorthEast(),_),A=this.unproject(M.add(k).divideBy(2).add(x),_);return{center:A,zoom:_}},fitBounds:function(s,l){if(s=tt(s),!s.isValid())throw new Error("Bounds are not valid.");var u=this._getBoundsCenterZoom(s,l);return this.setView(u.center,u.zoom,l)},fitWorld:function(s){return this.fitBounds([[-90,-180],[90,180]],s)},panTo:function(s,l){return this.setView(s,this._zoom,{pan:l})},panBy:function(s,l){if(s=Z(s).round(),l=l||{},!s.x&&!s.y)return this.fire("moveend");if(l.animate!==!0&&!this.getSize().contains(s))return this._resetView(this.unproject(this.project(this.getCenter()).add(s)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new yf,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),l.noMoveStart||this.fire("movestart"),l.animate!==!1){ct(this._mapPane,"leaflet-pan-anim");var u=this._getMapPanePos().subtract(s).round();this._panAnim.run(this._mapPane,u,l.duration||.25,l.easeLinearity)}else this._rawPanBy(s),this.fire("move").fire("moveend");return this},flyTo:function(s,l,u){if(u=u||{},u.animate===!1||!K.any3d)return this.setView(s,l,u);this._stop();var g=this.project(this.getCenter()),_=this.project(s),x=this.getSize(),M=this._zoom;s=st(s),l=l===void 0?M:l;var k=Math.max(x.x,x.y),A=k*this.getZoomScale(M,l),F=_.distanceTo(g)||1,W=1.42,it=W*W;function dt(Bt){var Qo=Bt?-1:1,TL=Bt?A:k,CL=A*A-k*k+Qo*it*it*F*F,ML=2*TL*it*F,mh=CL/ML,Qf=Math.sqrt(mh*mh+1)-mh,SL=Qf<1e-9?-18:Math.log(Qf);return SL}function re(Bt){return(Math.exp(Bt)-Math.exp(-Bt))/2}function Ht(Bt){return(Math.exp(Bt)+Math.exp(-Bt))/2}function Le(Bt){return re(Bt)/Ht(Bt)}var ue=dt(0);function rr(Bt){return k*(Ht(ue)/Ht(ue+W*Bt))}function wL(Bt){return k*(Ht(ue)*Le(ue+W*Bt)-re(ue))/it}function EL(Bt){return 1-Math.pow(1-Bt,1.5)}var LL=Date.now(),qf=(dt(1)-ue)/W,bL=u.duration?1e3*u.duration:1e3*qf*.8;function Jf(){var Bt=(Date.now()-LL)/bL,Qo=EL(Bt)*qf;Bt<=1?(this._flyToFrame=q(Jf,this),this._move(this.unproject(g.add(_.subtract(g).multiplyBy(wL(Qo)/F)),M),this.getScaleZoom(k/rr(Qo),M),{flyTo:!0})):this._move(s,l)._moveEnd(!0)}return this._moveStart(!0,u.noMoveStart),Jf.call(this),this},flyToBounds:function(s,l){var u=this._getBoundsCenterZoom(s,l);return this.flyTo(u.center,u.zoom,l)},setMaxBounds:function(s){return s=tt(s),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),s.isValid()?(this.options.maxBounds=s,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(s){var l=this.options.minZoom;return this.options.minZoom=s,this._loaded&&l!==s&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(s):this},setMaxZoom:function(s){var l=this.options.maxZoom;return this.options.maxZoom=s,this._loaded&&l!==s&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(s):this},panInsideBounds:function(s,l){this._enforcingBounds=!0;var u=this.getCenter(),g=this._limitCenter(u,this._zoom,tt(s));return u.equals(g)||this.panTo(g,l),this._enforcingBounds=!1,this},panInside:function(s,l){l=l||{};var u=Z(l.paddingTopLeft||l.padding||[0,0]),g=Z(l.paddingBottomRight||l.padding||[0,0]),_=this.project(this.getCenter()),x=this.project(s),M=this.getPixelBounds(),k=z([M.min.add(u),M.max.subtract(g)]),A=k.getSize();if(!k.contains(x)){this._enforcingBounds=!0;var F=x.subtract(k.getCenter()),W=k.extend(x).getSize().subtract(A);_.x+=F.x<0?-W.x:W.x,_.y+=F.y<0?-W.y:W.y,this.panTo(this.unproject(_),l),this._enforcingBounds=!1}return this},invalidateSize:function(s){if(!this._loaded)return this;s=n({animate:!1,pan:!0},s===!0?{animate:!0}:s);var l=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var u=this.getSize(),g=l.divideBy(2).round(),_=u.divideBy(2).round(),x=g.subtract(_);return!x.x&&!x.y?this:(s.animate&&s.pan?this.panBy(x):(s.pan&&this._rawPanBy(x),this.fire("move"),s.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:l,newSize:u}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(s){if(s=this._locateOptions=n({timeout:1e4,watch:!1},s),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var l=a(this._handleGeolocationResponse,this),u=a(this._handleGeolocationError,this);return s.watch?this._locationWatchId=navigator.geolocation.watchPosition(l,u,s):navigator.geolocation.getCurrentPosition(l,u,s),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(s){if(this._container._leaflet_id){var l=s.code,u=s.message||(l===1?"permission denied":l===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:l,message:"Geolocation error: "+u+"."})}},_handleGeolocationResponse:function(s){if(this._container._leaflet_id){var l=s.coords.latitude,u=s.coords.longitude,g=new J(l,u),_=g.toBounds(s.coords.accuracy*2),x=this._locateOptions;if(x.setView){var M=this.getBoundsZoom(_);this.setView(g,x.maxZoom?Math.min(M,x.maxZoom):M)}var k={latlng:g,bounds:_,timestamp:s.timestamp};for(var A in s.coords)typeof s.coords[A]=="number"&&(k[A]=s.coords[A]);this.fire("locationfound",k)}},addHandler:function(s,l){if(!l)return this;var u=this[s]=new l(this);return this._handlers.push(u),this.options[s]&&u.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),kt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Y(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var s;for(s in this._layers)this._layers[s].remove();for(s in this._panes)kt(this._panes[s]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(s,l){var u="leaflet-pane"+(s?" leaflet-"+s.replace("Pane","")+"-pane":""),g=yt("div",u,l||this._mapPane);return s&&(this._panes[s]=g),g},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var s=this.getPixelBounds(),l=this.unproject(s.getBottomLeft()),u=this.unproject(s.getTopRight());return new Lt(l,u)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(s,l,u){s=tt(s),u=Z(u||[0,0]);var g=this.getZoom()||0,_=this.getMinZoom(),x=this.getMaxZoom(),M=s.getNorthWest(),k=s.getSouthEast(),A=this.getSize().subtract(u),F=z(this.project(k,g),this.project(M,g)).getSize(),W=K.any3d?this.options.zoomSnap:1,it=A.x/F.x,dt=A.y/F.y,re=l?Math.max(it,dt):Math.min(it,dt);return g=this.getScaleZoom(re,g),W&&(g=Math.round(g/(W/100))*(W/100),g=l?Math.ceil(g/W)*W:Math.floor(g/W)*W),Math.max(_,Math.min(x,g))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new N(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(s,l){var u=this._getTopLeftPoint(s,l);return new at(u,u.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(s){return this.options.crs.getProjectedBounds(s===void 0?this.getZoom():s)},getPane:function(s){return typeof s=="string"?this._panes[s]:s},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(s,l){var u=this.options.crs;return l=l===void 0?this._zoom:l,u.scale(s)/u.scale(l)},getScaleZoom:function(s,l){var u=this.options.crs;l=l===void 0?this._zoom:l;var g=u.zoom(s*u.scale(l));return isNaN(g)?1/0:g},project:function(s,l){return l=l===void 0?this._zoom:l,this.options.crs.latLngToPoint(st(s),l)},unproject:function(s,l){return l=l===void 0?this._zoom:l,this.options.crs.pointToLatLng(Z(s),l)},layerPointToLatLng:function(s){var l=Z(s).add(this.getPixelOrigin());return this.unproject(l)},latLngToLayerPoint:function(s){var l=this.project(st(s))._round();return l._subtract(this.getPixelOrigin())},wrapLatLng:function(s){return this.options.crs.wrapLatLng(st(s))},wrapLatLngBounds:function(s){return this.options.crs.wrapLatLngBounds(tt(s))},distance:function(s,l){return this.options.crs.distance(st(s),st(l))},containerPointToLayerPoint:function(s){return Z(s).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(s){return Z(s).add(this._getMapPanePos())},containerPointToLatLng:function(s){var l=this.containerPointToLayerPoint(Z(s));return this.layerPointToLatLng(l)},latLngToContainerPoint:function(s){return this.layerPointToContainerPoint(this.latLngToLayerPoint(st(s)))},mouseEventToContainerPoint:function(s){return _f(s,this._container)},mouseEventToLayerPoint:function(s){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(s))},mouseEventToLatLng:function(s){return this.layerPointToLatLng(this.mouseEventToLayerPoint(s))},_initContainer:function(s){var l=this._container=df(s);if(l){if(l._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");lt(l,"scroll",this._onScroll,this),this._containerId=c(l)},_initLayout:function(){var s=this._container;this._fadeAnimated=this.options.fadeAnimation&&K.any3d,ct(s,"leaflet-container"+(K.touch?" leaflet-touch":"")+(K.retina?" leaflet-retina":"")+(K.ielt9?" leaflet-oldie":"")+(K.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var l=Vr(s,"position");l!=="absolute"&&l!=="relative"&&l!=="fixed"&&l!=="sticky"&&(s.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var s=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Nt(this._mapPane,new N(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ct(s.markerPane,"leaflet-zoom-hide"),ct(s.shadowPane,"leaflet-zoom-hide"))},_resetView:function(s,l,u){Nt(this._mapPane,new N(0,0));var g=!this._loaded;this._loaded=!0,l=this._limitZoom(l),this.fire("viewprereset");var _=this._zoom!==l;this._moveStart(_,u)._move(s,l)._moveEnd(_),this.fire("viewreset"),g&&this.fire("load")},_moveStart:function(s,l){return s&&this.fire("zoomstart"),l||this.fire("movestart"),this},_move:function(s,l,u,g){l===void 0&&(l=this._zoom);var _=this._zoom!==l;return this._zoom=l,this._lastCenter=s,this._pixelOrigin=this._getNewPixelOrigin(s),g?u&&u.pinch&&this.fire("zoom",u):((_||u&&u.pinch)&&this.fire("zoom",u),this.fire("move",u)),this},_moveEnd:function(s){return s&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return Y(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(s){Nt(this._mapPane,this._getMapPanePos().subtract(s))},_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(s){this._targets={},this._targets[c(this._container)]=this;var l=s?St:lt;l(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&l(window,"resize",this._onResize,this),K.any3d&&this.options.transform3DLimit&&(s?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Y(this._resizeRequest),this._resizeRequest=q(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var s=this._getMapPanePos();Math.max(Math.abs(s.x),Math.abs(s.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(s,l){for(var u=[],g,_=l==="mouseout"||l==="mouseover",x=s.target||s.srcElement,M=!1;x;){if(g=this._targets[c(x)],g&&(l==="click"||l==="preclick")&&this._draggableMoved(g)){M=!0;break}if(g&&g.listens(l,!0)&&(_&&!oh(x,s)||(u.push(g),_))||x===this._container)break;x=x.parentNode}return!u.length&&!M&&!_&&this.listens(l,!0)&&(u=[this]),u},_isClickDisabled:function(s){for(;s&&s!==this._container;){if(s._leaflet_disable_click)return!0;s=s.parentNode}},_handleDOMEvent:function(s){var l=s.target||s.srcElement;if(!(!this._loaded||l._leaflet_disable_events||s.type==="click"&&this._isClickDisabled(l))){var u=s.type;u==="mousedown"&&th(l),this._fireDOMEvent(s,u)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(s,l,u){if(s.type==="click"){var g=n({},s);g.type="preclick",this._fireDOMEvent(g,g.type,u)}var _=this._findEventTargets(s,l);if(u){for(var x=[],M=0;M<u.length;M++)u[M].listens(l,!0)&&x.push(u[M]);_=x.concat(_)}if(_.length){l==="contextmenu"&&Kt(s);var k=_[0],A={originalEvent:s};if(s.type!=="keypress"&&s.type!=="keydown"&&s.type!=="keyup"){var F=k.getLatLng&&(!k._radius||k._radius<=10);A.containerPoint=F?this.latLngToContainerPoint(k.getLatLng()):this.mouseEventToContainerPoint(s),A.layerPoint=this.containerPointToLayerPoint(A.containerPoint),A.latlng=F?k.getLatLng():this.layerPointToLatLng(A.layerPoint)}for(M=0;M<_.length;M++)if(_[M].fire(l,A,!0),A.originalEvent._stopped||_[M].options.bubblingMouseEvents===!1&&T(this._mouseEvents,l)!==-1)return}},_draggableMoved:function(s){return s=s.dragging&&s.dragging.enabled()?s:this,s.dragging&&s.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var s=0,l=this._handlers.length;s<l;s++)this._handlers[s].disable()},whenReady:function(s,l){return this._loaded?s.call(l||this,{target:this}):this.on("load",s,l),this},_getMapPanePos:function(){return dn(this._mapPane)||new N(0,0)},_moved:function(){var s=this._getMapPanePos();return s&&!s.equals([0,0])},_getTopLeftPoint:function(s,l){var u=s&&l!==void 0?this._getNewPixelOrigin(s,l):this.getPixelOrigin();return u.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(s,l){var u=this.getSize()._divideBy(2);return this.project(s,l)._subtract(u)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(s,l,u){var g=this._getNewPixelOrigin(u,l);return this.project(s,l)._subtract(g)},_latLngBoundsToNewLayerBounds:function(s,l,u){var g=this._getNewPixelOrigin(u,l);return z([this.project(s.getSouthWest(),l)._subtract(g),this.project(s.getNorthWest(),l)._subtract(g),this.project(s.getSouthEast(),l)._subtract(g),this.project(s.getNorthEast(),l)._subtract(g)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(s){return this.latLngToLayerPoint(s).subtract(this._getCenterLayerPoint())},_limitCenter:function(s,l,u){if(!u)return s;var g=this.project(s,l),_=this.getSize().divideBy(2),x=new at(g.subtract(_),g.add(_)),M=this._getBoundsOffset(x,u,l);return Math.abs(M.x)<=1&&Math.abs(M.y)<=1?s:this.unproject(g.add(M),l)},_limitOffset:function(s,l){if(!l)return s;var u=this.getPixelBounds(),g=new at(u.min.add(s),u.max.add(s));return s.add(this._getBoundsOffset(g,l))},_getBoundsOffset:function(s,l,u){var g=z(this.project(l.getNorthEast(),u),this.project(l.getSouthWest(),u)),_=g.min.subtract(s.min),x=g.max.subtract(s.max),M=this._rebound(_.x,-x.x),k=this._rebound(_.y,-x.y);return new N(M,k)},_rebound:function(s,l){return s+l>0?Math.round(s-l)/2:Math.max(0,Math.ceil(s))-Math.max(0,Math.floor(l))},_limitZoom:function(s){var l=this.getMinZoom(),u=this.getMaxZoom(),g=K.any3d?this.options.zoomSnap:1;return g&&(s=Math.round(s/g)*g),Math.max(l,Math.min(u,s))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){It(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(s,l){var u=this._getCenterOffset(s)._trunc();return(l&&l.animate)!==!0&&!this.getSize().contains(u)?!1:(this.panBy(u,l),!0)},_createAnimProxy:function(){var s=this._proxy=yt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(s),this.on("zoomanim",function(l){var u=Xl,g=this._proxy.style[u];un(this._proxy,this.project(l.center,l.zoom),this.getZoomScale(l.zoom,1)),g===this._proxy.style[u]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){kt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var s=this.getCenter(),l=this.getZoom();un(this._proxy,this.project(s,l),this.getZoomScale(l,1))},_catchTransitionEnd:function(s){this._animatingZoom&&s.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(s,l,u){if(this._animatingZoom)return!0;if(u=u||{},!this._zoomAnimated||u.animate===!1||this._nothingToAnimate()||Math.abs(l-this._zoom)>this.options.zoomAnimationThreshold)return!1;var g=this.getZoomScale(l),_=this._getCenterOffset(s)._divideBy(1-1/g);return u.animate!==!0&&!this.getSize().contains(_)?!1:(q(function(){this._moveStart(!0,u.noMoveStart||!1)._animateZoom(s,l,!0)},this),!0)},_animateZoom:function(s,l,u,g){this._mapPane&&(u&&(this._animatingZoom=!0,this._animateToCenter=s,this._animateToZoom=l,ct(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:s,zoom:l,noUpdate:g}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&It(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 NE(s,l){return new mt(s,l)}var Ae=pt.extend({options:{position:"topright"},initialize:function(s){E(this,s)},getPosition:function(){return this.options.position},setPosition:function(s){var l=this._map;return l&&l.removeControl(this),this.options.position=s,l&&l.addControl(this),this},getContainer:function(){return this._container},addTo:function(s){this.remove(),this._map=s;var l=this._container=this.onAdd(s),u=this.getPosition(),g=s._controlCorners[u];return ct(l,"leaflet-control"),u.indexOf("bottom")!==-1?g.insertBefore(l,g.firstChild):g.appendChild(l),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(kt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(s){this._map&&s&&s.screenX>0&&s.screenY>0&&this._map.getContainer().focus()}}),Jr=function(s){return new Ae(s)};mt.include({addControl:function(s){return s.addTo(this),this},removeControl:function(s){return s.remove(),this},_initControlPos:function(){var s=this._controlCorners={},l="leaflet-",u=this._controlContainer=yt("div",l+"control-container",this._container);function g(_,x){var M=l+_+" "+l+x;s[_+x]=yt("div",M,u)}g("top","left"),g("top","right"),g("bottom","left"),g("bottom","right")},_clearControlPos:function(){for(var s in this._controlCorners)kt(this._controlCorners[s]);kt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var vf=Ae.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(s,l,u,g){return u<g?-1:g<u?1:0}},initialize:function(s,l,u){E(this,u),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var g in s)this._addLayer(s[g],g);for(g in l)this._addLayer(l[g],g,!0)},onAdd:function(s){this._initLayout(),this._update(),this._map=s,s.on("zoomend",this._checkDisabledLayers,this);for(var l=0;l<this._layers.length;l++)this._layers[l].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(s){return Ae.prototype.addTo.call(this,s),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var s=0;s<this._layers.length;s++)this._layers[s].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(s,l){return this._addLayer(s,l),this._map?this._update():this},addOverlay:function(s,l){return this._addLayer(s,l,!0),this._map?this._update():this},removeLayer:function(s){s.off("add remove",this._onLayerChange,this);var l=this._getLayer(c(s));return l&&this._layers.splice(this._layers.indexOf(l),1),this._map?this._update():this},expand:function(){ct(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var s=this._map.getSize().y-(this._container.offsetTop+50);return s<this._section.clientHeight?(ct(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=s+"px"):It(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return It(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var s="leaflet-control-layers",l=this._container=yt("div",s),u=this.options.collapsed;l.setAttribute("aria-haspopup",!0),qr(l),sh(l);var g=this._section=yt("section",s+"-list");u&&(this._map.on("click",this.collapse,this),lt(l,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var _=this._layersLink=yt("a",s+"-toggle",l);_.href="#",_.title="Layers",_.setAttribute("role","button"),lt(_,{keydown:function(x){x.keyCode===13&&this._expandSafely()},click:function(x){Kt(x),this._expandSafely()}},this),u||this.expand(),this._baseLayersList=yt("div",s+"-base",g),this._separator=yt("div",s+"-separator",g),this._overlaysList=yt("div",s+"-overlays",g),l.appendChild(g)},_getLayer:function(s){for(var l=0;l<this._layers.length;l++)if(this._layers[l]&&c(this._layers[l].layer)===s)return this._layers[l]},_addLayer:function(s,l,u){this._map&&s.on("add remove",this._onLayerChange,this),this._layers.push({layer:s,name:l,overlay:u}),this.options.sortLayers&&this._layers.sort(a(function(g,_){return this.options.sortFunction(g.layer,_.layer,g.name,_.name)},this)),this.options.autoZIndex&&s.setZIndex&&(this._lastZIndex++,s.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Fo(this._baseLayersList),Fo(this._overlaysList),this._layerControlInputs=[];var s,l,u,g,_=0;for(u=0;u<this._layers.length;u++)g=this._layers[u],this._addItem(g),l=l||g.overlay,s=s||!g.overlay,_+=g.overlay?0:1;return this.options.hideSingleBase&&(s=s&&_>1,this._baseLayersList.style.display=s?"":"none"),this._separator.style.display=l&&s?"":"none",this},_onLayerChange:function(s){this._handlingClick||this._update();var l=this._getLayer(c(s.target)),u=l.overlay?s.type==="add"?"overlayadd":"overlayremove":s.type==="add"?"baselayerchange":null;u&&this._map.fire(u,l)},_createRadioElement:function(s,l){var u='<input type="radio" class="leaflet-control-layers-selector" name="'+s+'"'+(l?' checked="checked"':"")+"/>",g=document.createElement("div");return g.innerHTML=u,g.firstChild},_addItem:function(s){var l=document.createElement("label"),u=this._map.hasLayer(s.layer),g;s.overlay?(g=document.createElement("input"),g.type="checkbox",g.className="leaflet-control-layers-selector",g.defaultChecked=u):g=this._createRadioElement("leaflet-base-layers_"+c(this),u),this._layerControlInputs.push(g),g.layerId=c(s.layer),lt(g,"click",this._onInputClick,this);var _=document.createElement("span");_.innerHTML=" "+s.name;var x=document.createElement("span");l.appendChild(x),x.appendChild(g),x.appendChild(_);var M=s.overlay?this._overlaysList:this._baseLayersList;return M.appendChild(l),this._checkDisabledLayers(),l},_onInputClick:function(){if(!this._preventClick){var s=this._layerControlInputs,l,u,g=[],_=[];this._handlingClick=!0;for(var x=s.length-1;x>=0;x--)l=s[x],u=this._getLayer(l.layerId).layer,l.checked?g.push(u):l.checked||_.push(u);for(x=0;x<_.length;x++)this._map.hasLayer(_[x])&&this._map.removeLayer(_[x]);for(x=0;x<g.length;x++)this._map.hasLayer(g[x])||this._map.addLayer(g[x]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var s=this._layerControlInputs,l,u,g=this._map.getZoom(),_=s.length-1;_>=0;_--)l=s[_],u=this._getLayer(l.layerId).layer,l.disabled=u.options.minZoom!==void 0&&g<u.options.minZoom||u.options.maxZoom!==void 0&&g>u.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var s=this._section;this._preventClick=!0,lt(s,"click",Kt),this.expand();var l=this;setTimeout(function(){St(s,"click",Kt),l._preventClick=!1})}}),BE=function(s,l,u){return new vf(s,l,u)},ah=Ae.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(s){var l="leaflet-control-zoom",u=yt("div",l+" leaflet-bar"),g=this.options;return this._zoomInButton=this._createButton(g.zoomInText,g.zoomInTitle,l+"-in",u,this._zoomIn),this._zoomOutButton=this._createButton(g.zoomOutText,g.zoomOutTitle,l+"-out",u,this._zoomOut),this._updateDisabled(),s.on("zoomend zoomlevelschange",this._updateDisabled,this),u},onRemove:function(s){s.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(s){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(s.shiftKey?3:1))},_zoomOut:function(s){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(s.shiftKey?3:1))},_createButton:function(s,l,u,g,_){var x=yt("a",u,g);return x.innerHTML=s,x.href="#",x.title=l,x.setAttribute("role","button"),x.setAttribute("aria-label",l),qr(x),lt(x,"click",gn),lt(x,"click",_,this),lt(x,"click",this._refocusOnMap,this),x},_updateDisabled:function(){var s=this._map,l="leaflet-disabled";It(this._zoomInButton,l),It(this._zoomOutButton,l),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||s._zoom===s.getMinZoom())&&(ct(this._zoomOutButton,l),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||s._zoom===s.getMaxZoom())&&(ct(this._zoomInButton,l),this._zoomInButton.setAttribute("aria-disabled","true"))}});mt.mergeOptions({zoomControl:!0}),mt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new ah,this.addControl(this.zoomControl))});var GE=function(s){return new ah(s)},xf=Ae.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(s){var l="leaflet-control-scale",u=yt("div",l),g=this.options;return this._addScales(g,l+"-line",u),s.on(g.updateWhenIdle?"moveend":"move",this._update,this),s.whenReady(this._update,this),u},onRemove:function(s){s.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(s,l,u){s.metric&&(this._mScale=yt("div",l,u)),s.imperial&&(this._iScale=yt("div",l,u))},_update:function(){var s=this._map,l=s.getSize().y/2,u=s.distance(s.containerPointToLatLng([0,l]),s.containerPointToLatLng([this.options.maxWidth,l]));this._updateScales(u)},_updateScales:function(s){this.options.metric&&s&&this._updateMetric(s),this.options.imperial&&s&&this._updateImperial(s)},_updateMetric:function(s){var l=this._getRoundNum(s),u=l<1e3?l+" m":l/1e3+" km";this._updateScale(this._mScale,u,l/s)},_updateImperial:function(s){var l=s*3.2808399,u,g,_;l>5280?(u=l/5280,g=this._getRoundNum(u),this._updateScale(this._iScale,g+" mi",g/u)):(_=this._getRoundNum(l),this._updateScale(this._iScale,_+" ft",_/l))},_updateScale:function(s,l,u){s.style.width=Math.round(this.options.maxWidth*u)+"px",s.innerHTML=l},_getRoundNum:function(s){var l=Math.pow(10,(Math.floor(s)+"").length-1),u=s/l;return u=u>=10?10:u>=5?5:u>=3?3:u>=2?2:1,l*u}}),UE=function(s){return new xf(s)},jE='<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>',lh=Ae.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(K.inlineSvg?jE+" ":"")+"Leaflet</a>"},initialize:function(s){E(this,s),this._attributions={}},onAdd:function(s){s.attributionControl=this,this._container=yt("div","leaflet-control-attribution"),qr(this._container);for(var l in s._layers)s._layers[l].getAttribution&&this.addAttribution(s._layers[l].getAttribution());return this._update(),s.on("layeradd",this._addAttribution,this),this._container},onRemove:function(s){s.off("layeradd",this._addAttribution,this)},_addAttribution:function(s){s.layer.getAttribution&&(this.addAttribution(s.layer.getAttribution()),s.layer.once("remove",function(){this.removeAttribution(s.layer.getAttribution())},this))},setPrefix:function(s){return this.options.prefix=s,this._update(),this},addAttribution:function(s){return s?(this._attributions[s]||(this._attributions[s]=0),this._attributions[s]++,this._update(),this):this},removeAttribution:function(s){return s?(this._attributions[s]&&(this._attributions[s]--,this._update()),this):this},_update:function(){if(this._map){var s=[];for(var l in this._attributions)this._attributions[l]&&s.push(l);var u=[];this.options.prefix&&u.push(this.options.prefix),s.length&&u.push(s.join(", ")),this._container.innerHTML=u.join(' <span aria-hidden="true">|</span> ')}}});mt.mergeOptions({attributionControl:!0}),mt.addInitHook(function(){this.options.attributionControl&&new lh().addTo(this)});var ZE=function(s){return new lh(s)};Ae.Layers=vf,Ae.Zoom=ah,Ae.Scale=xf,Ae.Attribution=lh,Jr.layers=BE,Jr.zoom=GE,Jr.scale=UE,Jr.attribution=ZE;var Ye=pt.extend({initialize:function(s){this._map=s},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Ye.addTo=function(s,l){return s.addHandler(l,this),this};var WE={Events:H},wf=K.touch?"touchstart mousedown":"mousedown",Zi=G.extend({options:{clickTolerance:3},initialize:function(s,l,u,g){E(this,g),this._element=s,this._dragStartTarget=l||s,this._preventOutline=u},enable:function(){this._enabled||(lt(this._dragStartTarget,wf,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Zi._dragging===this&&this.finishDrag(!0),St(this._dragStartTarget,wf,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(s){if(this._enabled&&(this._moved=!1,!Yl(this._element,"leaflet-zoom-anim"))){if(s.touches&&s.touches.length!==1){Zi._dragging===this&&this.finishDrag();return}if(!(Zi._dragging||s.shiftKey||s.which!==1&&s.button!==1&&!s.touches)&&(Zi._dragging=this,this._preventOutline&&th(this._element),Jl(),Xr(),!this._moving)){this.fire("down");var l=s.touches?s.touches[0]:s,u=ff(this._element);this._startPoint=new N(l.clientX,l.clientY),this._startPos=dn(this._element),this._parentScale=eh(u);var g=s.type==="mousedown";lt(document,g?"mousemove":"touchmove",this._onMove,this),lt(document,g?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(s){if(this._enabled){if(s.touches&&s.touches.length>1){this._moved=!0;return}var l=s.touches&&s.touches.length===1?s.touches[0]:s,u=new N(l.clientX,l.clientY)._subtract(this._startPoint);!u.x&&!u.y||Math.abs(u.x)+Math.abs(u.y)<this.options.clickTolerance||(u.x/=this._parentScale.x,u.y/=this._parentScale.y,Kt(s),this._moved||(this.fire("dragstart"),this._moved=!0,ct(document.body,"leaflet-dragging"),this._lastTarget=s.target||s.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ct(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(u),this._moving=!0,this._lastEvent=s,this._updatePosition())}},_updatePosition:function(){var s={originalEvent:this._lastEvent};this.fire("predrag",s),Nt(this._element,this._newPos),this.fire("drag",s)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(s){It(document.body,"leaflet-dragging"),this._lastTarget&&(It(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),St(document,"mousemove touchmove",this._onMove,this),St(document,"mouseup touchend touchcancel",this._onUp,this),Ql(),Yr();var l=this._moved&&this._moving;this._moving=!1,Zi._dragging=!1,l&&this.fire("dragend",{noInertia:s,distance:this._newPos.distanceTo(this._startPos)})}});function Ef(s,l,u){var g,_=[1,4,2,8],x,M,k,A,F,W,it,dt;for(x=0,W=s.length;x<W;x++)s[x]._code=pn(s[x],l);for(k=0;k<4;k++){for(it=_[k],g=[],x=0,W=s.length,M=W-1;x<W;M=x++)A=s[x],F=s[M],A._code&it?F._code&it||(dt=Uo(F,A,it,l,u),dt._code=pn(dt,l),g.push(dt)):(F._code&it&&(dt=Uo(F,A,it,l,u),dt._code=pn(dt,l),g.push(dt)),g.push(A));s=g}return s}function Lf(s,l){var u,g,_,x,M,k,A,F,W;if(!s||s.length===0)throw new Error("latlngs not passed");Ee(s)||(console.warn("latlngs are not flat! Only the first ring will be used"),s=s[0]);var it=st([0,0]),dt=tt(s),re=dt.getNorthWest().distanceTo(dt.getSouthWest())*dt.getNorthEast().distanceTo(dt.getNorthWest());re<1700&&(it=hh(s));var Ht=s.length,Le=[];for(u=0;u<Ht;u++){var ue=st(s[u]);Le.push(l.project(st([ue.lat-it.lat,ue.lng-it.lng])))}for(k=A=F=0,u=0,g=Ht-1;u<Ht;g=u++)_=Le[u],x=Le[g],M=_.y*x.x-x.y*_.x,A+=(_.x+x.x)*M,F+=(_.y+x.y)*M,k+=M*3;k===0?W=Le[0]:W=[A/k,F/k];var rr=l.unproject(Z(W));return st([rr.lat+it.lat,rr.lng+it.lng])}function hh(s){for(var l=0,u=0,g=0,_=0;_<s.length;_++){var x=st(s[_]);l+=x.lat,u+=x.lng,g++}return st([l/g,u/g])}var HE={__proto__:null,clipPolygon:Ef,polygonCenter:Lf,centroid:hh};function bf(s,l){if(!l||!s.length)return s.slice();var u=l*l;return s=YE(s,u),s=XE(s,u),s}function Tf(s,l,u){return Math.sqrt(Qr(s,l,u,!0))}function VE(s,l,u){return Qr(s,l,u)}function XE(s,l){var u=s.length,g=typeof Uint8Array!=void 0+""?Uint8Array:Array,_=new g(u);_[0]=_[u-1]=1,ch(s,_,l,0,u-1);var x,M=[];for(x=0;x<u;x++)_[x]&&M.push(s[x]);return M}function ch(s,l,u,g,_){var x=0,M,k,A;for(k=g+1;k<=_-1;k++)A=Qr(s[k],s[g],s[_],!0),A>x&&(M=k,x=A);x>u&&(l[M]=1,ch(s,l,u,g,M),ch(s,l,u,M,_))}function YE(s,l){for(var u=[s[0]],g=1,_=0,x=s.length;g<x;g++)KE(s[g],s[_])>l&&(u.push(s[g]),_=g);return _<x-1&&u.push(s[x-1]),u}var Cf;function Mf(s,l,u,g,_){var x=g?Cf:pn(s,u),M=pn(l,u),k,A,F;for(Cf=M;;){if(!(x|M))return[s,l];if(x&M)return!1;k=x||M,A=Uo(s,l,k,u,_),F=pn(A,u),k===x?(s=A,x=F):(l=A,M=F)}}function Uo(s,l,u,g,_){var x=l.x-s.x,M=l.y-s.y,k=g.min,A=g.max,F,W;return u&8?(F=s.x+x*(A.y-s.y)/M,W=A.y):u&4?(F=s.x+x*(k.y-s.y)/M,W=k.y):u&2?(F=A.x,W=s.y+M*(A.x-s.x)/x):u&1&&(F=k.x,W=s.y+M*(k.x-s.x)/x),new N(F,W,_)}function pn(s,l){var u=0;return s.x<l.min.x?u|=1:s.x>l.max.x&&(u|=2),s.y<l.min.y?u|=4:s.y>l.max.y&&(u|=8),u}function KE(s,l){var u=l.x-s.x,g=l.y-s.y;return u*u+g*g}function Qr(s,l,u,g){var _=l.x,x=l.y,M=u.x-_,k=u.y-x,A=M*M+k*k,F;return A>0&&(F=((s.x-_)*M+(s.y-x)*k)/A,F>1?(_=u.x,x=u.y):F>0&&(_+=M*F,x+=k*F)),M=s.x-_,k=s.y-x,g?M*M+k*k:new N(_,x)}function Ee(s){return!b(s[0])||typeof s[0][0]!="object"&&typeof s[0][0]<"u"}function Sf(s){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ee(s)}function Pf(s,l){var u,g,_,x,M,k,A,F;if(!s||s.length===0)throw new Error("latlngs not passed");Ee(s)||(console.warn("latlngs are not flat! Only the first ring will be used"),s=s[0]);var W=st([0,0]),it=tt(s),dt=it.getNorthWest().distanceTo(it.getSouthWest())*it.getNorthEast().distanceTo(it.getNorthWest());dt<1700&&(W=hh(s));var re=s.length,Ht=[];for(u=0;u<re;u++){var Le=st(s[u]);Ht.push(l.project(st([Le.lat-W.lat,Le.lng-W.lng])))}for(u=0,g=0;u<re-1;u++)g+=Ht[u].distanceTo(Ht[u+1])/2;if(g===0)F=Ht[0];else for(u=0,x=0;u<re-1;u++)if(M=Ht[u],k=Ht[u+1],_=M.distanceTo(k),x+=_,x>g){A=(x-g)/_,F=[k.x-A*(k.x-M.x),k.y-A*(k.y-M.y)];break}var ue=l.unproject(Z(F));return st([ue.lat+W.lat,ue.lng+W.lng])}var qE={__proto__:null,simplify:bf,pointToSegmentDistance:Tf,closestPointOnSegment:VE,clipSegment:Mf,_getEdgeIntersection:Uo,_getBitCode:pn,_sqClosestPointOnSegment:Qr,isFlat:Ee,_flat:Sf,polylineCenter:Pf},uh={project:function(s){return new N(s.lng,s.lat)},unproject:function(s){return new J(s.y,s.x)},bounds:new at([-180,-90],[180,90])},dh={R:6378137,R_MINOR:6356752314245179e-9,bounds:new at([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(s){var l=Math.PI/180,u=this.R,g=s.lat*l,_=this.R_MINOR/u,x=Math.sqrt(1-_*_),M=x*Math.sin(g),k=Math.tan(Math.PI/4-g/2)/Math.pow((1-M)/(1+M),x/2);return g=-u*Math.log(Math.max(k,1e-10)),new N(s.lng*l*u,g)},unproject:function(s){for(var l=180/Math.PI,u=this.R,g=this.R_MINOR/u,_=Math.sqrt(1-g*g),x=Math.exp(-s.y/u),M=Math.PI/2-2*Math.atan(x),k=0,A=.1,F;k<15&&Math.abs(A)>1e-7;k++)F=_*Math.sin(M),F=Math.pow((1-F)/(1+F),_/2),A=Math.PI/2-2*Math.atan(x*F)-M,M+=A;return new J(M*l,s.x*l/u)}},JE={__proto__:null,LonLat:uh,Mercator:dh,SphericalMercator:Ze},QE=n({},Mt,{code:"EPSG:3395",projection:dh,transformation:function(){var s=.5/(Math.PI*dh.R);return xe(s,.5,-s,.5)}()}),kf=n({},Mt,{code:"EPSG:4326",projection:uh,transformation:xe(1/180,1,-1/180,.5)}),$E=n({},Ft,{projection:uh,transformation:xe(1,0,-1,0),scale:function(s){return Math.pow(2,s)},zoom:function(s){return Math.log(s)/Math.LN2},distance:function(s,l){var u=l.lng-s.lng,g=l.lat-s.lat;return Math.sqrt(u*u+g*g)},infinite:!0});Ft.Earth=Mt,Ft.EPSG3395=QE,Ft.EPSG3857=Oi,Ft.EPSG900913=We,Ft.EPSG4326=kf,Ft.Simple=$E;var Ie=G.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(s){return s.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(s){return s&&s.removeLayer(this),this},getPane:function(s){return this._map.getPane(s?this.options[s]||s:this.options.pane)},addInteractiveTarget:function(s){return this._map._targets[c(s)]=this,this},removeInteractiveTarget:function(s){return delete this._map._targets[c(s)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(s){var l=s.target;if(l.hasLayer(this)){if(this._map=l,this._zoomAnimated=l._zoomAnimated,this.getEvents){var u=this.getEvents();l.on(u,this),this.once("remove",function(){l.off(u,this)},this)}this.onAdd(l),this.fire("add"),l.fire("layeradd",{layer:this})}}});mt.include({addLayer:function(s){if(!s._layerAdd)throw new Error("The provided object is not a Layer.");var l=c(s);return this._layers[l]?this:(this._layers[l]=s,s._mapToAdd=this,s.beforeAdd&&s.beforeAdd(this),this.whenReady(s._layerAdd,s),this)},removeLayer:function(s){var l=c(s);return this._layers[l]?(this._loaded&&s.onRemove(this),delete this._layers[l],this._loaded&&(this.fire("layerremove",{layer:s}),s.fire("remove")),s._map=s._mapToAdd=null,this):this},hasLayer:function(s){return c(s)in this._layers},eachLayer:function(s,l){for(var u in this._layers)s.call(l,this._layers[u]);return this},_addLayers:function(s){s=s?b(s)?s:[s]:[];for(var l=0,u=s.length;l<u;l++)this.addLayer(s[l])},_addZoomLimit:function(s){(!isNaN(s.options.maxZoom)||!isNaN(s.options.minZoom))&&(this._zoomBoundLayers[c(s)]=s,this._updateZoomLevels())},_removeZoomLimit:function(s){var l=c(s);this._zoomBoundLayers[l]&&(delete this._zoomBoundLayers[l],this._updateZoomLevels())},_updateZoomLevels:function(){var s=1/0,l=-1/0,u=this._getZoomSpan();for(var g in this._zoomBoundLayers){var _=this._zoomBoundLayers[g].options;s=_.minZoom===void 0?s:Math.min(s,_.minZoom),l=_.maxZoom===void 0?l:Math.max(l,_.maxZoom)}this._layersMaxZoom=l===-1/0?void 0:l,this._layersMinZoom=s===1/0?void 0:s,u!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var $n=Ie.extend({initialize:function(s,l){E(this,l),this._layers={};var u,g;if(s)for(u=0,g=s.length;u<g;u++)this.addLayer(s[u])},addLayer:function(s){var l=this.getLayerId(s);return this._layers[l]=s,this._map&&this._map.addLayer(s),this},removeLayer:function(s){var l=s in this._layers?s:this.getLayerId(s);return this._map&&this._layers[l]&&this._map.removeLayer(this._layers[l]),delete this._layers[l],this},hasLayer:function(s){var l=typeof s=="number"?s:this.getLayerId(s);return l in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(s){var l=Array.prototype.slice.call(arguments,1),u,g;for(u in this._layers)g=this._layers[u],g[s]&&g[s].apply(g,l);return this},onAdd:function(s){this.eachLayer(s.addLayer,s)},onRemove:function(s){this.eachLayer(s.removeLayer,s)},eachLayer:function(s,l){for(var u in this._layers)s.call(l,this._layers[u]);return this},getLayer:function(s){return this._layers[s]},getLayers:function(){var s=[];return this.eachLayer(s.push,s),s},setZIndex:function(s){return this.invoke("setZIndex",s)},getLayerId:function(s){return c(s)}}),tL=function(s,l){return new $n(s,l)},pi=$n.extend({addLayer:function(s){return this.hasLayer(s)?this:(s.addEventParent(this),$n.prototype.addLayer.call(this,s),this.fire("layeradd",{layer:s}))},removeLayer:function(s){return this.hasLayer(s)?(s in this._layers&&(s=this._layers[s]),s.removeEventParent(this),$n.prototype.removeLayer.call(this,s),this.fire("layerremove",{layer:s})):this},setStyle:function(s){return this.invoke("setStyle",s)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var s=new Lt;for(var l in this._layers){var u=this._layers[l];s.extend(u.getBounds?u.getBounds():u.getLatLng())}return s}}),eL=function(s,l){return new pi(s,l)},tr=pt.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(s){E(this,s)},createIcon:function(s){return this._createIcon("icon",s)},createShadow:function(s){return this._createIcon("shadow",s)},_createIcon:function(s,l){var u=this._getIconUrl(s);if(!u){if(s==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var g=this._createImg(u,l&&l.tagName==="IMG"?l:null);return this._setIconStyles(g,s),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),g},_setIconStyles:function(s,l){var u=this.options,g=u[l+"Size"];typeof g=="number"&&(g=[g,g]);var _=Z(g),x=Z(l==="shadow"&&u.shadowAnchor||u.iconAnchor||_&&_.divideBy(2,!0));s.className="leaflet-marker-"+l+" "+(u.className||""),x&&(s.style.marginLeft=-x.x+"px",s.style.marginTop=-x.y+"px"),_&&(s.style.width=_.x+"px",s.style.height=_.y+"px")},_createImg:function(s,l){return l=l||document.createElement("img"),l.src=s,l},_getIconUrl:function(s){return K.retina&&this.options[s+"RetinaUrl"]||this.options[s+"Url"]}});function iL(s){return new tr(s)}var $r=tr.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(s){return typeof $r.imagePath!="string"&&($r.imagePath=this._detectIconPath()),(this.options.imagePath||$r.imagePath)+tr.prototype._getIconUrl.call(this,s)},_stripUrl:function(s){var l=function(u,g,_){var x=g.exec(u);return x&&x[_]};return s=l(s,/^url\((['"])?(.+)\1\)$/,2),s&&l(s,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var s=yt("div","leaflet-default-icon-path",document.body),l=Vr(s,"background-image")||Vr(s,"backgroundImage");if(document.body.removeChild(s),l=this._stripUrl(l),l)return l;var u=document.querySelector('link[href$="leaflet.css"]');return u?u.href.substring(0,u.href.length-11-1):""}}),Rf=Ye.extend({initialize:function(s){this._marker=s},addHooks:function(){var s=this._marker._icon;this._draggable||(this._draggable=new Zi(s,s,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ct(s,"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&&It(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(s){var l=this._marker,u=l._map,g=this._marker.options.autoPanSpeed,_=this._marker.options.autoPanPadding,x=dn(l._icon),M=u.getPixelBounds(),k=u.getPixelOrigin(),A=z(M.min._subtract(k).add(_),M.max._subtract(k).subtract(_));if(!A.contains(x)){var F=Z((Math.max(A.max.x,x.x)-A.max.x)/(M.max.x-A.max.x)-(Math.min(A.min.x,x.x)-A.min.x)/(M.min.x-A.min.x),(Math.max(A.max.y,x.y)-A.max.y)/(M.max.y-A.max.y)-(Math.min(A.min.y,x.y)-A.min.y)/(M.min.y-A.min.y)).multiplyBy(g);u.panBy(F,{animate:!1}),this._draggable._newPos._add(F),this._draggable._startPos._add(F),Nt(l._icon,this._draggable._newPos),this._onDrag(s),this._panRequest=q(this._adjustPan.bind(this,s))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(s){this._marker.options.autoPan&&(Y(this._panRequest),this._panRequest=q(this._adjustPan.bind(this,s)))},_onDrag:function(s){var l=this._marker,u=l._shadow,g=dn(l._icon),_=l._map.layerPointToLatLng(g);u&&Nt(u,g),l._latlng=_,s.latlng=_,s.oldLatLng=this._oldLatLng,l.fire("move",s).fire("drag",s)},_onDragEnd:function(s){Y(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",s)}}),jo=Ie.extend({options:{icon:new $r,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(s,l){E(this,l),this._latlng=st(s)},onAdd:function(s){this._zoomAnimated=this._zoomAnimated&&s.options.markerZoomAnimation,this._zoomAnimated&&s.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(s){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&s.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(s){var l=this._latlng;return this._latlng=st(s),this.update(),this.fire("move",{oldLatLng:l,latlng:this._latlng})},setZIndexOffset:function(s){return this.options.zIndexOffset=s,this.update()},getIcon:function(){return this.options.icon},setIcon:function(s){return this.options.icon=s,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 s=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(s)}return this},_initIcon:function(){var s=this.options,l="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),u=s.icon.createIcon(this._icon),g=!1;u!==this._icon&&(this._icon&&this._removeIcon(),g=!0,s.title&&(u.title=s.title),u.tagName==="IMG"&&(u.alt=s.alt||"")),ct(u,l),s.keyboard&&(u.tabIndex="0",u.setAttribute("role","button")),this._icon=u,s.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&<(u,"focus",this._panOnFocus,this);var _=s.icon.createShadow(this._shadow),x=!1;_!==this._shadow&&(this._removeShadow(),x=!0),_&&(ct(_,l),_.alt=""),this._shadow=_,s.opacity<1&&this._updateOpacity(),g&&this.getPane().appendChild(this._icon),this._initInteraction(),_&&x&&this.getPane(s.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&St(this._icon,"focus",this._panOnFocus,this),kt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&kt(this._shadow),this._shadow=null},_setPos:function(s){this._icon&&Nt(this._icon,s),this._shadow&&Nt(this._shadow,s),this._zIndex=s.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(s){this._icon&&(this._icon.style.zIndex=this._zIndex+s)},_animateZoom:function(s){var l=this._map._latLngToNewLayerPoint(this._latlng,s.zoom,s.center).round();this._setPos(l)},_initInteraction:function(){if(this.options.interactive&&(ct(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Rf)){var s=this.options.draggable;this.dragging&&(s=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Rf(this),s&&this.dragging.enable()}},setOpacity:function(s){return this.options.opacity=s,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var s=this.options.opacity;this._icon&&we(this._icon,s),this._shadow&&we(this._shadow,s)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var s=this._map;if(s){var l=this.options.icon.options,u=l.iconSize?Z(l.iconSize):Z(0,0),g=l.iconAnchor?Z(l.iconAnchor):Z(0,0);s.panInside(this._latlng,{paddingTopLeft:g,paddingBottomRight:u.subtract(g)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function nL(s,l){return new jo(s,l)}var Wi=Ie.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(s){this._renderer=s.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(s){return E(this,s),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&s&&Object.prototype.hasOwnProperty.call(s,"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)}}),Zo=Wi.extend({options:{fill:!0,radius:10},initialize:function(s,l){E(this,l),this._latlng=st(s),this._radius=this.options.radius},setLatLng:function(s){var l=this._latlng;return this._latlng=st(s),this.redraw(),this.fire("move",{oldLatLng:l,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(s){return this.options.radius=this._radius=s,this.redraw()},getRadius:function(){return this._radius},setStyle:function(s){var l=s&&s.radius||this._radius;return Wi.prototype.setStyle.call(this,s),this.setRadius(l),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var s=this._radius,l=this._radiusY||s,u=this._clickTolerance(),g=[s+u,l+u];this._pxBounds=new at(this._point.subtract(g),this._point.add(g))},_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(s){return s.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function rL(s,l){return new Zo(s,l)}var fh=Zo.extend({initialize:function(s,l,u){if(typeof l=="number"&&(l=n({},u,{radius:l})),E(this,l),this._latlng=st(s),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(s){return this._mRadius=s,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var s=[this._radius,this._radiusY||this._radius];return new Lt(this._map.layerPointToLatLng(this._point.subtract(s)),this._map.layerPointToLatLng(this._point.add(s)))},setStyle:Wi.prototype.setStyle,_project:function(){var s=this._latlng.lng,l=this._latlng.lat,u=this._map,g=u.options.crs;if(g.distance===Mt.distance){var _=Math.PI/180,x=this._mRadius/Mt.R/_,M=u.project([l+x,s]),k=u.project([l-x,s]),A=M.add(k).divideBy(2),F=u.unproject(A).lat,W=Math.acos((Math.cos(x*_)-Math.sin(l*_)*Math.sin(F*_))/(Math.cos(l*_)*Math.cos(F*_)))/_;(isNaN(W)||W===0)&&(W=x/Math.cos(Math.PI/180*l)),this._point=A.subtract(u.getPixelOrigin()),this._radius=isNaN(W)?0:A.x-u.project([F,s-W]).x,this._radiusY=A.y-M.y}else{var it=g.unproject(g.project(this._latlng).subtract([this._mRadius,0]));this._point=u.latLngToLayerPoint(this._latlng),this._radius=this._point.x-u.latLngToLayerPoint(it).x}this._updateBounds()}});function sL(s,l,u){return new fh(s,l,u)}var _i=Wi.extend({options:{smoothFactor:1,noClip:!1},initialize:function(s,l){E(this,l),this._setLatLngs(s)},getLatLngs:function(){return this._latlngs},setLatLngs:function(s){return this._setLatLngs(s),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(s){for(var l=1/0,u=null,g=Qr,_,x,M=0,k=this._parts.length;M<k;M++)for(var A=this._parts[M],F=1,W=A.length;F<W;F++){_=A[F-1],x=A[F];var it=g(s,_,x,!0);it<l&&(l=it,u=g(s,_,x))}return u&&(u.distance=Math.sqrt(l)),u},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Pf(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(s,l){return l=l||this._defaultShape(),s=st(s),l.push(s),this._bounds.extend(s),this.redraw()},_setLatLngs:function(s){this._bounds=new Lt,this._latlngs=this._convertLatLngs(s)},_defaultShape:function(){return Ee(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(s){for(var l=[],u=Ee(s),g=0,_=s.length;g<_;g++)u?(l[g]=st(s[g]),this._bounds.extend(l[g])):l[g]=this._convertLatLngs(s[g]);return l},_project:function(){var s=new at;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,s),this._bounds.isValid()&&s.isValid()&&(this._rawPxBounds=s,this._updateBounds())},_updateBounds:function(){var s=this._clickTolerance(),l=new N(s,s);this._rawPxBounds&&(this._pxBounds=new at([this._rawPxBounds.min.subtract(l),this._rawPxBounds.max.add(l)]))},_projectLatlngs:function(s,l,u){var g=s[0]instanceof J,_=s.length,x,M;if(g){for(M=[],x=0;x<_;x++)M[x]=this._map.latLngToLayerPoint(s[x]),u.extend(M[x]);l.push(M)}else for(x=0;x<_;x++)this._projectLatlngs(s[x],l,u)},_clipPoints:function(){var s=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(s))){if(this.options.noClip){this._parts=this._rings;return}var l=this._parts,u,g,_,x,M,k,A;for(u=0,_=0,x=this._rings.length;u<x;u++)for(A=this._rings[u],g=0,M=A.length;g<M-1;g++)k=Mf(A[g],A[g+1],s,g,!0),k&&(l[_]=l[_]||[],l[_].push(k[0]),(k[1]!==A[g+1]||g===M-2)&&(l[_].push(k[1]),_++))}},_simplifyPoints:function(){for(var s=this._parts,l=this.options.smoothFactor,u=0,g=s.length;u<g;u++)s[u]=bf(s[u],l)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(s,l){var u,g,_,x,M,k,A=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(s))return!1;for(u=0,x=this._parts.length;u<x;u++)for(k=this._parts[u],g=0,M=k.length,_=M-1;g<M;_=g++)if(!(!l&&g===0)&&Tf(s,k[_],k[g])<=A)return!0;return!1}});function oL(s,l){return new _i(s,l)}_i._flat=Sf;var er=_i.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 Lf(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(s){var l=_i.prototype._convertLatLngs.call(this,s),u=l.length;return u>=2&&l[0]instanceof J&&l[0].equals(l[u-1])&&l.pop(),l},_setLatLngs:function(s){_i.prototype._setLatLngs.call(this,s),Ee(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ee(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var s=this._renderer._bounds,l=this.options.weight,u=new N(l,l);if(s=new at(s.min.subtract(u),s.max.add(u)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(s))){if(this.options.noClip){this._parts=this._rings;return}for(var g=0,_=this._rings.length,x;g<_;g++)x=Ef(this._rings[g],s,!0),x.length&&this._parts.push(x)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(s){var l=!1,u,g,_,x,M,k,A,F;if(!this._pxBounds||!this._pxBounds.contains(s))return!1;for(x=0,A=this._parts.length;x<A;x++)for(u=this._parts[x],M=0,F=u.length,k=F-1;M<F;k=M++)g=u[M],_=u[k],g.y>s.y!=_.y>s.y&&s.x<(_.x-g.x)*(s.y-g.y)/(_.y-g.y)+g.x&&(l=!l);return l||_i.prototype._containsPoint.call(this,s,!0)}});function aL(s,l){return new er(s,l)}var mi=pi.extend({initialize:function(s,l){E(this,l),this._layers={},s&&this.addData(s)},addData:function(s){var l=b(s)?s:s.features,u,g,_;if(l){for(u=0,g=l.length;u<g;u++)_=l[u],(_.geometries||_.geometry||_.features||_.coordinates)&&this.addData(_);return this}var x=this.options;if(x.filter&&!x.filter(s))return this;var M=Wo(s,x);return M?(M.feature=Xo(s),M.defaultOptions=M.options,this.resetStyle(M),x.onEachFeature&&x.onEachFeature(s,M),this.addLayer(M)):this},resetStyle:function(s){return s===void 0?this.eachLayer(this.resetStyle,this):(s.options=n({},s.defaultOptions),this._setLayerStyle(s,this.options.style),this)},setStyle:function(s){return this.eachLayer(function(l){this._setLayerStyle(l,s)},this)},_setLayerStyle:function(s,l){s.setStyle&&(typeof l=="function"&&(l=l(s.feature)),s.setStyle(l))}});function Wo(s,l){var u=s.type==="Feature"?s.geometry:s,g=u?u.coordinates:null,_=[],x=l&&l.pointToLayer,M=l&&l.coordsToLatLng||gh,k,A,F,W;if(!g&&!u)return null;switch(u.type){case"Point":return k=M(g),Af(x,s,k,l);case"MultiPoint":for(F=0,W=g.length;F<W;F++)k=M(g[F]),_.push(Af(x,s,k,l));return new pi(_);case"LineString":case"MultiLineString":return A=Ho(g,u.type==="LineString"?0:1,M),new _i(A,l);case"Polygon":case"MultiPolygon":return A=Ho(g,u.type==="Polygon"?1:2,M),new er(A,l);case"GeometryCollection":for(F=0,W=u.geometries.length;F<W;F++){var it=Wo({geometry:u.geometries[F],type:"Feature",properties:s.properties},l);it&&_.push(it)}return new pi(_);case"FeatureCollection":for(F=0,W=u.features.length;F<W;F++){var dt=Wo(u.features[F],l);dt&&_.push(dt)}return new pi(_);default:throw new Error("Invalid GeoJSON object.")}}function Af(s,l,u,g){return s?s(l,u):new jo(u,g&&g.markersInheritOptions&&g)}function gh(s){return new J(s[1],s[0],s[2])}function Ho(s,l,u){for(var g=[],_=0,x=s.length,M;_<x;_++)M=l?Ho(s[_],l-1,u):(u||gh)(s[_]),g.push(M);return g}function ph(s,l){return s=st(s),s.alt!==void 0?[m(s.lng,l),m(s.lat,l),m(s.alt,l)]:[m(s.lng,l),m(s.lat,l)]}function Vo(s,l,u,g){for(var _=[],x=0,M=s.length;x<M;x++)_.push(l?Vo(s[x],Ee(s[x])?0:l-1,u,g):ph(s[x],g));return!l&&u&&_.length>0&&_.push(_[0].slice()),_}function ir(s,l){return s.feature?n({},s.feature,{geometry:l}):Xo(l)}function Xo(s){return s.type==="Feature"||s.type==="FeatureCollection"?s:{type:"Feature",properties:{},geometry:s}}var _h={toGeoJSON:function(s){return ir(this,{type:"Point",coordinates:ph(this.getLatLng(),s)})}};jo.include(_h),fh.include(_h),Zo.include(_h),_i.include({toGeoJSON:function(s){var l=!Ee(this._latlngs),u=Vo(this._latlngs,l?1:0,!1,s);return ir(this,{type:(l?"Multi":"")+"LineString",coordinates:u})}}),er.include({toGeoJSON:function(s){var l=!Ee(this._latlngs),u=l&&!Ee(this._latlngs[0]),g=Vo(this._latlngs,u?2:l?1:0,!0,s);return l||(g=[g]),ir(this,{type:(u?"Multi":"")+"Polygon",coordinates:g})}}),$n.include({toMultiPoint:function(s){var l=[];return this.eachLayer(function(u){l.push(u.toGeoJSON(s).geometry.coordinates)}),ir(this,{type:"MultiPoint",coordinates:l})},toGeoJSON:function(s){var l=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(l==="MultiPoint")return this.toMultiPoint(s);var u=l==="GeometryCollection",g=[];return this.eachLayer(function(_){if(_.toGeoJSON){var x=_.toGeoJSON(s);if(u)g.push(x.geometry);else{var M=Xo(x);M.type==="FeatureCollection"?g.push.apply(g,M.features):g.push(M)}}}),u?ir(this,{geometries:g,type:"GeometryCollection"}):{type:"FeatureCollection",features:g}}});function If(s,l){return new mi(s,l)}var lL=If,Yo=Ie.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(s,l,u){this._url=s,this._bounds=tt(l),E(this,u)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ct(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){kt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(s){return this.options.opacity=s,this._image&&this._updateOpacity(),this},setStyle:function(s){return s.opacity&&this.setOpacity(s.opacity),this},bringToFront:function(){return this._map&&Jn(this._image),this},bringToBack:function(){return this._map&&Qn(this._image),this},setUrl:function(s){return this._url=s,this._image&&(this._image.src=s),this},setBounds:function(s){return this._bounds=tt(s),this._map&&this._reset(),this},getEvents:function(){var s={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(s.zoomanim=this._animateZoom),s},setZIndex:function(s){return this.options.zIndex=s,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var s=this._url.tagName==="IMG",l=this._image=s?this._url:yt("img");if(ct(l,"leaflet-image-layer"),this._zoomAnimated&&ct(l,"leaflet-zoom-animated"),this.options.className&&ct(l,this.options.className),l.onselectstart=p,l.onmousemove=p,l.onload=a(this.fire,this,"load"),l.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(l.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),s){this._url=l.src;return}l.src=this._url,l.alt=this.options.alt},_animateZoom:function(s){var l=this._map.getZoomScale(s.zoom),u=this._map._latLngBoundsToNewLayerBounds(this._bounds,s.zoom,s.center).min;un(this._image,u,l)},_reset:function(){var s=this._image,l=new at(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),u=l.getSize();Nt(s,l.min),s.style.width=u.x+"px",s.style.height=u.y+"px"},_updateOpacity:function(){we(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var s=this.options.errorOverlayUrl;s&&this._url!==s&&(this._url=s,this._image.src=s)},getCenter:function(){return this._bounds.getCenter()}}),hL=function(s,l,u){return new Yo(s,l,u)},Df=Yo.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var s=this._url.tagName==="VIDEO",l=this._image=s?this._url:yt("video");if(ct(l,"leaflet-image-layer"),this._zoomAnimated&&ct(l,"leaflet-zoom-animated"),this.options.className&&ct(l,this.options.className),l.onselectstart=p,l.onmousemove=p,l.onloadeddata=a(this.fire,this,"load"),s){for(var u=l.getElementsByTagName("source"),g=[],_=0;_<u.length;_++)g.push(u[_].src);this._url=u.length>0?g:[l.src];return}b(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(l.style,"objectFit")&&(l.style.objectFit="fill"),l.autoplay=!!this.options.autoplay,l.loop=!!this.options.loop,l.muted=!!this.options.muted,l.playsInline=!!this.options.playsInline;for(var x=0;x<this._url.length;x++){var M=yt("source");M.src=this._url[x],l.appendChild(M)}}});function cL(s,l,u){return new Df(s,l,u)}var Of=Yo.extend({_initImage:function(){var s=this._image=this._url;ct(s,"leaflet-image-layer"),this._zoomAnimated&&ct(s,"leaflet-zoom-animated"),this.options.className&&ct(s,this.options.className),s.onselectstart=p,s.onmousemove=p}});function uL(s,l,u){return new Of(s,l,u)}var Ke=Ie.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(s,l){s&&(s instanceof J||b(s))?(this._latlng=st(s),E(this,l)):(E(this,s),this._source=l),this.options.content&&(this._content=this.options.content)},openOn:function(s){return s=arguments.length?s:this._source._map,s.hasLayer(this)||s.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(s){return this._map?this.close():(arguments.length?this._source=s:s=this._source,this._prepareOpen(),this.openOn(s._map)),this},onAdd:function(s){this._zoomAnimated=s._zoomAnimated,this._container||this._initLayout(),s._fadeAnimated&&we(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),s._fadeAnimated&&we(this._container,1),this.bringToFront(),this.options.interactive&&(ct(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(s){s._fadeAnimated?(we(this._container,0),this._removeTimeout=setTimeout(a(kt,void 0,this._container),200)):kt(this._container),this.options.interactive&&(It(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(s){return this._latlng=st(s),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(s){return this._content=s,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 s={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(s.zoomanim=this._animateZoom),s},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Jn(this._container),this},bringToBack:function(){return this._map&&Qn(this._container),this},_prepareOpen:function(s){var l=this._source;if(!l._map)return!1;if(l instanceof pi){l=null;var u=this._source._layers;for(var g in u)if(u[g]._map){l=u[g];break}if(!l)return!1;this._source=l}if(!s)if(l.getCenter)s=l.getCenter();else if(l.getLatLng)s=l.getLatLng();else if(l.getBounds)s=l.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(s),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var s=this._contentNode,l=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof l=="string")s.innerHTML=l;else{for(;s.hasChildNodes();)s.removeChild(s.firstChild);s.appendChild(l)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var s=this._map.latLngToLayerPoint(this._latlng),l=Z(this.options.offset),u=this._getAnchor();this._zoomAnimated?Nt(this._container,s.add(u)):l=l.add(s).add(u);var g=this._containerBottom=-l.y,_=this._containerLeft=-Math.round(this._containerWidth/2)+l.x;this._container.style.bottom=g+"px",this._container.style.left=_+"px"}},_getAnchor:function(){return[0,0]}});mt.include({_initOverlay:function(s,l,u,g){var _=l;return _ instanceof s||(_=new s(g).setContent(l)),u&&_.setLatLng(u),_}}),Ie.include({_initOverlay:function(s,l,u,g){var _=u;return _ instanceof s?(E(_,g),_._source=this):(_=l&&!g?l:new s(g,this),_.setContent(u)),_}});var Ko=Ke.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(s){return s=arguments.length?s:this._source._map,!s.hasLayer(this)&&s._popup&&s._popup.options.autoClose&&s.removeLayer(s._popup),s._popup=this,Ke.prototype.openOn.call(this,s)},onAdd:function(s){Ke.prototype.onAdd.call(this,s),s.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Wi||this._source.on("preclick",fn))},onRemove:function(s){Ke.prototype.onRemove.call(this,s),s.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Wi||this._source.off("preclick",fn))},getEvents:function(){var s=Ke.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(s.preclick=this.close),this.options.keepInView&&(s.moveend=this._adjustPan),s},_initLayout:function(){var s="leaflet-popup",l=this._container=yt("div",s+" "+(this.options.className||"")+" leaflet-zoom-animated"),u=this._wrapper=yt("div",s+"-content-wrapper",l);if(this._contentNode=yt("div",s+"-content",u),qr(l),sh(this._contentNode),lt(l,"contextmenu",fn),this._tipContainer=yt("div",s+"-tip-container",l),this._tip=yt("div",s+"-tip",this._tipContainer),this.options.closeButton){var g=this._closeButton=yt("a",s+"-close-button",l);g.setAttribute("role","button"),g.setAttribute("aria-label","Close popup"),g.href="#close",g.innerHTML='<span aria-hidden="true">×</span>',lt(g,"click",function(_){Kt(_),this.close()},this)}},_updateLayout:function(){var s=this._contentNode,l=s.style;l.width="",l.whiteSpace="nowrap";var u=s.offsetWidth;u=Math.min(u,this.options.maxWidth),u=Math.max(u,this.options.minWidth),l.width=u+1+"px",l.whiteSpace="",l.height="";var g=s.offsetHeight,_=this.options.maxHeight,x="leaflet-popup-scrolled";_&&g>_?(l.height=_+"px",ct(s,x)):It(s,x),this._containerWidth=this._container.offsetWidth},_animateZoom:function(s){var l=this._map._latLngToNewLayerPoint(this._latlng,s.zoom,s.center),u=this._getAnchor();Nt(this._container,l.add(u))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var s=this._map,l=parseInt(Vr(this._container,"marginBottom"),10)||0,u=this._container.offsetHeight+l,g=this._containerWidth,_=new N(this._containerLeft,-u-this._containerBottom);_._add(dn(this._container));var x=s.layerPointToContainerPoint(_),M=Z(this.options.autoPanPadding),k=Z(this.options.autoPanPaddingTopLeft||M),A=Z(this.options.autoPanPaddingBottomRight||M),F=s.getSize(),W=0,it=0;x.x+g+A.x>F.x&&(W=x.x+g-F.x+A.x),x.x-W-k.x<0&&(W=x.x-k.x),x.y+u+A.y>F.y&&(it=x.y+u-F.y+A.y),x.y-it-k.y<0&&(it=x.y-k.y),(W||it)&&(this.options.keepInView&&(this._autopanning=!0),s.fire("autopanstart").panBy([W,it]))}},_getAnchor:function(){return Z(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),dL=function(s,l){return new Ko(s,l)};mt.mergeOptions({closePopupOnClick:!0}),mt.include({openPopup:function(s,l,u){return this._initOverlay(Ko,s,l,u).openOn(this),this},closePopup:function(s){return s=arguments.length?s:this._popup,s&&s.close(),this}}),Ie.include({bindPopup:function(s,l){return this._popup=this._initOverlay(Ko,this._popup,s,l),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(s){return this._popup&&(this instanceof pi||(this._popup._source=this),this._popup._prepareOpen(s||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(s){return this._popup&&this._popup.setContent(s),this},getPopup:function(){return this._popup},_openPopup:function(s){if(!(!this._popup||!this._map)){gn(s);var l=s.layer||s.target;if(this._popup._source===l&&!(l instanceof Wi)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(s.latlng);return}this._popup._source=l,this.openPopup(s.latlng)}},_movePopup:function(s){this._popup.setLatLng(s.latlng)},_onKeyPress:function(s){s.originalEvent.keyCode===13&&this._openPopup(s)}});var qo=Ke.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(s){Ke.prototype.onAdd.call(this,s),this.setOpacity(this.options.opacity),s.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(s){Ke.prototype.onRemove.call(this,s),s.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var s=Ke.prototype.getEvents.call(this);return this.options.permanent||(s.preclick=this.close),s},_initLayout:function(){var s="leaflet-tooltip",l=s+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=yt("div",l),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(s){var l,u,g=this._map,_=this._container,x=g.latLngToContainerPoint(g.getCenter()),M=g.layerPointToContainerPoint(s),k=this.options.direction,A=_.offsetWidth,F=_.offsetHeight,W=Z(this.options.offset),it=this._getAnchor();k==="top"?(l=A/2,u=F):k==="bottom"?(l=A/2,u=0):k==="center"?(l=A/2,u=F/2):k==="right"?(l=0,u=F/2):k==="left"?(l=A,u=F/2):M.x<x.x?(k="right",l=0,u=F/2):(k="left",l=A+(W.x+it.x)*2,u=F/2),s=s.subtract(Z(l,u,!0)).add(W).add(it),It(_,"leaflet-tooltip-right"),It(_,"leaflet-tooltip-left"),It(_,"leaflet-tooltip-top"),It(_,"leaflet-tooltip-bottom"),ct(_,"leaflet-tooltip-"+k),Nt(_,s)},_updatePosition:function(){var s=this._map.latLngToLayerPoint(this._latlng);this._setPosition(s)},setOpacity:function(s){this.options.opacity=s,this._container&&we(this._container,s)},_animateZoom:function(s){var l=this._map._latLngToNewLayerPoint(this._latlng,s.zoom,s.center);this._setPosition(l)},_getAnchor:function(){return Z(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),fL=function(s,l){return new qo(s,l)};mt.include({openTooltip:function(s,l,u){return this._initOverlay(qo,s,l,u).openOn(this),this},closeTooltip:function(s){return s.close(),this}}),Ie.include({bindTooltip:function(s,l){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(qo,this._tooltip,s,l),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(s){if(!(!s&&this._tooltipHandlersAdded)){var l=s?"off":"on",u={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?u.add=this._openTooltip:(u.mouseover=this._openTooltip,u.mouseout=this.closeTooltip,u.click=this._openTooltip,this._map?this._addFocusListeners():u.add=this._addFocusListeners),this._tooltip.options.sticky&&(u.mousemove=this._moveTooltip),this[l](u),this._tooltipHandlersAdded=!s}},openTooltip:function(s){return this._tooltip&&(this instanceof pi||(this._tooltip._source=this),this._tooltip._prepareOpen(s)&&(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(s){return this._tooltip&&this._tooltip.setContent(s),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(s){var l=typeof s.getElement=="function"&&s.getElement();l&&(lt(l,"focus",function(){this._tooltip._source=s,this.openTooltip()},this),lt(l,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(s){var l=typeof s.getElement=="function"&&s.getElement();l&&l.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(s){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var l=this;this._map.once("moveend",function(){l._openOnceFlag=!1,l._openTooltip(s)});return}this._tooltip._source=s.layer||s.target,this.openTooltip(this._tooltip.options.sticky?s.latlng:void 0)}},_moveTooltip:function(s){var l=s.latlng,u,g;this._tooltip.options.sticky&&s.originalEvent&&(u=this._map.mouseEventToContainerPoint(s.originalEvent),g=this._map.containerPointToLayerPoint(u),l=this._map.layerPointToLatLng(g)),this._tooltip.setLatLng(l)}});var Ff=tr.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(s){var l=s&&s.tagName==="DIV"?s:document.createElement("div"),u=this.options;if(u.html instanceof Element?(Fo(l),l.appendChild(u.html)):l.innerHTML=u.html!==!1?u.html:"",u.bgPos){var g=Z(u.bgPos);l.style.backgroundPosition=-g.x+"px "+-g.y+"px"}return this._setIconStyles(l,"icon"),l},createShadow:function(){return null}});function gL(s){return new Ff(s)}tr.Default=$r;var ts=Ie.extend({options:{tileSize:256,opacity:1,updateWhenIdle:K.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(s){E(this,s)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(s){s._addZoomLimit(this)},onRemove:function(s){this._removeAllTiles(),kt(this._container),s._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Jn(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Qn(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(s){return this.options.opacity=s,this._updateOpacity(),this},setZIndex:function(s){return this.options.zIndex=s,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var s=this._clampZoom(this._map.getZoom());s!==this._tileZoom&&(this._tileZoom=s,this._updateLevels()),this._update()}return this},getEvents:function(){var s={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=d(this._onMoveEnd,this.options.updateInterval,this)),s.move=this._onMove),this._zoomAnimated&&(s.zoomanim=this._animateZoom),s},createTile:function(){return document.createElement("div")},getTileSize:function(){var s=this.options.tileSize;return s instanceof N?s:new N(s,s)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(s){for(var l=this.getPane().children,u=-s(-1/0,1/0),g=0,_=l.length,x;g<_;g++)x=l[g].style.zIndex,l[g]!==this._container&&x&&(u=s(u,+x));isFinite(u)&&(this.options.zIndex=u+s(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!K.ielt9){we(this._container,this.options.opacity);var s=+new Date,l=!1,u=!1;for(var g in this._tiles){var _=this._tiles[g];if(!(!_.current||!_.loaded)){var x=Math.min(1,(s-_.loaded)/200);we(_.el,x),x<1?l=!0:(_.active?u=!0:this._onOpaqueTile(_),_.active=!0)}}u&&!this._noPrune&&this._pruneTiles(),l&&(Y(this._fadeFrame),this._fadeFrame=q(this._updateOpacity,this))}},_onOpaqueTile:p,_initContainer:function(){this._container||(this._container=yt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var s=this._tileZoom,l=this.options.maxZoom;if(s!==void 0){for(var u in this._levels)u=Number(u),this._levels[u].el.children.length||u===s?(this._levels[u].el.style.zIndex=l-Math.abs(s-u),this._onUpdateLevel(u)):(kt(this._levels[u].el),this._removeTilesAtZoom(u),this._onRemoveLevel(u),delete this._levels[u]);var g=this._levels[s],_=this._map;return g||(g=this._levels[s]={},g.el=yt("div","leaflet-tile-container leaflet-zoom-animated",this._container),g.el.style.zIndex=l,g.origin=_.project(_.unproject(_.getPixelOrigin()),s).round(),g.zoom=s,this._setZoomTransform(g,_.getCenter(),_.getZoom()),p(g.el.offsetWidth),this._onCreateLevel(g)),this._level=g,g}},_onUpdateLevel:p,_onRemoveLevel:p,_onCreateLevel:p,_pruneTiles:function(){if(this._map){var s,l,u=this._map.getZoom();if(u>this.options.maxZoom||u<this.options.minZoom){this._removeAllTiles();return}for(s in this._tiles)l=this._tiles[s],l.retain=l.current;for(s in this._tiles)if(l=this._tiles[s],l.current&&!l.active){var g=l.coords;this._retainParent(g.x,g.y,g.z,g.z-5)||this._retainChildren(g.x,g.y,g.z,g.z+2)}for(s in this._tiles)this._tiles[s].retain||this._removeTile(s)}},_removeTilesAtZoom:function(s){for(var l in this._tiles)this._tiles[l].coords.z===s&&this._removeTile(l)},_removeAllTiles:function(){for(var s in this._tiles)this._removeTile(s)},_invalidateAll:function(){for(var s in this._levels)kt(this._levels[s].el),this._onRemoveLevel(Number(s)),delete this._levels[s];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(s,l,u,g){var _=Math.floor(s/2),x=Math.floor(l/2),M=u-1,k=new N(+_,+x);k.z=+M;var A=this._tileCoordsToKey(k),F=this._tiles[A];return F&&F.active?(F.retain=!0,!0):(F&&F.loaded&&(F.retain=!0),M>g?this._retainParent(_,x,M,g):!1)},_retainChildren:function(s,l,u,g){for(var _=2*s;_<2*s+2;_++)for(var x=2*l;x<2*l+2;x++){var M=new N(_,x);M.z=u+1;var k=this._tileCoordsToKey(M),A=this._tiles[k];if(A&&A.active){A.retain=!0;continue}else A&&A.loaded&&(A.retain=!0);u+1<g&&this._retainChildren(_,x,u+1,g)}},_resetView:function(s){var l=s&&(s.pinch||s.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),l,l)},_animateZoom:function(s){this._setView(s.center,s.zoom,!0,s.noUpdate)},_clampZoom:function(s){var l=this.options;return l.minNativeZoom!==void 0&&s<l.minNativeZoom?l.minNativeZoom:l.maxNativeZoom!==void 0&&l.maxNativeZoom<s?l.maxNativeZoom:s},_setView:function(s,l,u,g){var _=Math.round(l);this.options.maxZoom!==void 0&&_>this.options.maxZoom||this.options.minZoom!==void 0&&_<this.options.minZoom?_=void 0:_=this._clampZoom(_);var x=this.options.updateWhenZooming&&_!==this._tileZoom;(!g||x)&&(this._tileZoom=_,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),_!==void 0&&this._update(s),u||this._pruneTiles(),this._noPrune=!!u),this._setZoomTransforms(s,l)},_setZoomTransforms:function(s,l){for(var u in this._levels)this._setZoomTransform(this._levels[u],s,l)},_setZoomTransform:function(s,l,u){var g=this._map.getZoomScale(u,s.zoom),_=s.origin.multiplyBy(g).subtract(this._map._getNewPixelOrigin(l,u)).round();K.any3d?un(s.el,_,g):Nt(s.el,_)},_resetGrid:function(){var s=this._map,l=s.options.crs,u=this._tileSize=this.getTileSize(),g=this._tileZoom,_=this._map.getPixelWorldBounds(this._tileZoom);_&&(this._globalTileRange=this._pxBoundsToTileRange(_)),this._wrapX=l.wrapLng&&!this.options.noWrap&&[Math.floor(s.project([0,l.wrapLng[0]],g).x/u.x),Math.ceil(s.project([0,l.wrapLng[1]],g).x/u.y)],this._wrapY=l.wrapLat&&!this.options.noWrap&&[Math.floor(s.project([l.wrapLat[0],0],g).y/u.x),Math.ceil(s.project([l.wrapLat[1],0],g).y/u.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(s){var l=this._map,u=l._animatingZoom?Math.max(l._animateToZoom,l.getZoom()):l.getZoom(),g=l.getZoomScale(u,this._tileZoom),_=l.project(s,this._tileZoom).floor(),x=l.getSize().divideBy(g*2);return new at(_.subtract(x),_.add(x))},_update:function(s){var l=this._map;if(l){var u=this._clampZoom(l.getZoom());if(s===void 0&&(s=l.getCenter()),this._tileZoom!==void 0){var g=this._getTiledPixelBounds(s),_=this._pxBoundsToTileRange(g),x=_.getCenter(),M=[],k=this.options.keepBuffer,A=new at(_.getBottomLeft().subtract([k,-k]),_.getTopRight().add([k,-k]));if(!(isFinite(_.min.x)&&isFinite(_.min.y)&&isFinite(_.max.x)&&isFinite(_.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var F in this._tiles){var W=this._tiles[F].coords;(W.z!==this._tileZoom||!A.contains(new N(W.x,W.y)))&&(this._tiles[F].current=!1)}if(Math.abs(u-this._tileZoom)>1){this._setView(s,u);return}for(var it=_.min.y;it<=_.max.y;it++)for(var dt=_.min.x;dt<=_.max.x;dt++){var re=new N(dt,it);if(re.z=this._tileZoom,!!this._isValidTile(re)){var Ht=this._tiles[this._tileCoordsToKey(re)];Ht?Ht.current=!0:M.push(re)}}if(M.sort(function(ue,rr){return ue.distanceTo(x)-rr.distanceTo(x)}),M.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Le=document.createDocumentFragment();for(dt=0;dt<M.length;dt++)this._addTile(M[dt],Le);this._level.el.appendChild(Le)}}}},_isValidTile:function(s){var l=this._map.options.crs;if(!l.infinite){var u=this._globalTileRange;if(!l.wrapLng&&(s.x<u.min.x||s.x>u.max.x)||!l.wrapLat&&(s.y<u.min.y||s.y>u.max.y))return!1}if(!this.options.bounds)return!0;var g=this._tileCoordsToBounds(s);return tt(this.options.bounds).overlaps(g)},_keyToBounds:function(s){return this._tileCoordsToBounds(this._keyToTileCoords(s))},_tileCoordsToNwSe:function(s){var l=this._map,u=this.getTileSize(),g=s.scaleBy(u),_=g.add(u),x=l.unproject(g,s.z),M=l.unproject(_,s.z);return[x,M]},_tileCoordsToBounds:function(s){var l=this._tileCoordsToNwSe(s),u=new Lt(l[0],l[1]);return this.options.noWrap||(u=this._map.wrapLatLngBounds(u)),u},_tileCoordsToKey:function(s){return s.x+":"+s.y+":"+s.z},_keyToTileCoords:function(s){var l=s.split(":"),u=new N(+l[0],+l[1]);return u.z=+l[2],u},_removeTile:function(s){var l=this._tiles[s];l&&(kt(l.el),delete this._tiles[s],this.fire("tileunload",{tile:l.el,coords:this._keyToTileCoords(s)}))},_initTile:function(s){ct(s,"leaflet-tile");var l=this.getTileSize();s.style.width=l.x+"px",s.style.height=l.y+"px",s.onselectstart=p,s.onmousemove=p,K.ielt9&&this.options.opacity<1&&we(s,this.options.opacity)},_addTile:function(s,l){var u=this._getTilePos(s),g=this._tileCoordsToKey(s),_=this.createTile(this._wrapCoords(s),a(this._tileReady,this,s));this._initTile(_),this.createTile.length<2&&q(a(this._tileReady,this,s,null,_)),Nt(_,u),this._tiles[g]={el:_,coords:s,current:!0},l.appendChild(_),this.fire("tileloadstart",{tile:_,coords:s})},_tileReady:function(s,l,u){l&&this.fire("tileerror",{error:l,tile:u,coords:s});var g=this._tileCoordsToKey(s);u=this._tiles[g],u&&(u.loaded=+new Date,this._map._fadeAnimated?(we(u.el,0),Y(this._fadeFrame),this._fadeFrame=q(this._updateOpacity,this)):(u.active=!0,this._pruneTiles()),l||(ct(u.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:u.el,coords:s})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),K.ielt9||!this._map._fadeAnimated?q(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(s){return s.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(s){var l=new N(this._wrapX?f(s.x,this._wrapX):s.x,this._wrapY?f(s.y,this._wrapY):s.y);return l.z=s.z,l},_pxBoundsToTileRange:function(s){var l=this.getTileSize();return new at(s.min.unscaleBy(l).floor(),s.max.unscaleBy(l).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var s in this._tiles)if(!this._tiles[s].loaded)return!1;return!0}});function pL(s){return new ts(s)}var nr=ts.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(s,l){this._url=s,l=E(this,l),l.detectRetina&&K.retina&&l.maxZoom>0?(l.tileSize=Math.floor(l.tileSize/2),l.zoomReverse?(l.zoomOffset--,l.minZoom=Math.min(l.maxZoom,l.minZoom+1)):(l.zoomOffset++,l.maxZoom=Math.max(l.minZoom,l.maxZoom-1)),l.minZoom=Math.max(0,l.minZoom)):l.zoomReverse?l.minZoom=Math.min(l.maxZoom,l.minZoom):l.maxZoom=Math.max(l.minZoom,l.maxZoom),typeof l.subdomains=="string"&&(l.subdomains=l.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(s,l){return this._url===s&&l===void 0&&(l=!0),this._url=s,l||this.redraw(),this},createTile:function(s,l){var u=document.createElement("img");return lt(u,"load",a(this._tileOnLoad,this,l,u)),lt(u,"error",a(this._tileOnError,this,l,u)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(u.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(u.referrerPolicy=this.options.referrerPolicy),u.alt="",u.src=this.getTileUrl(s),u},getTileUrl:function(s){var l={r:K.retina?"@2x":"",s:this._getSubdomain(s),x:s.x,y:s.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var u=this._globalTileRange.max.y-s.y;this.options.tms&&(l.y=u),l["-y"]=u}return w(this._url,n(l,this.options))},_tileOnLoad:function(s,l){K.ielt9?setTimeout(a(s,this,null,l),0):s(null,l)},_tileOnError:function(s,l,u){var g=this.options.errorTileUrl;g&&l.getAttribute("src")!==g&&(l.src=g),s(u,l)},_onTileRemove:function(s){s.tile.onload=null},_getZoomForUrl:function(){var s=this._tileZoom,l=this.options.maxZoom,u=this.options.zoomReverse,g=this.options.zoomOffset;return u&&(s=l-s),s+g},_getSubdomain:function(s){var l=Math.abs(s.x+s.y)%this.options.subdomains.length;return this.options.subdomains[l]},_abortLoading:function(){var s,l;for(s in this._tiles)if(this._tiles[s].coords.z!==this._tileZoom&&(l=this._tiles[s].el,l.onload=p,l.onerror=p,!l.complete)){l.src=P;var u=this._tiles[s].coords;kt(l),delete this._tiles[s],this.fire("tileabort",{tile:l,coords:u})}},_removeTile:function(s){var l=this._tiles[s];if(l)return l.el.setAttribute("src",P),ts.prototype._removeTile.call(this,s)},_tileReady:function(s,l,u){if(!(!this._map||u&&u.getAttribute("src")===P))return ts.prototype._tileReady.call(this,s,l,u)}});function zf(s,l){return new nr(s,l)}var Nf=nr.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(s,l){this._url=s;var u=n({},this.defaultWmsParams);for(var g in l)g in this.options||(u[g]=l[g]);l=E(this,l);var _=l.detectRetina&&K.retina?2:1,x=this.getTileSize();u.width=x.x*_,u.height=x.y*_,this.wmsParams=u},onAdd:function(s){this._crs=this.options.crs||s.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var l=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[l]=this._crs.code,nr.prototype.onAdd.call(this,s)},getTileUrl:function(s){var l=this._tileCoordsToNwSe(s),u=this._crs,g=z(u.project(l[0]),u.project(l[1])),_=g.min,x=g.max,M=(this._wmsVersion>=1.3&&this._crs===kf?[_.y,_.x,x.y,x.x]:[_.x,_.y,x.x,x.y]).join(","),k=nr.prototype.getTileUrl.call(this,s);return k+C(this.wmsParams,k,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+M},setParams:function(s,l){return n(this.wmsParams,s),l||this.redraw(),this}});function _L(s,l){return new Nf(s,l)}nr.WMS=Nf,zf.wms=_L;var yi=Ie.extend({options:{padding:.1},initialize:function(s){E(this,s),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),ct(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 s={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(s.zoomanim=this._onAnimZoom),s},_onAnimZoom:function(s){this._updateTransform(s.center,s.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(s,l){var u=this._map.getZoomScale(l,this._zoom),g=this._map.getSize().multiplyBy(.5+this.options.padding),_=this._map.project(this._center,l),x=g.multiplyBy(-u).add(_).subtract(this._map._getNewPixelOrigin(s,l));K.any3d?un(this._container,x,u):Nt(this._container,x)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var s in this._layers)this._layers[s]._reset()},_onZoomEnd:function(){for(var s in this._layers)this._layers[s]._project()},_updatePaths:function(){for(var s in this._layers)this._layers[s]._update()},_update:function(){var s=this.options.padding,l=this._map.getSize(),u=this._map.containerPointToLayerPoint(l.multiplyBy(-s)).round();this._bounds=new at(u,u.add(l.multiplyBy(1+s*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Bf=yi.extend({options:{tolerance:0},getEvents:function(){var s=yi.prototype.getEvents.call(this);return s.viewprereset=this._onViewPreReset,s},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){yi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var s=this._container=document.createElement("canvas");lt(s,"mousemove",this._onMouseMove,this),lt(s,"click dblclick mousedown mouseup contextmenu",this._onClick,this),lt(s,"mouseout",this._handleMouseOut,this),s._leaflet_disable_events=!0,this._ctx=s.getContext("2d")},_destroyContainer:function(){Y(this._redrawRequest),delete this._ctx,kt(this._container),St(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var s;this._redrawBounds=null;for(var l in this._layers)s=this._layers[l],s._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){yi.prototype._update.call(this);var s=this._bounds,l=this._container,u=s.getSize(),g=K.retina?2:1;Nt(l,s.min),l.width=g*u.x,l.height=g*u.y,l.style.width=u.x+"px",l.style.height=u.y+"px",K.retina&&this._ctx.scale(2,2),this._ctx.translate(-s.min.x,-s.min.y),this.fire("update")}},_reset:function(){yi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(s){this._updateDashArray(s),this._layers[c(s)]=s;var l=s._order={layer:s,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=l),this._drawLast=l,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(s){this._requestRedraw(s)},_removePath:function(s){var l=s._order,u=l.next,g=l.prev;u?u.prev=g:this._drawLast=g,g?g.next=u:this._drawFirst=u,delete s._order,delete this._layers[c(s)],this._requestRedraw(s)},_updatePath:function(s){this._extendRedrawBounds(s),s._project(),s._update(),this._requestRedraw(s)},_updateStyle:function(s){this._updateDashArray(s),this._requestRedraw(s)},_updateDashArray:function(s){if(typeof s.options.dashArray=="string"){var l=s.options.dashArray.split(/[, ]+/),u=[],g,_;for(_=0;_<l.length;_++){if(g=Number(l[_]),isNaN(g))return;u.push(g)}s.options._dashArray=u}else s.options._dashArray=s.options.dashArray},_requestRedraw:function(s){this._map&&(this._extendRedrawBounds(s),this._redrawRequest=this._redrawRequest||q(this._redraw,this))},_extendRedrawBounds:function(s){if(s._pxBounds){var l=(s.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new at,this._redrawBounds.extend(s._pxBounds.min.subtract([l,l])),this._redrawBounds.extend(s._pxBounds.max.add([l,l]))}},_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 s=this._redrawBounds;if(s){var l=s.getSize();this._ctx.clearRect(s.min.x,s.min.y,l.x,l.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 s,l=this._redrawBounds;if(this._ctx.save(),l){var u=l.getSize();this._ctx.beginPath(),this._ctx.rect(l.min.x,l.min.y,u.x,u.y),this._ctx.clip()}this._drawing=!0;for(var g=this._drawFirst;g;g=g.next)s=g.layer,(!l||s._pxBounds&&s._pxBounds.intersects(l))&&s._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(s,l){if(this._drawing){var u,g,_,x,M=s._parts,k=M.length,A=this._ctx;if(k){for(A.beginPath(),u=0;u<k;u++){for(g=0,_=M[u].length;g<_;g++)x=M[u][g],A[g?"lineTo":"moveTo"](x.x,x.y);l&&A.closePath()}this._fillStroke(A,s)}}},_updateCircle:function(s){if(!(!this._drawing||s._empty())){var l=s._point,u=this._ctx,g=Math.max(Math.round(s._radius),1),_=(Math.max(Math.round(s._radiusY),1)||g)/g;_!==1&&(u.save(),u.scale(1,_)),u.beginPath(),u.arc(l.x,l.y/_,g,0,Math.PI*2,!1),_!==1&&u.restore(),this._fillStroke(u,s)}},_fillStroke:function(s,l){var u=l.options;u.fill&&(s.globalAlpha=u.fillOpacity,s.fillStyle=u.fillColor||u.color,s.fill(u.fillRule||"evenodd")),u.stroke&&u.weight!==0&&(s.setLineDash&&s.setLineDash(l.options&&l.options._dashArray||[]),s.globalAlpha=u.opacity,s.lineWidth=u.weight,s.strokeStyle=u.color,s.lineCap=u.lineCap,s.lineJoin=u.lineJoin,s.stroke())},_onClick:function(s){for(var l=this._map.mouseEventToLayerPoint(s),u,g,_=this._drawFirst;_;_=_.next)u=_.layer,u.options.interactive&&u._containsPoint(l)&&(!(s.type==="click"||s.type==="preclick")||!this._map._draggableMoved(u))&&(g=u);this._fireEvent(g?[g]:!1,s)},_onMouseMove:function(s){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var l=this._map.mouseEventToLayerPoint(s);this._handleMouseHover(s,l)}},_handleMouseOut:function(s){var l=this._hoveredLayer;l&&(It(this._container,"leaflet-interactive"),this._fireEvent([l],s,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(s,l){if(!this._mouseHoverThrottled){for(var u,g,_=this._drawFirst;_;_=_.next)u=_.layer,u.options.interactive&&u._containsPoint(l)&&(g=u);g!==this._hoveredLayer&&(this._handleMouseOut(s),g&&(ct(this._container,"leaflet-interactive"),this._fireEvent([g],s,"mouseover"),this._hoveredLayer=g)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,s),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(s,l,u){this._map._fireDOMEvent(l,u||l.type,s)},_bringToFront:function(s){var l=s._order;if(l){var u=l.next,g=l.prev;if(u)u.prev=g;else return;g?g.next=u:u&&(this._drawFirst=u),l.prev=this._drawLast,this._drawLast.next=l,l.next=null,this._drawLast=l,this._requestRedraw(s)}},_bringToBack:function(s){var l=s._order;if(l){var u=l.next,g=l.prev;if(g)g.next=u;else return;u?u.prev=g:g&&(this._drawLast=g),l.prev=null,l.next=this._drawFirst,this._drawFirst.prev=l,this._drawFirst=l,this._requestRedraw(s)}}});function Gf(s){return K.canvas?new Bf(s):null}var es=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(s){return document.createElement("<lvml:"+s+' class="lvml">')}}catch{}return function(s){return document.createElement("<"+s+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),mL={_initContainer:function(){this._container=yt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(yi.prototype._update.call(this),this.fire("update"))},_initPath:function(s){var l=s._container=es("shape");ct(l,"leaflet-vml-shape "+(this.options.className||"")),l.coordsize="1 1",s._path=es("path"),l.appendChild(s._path),this._updateStyle(s),this._layers[c(s)]=s},_addPath:function(s){var l=s._container;this._container.appendChild(l),s.options.interactive&&s.addInteractiveTarget(l)},_removePath:function(s){var l=s._container;kt(l),s.removeInteractiveTarget(l),delete this._layers[c(s)]},_updateStyle:function(s){var l=s._stroke,u=s._fill,g=s.options,_=s._container;_.stroked=!!g.stroke,_.filled=!!g.fill,g.stroke?(l||(l=s._stroke=es("stroke")),_.appendChild(l),l.weight=g.weight+"px",l.color=g.color,l.opacity=g.opacity,g.dashArray?l.dashStyle=b(g.dashArray)?g.dashArray.join(" "):g.dashArray.replace(/( *, *)/g," "):l.dashStyle="",l.endcap=g.lineCap.replace("butt","flat"),l.joinstyle=g.lineJoin):l&&(_.removeChild(l),s._stroke=null),g.fill?(u||(u=s._fill=es("fill")),_.appendChild(u),u.color=g.fillColor||g.color,u.opacity=g.fillOpacity):u&&(_.removeChild(u),s._fill=null)},_updateCircle:function(s){var l=s._point.round(),u=Math.round(s._radius),g=Math.round(s._radiusY||u);this._setPath(s,s._empty()?"M0 0":"AL "+l.x+","+l.y+" "+u+","+g+" 0,"+65535*360)},_setPath:function(s,l){s._path.v=l},_bringToFront:function(s){Jn(s._container)},_bringToBack:function(s){Qn(s._container)}},Jo=K.vml?es:Fi,is=yi.extend({_initContainer:function(){this._container=Jo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Jo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){kt(this._container),St(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){yi.prototype._update.call(this);var s=this._bounds,l=s.getSize(),u=this._container;(!this._svgSize||!this._svgSize.equals(l))&&(this._svgSize=l,u.setAttribute("width",l.x),u.setAttribute("height",l.y)),Nt(u,s.min),u.setAttribute("viewBox",[s.min.x,s.min.y,l.x,l.y].join(" ")),this.fire("update")}},_initPath:function(s){var l=s._path=Jo("path");s.options.className&&ct(l,s.options.className),s.options.interactive&&ct(l,"leaflet-interactive"),this._updateStyle(s),this._layers[c(s)]=s},_addPath:function(s){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(s._path),s.addInteractiveTarget(s._path)},_removePath:function(s){kt(s._path),s.removeInteractiveTarget(s._path),delete this._layers[c(s)]},_updatePath:function(s){s._project(),s._update()},_updateStyle:function(s){var l=s._path,u=s.options;l&&(u.stroke?(l.setAttribute("stroke",u.color),l.setAttribute("stroke-opacity",u.opacity),l.setAttribute("stroke-width",u.weight),l.setAttribute("stroke-linecap",u.lineCap),l.setAttribute("stroke-linejoin",u.lineJoin),u.dashArray?l.setAttribute("stroke-dasharray",u.dashArray):l.removeAttribute("stroke-dasharray"),u.dashOffset?l.setAttribute("stroke-dashoffset",u.dashOffset):l.removeAttribute("stroke-dashoffset")):l.setAttribute("stroke","none"),u.fill?(l.setAttribute("fill",u.fillColor||u.color),l.setAttribute("fill-opacity",u.fillOpacity),l.setAttribute("fill-rule",u.fillRule||"evenodd")):l.setAttribute("fill","none"))},_updatePoly:function(s,l){this._setPath(s,Se(s._parts,l))},_updateCircle:function(s){var l=s._point,u=Math.max(Math.round(s._radius),1),g=Math.max(Math.round(s._radiusY),1)||u,_="a"+u+","+g+" 0 1,0 ",x=s._empty()?"M0 0":"M"+(l.x-u)+","+l.y+_+u*2+",0 "+_+-u*2+",0 ";this._setPath(s,x)},_setPath:function(s,l){s._path.setAttribute("d",l)},_bringToFront:function(s){Jn(s._path)},_bringToBack:function(s){Qn(s._path)}});K.vml&&is.include(mL);function Uf(s){return K.svg||K.vml?new is(s):null}mt.include({getRenderer:function(s){var l=s.options.renderer||this._getPaneRenderer(s.options.pane)||this.options.renderer||this._renderer;return l||(l=this._renderer=this._createRenderer()),this.hasLayer(l)||this.addLayer(l),l},_getPaneRenderer:function(s){if(s==="overlayPane"||s===void 0)return!1;var l=this._paneRenderers[s];return l===void 0&&(l=this._createRenderer({pane:s}),this._paneRenderers[s]=l),l},_createRenderer:function(s){return this.options.preferCanvas&&Gf(s)||Uf(s)}});var jf=er.extend({initialize:function(s,l){er.prototype.initialize.call(this,this._boundsToLatLngs(s),l)},setBounds:function(s){return this.setLatLngs(this._boundsToLatLngs(s))},_boundsToLatLngs:function(s){return s=tt(s),[s.getSouthWest(),s.getNorthWest(),s.getNorthEast(),s.getSouthEast()]}});function yL(s,l){return new jf(s,l)}is.create=Jo,is.pointsToPath=Se,mi.geometryToLayer=Wo,mi.coordsToLatLng=gh,mi.coordsToLatLngs=Ho,mi.latLngToCoords=ph,mi.latLngsToCoords=Vo,mi.getFeature=ir,mi.asFeature=Xo,mt.mergeOptions({boxZoom:!0});var Zf=Ye.extend({initialize:function(s){this._map=s,this._container=s._container,this._pane=s._panes.overlayPane,this._resetStateTimeout=0,s.on("unload",this._destroy,this)},addHooks:function(){lt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){St(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){kt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(s){if(!s.shiftKey||s.which!==1&&s.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Xr(),Jl(),this._startPoint=this._map.mouseEventToContainerPoint(s),lt(document,{contextmenu:gn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(s){this._moved||(this._moved=!0,this._box=yt("div","leaflet-zoom-box",this._container),ct(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(s);var l=new at(this._point,this._startPoint),u=l.getSize();Nt(this._box,l.min),this._box.style.width=u.x+"px",this._box.style.height=u.y+"px"},_finish:function(){this._moved&&(kt(this._box),It(this._container,"leaflet-crosshair")),Yr(),Ql(),St(document,{contextmenu:gn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(s){if(!(s.which!==1&&s.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var l=new Lt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(l).fire("boxzoomend",{boxZoomBounds:l})}},_onKeyDown:function(s){s.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});mt.addInitHook("addHandler","boxZoom",Zf),mt.mergeOptions({doubleClickZoom:!0});var Wf=Ye.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(s){var l=this._map,u=l.getZoom(),g=l.options.zoomDelta,_=s.originalEvent.shiftKey?u-g:u+g;l.options.doubleClickZoom==="center"?l.setZoom(_):l.setZoomAround(s.containerPoint,_)}});mt.addInitHook("addHandler","doubleClickZoom",Wf),mt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Hf=Ye.extend({addHooks:function(){if(!this._draggable){var s=this._map;this._draggable=new Zi(s._mapPane,s._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),s.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),s.on("zoomend",this._onZoomEnd,this),s.whenReady(this._onZoomEnd,this))}ct(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){It(this._map._container,"leaflet-grab"),It(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 s=this._map;if(s._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var l=tt(this._map.options.maxBounds);this._offsetLimit=z(this._map.latLngToContainerPoint(l.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(l.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;s.fire("movestart").fire("dragstart"),s.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(s){if(this._map.options.inertia){var l=this._lastTime=+new Date,u=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(u),this._times.push(l),this._prunePositions(l)}this._map.fire("move",s).fire("drag",s)},_prunePositions:function(s){for(;this._positions.length>1&&s-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var s=this._map.getSize().divideBy(2),l=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=l.subtract(s).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(s,l){return s-(s-l)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var s=this._draggable._newPos.subtract(this._draggable._startPos),l=this._offsetLimit;s.x<l.min.x&&(s.x=this._viscousLimit(s.x,l.min.x)),s.y<l.min.y&&(s.y=this._viscousLimit(s.y,l.min.y)),s.x>l.max.x&&(s.x=this._viscousLimit(s.x,l.max.x)),s.y>l.max.y&&(s.y=this._viscousLimit(s.y,l.max.y)),this._draggable._newPos=this._draggable._startPos.add(s)}},_onPreDragWrap:function(){var s=this._worldWidth,l=Math.round(s/2),u=this._initialWorldOffset,g=this._draggable._newPos.x,_=(g-l+u)%s+l-u,x=(g+l+u)%s-l-u,M=Math.abs(_+u)<Math.abs(x+u)?_:x;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=M},_onDragEnd:function(s){var l=this._map,u=l.options,g=!u.inertia||s.noInertia||this._times.length<2;if(l.fire("dragend",s),g)l.fire("moveend");else{this._prunePositions(+new Date);var _=this._lastPos.subtract(this._positions[0]),x=(this._lastTime-this._times[0])/1e3,M=u.easeLinearity,k=_.multiplyBy(M/x),A=k.distanceTo([0,0]),F=Math.min(u.inertiaMaxSpeed,A),W=k.multiplyBy(F/A),it=F/(u.inertiaDeceleration*M),dt=W.multiplyBy(-it/2).round();!dt.x&&!dt.y?l.fire("moveend"):(dt=l._limitOffset(dt,l.options.maxBounds),q(function(){l.panBy(dt,{duration:it,easeLinearity:M,noMoveStart:!0,animate:!0})}))}}});mt.addInitHook("addHandler","dragging",Hf),mt.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Vf=Ye.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(s){this._map=s,this._setPanDelta(s.options.keyboardPanDelta),this._setZoomDelta(s.options.zoomDelta)},addHooks:function(){var s=this._map._container;s.tabIndex<=0&&(s.tabIndex="0"),lt(s,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),St(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 s=document.body,l=document.documentElement,u=s.scrollTop||l.scrollTop,g=s.scrollLeft||l.scrollLeft;this._map._container.focus(),window.scrollTo(g,u)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(s){var l=this._panKeys={},u=this.keyCodes,g,_;for(g=0,_=u.left.length;g<_;g++)l[u.left[g]]=[-1*s,0];for(g=0,_=u.right.length;g<_;g++)l[u.right[g]]=[s,0];for(g=0,_=u.down.length;g<_;g++)l[u.down[g]]=[0,s];for(g=0,_=u.up.length;g<_;g++)l[u.up[g]]=[0,-1*s]},_setZoomDelta:function(s){var l=this._zoomKeys={},u=this.keyCodes,g,_;for(g=0,_=u.zoomIn.length;g<_;g++)l[u.zoomIn[g]]=s;for(g=0,_=u.zoomOut.length;g<_;g++)l[u.zoomOut[g]]=-s},_addHooks:function(){lt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){St(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(s){if(!(s.altKey||s.ctrlKey||s.metaKey)){var l=s.keyCode,u=this._map,g;if(l in this._panKeys){if(!u._panAnim||!u._panAnim._inProgress)if(g=this._panKeys[l],s.shiftKey&&(g=Z(g).multiplyBy(3)),u.options.maxBounds&&(g=u._limitOffset(Z(g),u.options.maxBounds)),u.options.worldCopyJump){var _=u.wrapLatLng(u.unproject(u.project(u.getCenter()).add(g)));u.panTo(_)}else u.panBy(g)}else if(l in this._zoomKeys)u.setZoom(u.getZoom()+(s.shiftKey?3:1)*this._zoomKeys[l]);else if(l===27&&u._popup&&u._popup.options.closeOnEscapeKey)u.closePopup();else return;gn(s)}}});mt.addInitHook("addHandler","keyboard",Vf),mt.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Xf=Ye.extend({addHooks:function(){lt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){St(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(s){var l=mf(s),u=this._map.options.wheelDebounceTime;this._delta+=l,this._lastMousePos=this._map.mouseEventToContainerPoint(s),this._startTime||(this._startTime=+new Date);var g=Math.max(u-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),g),gn(s)},_performZoom:function(){var s=this._map,l=s.getZoom(),u=this._map.options.zoomSnap||0;s._stop();var g=this._delta/(this._map.options.wheelPxPerZoomLevel*4),_=4*Math.log(2/(1+Math.exp(-Math.abs(g))))/Math.LN2,x=u?Math.ceil(_/u)*u:_,M=s._limitZoom(l+(this._delta>0?x:-x))-l;this._delta=0,this._startTime=null,M&&(s.options.scrollWheelZoom==="center"?s.setZoom(l+M):s.setZoomAround(this._lastMousePos,l+M))}});mt.addInitHook("addHandler","scrollWheelZoom",Xf);var vL=600;mt.mergeOptions({tapHold:K.touchNative&&K.safari&&K.mobile,tapTolerance:15});var Yf=Ye.extend({addHooks:function(){lt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){St(this._map._container,"touchstart",this._onDown,this)},_onDown:function(s){if(clearTimeout(this._holdTimeout),s.touches.length===1){var l=s.touches[0];this._startPos=this._newPos=new N(l.clientX,l.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(lt(document,"touchend",Kt),lt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",l))},this),vL),lt(document,"touchend touchcancel contextmenu",this._cancel,this),lt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function s(){St(document,"touchend",Kt),St(document,"touchend touchcancel",s)},_cancel:function(){clearTimeout(this._holdTimeout),St(document,"touchend touchcancel contextmenu",this._cancel,this),St(document,"touchmove",this._onMove,this)},_onMove:function(s){var l=s.touches[0];this._newPos=new N(l.clientX,l.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(s,l){var u=new MouseEvent(s,{bubbles:!0,cancelable:!0,view:window,screenX:l.screenX,screenY:l.screenY,clientX:l.clientX,clientY:l.clientY});u._simulated=!0,l.target.dispatchEvent(u)}});mt.addInitHook("addHandler","tapHold",Yf),mt.mergeOptions({touchZoom:K.touch,bounceAtZoomLimits:!0});var Kf=Ye.extend({addHooks:function(){ct(this._map._container,"leaflet-touch-zoom"),lt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){It(this._map._container,"leaflet-touch-zoom"),St(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(s){var l=this._map;if(!(!s.touches||s.touches.length!==2||l._animatingZoom||this._zooming)){var u=l.mouseEventToContainerPoint(s.touches[0]),g=l.mouseEventToContainerPoint(s.touches[1]);this._centerPoint=l.getSize()._divideBy(2),this._startLatLng=l.containerPointToLatLng(this._centerPoint),l.options.touchZoom!=="center"&&(this._pinchStartLatLng=l.containerPointToLatLng(u.add(g)._divideBy(2))),this._startDist=u.distanceTo(g),this._startZoom=l.getZoom(),this._moved=!1,this._zooming=!0,l._stop(),lt(document,"touchmove",this._onTouchMove,this),lt(document,"touchend touchcancel",this._onTouchEnd,this),Kt(s)}},_onTouchMove:function(s){if(!(!s.touches||s.touches.length!==2||!this._zooming)){var l=this._map,u=l.mouseEventToContainerPoint(s.touches[0]),g=l.mouseEventToContainerPoint(s.touches[1]),_=u.distanceTo(g)/this._startDist;if(this._zoom=l.getScaleZoom(_,this._startZoom),!l.options.bounceAtZoomLimits&&(this._zoom<l.getMinZoom()&&_<1||this._zoom>l.getMaxZoom()&&_>1)&&(this._zoom=l._limitZoom(this._zoom)),l.options.touchZoom==="center"){if(this._center=this._startLatLng,_===1)return}else{var x=u._add(g)._divideBy(2)._subtract(this._centerPoint);if(_===1&&x.x===0&&x.y===0)return;this._center=l.unproject(l.project(this._pinchStartLatLng,this._zoom).subtract(x),this._zoom)}this._moved||(l._moveStart(!0,!1),this._moved=!0),Y(this._animRequest);var M=a(l._move,l,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=q(M,this,!0),Kt(s)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,Y(this._animRequest),St(document,"touchmove",this._onTouchMove,this),St(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))}});mt.addInitHook("addHandler","touchZoom",Kf),mt.BoxZoom=Zf,mt.DoubleClickZoom=Wf,mt.Drag=Hf,mt.Keyboard=Vf,mt.ScrollWheelZoom=Xf,mt.TapHold=Yf,mt.TouchZoom=Kf,e.Bounds=at,e.Browser=K,e.CRS=Ft,e.Canvas=Bf,e.Circle=fh,e.CircleMarker=Zo,e.Class=pt,e.Control=Ae,e.DivIcon=Ff,e.DivOverlay=Ke,e.DomEvent=zE,e.DomUtil=OE,e.Draggable=Zi,e.Evented=G,e.FeatureGroup=pi,e.GeoJSON=mi,e.GridLayer=ts,e.Handler=Ye,e.Icon=tr,e.ImageOverlay=Yo,e.LatLng=J,e.LatLngBounds=Lt,e.Layer=Ie,e.LayerGroup=$n,e.LineUtil=qE,e.Map=mt,e.Marker=jo,e.Mixin=WE,e.Path=Wi,e.Point=N,e.PolyUtil=HE,e.Polygon=er,e.Polyline=_i,e.Popup=Ko,e.PosAnimation=yf,e.Projection=JE,e.Rectangle=jf,e.Renderer=yi,e.SVG=is,e.SVGOverlay=Of,e.TileLayer=nr,e.Tooltip=qo,e.Transformation=Di,e.Util=rt,e.VideoOverlay=Df,e.bind=a,e.bounds=z,e.canvas=Gf,e.circle=sL,e.circleMarker=rL,e.control=Jr,e.divIcon=gL,e.extend=n,e.featureGroup=eL,e.geoJSON=If,e.geoJson=lL,e.gridLayer=pL,e.icon=iL,e.imageOverlay=hL,e.latLng=st,e.latLngBounds=tt,e.layerGroup=tL,e.map=NE,e.marker=nL,e.point=Z,e.polygon=aL,e.polyline=oL,e.popup=dL,e.rectangle=yL,e.setOptions=E,e.stamp=c,e.svg=Uf,e.svgOverlay=uL,e.tileLayer=zf,e.tooltip=fL,e.transformation=xe,e.version=i,e.videoOverlay=cL;var xL=window.L;e.noConflict=function(){return window.L=xL,this},window.L=e})}(os,os.exports)),os.exports}var Q=Mh();const RL="";function Sh(r,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=r,i}function hg(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ph(r[0])||!Ph(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return Sh(i,t,e)}function cg(r,t,e){e===void 0&&(e={});for(var i=0,n=r;i<n.length;i++){var o=n[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:r};return Sh(h,t,e)}function Ph(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function ug(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function dg(r){return r.type==="Feature"?r.geometry:r}function fg(r,t,e,i,n){kh(r,t,e||0,i||r.length-1,n||gg)}function kh(r,t,e,i,n){for(;i>e;){if(i-e>600){var o=i-e+1,a=t-e+1,h=Math.log(o),c=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*c*(o-c)/o)*(a-o/2<0?-1:1),f=Math.max(e,Math.floor(t-a*c/o+d)),p=Math.min(i,Math.floor(t+(o-a)*c/o+d));kh(r,t,f,p,n)}var m=r[t],y=e,v=i;for(sr(r,e,t),n(r[i],m)>0&&sr(r,e,i);y<v;){for(sr(r,y,v),y++,v--;n(r[y],m)<0;)y++;for(;n(r[v],m)>0;)v--}n(r[e],m)===0?sr(r,e,v):(v++,sr(r,v,i)),v<=t&&(e=v+1),t<=v&&(i=v-1)}}function sr(r,t,e){var i=r[t];r[t]=r[e],r[e]=i}function gg(r,t){return r<t?-1:r>t?1:0}let Rh=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!ls(t,e))return i;const n=this.toBBox,o=[];for(;e;){for(let a=0;a<e.children.length;a++){const h=e.children[a],c=e.leaf?n(h):h;ls(t,c)&&(e.leaf?i.push(h):ia(t,c)?this._all(h,i):o.push(h))}e=o.pop()}return i}collides(t){let e=this.data;if(!ls(t,e))return!1;const i=[];for(;e;){for(let n=0;n<e.children.length;n++){const o=e.children[n],a=e.leaf?this.toBBox(o):o;if(ls(t,a)){if(e.leaf||ia(t,a))return!0;i.push(o)}}e=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=e;else if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const i=this.data;this.data=e,e=i}this._insert(e,this.data.height-e.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=mn([]),this}remove(t,e){if(!t)return this;let i=this.data;const n=this.toBBox(t),o=[],a=[];let h,c,d;for(;i||o.length;){if(i||(i=o.pop(),c=o[o.length-1],h=a.pop(),d=!0),i.leaf){const f=pg(t,i.children,e);if(f!==-1)return i.children.splice(f,1),o.push(i),this._condense(o),this}!d&&!i.leaf&&ia(i,n)?(o.push(i),a.push(h),h=0,c=i,i=i.children[0]):c?(h++,i=c.children[h],d=!1):i=null}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,n){const o=i-e+1;let a=this._maxEntries,h;if(o<=a)return h=mn(t.slice(e,i+1)),_n(h,this.toBBox),h;n||(n=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,n-1))),h=mn([]),h.leaf=!1,h.height=n;const c=Math.ceil(o/a),d=c*Math.ceil(Math.sqrt(a));Ah(t,e,i,d,this.compareMinX);for(let f=e;f<=i;f+=d){const p=Math.min(f+d-1,i);Ah(t,f,p,c,this.compareMinY);for(let m=f;m<=p;m+=c){const y=Math.min(m+c-1,p);h.children.push(this._build(t,m,y,n-1))}}return _n(h,this.toBBox),h}_chooseSubtree(t,e,i,n){for(;n.push(e),!(e.leaf||n.length-1===i);){let o=1/0,a=1/0,h;for(let c=0;c<e.children.length;c++){const d=e.children[c],f=ea(d),p=yg(t,d)-f;p<a?(a=p,o=f<o?f:o,h=d):p===a&&f<o&&(o=f,h=d)}e=h||e.children[0]}return e}_insert(t,e,i){const n=i?t:this.toBBox(t),o=[],a=this._chooseSubtree(n,this.data,e,o);for(a.children.push(t),ar(a,n);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(n,o,e)}_split(t,e){const i=t[e],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);const a=this._chooseSplitIndex(i,o,n),h=mn(i.children.splice(a,i.children.length-a));h.height=i.height,h.leaf=i.leaf,_n(i,this.toBBox),_n(h,this.toBBox),e?t[e-1].children.push(h):this._splitRoot(i,h)}_splitRoot(t,e){this.data=mn([t,e]),this.data.height=t.height+1,this.data.leaf=!1,_n(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let n,o=1/0,a=1/0;for(let h=e;h<=i-e;h++){const c=or(t,0,h,this.toBBox),d=or(t,h,i,this.toBBox),f=vg(c,d),p=ea(c)+ea(d);f<o?(o=f,n=h,a=p<a?p:a):f===o&&p<a&&(a=p,n=h)}return n||i-e}_chooseSplitAxis(t,e,i){const n=t.leaf?this.compareMinX:_g,o=t.leaf?this.compareMinY:mg,a=this._allDistMargin(t,e,i,n),h=this._allDistMargin(t,e,i,o);a<h&&t.children.sort(n)}_allDistMargin(t,e,i,n){t.children.sort(n);const o=this.toBBox,a=or(t,0,e,o),h=or(t,i-e,i,o);let c=as(a)+as(h);for(let d=e;d<i-e;d++){const f=t.children[d];ar(a,t.leaf?o(f):f),c+=as(a)}for(let d=i-e-1;d>=e;d--){const f=t.children[d];ar(h,t.leaf?o(f):f),c+=as(h)}return c}_adjustParentBBoxes(t,e,i){for(let n=i;n>=0;n--)ar(e[n],t)}_condense(t){for(let e=t.length-1,i;e>=0;e--)t[e].children.length===0?e>0?(i=t[e-1].children,i.splice(i.indexOf(t[e]),1)):this.clear():_n(t[e],this.toBBox)}};function pg(r,t,e){if(!e)return t.indexOf(r);for(let i=0;i<t.length;i++)if(e(r,t[i]))return i;return-1}function _n(r,t){or(r,0,r.children.length,t,r)}function or(r,t,e,i,n){n||(n=mn(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let o=t;o<e;o++){const a=r.children[o];ar(n,r.leaf?i(a):a)}return n}function ar(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function _g(r,t){return r.minX-t.minX}function mg(r,t){return r.minY-t.minY}function ea(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function as(r){return r.maxX-r.minX+(r.maxY-r.minY)}function yg(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function vg(r,t){const e=Math.max(r.minX,t.minX),i=Math.max(r.minY,t.minY),n=Math.min(r.maxX,t.maxX),o=Math.min(r.maxY,t.maxY);return Math.max(0,n-e)*Math.max(0,o-i)}function ia(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function ls(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function mn(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Ah(r,t,e,i,n){const o=[t,e];for(;o.length;){if(e=o.pop(),t=o.pop(),e-t<=i)continue;const a=t+Math.ceil((e-t)/i/2)*i;fg(r,a,t,e,n),o.push(t,a,a,e)}}function xg(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");var i=ug(r),n=dg(t),o=n.type,a=t.bbox,h=n.coordinates;if(a&&wg(i,a)===!1)return!1;o==="Polygon"&&(h=[h]);for(var c=!1,d=0;d<h.length&&!c;d++)if(Ih(i,h[d][0],e.ignoreBoundary)){for(var f=!1,p=1;p<h[d].length&&!f;)Ih(i,h[d][p],!e.ignoreBoundary)&&(f=!0),p++;f||(c=!0)}return c}function Ih(r,t,e){var i=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var n=0,o=t.length-1;n<t.length;o=n++){var a=t[n][0],h=t[n][1],c=t[o][0],d=t[o][1],f=r[1]*(a-c)+h*(c-r[0])+d*(r[0]-a)===0&&(a-r[0])*(c-r[0])<=0&&(h-r[1])*(d-r[1])<=0;if(f)return!e;var p=h>r[1]!=d>r[1]&&r[0]<(c-a)*(r[1]-h)/(d-h)+a;p&&(i=!i)}return i}function wg(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}var Dh={exports:{}};Dh.exports=hs,Dh.exports.default=hs;function hs(r,t,e){e=e||2;var i=t&&t.length,n=i?t[0]*e:r.length,o=Oh(r,0,n,e,!0),a=[];if(!o||o.next===o.prev)return a;var h,c,d,f,p,m,y;if(i&&(o=Cg(r,t,o,e)),r.length>80*e){h=d=r[0],c=f=r[1];for(var v=e;v<n;v+=e)p=r[v],m=r[v+1],p<h&&(h=p),m<c&&(c=m),p>d&&(d=p),m>f&&(f=m);y=Math.max(d-h,f-c),y=y!==0?32767/y:0}return lr(o,a,e,h,c,y,0),a}function Oh(r,t,e,i,n){var o,a;if(n===sa(r,t,e,i)>0)for(o=t;o<e;o+=i)a=Nh(o,r[o],r[o+1],a);else for(o=e-i;o>=t;o-=i)a=Nh(o,r[o],r[o+1],a);return a&&cs(a,a.next)&&(cr(a),a=a.next),a}function Hi(r,t){if(!r)return r;t||(t=r);var e=r,i;do if(i=!1,!e.steiner&&(cs(e,e.next)||Pt(e.prev,e,e.next)===0)){if(cr(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function lr(r,t,e,i,n,o,a){if(r){!a&&o&&Rg(r,i,n,o);for(var h=r,c,d;r.prev!==r.next;){if(c=r.prev,d=r.next,o?Lg(r,i,n,o):Eg(r)){t.push(c.i/e|0),t.push(r.i/e|0),t.push(d.i/e|0),cr(r),r=d.next,h=d.next;continue}if(r=d,r===h){a?a===1?(r=bg(Hi(r),t,e),lr(r,t,e,i,n,o,2)):a===2&&Tg(r,t,e,i,n,o):lr(Hi(r),t,e,i,n,o,1);break}}}}function Eg(r){var t=r.prev,e=r,i=r.next;if(Pt(t,e,i)>=0)return!1;for(var n=t.x,o=e.x,a=i.x,h=t.y,c=e.y,d=i.y,f=n<o?n<a?n:a:o<a?o:a,p=h<c?h<d?h:d:c<d?c:d,m=n>o?n>a?n:a:o>a?o:a,y=h>c?h>d?h:d:c>d?c:d,v=i.next;v!==t;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=y&&yn(n,h,o,c,a,d,v.x,v.y)&&Pt(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function Lg(r,t,e,i){var n=r.prev,o=r,a=r.next;if(Pt(n,o,a)>=0)return!1;for(var h=n.x,c=o.x,d=a.x,f=n.y,p=o.y,m=a.y,y=h<c?h<d?h:d:c<d?c:d,v=f<p?f<m?f:m:p<m?p:m,E=h>c?h>d?h:d:c>d?c:d,C=f>p?f>m?f:m:p>m?p:m,S=na(y,v,t,e,i),w=na(E,C,t,e,i),b=r.prevZ,T=r.nextZ;b&&b.z>=S&&T&&T.z<=w;){if(b.x>=y&&b.x<=E&&b.y>=v&&b.y<=C&&b!==n&&b!==a&&yn(h,f,c,p,d,m,b.x,b.y)&&Pt(b.prev,b,b.next)>=0||(b=b.prevZ,T.x>=y&&T.x<=E&&T.y>=v&&T.y<=C&&T!==n&&T!==a&&yn(h,f,c,p,d,m,T.x,T.y)&&Pt(T.prev,T,T.next)>=0))return!1;T=T.nextZ}for(;b&&b.z>=S;){if(b.x>=y&&b.x<=E&&b.y>=v&&b.y<=C&&b!==n&&b!==a&&yn(h,f,c,p,d,m,b.x,b.y)&&Pt(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;T&&T.z<=w;){if(T.x>=y&&T.x<=E&&T.y>=v&&T.y<=C&&T!==n&&T!==a&&yn(h,f,c,p,d,m,T.x,T.y)&&Pt(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function bg(r,t,e){var i=r;do{var n=i.prev,o=i.next.next;!cs(n,o)&&Fh(n,i,i.next,o)&&hr(n,o)&&hr(o,n)&&(t.push(n.i/e|0),t.push(i.i/e|0),t.push(o.i/e|0),cr(i),cr(i.next),i=r=o),i=i.next}while(i!==r);return Hi(i)}function Tg(r,t,e,i,n,o){var a=r;do{for(var h=a.next.next;h!==a.prev;){if(a.i!==h.i&&Dg(a,h)){var c=zh(a,h);a=Hi(a,a.next),c=Hi(c,c.next),lr(a,t,e,i,n,o,0),lr(c,t,e,i,n,o,0);return}h=h.next}a=a.next}while(a!==r)}function Cg(r,t,e,i){var n=[],o,a,h,c,d;for(o=0,a=t.length;o<a;o++)h=t[o]*i,c=o<a-1?t[o+1]*i:r.length,d=Oh(r,h,c,i,!1),d===d.next&&(d.steiner=!0),n.push(Ig(d));for(n.sort(Mg),o=0;o<n.length;o++)e=Sg(n[o],e);return e}function Mg(r,t){return r.x-t.x}function Sg(r,t){var e=Pg(r,t);if(!e)return t;var i=zh(e,r);return Hi(i,i.next),Hi(e,e.next)}function Pg(r,t){var e=t,i=r.x,n=r.y,o=-1/0,a;do{if(n<=e.y&&n>=e.next.y&&e.next.y!==e.y){var h=e.x+(n-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=i&&h>o&&(o=h,a=e.x<e.next.x?e:e.next,h===i))return a}e=e.next}while(e!==t);if(!a)return null;var c=a,d=a.x,f=a.y,p=1/0,m;e=a;do i>=e.x&&e.x>=d&&i!==e.x&&yn(n<f?i:o,n,d,f,n<f?o:i,n,e.x,e.y)&&(m=Math.abs(n-e.y)/(i-e.x),hr(e,r)&&(m<p||m===p&&(e.x>a.x||e.x===a.x&&kg(a,e)))&&(a=e,p=m)),e=e.next;while(e!==c);return a}function kg(r,t){return Pt(r.prev,r,t.prev)<0&&Pt(t.next,r,r.next)<0}function Rg(r,t,e,i){var n=r;do n.z===0&&(n.z=na(n.x,n.y,t,e,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==r);n.prevZ.nextZ=null,n.prevZ=null,Ag(n)}function Ag(r){var t,e,i,n,o,a,h,c,d=1;do{for(e=r,r=null,o=null,a=0;e;){for(a++,i=e,h=0,t=0;t<d&&(h++,i=i.nextZ,!!i);t++);for(c=d;h>0||c>0&&i;)h!==0&&(c===0||!i||e.z<=i.z)?(n=e,e=e.nextZ,h--):(n=i,i=i.nextZ,c--),o?o.nextZ=n:r=n,n.prevZ=o,o=n;e=i}o.nextZ=null,d*=2}while(a>1);return r}function na(r,t,e,i,n){return r=(r-e)*n|0,t=(t-i)*n|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function Ig(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function yn(r,t,e,i,n,o,a,h){return(n-a)*(t-h)>=(r-a)*(o-h)&&(r-a)*(i-h)>=(e-a)*(t-h)&&(e-a)*(o-h)>=(n-a)*(i-h)}function Dg(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!Og(r,t)&&(hr(r,t)&&hr(t,r)&&Fg(r,t)&&(Pt(r.prev,r,t.prev)||Pt(r,t.prev,t))||cs(r,t)&&Pt(r.prev,r,r.next)>0&&Pt(t.prev,t,t.next)>0)}function Pt(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function cs(r,t){return r.x===t.x&&r.y===t.y}function Fh(r,t,e,i){var n=ds(Pt(r,t,e)),o=ds(Pt(r,t,i)),a=ds(Pt(e,i,r)),h=ds(Pt(e,i,t));return!!(n!==o&&a!==h||n===0&&us(r,e,t)||o===0&&us(r,i,t)||a===0&&us(e,r,i)||h===0&&us(e,t,i))}function us(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function ds(r){return r>0?1:r<0?-1:0}function Og(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Fh(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function hr(r,t){return Pt(r.prev,r,r.next)<0?Pt(r,t,r.next)>=0&&Pt(r,r.prev,t)>=0:Pt(r,t,r.prev)<0||Pt(r,r.next,t)<0}function Fg(r,t){var e=r,i=!1,n=(r.x+t.x)/2,o=(r.y+t.y)/2;do e.y>o!=e.next.y>o&&e.next.y!==e.y&&n<(e.next.x-e.x)*(o-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==r);return i}function zh(r,t){var e=new ra(r.i,r.x,r.y),i=new ra(t.i,t.x,t.y),n=r.next,o=t.prev;return r.next=t,t.prev=r,e.next=n,n.prev=e,i.next=e,e.prev=i,o.next=i,i.prev=o,i}function Nh(r,t,e,i){var n=new ra(r,t,e);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function cr(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function ra(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}hs.deviation=function(r,t,e,i){var n=t&&t.length,o=n?t[0]*e:r.length,a=Math.abs(sa(r,0,o,e));if(n)for(var h=0,c=t.length;h<c;h++){var d=t[h]*e,f=h<c-1?t[h+1]*e:r.length;a-=Math.abs(sa(r,d,f,e))}var p=0;for(h=0;h<i.length;h+=3){var m=i[h]*e,y=i[h+1]*e,v=i[h+2]*e;p+=Math.abs((r[m]-r[v])*(r[y+1]-r[m+1])-(r[m]-r[y])*(r[v+1]-r[m+1]))}return a===0&&p===0?0:Math.abs((p-a)/a)};function sa(r,t,e,i){for(var n=0,o=t,a=e-i;o<e;o+=i)n+=(r[a]-r[o])*(r[o+1]+r[a+1]),a=o;return n}hs.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},i=0,n=0;n<r.length;n++){for(var o=0;o<r[n].length;o++)for(var a=0;a<t;a++)e.vertices.push(r[n][o][a]);n>0&&(i+=r[n-1].length,e.holes.push(i))}return e};const AL="";var zg={exports:{}};const Bh=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],Je=(()=>{if(typeof document>"u")return!1;const r=Bh[0],t={};for(const e of Bh)if((e==null?void 0:e[1])in document){for(const[n,o]of e.entries())t[r[n]]=o;return t}return!1})(),Gh={change:Je.fullscreenchange,error:Je.fullscreenerror};let fe={request(r=document.documentElement,t){return new Promise((e,i)=>{const n=()=>{fe.off("change",n),e()};fe.on("change",n);const o=r[Je.requestFullscreen](t);o instanceof Promise&&o.then(n).catch(i)})},exit(){return new Promise((r,t)=>{if(!fe.isFullscreen){r();return}const e=()=>{fe.off("change",e),r()};fe.on("change",e);const i=document[Je.exitFullscreen]();i instanceof Promise&&i.then(e).catch(t)})},toggle(r,t){return fe.isFullscreen?fe.exit():fe.request(r,t)},onchange(r){fe.on("change",r)},onerror(r){fe.on("error",r)},on(r,t){const e=Gh[r];e&&document.addEventListener(e,t,!1)},off(r,t){const e=Gh[r];e&&document.removeEventListener(e,t,!1)},raw:Je};Object.defineProperties(fe,{isFullscreen:{get:()=>!!document[Je.fullscreenElement]},element:{enumerable:!0,get:()=>document[Je.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>!!document[Je.fullscreenEnabled]}}),Je||(fe={isEnabled:!1});const Ng=vh(Object.freeze(Object.defineProperty({__proto__:null,default:fe},Symbol.toStringTag,{value:"Module"})));/*!
|
|
4
|
+
*/(function(r,t){(function(e,i){i(t)})(ri,function(e){var i="1.9.4";function n(o){var l,u,g,m;for(u=1,g=arguments.length;u<g;u++){m=arguments[u];for(l in m)o[l]=m[l]}return o}var s=Object.create||function(){function o(){}return function(l){return o.prototype=l,new o}}();function a(o,l){var u=Array.prototype.slice;if(o.bind)return o.bind.apply(o,u.call(arguments,1));var g=u.call(arguments,2);return function(){return o.apply(l,g.length?g.concat(u.call(arguments)):arguments)}}var h=0;function c(o){return"_leaflet_id"in o||(o._leaflet_id=++h),o._leaflet_id}function d(o,l,u){var g,m,x,S;return S=function(){g=!1,m&&(x.apply(u,m),m=!1)},x=function(){g?m=arguments:(o.apply(u,arguments),setTimeout(S,l),g=!0)},x}function f(o,l,u){var g=l[1],m=l[0],x=g-m;return o===g&&u?o:((o-m)%x+x)%x+m}function p(){return!1}function _(o,l){if(l===!1)return o;var u=Math.pow(10,l===void 0?6:l);return Math.round(o*u)/u}function y(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function v(o){return y(o).split(/\s+/)}function w(o,l){Object.prototype.hasOwnProperty.call(o,"options")||(o.options=o.options?s(o.options):{});for(var u in l)o.options[u]=l[u];return o.options}function T(o,l,u){var g=[];for(var m in o)g.push(encodeURIComponent(u?m.toUpperCase():m)+"="+encodeURIComponent(o[m]));return(!l||l.indexOf("?")===-1?"?":"&")+g.join("&")}var M=/\{ *([\w_ -]+) *\}/g;function E(o,l){return o.replace(M,function(u,g){var m=l[g];if(m===void 0)throw new Error("No value provided for variable "+u);return typeof m=="function"&&(m=m(l)),m})}var b=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"};function C(o,l){for(var u=0;u<o.length;u++)if(o[u]===l)return u;return-1}var P="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function R(o){return window["webkit"+o]||window["moz"+o]||window["ms"+o]}var D=0;function O(o){var l=+new Date,u=Math.max(0,16-(l-D));return D=l+u,window.setTimeout(o,u)}var G=window.requestAnimationFrame||R("RequestAnimationFrame")||O,X=window.cancelAnimationFrame||R("CancelAnimationFrame")||R("CancelRequestAnimationFrame")||function(o){window.clearTimeout(o)};function Y(o,l,u){if(u&&G===O)o.call(l);else return G.call(window,a(o,l))}function q(o){o&&X.call(window,o)}var st={__proto__:null,extend:n,create:s,bind:a,get lastId(){return h},stamp:c,throttle:d,wrapNum:f,falseFn:p,formatNum:_,trim:y,splitWords:v,setOptions:w,getParamString:T,template:E,isArray:b,indexOf:C,emptyImageUrl:P,requestFn:G,cancelFn:X,requestAnimFrame:Y,cancelAnimFrame:q};function _t(){}_t.extend=function(o){var l=function(){w(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},u=l.__super__=this.prototype,g=s(u);g.constructor=l,l.prototype=g;for(var m in this)Object.prototype.hasOwnProperty.call(this,m)&&m!=="prototype"&&m!=="__super__"&&(l[m]=this[m]);return o.statics&&n(l,o.statics),o.includes&&(V(o.includes),n.apply(null,[g].concat(o.includes))),n(g,o),delete g.statics,delete g.includes,g.options&&(g.options=u.options?s(u.options):{},n(g.options,o.options)),g._initHooks=[],g.callInitHooks=function(){if(!this._initHooksCalled){u.callInitHooks&&u.callInitHooks.call(this),this._initHooksCalled=!0;for(var x=0,S=g._initHooks.length;x<S;x++)g._initHooks[x].call(this)}},l},_t.include=function(o){var l=this.prototype.options;return n(this.prototype,o),o.options&&(this.prototype.options=l,this.mergeOptions(o.options)),this},_t.mergeOptions=function(o){return n(this.prototype.options,o),this},_t.addInitHook=function(o){var l=Array.prototype.slice.call(arguments,1),u=typeof o=="function"?o:function(){this[o].apply(this,l)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(u),this};function V(o){if(!(typeof L>"u"||!L||!L.Mixin)){o=b(o)?o:[o];for(var l=0;l<o.length;l++)o[l]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var H={on:function(o,l,u){if(typeof o=="object")for(var g in o)this._on(g,o[g],l);else{o=v(o);for(var m=0,x=o.length;m<x;m++)this._on(o[m],l,u)}return this},off:function(o,l,u){if(!arguments.length)delete this._events;else if(typeof o=="object")for(var g in o)this._off(g,o[g],l);else{o=v(o);for(var m=arguments.length===1,x=0,S=o.length;x<S;x++)m?this._off(o[x]):this._off(o[x],l,u)}return this},_on:function(o,l,u,g){if(typeof l!="function"){console.warn("wrong listener type: "+typeof l);return}if(this._listens(o,l,u)===!1){u===this&&(u=void 0);var m={fn:l,ctx:u};g&&(m.once=!0),this._events=this._events||{},this._events[o]=this._events[o]||[],this._events[o].push(m)}},_off:function(o,l,u){var g,m,x;if(this._events&&(g=this._events[o],!!g)){if(arguments.length===1){if(this._firingCount)for(m=0,x=g.length;m<x;m++)g[m].fn=p;delete this._events[o];return}if(typeof l!="function"){console.warn("wrong listener type: "+typeof l);return}var S=this._listens(o,l,u);if(S!==!1){var k=g[S];this._firingCount&&(k.fn=p,this._events[o]=g=g.slice()),g.splice(S,1)}}},fire:function(o,l,u){if(!this.listens(o,u))return this;var g=n({},l,{type:o,target:this,sourceTarget:l&&l.sourceTarget||this});if(this._events){var m=this._events[o];if(m){this._firingCount=this._firingCount+1||1;for(var x=0,S=m.length;x<S;x++){var k=m[x],A=k.fn;k.once&&this.off(o,A,k.ctx),A.call(k.ctx||this,g)}this._firingCount--}}return u&&this._propagateEvent(g),this},listens:function(o,l,u,g){typeof o!="string"&&console.warn('"string" type argument expected');var m=l;typeof l!="function"&&(g=!!l,m=void 0,u=void 0);var x=this._events&&this._events[o];if(x&&x.length&&this._listens(o,m,u)!==!1)return!0;if(g){for(var S in this._eventParents)if(this._eventParents[S].listens(o,l,u,g))return!0}return!1},_listens:function(o,l,u){if(!this._events)return!1;var g=this._events[o]||[];if(!l)return!!g.length;u===this&&(u=void 0);for(var m=0,x=g.length;m<x;m++)if(g[m].fn===l&&g[m].ctx===u)return m;return!1},once:function(o,l,u){if(typeof o=="object")for(var g in o)this._on(g,o[g],l,!0);else{o=v(o);for(var m=0,x=o.length;m<x;m++)this._on(o[m],l,u,!0)}return this},addEventParent:function(o){return this._eventParents=this._eventParents||{},this._eventParents[c(o)]=o,this},removeEventParent:function(o){return this._eventParents&&delete this._eventParents[c(o)],this},_propagateEvent:function(o){for(var l in this._eventParents)this._eventParents[l].fire(o.type,n({layer:o.target,propagatedFrom:o.target},o),!0)}};H.addEventListener=H.on,H.removeEventListener=H.clearAllEventListeners=H.off,H.addOneTimeEventListener=H.once,H.fireEvent=H.fire,H.hasEventListeners=H.listens;var j=_t.extend(H);function B(o,l,u){this.x=u?Math.round(o):o,this.y=u?Math.round(l):l}var Lt=Math.trunc||function(o){return o>0?Math.floor(o):Math.ceil(o)};B.prototype={clone:function(){return new B(this.x,this.y)},add:function(o){return this.clone()._add(Z(o))},_add:function(o){return this.x+=o.x,this.y+=o.y,this},subtract:function(o){return this.clone()._subtract(Z(o))},_subtract:function(o){return this.x-=o.x,this.y-=o.y,this},divideBy:function(o){return this.clone()._divideBy(o)},_divideBy:function(o){return this.x/=o,this.y/=o,this},multiplyBy:function(o){return this.clone()._multiplyBy(o)},_multiplyBy:function(o){return this.x*=o,this.y*=o,this},scaleBy:function(o){return new B(this.x*o.x,this.y*o.y)},unscaleBy:function(o){return new B(this.x/o.x,this.y/o.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=Lt(this.x),this.y=Lt(this.y),this},distanceTo:function(o){o=Z(o);var l=o.x-this.x,u=o.y-this.y;return Math.sqrt(l*l+u*u)},equals:function(o){return o=Z(o),o.x===this.x&&o.y===this.y},contains:function(o){return o=Z(o),Math.abs(o.x)<=Math.abs(this.x)&&Math.abs(o.y)<=Math.abs(this.y)},toString:function(){return"Point("+_(this.x)+", "+_(this.y)+")"}};function Z(o,l,u){return o instanceof B?o:b(o)?new B(o[0],o[1]):o==null?o:typeof o=="object"&&"x"in o&&"y"in o?new B(o.x,o.y):new B(o,l,u)}function ut(o,l){if(o)for(var u=l?[o,l]:o,g=0,m=u.length;g<m;g++)this.extend(u[g])}ut.prototype={extend:function(o){var l,u;if(!o)return this;if(o instanceof B||typeof o[0]=="number"||"x"in o)l=u=Z(o);else if(o=z(o),l=o.min,u=o.max,!l||!u)return this;return!this.min&&!this.max?(this.min=l.clone(),this.max=u.clone()):(this.min.x=Math.min(l.x,this.min.x),this.max.x=Math.max(u.x,this.max.x),this.min.y=Math.min(l.y,this.min.y),this.max.y=Math.max(u.y,this.max.y)),this},getCenter:function(o){return Z((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,o)},getBottomLeft:function(){return Z(this.min.x,this.max.y)},getTopRight:function(){return Z(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(o){var l,u;return typeof o[0]=="number"||o instanceof B?o=Z(o):o=z(o),o instanceof ut?(l=o.min,u=o.max):l=u=o,l.x>=this.min.x&&u.x<=this.max.x&&l.y>=this.min.y&&u.y<=this.max.y},intersects:function(o){o=z(o);var l=this.min,u=this.max,g=o.min,m=o.max,x=m.x>=l.x&&g.x<=u.x,S=m.y>=l.y&&g.y<=u.y;return x&&S},overlaps:function(o){o=z(o);var l=this.min,u=this.max,g=o.min,m=o.max,x=m.x>l.x&&g.x<u.x,S=m.y>l.y&&g.y<u.y;return x&&S},isValid:function(){return!!(this.min&&this.max)},pad:function(o){var l=this.min,u=this.max,g=Math.abs(l.x-u.x)*o,m=Math.abs(l.y-u.y)*o;return z(Z(l.x-g,l.y-m),Z(u.x+g,u.y+m))},equals:function(o){return o?(o=z(o),this.min.equals(o.getTopLeft())&&this.max.equals(o.getBottomRight())):!1}};function z(o,l){return!o||o instanceof ut?o:new ut(o,l)}function xt(o,l){if(o)for(var u=l?[o,l]:o,g=0,m=u.length;g<m;g++)this.extend(u[g])}xt.prototype={extend:function(o){var l=this._southWest,u=this._northEast,g,m;if(o instanceof tt)g=o,m=o;else if(o instanceof xt){if(g=o._southWest,m=o._northEast,!g||!m)return this}else return o?this.extend(at(o)||$(o)):this;return!l&&!u?(this._southWest=new tt(g.lat,g.lng),this._northEast=new tt(m.lat,m.lng)):(l.lat=Math.min(g.lat,l.lat),l.lng=Math.min(g.lng,l.lng),u.lat=Math.max(m.lat,u.lat),u.lng=Math.max(m.lng,u.lng)),this},pad:function(o){var l=this._southWest,u=this._northEast,g=Math.abs(l.lat-u.lat)*o,m=Math.abs(l.lng-u.lng)*o;return new xt(new tt(l.lat-g,l.lng-m),new tt(u.lat+g,u.lng+m))},getCenter:function(){return new tt((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 tt(this.getNorth(),this.getWest())},getSouthEast:function(){return new tt(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(o){typeof o[0]=="number"||o instanceof tt||"lat"in o?o=at(o):o=$(o);var l=this._southWest,u=this._northEast,g,m;return o instanceof xt?(g=o.getSouthWest(),m=o.getNorthEast()):g=m=o,g.lat>=l.lat&&m.lat<=u.lat&&g.lng>=l.lng&&m.lng<=u.lng},intersects:function(o){o=$(o);var l=this._southWest,u=this._northEast,g=o.getSouthWest(),m=o.getNorthEast(),x=m.lat>=l.lat&&g.lat<=u.lat,S=m.lng>=l.lng&&g.lng<=u.lng;return x&&S},overlaps:function(o){o=$(o);var l=this._southWest,u=this._northEast,g=o.getSouthWest(),m=o.getNorthEast(),x=m.lat>l.lat&&g.lat<u.lat,S=m.lng>l.lng&&g.lng<u.lng;return x&&S},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(o,l){return o?(o=$(o),this._southWest.equals(o.getSouthWest(),l)&&this._northEast.equals(o.getNorthEast(),l)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function $(o,l){return o instanceof xt?o:new xt(o,l)}function tt(o,l,u){if(isNaN(o)||isNaN(l))throw new Error("Invalid LatLng object: ("+o+", "+l+")");this.lat=+o,this.lng=+l,u!==void 0&&(this.alt=+u)}tt.prototype={equals:function(o,l){if(!o)return!1;o=at(o);var u=Math.max(Math.abs(this.lat-o.lat),Math.abs(this.lng-o.lng));return u<=(l===void 0?1e-9:l)},toString:function(o){return"LatLng("+_(this.lat,o)+", "+_(this.lng,o)+")"},distanceTo:function(o){return Xt.distance(this,at(o))},wrap:function(){return Xt.wrapLatLng(this)},toBounds:function(o){var l=180*o/40075017,u=l/Math.cos(Math.PI/180*this.lat);return $([this.lat-l,this.lng-u],[this.lat+l,this.lng+u])},clone:function(){return new tt(this.lat,this.lng,this.alt)}};function at(o,l,u){return o instanceof tt?o:b(o)&&typeof o[0]!="object"?o.length===3?new tt(o[0],o[1],o[2]):o.length===2?new tt(o[0],o[1]):null:o==null?o:typeof o=="object"&&"lat"in o?new tt(o.lat,"lng"in o?o.lng:o.lon,o.alt):l===void 0?null:new tt(o,l,u)}var kt={latLngToPoint:function(o,l){var u=this.projection.project(o),g=this.scale(l);return this.transformation._transform(u,g)},pointToLatLng:function(o,l){var u=this.scale(l),g=this.transformation.untransform(o,u);return this.projection.unproject(g)},project:function(o){return this.projection.project(o)},unproject:function(o){return this.projection.unproject(o)},scale:function(o){return 256*Math.pow(2,o)},zoom:function(o){return Math.log(o/256)/Math.LN2},getProjectedBounds:function(o){if(this.infinite)return null;var l=this.projection.bounds,u=this.scale(o),g=this.transformation.transform(l.min,u),m=this.transformation.transform(l.max,u);return new ut(g,m)},infinite:!1,wrapLatLng:function(o){var l=this.wrapLng?f(o.lng,this.wrapLng,!0):o.lng,u=this.wrapLat?f(o.lat,this.wrapLat,!0):o.lat,g=o.alt;return new tt(u,l,g)},wrapLatLngBounds:function(o){var l=o.getCenter(),u=this.wrapLatLng(l),g=l.lat-u.lat,m=l.lng-u.lng;if(g===0&&m===0)return o;var x=o.getSouthWest(),S=o.getNorthEast(),k=new tt(x.lat-g,x.lng-m),A=new tt(S.lat-g,S.lng-m);return new xt(k,A)}},Xt=n({},kt,{wrapLng:[-180,180],R:6371e3,distance:function(o,l){var u=Math.PI/180,g=o.lat*u,m=l.lat*u,x=Math.sin((l.lat-o.lat)*u/2),S=Math.sin((l.lng-o.lng)*u/2),k=x*x+Math.cos(g)*Math.cos(m)*S*S,A=2*Math.atan2(Math.sqrt(k),Math.sqrt(1-k));return this.R*A}}),Ce=6378137,Je={R:Ce,MAX_LATITUDE:85.0511287798,project:function(o){var l=Math.PI/180,u=this.MAX_LATITUDE,g=Math.max(Math.min(u,o.lat),-u),m=Math.sin(g*l);return new B(this.R*o.lng*l,this.R*Math.log((1+m)/(1-m))/2)},unproject:function(o){var l=180/Math.PI;return new tt((2*Math.atan(Math.exp(o.y/this.R))-Math.PI/2)*l,o.x*l/this.R)},bounds:function(){var o=Ce*Math.PI;return new ut([-o,-o],[o,o])}()};function Xi(o,l,u,g){if(b(o)){this._a=o[0],this._b=o[1],this._c=o[2],this._d=o[3];return}this._a=o,this._b=l,this._c=u,this._d=g}Xi.prototype={transform:function(o,l){return this._transform(o.clone(),l)},_transform:function(o,l){return l=l||1,o.x=l*(this._a*o.x+this._b),o.y=l*(this._c*o.y+this._d),o},untransform:function(o,l){return l=l||1,new B((o.x/l-this._b)/this._a,(o.y/l-this._d)/this._c)}};function Me(o,l,u,g){return new Xi(o,l,u,g)}var Yi=n({},Xt,{code:"EPSG:3857",projection:Je,transformation:function(){var o=.5/(Math.PI*Je.R);return Me(o,.5,-o,.5)}()}),Qe=n({},Yi,{code:"EPSG:900913"});function Ki(o){return document.createElementNS("http://www.w3.org/2000/svg",o)}function Fe(o,l){var u="",g,m,x,S,k,A;for(g=0,x=o.length;g<x;g++){for(k=o[g],m=0,S=k.length;m<S;m++)A=k[m],u+=(m?"L":"M")+A.x+" "+A.y;u+=l?K.svg?"z":"x":""}return u||"M0 0"}var qi=document.documentElement.style,wi="ActiveXObject"in window,or=wi&&!document.addEventListener,Ei="msLaunchUri"in navigator&&!("documentMode"in document),En=Bt("webkit"),qt=Bt("android"),ae=Bt("android 2")||Bt("android 3"),be=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),ze=qt&&Bt("Google")&&be<537&&!("AudioNode"in window),$e=!!window.opera,ti=!Ei&&Bt("chrome"),Ne=Bt("gecko")&&!En&&!$e&&!wi,Ji=!ti&&Bt("safari"),Ln=Bt("phantom"),Yt="OTransition"in qi,rs=navigator.platform.indexOf("Win")===0,Yo=wi&&"transition"in qi,ss="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ae,os="MozPerspective"in qi,Ko=!window.L_DISABLE_3D&&(Yo||ss||os)&&!Yt&&!Ln,Li=typeof orientation<"u"||Bt("mobile"),qo=Li&&En,as=Li&&ss,Qi=!window.PointerEvent&&window.MSPointerEvent,$i=!!(window.PointerEvent||Qi),tn="ontouchstart"in window||!!window.TouchEvent,Jo=!window.L_NO_TOUCH&&(tn||$i),Qo=Li&&$e,le=Li&&Ne,en=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,pe=function(){var o=!1;try{var l=Object.defineProperty({},"passive",{get:function(){o=!0}});window.addEventListener("testPassiveEventSupport",p,l),window.removeEventListener("testPassiveEventSupport",p,l)}catch{}return o}(),Be=function(){return!!document.createElement("canvas").getContext}(),Jt=!!(document.createElementNS&&Ki("svg").createSVGRect),ar=!!Jt&&function(){var o=document.createElement("div");return o.innerHTML="<svg/>",(o.firstChild&&o.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),lr=!Jt&&function(){try{var o=document.createElement("div");o.innerHTML='<v:shape adj="1"/>';var l=o.firstChild;return l.style.behavior="url(#default#VML)",l&&typeof l.adj=="object"}catch{return!1}}(),se=navigator.platform.indexOf("Mac")===0,_e=navigator.platform.indexOf("Linux")===0;function Bt(o){return navigator.userAgent.toLowerCase().indexOf(o)>=0}var K={ie:wi,ielt9:or,edge:Ei,webkit:En,android:qt,android23:ae,androidStock:ze,opera:$e,chrome:ti,gecko:Ne,safari:Ji,phantom:Ln,opera12:Yt,win:rs,ie3d:Yo,webkit3d:ss,gecko3d:os,any3d:Ko,mobile:Li,mobileWebkit:qo,mobileWebkit3d:as,msPointer:Qi,pointer:$i,touch:Jo,touchNative:tn,mobileOpera:Qo,mobileGecko:le,retina:en,passiveEvents:pe,canvas:Be,svg:Jt,vml:lr,inlineSvg:ar,mac:se,linux:_e},Af=K.msPointer?"MSPointerDown":"pointerdown",If=K.msPointer?"MSPointerMove":"pointermove",Df=K.msPointer?"MSPointerUp":"pointerup",Of=K.msPointer?"MSPointerCancel":"pointercancel",mh={touchstart:Af,touchmove:If,touchend:Df,touchcancel:Of},Ff={touchstart:hL,touchmove:$o,touchend:$o,touchcancel:$o},hr={},zf=!1;function rL(o,l,u){return l==="touchstart"&&lL(),Ff[l]?(u=Ff[l].bind(this,u),o.addEventListener(mh[l],u,!1),u):(console.warn("wrong event specified:",l),p)}function sL(o,l,u){if(!mh[l]){console.warn("wrong event specified:",l);return}o.removeEventListener(mh[l],u,!1)}function oL(o){hr[o.pointerId]=o}function aL(o){hr[o.pointerId]&&(hr[o.pointerId]=o)}function Nf(o){delete hr[o.pointerId]}function lL(){zf||(document.addEventListener(Af,oL,!0),document.addEventListener(If,aL,!0),document.addEventListener(Df,Nf,!0),document.addEventListener(Of,Nf,!0),zf=!0)}function $o(o,l){if(l.pointerType!==(l.MSPOINTER_TYPE_MOUSE||"mouse")){l.touches=[];for(var u in hr)l.touches.push(hr[u]);l.changedTouches=[l],o(l)}}function hL(o,l){l.MSPOINTER_TYPE_TOUCH&&l.pointerType===l.MSPOINTER_TYPE_TOUCH&&Qt(l),$o(o,l)}function cL(o){var l={},u,g;for(g in o)u=o[g],l[g]=u&&u.bind?u.bind(o):u;return o=l,l.type="dblclick",l.detail=2,l.isTrusted=!1,l._simulated=!0,l}var uL=200;function dL(o,l){o.addEventListener("dblclick",l);var u=0,g;function m(x){if(x.detail!==1){g=x.detail;return}if(!(x.pointerType==="mouse"||x.sourceCapabilities&&!x.sourceCapabilities.firesTouchEvents)){var S=Zf(x);if(!(S.some(function(A){return A instanceof HTMLLabelElement&&A.attributes.for})&&!S.some(function(A){return A instanceof HTMLInputElement||A instanceof HTMLSelectElement}))){var k=Date.now();k-u<=uL?(g++,g===2&&l(cL(x))):g=1,u=k}}}return o.addEventListener("click",m),{dblclick:l,simDblclick:m}}function fL(o,l){o.removeEventListener("dblclick",l.dblclick),o.removeEventListener("click",l.simDblclick)}var yh=ia(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ls=ia(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Bf=ls==="webkitTransition"||ls==="OTransition"?ls+"End":"transitionend";function Gf(o){return typeof o=="string"?document.getElementById(o):o}function hs(o,l){var u=o.style[l]||o.currentStyle&&o.currentStyle[l];if((!u||u==="auto")&&document.defaultView){var g=document.defaultView.getComputedStyle(o,null);u=g?g[l]:null}return u==="auto"?null:u}function wt(o,l,u){var g=document.createElement(o);return g.className=l||"",u&&u.appendChild(g),g}function At(o){var l=o.parentNode;l&&l.removeChild(o)}function ta(o){for(;o.firstChild;)o.removeChild(o.firstChild)}function cr(o){var l=o.parentNode;l&&l.lastChild!==o&&l.appendChild(o)}function ur(o){var l=o.parentNode;l&&l.firstChild!==o&&l.insertBefore(o,l.firstChild)}function vh(o,l){if(o.classList!==void 0)return o.classList.contains(l);var u=ea(o);return u.length>0&&new RegExp("(^|\\s)"+l+"(\\s|$)").test(u)}function dt(o,l){if(o.classList!==void 0)for(var u=v(l),g=0,m=u.length;g<m;g++)o.classList.add(u[g]);else if(!vh(o,l)){var x=ea(o);xh(o,(x?x+" ":"")+l)}}function Ft(o,l){o.classList!==void 0?o.classList.remove(l):xh(o,y((" "+ea(o)+" ").replace(" "+l+" "," ")))}function xh(o,l){o.className.baseVal===void 0?o.className=l:o.className.baseVal=l}function ea(o){return o.correspondingElement&&(o=o.correspondingElement),o.className.baseVal===void 0?o.className:o.className.baseVal}function Se(o,l){"opacity"in o.style?o.style.opacity=l:"filter"in o.style&&gL(o,l)}function gL(o,l){var u=!1,g="DXImageTransform.Microsoft.Alpha";try{u=o.filters.item(g)}catch{if(l===1)return}l=Math.round(l*100),u?(u.Enabled=l!==100,u.Opacity=l):o.style.filter+=" progid:"+g+"(opacity="+l+")"}function ia(o){for(var l=document.documentElement.style,u=0;u<o.length;u++)if(o[u]in l)return o[u];return!1}function bn(o,l,u){var g=l||new B(0,0);o.style[yh]=(K.ie3d?"translate("+g.x+"px,"+g.y+"px)":"translate3d("+g.x+"px,"+g.y+"px,0)")+(u?" scale("+u+")":"")}function Gt(o,l){o._leaflet_pos=l,K.any3d?bn(o,l):(o.style.left=l.x+"px",o.style.top=l.y+"px")}function Tn(o){return o._leaflet_pos||new B(0,0)}var cs,us,wh;if("onselectstart"in document)cs=function(){ht(window,"selectstart",Qt)},us=function(){Pt(window,"selectstart",Qt)};else{var ds=ia(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);cs=function(){if(ds){var o=document.documentElement.style;wh=o[ds],o[ds]="none"}},us=function(){ds&&(document.documentElement.style[ds]=wh,wh=void 0)}}function Eh(){ht(window,"dragstart",Qt)}function Lh(){Pt(window,"dragstart",Qt)}var na,bh;function Th(o){for(;o.tabIndex===-1;)o=o.parentNode;o.style&&(ra(),na=o,bh=o.style.outlineStyle,o.style.outlineStyle="none",ht(window,"keydown",ra))}function ra(){na&&(na.style.outlineStyle=bh,na=void 0,bh=void 0,Pt(window,"keydown",ra))}function Uf(o){do o=o.parentNode;while((!o.offsetWidth||!o.offsetHeight)&&o!==document.body);return o}function Ch(o){var l=o.getBoundingClientRect();return{x:l.width/o.offsetWidth||1,y:l.height/o.offsetHeight||1,boundingClientRect:l}}var pL={__proto__:null,TRANSFORM:yh,TRANSITION:ls,TRANSITION_END:Bf,get:Gf,getStyle:hs,create:wt,remove:At,empty:ta,toFront:cr,toBack:ur,hasClass:vh,addClass:dt,removeClass:Ft,setClass:xh,getClass:ea,setOpacity:Se,testProp:ia,setTransform:bn,setPosition:Gt,getPosition:Tn,get disableTextSelection(){return cs},get enableTextSelection(){return us},disableImageDrag:Eh,enableImageDrag:Lh,preventOutline:Th,restoreOutline:ra,getSizedParentNode:Uf,getScale:Ch};function ht(o,l,u,g){if(l&&typeof l=="object")for(var m in l)Sh(o,m,l[m],u);else{l=v(l);for(var x=0,S=l.length;x<S;x++)Sh(o,l[x],u,g)}return this}var ei="_leaflet_events";function Pt(o,l,u,g){if(arguments.length===1)jf(o),delete o[ei];else if(l&&typeof l=="object")for(var m in l)Ph(o,m,l[m],u);else if(l=v(l),arguments.length===2)jf(o,function(k){return C(l,k)!==-1});else for(var x=0,S=l.length;x<S;x++)Ph(o,l[x],u,g);return this}function jf(o,l){for(var u in o[ei]){var g=u.split(/\d/)[0];(!l||l(g))&&Ph(o,g,null,null,u)}}var Mh={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Sh(o,l,u,g){var m=l+c(u)+(g?"_"+c(g):"");if(o[ei]&&o[ei][m])return this;var x=function(k){return u.call(g||o,k||window.event)},S=x;!K.touchNative&&K.pointer&&l.indexOf("touch")===0?x=rL(o,l,x):K.touch&&l==="dblclick"?x=dL(o,x):"addEventListener"in o?l==="touchstart"||l==="touchmove"||l==="wheel"||l==="mousewheel"?o.addEventListener(Mh[l]||l,x,K.passiveEvents?{passive:!1}:!1):l==="mouseenter"||l==="mouseleave"?(x=function(k){k=k||window.event,Rh(o,k)&&S(k)},o.addEventListener(Mh[l],x,!1)):o.addEventListener(l,S,!1):o.attachEvent("on"+l,x),o[ei]=o[ei]||{},o[ei][m]=x}function Ph(o,l,u,g,m){m=m||l+c(u)+(g?"_"+c(g):"");var x=o[ei]&&o[ei][m];if(!x)return this;!K.touchNative&&K.pointer&&l.indexOf("touch")===0?sL(o,l,x):K.touch&&l==="dblclick"?fL(o,x):"removeEventListener"in o?o.removeEventListener(Mh[l]||l,x,!1):o.detachEvent("on"+l,x),o[ei][m]=null}function Cn(o){return o.stopPropagation?o.stopPropagation():o.originalEvent?o.originalEvent._stopped=!0:o.cancelBubble=!0,this}function kh(o){return Sh(o,"wheel",Cn),this}function fs(o){return ht(o,"mousedown touchstart dblclick contextmenu",Cn),o._leaflet_disable_click=!0,this}function Qt(o){return o.preventDefault?o.preventDefault():o.returnValue=!1,this}function Mn(o){return Qt(o),Cn(o),this}function Zf(o){if(o.composedPath)return o.composedPath();for(var l=[],u=o.target;u;)l.push(u),u=u.parentNode;return l}function Wf(o,l){if(!l)return new B(o.clientX,o.clientY);var u=Ch(l),g=u.boundingClientRect;return new B((o.clientX-g.left)/u.x-l.clientLeft,(o.clientY-g.top)/u.y-l.clientTop)}var _L=K.linux&&K.chrome?window.devicePixelRatio:K.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Hf(o){return K.edge?o.wheelDeltaY/2:o.deltaY&&o.deltaMode===0?-o.deltaY/_L:o.deltaY&&o.deltaMode===1?-o.deltaY*20:o.deltaY&&o.deltaMode===2?-o.deltaY*60:o.deltaX||o.deltaZ?0:o.wheelDelta?(o.wheelDeltaY||o.wheelDelta)/2:o.detail&&Math.abs(o.detail)<32765?-o.detail*20:o.detail?o.detail/-32765*60:0}function Rh(o,l){var u=l.relatedTarget;if(!u)return!0;try{for(;u&&u!==o;)u=u.parentNode}catch{return!1}return u!==o}var mL={__proto__:null,on:ht,off:Pt,stopPropagation:Cn,disableScrollPropagation:kh,disableClickPropagation:fs,preventDefault:Qt,stop:Mn,getPropagationPath:Zf,getMousePosition:Wf,getWheelDelta:Hf,isExternalTarget:Rh,addListener:ht,removeListener:Pt},Vf=j.extend({run:function(o,l,u,g){this.stop(),this._el=o,this._inProgress=!0,this._duration=u||.25,this._easeOutPower=1/Math.max(g||.5,.2),this._startPos=Tn(o),this._offset=l.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=Y(this._animate,this),this._step()},_step:function(o){var l=+new Date-this._startTime,u=this._duration*1e3;l<u?this._runFrame(this._easeOut(l/u),o):(this._runFrame(1),this._complete())},_runFrame:function(o,l){var u=this._startPos.add(this._offset.multiplyBy(o));l&&u._round(),Gt(this._el,u),this.fire("step")},_complete:function(){q(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(o){return 1-Math.pow(1-o,this._easeOutPower)}}),yt=j.extend({options:{crs:Yi,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(o,l){l=w(this,l),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(o),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),l.maxBounds&&this.setMaxBounds(l.maxBounds),l.zoom!==void 0&&(this._zoom=this._limitZoom(l.zoom)),l.center&&l.zoom!==void 0&&this.setView(at(l.center),l.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ls&&K.any3d&&!K.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ht(this._proxy,Bf,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(o,l,u){if(l=l===void 0?this._zoom:this._limitZoom(l),o=this._limitCenter(at(o),l,this.options.maxBounds),u=u||{},this._stop(),this._loaded&&!u.reset&&u!==!0){u.animate!==void 0&&(u.zoom=n({animate:u.animate},u.zoom),u.pan=n({animate:u.animate,duration:u.duration},u.pan));var g=this._zoom!==l?this._tryAnimatedZoom&&this._tryAnimatedZoom(o,l,u.zoom):this._tryAnimatedPan(o,u.pan);if(g)return clearTimeout(this._sizeTimer),this}return this._resetView(o,l,u.pan&&u.pan.noMoveStart),this},setZoom:function(o,l){return this._loaded?this.setView(this.getCenter(),o,{zoom:l}):(this._zoom=o,this)},zoomIn:function(o,l){return o=o||(K.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+o,l)},zoomOut:function(o,l){return o=o||(K.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-o,l)},setZoomAround:function(o,l,u){var g=this.getZoomScale(l),m=this.getSize().divideBy(2),x=o instanceof B?o:this.latLngToContainerPoint(o),S=x.subtract(m).multiplyBy(1-1/g),k=this.containerPointToLatLng(m.add(S));return this.setView(k,l,{zoom:u})},_getBoundsCenterZoom:function(o,l){l=l||{},o=o.getBounds?o.getBounds():$(o);var u=Z(l.paddingTopLeft||l.padding||[0,0]),g=Z(l.paddingBottomRight||l.padding||[0,0]),m=this.getBoundsZoom(o,!1,u.add(g));if(m=typeof l.maxZoom=="number"?Math.min(l.maxZoom,m):m,m===1/0)return{center:o.getCenter(),zoom:m};var x=g.subtract(u).divideBy(2),S=this.project(o.getSouthWest(),m),k=this.project(o.getNorthEast(),m),A=this.unproject(S.add(k).divideBy(2).add(x),m);return{center:A,zoom:m}},fitBounds:function(o,l){if(o=$(o),!o.isValid())throw new Error("Bounds are not valid.");var u=this._getBoundsCenterZoom(o,l);return this.setView(u.center,u.zoom,l)},fitWorld:function(o){return this.fitBounds([[-90,-180],[90,180]],o)},panTo:function(o,l){return this.setView(o,this._zoom,{pan:l})},panBy:function(o,l){if(o=Z(o).round(),l=l||{},!o.x&&!o.y)return this.fire("moveend");if(l.animate!==!0&&!this.getSize().contains(o))return this._resetView(this.unproject(this.project(this.getCenter()).add(o)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Vf,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),l.noMoveStart||this.fire("movestart"),l.animate!==!1){dt(this._mapPane,"leaflet-pan-anim");var u=this._getMapPanePos().subtract(o).round();this._panAnim.run(this._mapPane,u,l.duration||.25,l.easeLinearity)}else this._rawPanBy(o),this.fire("move").fire("moveend");return this},flyTo:function(o,l,u){if(u=u||{},u.animate===!1||!K.any3d)return this.setView(o,l,u);this._stop();var g=this.project(this.getCenter()),m=this.project(o),x=this.getSize(),S=this._zoom;o=at(o),l=l===void 0?S:l;var k=Math.max(x.x,x.y),A=k*this.getZoomScale(S,l),N=m.distanceTo(g)||1,W=1.42,nt=W*W;function pt(Ut){var _a=Ut?-1:1,sb=Ut?A:k,ob=A*A-k*k+_a*nt*nt*N*N,ab=2*sb*nt*N,jh=ob/ab,Cg=Math.sqrt(jh*jh+1)-jh,lb=Cg<1e-9?-18:Math.log(Cg);return lb}function he(Ut){return(Math.exp(Ut)-Math.exp(-Ut))/2}function Kt(Ut){return(Math.exp(Ut)+Math.exp(-Ut))/2}function ke(Ut){return he(Ut)/Kt(Ut)}var me=pt(0);function mr(Ut){return k*(Kt(me)/Kt(me+W*Ut))}function eb(Ut){return k*(Kt(me)*ke(me+W*Ut)-he(me))/nt}function ib(Ut){return 1-Math.pow(1-Ut,1.5)}var nb=Date.now(),bg=(pt(1)-me)/W,rb=u.duration?1e3*u.duration:1e3*bg*.8;function Tg(){var Ut=(Date.now()-nb)/rb,_a=ib(Ut)*bg;Ut<=1?(this._flyToFrame=Y(Tg,this),this._move(this.unproject(g.add(m.subtract(g).multiplyBy(eb(_a)/N)),S),this.getScaleZoom(k/mr(_a),S),{flyTo:!0})):this._move(o,l)._moveEnd(!0)}return this._moveStart(!0,u.noMoveStart),Tg.call(this),this},flyToBounds:function(o,l){var u=this._getBoundsCenterZoom(o,l);return this.flyTo(u.center,u.zoom,l)},setMaxBounds:function(o){return o=$(o),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),o.isValid()?(this.options.maxBounds=o,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(o){var l=this.options.minZoom;return this.options.minZoom=o,this._loaded&&l!==o&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(o):this},setMaxZoom:function(o){var l=this.options.maxZoom;return this.options.maxZoom=o,this._loaded&&l!==o&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(o):this},panInsideBounds:function(o,l){this._enforcingBounds=!0;var u=this.getCenter(),g=this._limitCenter(u,this._zoom,$(o));return u.equals(g)||this.panTo(g,l),this._enforcingBounds=!1,this},panInside:function(o,l){l=l||{};var u=Z(l.paddingTopLeft||l.padding||[0,0]),g=Z(l.paddingBottomRight||l.padding||[0,0]),m=this.project(this.getCenter()),x=this.project(o),S=this.getPixelBounds(),k=z([S.min.add(u),S.max.subtract(g)]),A=k.getSize();if(!k.contains(x)){this._enforcingBounds=!0;var N=x.subtract(k.getCenter()),W=k.extend(x).getSize().subtract(A);m.x+=N.x<0?-W.x:W.x,m.y+=N.y<0?-W.y:W.y,this.panTo(this.unproject(m),l),this._enforcingBounds=!1}return this},invalidateSize:function(o){if(!this._loaded)return this;o=n({animate:!1,pan:!0},o===!0?{animate:!0}:o);var l=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var u=this.getSize(),g=l.divideBy(2).round(),m=u.divideBy(2).round(),x=g.subtract(m);return!x.x&&!x.y?this:(o.animate&&o.pan?this.panBy(x):(o.pan&&this._rawPanBy(x),this.fire("move"),o.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:l,newSize:u}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(o){if(o=this._locateOptions=n({timeout:1e4,watch:!1},o),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var l=a(this._handleGeolocationResponse,this),u=a(this._handleGeolocationError,this);return o.watch?this._locationWatchId=navigator.geolocation.watchPosition(l,u,o):navigator.geolocation.getCurrentPosition(l,u,o),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(o){if(this._container._leaflet_id){var l=o.code,u=o.message||(l===1?"permission denied":l===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:l,message:"Geolocation error: "+u+"."})}},_handleGeolocationResponse:function(o){if(this._container._leaflet_id){var l=o.coords.latitude,u=o.coords.longitude,g=new tt(l,u),m=g.toBounds(o.coords.accuracy*2),x=this._locateOptions;if(x.setView){var S=this.getBoundsZoom(m);this.setView(g,x.maxZoom?Math.min(S,x.maxZoom):S)}var k={latlng:g,bounds:m,timestamp:o.timestamp};for(var A in o.coords)typeof o.coords[A]=="number"&&(k[A]=o.coords[A]);this.fire("locationfound",k)}},addHandler:function(o,l){if(!l)return this;var u=this[o]=new l(this);return this._handlers.push(u),this.options[o]&&u.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),At(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(q(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var o;for(o in this._layers)this._layers[o].remove();for(o in this._panes)At(this._panes[o]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(o,l){var u="leaflet-pane"+(o?" leaflet-"+o.replace("Pane","")+"-pane":""),g=wt("div",u,l||this._mapPane);return o&&(this._panes[o]=g),g},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var o=this.getPixelBounds(),l=this.unproject(o.getBottomLeft()),u=this.unproject(o.getTopRight());return new xt(l,u)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(o,l,u){o=$(o),u=Z(u||[0,0]);var g=this.getZoom()||0,m=this.getMinZoom(),x=this.getMaxZoom(),S=o.getNorthWest(),k=o.getSouthEast(),A=this.getSize().subtract(u),N=z(this.project(k,g),this.project(S,g)).getSize(),W=K.any3d?this.options.zoomSnap:1,nt=A.x/N.x,pt=A.y/N.y,he=l?Math.max(nt,pt):Math.min(nt,pt);return g=this.getScaleZoom(he,g),W&&(g=Math.round(g/(W/100))*(W/100),g=l?Math.ceil(g/W)*W:Math.floor(g/W)*W),Math.max(m,Math.min(x,g))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new B(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(o,l){var u=this._getTopLeftPoint(o,l);return new ut(u,u.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(o){return this.options.crs.getProjectedBounds(o===void 0?this.getZoom():o)},getPane:function(o){return typeof o=="string"?this._panes[o]:o},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(o,l){var u=this.options.crs;return l=l===void 0?this._zoom:l,u.scale(o)/u.scale(l)},getScaleZoom:function(o,l){var u=this.options.crs;l=l===void 0?this._zoom:l;var g=u.zoom(o*u.scale(l));return isNaN(g)?1/0:g},project:function(o,l){return l=l===void 0?this._zoom:l,this.options.crs.latLngToPoint(at(o),l)},unproject:function(o,l){return l=l===void 0?this._zoom:l,this.options.crs.pointToLatLng(Z(o),l)},layerPointToLatLng:function(o){var l=Z(o).add(this.getPixelOrigin());return this.unproject(l)},latLngToLayerPoint:function(o){var l=this.project(at(o))._round();return l._subtract(this.getPixelOrigin())},wrapLatLng:function(o){return this.options.crs.wrapLatLng(at(o))},wrapLatLngBounds:function(o){return this.options.crs.wrapLatLngBounds($(o))},distance:function(o,l){return this.options.crs.distance(at(o),at(l))},containerPointToLayerPoint:function(o){return Z(o).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(o){return Z(o).add(this._getMapPanePos())},containerPointToLatLng:function(o){var l=this.containerPointToLayerPoint(Z(o));return this.layerPointToLatLng(l)},latLngToContainerPoint:function(o){return this.layerPointToContainerPoint(this.latLngToLayerPoint(at(o)))},mouseEventToContainerPoint:function(o){return Wf(o,this._container)},mouseEventToLayerPoint:function(o){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(o))},mouseEventToLatLng:function(o){return this.layerPointToLatLng(this.mouseEventToLayerPoint(o))},_initContainer:function(o){var l=this._container=Gf(o);if(l){if(l._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");ht(l,"scroll",this._onScroll,this),this._containerId=c(l)},_initLayout:function(){var o=this._container;this._fadeAnimated=this.options.fadeAnimation&&K.any3d,dt(o,"leaflet-container"+(K.touch?" leaflet-touch":"")+(K.retina?" leaflet-retina":"")+(K.ielt9?" leaflet-oldie":"")+(K.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var l=hs(o,"position");l!=="absolute"&&l!=="relative"&&l!=="fixed"&&l!=="sticky"&&(o.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var o=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Gt(this._mapPane,new B(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(dt(o.markerPane,"leaflet-zoom-hide"),dt(o.shadowPane,"leaflet-zoom-hide"))},_resetView:function(o,l,u){Gt(this._mapPane,new B(0,0));var g=!this._loaded;this._loaded=!0,l=this._limitZoom(l),this.fire("viewprereset");var m=this._zoom!==l;this._moveStart(m,u)._move(o,l)._moveEnd(m),this.fire("viewreset"),g&&this.fire("load")},_moveStart:function(o,l){return o&&this.fire("zoomstart"),l||this.fire("movestart"),this},_move:function(o,l,u,g){l===void 0&&(l=this._zoom);var m=this._zoom!==l;return this._zoom=l,this._lastCenter=o,this._pixelOrigin=this._getNewPixelOrigin(o),g?u&&u.pinch&&this.fire("zoom",u):((m||u&&u.pinch)&&this.fire("zoom",u),this.fire("move",u)),this},_moveEnd:function(o){return o&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return q(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(o){Gt(this._mapPane,this._getMapPanePos().subtract(o))},_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(o){this._targets={},this._targets[c(this._container)]=this;var l=o?Pt:ht;l(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&l(window,"resize",this._onResize,this),K.any3d&&this.options.transform3DLimit&&(o?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){q(this._resizeRequest),this._resizeRequest=Y(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var o=this._getMapPanePos();Math.max(Math.abs(o.x),Math.abs(o.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(o,l){for(var u=[],g,m=l==="mouseout"||l==="mouseover",x=o.target||o.srcElement,S=!1;x;){if(g=this._targets[c(x)],g&&(l==="click"||l==="preclick")&&this._draggableMoved(g)){S=!0;break}if(g&&g.listens(l,!0)&&(m&&!Rh(x,o)||(u.push(g),m))||x===this._container)break;x=x.parentNode}return!u.length&&!S&&!m&&this.listens(l,!0)&&(u=[this]),u},_isClickDisabled:function(o){for(;o&&o!==this._container;){if(o._leaflet_disable_click)return!0;o=o.parentNode}},_handleDOMEvent:function(o){var l=o.target||o.srcElement;if(!(!this._loaded||l._leaflet_disable_events||o.type==="click"&&this._isClickDisabled(l))){var u=o.type;u==="mousedown"&&Th(l),this._fireDOMEvent(o,u)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(o,l,u){if(o.type==="click"){var g=n({},o);g.type="preclick",this._fireDOMEvent(g,g.type,u)}var m=this._findEventTargets(o,l);if(u){for(var x=[],S=0;S<u.length;S++)u[S].listens(l,!0)&&x.push(u[S]);m=x.concat(m)}if(m.length){l==="contextmenu"&&Qt(o);var k=m[0],A={originalEvent:o};if(o.type!=="keypress"&&o.type!=="keydown"&&o.type!=="keyup"){var N=k.getLatLng&&(!k._radius||k._radius<=10);A.containerPoint=N?this.latLngToContainerPoint(k.getLatLng()):this.mouseEventToContainerPoint(o),A.layerPoint=this.containerPointToLayerPoint(A.containerPoint),A.latlng=N?k.getLatLng():this.layerPointToLatLng(A.layerPoint)}for(S=0;S<m.length;S++)if(m[S].fire(l,A,!0),A.originalEvent._stopped||m[S].options.bubblingMouseEvents===!1&&C(this._mouseEvents,l)!==-1)return}},_draggableMoved:function(o){return o=o.dragging&&o.dragging.enabled()?o:this,o.dragging&&o.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var o=0,l=this._handlers.length;o<l;o++)this._handlers[o].disable()},whenReady:function(o,l){return this._loaded?o.call(l||this,{target:this}):this.on("load",o,l),this},_getMapPanePos:function(){return Tn(this._mapPane)||new B(0,0)},_moved:function(){var o=this._getMapPanePos();return o&&!o.equals([0,0])},_getTopLeftPoint:function(o,l){var u=o&&l!==void 0?this._getNewPixelOrigin(o,l):this.getPixelOrigin();return u.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(o,l){var u=this.getSize()._divideBy(2);return this.project(o,l)._subtract(u)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(o,l,u){var g=this._getNewPixelOrigin(u,l);return this.project(o,l)._subtract(g)},_latLngBoundsToNewLayerBounds:function(o,l,u){var g=this._getNewPixelOrigin(u,l);return z([this.project(o.getSouthWest(),l)._subtract(g),this.project(o.getNorthWest(),l)._subtract(g),this.project(o.getSouthEast(),l)._subtract(g),this.project(o.getNorthEast(),l)._subtract(g)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(o){return this.latLngToLayerPoint(o).subtract(this._getCenterLayerPoint())},_limitCenter:function(o,l,u){if(!u)return o;var g=this.project(o,l),m=this.getSize().divideBy(2),x=new ut(g.subtract(m),g.add(m)),S=this._getBoundsOffset(x,u,l);return Math.abs(S.x)<=1&&Math.abs(S.y)<=1?o:this.unproject(g.add(S),l)},_limitOffset:function(o,l){if(!l)return o;var u=this.getPixelBounds(),g=new ut(u.min.add(o),u.max.add(o));return o.add(this._getBoundsOffset(g,l))},_getBoundsOffset:function(o,l,u){var g=z(this.project(l.getNorthEast(),u),this.project(l.getSouthWest(),u)),m=g.min.subtract(o.min),x=g.max.subtract(o.max),S=this._rebound(m.x,-x.x),k=this._rebound(m.y,-x.y);return new B(S,k)},_rebound:function(o,l){return o+l>0?Math.round(o-l)/2:Math.max(0,Math.ceil(o))-Math.max(0,Math.floor(l))},_limitZoom:function(o){var l=this.getMinZoom(),u=this.getMaxZoom(),g=K.any3d?this.options.zoomSnap:1;return g&&(o=Math.round(o/g)*g),Math.max(l,Math.min(u,o))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Ft(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(o,l){var u=this._getCenterOffset(o)._trunc();return(l&&l.animate)!==!0&&!this.getSize().contains(u)?!1:(this.panBy(u,l),!0)},_createAnimProxy:function(){var o=this._proxy=wt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(o),this.on("zoomanim",function(l){var u=yh,g=this._proxy.style[u];bn(this._proxy,this.project(l.center,l.zoom),this.getZoomScale(l.zoom,1)),g===this._proxy.style[u]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){At(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var o=this.getCenter(),l=this.getZoom();bn(this._proxy,this.project(o,l),this.getZoomScale(l,1))},_catchTransitionEnd:function(o){this._animatingZoom&&o.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(o,l,u){if(this._animatingZoom)return!0;if(u=u||{},!this._zoomAnimated||u.animate===!1||this._nothingToAnimate()||Math.abs(l-this._zoom)>this.options.zoomAnimationThreshold)return!1;var g=this.getZoomScale(l),m=this._getCenterOffset(o)._divideBy(1-1/g);return u.animate!==!0&&!this.getSize().contains(m)?!1:(Y(function(){this._moveStart(!0,u.noMoveStart||!1)._animateZoom(o,l,!0)},this),!0)},_animateZoom:function(o,l,u,g){this._mapPane&&(u&&(this._animatingZoom=!0,this._animateToCenter=o,this._animateToZoom=l,dt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:o,zoom:l,noUpdate:g}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Ft(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 yL(o,l){return new yt(o,l)}var Ge=_t.extend({options:{position:"topright"},initialize:function(o){w(this,o)},getPosition:function(){return this.options.position},setPosition:function(o){var l=this._map;return l&&l.removeControl(this),this.options.position=o,l&&l.addControl(this),this},getContainer:function(){return this._container},addTo:function(o){this.remove(),this._map=o;var l=this._container=this.onAdd(o),u=this.getPosition(),g=o._controlCorners[u];return dt(l,"leaflet-control"),u.indexOf("bottom")!==-1?g.insertBefore(l,g.firstChild):g.appendChild(l),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(At(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(o){this._map&&o&&o.screenX>0&&o.screenY>0&&this._map.getContainer().focus()}}),gs=function(o){return new Ge(o)};yt.include({addControl:function(o){return o.addTo(this),this},removeControl:function(o){return o.remove(),this},_initControlPos:function(){var o=this._controlCorners={},l="leaflet-",u=this._controlContainer=wt("div",l+"control-container",this._container);function g(m,x){var S=l+m+" "+l+x;o[m+x]=wt("div",S,u)}g("top","left"),g("top","right"),g("bottom","left"),g("bottom","right")},_clearControlPos:function(){for(var o in this._controlCorners)At(this._controlCorners[o]);At(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Xf=Ge.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(o,l,u,g){return u<g?-1:g<u?1:0}},initialize:function(o,l,u){w(this,u),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var g in o)this._addLayer(o[g],g);for(g in l)this._addLayer(l[g],g,!0)},onAdd:function(o){this._initLayout(),this._update(),this._map=o,o.on("zoomend",this._checkDisabledLayers,this);for(var l=0;l<this._layers.length;l++)this._layers[l].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(o){return Ge.prototype.addTo.call(this,o),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var o=0;o<this._layers.length;o++)this._layers[o].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(o,l){return this._addLayer(o,l),this._map?this._update():this},addOverlay:function(o,l){return this._addLayer(o,l,!0),this._map?this._update():this},removeLayer:function(o){o.off("add remove",this._onLayerChange,this);var l=this._getLayer(c(o));return l&&this._layers.splice(this._layers.indexOf(l),1),this._map?this._update():this},expand:function(){dt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var o=this._map.getSize().y-(this._container.offsetTop+50);return o<this._section.clientHeight?(dt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=o+"px"):Ft(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return Ft(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var o="leaflet-control-layers",l=this._container=wt("div",o),u=this.options.collapsed;l.setAttribute("aria-haspopup",!0),fs(l),kh(l);var g=this._section=wt("section",o+"-list");u&&(this._map.on("click",this.collapse,this),ht(l,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var m=this._layersLink=wt("a",o+"-toggle",l);m.href="#",m.title="Layers",m.setAttribute("role","button"),ht(m,{keydown:function(x){x.keyCode===13&&this._expandSafely()},click:function(x){Qt(x),this._expandSafely()}},this),u||this.expand(),this._baseLayersList=wt("div",o+"-base",g),this._separator=wt("div",o+"-separator",g),this._overlaysList=wt("div",o+"-overlays",g),l.appendChild(g)},_getLayer:function(o){for(var l=0;l<this._layers.length;l++)if(this._layers[l]&&c(this._layers[l].layer)===o)return this._layers[l]},_addLayer:function(o,l,u){this._map&&o.on("add remove",this._onLayerChange,this),this._layers.push({layer:o,name:l,overlay:u}),this.options.sortLayers&&this._layers.sort(a(function(g,m){return this.options.sortFunction(g.layer,m.layer,g.name,m.name)},this)),this.options.autoZIndex&&o.setZIndex&&(this._lastZIndex++,o.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;ta(this._baseLayersList),ta(this._overlaysList),this._layerControlInputs=[];var o,l,u,g,m=0;for(u=0;u<this._layers.length;u++)g=this._layers[u],this._addItem(g),l=l||g.overlay,o=o||!g.overlay,m+=g.overlay?0:1;return this.options.hideSingleBase&&(o=o&&m>1,this._baseLayersList.style.display=o?"":"none"),this._separator.style.display=l&&o?"":"none",this},_onLayerChange:function(o){this._handlingClick||this._update();var l=this._getLayer(c(o.target)),u=l.overlay?o.type==="add"?"overlayadd":"overlayremove":o.type==="add"?"baselayerchange":null;u&&this._map.fire(u,l)},_createRadioElement:function(o,l){var u='<input type="radio" class="leaflet-control-layers-selector" name="'+o+'"'+(l?' checked="checked"':"")+"/>",g=document.createElement("div");return g.innerHTML=u,g.firstChild},_addItem:function(o){var l=document.createElement("label"),u=this._map.hasLayer(o.layer),g;o.overlay?(g=document.createElement("input"),g.type="checkbox",g.className="leaflet-control-layers-selector",g.defaultChecked=u):g=this._createRadioElement("leaflet-base-layers_"+c(this),u),this._layerControlInputs.push(g),g.layerId=c(o.layer),ht(g,"click",this._onInputClick,this);var m=document.createElement("span");m.innerHTML=" "+o.name;var x=document.createElement("span");l.appendChild(x),x.appendChild(g),x.appendChild(m);var S=o.overlay?this._overlaysList:this._baseLayersList;return S.appendChild(l),this._checkDisabledLayers(),l},_onInputClick:function(){if(!this._preventClick){var o=this._layerControlInputs,l,u,g=[],m=[];this._handlingClick=!0;for(var x=o.length-1;x>=0;x--)l=o[x],u=this._getLayer(l.layerId).layer,l.checked?g.push(u):l.checked||m.push(u);for(x=0;x<m.length;x++)this._map.hasLayer(m[x])&&this._map.removeLayer(m[x]);for(x=0;x<g.length;x++)this._map.hasLayer(g[x])||this._map.addLayer(g[x]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var o=this._layerControlInputs,l,u,g=this._map.getZoom(),m=o.length-1;m>=0;m--)l=o[m],u=this._getLayer(l.layerId).layer,l.disabled=u.options.minZoom!==void 0&&g<u.options.minZoom||u.options.maxZoom!==void 0&&g>u.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var o=this._section;this._preventClick=!0,ht(o,"click",Qt),this.expand();var l=this;setTimeout(function(){Pt(o,"click",Qt),l._preventClick=!1})}}),vL=function(o,l,u){return new Xf(o,l,u)},Ah=Ge.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(o){var l="leaflet-control-zoom",u=wt("div",l+" leaflet-bar"),g=this.options;return this._zoomInButton=this._createButton(g.zoomInText,g.zoomInTitle,l+"-in",u,this._zoomIn),this._zoomOutButton=this._createButton(g.zoomOutText,g.zoomOutTitle,l+"-out",u,this._zoomOut),this._updateDisabled(),o.on("zoomend zoomlevelschange",this._updateDisabled,this),u},onRemove:function(o){o.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(o){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(o.shiftKey?3:1))},_zoomOut:function(o){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(o.shiftKey?3:1))},_createButton:function(o,l,u,g,m){var x=wt("a",u,g);return x.innerHTML=o,x.href="#",x.title=l,x.setAttribute("role","button"),x.setAttribute("aria-label",l),fs(x),ht(x,"click",Mn),ht(x,"click",m,this),ht(x,"click",this._refocusOnMap,this),x},_updateDisabled:function(){var o=this._map,l="leaflet-disabled";Ft(this._zoomInButton,l),Ft(this._zoomOutButton,l),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||o._zoom===o.getMinZoom())&&(dt(this._zoomOutButton,l),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||o._zoom===o.getMaxZoom())&&(dt(this._zoomInButton,l),this._zoomInButton.setAttribute("aria-disabled","true"))}});yt.mergeOptions({zoomControl:!0}),yt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ah,this.addControl(this.zoomControl))});var xL=function(o){return new Ah(o)},Yf=Ge.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(o){var l="leaflet-control-scale",u=wt("div",l),g=this.options;return this._addScales(g,l+"-line",u),o.on(g.updateWhenIdle?"moveend":"move",this._update,this),o.whenReady(this._update,this),u},onRemove:function(o){o.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(o,l,u){o.metric&&(this._mScale=wt("div",l,u)),o.imperial&&(this._iScale=wt("div",l,u))},_update:function(){var o=this._map,l=o.getSize().y/2,u=o.distance(o.containerPointToLatLng([0,l]),o.containerPointToLatLng([this.options.maxWidth,l]));this._updateScales(u)},_updateScales:function(o){this.options.metric&&o&&this._updateMetric(o),this.options.imperial&&o&&this._updateImperial(o)},_updateMetric:function(o){var l=this._getRoundNum(o),u=l<1e3?l+" m":l/1e3+" km";this._updateScale(this._mScale,u,l/o)},_updateImperial:function(o){var l=o*3.2808399,u,g,m;l>5280?(u=l/5280,g=this._getRoundNum(u),this._updateScale(this._iScale,g+" mi",g/u)):(m=this._getRoundNum(l),this._updateScale(this._iScale,m+" ft",m/l))},_updateScale:function(o,l,u){o.style.width=Math.round(this.options.maxWidth*u)+"px",o.innerHTML=l},_getRoundNum:function(o){var l=Math.pow(10,(Math.floor(o)+"").length-1),u=o/l;return u=u>=10?10:u>=5?5:u>=3?3:u>=2?2:1,l*u}}),wL=function(o){return new Yf(o)},EL='<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>',Ih=Ge.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(K.inlineSvg?EL+" ":"")+"Leaflet</a>"},initialize:function(o){w(this,o),this._attributions={}},onAdd:function(o){o.attributionControl=this,this._container=wt("div","leaflet-control-attribution"),fs(this._container);for(var l in o._layers)o._layers[l].getAttribution&&this.addAttribution(o._layers[l].getAttribution());return this._update(),o.on("layeradd",this._addAttribution,this),this._container},onRemove:function(o){o.off("layeradd",this._addAttribution,this)},_addAttribution:function(o){o.layer.getAttribution&&(this.addAttribution(o.layer.getAttribution()),o.layer.once("remove",function(){this.removeAttribution(o.layer.getAttribution())},this))},setPrefix:function(o){return this.options.prefix=o,this._update(),this},addAttribution:function(o){return o?(this._attributions[o]||(this._attributions[o]=0),this._attributions[o]++,this._update(),this):this},removeAttribution:function(o){return o?(this._attributions[o]&&(this._attributions[o]--,this._update()),this):this},_update:function(){if(this._map){var o=[];for(var l in this._attributions)this._attributions[l]&&o.push(l);var u=[];this.options.prefix&&u.push(this.options.prefix),o.length&&u.push(o.join(", ")),this._container.innerHTML=u.join(' <span aria-hidden="true">|</span> ')}}});yt.mergeOptions({attributionControl:!0}),yt.addInitHook(function(){this.options.attributionControl&&new Ih().addTo(this)});var LL=function(o){return new Ih(o)};Ge.Layers=Xf,Ge.Zoom=Ah,Ge.Scale=Yf,Ge.Attribution=Ih,gs.layers=vL,gs.zoom=xL,gs.scale=wL,gs.attribution=LL;var ii=_t.extend({initialize:function(o){this._map=o},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});ii.addTo=function(o,l){return o.addHandler(l,this),this};var bL={Events:H},Kf=K.touch?"touchstart mousedown":"mousedown",nn=j.extend({options:{clickTolerance:3},initialize:function(o,l,u,g){w(this,g),this._element=o,this._dragStartTarget=l||o,this._preventOutline=u},enable:function(){this._enabled||(ht(this._dragStartTarget,Kf,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(nn._dragging===this&&this.finishDrag(!0),Pt(this._dragStartTarget,Kf,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(o){if(this._enabled&&(this._moved=!1,!vh(this._element,"leaflet-zoom-anim"))){if(o.touches&&o.touches.length!==1){nn._dragging===this&&this.finishDrag();return}if(!(nn._dragging||o.shiftKey||o.which!==1&&o.button!==1&&!o.touches)&&(nn._dragging=this,this._preventOutline&&Th(this._element),Eh(),cs(),!this._moving)){this.fire("down");var l=o.touches?o.touches[0]:o,u=Uf(this._element);this._startPoint=new B(l.clientX,l.clientY),this._startPos=Tn(this._element),this._parentScale=Ch(u);var g=o.type==="mousedown";ht(document,g?"mousemove":"touchmove",this._onMove,this),ht(document,g?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(o){if(this._enabled){if(o.touches&&o.touches.length>1){this._moved=!0;return}var l=o.touches&&o.touches.length===1?o.touches[0]:o,u=new B(l.clientX,l.clientY)._subtract(this._startPoint);!u.x&&!u.y||Math.abs(u.x)+Math.abs(u.y)<this.options.clickTolerance||(u.x/=this._parentScale.x,u.y/=this._parentScale.y,Qt(o),this._moved||(this.fire("dragstart"),this._moved=!0,dt(document.body,"leaflet-dragging"),this._lastTarget=o.target||o.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),dt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(u),this._moving=!0,this._lastEvent=o,this._updatePosition())}},_updatePosition:function(){var o={originalEvent:this._lastEvent};this.fire("predrag",o),Gt(this._element,this._newPos),this.fire("drag",o)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(o){Ft(document.body,"leaflet-dragging"),this._lastTarget&&(Ft(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Pt(document,"mousemove touchmove",this._onMove,this),Pt(document,"mouseup touchend touchcancel",this._onUp,this),Lh(),us();var l=this._moved&&this._moving;this._moving=!1,nn._dragging=!1,l&&this.fire("dragend",{noInertia:o,distance:this._newPos.distanceTo(this._startPos)})}});function qf(o,l,u){var g,m=[1,4,2,8],x,S,k,A,N,W,nt,pt;for(x=0,W=o.length;x<W;x++)o[x]._code=Sn(o[x],l);for(k=0;k<4;k++){for(nt=m[k],g=[],x=0,W=o.length,S=W-1;x<W;S=x++)A=o[x],N=o[S],A._code&nt?N._code&nt||(pt=sa(N,A,nt,l,u),pt._code=Sn(pt,l),g.push(pt)):(N._code&nt&&(pt=sa(N,A,nt,l,u),pt._code=Sn(pt,l),g.push(pt)),g.push(A));o=g}return o}function Jf(o,l){var u,g,m,x,S,k,A,N,W;if(!o||o.length===0)throw new Error("latlngs not passed");Pe(o)||(console.warn("latlngs are not flat! Only the first ring will be used"),o=o[0]);var nt=at([0,0]),pt=$(o),he=pt.getNorthWest().distanceTo(pt.getSouthWest())*pt.getNorthEast().distanceTo(pt.getNorthWest());he<1700&&(nt=Dh(o));var Kt=o.length,ke=[];for(u=0;u<Kt;u++){var me=at(o[u]);ke.push(l.project(at([me.lat-nt.lat,me.lng-nt.lng])))}for(k=A=N=0,u=0,g=Kt-1;u<Kt;g=u++)m=ke[u],x=ke[g],S=m.y*x.x-x.y*m.x,A+=(m.x+x.x)*S,N+=(m.y+x.y)*S,k+=S*3;k===0?W=ke[0]:W=[A/k,N/k];var mr=l.unproject(Z(W));return at([mr.lat+nt.lat,mr.lng+nt.lng])}function Dh(o){for(var l=0,u=0,g=0,m=0;m<o.length;m++){var x=at(o[m]);l+=x.lat,u+=x.lng,g++}return at([l/g,u/g])}var TL={__proto__:null,clipPolygon:qf,polygonCenter:Jf,centroid:Dh};function Qf(o,l){if(!l||!o.length)return o.slice();var u=l*l;return o=SL(o,u),o=ML(o,u),o}function $f(o,l,u){return Math.sqrt(ps(o,l,u,!0))}function CL(o,l,u){return ps(o,l,u)}function ML(o,l){var u=o.length,g=typeof Uint8Array!=void 0+""?Uint8Array:Array,m=new g(u);m[0]=m[u-1]=1,Oh(o,m,l,0,u-1);var x,S=[];for(x=0;x<u;x++)m[x]&&S.push(o[x]);return S}function Oh(o,l,u,g,m){var x=0,S,k,A;for(k=g+1;k<=m-1;k++)A=ps(o[k],o[g],o[m],!0),A>x&&(S=k,x=A);x>u&&(l[S]=1,Oh(o,l,u,g,S),Oh(o,l,u,S,m))}function SL(o,l){for(var u=[o[0]],g=1,m=0,x=o.length;g<x;g++)PL(o[g],o[m])>l&&(u.push(o[g]),m=g);return m<x-1&&u.push(o[x-1]),u}var tg;function eg(o,l,u,g,m){var x=g?tg:Sn(o,u),S=Sn(l,u),k,A,N;for(tg=S;;){if(!(x|S))return[o,l];if(x&S)return!1;k=x||S,A=sa(o,l,k,u,m),N=Sn(A,u),k===x?(o=A,x=N):(l=A,S=N)}}function sa(o,l,u,g,m){var x=l.x-o.x,S=l.y-o.y,k=g.min,A=g.max,N,W;return u&8?(N=o.x+x*(A.y-o.y)/S,W=A.y):u&4?(N=o.x+x*(k.y-o.y)/S,W=k.y):u&2?(N=A.x,W=o.y+S*(A.x-o.x)/x):u&1&&(N=k.x,W=o.y+S*(k.x-o.x)/x),new B(N,W,m)}function Sn(o,l){var u=0;return o.x<l.min.x?u|=1:o.x>l.max.x&&(u|=2),o.y<l.min.y?u|=4:o.y>l.max.y&&(u|=8),u}function PL(o,l){var u=l.x-o.x,g=l.y-o.y;return u*u+g*g}function ps(o,l,u,g){var m=l.x,x=l.y,S=u.x-m,k=u.y-x,A=S*S+k*k,N;return A>0&&(N=((o.x-m)*S+(o.y-x)*k)/A,N>1?(m=u.x,x=u.y):N>0&&(m+=S*N,x+=k*N)),S=o.x-m,k=o.y-x,g?S*S+k*k:new B(m,x)}function Pe(o){return!b(o[0])||typeof o[0][0]!="object"&&typeof o[0][0]<"u"}function ig(o){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Pe(o)}function ng(o,l){var u,g,m,x,S,k,A,N;if(!o||o.length===0)throw new Error("latlngs not passed");Pe(o)||(console.warn("latlngs are not flat! Only the first ring will be used"),o=o[0]);var W=at([0,0]),nt=$(o),pt=nt.getNorthWest().distanceTo(nt.getSouthWest())*nt.getNorthEast().distanceTo(nt.getNorthWest());pt<1700&&(W=Dh(o));var he=o.length,Kt=[];for(u=0;u<he;u++){var ke=at(o[u]);Kt.push(l.project(at([ke.lat-W.lat,ke.lng-W.lng])))}for(u=0,g=0;u<he-1;u++)g+=Kt[u].distanceTo(Kt[u+1])/2;if(g===0)N=Kt[0];else for(u=0,x=0;u<he-1;u++)if(S=Kt[u],k=Kt[u+1],m=S.distanceTo(k),x+=m,x>g){A=(x-g)/m,N=[k.x-A*(k.x-S.x),k.y-A*(k.y-S.y)];break}var me=l.unproject(Z(N));return at([me.lat+W.lat,me.lng+W.lng])}var kL={__proto__:null,simplify:Qf,pointToSegmentDistance:$f,closestPointOnSegment:CL,clipSegment:eg,_getEdgeIntersection:sa,_getBitCode:Sn,_sqClosestPointOnSegment:ps,isFlat:Pe,_flat:ig,polylineCenter:ng},Fh={project:function(o){return new B(o.lng,o.lat)},unproject:function(o){return new tt(o.y,o.x)},bounds:new ut([-180,-90],[180,90])},zh={R:6378137,R_MINOR:6356752314245179e-9,bounds:new ut([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(o){var l=Math.PI/180,u=this.R,g=o.lat*l,m=this.R_MINOR/u,x=Math.sqrt(1-m*m),S=x*Math.sin(g),k=Math.tan(Math.PI/4-g/2)/Math.pow((1-S)/(1+S),x/2);return g=-u*Math.log(Math.max(k,1e-10)),new B(o.lng*l*u,g)},unproject:function(o){for(var l=180/Math.PI,u=this.R,g=this.R_MINOR/u,m=Math.sqrt(1-g*g),x=Math.exp(-o.y/u),S=Math.PI/2-2*Math.atan(x),k=0,A=.1,N;k<15&&Math.abs(A)>1e-7;k++)N=m*Math.sin(S),N=Math.pow((1-N)/(1+N),m/2),A=Math.PI/2-2*Math.atan(x*N)-S,S+=A;return new tt(S*l,o.x*l/u)}},RL={__proto__:null,LonLat:Fh,Mercator:zh,SphericalMercator:Je},AL=n({},Xt,{code:"EPSG:3395",projection:zh,transformation:function(){var o=.5/(Math.PI*zh.R);return Me(o,.5,-o,.5)}()}),rg=n({},Xt,{code:"EPSG:4326",projection:Fh,transformation:Me(1/180,1,-1/180,.5)}),IL=n({},kt,{projection:Fh,transformation:Me(1,0,-1,0),scale:function(o){return Math.pow(2,o)},zoom:function(o){return Math.log(o)/Math.LN2},distance:function(o,l){var u=l.lng-o.lng,g=l.lat-o.lat;return Math.sqrt(u*u+g*g)},infinite:!0});kt.Earth=Xt,kt.EPSG3395=AL,kt.EPSG3857=Yi,kt.EPSG900913=Qe,kt.EPSG4326=rg,kt.Simple=IL;var Ue=j.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(o){return o.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(o){return o&&o.removeLayer(this),this},getPane:function(o){return this._map.getPane(o?this.options[o]||o:this.options.pane)},addInteractiveTarget:function(o){return this._map._targets[c(o)]=this,this},removeInteractiveTarget:function(o){return delete this._map._targets[c(o)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(o){var l=o.target;if(l.hasLayer(this)){if(this._map=l,this._zoomAnimated=l._zoomAnimated,this.getEvents){var u=this.getEvents();l.on(u,this),this.once("remove",function(){l.off(u,this)},this)}this.onAdd(l),this.fire("add"),l.fire("layeradd",{layer:this})}}});yt.include({addLayer:function(o){if(!o._layerAdd)throw new Error("The provided object is not a Layer.");var l=c(o);return this._layers[l]?this:(this._layers[l]=o,o._mapToAdd=this,o.beforeAdd&&o.beforeAdd(this),this.whenReady(o._layerAdd,o),this)},removeLayer:function(o){var l=c(o);return this._layers[l]?(this._loaded&&o.onRemove(this),delete this._layers[l],this._loaded&&(this.fire("layerremove",{layer:o}),o.fire("remove")),o._map=o._mapToAdd=null,this):this},hasLayer:function(o){return c(o)in this._layers},eachLayer:function(o,l){for(var u in this._layers)o.call(l,this._layers[u]);return this},_addLayers:function(o){o=o?b(o)?o:[o]:[];for(var l=0,u=o.length;l<u;l++)this.addLayer(o[l])},_addZoomLimit:function(o){(!isNaN(o.options.maxZoom)||!isNaN(o.options.minZoom))&&(this._zoomBoundLayers[c(o)]=o,this._updateZoomLevels())},_removeZoomLimit:function(o){var l=c(o);this._zoomBoundLayers[l]&&(delete this._zoomBoundLayers[l],this._updateZoomLevels())},_updateZoomLevels:function(){var o=1/0,l=-1/0,u=this._getZoomSpan();for(var g in this._zoomBoundLayers){var m=this._zoomBoundLayers[g].options;o=m.minZoom===void 0?o:Math.min(o,m.minZoom),l=m.maxZoom===void 0?l:Math.max(l,m.maxZoom)}this._layersMaxZoom=l===-1/0?void 0:l,this._layersMinZoom=o===1/0?void 0:o,u!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var dr=Ue.extend({initialize:function(o,l){w(this,l),this._layers={};var u,g;if(o)for(u=0,g=o.length;u<g;u++)this.addLayer(o[u])},addLayer:function(o){var l=this.getLayerId(o);return this._layers[l]=o,this._map&&this._map.addLayer(o),this},removeLayer:function(o){var l=o in this._layers?o:this.getLayerId(o);return this._map&&this._layers[l]&&this._map.removeLayer(this._layers[l]),delete this._layers[l],this},hasLayer:function(o){var l=typeof o=="number"?o:this.getLayerId(o);return l in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(o){var l=Array.prototype.slice.call(arguments,1),u,g;for(u in this._layers)g=this._layers[u],g[o]&&g[o].apply(g,l);return this},onAdd:function(o){this.eachLayer(o.addLayer,o)},onRemove:function(o){this.eachLayer(o.removeLayer,o)},eachLayer:function(o,l){for(var u in this._layers)o.call(l,this._layers[u]);return this},getLayer:function(o){return this._layers[o]},getLayers:function(){var o=[];return this.eachLayer(o.push,o),o},setZIndex:function(o){return this.invoke("setZIndex",o)},getLayerId:function(o){return c(o)}}),DL=function(o,l){return new dr(o,l)},bi=dr.extend({addLayer:function(o){return this.hasLayer(o)?this:(o.addEventParent(this),dr.prototype.addLayer.call(this,o),this.fire("layeradd",{layer:o}))},removeLayer:function(o){return this.hasLayer(o)?(o in this._layers&&(o=this._layers[o]),o.removeEventParent(this),dr.prototype.removeLayer.call(this,o),this.fire("layerremove",{layer:o})):this},setStyle:function(o){return this.invoke("setStyle",o)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var o=new xt;for(var l in this._layers){var u=this._layers[l];o.extend(u.getBounds?u.getBounds():u.getLatLng())}return o}}),OL=function(o,l){return new bi(o,l)},fr=_t.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(o){w(this,o)},createIcon:function(o){return this._createIcon("icon",o)},createShadow:function(o){return this._createIcon("shadow",o)},_createIcon:function(o,l){var u=this._getIconUrl(o);if(!u){if(o==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var g=this._createImg(u,l&&l.tagName==="IMG"?l:null);return this._setIconStyles(g,o),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),g},_setIconStyles:function(o,l){var u=this.options,g=u[l+"Size"];typeof g=="number"&&(g=[g,g]);var m=Z(g),x=Z(l==="shadow"&&u.shadowAnchor||u.iconAnchor||m&&m.divideBy(2,!0));o.className="leaflet-marker-"+l+" "+(u.className||""),x&&(o.style.marginLeft=-x.x+"px",o.style.marginTop=-x.y+"px"),m&&(o.style.width=m.x+"px",o.style.height=m.y+"px")},_createImg:function(o,l){return l=l||document.createElement("img"),l.src=o,l},_getIconUrl:function(o){return K.retina&&this.options[o+"RetinaUrl"]||this.options[o+"Url"]}});function FL(o){return new fr(o)}var _s=fr.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(o){return typeof _s.imagePath!="string"&&(_s.imagePath=this._detectIconPath()),(this.options.imagePath||_s.imagePath)+fr.prototype._getIconUrl.call(this,o)},_stripUrl:function(o){var l=function(u,g,m){var x=g.exec(u);return x&&x[m]};return o=l(o,/^url\((['"])?(.+)\1\)$/,2),o&&l(o,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var o=wt("div","leaflet-default-icon-path",document.body),l=hs(o,"background-image")||hs(o,"backgroundImage");if(document.body.removeChild(o),l=this._stripUrl(l),l)return l;var u=document.querySelector('link[href$="leaflet.css"]');return u?u.href.substring(0,u.href.length-11-1):""}}),sg=ii.extend({initialize:function(o){this._marker=o},addHooks:function(){var o=this._marker._icon;this._draggable||(this._draggable=new nn(o,o,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),dt(o,"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&&Ft(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(o){var l=this._marker,u=l._map,g=this._marker.options.autoPanSpeed,m=this._marker.options.autoPanPadding,x=Tn(l._icon),S=u.getPixelBounds(),k=u.getPixelOrigin(),A=z(S.min._subtract(k).add(m),S.max._subtract(k).subtract(m));if(!A.contains(x)){var N=Z((Math.max(A.max.x,x.x)-A.max.x)/(S.max.x-A.max.x)-(Math.min(A.min.x,x.x)-A.min.x)/(S.min.x-A.min.x),(Math.max(A.max.y,x.y)-A.max.y)/(S.max.y-A.max.y)-(Math.min(A.min.y,x.y)-A.min.y)/(S.min.y-A.min.y)).multiplyBy(g);u.panBy(N,{animate:!1}),this._draggable._newPos._add(N),this._draggable._startPos._add(N),Gt(l._icon,this._draggable._newPos),this._onDrag(o),this._panRequest=Y(this._adjustPan.bind(this,o))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(o){this._marker.options.autoPan&&(q(this._panRequest),this._panRequest=Y(this._adjustPan.bind(this,o)))},_onDrag:function(o){var l=this._marker,u=l._shadow,g=Tn(l._icon),m=l._map.layerPointToLatLng(g);u&&Gt(u,g),l._latlng=m,o.latlng=m,o.oldLatLng=this._oldLatLng,l.fire("move",o).fire("drag",o)},_onDragEnd:function(o){q(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",o)}}),oa=Ue.extend({options:{icon:new _s,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(o,l){w(this,l),this._latlng=at(o)},onAdd:function(o){this._zoomAnimated=this._zoomAnimated&&o.options.markerZoomAnimation,this._zoomAnimated&&o.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(o){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&o.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(o){var l=this._latlng;return this._latlng=at(o),this.update(),this.fire("move",{oldLatLng:l,latlng:this._latlng})},setZIndexOffset:function(o){return this.options.zIndexOffset=o,this.update()},getIcon:function(){return this.options.icon},setIcon:function(o){return this.options.icon=o,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 o=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(o)}return this},_initIcon:function(){var o=this.options,l="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),u=o.icon.createIcon(this._icon),g=!1;u!==this._icon&&(this._icon&&this._removeIcon(),g=!0,o.title&&(u.title=o.title),u.tagName==="IMG"&&(u.alt=o.alt||"")),dt(u,l),o.keyboard&&(u.tabIndex="0",u.setAttribute("role","button")),this._icon=u,o.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&ht(u,"focus",this._panOnFocus,this);var m=o.icon.createShadow(this._shadow),x=!1;m!==this._shadow&&(this._removeShadow(),x=!0),m&&(dt(m,l),m.alt=""),this._shadow=m,o.opacity<1&&this._updateOpacity(),g&&this.getPane().appendChild(this._icon),this._initInteraction(),m&&x&&this.getPane(o.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Pt(this._icon,"focus",this._panOnFocus,this),At(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&At(this._shadow),this._shadow=null},_setPos:function(o){this._icon&&Gt(this._icon,o),this._shadow&&Gt(this._shadow,o),this._zIndex=o.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(o){this._icon&&(this._icon.style.zIndex=this._zIndex+o)},_animateZoom:function(o){var l=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center).round();this._setPos(l)},_initInteraction:function(){if(this.options.interactive&&(dt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),sg)){var o=this.options.draggable;this.dragging&&(o=this.dragging.enabled(),this.dragging.disable()),this.dragging=new sg(this),o&&this.dragging.enable()}},setOpacity:function(o){return this.options.opacity=o,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var o=this.options.opacity;this._icon&&Se(this._icon,o),this._shadow&&Se(this._shadow,o)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var o=this._map;if(o){var l=this.options.icon.options,u=l.iconSize?Z(l.iconSize):Z(0,0),g=l.iconAnchor?Z(l.iconAnchor):Z(0,0);o.panInside(this._latlng,{paddingTopLeft:g,paddingBottomRight:u.subtract(g)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function zL(o,l){return new oa(o,l)}var rn=Ue.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(o){this._renderer=o.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(o){return w(this,o),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&o&&Object.prototype.hasOwnProperty.call(o,"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)}}),aa=rn.extend({options:{fill:!0,radius:10},initialize:function(o,l){w(this,l),this._latlng=at(o),this._radius=this.options.radius},setLatLng:function(o){var l=this._latlng;return this._latlng=at(o),this.redraw(),this.fire("move",{oldLatLng:l,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(o){return this.options.radius=this._radius=o,this.redraw()},getRadius:function(){return this._radius},setStyle:function(o){var l=o&&o.radius||this._radius;return rn.prototype.setStyle.call(this,o),this.setRadius(l),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var o=this._radius,l=this._radiusY||o,u=this._clickTolerance(),g=[o+u,l+u];this._pxBounds=new ut(this._point.subtract(g),this._point.add(g))},_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(o){return o.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function NL(o,l){return new aa(o,l)}var Nh=aa.extend({initialize:function(o,l,u){if(typeof l=="number"&&(l=n({},u,{radius:l})),w(this,l),this._latlng=at(o),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(o){return this._mRadius=o,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var o=[this._radius,this._radiusY||this._radius];return new xt(this._map.layerPointToLatLng(this._point.subtract(o)),this._map.layerPointToLatLng(this._point.add(o)))},setStyle:rn.prototype.setStyle,_project:function(){var o=this._latlng.lng,l=this._latlng.lat,u=this._map,g=u.options.crs;if(g.distance===Xt.distance){var m=Math.PI/180,x=this._mRadius/Xt.R/m,S=u.project([l+x,o]),k=u.project([l-x,o]),A=S.add(k).divideBy(2),N=u.unproject(A).lat,W=Math.acos((Math.cos(x*m)-Math.sin(l*m)*Math.sin(N*m))/(Math.cos(l*m)*Math.cos(N*m)))/m;(isNaN(W)||W===0)&&(W=x/Math.cos(Math.PI/180*l)),this._point=A.subtract(u.getPixelOrigin()),this._radius=isNaN(W)?0:A.x-u.project([N,o-W]).x,this._radiusY=A.y-S.y}else{var nt=g.unproject(g.project(this._latlng).subtract([this._mRadius,0]));this._point=u.latLngToLayerPoint(this._latlng),this._radius=this._point.x-u.latLngToLayerPoint(nt).x}this._updateBounds()}});function BL(o,l,u){return new Nh(o,l,u)}var Ti=rn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(o,l){w(this,l),this._setLatLngs(o)},getLatLngs:function(){return this._latlngs},setLatLngs:function(o){return this._setLatLngs(o),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(o){for(var l=1/0,u=null,g=ps,m,x,S=0,k=this._parts.length;S<k;S++)for(var A=this._parts[S],N=1,W=A.length;N<W;N++){m=A[N-1],x=A[N];var nt=g(o,m,x,!0);nt<l&&(l=nt,u=g(o,m,x))}return u&&(u.distance=Math.sqrt(l)),u},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return ng(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(o,l){return l=l||this._defaultShape(),o=at(o),l.push(o),this._bounds.extend(o),this.redraw()},_setLatLngs:function(o){this._bounds=new xt,this._latlngs=this._convertLatLngs(o)},_defaultShape:function(){return Pe(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(o){for(var l=[],u=Pe(o),g=0,m=o.length;g<m;g++)u?(l[g]=at(o[g]),this._bounds.extend(l[g])):l[g]=this._convertLatLngs(o[g]);return l},_project:function(){var o=new ut;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,o),this._bounds.isValid()&&o.isValid()&&(this._rawPxBounds=o,this._updateBounds())},_updateBounds:function(){var o=this._clickTolerance(),l=new B(o,o);this._rawPxBounds&&(this._pxBounds=new ut([this._rawPxBounds.min.subtract(l),this._rawPxBounds.max.add(l)]))},_projectLatlngs:function(o,l,u){var g=o[0]instanceof tt,m=o.length,x,S;if(g){for(S=[],x=0;x<m;x++)S[x]=this._map.latLngToLayerPoint(o[x]),u.extend(S[x]);l.push(S)}else for(x=0;x<m;x++)this._projectLatlngs(o[x],l,u)},_clipPoints:function(){var o=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(o))){if(this.options.noClip){this._parts=this._rings;return}var l=this._parts,u,g,m,x,S,k,A;for(u=0,m=0,x=this._rings.length;u<x;u++)for(A=this._rings[u],g=0,S=A.length;g<S-1;g++)k=eg(A[g],A[g+1],o,g,!0),k&&(l[m]=l[m]||[],l[m].push(k[0]),(k[1]!==A[g+1]||g===S-2)&&(l[m].push(k[1]),m++))}},_simplifyPoints:function(){for(var o=this._parts,l=this.options.smoothFactor,u=0,g=o.length;u<g;u++)o[u]=Qf(o[u],l)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(o,l){var u,g,m,x,S,k,A=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(o))return!1;for(u=0,x=this._parts.length;u<x;u++)for(k=this._parts[u],g=0,S=k.length,m=S-1;g<S;m=g++)if(!(!l&&g===0)&&$f(o,k[m],k[g])<=A)return!0;return!1}});function GL(o,l){return new Ti(o,l)}Ti._flat=ig;var gr=Ti.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Jf(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(o){var l=Ti.prototype._convertLatLngs.call(this,o),u=l.length;return u>=2&&l[0]instanceof tt&&l[0].equals(l[u-1])&&l.pop(),l},_setLatLngs:function(o){Ti.prototype._setLatLngs.call(this,o),Pe(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Pe(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var o=this._renderer._bounds,l=this.options.weight,u=new B(l,l);if(o=new ut(o.min.subtract(u),o.max.add(u)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(o))){if(this.options.noClip){this._parts=this._rings;return}for(var g=0,m=this._rings.length,x;g<m;g++)x=qf(this._rings[g],o,!0),x.length&&this._parts.push(x)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(o){var l=!1,u,g,m,x,S,k,A,N;if(!this._pxBounds||!this._pxBounds.contains(o))return!1;for(x=0,A=this._parts.length;x<A;x++)for(u=this._parts[x],S=0,N=u.length,k=N-1;S<N;k=S++)g=u[S],m=u[k],g.y>o.y!=m.y>o.y&&o.x<(m.x-g.x)*(o.y-g.y)/(m.y-g.y)+g.x&&(l=!l);return l||Ti.prototype._containsPoint.call(this,o,!0)}});function UL(o,l){return new gr(o,l)}var Ci=bi.extend({initialize:function(o,l){w(this,l),this._layers={},o&&this.addData(o)},addData:function(o){var l=b(o)?o:o.features,u,g,m;if(l){for(u=0,g=l.length;u<g;u++)m=l[u],(m.geometries||m.geometry||m.features||m.coordinates)&&this.addData(m);return this}var x=this.options;if(x.filter&&!x.filter(o))return this;var S=la(o,x);return S?(S.feature=ua(o),S.defaultOptions=S.options,this.resetStyle(S),x.onEachFeature&&x.onEachFeature(o,S),this.addLayer(S)):this},resetStyle:function(o){return o===void 0?this.eachLayer(this.resetStyle,this):(o.options=n({},o.defaultOptions),this._setLayerStyle(o,this.options.style),this)},setStyle:function(o){return this.eachLayer(function(l){this._setLayerStyle(l,o)},this)},_setLayerStyle:function(o,l){o.setStyle&&(typeof l=="function"&&(l=l(o.feature)),o.setStyle(l))}});function la(o,l){var u=o.type==="Feature"?o.geometry:o,g=u?u.coordinates:null,m=[],x=l&&l.pointToLayer,S=l&&l.coordsToLatLng||Bh,k,A,N,W;if(!g&&!u)return null;switch(u.type){case"Point":return k=S(g),og(x,o,k,l);case"MultiPoint":for(N=0,W=g.length;N<W;N++)k=S(g[N]),m.push(og(x,o,k,l));return new bi(m);case"LineString":case"MultiLineString":return A=ha(g,u.type==="LineString"?0:1,S),new Ti(A,l);case"Polygon":case"MultiPolygon":return A=ha(g,u.type==="Polygon"?1:2,S),new gr(A,l);case"GeometryCollection":for(N=0,W=u.geometries.length;N<W;N++){var nt=la({geometry:u.geometries[N],type:"Feature",properties:o.properties},l);nt&&m.push(nt)}return new bi(m);case"FeatureCollection":for(N=0,W=u.features.length;N<W;N++){var pt=la(u.features[N],l);pt&&m.push(pt)}return new bi(m);default:throw new Error("Invalid GeoJSON object.")}}function og(o,l,u,g){return o?o(l,u):new oa(u,g&&g.markersInheritOptions&&g)}function Bh(o){return new tt(o[1],o[0],o[2])}function ha(o,l,u){for(var g=[],m=0,x=o.length,S;m<x;m++)S=l?ha(o[m],l-1,u):(u||Bh)(o[m]),g.push(S);return g}function Gh(o,l){return o=at(o),o.alt!==void 0?[_(o.lng,l),_(o.lat,l),_(o.alt,l)]:[_(o.lng,l),_(o.lat,l)]}function ca(o,l,u,g){for(var m=[],x=0,S=o.length;x<S;x++)m.push(l?ca(o[x],Pe(o[x])?0:l-1,u,g):Gh(o[x],g));return!l&&u&&m.length>0&&m.push(m[0].slice()),m}function pr(o,l){return o.feature?n({},o.feature,{geometry:l}):ua(l)}function ua(o){return o.type==="Feature"||o.type==="FeatureCollection"?o:{type:"Feature",properties:{},geometry:o}}var Uh={toGeoJSON:function(o){return pr(this,{type:"Point",coordinates:Gh(this.getLatLng(),o)})}};oa.include(Uh),Nh.include(Uh),aa.include(Uh),Ti.include({toGeoJSON:function(o){var l=!Pe(this._latlngs),u=ca(this._latlngs,l?1:0,!1,o);return pr(this,{type:(l?"Multi":"")+"LineString",coordinates:u})}}),gr.include({toGeoJSON:function(o){var l=!Pe(this._latlngs),u=l&&!Pe(this._latlngs[0]),g=ca(this._latlngs,u?2:l?1:0,!0,o);return l||(g=[g]),pr(this,{type:(u?"Multi":"")+"Polygon",coordinates:g})}}),dr.include({toMultiPoint:function(o){var l=[];return this.eachLayer(function(u){l.push(u.toGeoJSON(o).geometry.coordinates)}),pr(this,{type:"MultiPoint",coordinates:l})},toGeoJSON:function(o){var l=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(l==="MultiPoint")return this.toMultiPoint(o);var u=l==="GeometryCollection",g=[];return this.eachLayer(function(m){if(m.toGeoJSON){var x=m.toGeoJSON(o);if(u)g.push(x.geometry);else{var S=ua(x);S.type==="FeatureCollection"?g.push.apply(g,S.features):g.push(S)}}}),u?pr(this,{geometries:g,type:"GeometryCollection"}):{type:"FeatureCollection",features:g}}});function ag(o,l){return new Ci(o,l)}var jL=ag,da=Ue.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(o,l,u){this._url=o,this._bounds=$(l),w(this,u)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(dt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){At(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(o){return this.options.opacity=o,this._image&&this._updateOpacity(),this},setStyle:function(o){return o.opacity&&this.setOpacity(o.opacity),this},bringToFront:function(){return this._map&&cr(this._image),this},bringToBack:function(){return this._map&&ur(this._image),this},setUrl:function(o){return this._url=o,this._image&&(this._image.src=o),this},setBounds:function(o){return this._bounds=$(o),this._map&&this._reset(),this},getEvents:function(){var o={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},setZIndex:function(o){return this.options.zIndex=o,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var o=this._url.tagName==="IMG",l=this._image=o?this._url:wt("img");if(dt(l,"leaflet-image-layer"),this._zoomAnimated&&dt(l,"leaflet-zoom-animated"),this.options.className&&dt(l,this.options.className),l.onselectstart=p,l.onmousemove=p,l.onload=a(this.fire,this,"load"),l.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(l.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),o){this._url=l.src;return}l.src=this._url,l.alt=this.options.alt},_animateZoom:function(o){var l=this._map.getZoomScale(o.zoom),u=this._map._latLngBoundsToNewLayerBounds(this._bounds,o.zoom,o.center).min;bn(this._image,u,l)},_reset:function(){var o=this._image,l=new ut(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),u=l.getSize();Gt(o,l.min),o.style.width=u.x+"px",o.style.height=u.y+"px"},_updateOpacity:function(){Se(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var o=this.options.errorOverlayUrl;o&&this._url!==o&&(this._url=o,this._image.src=o)},getCenter:function(){return this._bounds.getCenter()}}),ZL=function(o,l,u){return new da(o,l,u)},lg=da.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var o=this._url.tagName==="VIDEO",l=this._image=o?this._url:wt("video");if(dt(l,"leaflet-image-layer"),this._zoomAnimated&&dt(l,"leaflet-zoom-animated"),this.options.className&&dt(l,this.options.className),l.onselectstart=p,l.onmousemove=p,l.onloadeddata=a(this.fire,this,"load"),o){for(var u=l.getElementsByTagName("source"),g=[],m=0;m<u.length;m++)g.push(u[m].src);this._url=u.length>0?g:[l.src];return}b(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(l.style,"objectFit")&&(l.style.objectFit="fill"),l.autoplay=!!this.options.autoplay,l.loop=!!this.options.loop,l.muted=!!this.options.muted,l.playsInline=!!this.options.playsInline;for(var x=0;x<this._url.length;x++){var S=wt("source");S.src=this._url[x],l.appendChild(S)}}});function WL(o,l,u){return new lg(o,l,u)}var hg=da.extend({_initImage:function(){var o=this._image=this._url;dt(o,"leaflet-image-layer"),this._zoomAnimated&&dt(o,"leaflet-zoom-animated"),this.options.className&&dt(o,this.options.className),o.onselectstart=p,o.onmousemove=p}});function HL(o,l,u){return new hg(o,l,u)}var ni=Ue.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(o,l){o&&(o instanceof tt||b(o))?(this._latlng=at(o),w(this,l)):(w(this,o),this._source=l),this.options.content&&(this._content=this.options.content)},openOn:function(o){return o=arguments.length?o:this._source._map,o.hasLayer(this)||o.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(o){return this._map?this.close():(arguments.length?this._source=o:o=this._source,this._prepareOpen(),this.openOn(o._map)),this},onAdd:function(o){this._zoomAnimated=o._zoomAnimated,this._container||this._initLayout(),o._fadeAnimated&&Se(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),o._fadeAnimated&&Se(this._container,1),this.bringToFront(),this.options.interactive&&(dt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(o){o._fadeAnimated?(Se(this._container,0),this._removeTimeout=setTimeout(a(At,void 0,this._container),200)):At(this._container),this.options.interactive&&(Ft(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(o){return this._latlng=at(o),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(o){return this._content=o,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 o={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&cr(this._container),this},bringToBack:function(){return this._map&&ur(this._container),this},_prepareOpen:function(o){var l=this._source;if(!l._map)return!1;if(l instanceof bi){l=null;var u=this._source._layers;for(var g in u)if(u[g]._map){l=u[g];break}if(!l)return!1;this._source=l}if(!o)if(l.getCenter)o=l.getCenter();else if(l.getLatLng)o=l.getLatLng();else if(l.getBounds)o=l.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(o),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var o=this._contentNode,l=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof l=="string")o.innerHTML=l;else{for(;o.hasChildNodes();)o.removeChild(o.firstChild);o.appendChild(l)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var o=this._map.latLngToLayerPoint(this._latlng),l=Z(this.options.offset),u=this._getAnchor();this._zoomAnimated?Gt(this._container,o.add(u)):l=l.add(o).add(u);var g=this._containerBottom=-l.y,m=this._containerLeft=-Math.round(this._containerWidth/2)+l.x;this._container.style.bottom=g+"px",this._container.style.left=m+"px"}},_getAnchor:function(){return[0,0]}});yt.include({_initOverlay:function(o,l,u,g){var m=l;return m instanceof o||(m=new o(g).setContent(l)),u&&m.setLatLng(u),m}}),Ue.include({_initOverlay:function(o,l,u,g){var m=u;return m instanceof o?(w(m,g),m._source=this):(m=l&&!g?l:new o(g,this),m.setContent(u)),m}});var fa=ni.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(o){return o=arguments.length?o:this._source._map,!o.hasLayer(this)&&o._popup&&o._popup.options.autoClose&&o.removeLayer(o._popup),o._popup=this,ni.prototype.openOn.call(this,o)},onAdd:function(o){ni.prototype.onAdd.call(this,o),o.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof rn||this._source.on("preclick",Cn))},onRemove:function(o){ni.prototype.onRemove.call(this,o),o.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof rn||this._source.off("preclick",Cn))},getEvents:function(){var o=ni.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(o.preclick=this.close),this.options.keepInView&&(o.moveend=this._adjustPan),o},_initLayout:function(){var o="leaflet-popup",l=this._container=wt("div",o+" "+(this.options.className||"")+" leaflet-zoom-animated"),u=this._wrapper=wt("div",o+"-content-wrapper",l);if(this._contentNode=wt("div",o+"-content",u),fs(l),kh(this._contentNode),ht(l,"contextmenu",Cn),this._tipContainer=wt("div",o+"-tip-container",l),this._tip=wt("div",o+"-tip",this._tipContainer),this.options.closeButton){var g=this._closeButton=wt("a",o+"-close-button",l);g.setAttribute("role","button"),g.setAttribute("aria-label","Close popup"),g.href="#close",g.innerHTML='<span aria-hidden="true">×</span>',ht(g,"click",function(m){Qt(m),this.close()},this)}},_updateLayout:function(){var o=this._contentNode,l=o.style;l.width="",l.whiteSpace="nowrap";var u=o.offsetWidth;u=Math.min(u,this.options.maxWidth),u=Math.max(u,this.options.minWidth),l.width=u+1+"px",l.whiteSpace="",l.height="";var g=o.offsetHeight,m=this.options.maxHeight,x="leaflet-popup-scrolled";m&&g>m?(l.height=m+"px",dt(o,x)):Ft(o,x),this._containerWidth=this._container.offsetWidth},_animateZoom:function(o){var l=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center),u=this._getAnchor();Gt(this._container,l.add(u))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var o=this._map,l=parseInt(hs(this._container,"marginBottom"),10)||0,u=this._container.offsetHeight+l,g=this._containerWidth,m=new B(this._containerLeft,-u-this._containerBottom);m._add(Tn(this._container));var x=o.layerPointToContainerPoint(m),S=Z(this.options.autoPanPadding),k=Z(this.options.autoPanPaddingTopLeft||S),A=Z(this.options.autoPanPaddingBottomRight||S),N=o.getSize(),W=0,nt=0;x.x+g+A.x>N.x&&(W=x.x+g-N.x+A.x),x.x-W-k.x<0&&(W=x.x-k.x),x.y+u+A.y>N.y&&(nt=x.y+u-N.y+A.y),x.y-nt-k.y<0&&(nt=x.y-k.y),(W||nt)&&(this.options.keepInView&&(this._autopanning=!0),o.fire("autopanstart").panBy([W,nt]))}},_getAnchor:function(){return Z(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),VL=function(o,l){return new fa(o,l)};yt.mergeOptions({closePopupOnClick:!0}),yt.include({openPopup:function(o,l,u){return this._initOverlay(fa,o,l,u).openOn(this),this},closePopup:function(o){return o=arguments.length?o:this._popup,o&&o.close(),this}}),Ue.include({bindPopup:function(o,l){return this._popup=this._initOverlay(fa,this._popup,o,l),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(o){return this._popup&&(this instanceof bi||(this._popup._source=this),this._popup._prepareOpen(o||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(o){return this._popup&&this._popup.setContent(o),this},getPopup:function(){return this._popup},_openPopup:function(o){if(!(!this._popup||!this._map)){Mn(o);var l=o.layer||o.target;if(this._popup._source===l&&!(l instanceof rn)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(o.latlng);return}this._popup._source=l,this.openPopup(o.latlng)}},_movePopup:function(o){this._popup.setLatLng(o.latlng)},_onKeyPress:function(o){o.originalEvent.keyCode===13&&this._openPopup(o)}});var ga=ni.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(o){ni.prototype.onAdd.call(this,o),this.setOpacity(this.options.opacity),o.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(o){ni.prototype.onRemove.call(this,o),o.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var o=ni.prototype.getEvents.call(this);return this.options.permanent||(o.preclick=this.close),o},_initLayout:function(){var o="leaflet-tooltip",l=o+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=wt("div",l),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(o){var l,u,g=this._map,m=this._container,x=g.latLngToContainerPoint(g.getCenter()),S=g.layerPointToContainerPoint(o),k=this.options.direction,A=m.offsetWidth,N=m.offsetHeight,W=Z(this.options.offset),nt=this._getAnchor();k==="top"?(l=A/2,u=N):k==="bottom"?(l=A/2,u=0):k==="center"?(l=A/2,u=N/2):k==="right"?(l=0,u=N/2):k==="left"?(l=A,u=N/2):S.x<x.x?(k="right",l=0,u=N/2):(k="left",l=A+(W.x+nt.x)*2,u=N/2),o=o.subtract(Z(l,u,!0)).add(W).add(nt),Ft(m,"leaflet-tooltip-right"),Ft(m,"leaflet-tooltip-left"),Ft(m,"leaflet-tooltip-top"),Ft(m,"leaflet-tooltip-bottom"),dt(m,"leaflet-tooltip-"+k),Gt(m,o)},_updatePosition:function(){var o=this._map.latLngToLayerPoint(this._latlng);this._setPosition(o)},setOpacity:function(o){this.options.opacity=o,this._container&&Se(this._container,o)},_animateZoom:function(o){var l=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center);this._setPosition(l)},_getAnchor:function(){return Z(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),XL=function(o,l){return new ga(o,l)};yt.include({openTooltip:function(o,l,u){return this._initOverlay(ga,o,l,u).openOn(this),this},closeTooltip:function(o){return o.close(),this}}),Ue.include({bindTooltip:function(o,l){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(ga,this._tooltip,o,l),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(o){if(!(!o&&this._tooltipHandlersAdded)){var l=o?"off":"on",u={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?u.add=this._openTooltip:(u.mouseover=this._openTooltip,u.mouseout=this.closeTooltip,u.click=this._openTooltip,this._map?this._addFocusListeners():u.add=this._addFocusListeners),this._tooltip.options.sticky&&(u.mousemove=this._moveTooltip),this[l](u),this._tooltipHandlersAdded=!o}},openTooltip:function(o){return this._tooltip&&(this instanceof bi||(this._tooltip._source=this),this._tooltip._prepareOpen(o)&&(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(o){return this._tooltip&&this._tooltip.setContent(o),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(o){var l=typeof o.getElement=="function"&&o.getElement();l&&(ht(l,"focus",function(){this._tooltip._source=o,this.openTooltip()},this),ht(l,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(o){var l=typeof o.getElement=="function"&&o.getElement();l&&l.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(o){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var l=this;this._map.once("moveend",function(){l._openOnceFlag=!1,l._openTooltip(o)});return}this._tooltip._source=o.layer||o.target,this.openTooltip(this._tooltip.options.sticky?o.latlng:void 0)}},_moveTooltip:function(o){var l=o.latlng,u,g;this._tooltip.options.sticky&&o.originalEvent&&(u=this._map.mouseEventToContainerPoint(o.originalEvent),g=this._map.containerPointToLayerPoint(u),l=this._map.layerPointToLatLng(g)),this._tooltip.setLatLng(l)}});var cg=fr.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(o){var l=o&&o.tagName==="DIV"?o:document.createElement("div"),u=this.options;if(u.html instanceof Element?(ta(l),l.appendChild(u.html)):l.innerHTML=u.html!==!1?u.html:"",u.bgPos){var g=Z(u.bgPos);l.style.backgroundPosition=-g.x+"px "+-g.y+"px"}return this._setIconStyles(l,"icon"),l},createShadow:function(){return null}});function YL(o){return new cg(o)}fr.Default=_s;var ms=Ue.extend({options:{tileSize:256,opacity:1,updateWhenIdle:K.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(o){w(this,o)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(o){o._addZoomLimit(this)},onRemove:function(o){this._removeAllTiles(),At(this._container),o._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(cr(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(ur(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(o){return this.options.opacity=o,this._updateOpacity(),this},setZIndex:function(o){return this.options.zIndex=o,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var o=this._clampZoom(this._map.getZoom());o!==this._tileZoom&&(this._tileZoom=o,this._updateLevels()),this._update()}return this},getEvents:function(){var o={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=d(this._onMoveEnd,this.options.updateInterval,this)),o.move=this._onMove),this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},createTile:function(){return document.createElement("div")},getTileSize:function(){var o=this.options.tileSize;return o instanceof B?o:new B(o,o)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(o){for(var l=this.getPane().children,u=-o(-1/0,1/0),g=0,m=l.length,x;g<m;g++)x=l[g].style.zIndex,l[g]!==this._container&&x&&(u=o(u,+x));isFinite(u)&&(this.options.zIndex=u+o(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!K.ielt9){Se(this._container,this.options.opacity);var o=+new Date,l=!1,u=!1;for(var g in this._tiles){var m=this._tiles[g];if(!(!m.current||!m.loaded)){var x=Math.min(1,(o-m.loaded)/200);Se(m.el,x),x<1?l=!0:(m.active?u=!0:this._onOpaqueTile(m),m.active=!0)}}u&&!this._noPrune&&this._pruneTiles(),l&&(q(this._fadeFrame),this._fadeFrame=Y(this._updateOpacity,this))}},_onOpaqueTile:p,_initContainer:function(){this._container||(this._container=wt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var o=this._tileZoom,l=this.options.maxZoom;if(o!==void 0){for(var u in this._levels)u=Number(u),this._levels[u].el.children.length||u===o?(this._levels[u].el.style.zIndex=l-Math.abs(o-u),this._onUpdateLevel(u)):(At(this._levels[u].el),this._removeTilesAtZoom(u),this._onRemoveLevel(u),delete this._levels[u]);var g=this._levels[o],m=this._map;return g||(g=this._levels[o]={},g.el=wt("div","leaflet-tile-container leaflet-zoom-animated",this._container),g.el.style.zIndex=l,g.origin=m.project(m.unproject(m.getPixelOrigin()),o).round(),g.zoom=o,this._setZoomTransform(g,m.getCenter(),m.getZoom()),p(g.el.offsetWidth),this._onCreateLevel(g)),this._level=g,g}},_onUpdateLevel:p,_onRemoveLevel:p,_onCreateLevel:p,_pruneTiles:function(){if(this._map){var o,l,u=this._map.getZoom();if(u>this.options.maxZoom||u<this.options.minZoom){this._removeAllTiles();return}for(o in this._tiles)l=this._tiles[o],l.retain=l.current;for(o in this._tiles)if(l=this._tiles[o],l.current&&!l.active){var g=l.coords;this._retainParent(g.x,g.y,g.z,g.z-5)||this._retainChildren(g.x,g.y,g.z,g.z+2)}for(o in this._tiles)this._tiles[o].retain||this._removeTile(o)}},_removeTilesAtZoom:function(o){for(var l in this._tiles)this._tiles[l].coords.z===o&&this._removeTile(l)},_removeAllTiles:function(){for(var o in this._tiles)this._removeTile(o)},_invalidateAll:function(){for(var o in this._levels)At(this._levels[o].el),this._onRemoveLevel(Number(o)),delete this._levels[o];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(o,l,u,g){var m=Math.floor(o/2),x=Math.floor(l/2),S=u-1,k=new B(+m,+x);k.z=+S;var A=this._tileCoordsToKey(k),N=this._tiles[A];return N&&N.active?(N.retain=!0,!0):(N&&N.loaded&&(N.retain=!0),S>g?this._retainParent(m,x,S,g):!1)},_retainChildren:function(o,l,u,g){for(var m=2*o;m<2*o+2;m++)for(var x=2*l;x<2*l+2;x++){var S=new B(m,x);S.z=u+1;var k=this._tileCoordsToKey(S),A=this._tiles[k];if(A&&A.active){A.retain=!0;continue}else A&&A.loaded&&(A.retain=!0);u+1<g&&this._retainChildren(m,x,u+1,g)}},_resetView:function(o){var l=o&&(o.pinch||o.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),l,l)},_animateZoom:function(o){this._setView(o.center,o.zoom,!0,o.noUpdate)},_clampZoom:function(o){var l=this.options;return l.minNativeZoom!==void 0&&o<l.minNativeZoom?l.minNativeZoom:l.maxNativeZoom!==void 0&&l.maxNativeZoom<o?l.maxNativeZoom:o},_setView:function(o,l,u,g){var m=Math.round(l);this.options.maxZoom!==void 0&&m>this.options.maxZoom||this.options.minZoom!==void 0&&m<this.options.minZoom?m=void 0:m=this._clampZoom(m);var x=this.options.updateWhenZooming&&m!==this._tileZoom;(!g||x)&&(this._tileZoom=m,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),m!==void 0&&this._update(o),u||this._pruneTiles(),this._noPrune=!!u),this._setZoomTransforms(o,l)},_setZoomTransforms:function(o,l){for(var u in this._levels)this._setZoomTransform(this._levels[u],o,l)},_setZoomTransform:function(o,l,u){var g=this._map.getZoomScale(u,o.zoom),m=o.origin.multiplyBy(g).subtract(this._map._getNewPixelOrigin(l,u)).round();K.any3d?bn(o.el,m,g):Gt(o.el,m)},_resetGrid:function(){var o=this._map,l=o.options.crs,u=this._tileSize=this.getTileSize(),g=this._tileZoom,m=this._map.getPixelWorldBounds(this._tileZoom);m&&(this._globalTileRange=this._pxBoundsToTileRange(m)),this._wrapX=l.wrapLng&&!this.options.noWrap&&[Math.floor(o.project([0,l.wrapLng[0]],g).x/u.x),Math.ceil(o.project([0,l.wrapLng[1]],g).x/u.y)],this._wrapY=l.wrapLat&&!this.options.noWrap&&[Math.floor(o.project([l.wrapLat[0],0],g).y/u.x),Math.ceil(o.project([l.wrapLat[1],0],g).y/u.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(o){var l=this._map,u=l._animatingZoom?Math.max(l._animateToZoom,l.getZoom()):l.getZoom(),g=l.getZoomScale(u,this._tileZoom),m=l.project(o,this._tileZoom).floor(),x=l.getSize().divideBy(g*2);return new ut(m.subtract(x),m.add(x))},_update:function(o){var l=this._map;if(l){var u=this._clampZoom(l.getZoom());if(o===void 0&&(o=l.getCenter()),this._tileZoom!==void 0){var g=this._getTiledPixelBounds(o),m=this._pxBoundsToTileRange(g),x=m.getCenter(),S=[],k=this.options.keepBuffer,A=new ut(m.getBottomLeft().subtract([k,-k]),m.getTopRight().add([k,-k]));if(!(isFinite(m.min.x)&&isFinite(m.min.y)&&isFinite(m.max.x)&&isFinite(m.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var N in this._tiles){var W=this._tiles[N].coords;(W.z!==this._tileZoom||!A.contains(new B(W.x,W.y)))&&(this._tiles[N].current=!1)}if(Math.abs(u-this._tileZoom)>1){this._setView(o,u);return}for(var nt=m.min.y;nt<=m.max.y;nt++)for(var pt=m.min.x;pt<=m.max.x;pt++){var he=new B(pt,nt);if(he.z=this._tileZoom,!!this._isValidTile(he)){var Kt=this._tiles[this._tileCoordsToKey(he)];Kt?Kt.current=!0:S.push(he)}}if(S.sort(function(me,mr){return me.distanceTo(x)-mr.distanceTo(x)}),S.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var ke=document.createDocumentFragment();for(pt=0;pt<S.length;pt++)this._addTile(S[pt],ke);this._level.el.appendChild(ke)}}}},_isValidTile:function(o){var l=this._map.options.crs;if(!l.infinite){var u=this._globalTileRange;if(!l.wrapLng&&(o.x<u.min.x||o.x>u.max.x)||!l.wrapLat&&(o.y<u.min.y||o.y>u.max.y))return!1}if(!this.options.bounds)return!0;var g=this._tileCoordsToBounds(o);return $(this.options.bounds).overlaps(g)},_keyToBounds:function(o){return this._tileCoordsToBounds(this._keyToTileCoords(o))},_tileCoordsToNwSe:function(o){var l=this._map,u=this.getTileSize(),g=o.scaleBy(u),m=g.add(u),x=l.unproject(g,o.z),S=l.unproject(m,o.z);return[x,S]},_tileCoordsToBounds:function(o){var l=this._tileCoordsToNwSe(o),u=new xt(l[0],l[1]);return this.options.noWrap||(u=this._map.wrapLatLngBounds(u)),u},_tileCoordsToKey:function(o){return o.x+":"+o.y+":"+o.z},_keyToTileCoords:function(o){var l=o.split(":"),u=new B(+l[0],+l[1]);return u.z=+l[2],u},_removeTile:function(o){var l=this._tiles[o];l&&(At(l.el),delete this._tiles[o],this.fire("tileunload",{tile:l.el,coords:this._keyToTileCoords(o)}))},_initTile:function(o){dt(o,"leaflet-tile");var l=this.getTileSize();o.style.width=l.x+"px",o.style.height=l.y+"px",o.onselectstart=p,o.onmousemove=p,K.ielt9&&this.options.opacity<1&&Se(o,this.options.opacity)},_addTile:function(o,l){var u=this._getTilePos(o),g=this._tileCoordsToKey(o),m=this.createTile(this._wrapCoords(o),a(this._tileReady,this,o));this._initTile(m),this.createTile.length<2&&Y(a(this._tileReady,this,o,null,m)),Gt(m,u),this._tiles[g]={el:m,coords:o,current:!0},l.appendChild(m),this.fire("tileloadstart",{tile:m,coords:o})},_tileReady:function(o,l,u){l&&this.fire("tileerror",{error:l,tile:u,coords:o});var g=this._tileCoordsToKey(o);u=this._tiles[g],u&&(u.loaded=+new Date,this._map._fadeAnimated?(Se(u.el,0),q(this._fadeFrame),this._fadeFrame=Y(this._updateOpacity,this)):(u.active=!0,this._pruneTiles()),l||(dt(u.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:u.el,coords:o})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),K.ielt9||!this._map._fadeAnimated?Y(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(o){return o.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(o){var l=new B(this._wrapX?f(o.x,this._wrapX):o.x,this._wrapY?f(o.y,this._wrapY):o.y);return l.z=o.z,l},_pxBoundsToTileRange:function(o){var l=this.getTileSize();return new ut(o.min.unscaleBy(l).floor(),o.max.unscaleBy(l).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var o in this._tiles)if(!this._tiles[o].loaded)return!1;return!0}});function KL(o){return new ms(o)}var _r=ms.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(o,l){this._url=o,l=w(this,l),l.detectRetina&&K.retina&&l.maxZoom>0?(l.tileSize=Math.floor(l.tileSize/2),l.zoomReverse?(l.zoomOffset--,l.minZoom=Math.min(l.maxZoom,l.minZoom+1)):(l.zoomOffset++,l.maxZoom=Math.max(l.minZoom,l.maxZoom-1)),l.minZoom=Math.max(0,l.minZoom)):l.zoomReverse?l.minZoom=Math.min(l.maxZoom,l.minZoom):l.maxZoom=Math.max(l.minZoom,l.maxZoom),typeof l.subdomains=="string"&&(l.subdomains=l.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(o,l){return this._url===o&&l===void 0&&(l=!0),this._url=o,l||this.redraw(),this},createTile:function(o,l){var u=document.createElement("img");return ht(u,"load",a(this._tileOnLoad,this,l,u)),ht(u,"error",a(this._tileOnError,this,l,u)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(u.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(u.referrerPolicy=this.options.referrerPolicy),u.alt="",u.src=this.getTileUrl(o),u},getTileUrl:function(o){var l={r:K.retina?"@2x":"",s:this._getSubdomain(o),x:o.x,y:o.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var u=this._globalTileRange.max.y-o.y;this.options.tms&&(l.y=u),l["-y"]=u}return E(this._url,n(l,this.options))},_tileOnLoad:function(o,l){K.ielt9?setTimeout(a(o,this,null,l),0):o(null,l)},_tileOnError:function(o,l,u){var g=this.options.errorTileUrl;g&&l.getAttribute("src")!==g&&(l.src=g),o(u,l)},_onTileRemove:function(o){o.tile.onload=null},_getZoomForUrl:function(){var o=this._tileZoom,l=this.options.maxZoom,u=this.options.zoomReverse,g=this.options.zoomOffset;return u&&(o=l-o),o+g},_getSubdomain:function(o){var l=Math.abs(o.x+o.y)%this.options.subdomains.length;return this.options.subdomains[l]},_abortLoading:function(){var o,l;for(o in this._tiles)if(this._tiles[o].coords.z!==this._tileZoom&&(l=this._tiles[o].el,l.onload=p,l.onerror=p,!l.complete)){l.src=P;var u=this._tiles[o].coords;At(l),delete this._tiles[o],this.fire("tileabort",{tile:l,coords:u})}},_removeTile:function(o){var l=this._tiles[o];if(l)return l.el.setAttribute("src",P),ms.prototype._removeTile.call(this,o)},_tileReady:function(o,l,u){if(!(!this._map||u&&u.getAttribute("src")===P))return ms.prototype._tileReady.call(this,o,l,u)}});function ug(o,l){return new _r(o,l)}var dg=_r.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(o,l){this._url=o;var u=n({},this.defaultWmsParams);for(var g in l)g in this.options||(u[g]=l[g]);l=w(this,l);var m=l.detectRetina&&K.retina?2:1,x=this.getTileSize();u.width=x.x*m,u.height=x.y*m,this.wmsParams=u},onAdd:function(o){this._crs=this.options.crs||o.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var l=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[l]=this._crs.code,_r.prototype.onAdd.call(this,o)},getTileUrl:function(o){var l=this._tileCoordsToNwSe(o),u=this._crs,g=z(u.project(l[0]),u.project(l[1])),m=g.min,x=g.max,S=(this._wmsVersion>=1.3&&this._crs===rg?[m.y,m.x,x.y,x.x]:[m.x,m.y,x.x,x.y]).join(","),k=_r.prototype.getTileUrl.call(this,o);return k+T(this.wmsParams,k,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+S},setParams:function(o,l){return n(this.wmsParams,o),l||this.redraw(),this}});function qL(o,l){return new dg(o,l)}_r.WMS=dg,ug.wms=qL;var Mi=Ue.extend({options:{padding:.1},initialize:function(o){w(this,o),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),dt(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 o={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(o.zoomanim=this._onAnimZoom),o},_onAnimZoom:function(o){this._updateTransform(o.center,o.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(o,l){var u=this._map.getZoomScale(l,this._zoom),g=this._map.getSize().multiplyBy(.5+this.options.padding),m=this._map.project(this._center,l),x=g.multiplyBy(-u).add(m).subtract(this._map._getNewPixelOrigin(o,l));K.any3d?bn(this._container,x,u):Gt(this._container,x)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var o in this._layers)this._layers[o]._reset()},_onZoomEnd:function(){for(var o in this._layers)this._layers[o]._project()},_updatePaths:function(){for(var o in this._layers)this._layers[o]._update()},_update:function(){var o=this.options.padding,l=this._map.getSize(),u=this._map.containerPointToLayerPoint(l.multiplyBy(-o)).round();this._bounds=new ut(u,u.add(l.multiplyBy(1+o*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),fg=Mi.extend({options:{tolerance:0},getEvents:function(){var o=Mi.prototype.getEvents.call(this);return o.viewprereset=this._onViewPreReset,o},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Mi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var o=this._container=document.createElement("canvas");ht(o,"mousemove",this._onMouseMove,this),ht(o,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ht(o,"mouseout",this._handleMouseOut,this),o._leaflet_disable_events=!0,this._ctx=o.getContext("2d")},_destroyContainer:function(){q(this._redrawRequest),delete this._ctx,At(this._container),Pt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var o;this._redrawBounds=null;for(var l in this._layers)o=this._layers[l],o._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Mi.prototype._update.call(this);var o=this._bounds,l=this._container,u=o.getSize(),g=K.retina?2:1;Gt(l,o.min),l.width=g*u.x,l.height=g*u.y,l.style.width=u.x+"px",l.style.height=u.y+"px",K.retina&&this._ctx.scale(2,2),this._ctx.translate(-o.min.x,-o.min.y),this.fire("update")}},_reset:function(){Mi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(o){this._updateDashArray(o),this._layers[c(o)]=o;var l=o._order={layer:o,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=l),this._drawLast=l,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(o){this._requestRedraw(o)},_removePath:function(o){var l=o._order,u=l.next,g=l.prev;u?u.prev=g:this._drawLast=g,g?g.next=u:this._drawFirst=u,delete o._order,delete this._layers[c(o)],this._requestRedraw(o)},_updatePath:function(o){this._extendRedrawBounds(o),o._project(),o._update(),this._requestRedraw(o)},_updateStyle:function(o){this._updateDashArray(o),this._requestRedraw(o)},_updateDashArray:function(o){if(typeof o.options.dashArray=="string"){var l=o.options.dashArray.split(/[, ]+/),u=[],g,m;for(m=0;m<l.length;m++){if(g=Number(l[m]),isNaN(g))return;u.push(g)}o.options._dashArray=u}else o.options._dashArray=o.options.dashArray},_requestRedraw:function(o){this._map&&(this._extendRedrawBounds(o),this._redrawRequest=this._redrawRequest||Y(this._redraw,this))},_extendRedrawBounds:function(o){if(o._pxBounds){var l=(o.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new ut,this._redrawBounds.extend(o._pxBounds.min.subtract([l,l])),this._redrawBounds.extend(o._pxBounds.max.add([l,l]))}},_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 o=this._redrawBounds;if(o){var l=o.getSize();this._ctx.clearRect(o.min.x,o.min.y,l.x,l.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 o,l=this._redrawBounds;if(this._ctx.save(),l){var u=l.getSize();this._ctx.beginPath(),this._ctx.rect(l.min.x,l.min.y,u.x,u.y),this._ctx.clip()}this._drawing=!0;for(var g=this._drawFirst;g;g=g.next)o=g.layer,(!l||o._pxBounds&&o._pxBounds.intersects(l))&&o._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(o,l){if(this._drawing){var u,g,m,x,S=o._parts,k=S.length,A=this._ctx;if(k){for(A.beginPath(),u=0;u<k;u++){for(g=0,m=S[u].length;g<m;g++)x=S[u][g],A[g?"lineTo":"moveTo"](x.x,x.y);l&&A.closePath()}this._fillStroke(A,o)}}},_updateCircle:function(o){if(!(!this._drawing||o._empty())){var l=o._point,u=this._ctx,g=Math.max(Math.round(o._radius),1),m=(Math.max(Math.round(o._radiusY),1)||g)/g;m!==1&&(u.save(),u.scale(1,m)),u.beginPath(),u.arc(l.x,l.y/m,g,0,Math.PI*2,!1),m!==1&&u.restore(),this._fillStroke(u,o)}},_fillStroke:function(o,l){var u=l.options;u.fill&&(o.globalAlpha=u.fillOpacity,o.fillStyle=u.fillColor||u.color,o.fill(u.fillRule||"evenodd")),u.stroke&&u.weight!==0&&(o.setLineDash&&o.setLineDash(l.options&&l.options._dashArray||[]),o.globalAlpha=u.opacity,o.lineWidth=u.weight,o.strokeStyle=u.color,o.lineCap=u.lineCap,o.lineJoin=u.lineJoin,o.stroke())},_onClick:function(o){for(var l=this._map.mouseEventToLayerPoint(o),u,g,m=this._drawFirst;m;m=m.next)u=m.layer,u.options.interactive&&u._containsPoint(l)&&(!(o.type==="click"||o.type==="preclick")||!this._map._draggableMoved(u))&&(g=u);this._fireEvent(g?[g]:!1,o)},_onMouseMove:function(o){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var l=this._map.mouseEventToLayerPoint(o);this._handleMouseHover(o,l)}},_handleMouseOut:function(o){var l=this._hoveredLayer;l&&(Ft(this._container,"leaflet-interactive"),this._fireEvent([l],o,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(o,l){if(!this._mouseHoverThrottled){for(var u,g,m=this._drawFirst;m;m=m.next)u=m.layer,u.options.interactive&&u._containsPoint(l)&&(g=u);g!==this._hoveredLayer&&(this._handleMouseOut(o),g&&(dt(this._container,"leaflet-interactive"),this._fireEvent([g],o,"mouseover"),this._hoveredLayer=g)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,o),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(o,l,u){this._map._fireDOMEvent(l,u||l.type,o)},_bringToFront:function(o){var l=o._order;if(l){var u=l.next,g=l.prev;if(u)u.prev=g;else return;g?g.next=u:u&&(this._drawFirst=u),l.prev=this._drawLast,this._drawLast.next=l,l.next=null,this._drawLast=l,this._requestRedraw(o)}},_bringToBack:function(o){var l=o._order;if(l){var u=l.next,g=l.prev;if(g)g.next=u;else return;u?u.prev=g:g&&(this._drawLast=g),l.prev=null,l.next=this._drawFirst,this._drawFirst.prev=l,this._drawFirst=l,this._requestRedraw(o)}}});function gg(o){return K.canvas?new fg(o):null}var ys=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(o){return document.createElement("<lvml:"+o+' class="lvml">')}}catch{}return function(o){return document.createElement("<"+o+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),JL={_initContainer:function(){this._container=wt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Mi.prototype._update.call(this),this.fire("update"))},_initPath:function(o){var l=o._container=ys("shape");dt(l,"leaflet-vml-shape "+(this.options.className||"")),l.coordsize="1 1",o._path=ys("path"),l.appendChild(o._path),this._updateStyle(o),this._layers[c(o)]=o},_addPath:function(o){var l=o._container;this._container.appendChild(l),o.options.interactive&&o.addInteractiveTarget(l)},_removePath:function(o){var l=o._container;At(l),o.removeInteractiveTarget(l),delete this._layers[c(o)]},_updateStyle:function(o){var l=o._stroke,u=o._fill,g=o.options,m=o._container;m.stroked=!!g.stroke,m.filled=!!g.fill,g.stroke?(l||(l=o._stroke=ys("stroke")),m.appendChild(l),l.weight=g.weight+"px",l.color=g.color,l.opacity=g.opacity,g.dashArray?l.dashStyle=b(g.dashArray)?g.dashArray.join(" "):g.dashArray.replace(/( *, *)/g," "):l.dashStyle="",l.endcap=g.lineCap.replace("butt","flat"),l.joinstyle=g.lineJoin):l&&(m.removeChild(l),o._stroke=null),g.fill?(u||(u=o._fill=ys("fill")),m.appendChild(u),u.color=g.fillColor||g.color,u.opacity=g.fillOpacity):u&&(m.removeChild(u),o._fill=null)},_updateCircle:function(o){var l=o._point.round(),u=Math.round(o._radius),g=Math.round(o._radiusY||u);this._setPath(o,o._empty()?"M0 0":"AL "+l.x+","+l.y+" "+u+","+g+" 0,"+65535*360)},_setPath:function(o,l){o._path.v=l},_bringToFront:function(o){cr(o._container)},_bringToBack:function(o){ur(o._container)}},pa=K.vml?ys:Ki,vs=Mi.extend({_initContainer:function(){this._container=pa("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=pa("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){At(this._container),Pt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Mi.prototype._update.call(this);var o=this._bounds,l=o.getSize(),u=this._container;(!this._svgSize||!this._svgSize.equals(l))&&(this._svgSize=l,u.setAttribute("width",l.x),u.setAttribute("height",l.y)),Gt(u,o.min),u.setAttribute("viewBox",[o.min.x,o.min.y,l.x,l.y].join(" ")),this.fire("update")}},_initPath:function(o){var l=o._path=pa("path");o.options.className&&dt(l,o.options.className),o.options.interactive&&dt(l,"leaflet-interactive"),this._updateStyle(o),this._layers[c(o)]=o},_addPath:function(o){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(o._path),o.addInteractiveTarget(o._path)},_removePath:function(o){At(o._path),o.removeInteractiveTarget(o._path),delete this._layers[c(o)]},_updatePath:function(o){o._project(),o._update()},_updateStyle:function(o){var l=o._path,u=o.options;l&&(u.stroke?(l.setAttribute("stroke",u.color),l.setAttribute("stroke-opacity",u.opacity),l.setAttribute("stroke-width",u.weight),l.setAttribute("stroke-linecap",u.lineCap),l.setAttribute("stroke-linejoin",u.lineJoin),u.dashArray?l.setAttribute("stroke-dasharray",u.dashArray):l.removeAttribute("stroke-dasharray"),u.dashOffset?l.setAttribute("stroke-dashoffset",u.dashOffset):l.removeAttribute("stroke-dashoffset")):l.setAttribute("stroke","none"),u.fill?(l.setAttribute("fill",u.fillColor||u.color),l.setAttribute("fill-opacity",u.fillOpacity),l.setAttribute("fill-rule",u.fillRule||"evenodd")):l.setAttribute("fill","none"))},_updatePoly:function(o,l){this._setPath(o,Fe(o._parts,l))},_updateCircle:function(o){var l=o._point,u=Math.max(Math.round(o._radius),1),g=Math.max(Math.round(o._radiusY),1)||u,m="a"+u+","+g+" 0 1,0 ",x=o._empty()?"M0 0":"M"+(l.x-u)+","+l.y+m+u*2+",0 "+m+-u*2+",0 ";this._setPath(o,x)},_setPath:function(o,l){o._path.setAttribute("d",l)},_bringToFront:function(o){cr(o._path)},_bringToBack:function(o){ur(o._path)}});K.vml&&vs.include(JL);function pg(o){return K.svg||K.vml?new vs(o):null}yt.include({getRenderer:function(o){var l=o.options.renderer||this._getPaneRenderer(o.options.pane)||this.options.renderer||this._renderer;return l||(l=this._renderer=this._createRenderer()),this.hasLayer(l)||this.addLayer(l),l},_getPaneRenderer:function(o){if(o==="overlayPane"||o===void 0)return!1;var l=this._paneRenderers[o];return l===void 0&&(l=this._createRenderer({pane:o}),this._paneRenderers[o]=l),l},_createRenderer:function(o){return this.options.preferCanvas&&gg(o)||pg(o)}});var _g=gr.extend({initialize:function(o,l){gr.prototype.initialize.call(this,this._boundsToLatLngs(o),l)},setBounds:function(o){return this.setLatLngs(this._boundsToLatLngs(o))},_boundsToLatLngs:function(o){return o=$(o),[o.getSouthWest(),o.getNorthWest(),o.getNorthEast(),o.getSouthEast()]}});function QL(o,l){return new _g(o,l)}vs.create=pa,vs.pointsToPath=Fe,Ci.geometryToLayer=la,Ci.coordsToLatLng=Bh,Ci.coordsToLatLngs=ha,Ci.latLngToCoords=Gh,Ci.latLngsToCoords=ca,Ci.getFeature=pr,Ci.asFeature=ua,yt.mergeOptions({boxZoom:!0});var mg=ii.extend({initialize:function(o){this._map=o,this._container=o._container,this._pane=o._panes.overlayPane,this._resetStateTimeout=0,o.on("unload",this._destroy,this)},addHooks:function(){ht(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Pt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){At(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(o){if(!o.shiftKey||o.which!==1&&o.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),cs(),Eh(),this._startPoint=this._map.mouseEventToContainerPoint(o),ht(document,{contextmenu:Mn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(o){this._moved||(this._moved=!0,this._box=wt("div","leaflet-zoom-box",this._container),dt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(o);var l=new ut(this._point,this._startPoint),u=l.getSize();Gt(this._box,l.min),this._box.style.width=u.x+"px",this._box.style.height=u.y+"px"},_finish:function(){this._moved&&(At(this._box),Ft(this._container,"leaflet-crosshair")),us(),Lh(),Pt(document,{contextmenu:Mn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(o){if(!(o.which!==1&&o.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var l=new xt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(l).fire("boxzoomend",{boxZoomBounds:l})}},_onKeyDown:function(o){o.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});yt.addInitHook("addHandler","boxZoom",mg),yt.mergeOptions({doubleClickZoom:!0});var yg=ii.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(o){var l=this._map,u=l.getZoom(),g=l.options.zoomDelta,m=o.originalEvent.shiftKey?u-g:u+g;l.options.doubleClickZoom==="center"?l.setZoom(m):l.setZoomAround(o.containerPoint,m)}});yt.addInitHook("addHandler","doubleClickZoom",yg),yt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var vg=ii.extend({addHooks:function(){if(!this._draggable){var o=this._map;this._draggable=new nn(o._mapPane,o._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),o.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),o.on("zoomend",this._onZoomEnd,this),o.whenReady(this._onZoomEnd,this))}dt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Ft(this._map._container,"leaflet-grab"),Ft(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 o=this._map;if(o._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var l=$(this._map.options.maxBounds);this._offsetLimit=z(this._map.latLngToContainerPoint(l.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(l.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;o.fire("movestart").fire("dragstart"),o.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(o){if(this._map.options.inertia){var l=this._lastTime=+new Date,u=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(u),this._times.push(l),this._prunePositions(l)}this._map.fire("move",o).fire("drag",o)},_prunePositions:function(o){for(;this._positions.length>1&&o-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var o=this._map.getSize().divideBy(2),l=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=l.subtract(o).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(o,l){return o-(o-l)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var o=this._draggable._newPos.subtract(this._draggable._startPos),l=this._offsetLimit;o.x<l.min.x&&(o.x=this._viscousLimit(o.x,l.min.x)),o.y<l.min.y&&(o.y=this._viscousLimit(o.y,l.min.y)),o.x>l.max.x&&(o.x=this._viscousLimit(o.x,l.max.x)),o.y>l.max.y&&(o.y=this._viscousLimit(o.y,l.max.y)),this._draggable._newPos=this._draggable._startPos.add(o)}},_onPreDragWrap:function(){var o=this._worldWidth,l=Math.round(o/2),u=this._initialWorldOffset,g=this._draggable._newPos.x,m=(g-l+u)%o+l-u,x=(g+l+u)%o-l-u,S=Math.abs(m+u)<Math.abs(x+u)?m:x;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=S},_onDragEnd:function(o){var l=this._map,u=l.options,g=!u.inertia||o.noInertia||this._times.length<2;if(l.fire("dragend",o),g)l.fire("moveend");else{this._prunePositions(+new Date);var m=this._lastPos.subtract(this._positions[0]),x=(this._lastTime-this._times[0])/1e3,S=u.easeLinearity,k=m.multiplyBy(S/x),A=k.distanceTo([0,0]),N=Math.min(u.inertiaMaxSpeed,A),W=k.multiplyBy(N/A),nt=N/(u.inertiaDeceleration*S),pt=W.multiplyBy(-nt/2).round();!pt.x&&!pt.y?l.fire("moveend"):(pt=l._limitOffset(pt,l.options.maxBounds),Y(function(){l.panBy(pt,{duration:nt,easeLinearity:S,noMoveStart:!0,animate:!0})}))}}});yt.addInitHook("addHandler","dragging",vg),yt.mergeOptions({keyboard:!0,keyboardPanDelta:80});var xg=ii.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(o){this._map=o,this._setPanDelta(o.options.keyboardPanDelta),this._setZoomDelta(o.options.zoomDelta)},addHooks:function(){var o=this._map._container;o.tabIndex<=0&&(o.tabIndex="0"),ht(o,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Pt(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 o=document.body,l=document.documentElement,u=o.scrollTop||l.scrollTop,g=o.scrollLeft||l.scrollLeft;this._map._container.focus(),window.scrollTo(g,u)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(o){var l=this._panKeys={},u=this.keyCodes,g,m;for(g=0,m=u.left.length;g<m;g++)l[u.left[g]]=[-1*o,0];for(g=0,m=u.right.length;g<m;g++)l[u.right[g]]=[o,0];for(g=0,m=u.down.length;g<m;g++)l[u.down[g]]=[0,o];for(g=0,m=u.up.length;g<m;g++)l[u.up[g]]=[0,-1*o]},_setZoomDelta:function(o){var l=this._zoomKeys={},u=this.keyCodes,g,m;for(g=0,m=u.zoomIn.length;g<m;g++)l[u.zoomIn[g]]=o;for(g=0,m=u.zoomOut.length;g<m;g++)l[u.zoomOut[g]]=-o},_addHooks:function(){ht(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Pt(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(o){if(!(o.altKey||o.ctrlKey||o.metaKey)){var l=o.keyCode,u=this._map,g;if(l in this._panKeys){if(!u._panAnim||!u._panAnim._inProgress)if(g=this._panKeys[l],o.shiftKey&&(g=Z(g).multiplyBy(3)),u.options.maxBounds&&(g=u._limitOffset(Z(g),u.options.maxBounds)),u.options.worldCopyJump){var m=u.wrapLatLng(u.unproject(u.project(u.getCenter()).add(g)));u.panTo(m)}else u.panBy(g)}else if(l in this._zoomKeys)u.setZoom(u.getZoom()+(o.shiftKey?3:1)*this._zoomKeys[l]);else if(l===27&&u._popup&&u._popup.options.closeOnEscapeKey)u.closePopup();else return;Mn(o)}}});yt.addInitHook("addHandler","keyboard",xg),yt.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var wg=ii.extend({addHooks:function(){ht(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Pt(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(o){var l=Hf(o),u=this._map.options.wheelDebounceTime;this._delta+=l,this._lastMousePos=this._map.mouseEventToContainerPoint(o),this._startTime||(this._startTime=+new Date);var g=Math.max(u-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),g),Mn(o)},_performZoom:function(){var o=this._map,l=o.getZoom(),u=this._map.options.zoomSnap||0;o._stop();var g=this._delta/(this._map.options.wheelPxPerZoomLevel*4),m=4*Math.log(2/(1+Math.exp(-Math.abs(g))))/Math.LN2,x=u?Math.ceil(m/u)*u:m,S=o._limitZoom(l+(this._delta>0?x:-x))-l;this._delta=0,this._startTime=null,S&&(o.options.scrollWheelZoom==="center"?o.setZoom(l+S):o.setZoomAround(this._lastMousePos,l+S))}});yt.addInitHook("addHandler","scrollWheelZoom",wg);var $L=600;yt.mergeOptions({tapHold:K.touchNative&&K.safari&&K.mobile,tapTolerance:15});var Eg=ii.extend({addHooks:function(){ht(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Pt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(o){if(clearTimeout(this._holdTimeout),o.touches.length===1){var l=o.touches[0];this._startPos=this._newPos=new B(l.clientX,l.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(ht(document,"touchend",Qt),ht(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",l))},this),$L),ht(document,"touchend touchcancel contextmenu",this._cancel,this),ht(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function o(){Pt(document,"touchend",Qt),Pt(document,"touchend touchcancel",o)},_cancel:function(){clearTimeout(this._holdTimeout),Pt(document,"touchend touchcancel contextmenu",this._cancel,this),Pt(document,"touchmove",this._onMove,this)},_onMove:function(o){var l=o.touches[0];this._newPos=new B(l.clientX,l.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(o,l){var u=new MouseEvent(o,{bubbles:!0,cancelable:!0,view:window,screenX:l.screenX,screenY:l.screenY,clientX:l.clientX,clientY:l.clientY});u._simulated=!0,l.target.dispatchEvent(u)}});yt.addInitHook("addHandler","tapHold",Eg),yt.mergeOptions({touchZoom:K.touch,bounceAtZoomLimits:!0});var Lg=ii.extend({addHooks:function(){dt(this._map._container,"leaflet-touch-zoom"),ht(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Ft(this._map._container,"leaflet-touch-zoom"),Pt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(o){var l=this._map;if(!(!o.touches||o.touches.length!==2||l._animatingZoom||this._zooming)){var u=l.mouseEventToContainerPoint(o.touches[0]),g=l.mouseEventToContainerPoint(o.touches[1]);this._centerPoint=l.getSize()._divideBy(2),this._startLatLng=l.containerPointToLatLng(this._centerPoint),l.options.touchZoom!=="center"&&(this._pinchStartLatLng=l.containerPointToLatLng(u.add(g)._divideBy(2))),this._startDist=u.distanceTo(g),this._startZoom=l.getZoom(),this._moved=!1,this._zooming=!0,l._stop(),ht(document,"touchmove",this._onTouchMove,this),ht(document,"touchend touchcancel",this._onTouchEnd,this),Qt(o)}},_onTouchMove:function(o){if(!(!o.touches||o.touches.length!==2||!this._zooming)){var l=this._map,u=l.mouseEventToContainerPoint(o.touches[0]),g=l.mouseEventToContainerPoint(o.touches[1]),m=u.distanceTo(g)/this._startDist;if(this._zoom=l.getScaleZoom(m,this._startZoom),!l.options.bounceAtZoomLimits&&(this._zoom<l.getMinZoom()&&m<1||this._zoom>l.getMaxZoom()&&m>1)&&(this._zoom=l._limitZoom(this._zoom)),l.options.touchZoom==="center"){if(this._center=this._startLatLng,m===1)return}else{var x=u._add(g)._divideBy(2)._subtract(this._centerPoint);if(m===1&&x.x===0&&x.y===0)return;this._center=l.unproject(l.project(this._pinchStartLatLng,this._zoom).subtract(x),this._zoom)}this._moved||(l._moveStart(!0,!1),this._moved=!0),q(this._animRequest);var S=a(l._move,l,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Y(S,this,!0),Qt(o)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,q(this._animRequest),Pt(document,"touchmove",this._onTouchMove,this),Pt(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))}});yt.addInitHook("addHandler","touchZoom",Lg),yt.BoxZoom=mg,yt.DoubleClickZoom=yg,yt.Drag=vg,yt.Keyboard=xg,yt.ScrollWheelZoom=wg,yt.TapHold=Eg,yt.TouchZoom=Lg,e.Bounds=ut,e.Browser=K,e.CRS=kt,e.Canvas=fg,e.Circle=Nh,e.CircleMarker=aa,e.Class=_t,e.Control=Ge,e.DivIcon=cg,e.DivOverlay=ni,e.DomEvent=mL,e.DomUtil=pL,e.Draggable=nn,e.Evented=j,e.FeatureGroup=bi,e.GeoJSON=Ci,e.GridLayer=ms,e.Handler=ii,e.Icon=fr,e.ImageOverlay=da,e.LatLng=tt,e.LatLngBounds=xt,e.Layer=Ue,e.LayerGroup=dr,e.LineUtil=kL,e.Map=yt,e.Marker=oa,e.Mixin=bL,e.Path=rn,e.Point=B,e.PolyUtil=TL,e.Polygon=gr,e.Polyline=Ti,e.Popup=fa,e.PosAnimation=Vf,e.Projection=RL,e.Rectangle=_g,e.Renderer=Mi,e.SVG=vs,e.SVGOverlay=hg,e.TileLayer=_r,e.Tooltip=ga,e.Transformation=Xi,e.Util=st,e.VideoOverlay=lg,e.bind=a,e.bounds=z,e.canvas=gg,e.circle=BL,e.circleMarker=NL,e.control=gs,e.divIcon=YL,e.extend=n,e.featureGroup=OL,e.geoJSON=ag,e.geoJson=jL,e.gridLayer=KL,e.icon=FL,e.imageOverlay=ZL,e.latLng=at,e.latLngBounds=$,e.layerGroup=DL,e.map=yL,e.marker=zL,e.point=Z,e.polygon=UL,e.polyline=GL,e.popup=VL,e.rectangle=QL,e.setOptions=w,e.stamp=c,e.svg=pg,e.svgOverlay=HL,e.tileLayer=ug,e.tooltip=XL,e.transformation=Me,e.version=i,e.videoOverlay=WL;var tb=window.L;e.noConflict=function(){return window.L=tb,this},window.L=e})})(va,va.exports);var J=va.exports;const ub="";function Jh(r,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=r,i}function zg(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Qh(r[0])||!Qh(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return Jh(i,t,e)}function Ng(r,t,e){e===void 0&&(e={});for(var i=0,n=r;i<n.length;i++){var s=n[i];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.")}var h={type:"Polygon",coordinates:r};return Jh(h,t,e)}function Qh(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Bg(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Gg(r){return r.type==="Feature"?r.geometry:r}function Ug(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");var i=Bg(r),n=Gg(t),s=n.type,a=t.bbox,h=n.coordinates;if(a&&jg(i,a)===!1)return!1;s==="Polygon"&&(h=[h]);for(var c=!1,d=0;d<h.length&&!c;d++)if($h(i,h[d][0],e.ignoreBoundary)){for(var f=!1,p=1;p<h[d].length&&!f;)$h(i,h[d][p],!e.ignoreBoundary)&&(f=!0),p++;f||(c=!0)}return c}function $h(r,t,e){var i=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var n=0,s=t.length-1;n<t.length;s=n++){var a=t[n][0],h=t[n][1],c=t[s][0],d=t[s][1],f=r[1]*(a-c)+h*(c-r[0])+d*(r[0]-a)===0&&(a-r[0])*(c-r[0])<=0&&(h-r[1])*(d-r[1])<=0;if(f)return!e;var p=h>r[1]!=d>r[1]&&r[0]<(c-a)*(r[1]-h)/(d-h)+a;p&&(i=!i)}return i}function jg(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}var tc={exports:{}};tc.exports=Ls,tc.exports.default=Ls;function Ls(r,t,e){e=e||2;var i=t&&t.length,n=i?t[0]*e:r.length,s=ec(r,0,n,e,!0),a=[];if(!s||s.next===s.prev)return a;var h,c,d,f,p,_,y;if(i&&(s=Xg(r,t,s,e)),r.length>80*e){h=d=r[0],c=f=r[1];for(var v=e;v<n;v+=e)p=r[v],_=r[v+1],p<h&&(h=p),_<c&&(c=_),p>d&&(d=p),_>f&&(f=_);y=Math.max(d-h,f-c),y=y!==0?32767/y:0}return yr(s,a,e,h,c,y,0),a}function ec(r,t,e,i,n){var s,a;if(n===Ea(r,t,e,i)>0)for(s=t;s<e;s+=i)a=rc(s,r[s],r[s+1],a);else for(s=e-i;s>=t;s-=i)a=rc(s,r[s],r[s+1],a);return a&&bs(a,a.next)&&(xr(a),a=a.next),a}function sn(r,t){if(!r)return r;t||(t=r);var e=r,i;do if(i=!1,!e.steiner&&(bs(e,e.next)||Rt(e.prev,e,e.next)===0)){if(xr(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function yr(r,t,e,i,n,s,a){if(r){!a&&s&&Qg(r,i,n,s);for(var h=r,c,d;r.prev!==r.next;){if(c=r.prev,d=r.next,s?Wg(r,i,n,s):Zg(r)){t.push(c.i/e|0),t.push(r.i/e|0),t.push(d.i/e|0),xr(r),r=d.next,h=d.next;continue}if(r=d,r===h){a?a===1?(r=Hg(sn(r),t,e),yr(r,t,e,i,n,s,2)):a===2&&Vg(r,t,e,i,n,s):yr(sn(r),t,e,i,n,s,1);break}}}}function Zg(r){var t=r.prev,e=r,i=r.next;if(Rt(t,e,i)>=0)return!1;for(var n=t.x,s=e.x,a=i.x,h=t.y,c=e.y,d=i.y,f=n<s?n<a?n:a:s<a?s:a,p=h<c?h<d?h:d:c<d?c:d,_=n>s?n>a?n:a:s>a?s:a,y=h>c?h>d?h:d:c>d?c:d,v=i.next;v!==t;){if(v.x>=f&&v.x<=_&&v.y>=p&&v.y<=y&&Pn(n,h,s,c,a,d,v.x,v.y)&&Rt(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function Wg(r,t,e,i){var n=r.prev,s=r,a=r.next;if(Rt(n,s,a)>=0)return!1;for(var h=n.x,c=s.x,d=a.x,f=n.y,p=s.y,_=a.y,y=h<c?h<d?h:d:c<d?c:d,v=f<p?f<_?f:_:p<_?p:_,w=h>c?h>d?h:d:c>d?c:d,T=f>p?f>_?f:_:p>_?p:_,M=xa(y,v,t,e,i),E=xa(w,T,t,e,i),b=r.prevZ,C=r.nextZ;b&&b.z>=M&&C&&C.z<=E;){if(b.x>=y&&b.x<=w&&b.y>=v&&b.y<=T&&b!==n&&b!==a&&Pn(h,f,c,p,d,_,b.x,b.y)&&Rt(b.prev,b,b.next)>=0||(b=b.prevZ,C.x>=y&&C.x<=w&&C.y>=v&&C.y<=T&&C!==n&&C!==a&&Pn(h,f,c,p,d,_,C.x,C.y)&&Rt(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;b&&b.z>=M;){if(b.x>=y&&b.x<=w&&b.y>=v&&b.y<=T&&b!==n&&b!==a&&Pn(h,f,c,p,d,_,b.x,b.y)&&Rt(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;C&&C.z<=E;){if(C.x>=y&&C.x<=w&&C.y>=v&&C.y<=T&&C!==n&&C!==a&&Pn(h,f,c,p,d,_,C.x,C.y)&&Rt(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Hg(r,t,e){var i=r;do{var n=i.prev,s=i.next.next;!bs(n,s)&&ic(n,i,i.next,s)&&vr(n,s)&&vr(s,n)&&(t.push(n.i/e|0),t.push(i.i/e|0),t.push(s.i/e|0),xr(i),xr(i.next),i=r=s),i=i.next}while(i!==r);return sn(i)}function Vg(r,t,e,i,n,s){var a=r;do{for(var h=a.next.next;h!==a.prev;){if(a.i!==h.i&&ep(a,h)){var c=nc(a,h);a=sn(a,a.next),c=sn(c,c.next),yr(a,t,e,i,n,s,0),yr(c,t,e,i,n,s,0);return}h=h.next}a=a.next}while(a!==r)}function Xg(r,t,e,i){var n=[],s,a,h,c,d;for(s=0,a=t.length;s<a;s++)h=t[s]*i,c=s<a-1?t[s+1]*i:r.length,d=ec(r,h,c,i,!1),d===d.next&&(d.steiner=!0),n.push(tp(d));for(n.sort(Yg),s=0;s<n.length;s++)e=Kg(n[s],e);return e}function Yg(r,t){return r.x-t.x}function Kg(r,t){var e=qg(r,t);if(!e)return t;var i=nc(e,r);return sn(i,i.next),sn(e,e.next)}function qg(r,t){var e=t,i=r.x,n=r.y,s=-1/0,a;do{if(n<=e.y&&n>=e.next.y&&e.next.y!==e.y){var h=e.x+(n-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=i&&h>s&&(s=h,a=e.x<e.next.x?e:e.next,h===i))return a}e=e.next}while(e!==t);if(!a)return null;var c=a,d=a.x,f=a.y,p=1/0,_;e=a;do i>=e.x&&e.x>=d&&i!==e.x&&Pn(n<f?i:s,n,d,f,n<f?s:i,n,e.x,e.y)&&(_=Math.abs(n-e.y)/(i-e.x),vr(e,r)&&(_<p||_===p&&(e.x>a.x||e.x===a.x&&Jg(a,e)))&&(a=e,p=_)),e=e.next;while(e!==c);return a}function Jg(r,t){return Rt(r.prev,r,t.prev)<0&&Rt(t.next,r,r.next)<0}function Qg(r,t,e,i){var n=r;do n.z===0&&(n.z=xa(n.x,n.y,t,e,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==r);n.prevZ.nextZ=null,n.prevZ=null,$g(n)}function $g(r){var t,e,i,n,s,a,h,c,d=1;do{for(e=r,r=null,s=null,a=0;e;){for(a++,i=e,h=0,t=0;t<d&&(h++,i=i.nextZ,!!i);t++);for(c=d;h>0||c>0&&i;)h!==0&&(c===0||!i||e.z<=i.z)?(n=e,e=e.nextZ,h--):(n=i,i=i.nextZ,c--),s?s.nextZ=n:r=n,n.prevZ=s,s=n;e=i}s.nextZ=null,d*=2}while(a>1);return r}function xa(r,t,e,i,n){return r=(r-e)*n|0,t=(t-i)*n|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function tp(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function Pn(r,t,e,i,n,s,a,h){return(n-a)*(t-h)>=(r-a)*(s-h)&&(r-a)*(i-h)>=(e-a)*(t-h)&&(e-a)*(s-h)>=(n-a)*(i-h)}function ep(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!ip(r,t)&&(vr(r,t)&&vr(t,r)&&np(r,t)&&(Rt(r.prev,r,t.prev)||Rt(r,t.prev,t))||bs(r,t)&&Rt(r.prev,r,r.next)>0&&Rt(t.prev,t,t.next)>0)}function Rt(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function bs(r,t){return r.x===t.x&&r.y===t.y}function ic(r,t,e,i){var n=Cs(Rt(r,t,e)),s=Cs(Rt(r,t,i)),a=Cs(Rt(e,i,r)),h=Cs(Rt(e,i,t));return!!(n!==s&&a!==h||n===0&&Ts(r,e,t)||s===0&&Ts(r,i,t)||a===0&&Ts(e,r,i)||h===0&&Ts(e,t,i))}function Ts(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function Cs(r){return r>0?1:r<0?-1:0}function ip(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&ic(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function vr(r,t){return Rt(r.prev,r,r.next)<0?Rt(r,t,r.next)>=0&&Rt(r,r.prev,t)>=0:Rt(r,t,r.prev)<0||Rt(r,r.next,t)<0}function np(r,t){var e=r,i=!1,n=(r.x+t.x)/2,s=(r.y+t.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&n<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==r);return i}function nc(r,t){var e=new wa(r.i,r.x,r.y),i=new wa(t.i,t.x,t.y),n=r.next,s=t.prev;return r.next=t,t.prev=r,e.next=n,n.prev=e,i.next=e,e.prev=i,s.next=i,i.prev=s,i}function rc(r,t,e,i){var n=new wa(r,t,e);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function xr(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function wa(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Ls.deviation=function(r,t,e,i){var n=t&&t.length,s=n?t[0]*e:r.length,a=Math.abs(Ea(r,0,s,e));if(n)for(var h=0,c=t.length;h<c;h++){var d=t[h]*e,f=h<c-1?t[h+1]*e:r.length;a-=Math.abs(Ea(r,d,f,e))}var p=0;for(h=0;h<i.length;h+=3){var _=i[h]*e,y=i[h+1]*e,v=i[h+2]*e;p+=Math.abs((r[_]-r[v])*(r[y+1]-r[_+1])-(r[_]-r[y])*(r[v+1]-r[_+1]))}return a===0&&p===0?0:Math.abs((p-a)/a)};function Ea(r,t,e,i){for(var n=0,s=t,a=e-i;s<e;s+=i)n+=(r[a]-r[s])*(r[s+1]+r[a+1]),a=s;return n}Ls.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},i=0,n=0;n<r.length;n++){for(var s=0;s<r[n].length;s++)for(var a=0;a<t;a++)e.vertices.push(r[n][s][a]);n>0&&(i+=r[n-1].length,e.holes.push(i))}return e};const db="";var rp={exports:{}};const sc=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],si=(()=>{if(typeof document>"u")return!1;const r=sc[0],t={};for(const e of sc)if((e==null?void 0:e[1])in document){for(const[n,s]of e.entries())t[r[n]]=s;return t}return!1})(),oc={change:si.fullscreenchange,error:si.fullscreenerror};let ve={request(r=document.documentElement,t){return new Promise((e,i)=>{const n=()=>{ve.off("change",n),e()};ve.on("change",n);const s=r[si.requestFullscreen](t);s instanceof Promise&&s.then(n).catch(i)})},exit(){return new Promise((r,t)=>{if(!ve.isFullscreen){r();return}const e=()=>{ve.off("change",e),r()};ve.on("change",e);const i=document[si.exitFullscreen]();i instanceof Promise&&i.then(e).catch(t)})},toggle(r,t){return ve.isFullscreen?ve.exit():ve.request(r,t)},onchange(r){ve.on("change",r)},onerror(r){ve.on("error",r)},on(r,t){const e=oc[r];e&&document.addEventListener(e,t,!1)},off(r,t){const e=oc[r];e&&document.removeEventListener(e,t,!1)},raw:si};Object.defineProperties(ve,{isFullscreen:{get:()=>!!document[si.fullscreenElement]},element:{enumerable:!0,get:()=>document[si.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>!!document[si.fullscreenEnabled]}}),si||(ve={isEnabled:!1});const sp=Wh(Object.freeze(Object.defineProperty({__proto__:null,default:ve},Symbol.toStringTag,{value:"Module"})));/*!
|
|
5
5
|
* Based on package 'screenfull'
|
|
6
6
|
* v5.2.0 - 2021-11-03
|
|
7
7
|
* (c) Sindre Sorhus; MIT License
|
|
8
8
|
* Added definition for using screenfull as an amd module
|
|
9
9
|
* Must be placed before the definition of leaflet.fullscreen
|
|
10
10
|
* as it is required by that
|
|
11
|
-
*/(function(r){(function(t,e){r.exports?r.exports.screenfull=e():t.screenfull=e()})(typeof self<"u"?self:
|
|
11
|
+
*/(function(r){(function(t,e){r.exports?r.exports.screenfull=e():t.screenfull=e()})(typeof self<"u"?self:ri,function(){var t=typeof window<"u"&&typeof window.document<"u"?window.document:{},e=function(){for(var s,a=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],h=0,c=a.length,d={};h<c;h++)if(s=a[h],s&&s[1]in t){for(h=0;h<s.length;h++)d[a[0][h]]=s[h];return d}return!1}(),i={change:e.fullscreenchange,error:e.fullscreenerror},n={request:function(s,a){return new Promise((function(h,c){var d=(function(){this.off("change",d),h()}).bind(this);this.on("change",d),s=s||t.documentElement;var f=s[e.requestFullscreen](a);f instanceof Promise&&f.then(d).catch(c)}).bind(this))},exit:function(){return new Promise((function(s,a){if(!this.isFullscreen){s();return}var h=(function(){this.off("change",h),s()}).bind(this);this.on("change",h);var c=t[e.exitFullscreen]();c instanceof Promise&&c.then(h).catch(a)}).bind(this))},toggle:function(s,a){return this.isFullscreen?this.exit():this.request(s,a)},onchange:function(s){this.on("change",s)},onerror:function(s){this.on("error",s)},on:function(s,a){var h=i[s];h&&t.addEventListener(h,a,!1)},off:function(s,a){var h=i[s];h&&t.removeEventListener(h,a,!1)},raw:e};return e?(Object.defineProperties(n,{isFullscreen:{get:function(){return!!t[e.fullscreenElement]}},element:{enumerable:!0,get:function(){return t[e.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return!!t[e.fullscreenEnabled]}}}),n):{isEnabled:!1}});/*!
|
|
12
12
|
* leaflet.fullscreen
|
|
13
|
-
*/(function(t,e){r.exports?r.exports=e(Mh(),Ng):e(t.L,t.screenfull)})(typeof self<"u"?self:qe,function(t,e){return t.Control.FullScreen=t.Control.extend({options:{position:"topleft",title:"Full Screen",titleCancel:"Exit Full Screen",forceSeparateButton:!1,forcePseudoFullscreen:!1,fullscreenElement:!1},_screenfull:e,onAdd:function(i){var n="leaflet-control-zoom-fullscreen",o,a="";return i.zoomControl&&!this.options.forceSeparateButton?o=i.zoomControl._container:o=t.DomUtil.create("div","leaflet-bar"),this.options.content?a=this.options.content:n+=" fullscreen-icon",this._createButton(this.options.title,n,a,o,this.toggleFullScreen,this),this._map.fullscreenControl=this,this._map.on("enterFullscreen exitFullscreen",this._toggleState,this),o},onRemove:function(){t.DomEvent.off(this.link,"click",t.DomEvent.stop).off(this.link,"click",this.toggleFullScreen,this),this._screenfull.isEnabled&&(t.DomEvent.off(this._container,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).off(this._container,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,this),t.DomEvent.off(document,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).off(document,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,this))},_createButton:function(i,n,o,a,h,c){return this.link=t.DomUtil.create("a",n,a),this.link.href="#",this.link.title=i,this.link.innerHTML=o,this.link.setAttribute("role","button"),this.link.setAttribute("aria-label",i),L.DomEvent.disableClickPropagation(a),t.DomEvent.on(this.link,"click",t.DomEvent.stop).on(this.link,"click",h,c),this._screenfull.isEnabled&&(t.DomEvent.on(a,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).on(a,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,c),t.DomEvent.on(document,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).on(document,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,c)),this.link},toggleFullScreen:function(){var i=this._map;i._exitFired=!1,i._isFullscreen?(this._screenfull.isEnabled&&!this.options.forcePseudoFullscreen?this._screenfull.exit():(t.DomUtil.removeClass(this.options.fullscreenElement?this.options.fullscreenElement:i._container,"leaflet-pseudo-fullscreen"),i.invalidateSize()),i.fire("exitFullscreen"),i._exitFired=!0,i._isFullscreen=!1):(this._screenfull.isEnabled&&!this.options.forcePseudoFullscreen?this._screenfull.request(this.options.fullscreenElement?this.options.fullscreenElement:i._container):(t.DomUtil.addClass(this.options.fullscreenElement?this.options.fullscreenElement:i._container,"leaflet-pseudo-fullscreen"),i.invalidateSize()),i.fire("enterFullscreen"),i._isFullscreen=!0)},_toggleState:function(){this.link.title=this._map._isFullscreen?this.options.title:this.options.titleCancel,this._map._isFullscreen?L.DomUtil.removeClass(this.link,"leaflet-fullscreen-on"):L.DomUtil.addClass(this.link,"leaflet-fullscreen-on")},_handleFullscreenChange:function(){var i=this._map;i.invalidateSize(),!this._screenfull.isFullscreen&&!i._exitFired&&(i.fire("exitFullscreen"),i._exitFired=!0,i._isFullscreen=!1)}}),t.Map.include({toggleFullscreen:function(){this.fullscreenControl.toggleFullScreen()}}),t.Map.addInitHook(function(){this.options.fullscreenControl&&this.addControl(t.control.fullscreen(this.options.fullscreenControlOptions))}),t.control.fullscreen=function(i){return new t.Control.FullScreen(i)},{leaflet:t,screenfull:e}})})(zg);const Bg=j.defineComponent({name:"CoordinatesVerifyPolygon",props:{dataPolygon:Object,iconMarker:Object,coordinatesMap:Array,checkPointInPolygon:Function},data(){return{markerIconDefault:{iconUrl:ss,iconSize:[25,41],iconAnchor:[12,41]}}},mounted(){this.verificarPuntoEnPoligono()},methods:{verificarPuntoEnPoligono(){var f;const r=this.iconMarker?this.iconMarker:this.markerIconDefault,t=(f=this.dataPolygon)==null?void 0:f.geometry.coordinates[0].map(p=>[p[1],p[0]]),e=JSON.parse(JSON.stringify(t)),i=[this.coordinatesMap?this.coordinatesMap[0]:0,this.coordinatesMap?this.coordinatesMap[1]:0],n=Q.map("maps",{fullscreenControl:!0}).setView([this.coordinatesMap?this.coordinatesMap[0]:0,this.coordinatesMap?this.coordinatesMap[1]:0],this.coordinatesMap?this.coordinatesMap[2]:0);Q.tileLayer("https://tile.openstreetmaps.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(n),Q.polygon(e).addTo(n);const o=[this.coordinatesMap?this.coordinatesMap[0]:0,this.coordinatesMap?this.coordinatesMap[1]:0],a=Q.icon(r);Q.marker(o,{icon:a}).addTo(n);const h=hg(i),c=cg([t]),d=xg(h,c);this.checkPointInPolygon&&this.checkPointInPolygon(d)}}}),OL="",oa=(r,t)=>{const e=r.__vccOpts||r;for(const[i,n]of t)e[i]=n;return e},Gg={ref:"maps",id:"maps"};function Ug(r,t,e,i,n,o){return j.openBlock(),j.createElementBlock("div",Gg,null,512)}const jg=oa(Bg,[["render",Ug]]),Zg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAANHElEQVR4nOWbe3BUVZ7HP/fefiSdTtKEJsggBHnYBqVgwBKNyjiC4ojLw5Wt0t2ZcX2sU1SN1G7t1DijjlU66oiOO85ooazM1uBjRpQRJhAFh4criEEIUcRwI+EVyfOa3KQ7nX7de/eP7gSSe7tzO+ngH/utoiqce87v/M73/n6/8zu/c1swDIP/z3CMpnC/L5APLAMWAfOBywAx9VhI/RsMA6gH9gE7gEpFlcOjpaMwGhbg9wUCwL8BK4FxQByIleh+90RtcrRYH+Mo0oscDlwOwBEjKvaIIboFVWiWztIhtZMg0SeuHXgLeFlR5aO51jWnBPh9ge8AvwDuIfkmI5O0svby2GzfJG2Kb7w2wSEiZbQ6HYOg2GmccjQIXzhrOen46vzHfwQeU1T561zpnDMC/L7A/cCjgA/Qro5dd3pu9FpK9LGzs1IIgQQaAA4k2qQmvcZ1gMOuajFlFRHgIUWVX8iF3iMmwO8LFAJrgbuArvL4nCNLe+/wOw1XuYG1k2epImAQFkLa9vxK/ajzsCPVuA24U1Hl4Iikj4QAvy8wA9gEzBirl554MPiz1gja98XUsoUcLP98aOhExO74tvx3pXpHnQicAW5SVLl+uDKHTYDfF5gNfAi458TmNS/uXTlRwHC5cKAzOltrn3voGFS7d+t78naIQC9wjaLKnw1L5nAI8PsCU4HDAPOjCw7eFLntRrtjDQw0dJxI/TQJCMTREAEJCcMmgfvdu42dee8JJOPC5Yoqn8huJcMgwO8LuIETgK8ieuPB70duWWDH0Asn5TN2TjET5ozholnFuKe4yC9xIQgCkWCc6OkYHXUhzhxqo+tYGOVItx31qXbvMz7I2ywArUCZosrRbNYzHAI+AK5bFLm5dn500dVJNdKjdJ6Pqx6+lOkrJmQ1T/P+Tg4+U0/DlpaM/QQkap3VVHo2AuxUVHlRNvNkRYDfF1gF/LYsMf3MHT33XJo/RCJZ8UQ5Vz1yaTb6mFC/8Sy7HzxCb6v1i026lIuP8jazz/0hwCpFldfalW+bAL8vUEIyK/v60a41/ghxjxvngD4iAkEilE4rZvk7VzNuTrFdPTIiFkyw/YeHOLblLA4kk8UlSCDi4vmiR4gIEYASRZU77cgWh+7Sjz8A4WsiCzUd3ZOPy9ShlziLls3i3i9vsrX4E5WtHF1/esh+rkIH/7B5PteuLkcCU4h04kTEYGF4+fm62oItAvy+wGTgTq9RpC6MLr5EQLTY6gw8Mz3M31yO6BpabO2LDVQu/YQP7qtlx49rbSlb8btyLr+3zGQByV3D4LuJucyMzwb4Z78vMMmOTLsW8BAQuy28Mm2EFZ0i9+9daEvYwUcb2P3TI/0U1m1o5K8/2Gtr7MJX53DRlb60z2/pXd7350N25A1JgN8XcAE/8hre0PTEZdPSiVm6eT55Y8xuMRjv/+QQu3/92YAs0UCj8f1ONl67Dy2mDylj2XvXILmtVS8wPExPzAS42+8LOC07DdB8aNwGSDdEbo6bvQ9A4PL7LmbKreOHFLR9SQ1fvHIaJ5JJhoFO08ff8D+BHajHQxnl5Ptd/ODNKy2fGQgs7l0G4AGWDKWTHQKWArFAfHah1fIll8iC567IKCDWneD1ebs4WnUGZ8at0yB0Ksbrs/bQvD9zEJ9++wTGBAotn5XoY/DpYyBZjMkIOwRUlGllMYfhKrCygInfK8FdnN7Sws1RXrtiJ0pNEBHBRpprkIhobKzYx5ldrRl7Tr7Rn0YCzEi6wQK/L+DJJMMOAaUXJ6Y5nEiWp7uJ149NO7C1RuUv8z8i2BixMc1AGOhsWrSf+r+kr31MXZre7crjswCmAnMyzWOHgNDExGTJKt0VMLj45lLLQac3t/HGvF10NWb25/QwEAyRqjtr+PiROsseZbeMx+1zWtpUygUgWYdMCzsEuHzGGGHwJAk0nPlOLrrCnPAcfaWRyhUHEBBHWBNI7u8Hnqxn5301lj3GzfUimoIq59cUJ2eawQ4B4XyjwBS5JES8l3iQCgaKOPLyaap+coAYiZwWRL5c38TeX5ktoXhqIWDeOp24+/60DhQp2CEg5jJcZooRKfCbI3rjzlZcOBBzXA1KkKDtow5Te1FpHpqFE0hGv8oZg6Cde4Fe0px4BdHc/L0/zKZoeiExNcbJba0EG3ttTJEekluk/IeTkPIl5q4252GCaJ2dOM8d1DJuO3YIKIkT093kDWgUMYj0aKbOBRe5ue7pcgC2/uOBERPg9DpY9N9z0j7vCWo4MDDSW1zGyoodAvLCYk/cqxUNyHMNBEKnw0l+08wdD5kJ6kP+ODeSKznQMKCnyXqrNDSDeI+Gs8DCC4FwYxg9lWEMmJt4358Z7xDsEKCflc5GS7UJBYMf9LbFaP9CZdwsnw0x5zDvP6dR8eRMJGcyBBmGwfG/NrPtnz4dwmDNaP6kk8GDBASCQn+1/Fim8XaCYHuH1IRuOgAnc7qze2zVHQag/F8mIbnE/ttBQRSYccd3cHqs33I6KEe6CTVFTAYYJ4HqaAXoAD7NJMMOATXHHF86tdSebFKiVrWn7Xno/SZuaouHEpZBNRNOVrVa6hQnwQlHA8D/KqrclkmGHQL+3il2aEGxs9FqXz9Z1YqhZ2e3Vv0NPRkLssHJLS2YA5CAWxD5zHkQkrdHGWGHgEogsdf9gWEVaXtaohxcc9yGmNyivbaLpv3mvEBA53Pn532Z4Kah5AxJQKq4+P4RV22JiB62ekn7H60jbrElalHr4oYeN7cbumHZX4vqlhaz/ceH0+pc7foIoMpOYdRuSWydgeHa49qtamhIg4bpCdh6e7VpkJXiAuA0Z9ZILhHDghitV0sGzPNw8DcNtH+uDpKbdNAGsZF2qQng+aEWBdmVxfdLSPOe7nop2kKb1zMoMRIwmHFXGbe+8d3+to5jIQ78ph4tlAyhIjC+YgxzV09DsDhfNvythboNZ+jza1EUuOyeSUy95dyx97Pf1/P31fVIDLQ4DQ0Dkbe962iQGk4pqnxJrglYAfzphuiC2JWRJWPzBsWD5AIFbnzqCmb9Yqotmdmi+Z12/rxyP4JF3hciStDRyPqCdQA/UlT5NTsybd8LKKr8LlDzseuTggKL80XyFt+g6peHqX5q2LfVaXGqqoXXVn6Y9sMiL4Vsy9sK0Gp38ZDdxQjAizEh1lPj2hlL18GNg08erqNyxQFaqrNPkgaj+1SYvT//kneXVOPEaUp5kxDoFptoSfr+6mzkD+dytBqY/e/dj0sFRt6QqfTMuydx1S8vxTfDm9U80a44Nc83UP24PGRfHZG1hU/SKXbWK6ocyGae4RAwH9g+NXFZ9K6eu0vtGtElS8Yz/fYJlC0uxTsx37JPpDPG2Q87OFHZzFdvNxELJiz7Dcanrn1sz98CcLWiyubtKAOG+4HEJmDxvaFV7aXalCnZZPCCKFA83UNRmQePP1m1iQYTdJ/uoftED/GeoS9G+mAAMSHOs0UPA7yjqPLKLFRJ6jNMArxAl4QUXN39sDPf8Hqyy+KTIRPOP033SbCvj4HOOu/vaJdaNKBYUeWerNQg+yAIgKLKIeBfNbTidzxvugSLmlxmnFukMKAtm5chcMC9l3apBeCe4SwehkkAgKLKG4DdZxzHHfUOGXDkuAqYHgYQEmLsynsPYFdKl2Fh2ASksBxIbCrYQI+okL7+kzv0ZZRvF6xFQ0sAt49E3ogIUFS5G1ipofFH70uA+ZyfWxgYSGz0bOCs9DXASkWVu0YicaQWgKLKm4H1XUIXW/O2ESGGY+RiTZAQiQIHnbuQnV8ArE/NPSLkRFNFle8Dvvrc/TG6o5MuRvT1qiW66MEhJtjh2QbwVWrOESOXr2ohwO8LXqBDNNfpRgaBBDFe8j4zYK5cIGcEKKrcCCxPkOBPhc+gC9nfCGfCW4Wv0i10A6xIzZUT5NRZFVXeAjwOsL5gLSqxEV2RORCJEmNT/pu0i60AT+TC789HzqOVosqPAZUtUjOH83cQJmH729/B6CTMGVcdda7DAFsVVf5VLnWFUfrJDIDfF6gHZtwQuZWK6PWWV9hD4ZDjEO8VvAXJoDeyT07TIPf71TlUAME9eVUcdx7FyIIAAWiTWvoWH0zJGhWMGgGKKivA9QAbPa9zQjpOmGjGbwYkRGLEaRXbWOftr2len5I1KhhNCyD1I4alAH/2rsWQetEzJMxR4kiCwbrC5/qalg33hxB2MaoEACiqXAncD/Bf3qdQxG/QLE6PAgYtQhdPFz3S1/SAosp/G239Rp0AAEWVXwV+DvBK4bOEhZDJFRLEeKOw3+wfUlR53YXQ7YIQAKCo8hpgDcALRb8mLJw7vifQeK7oCeJCDGCNosrPWEvJPUZtG0wHvy/wAvAgwH90P4aAyMuFz9GTvM9/UVHln15IfS44AQB+X+AlYJWQqvIbyZiwVlHlVRdal2+FAAC/L/Ay8EDqv+sUVX4gU//RwrdGAIDfF3gWQFHln31bOvwfX7MkK809f/0AAAAASUVORK5CYII=",Wg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPI0lEQVR4nMWbe3RU1b3HP/uceWXymoRJQgiIEDGiolARWx/XFz56W7Raq9d6XeqqVltb8d1aqtfWKmpRsFitovVZH3i92qVYpMq1YrHVoghCOEh4hIS8TpKTZPKYmXP2vn/MZMIwk8zkxf2ulbWyf3vv3/79vmefvX+/vc8IpRTjiWCgaipwAjAXOBooB8oAf7xJGGgFGoBtwBfA303L2DKuhsUhxouAYKDqEuAa4DRAH4GKdcALwErTMjrG0LQkjDkBwUDVdcBPgKP6Zb7pXnKOd5NfmUtOuQ+9XEfP0RCAjCrsNgfZKumsCdG9Kay6P+8Vslf2G9YCPAk8bFpG+5gayxgSEAxUnQ08AMwG0As0yhYUU3hGHt5KD7rjwtEclJAIJZL6KhRSKtzChdQkdpcdsT9XzXVrGrtCH/XmAEEgBNxjWsZjY2JwHGNCQDBQ9QhwQ0wjTLpmAhPOL0L4BZoQMNwhNIHjOACodvVxwxMtG1rXdM4CjgE+Aa42LaNu1IYzSgKCgapy4E1gHkDwO0WUXBTAO8mDAJQYHblCCRAghcKxnJU776iv7anuuxAIABeblvH+qAZgFAQEA1UzgQ+AUi1PMOO/DsE/14ca9uPOHkrJvtBfe5+vWVx/KnA4cJlpGS+PRueICAgGqmYAnwF5vmkeDl0yEX9RLlI4o7ElIxQKTWi0r+l8bvd9DecAE4FLTct4ZaQ6h01AMFBVCHwFlOj5GrNWHobm0XF0O2VxGwrx2Q0q9qq4HBdKKBzNGVJPv73tq7rW1j7UOBcoAE43LeODYTkSx0gI+BSYm1PpZco9ZfjLfVn1O8I/g9n5x1LhLSfflU8uflAQ0aOEot20qBaMnq/4R8unREU0C8MF7a+Gqnc/UT+D2DJbYVpGy7CcAVzDaRwMVD1ALKJjxqOTwZPhSWlwUsHXuaBkAXPyj808wAQwy1pZ0/Y+T+97HiTouo5EprYVUPK9wMyG6sa94Q+dycA7wPHD8QeGMQOCgapZwCaAiT8qliXfK9Zcmk66/rrU8bl83Db1Bk4OnDhcmwBoiDTyx6YXWNO0Frfmir8vyVACfL25csPFX4TsLlkALDQt43fDGWc4BGwCZvln5TDjkQo0oaVd74USHFF4OL+auohiV1FKva1szGgrTZFmpJLku/Kp8JaTo+WkHffJlqd5o3YVUW2w10IQqYl0bL16VwExmgpNy+jMyimyJCAYqPo28Jaep3H065VKeETK8xBA1HGYX3Qav6y8PUXH6y1/Zp21nn3hRtqibUl1eXouQXeQWXlHcUnZhUz0lCXV/6vzc241fonLpaW1T0rBrtv3Wl0begLA46Zl/DijU/12Z0nAVmDmxCuCzsQrAzokGyIQ2NLhxKITuHf6XUl1W7qqWV7/B3b07YIsxtLQuGzixVxRflmSfEPX59y6fRG6lppXKSDaEu3YevEuP+AGirPNG9JTuh+CgarjgZkARefmOZrjTmnjSIdc4U9x/q+N73PzjkXs6N2ZlfMAEskLDa9wX+1DSfLj8ufwzSnnEHGiKaG1BuQW5RX6TnC3xkXXZTUYWRAAXAuQc4w76irTPUpLdaQvEuGuI3+WJFsdepflO1fgZLGlpUDA38yPuG37oiTx7aULKRUlSD3ZBgU4IkrFzSUasfOFH2Q7VDYEXABQ+f2pEk2gxAFbkoJvlMxjnm9uQrSu5SOW7XyK7tzQ8BOhOBxhs7FvK0tqHkmS3z/zbkSaLcF22RSWFZYWzMhtByqDgaqKbMYZkoBgoGoeUKz5NMRc5XGlO9cQcP3ka5JES/c9huOEETL7yDAdlGPzbtdaNnZuSsgO81dSrpeltNWUhqNscuZ5mgAJVGYzRqYZ8G8Avtle6RWe1AVTQKV7OtN9hyZE6zv/SacMjVlSpJRkyb7lSbKTCk+IBQEHQHdc5Mz29G8xX8tGfyYCZgPknKA5mkwNGjWlMX/SaUmyJ/Y+xYjnPfAfZRcxr+C4JFlDbyPr2tcnyvNLT0MJlZIz6Gi4j3QFgQiQrGQQZCKgEqC0okT2+npTKoXUODbv6ER5S2gb9ZHGbMZN1QX858RLuXrSFdxXeTdlB8QCfzbfTvw/wzuDUm8QoZLNj7gi5PvypxM7PRqTV6AMQFQIqdupTW09SqEqTJQ3dH4GqTFSRghgQfBbXFn+/YTsxaNW4I9Hh0JBi92a1Odw32E4up2sRwmkkDqxc8TSbMbOREABoPQCPW07N258ujdRrgvXD7rfD0aLAM6dcDY3TEneuv/U+DIRFU006rF7cNTAeUOJuwQtvfk24InbnhGZCPACSnhESjslFV7di1cbIKDdsVIUzM2fw9MzH+M7pedzYAghgLOK53PLIT9Nkq/Y9xzPNryMrQaecFiGCctIojzBV4jtpM0SFdBDLCLMiEzpsASUEGlWNQFImVQhDuBzfvHp/HzqzQBcX3E1jrJ5q3lV4jBkQfBbKU/+d3V/4O3mVYNPmTgyhPCR+F9GZJoBPYCSUWUfWCGEIKyiRPZ7KgF38qw7OvfIpPINk6/j+MK5aMDc/Lkpzq9seZO3m1eRLnzwal68midRbg934kr/ZkKMvq6hHOtHJgJaAWSvk5ZNW9n0yoHdYapvMmq/rWnZ3t/zbuvapD53TvsZ55cs4M5pyRnju23vs6Lu6bTOKwV+PQddDARiTdFmZPpZ4CZGgDW0azFkIqAO0MKN0XC6OalLF02qOVE+ueCklE1gSe3S2OlOHDmaj+sn/xC/PpD/P9XwAg/tWTaoEULAtJxpSbLqnm1IKQ9oJ5CO7AaKiN01ZkQmAqoBEdkSRempC47UbYyOHYny1JxDmOabktRGAa80vZYyE/rxbvtaXm1YGVtsBjFCAP8+4ZxEeVuPQXu0A11LNj9q23ikp4bY9r0tg29AZgI+BYS1MeRLd8ehlOK91g+SZFdMujwlFlDEZsKatmQS1rT/L0t2L00X1Q5AQIm/jHkFA5Ht+60fpm2qC4G1OdRNbPf61xBaE8hEwFqA7i/6/EoKqeSBLAh29u1kW8/2hOTkwq9TIooQaUj47Z6lfNzxCQAfd37Kb3c9nDloVvDz8huTRB91/j19UwG9W/qK48XqTKohAwGmZTQCG5wex9W5trsbdxpzBSyuXZIkuu+wX6HrHqSW/Noo4M6d9/BQ7XLurPn1kE9eKLBzFFdNvJxjCgbC7XXWeswDjtQgdrcghEbbaiuf2Pa9cyjf+pHNecDzgGh5tc2b/mgWarp288F+03Ja7qHcMX0h+d35pDtAWd26JuOg0gXz9NlcVn5xkvyBmqVpYwAhBLLD2di7L+IFVpuWEco4CNkR8CxAaHuvJ7JX2inhHOAWLh5pfCJJdmruKdw89SdIJFKppEOMTNNeaYozgqfy4IzfJMmXNC6nS4bShttKwr5nze3ErtKXZeEXkAUB8SPmFQAtr5launnr0l1YfRa31dxJVA4cgZ1acTKPVT7MGaWnIONxfCbnK/3TuLbsKhZNujVJvrrtPVbV/QW3y5V2kXXa7G2tb3YcB9QN59Y421PhEqAZYNYbh0mVrzSXnnw6JADbcSj3lPPSMU+n6Kju3s7a9g/4tHMDdeF9SXWFrgJm+o/g9KJTOLP4tJS+rzW9wfI9T+Bxp4b3Simi0qHhppZ17Zu7TgQuMC3jrYxO9ds9jIuR3wCL8o7yUfnoVIRSg8brs/KP5K5D76DIFUhb3xhpSroYOcQ7Gc9+Ye7+eKl1JSt2P5ey5/dDKYjW9jZvvXJvLlBtWsawrseGdTkaDFTVARWTf1qiSi4qFqnbYgyOlBS48rht6o2cHPjGcOxJoD7cwIr6Z/jQWo+AlG0VQAiFQldfnr8jZHfY+UClaRlZrf4JHcMkYA6x7wI44oXp+Ka4B83/VXyGfC1/DsflH8uZRadS4ikZUr9C8bf2j/isayOr297DURKUSut83Hy2/2h3b8+2cA5wk2kZy7J2pl/DCK7HbwSW6kUaM146hJwcb6bUNAYlmF14NEf6j2CKdwpF7kIEgj4Zpq6vnj3hPWzq3kpDb+MQDvcbDVKDhudaZPMz7RrwlmkZ5w3LkYSukX0h8jpwYekpxZTeXYQutIxGA0gpEULE/uILiCL2hB3HiddpZNorpEsR/iyKsXA3xJKeCtMyRnQSO5pvhGqBKcE78imfX4bb5UrJzsYDCohIm+0LduP0SICjTMvYOlJ92QRCg+FMAHNxF2KvTl84PApV2UEJEJqi9qr6fud/MBrnYRQEmJbxFXA5wJbrvkIzddRo6MwATWjYMsqeJ1vorg0DPGdaxh9HrXc0nU3LeBF40umT7HyqFrf0ZuwzUkSiEcQmjfY/WQDbTMu4ciz0jvqZmZZxLbC5Z22E0FshvLYPeeAF6iighAIlEO1uttyyE2LLwPyx0j9Wk/YswNn28C7qv2zAa4/dTNCljoODce8OlKMALjQto36s9I8JAaZlNAHnAdTd2oKv15+hR3ZQKLyRHJofbSXyhQOxL8bfHBPlcYzZsmVaxjvA/Tjw5e+r0bWs7iWGhCY1GjY30vQ/7QD/NC3jllErPXCMsVRmWsYdwLr21SEaXmmJJUwjhECgt7vZs7gBYvcTZ4+RmUkYj43rm0DnvsebCX3Zi8p0xTMINOFi8y3bULHTr3OH8+nbsMYZa4WmZXQD5wDsurcJpeyswuT9oRDsur+W8B4b4BemZawbazv7MS6hi2kZ/wAetJuitDzYQaivJ+u+0qXo+zJM2+ougL+YlrF4PGzsxzjGbvwCaGxYbWI+1YbQspsFkYYINYv2QizJGVGGNxyMGwGmZTjEF672/+6md6eNbafcsQ5AgNIlu67bh93pQOxnMUN0GBuM5wzAtIzNwA8Bam7ag78vN+2X35rQkMpm96PNhNuiEPup3DvjaVti7PEewLSMFcCLUcvm88Vb8Nn+lHS/NxxGVWt0rOwE2G1axiXjbVc/xp0AANMyLge2R9dLGp9pwSNj+YJCoRSIao3NP05csp5xMGzqx0EhII6zAGpfaqCppgV/JBdd6SCh+v6a/jaXmpax6yDadPAIMC2jFvguQO3CBpy+KJ6oj85nQqjYl3WPj+bHTyPFuP12eDAEA1XLgIXF5xWQe0YOe29sAthoWsacg2pIHAedAIBgoOoTBn7fEyF2qGkedEM4uGvA/tg/sVnw/+U8wP8BirtMKB0OWwYAAAAASUVORK5CYII=",Hg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPDElEQVR4nMWbeZyUxZnHv/W+b3dPz9kwjYKoC4pOUNF4g3hsDIrBAOpKjEfcKJFNVtd4xGvXuCresuvGENe4q0ZX+BDXZI26XjEBjcixHjAgwwvI6SDDvDPzTs/0Md3vW7V/dE8f0z3MO0MP/v5636rnfep5fl1VT9VT1UIpxXAiHGqoAr4NnApMAg4DxgKVGZEEsBtoBtYBnwDvWLYZGVbDMhDDRUA41PAt4ApgNjBqkJ+3A/8LLLZs8+1y25aPshMQDjWcB9wHTOktGyl8TPHVcrJRq47RK8Vo4ade86EjcFDYyqFF9qgNbkysdrpY6XTSJlO9n38M3GHZ5p/LamgGZSMgHGqoBx4HruktO8NXo+b4R6sZvnoRFJrwqiuqXN5y2nk50cJKJzsSXgJutWxzb1kMzqAsBIRDDZcCzwAjAM4UdVwbOEROq6zTUNrQlCpAwLtOB/8Ra2aVGwGIAPMs2/ztfhudwX4TEA413AU8BKixWkA+XjWBqb4aHWEgpCLtyf5jqdOhbuzeLDqVA3C9ZZtPlUPvfhEQDjXcCjwG9Jyq17ovVk+sqNJ0A0G5/M5CCWiVydS1kSbZKKN+4BbLNv9tf/UOmYBwqOE24H7AutY/1rmvctw4JYY3pCohEFIyL2pG3k61+4E7Ldv8xf7oHBIB4VDDVcCTwPa7q8bVzguMORLlYY4TvV1DUSCfT9xAejLVD8W/3PV0fOcI4BrLNl8ZlAP56gZLQDjUMAlYBnRcZhzU/tjIo08VKTnAV+k2jLMmoZ3xDbSJ4yBcg6gKoCJxaO3CbdyKXN6E++nGgUkApB5kdseKdWvd2HjgRMs2twzKkQyGQsB6QB9HMLis/riDNeWr2Nd4FwfXYcw+C+OyMxFHHDygfrl+F86S93FfW47qSvQrp4SBK3rap7St3tWCarZs88JBOdJr32AICIcapgOLqoTuaxw5FUMka4WjZbtlXxj/MBP/9TMh4Bu0YcqO4jz6MqklH/QjIJGGj4jytx7f9qcu4GrLNpcPtp3BErAVGPOrim+surC25hwt6e8zfkHpAjRJ4MG5GN87q6Qe2bgN9WUbMhpFq6lFHB5GO+awkrKpZ94m+ejLCBS4FJKtQAYcft62e/l/OV/WWLZ5gmdnMvBMQDjUMA9YUIeINo46p1Y4qcqiWCdAS4H/pdvRzplYUCU/34n78kc4yz5B7bIyhYCW1qEdMRbjvBPRLp2KduSYgm/dJctI3vECSqdEeNVIGXRMbP0wmYSbLNtc4smhXpMHQUAzUPemb2LLMSNHHKEli2Ucv0HNL65HXPDNXGE8Sc8NC3GXNqJQiH2sDJUGQoI+83QCT/64oE6+9Bei9z+Lnuo73gTSr/PG3i+23KCapWWbDZ4cysDTOjUcapgBjKwVvo5ja+uP0JLFpEmlqPy7aQXOq72dJGbch7O0EZRIOy8oWh2rzDZBZIKJ+/oqEnMehp7shgjtqrPwnzkJKfu2rdBSMK3ukFHA2HCoofS46wdeF+rzAOOiyvo4UtJ31lNCoI2ow7jhklxZNEHPzHuRO5oRvWFNgKirJHDtBQQW30HFnx4m8NxN+K88F/r0RPl/m4hf9nBBWeDB66CmBlSfsCuTBLWKusm+kUngRx59Sps00BAIhxoqgDbA/2HtSa2H6xVj+spIw6Fq4Z2I6cdmyxKz7kOu214oWBcg+NbDiDEjitqRa7cRn/MQIuVkyxTgO+8U/M9cnyt79k1ij7yCcHolcliWau++untjCghbtjnQ4gTw1gPOBowRwtd9uBEoch4h0MeOKXDeff6PyMbtBWJKdwg+fWdJ5wG0E8YTXDAX5eacEkDPn5uQ767Ilc2dgagLFUafjPQU38igDiFgsge/0u16kDkDcC/QRrkl471S+K6eVlCUXPDfhYs5BcY3GxCTx+WK1jaRevF9VHNbzphZk9FqKsgfYpqM4iwsTAoZZx5dcrMVEJo+VauAvGTMQPBCwCRA++vK6hiyH/FJ47OP8oM1yFhRuEY7+tDce1uE+MX/QureF0nMvh/iuZCinXwU+cNSKEiu+wq1aVeu7LRjShihQLlMSo/QQzz4lW7Pg8w4QByrVSdL0S6EQD9idPbdff1D0PU+QoCeo0S1RzMPLqotgkrkCBA1lfRtR+g67qvLsu/6aRP6MVVQi1RA3YBeZWB4kBkFGKOEv6KoRoGYMBpRX5Mtcta0IJwYiBy3AlAd0ey7dtQYjGunIVc0YcyejBhRna1zm3YiROFYE04M57M9WWO18aMRdVWozih9UScMAVQXVfQDLwRUA4kKoVUV1QjgsFzCV3XFUTv2FDjfC2d5E/68d//d3y+SUa2dyC++oih9KDTU1t25d11DHB5GrSsmIJju1IF9u5SDlyFgkM7dF+1olC7QjTwOIzHIC2MFsh3dOP/03D4bcu5+PpMzKIFYDyRzuoXhzy6g8qGnZx+9qKIfeOkBvfG0eAJQoNy8cBvwgSagaLWW9qtn0fu4HSl8s09HTD4q3Y1bO1GrttCzaCnyo/XFv34vfDroeb+XdIsjYc5IT2sA8EZAAhAuShmIgrElXInsyB3giPoaxEEjUXssSu2RhdBw31kBhsA3/qA0ATssUn9Yjlq5D+chvX7II0C2dRatHgFS6QCcKqroB14IsIH6pJIJQ/TtWQK1bW/6F9cECIH2V9W4LRFQxTb4fnIhxnXTESNyk6Z2ypEETrkR1WyRevpNnEXvg+qz71XAhLw1WGcMtbu9pLEJ5QLEPfiVbt+DTDMQaIVu1bdnCaAjgms2Z4uM70xGGX1m8doggadvxHf7pQXOF8iMDeOffzX++d9DVeUHHAmGhu+752RLnNUbEW6JXq4UXeknz+eKXgj4HAh+HNvmoFcWVUo9CJty6Tj9sm8jkon0CkYBPqh4az769BMLbe2MIjc3Q6JwX21cOZ3g83egMrl1pVWgjfShn5db/KgPPkHqJaKyXsGeHgvSexdP8ELAB4DxB5moTnfNQggk7ntrcwUVPvTTjkfpoJQicNV3EIfU5+pbu0jc/AyJqbeSOP9u4lNvpefu3xRMnNqp4/FNPQ6lK5TuYFzwrYI2ZeOXCIptQUk+VEmAlR78SrflQeYtwF3mRMIRp8sumtxUiuTb62BrS7Yo8O8/AkeBpqHfcXFOdP0m4rMeRv7PClQ0/cur9ijOomX0zHwMtu7MyvoX/hhcHc0nMG6bldOxahPOhmaQfecYQaNjsVkmosAfvbnvgQDLNqPAy0DVU9FtUaX3WWMoEErSc/uiXFl9HcEH5mL8zRm5hGjCIX71c8iWXRkOVVaBQJDa9DmJGxfndIQqMS46neCvb4GaYLY4ftdvEG6KopyEHuCJ7m0AL1m2WXoxUgKeUmLhUMNEYEO98MU/HXFqsDj+arhCUf3KLYiTjiupw12+jp4fPFEydAEoJRGaj8rPfgl1wZIy8qUPiN3zLFqflJISgpjrMLFzFcA4yzZ3DOhU1nIPsGyzCXijTaWCi2N7Y0rrOwNLdCmJ3fV7aOksbfzG3fs8LxRCA1yclZ+XFti8k9gTi9BkiUWecFkQ+xLSFyo8Ow/eU2KQTotxV2JL0HJcJ5vAyxohUFu2k5wxv3RDRx0CQYN0XkxlokTeMyDqqtFG1xd/HImRmPHPCNstToRIxSa3h2dTzQA3DMKfdJuDPBe4B7hvdkW9Wlh5lFBF2c30/sA493gCv/5penGUX90WwX33M+TyJuTOVlRXN6KuFm38QWhnH4sx7cSC8Q6guuP0XP447oYdCNct3isIOL9rLRtT0ZuHclo8lKOxBBBYXDlJTa2oFqKfczwxbjT+e69AP2fSYG3KwnltFamHlqBa7JL1Sih+H2vl5sSWrZZtHjmUNoZCwFzgPwWwJnwSI9wA/Z6NAfqcs/D/7BLEQSHPbajtLSQf/C3ue5/1LyRgu+rh7I5PAGZatvmG5wby1QzxePwt4IKLfGGeqGtAdwfQEfBhXDwFY9ZktJMmlDwrVJEY6uNNOK+uwHl99cBGSMn06DqanOjvLNu8dNBOZDBUAgJAK1CzIDiBOcGDEQPpydz5ESNr0CYciqipQAV0RMJBdcaRG3egov2fBhcYLRULU7vVo7EdrcBoyzaHfDNjf26ITAE+AlgbOpmQqEgfYHprNRMSRW5W93LBIv0FK2W3O6ezUQdOsGyzcbC252OIV7jAss0VwN0Av+xpRvoc7/eClCA7byjh2XkAdMHN3aYG3Ly/zkN5boltBBqeMY7j/LpKNOklxTAUuEhfDTdZ63lV7llq2ea55dA65B6QhysB5jnr6VAuw3X1Vhq1vNixilflHoAflkvvfhNg2eYnwG0Af9u1Gemvy6z3y0SEAoWi3a8zP9UF8BPLNncO9JlXlPOq7GvAzO/7qnik9jg0GQA8b8r6hyZIJl3OjnzKbpFcYtnm5fuvNE99GXXNBr5akoryUbwHpZeHWIVgfnIbu0VyW7mdhzISkInF5wJcEVtDxLBzG56hQAGa4N1UOy/0tNCru9woZw/Ass2NwM8B5lk7UY4BRVtnb1C6oLknwXWRDQA/tGxze9kMzUNZCQCwbPMBYMMKp5OnkrtRPq3fJMi+IH0VzI1uBPjUss0Xym1nL8pOQAbnAu6jiS9YG2tHDWoYCCQaD7StYYOKxhmmrt+LYSHAss0W4EKAWV1NRANVKGEwcGhUoFew1LV5NtUGMN2yzdIppjJhuHoAlm2+A8wHuK5jNSoZZ8AzS6HTnrS5LvI5pG+C/2W47OvFsBEAYNnmPcDHy1OdLHZ2ICtKnwr1wg2M4PKuNTioNy3bfHQ4bevFsBKQwQ8A/jGxl13xCIpS1z0VUhgssNfTlD58ufIA2AUcAAIyofGnABdFVpNUMVSfCxRK01mR+IpfxbcBzLVs0x5uu3pxIHoAlm0+CfyuTaa4v3szyhfKqxUoo5q/j20GeMGyzX3foigzhu2Pk6UQDjXsAg7915qjuUQbiaZpCBTXdG/ivVTbZss2jz5gxmRwQHpAHqYB3NK1iXaRwtU0no7v5r10yJu270+HBweUAMs2TeBnAA/GdrIp1c1jiZ0AV5RzizsYHNAh0ItwqGEb6fuHAI1D+aNDuXCgh0Avzst7/u7XZAPwNfUAgHCo4V4gYdnmI1+LARn8P0TdSRGR8ht7AAAAAElFTkSuQmCC";(function(r,t,e){function i(n,o){for(;(n=n.parentElement)&&!n.classList.contains(o););return n}L.drawVersion="1.0.4",L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes",text:"Save"},cancel:{title:"Cancel editing, discards all changes",text:"Cancel"},clearAll:{title:"Clear all layers",text:"Clear All"}},buttons:{edit:"Edit layers",editDisabled:"No layers to edit",remove:"Delete layers",removeDisabled:"No layers to delete"}},handlers:{edit:{tooltip:{text:"Drag handles or markers to edit features.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove."}}}}},L.Draw.Event={},L.Draw.Event.CREATED="draw:created",L.Draw.Event.EDITED="draw:edited",L.Draw.Event.DELETED="draw:deleted",L.Draw.Event.DRAWSTART="draw:drawstart",L.Draw.Event.DRAWSTOP="draw:drawstop",L.Draw.Event.DRAWVERTEX="draw:drawvertex",L.Draw.Event.EDITSTART="draw:editstart",L.Draw.Event.EDITMOVE="draw:editmove",L.Draw.Event.EDITRESIZE="draw:editresize",L.Draw.Event.EDITVERTEX="draw:editvertex",L.Draw.Event.EDITSTOP="draw:editstop",L.Draw.Event.DELETESTART="draw:deletestart",L.Draw.Event.DELETESTOP="draw:deletestop",L.Draw.Event.TOOLBAROPENED="draw:toolbaropened",L.Draw.Event.TOOLBARCLOSED="draw:toolbarclosed",L.Draw.Event.MARKERCONTEXT="draw:markercontext",L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({initialize:function(n,o){this._map=n,this._container=n._container,this._overlayPane=n._panes.overlayPane,this._popupPane=n._panes.popupPane,o&&o.shapeOptions&&(o.shapeOptions=L.Util.extend({},this.options.shapeOptions,o.shapeOptions)),L.setOptions(this,o);var a=L.version.split(".");parseInt(a[0],10)===1&&parseInt(a[1],10)>=2?L.Draw.Feature.include(L.Evented.prototype):L.Draw.Feature.include(L.Mixin.Events)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(L.DomUtil.disableTextSelection(),n.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,"keyup",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,"keyup",this._cancelDrawing,this))},setOptions:function(n){L.setOptions(this,n)},_fireCreatedEvent:function(n){this._map.fire(L.Draw.Event.CREATED,{layer:n,layerType:this.type})},_cancelDrawing:function(n){n.keyCode===27&&(this._map.fire("draw:canceled",{layerType:this.type}),this.disable())}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:"polyline"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},initialize:function(n,o){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,o&&o.drawError&&(o.drawError=L.Util.extend({},this.options.drawError,o.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,n,o)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("mouseout",this._onMouseOut,this).on("mousemove",this._onMouseMove,this).on("mousedown",this._onMouseDown,this).on("mouseup",this._onMouseUp,this).addTo(this._map),this._map.on("mouseup",this._onMouseUp,this).on("mousemove",this._onMouseMove,this).on("zoomlevelschange",this._onZoomEnd,this).on("touchstart",this._onTouch,this).on("zoomend",this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._clearHideErrorTimeout(),this._cleanUpShape(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,this._map.removeLayer(this._poly),delete this._poly,this._mouseMarker.off("mousedown",this._onMouseDown,this).off("mouseout",this._onMouseOut,this).off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._clearGuides(),this._map.off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this).off("zoomlevelschange",this._onZoomEnd,this).off("zoomend",this._onZoomEnd,this).off("touchstart",this._onTouch,this).off("click",this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var n=this._markers.pop(),o=this._poly,a=o.getLatLngs(),h=a.splice(-1,1)[0];this._poly.setLatLngs(a),this._markerGroup.removeLayer(n),o.getLatLngs().length<2&&this._map.removeLayer(o),this._vertexChanged(h,!1)}},addVertex:function(n){if(this._markers.length>=2&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(n))return void this._showErrorTooltip();this._errorShown&&this._hideErrorTooltip(),this._markers.push(this._createMarker(n)),this._poly.addLatLng(n),this._poly.getLatLngs().length===2&&this._map.addLayer(this._poly),this._vertexChanged(n,!0)},completeShape:function(){this._markers.length<=1||!this._shapeIsValid()||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_finishShape:function(){var n=this._poly._defaultShape?this._poly._defaultShape():this._poly.getLatLngs(),o=this._poly.newLatLngIntersects(n[n.length-1]);if(!this.options.allowIntersection&&o||!this._shapeIsValid())return void this._showErrorTooltip();this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_shapeIsValid:function(){return!0},_onZoomEnd:function(){this._markers!==null&&this._updateGuide()},_onMouseMove:function(n){var o=this._map.mouseEventToLayerPoint(n.originalEvent),a=this._map.layerPointToLatLng(o);this._currentLatLng=a,this._updateTooltip(a),this._updateGuide(o),this._mouseMarker.setLatLng(a),L.DomEvent.preventDefault(n.originalEvent)},_vertexChanged:function(n,o){this._map.fire(L.Draw.Event.DRAWVERTEX,{layers:this._markerGroup}),this._updateFinishHandler(),this._updateRunningMeasure(n,o),this._clearGuides(),this._updateTooltip()},_onMouseDown:function(n){if(!this._clickHandled&&!this._touchHandled&&!this._disableMarkers){this._onMouseMove(n),this._clickHandled=!0,this._disableNewMarkers();var o=n.originalEvent,a=o.clientX,h=o.clientY;this._startPoint.call(this,a,h)}},_startPoint:function(n,o){this._mouseDownOrigin=L.point(n,o)},_onMouseUp:function(n){var o=n.originalEvent,a=o.clientX,h=o.clientY;this._endPoint.call(this,a,h,n),this._clickHandled=null},_endPoint:function(n,o,a){if(this._mouseDownOrigin){var h=L.point(n,o).distanceTo(this._mouseDownOrigin),c=this._calculateFinishDistance(a.latlng);this.options.maxPoints>1&&this.options.maxPoints==this._markers.length+1?(this.addVertex(a.latlng),this._finishShape()):c<10&&L.Browser.touch?this._finishShape():Math.abs(h)<9*(r.devicePixelRatio||1)&&this.addVertex(a.latlng),this._enableNewMarkers()}this._mouseDownOrigin=null},_onTouch:function(n){var o,a,h=n.originalEvent;!h.touches||!h.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(o=h.touches[0].clientX,a=h.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,o,a),this._endPoint.call(this,o,a,n),this._touchHandled=null),this._clickHandled=null},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_calculateFinishDistance:function(n){var o;if(this._markers.length>0){var a;if(this.type===L.Draw.Polyline.TYPE)a=this._markers[this._markers.length-1];else{if(this.type!==L.Draw.Polygon.TYPE)return 1/0;a=this._markers[0]}var h=this._map.latLngToContainerPoint(a.getLatLng()),c=new L.Marker(n,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),d=this._map.latLngToContainerPoint(c.getLatLng());o=h.distanceTo(d)}else o=1/0;return o},_updateFinishHandler:function(){var n=this._markers.length;n>1&&this._markers[n-1].on("click",this._finishShape,this),n>2&&this._markers[n-2].off("click",this._finishShape,this)},_createMarker:function(n){var o=new L.Marker(n,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(o),o},_updateGuide:function(n){var o=this._markers?this._markers.length:0;o>0&&(n=n||this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[o-1].getLatLng()),n))},_updateTooltip:function(n){var o=this._getTooltipText();n&&this._tooltip.updatePosition(n),this._errorShown||this._tooltip.updateContent(o)},_drawGuide:function(n,o){var a,h,c,d=Math.floor(Math.sqrt(Math.pow(o.x-n.x,2)+Math.pow(o.y-n.y,2))),f=this.options.guidelineDistance,p=this.options.maxGuideLineLength,m=d>p?d-p:f;for(this._guidesContainer||(this._guidesContainer=L.DomUtil.create("div","leaflet-draw-guides",this._overlayPane));m<d;m+=this.options.guidelineDistance)a=m/d,h={x:Math.floor(n.x*(1-a)+a*o.x),y:Math.floor(n.y*(1-a)+a*o.y)},c=L.DomUtil.create("div","leaflet-draw-guide-dash",this._guidesContainer),c.style.backgroundColor=this._errorShown?this.options.drawError.color:this.options.shapeOptions.color,L.DomUtil.setPosition(c,h)},_updateGuideColor:function(n){if(this._guidesContainer)for(var o=0,a=this._guidesContainer.childNodes.length;o<a;o++)this._guidesContainer.childNodes[o].style.backgroundColor=n},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var n,o,a=this.options.showLength;return this._markers.length===0?n={text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(o=a?this._getMeasurementString():"",n=this._markers.length===1?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:o}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:o}),n},_updateRunningMeasure:function(n,o){var a,h,c=this._markers.length;this._markers.length===1?this._measurementRunningTotal=0:(a=c-(o?2:1),h=L.GeometryUtil.isVersion07x()?n.distanceTo(this._markers[a].getLatLng())*(this.options.factor||1):this._map.distance(n,this._markers[a].getLatLng())*(this.options.factor||1),this._measurementRunningTotal+=h*(o?1:-1))},_getMeasurementString:function(){var n,o=this._currentLatLng,a=this._markers[this._markers.length-1].getLatLng();return n=L.GeometryUtil.isVersion07x()?a&&o&&o.distanceTo?this._measurementRunningTotal+o.distanceTo(a)*(this.options.factor||1):this._measurementRunningTotal||0:a&&o?this._measurementRunningTotal+this._map.distance(o,a)*(this.options.factor||1):this._measurementRunningTotal||0,L.GeometryUtil.readableDistance(n,this.options.metric,this.options.feet,this.options.nautic,this.options.precision)},_showErrorTooltip:function(){this._errorShown=!0,this._tooltip.showAsError().updateContent({text:this.options.drawError.message}),this._updateGuideColor(this.options.drawError.color),this._poly.setStyle({color:this.options.drawError.color}),this._clearHideErrorTimeout(),this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1,this._clearHideErrorTimeout(),this._tooltip.removeError().updateContent(this._getTooltipText()),this._updateGuideColor(this.options.shapeOptions.color),this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&(clearTimeout(this._hideErrorTimeout),this._hideErrorTimeout=null)},_disableNewMarkers:function(){this._disableMarkers=!0},_enableNewMarkers:function(){setTimeout((function(){this._disableMarkers=!1}).bind(this),50)},_cleanUpShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off("click",this._finishShape,this)},_fireCreatedEvent:function(){var n=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)}}),L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:"polygon"},Poly:L.Polygon,options:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},initialize:function(n,o){L.Draw.Polyline.prototype.initialize.call(this,n,o),this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var n=this._markers.length;n===1&&this._markers[0].on("click",this._finishShape,this),n>2&&(this._markers[n-1].on("dblclick",this._finishShape,this),n>3&&this._markers[n-2].off("dblclick",this._finishShape,this))},_getTooltipText:function(){var n,o;return this._markers.length===0?n=L.drawLocal.draw.handlers.polygon.tooltip.start:this._markers.length<3?(n=L.drawLocal.draw.handlers.polygon.tooltip.cont,o=this._getMeasurementString()):(n=L.drawLocal.draw.handlers.polygon.tooltip.end,o=this._getMeasurementString()),{text:n,subtext:o}},_getMeasurementString:function(){var n=this._area,o="";return n||this.options.showLength?(this.options.showLength&&(o=L.Draw.Polyline.prototype._getMeasurementString.call(this)),n&&(o+="<br>"+L.GeometryUtil.readableArea(n,this.options.metric,this.options.precision)),o):null},_shapeIsValid:function(){return this._markers.length>=3},_vertexChanged:function(n,o){var a;!this.options.allowIntersection&&this.options.showArea&&(a=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(a)),L.Draw.Polyline.prototype._vertexChanged.call(this,n,o)},_cleanUpShape:function(){var n=this._markers.length;n>0&&(this._markers[0].off("click",this._finishShape,this),n>2&&this._markers[n-1].off("dblclick",this._finishShape,this))}}),L.SimpleShape={},L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(n,o){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end,L.Draw.Feature.prototype.initialize.call(this,n,o)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor="crosshair",this._tooltip.updateContent({text:this._initialLabelText}),this._map.on("mousedown",this._onMouseDown,this).on("mousemove",this._onMouseMove,this).on("touchstart",this._onMouseDown,this).on("touchmove",this._onMouseMove,this),t.addEventListener("touchstart",L.DomEvent.preventDefault,{passive:!1}))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor="",this._map.off("mousedown",this._onMouseDown,this).off("mousemove",this._onMouseMove,this).off("touchstart",this._onMouseDown,this).off("touchmove",this._onMouseMove,this),L.DomEvent.off(t,"mouseup",this._onMouseUp,this),L.DomEvent.off(t,"touchend",this._onMouseUp,this),t.removeEventListener("touchstart",L.DomEvent.preventDefault),this._shape&&(this._map.removeLayer(this._shape),delete this._shape)),this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(n){this._isDrawing=!0,this._startLatLng=n.latlng,L.DomEvent.on(t,"mouseup",this._onMouseUp,this).on(t,"touchend",this._onMouseUp,this).preventDefault(n.originalEvent)},_onMouseMove:function(n){var o=n.latlng;this._tooltip.updatePosition(o),this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(o))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()}}),L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:"rectangle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showArea:!0,metric:!0},initialize:function(n,o){this.type=L.Draw.Rectangle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,n,o)},disable:function(){this._enabled&&(this._isCurrentlyTwoClickDrawing=!1,L.Draw.SimpleShape.prototype.disable.call(this))},_onMouseUp:function(n){if(!this._shape&&!this._isCurrentlyTwoClickDrawing)return void(this._isCurrentlyTwoClickDrawing=!0);this._isCurrentlyTwoClickDrawing&&!i(n.target,"leaflet-pane")||L.Draw.SimpleShape.prototype._onMouseUp.call(this)},_drawShape:function(n){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,n)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,n),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var n=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,n)},_getTooltipText:function(){var n,o,a,h=L.Draw.SimpleShape.prototype._getTooltipText.call(this),c=this._shape,d=this.options.showArea;return c&&(n=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),o=L.GeometryUtil.geodesicArea(n),a=d?L.GeometryUtil.readableArea(o,this.options.metric):""),{text:h.text,subtext:a}}}),L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:"marker"},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(n,o){this.type=L.Draw.Marker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.marker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,n,o)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._tooltip.updateContent({text:this._initialLabelText}),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("click",this._onClick,this).addTo(this._map),this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._map.off("click",this._onClick,this).off("click",this._onTouch,this),this._marker&&(this._marker.off("click",this._onClick,this),this._map.removeLayer(this._marker),delete this._marker),this._mouseMarker.off("click",this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off("mousemove",this._onMouseMove,this))},_onMouseMove:function(n){var o=n.latlng;this._tooltip.updatePosition(o),this._mouseMarker.setLatLng(o),this._marker?(o=this._mouseMarker.getLatLng(),this._marker.setLatLng(o)):(this._marker=this._createMarker(o),this._marker.on("click",this._onClick,this),this._map.on("click",this._onClick,this).addLayer(this._marker))},_createMarker:function(n){return new L.Marker(n,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset})},_onClick:function(){this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_onTouch:function(n){this._onMouseMove(n),this._onClick()},_fireCreatedEvent:function(){var n=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)}}),L.Draw.CircleMarker=L.Draw.Marker.extend({statics:{TYPE:"circlemarker"},options:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0,zIndexOffset:2e3},initialize:function(n,o){this.type=L.Draw.CircleMarker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circlemarker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,n,o)},_fireCreatedEvent:function(){var n=new L.CircleMarker(this._marker.getLatLng(),this.options);L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)},_createMarker:function(n){return new L.CircleMarker(n,this.options)}}),L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:"circle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},initialize:function(n,o){this.type=L.Draw.Circle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,n,o)},_drawShape:function(n){if(L.GeometryUtil.isVersion07x())var o=this._startLatLng.distanceTo(n);else var o=this._map.distance(this._startLatLng,n);this._shape?this._shape.setRadius(o):(this._shape=new L.Circle(this._startLatLng,o,this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var n=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,n)},_onMouseMove:function(n){var o,a=n.latlng,h=this.options.showRadius,c=this.options.metric;if(this._tooltip.updatePosition(a),this._isDrawing){this._drawShape(a),o=this._shape.getRadius().toFixed(1);var d="";h&&(d=L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(o,c,this.options.feet,this.options.nautic)),this._tooltip.updateContent({text:this._endLabelText,subtext:d})}}}),L.Edit=L.Edit||{},L.Edit.Marker=L.Handler.extend({initialize:function(n,o){this._marker=n,L.setOptions(this,o)},addHooks:function(){var n=this._marker;n.dragging.enable(),n.on("dragend",this._onDragEnd,n),this._toggleMarkerHighlight()},removeHooks:function(){var n=this._marker;n.dragging.disable(),n.off("dragend",this._onDragEnd,n),this._toggleMarkerHighlight()},_onDragEnd:function(n){var o=n.target;o.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:o})},_toggleMarkerHighlight:function(){var n=this._marker._icon;n&&(n.style.display="none",L.DomUtil.hasClass(n,"leaflet-edit-marker-selected")?(L.DomUtil.removeClass(n,"leaflet-edit-marker-selected"),this._offsetMarker(n,-4)):(L.DomUtil.addClass(n,"leaflet-edit-marker-selected"),this._offsetMarker(n,4)),n.style.display="")},_offsetMarker:function(n,o){var a=parseInt(n.style.marginTop,10)-o,h=parseInt(n.style.marginLeft,10)-o;n.style.marginTop=a+"px",n.style.marginLeft=h+"px"}}),L.Marker.addInitHook(function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.Poly=L.Handler.extend({initialize:function(n){this.latlngs=[n._latlngs],n._holes&&(this.latlngs=this.latlngs.concat(n._holes)),this._poly=n,this._poly.on("revert-edited",this._updateLatLngs,this)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._poly._latlngs)?this._poly._latlngs:this._poly._latlngs[0]:this._poly._latlngs},_eachVertexHandler:function(n){for(var o=0;o<this._verticesHandlers.length;o++)n(this._verticesHandlers[o])},addHooks:function(){this._initHandlers(),this._eachVertexHandler(function(n){n.addHooks()})},removeHooks:function(){this._eachVertexHandler(function(n){n.removeHooks()})},updateMarkers:function(){this._eachVertexHandler(function(n){n.updateMarkers()})},_initHandlers:function(){this._verticesHandlers=[];for(var n=0;n<this.latlngs.length;n++)this._verticesHandlers.push(new L.Edit.PolyVerticesEdit(this._poly,this.latlngs[n],this._poly.options.poly))},_updateLatLngs:function(n){this.latlngs=[n.layer._latlngs],n.layer._holes&&(this.latlngs=this.latlngs.concat(n.layer._holes))}}),L.Edit.PolyVerticesEdit=L.Handler.extend({options:{icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),drawError:{color:"#b00b00",timeout:1e3}},initialize:function(n,o,a){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this._poly=n,a&&a.drawError&&(a.drawError=L.Util.extend({},this.options.drawError,a.drawError)),this._latlngs=o,L.setOptions(this,a)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]:this._latlngs},addHooks:function(){var n=this._poly,o=n._path;n instanceof L.Polygon||(n.options.fill=!1,n.options.editing&&(n.options.editing.fill=!1)),o&&n.options.editing&&n.options.editing.className&&(n.options.original.className&&n.options.original.className.split(" ").forEach(function(a){L.DomUtil.removeClass(o,a)}),n.options.editing.className.split(" ").forEach(function(a){L.DomUtil.addClass(o,a)})),n.setStyle(n.options.editing),this._poly._map&&(this._map=this._poly._map,this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var n=this._poly,o=n._path;o&&n.options.editing&&n.options.editing.className&&(n.options.editing.className.split(" ").forEach(function(a){L.DomUtil.removeClass(o,a)}),n.options.original.className&&n.options.original.className.split(" ").forEach(function(a){L.DomUtil.addClass(o,a)})),n.setStyle(n.options.original),n._map&&(n._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._markers=[];var n,o,a,h,c=this._defaultShape();for(n=0,a=c.length;n<a;n++)h=this._createMarker(c[n],n),h.on("click",this._onMarkerClick,this),h.on("contextmenu",this._onContextMenu,this),this._markers.push(h);var d,f;for(n=0,o=a-1;n<a;o=n++)(n!==0||L.Polygon&&this._poly instanceof L.Polygon)&&(d=this._markers[o],f=this._markers[n],this._createMiddleMarker(d,f),this._updatePrevNext(d,f))},_createMarker:function(n,o){var a=new L.Marker.Touch(n,{draggable:!0,icon:this.options.icon});return a._origLatLng=n,a._index=o,a.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._fireEdit,this).on("touchmove",this._onTouchMove,this).on("touchend",this._fireEdit,this).on("MSPointerMove",this._onTouchMove,this).on("MSPointerUp",this._fireEdit,this),this._markerGroup.addLayer(a),a},_onMarkerDragStart:function(){this._poly.fire("editstart")},_spliceLatLngs:function(){var n=this._defaultShape(),o=[].splice.apply(n,arguments);return this._poly._convertLatLngs(n,!0),this._poly.redraw(),o},_removeMarker:function(n){var o=n._index;this._markerGroup.removeLayer(n),this._markers.splice(o,1),this._spliceLatLngs(o,1),this._updateIndexes(o,-1),n.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._fireEdit,this).off("touchmove",this._onMarkerDrag,this).off("touchend",this._fireEdit,this).off("click",this._onMarkerClick,this).off("MSPointerMove",this._onTouchMove,this).off("MSPointerUp",this._fireEdit,this)},_fireEdit:function(){this._poly.edited=!0,this._poly.fire("edit"),this._poly._map.fire(L.Draw.Event.EDITVERTEX,{layers:this._markerGroup,poly:this._poly})},_onMarkerDrag:function(n){var o=n.target,a=this._poly,h=L.LatLngUtil.cloneLatLng(o._origLatLng);if(L.extend(o._origLatLng,o._latlng),a.options.poly){var c=a._map._editTooltip;if(!a.options.poly.allowIntersection&&a.intersects()){L.extend(o._origLatLng,h),o.setLatLng(h);var d=a.options.color;a.setStyle({color:this.options.drawError.color}),c&&c.updateContent({text:L.drawLocal.draw.handlers.polyline.error}),setTimeout(function(){a.setStyle({color:d}),c&&c.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext})},1e3)}}o._middleLeft&&o._middleLeft.setLatLng(this._getMiddleLatLng(o._prev,o)),o._middleRight&&o._middleRight.setLatLng(this._getMiddleLatLng(o,o._next)),this._poly._bounds._southWest=L.latLng(1/0,1/0),this._poly._bounds._northEast=L.latLng(-1/0,-1/0);var f=this._poly.getLatLngs();this._poly._convertLatLngs(f,!0),this._poly.redraw(),this._poly.fire("editdrag")},_onMarkerClick:function(n){var o=L.Polygon&&this._poly instanceof L.Polygon?4:3,a=n.target;this._defaultShape().length<o||(this._removeMarker(a),this._updatePrevNext(a._prev,a._next),a._middleLeft&&this._markerGroup.removeLayer(a._middleLeft),a._middleRight&&this._markerGroup.removeLayer(a._middleRight),a._prev&&a._next?this._createMiddleMarker(a._prev,a._next):a._prev?a._next||(a._prev._middleRight=null):a._next._middleLeft=null,this._fireEdit())},_onContextMenu:function(n){var o=n.target;this._poly,this._poly._map.fire(L.Draw.Event.MARKERCONTEXT,{marker:o,layers:this._markerGroup,poly:this._poly}),L.DomEvent.stopPropagation},_onTouchMove:function(n){var o=this._map.mouseEventToLayerPoint(n.originalEvent.touches[0]),a=this._map.layerPointToLatLng(o),h=n.target;L.extend(h._origLatLng,a),h._middleLeft&&h._middleLeft.setLatLng(this._getMiddleLatLng(h._prev,h)),h._middleRight&&h._middleRight.setLatLng(this._getMiddleLatLng(h,h._next)),this._poly.redraw(),this.updateMarkers()},_updateIndexes:function(n,o){this._markerGroup.eachLayer(function(a){a._index>n&&(a._index+=o)})},_createMiddleMarker:function(n,o){var a,h,c,d=this._getMiddleLatLng(n,o),f=this._createMarker(d);f.setOpacity(.6),n._middleRight=o._middleLeft=f,h=function(){f.off("touchmove",h,this);var p=o._index;f._index=p,f.off("click",a,this).on("click",this._onMarkerClick,this),d.lat=f.getLatLng().lat,d.lng=f.getLatLng().lng,this._spliceLatLngs(p,0,d),this._markers.splice(p,0,f),f.setOpacity(1),this._updateIndexes(p,1),o._index++,this._updatePrevNext(n,f),this._updatePrevNext(f,o),this._poly.fire("editstart")},c=function(){f.off("dragstart",h,this),f.off("dragend",c,this),f.off("touchmove",h,this),this._createMiddleMarker(n,f),this._createMiddleMarker(f,o)},a=function(){h.call(this),c.call(this),this._fireEdit()},f.on("click",a,this).on("dragstart",h,this).on("dragend",c,this).on("touchmove",h,this),this._markerGroup.addLayer(f)},_updatePrevNext:function(n,o){n&&(n._next=o),o&&(o._prev=n)},_getMiddleLatLng:function(n,o){var a=this._poly._map,h=a.project(n.getLatLng()),c=a.project(o.getLatLng());return a.unproject(h._add(c)._divideBy(2))}}),L.Polyline.addInitHook(function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))}),L.Edit=L.Edit||{},L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move"}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize"}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon"}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon"})},initialize:function(n,o){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon),this._shape=n,L.Util.setOptions(this,o)},addHooks:function(){var n=this._shape;this._shape._map&&(this._map=this._shape._map,n.setStyle(n.options.editing),n._map&&(this._map=n._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var n=this._shape;if(n.setStyle(n.options.original),n._map){this._unbindMarker(this._moveMarker);for(var o=0,a=this._resizeMarkers.length;o<a;o++)this._unbindMarker(this._resizeMarkers[o]);this._resizeMarkers=null,this._map.removeLayer(this._markerGroup),delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._createMoveMarker(),this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(n,o){var a=new L.Marker.Touch(n,{draggable:!0,icon:o,zIndexOffset:10});return this._bindMarker(a),this._markerGroup.addLayer(a),a},_bindMarker:function(n){n.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._onMarkerDragEnd,this).on("touchstart",this._onTouchStart,this).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onTouchEnd,this).on("MSPointerUp",this._onTouchEnd,this)},_unbindMarker:function(n){n.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._onMarkerDragEnd,this).off("touchstart",this._onTouchStart,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onTouchEnd,this).off("MSPointerUp",this._onTouchEnd,this)},_onMarkerDragStart:function(n){n.target.setOpacity(0),this._shape.fire("editstart")},_fireEdit:function(){this._shape.edited=!0,this._shape.fire("edit")},_onMarkerDrag:function(n){var o=n.target,a=o.getLatLng();o===this._moveMarker?this._move(a):this._resize(a),this._shape.redraw(),this._shape.fire("editdrag")},_onMarkerDragEnd:function(n){n.target.setOpacity(1),this._fireEdit()},_onTouchStart:function(n){if(L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,n),typeof this._getCorners=="function"){var o=this._getCorners(),a=n.target,h=a._cornerIndex;a.setOpacity(0),this._oppositeCorner=o[(h+2)%4],this._toggleCornerMarkers(0,h)}this._shape.fire("editstart")},_onTouchMove:function(n){var o=this._map.mouseEventToLayerPoint(n.originalEvent.touches[0]),a=this._map.layerPointToLatLng(o);return n.target===this._moveMarker?this._move(a):this._resize(a),this._shape.redraw(),!1},_onTouchEnd:function(n){n.target.setOpacity(1),this.updateMarkers(),this._fireEdit()},_move:function(){},_resize:function(){}}),L.Edit=L.Edit||{},L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var n=this._shape.getBounds(),o=n.getCenter();this._moveMarker=this._createMarker(o,this.options.moveIcon)},_createResizeMarker:function(){var n=this._getCorners();this._resizeMarkers=[];for(var o=0,a=n.length;o<a;o++)this._resizeMarkers.push(this._createMarker(n[o],this.options.resizeIcon)),this._resizeMarkers[o]._cornerIndex=o},_onMarkerDragStart:function(n){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,n);var o=this._getCorners(),a=n.target,h=a._cornerIndex;this._oppositeCorner=o[(h+2)%4],this._toggleCornerMarkers(0,h)},_onMarkerDragEnd:function(n){var o,a,h=n.target;h===this._moveMarker&&(o=this._shape.getBounds(),a=o.getCenter(),h.setLatLng(a)),this._toggleCornerMarkers(1),this._repositionCornerMarkers(),L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,n)},_move:function(n){for(var o,a=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),h=this._shape.getBounds(),c=h.getCenter(),d=[],f=0,p=a.length;f<p;f++)o=[a[f].lat-c.lat,a[f].lng-c.lng],d.push([n.lat+o[0],n.lng+o[1]]);this._shape.setLatLngs(d),this._repositionCornerMarkers(),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})},_resize:function(n){var o;this._shape.setBounds(L.latLngBounds(n,this._oppositeCorner)),o=this._shape.getBounds(),this._moveMarker.setLatLng(o.getCenter()),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})},_getCorners:function(){var n=this._shape.getBounds();return[n.getNorthWest(),n.getNorthEast(),n.getSouthEast(),n.getSouthWest()]},_toggleCornerMarkers:function(n){for(var o=0,a=this._resizeMarkers.length;o<a;o++)this._resizeMarkers[o].setOpacity(n)},_repositionCornerMarkers:function(){for(var n=this._getCorners(),o=0,a=this._resizeMarkers.length;o<a;o++)this._resizeMarkers[o].setLatLng(n[o])}}),L.Rectangle.addInitHook(function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.CircleMarker=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var n=this._shape.getLatLng();this._moveMarker=this._createMarker(n,this.options.moveIcon)},_createResizeMarker:function(){this._resizeMarkers=[]},_move:function(n){if(this._resizeMarkers.length){var o=this._getResizeMarkerPoint(n);this._resizeMarkers[0].setLatLng(o)}this._shape.setLatLng(n),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})}}),L.CircleMarker.addInitHook(function(){L.Edit.CircleMarker&&(this.editing=new L.Edit.CircleMarker(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),L.Edit=L.Edit||{},L.Edit.Circle=L.Edit.CircleMarker.extend({_createResizeMarker:function(){var n=this._shape.getLatLng(),o=this._getResizeMarkerPoint(n);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(o,this.options.resizeIcon))},_getResizeMarkerPoint:function(n){var o=this._shape._radius*Math.cos(Math.PI/4),a=this._map.project(n);return this._map.unproject([a.x+o,a.y-o])},_resize:function(n){var o=this._moveMarker.getLatLng();L.GeometryUtil.isVersion07x()?radius=o.distanceTo(n):radius=this._map.distance(o,n),this._shape.setRadius(radius),this._map.editTooltip&&this._map._editTooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.subtext+"<br />"+L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(radius,!0,this.options.feet,this.options.nautic)}),this._shape.setRadius(radius),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})}}),L.Circle.addInitHook(function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable())}),L.Map.mergeOptions({touchExtend:!0}),L.Map.TouchExtend=L.Handler.extend({initialize:function(n){this._map=n,this._container=n._container,this._pane=n._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.on(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.on(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.on(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.on(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.on(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.on(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.on(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.on(this._container,"touchleave",this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.off(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.off(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.off(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.off(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.off(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.off(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.off(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.off(this._container,"touchleave",this._onTouchLeave,this))},_touchEvent:function(n,o){var a={};if(n.touches!==void 0){if(!n.touches.length)return;a=n.touches[0]}else if(n.pointerType!=="touch"||(a=n,!this._filterClick(n)))return;var h=this._map.mouseEventToContainerPoint(a),c=this._map.mouseEventToLayerPoint(a),d=this._map.layerPointToLatLng(c);this._map.fire(o,{latlng:d,layerPoint:c,containerPoint:h,pageX:a.pageX,pageY:a.pageY,originalEvent:n})},_filterClick:function(n){var o=n.timeStamp||n.originalEvent.timeStamp,a=L.DomEvent._lastClick&&o-L.DomEvent._lastClick;return a&&a>100&&a<500||n.target._simulatedClick&&!n._simulated?(L.DomEvent.stop(n),!1):(L.DomEvent._lastClick=o,!0)},_onTouchStart:function(n){this._map._loaded&&this._touchEvent(n,"touchstart")},_onTouchEnd:function(n){this._map._loaded&&this._touchEvent(n,"touchend")},_onTouchCancel:function(n){if(this._map._loaded){var o="touchcancel";this._detectIE()&&(o="pointercancel"),this._touchEvent(n,o)}},_onTouchLeave:function(n){this._map._loaded&&this._touchEvent(n,"touchleave")},_onTouchMove:function(n){this._map._loaded&&this._touchEvent(n,"touchmove")},_detectIE:function(){var n=r.navigator.userAgent,o=n.indexOf("MSIE ");if(o>0)return parseInt(n.substring(o+5,n.indexOf(".",o)),10);if(n.indexOf("Trident/")>0){var a=n.indexOf("rv:");return parseInt(n.substring(a+3,n.indexOf(".",a)),10)}var h=n.indexOf("Edge/");return h>0&&parseInt(n.substring(h+5,n.indexOf(".",h)),10)}}),L.Map.addInitHook("addHandler","touchExtend",L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){return this.addInteractiveTarget?L.Marker.prototype._initInteraction.apply(this):this._initInteractionLegacy()},_initInteractionLegacy:function(){if(this.options.clickable){var n=this._icon,o=["dblclick","mousedown","mouseover","mouseout","contextmenu","touchstart","touchend","touchmove"];this._detectIE?o.concat(["MSPointerDown","MSPointerUp","MSPointerMove","MSPointerCancel"]):o.concat(["touchcancel"]),L.DomUtil.addClass(n,"leaflet-clickable"),L.DomEvent.on(n,"click",this._onMouseClick,this),L.DomEvent.on(n,"keypress",this._onKeyPress,this);for(var a=0;a<o.length;a++)L.DomEvent.on(n,o[a],this._fireMouseEvent,this);L.Handler.MarkerDrag&&(this.dragging=new L.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_detectIE:function(){var n=r.navigator.userAgent,o=n.indexOf("MSIE ");if(o>0)return parseInt(n.substring(o+5,n.indexOf(".",o)),10);if(n.indexOf("Trident/")>0){var a=n.indexOf("rv:");return parseInt(n.substring(a+3,n.indexOf(".",a)),10)}var h=n.indexOf("Edge/");return h>0&&parseInt(n.substring(h+5,n.indexOf(".",h)),10)}}),L.LatLngUtil={cloneLatLngs:function(n){for(var o=[],a=0,h=n.length;a<h;a++)Array.isArray(n[a])?o.push(L.LatLngUtil.cloneLatLngs(n[a])):o.push(this.cloneLatLng(n[a]));return o},cloneLatLng:function(n){return L.latLng(n.lat,n.lng)}},function(){var n={km:2,ha:2,m:0,mi:2,ac:2,yd:0,ft:0,nm:2};L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(o){var a,h,c=o.length,d=0,f=Math.PI/180;if(c>2){for(var p=0;p<c;p++)a=o[p],h=o[(p+1)%c],d+=(h.lng-a.lng)*f*(2+Math.sin(a.lat*f)+Math.sin(h.lat*f));d=6378137*d*6378137/2}return Math.abs(d)},formattedNumber:function(o,a){var h=parseFloat(o).toFixed(a),c=L.drawLocal.format&&L.drawLocal.format.numeric,d=c&&c.delimiters,f=d&&d.thousands,p=d&&d.decimal;if(f||p){var m=h.split(".");h=f?m[0].replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f):m[0],p=p||".",m.length>1&&(h=h+p+m[1])}return h},readableArea:function(o,a,f){var c,d,f=L.Util.extend({},n,f);return a?(d=["ha","m"],type=typeof a,type==="string"?d=[a]:type!=="boolean"&&(d=a),c=o>=1e6&&d.indexOf("km")!==-1?L.GeometryUtil.formattedNumber(1e-6*o,f.km)+" km²":o>=1e4&&d.indexOf("ha")!==-1?L.GeometryUtil.formattedNumber(1e-4*o,f.ha)+" ha":L.GeometryUtil.formattedNumber(o,f.m)+" m²"):(o/=.836127,c=o>=3097600?L.GeometryUtil.formattedNumber(o/3097600,f.mi)+" mi²":o>=4840?L.GeometryUtil.formattedNumber(o/4840,f.ac)+" acres":L.GeometryUtil.formattedNumber(o,f.yd)+" yd²"),c},readableDistance:function(o,a,h,c,p){var f,p=L.Util.extend({},n,p);switch(a?typeof a=="string"?a:"metric":h?"feet":c?"nauticalMile":"yards"){case"metric":f=o>1e3?L.GeometryUtil.formattedNumber(o/1e3,p.km)+" km":L.GeometryUtil.formattedNumber(o,p.m)+" m";break;case"feet":o*=3.28083,f=L.GeometryUtil.formattedNumber(o,p.ft)+" ft";break;case"nauticalMile":o*=.53996,f=L.GeometryUtil.formattedNumber(o/1e3,p.nm)+" nm";break;case"yards":default:o*=1.09361,f=o>1760?L.GeometryUtil.formattedNumber(o/1760,p.mi)+" miles":L.GeometryUtil.formattedNumber(o,p.yd)+" yd"}return f},isVersion07x:function(){var o=L.version.split(".");return parseInt(o[0],10)===0&&parseInt(o[1],10)===7}})}(),L.Util.extend(L.LineUtil,{segmentsIntersect:function(n,o,a,h){return this._checkCounterclockwise(n,a,h)!==this._checkCounterclockwise(o,a,h)&&this._checkCounterclockwise(n,o,a)!==this._checkCounterclockwise(n,o,h)},_checkCounterclockwise:function(n,o,a){return(a.y-n.y)*(o.x-n.x)>(o.y-n.y)*(a.x-n.x)}}),L.Polyline.include({intersects:function(){var n,o,a,h=this._getProjectedPoints(),c=h?h.length:0;if(this._tooFewPointsForIntersection())return!1;for(n=c-1;n>=3;n--)if(o=h[n-1],a=h[n],this._lineSegmentsIntersectsRange(o,a,n-2))return!0;return!1},newLatLngIntersects:function(n,o){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(n),o)},newPointIntersects:function(n,o){var a=this._getProjectedPoints(),h=a?a.length:0,c=a?a[h-1]:null,d=h-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(c,n,d,o?1:0)},_tooFewPointsForIntersection:function(n){var o=this._getProjectedPoints(),a=o?o.length:0;return a+=n||0,!o||a<=3},_lineSegmentsIntersectsRange:function(n,o,a,h){var c,d,f=this._getProjectedPoints();h=h||0;for(var p=a;p>h;p--)if(c=f[p-1],d=f[p],L.LineUtil.segmentsIntersect(n,o,c,d))return!0;return!1},_getProjectedPoints:function(){if(!this._defaultShape)return this._originalPoints;for(var n=[],o=this._defaultShape(),a=0;a<o.length;a++)n.push(this._map.latLngToLayerPoint(o[a]));return n}}),L.Polygon.include({intersects:function(){var n,o,a,h,c=this._getProjectedPoints();return!this._tooFewPointsForIntersection()&&(!!L.Polyline.prototype.intersects.call(this)||(n=c.length,o=c[0],a=c[n-1],h=n-2,this._lineSegmentsIntersectsRange(a,o,h,1)))}}),L.Control.Draw=L.Control.extend({options:{position:"topleft",draw:{},edit:!1},initialize:function(n){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");L.Control.prototype.initialize.call(this,n);var o;this._toolbars={},L.DrawToolbar&&this.options.draw&&(o=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=o,this._toolbars[L.DrawToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(o=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=o,this._toolbars[L.EditToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.toolbar=this},onAdd:function(n){var o,a=L.DomUtil.create("div","leaflet-draw"),h=!1;for(var c in this._toolbars)this._toolbars.hasOwnProperty(c)&&(o=this._toolbars[c].addToolbar(n))&&(h||(L.DomUtil.hasClass(o,"leaflet-draw-toolbar-top")||L.DomUtil.addClass(o.childNodes[0],"leaflet-draw-toolbar-top"),h=!0),a.appendChild(o));return a},onRemove:function(){for(var n in this._toolbars)this._toolbars.hasOwnProperty(n)&&this._toolbars[n].removeToolbar()},setDrawingOptions:function(n){for(var o in this._toolbars)this._toolbars[o]instanceof L.DrawToolbar&&this._toolbars[o].setOptions(n)},_toolbarEnabled:function(n){var o=n.target;for(var a in this._toolbars)this._toolbars[a]!==o&&this._toolbars[a].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))}),L.Toolbar=L.Class.extend({initialize:function(n){L.setOptions(this,n),this._modes={},this._actionButtons=[],this._activeMode=null;var o=L.version.split(".");parseInt(o[0],10)===1&&parseInt(o[1],10)>=2?L.Toolbar.include(L.Evented.prototype):L.Toolbar.include(L.Mixin.Events)},enabled:function(){return this._activeMode!==null},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(n){var o,a=L.DomUtil.create("div","leaflet-draw-section"),h=0,c=this._toolbarClass||"",d=this.getModeHandlers(n);for(this._toolbarContainer=L.DomUtil.create("div","leaflet-draw-toolbar leaflet-bar"),this._map=n,o=0;o<d.length;o++)d[o].enabled&&this._initModeHandler(d[o].handler,this._toolbarContainer,h++,c,d[o].title);if(h)return this._lastButtonIndex=--h,this._actionsContainer=L.DomUtil.create("ul","leaflet-draw-actions"),a.appendChild(this._toolbarContainer),a.appendChild(this._actionsContainer),a},removeToolbar:function(){for(var n in this._modes)this._modes.hasOwnProperty(n)&&(this._disposeButton(this._modes[n].button,this._modes[n].handler.enable,this._modes[n].handler),this._modes[n].handler.disable(),this._modes[n].handler.off("enabled",this._handlerActivated,this).off("disabled",this._handlerDeactivated,this));this._modes={};for(var o=0,a=this._actionButtons.length;o<a;o++)this._disposeButton(this._actionButtons[o].button,this._actionButtons[o].callback,this);this._actionButtons=[],this._actionsContainer=null},_initModeHandler:function(n,o,a,h,c){var d=n.type;this._modes[d]={},this._modes[d].handler=n,this._modes[d].button=this._createButton({type:d,title:c,className:h+"-"+d,container:o,callback:this._modes[d].handler.enable,context:this._modes[d].handler}),this._modes[d].buttonIndex=a,this._modes[d].handler.on("enabled",this._handlerActivated,this).on("disabled",this._handlerDeactivated,this)},_detectIOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!r.MSStream},_createButton:function(n){var o=L.DomUtil.create("a",n.className||"",n.container),a=L.DomUtil.create("span","sr-only",n.container);o.href="#",o.appendChild(a),n.title&&(o.title=n.title,a.innerHTML=n.title),n.text&&(o.innerHTML=n.text,a.innerHTML=n.text);var h=this._detectIOS()?"touchstart":"click";return L.DomEvent.on(o,"click",L.DomEvent.stopPropagation).on(o,"mousedown",L.DomEvent.stopPropagation).on(o,"dblclick",L.DomEvent.stopPropagation).on(o,"touchstart",L.DomEvent.stopPropagation).on(o,"click",L.DomEvent.preventDefault).on(o,h,n.callback,n.context),o},_disposeButton:function(n,o){var a=this._detectIOS()?"touchstart":"click";L.DomEvent.off(n,"click",L.DomEvent.stopPropagation).off(n,"mousedown",L.DomEvent.stopPropagation).off(n,"dblclick",L.DomEvent.stopPropagation).off(n,"touchstart",L.DomEvent.stopPropagation).off(n,"click",L.DomEvent.preventDefault).off(n,a,o)},_handlerActivated:function(n){this.disable(),this._activeMode=this._modes[n.handler],L.DomUtil.addClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._showActionsToolbar(),this.fire("enable")},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._activeMode=null,this.fire("disable")},_createActions:function(n){var o,a,h,c,d=this._actionsContainer,f=this.getActions(n),p=f.length;for(a=0,h=this._actionButtons.length;a<h;a++)this._disposeButton(this._actionButtons[a].button,this._actionButtons[a].callback);for(this._actionButtons=[];d.firstChild;)d.removeChild(d.firstChild);for(var m=0;m<p;m++)"enabled"in f[m]&&!f[m].enabled||(o=L.DomUtil.create("li","",d),c=this._createButton({title:f[m].title,text:f[m].text,container:o,callback:f[m].callback,context:f[m].context}),this._actionButtons.push({button:c,callback:f[m].callback}))},_showActionsToolbar:function(){var n=this._activeMode.buttonIndex,o=this._lastButtonIndex,a=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=a+"px",n===0&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-top")),n===o&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-bottom")),this._actionsContainer.style.display="block",this._map.fire(L.Draw.Event.TOOLBAROPENED)},_hideActionsToolbar:function(){this._actionsContainer.style.display="none",L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-top"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-bottom"),this._map.fire(L.Draw.Event.TOOLBARCLOSED)}}),L.Draw=L.Draw||{},L.Draw.Tooltip=L.Class.extend({initialize:function(n){this._map=n,this._popupPane=n._panes.popupPane,this._visible=!1,this._container=n.options.drawControlTooltips?L.DomUtil.create("div","leaflet-draw-tooltip",this._popupPane):null,this._singleLineLabel=!1,this._map.on("mouseout",this._onMouseOut,this)},dispose:function(){this._map.off("mouseout",this._onMouseOut,this),this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(n){return this._container?(n.subtext=n.subtext||"",n.subtext.length!==0||this._singleLineLabel?n.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!0),this._container.innerHTML=(n.subtext.length>0?'<span class="leaflet-draw-tooltip-subtext">'+n.subtext+"</span><br />":"")+"<span>"+n.text+"</span>",n.text||n.subtext?(this._visible=!0,this._container.style.visibility="inherit"):(this._visible=!1,this._container.style.visibility="hidden"),this):this},updatePosition:function(n){var o=this._map.latLngToLayerPoint(n),a=this._container;return this._container&&(this._visible&&(a.style.visibility="inherit"),L.DomUtil.setPosition(a,o)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,"leaflet-error-draw-tooltip"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,"leaflet-error-draw-tooltip"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility="hidden")}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:"draw"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{},circlemarker:{}},initialize:function(n){for(var o in this.options)this.options.hasOwnProperty(o)&&n[o]&&(n[o]=L.extend({},this.options[o],n[o]));this._toolbarClass="leaflet-draw-draw",L.Toolbar.prototype.initialize.call(this,n)},getModeHandlers:function(n){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(n,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(n,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(n,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(n,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(n,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker},{enabled:this.options.circlemarker,handler:new L.Draw.CircleMarker(n,this.options.circlemarker),title:L.drawLocal.draw.toolbar.buttons.circlemarker}]},getActions:function(n){return[{enabled:n.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:n.completeShape,context:n},{enabled:n.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:n.deleteLastVertex,context:n},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(n){L.setOptions(this,n);for(var o in this._modes)this._modes.hasOwnProperty(o)&&n.hasOwnProperty(o)&&this._modes[o].handler.setOptions(n[o])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:"edit"},options:{edit:{selectedPathOptions:{dashArray:"10, 10",fill:!0,fillColor:"#fe57a1",fillOpacity:.1,maintainColor:!1}},remove:{},poly:null,featureGroup:null},initialize:function(n){n.edit&&(n.edit.selectedPathOptions===void 0&&(n.edit.selectedPathOptions=this.options.edit.selectedPathOptions),n.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,n.edit.selectedPathOptions)),n.remove&&(n.remove=L.extend({},this.options.remove,n.remove)),n.poly&&(n.poly=L.extend({},this.options.poly,n.poly)),this._toolbarClass="leaflet-draw-edit",L.Toolbar.prototype.initialize.call(this,n),this._selectedFeatureCount=0},getModeHandlers:function(n){var o=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(n,{featureGroup:o,selectedPathOptions:this.options.edit.selectedPathOptions,poly:this.options.poly}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(n,{featureGroup:o}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(n){var o=[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}];return n.removeAllLayers&&o.push({title:L.drawLocal.edit.toolbar.actions.clearAll.title,text:L.drawLocal.edit.toolbar.actions.clearAll.text,callback:this._clearAllLayers,context:this}),o},addToolbar:function(n){var o=L.Toolbar.prototype.addToolbar.call(this,n);return this._checkDisabled(),this.options.featureGroup.on("layeradd layerremove",this._checkDisabled,this),o},removeToolbar:function(){this.options.featureGroup.off("layeradd layerremove",this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode&&this._activeMode.handler.disable()},_clearAllLayers:function(){this._activeMode.handler.removeAllLayers(),this._activeMode&&this._activeMode.handler.disable()},_checkDisabled:function(){var n,o=this.options.featureGroup,a=o.getLayers().length!==0;this.options.edit&&(n=this._modes[L.EditToolbar.Edit.TYPE].button,a?L.DomUtil.removeClass(n,"leaflet-disabled"):L.DomUtil.addClass(n,"leaflet-disabled"),n.setAttribute("title",a?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(n=this._modes[L.EditToolbar.Delete.TYPE].button,a?L.DomUtil.removeClass(n,"leaflet-disabled"):L.DomUtil.addClass(n,"leaflet-disabled"),n.setAttribute("title",a?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:"edit"},initialize:function(n,o){if(L.Handler.prototype.initialize.call(this,n),L.setOptions(this,o),this._featureGroup=o.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE;var a=L.version.split(".");parseInt(a[0],10)===1&&parseInt(a[1],10)>=2?L.EditToolbar.Edit.include(L.Evented.prototype):L.EditToolbar.Edit.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.EDITSTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on("layeradd",this._enableLayerEdit,this).on("layerremove",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off("layeradd",this._enableLayerEdit,this).off("layerremove",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.EDITSTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(n.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),n._editTooltip=this._tooltip,this._updateTooltip(),this._map.on("mousemove",this._onMouseMove,this).on("touchmove",this._onMouseMove,this).on("MSPointerMove",this._onMouseMove,this).on(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this).off("touchmove",this._onMouseMove,this).off("MSPointerMove",this._onMouseMove,this).off(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},revertLayers:function(){this._featureGroup.eachLayer(function(n){this._revertLayer(n)},this)},save:function(){var n=new L.LayerGroup;this._featureGroup.eachLayer(function(o){o.edited&&(n.addLayer(o),o.edited=!1)}),this._map.fire(L.Draw.Event.EDITED,{layers:n})},_backupLayer:function(n){var o=L.Util.stamp(n);this._uneditedLayerProps[o]||(n instanceof L.Polyline||n instanceof L.Polygon||n instanceof L.Rectangle?this._uneditedLayerProps[o]={latlngs:L.LatLngUtil.cloneLatLngs(n.getLatLngs())}:n instanceof L.Circle?this._uneditedLayerProps[o]={latlng:L.LatLngUtil.cloneLatLng(n.getLatLng()),radius:n.getRadius()}:(n instanceof L.Marker||n instanceof L.CircleMarker)&&(this._uneditedLayerProps[o]={latlng:L.LatLngUtil.cloneLatLng(n.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(n){var o=L.Util.stamp(n);n.edited=!1,this._uneditedLayerProps.hasOwnProperty(o)&&(n instanceof L.Polyline||n instanceof L.Polygon||n instanceof L.Rectangle?n.setLatLngs(this._uneditedLayerProps[o].latlngs):n instanceof L.Circle?(n.setLatLng(this._uneditedLayerProps[o].latlng),n.setRadius(this._uneditedLayerProps[o].radius)):(n instanceof L.Marker||n instanceof L.CircleMarker)&&n.setLatLng(this._uneditedLayerProps[o].latlng),n.fire("revert-edited",{layer:n}))},_enableLayerEdit:function(n){var o,a,h=n.layer||n.target||n;this._backupLayer(h),this.options.poly&&(a=L.Util.extend({},this.options.poly),h.options.poly=a),this.options.selectedPathOptions&&(o=L.Util.extend({},this.options.selectedPathOptions),o.maintainColor&&(o.color=h.options.color,o.fillColor=h.options.fillColor),h.options.original=L.extend({},h.options),h.options.editing=o),h instanceof L.Marker?(h.editing&&h.editing.enable(),h.dragging.enable(),h.on("dragend",this._onMarkerDragEnd).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onMarkerDragEnd,this).on("MSPointerUp",this._onMarkerDragEnd,this)):h.editing.enable()},_disableLayerEdit:function(n){var o=n.layer||n.target||n;o.edited=!1,o.editing&&o.editing.disable(),delete o.options.editing,delete o.options.original,this._selectedPathOptions&&(o instanceof L.Marker?this._toggleMarkerHighlight(o):(o.setStyle(o.options.previousOptions),delete o.options.previousOptions)),o instanceof L.Marker?(o.dragging.disable(),o.off("dragend",this._onMarkerDragEnd,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onMarkerDragEnd,this).off("MSPointerUp",this._onMarkerDragEnd,this)):o.editing.disable()},_onMouseMove:function(n){this._tooltip.updatePosition(n.latlng)},_onMarkerDragEnd:function(n){var o=n.target;o.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:o})},_onTouchMove:function(n){var o=n.originalEvent.changedTouches[0],a=this._map.mouseEventToLayerPoint(o),h=this._map.layerPointToLatLng(a);n.target.setLatLng(h)},_hasAvailableLayers:function(){return this._featureGroup.getLayers().length!==0}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:"remove"},initialize:function(n,o){if(L.Handler.prototype.initialize.call(this,n),L.Util.setOptions(this,o),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this.type=L.EditToolbar.Delete.TYPE;var a=L.version.split(".");parseInt(a[0],10)===1&&parseInt(a[1],10)>=2?L.EditToolbar.Delete.include(L.Evented.prototype):L.EditToolbar.Delete.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on("layeradd",this._enableLayerDelete,this).on("layerremove",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off("layeradd",this._enableLayerDelete,this).off("layerremove",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(n.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(n){this._deletableLayers.addLayer(n),n.fire("revert-deleted",{layer:n})},this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer(function(n){this._removeLayer({layer:n})},this),this.save()},_enableLayerDelete:function(n){(n.layer||n.target||n).on("click",this._removeLayer,this)},_disableLayerDelete:function(n){var o=n.layer||n.target||n;o.off("click",this._removeLayer,this),this._deletedLayers.removeLayer(o)},_removeLayer:function(n){var o=n.layer||n.target||n;this._deletableLayers.removeLayer(o),this._deletedLayers.addLayer(o),o.fire("deleted")},_onMouseMove:function(n){this._tooltip.updatePosition(n.latlng)},_hasAvailableLayers:function(){return this._deletableLayers.getLayers().length!==0}})})(window,document);const FL="";var Vg={draw:{toolbar:{actions:{title:"መሳል ተው",text:"ተው"},finish:{title:"መሳል ጨርስ",text:"ጨርስ"},undo:{title:"መጨረሻ የተሳለውን ነጥብ አጥፋ",text:"መጨረሻ የተሳለውን ነጥብ አጥፋ"},buttons:{polyline:"ፖሊላየን ሳል",polygon:"ፖሊጎን ሳል",rectangle:"አራት መአዘን ሳል",circle:"ክብ ሳል",marker:"ምልክት ሳል",circlemarker:"ክብ ምልክት ሳል"}},handlers:{circle:{tooltip:{start:"ክብ ለመሳል ተጭንው ይጎትቱ"},radius:"ራዲየስ"},circlemarker:{tooltip:{start:"ክብ ምልክት ለመሳል ካርታውን ይጫኑ ይጎትቱ"}},marker:{tooltip:{start:"ምልክት ለመሳል ካርታውን ይጫኑ ይጎትቱ"}},polygon:{tooltip:{start:"ቅርጽን ለመሳል ካርታውን ተጭነው ይጎትቱ",cont:"ቅርጽን መሳሎን ለመቀጠል ይጫኑ",end:"ቅርጽን ስሎ ለመጨረስ የመጀመሪያውን ነጥብ ይጫኑ"}},polyline:{error:"<strong>ስህተት:</strong> መስመሮች እርስ በእርስ መተላለፍ አይችሉም!",tooltip:{start:"መስመር ለመሳል ካርታውን ተጭነው ይጎትቱ",cont:"መስመር መሳሎን ለመቀጠል ይጫኑ",end:"መስመር ስሎ ለመጨረስ የመጨረሻውን ነጥብ ይጫኑ"}},rectangle:{tooltip:{start:"ዐራት መአዝን ለመሳል ካርታውን ይጫኑ ይጎትቱ"}},simpleshape:{tooltip:{end:"ስለው ለመጨረስ አይጤን ይልቀቁ"}}}},edit:{toolbar:{actions:{save:{title:"ለውጦቹን አኑር",text:"አኑር"},cancel:{title:"ማስተካከሉን ተው፣ ሁሉንም ለውጦች ሰርዝ",text:"ተው"},clearAll:{title:"ሁሉንም የካርታ ገጾች አጥፋ",text:"ሁሉንም አጥፋ"}},buttons:{edit:"የካርታ ገጽ አስተካክል",editDisabled:"የሚስተካከል የካርታ ገጽ የለም",remove:"የካርታ ገጽ ሰርዝ.",removeDisabled:"የሚሰረዝ የካርታ ገጽ የለም"}},handlers:{edit:{tooltip:{text:"ለማስተካከል ምልክቱን ወይም መያዣውን ይጎትቱ",subtext:"ለውጥጡን ለመተው ተው የሚለውን ይጫኑ"}},remove:{tooltip:{text:"ማጥፋት የፈለጉትን ይጫኑ"}}}}},Xg={draw:{toolbar:{actions:{title:"Zrušit kreslení",text:"Zrušit"},finish:{title:"Dokončit kreslení",text:"Dokončit"},undo:{title:"Smazat poslední nakreslený bod",text:"Smazat poslední bod"},buttons:{polyline:"Nakreslit mnohoúhelník",polygon:"Nakreslit polygon",rectangle:"Nakreslit obdélník",circle:"Nakreslit kruh",marker:"Nakreslit značku",circlemarker:"Nakreslit kruhovou značku"}},handlers:{circle:{tooltip:{start:"Kliknout a táhnout pro nakreslení kruhu."},radius:"Poloměr"},circlemarker:{tooltip:{start:"Kliknout do mapy pro umístění kruhové značky."}},marker:{tooltip:{start:"Kliknout do mapy pro umístění značky."}},polygon:{tooltip:{start:"Kliknout pro začátek kreslení tvaru.",cont:"Kliknout pro pokračování v kreslení tvaru.",end:"Kliknout na pvní bod k uzavření tvaru."}},polyline:{error:"<strong>Chyba:</strong> hrany tvaru se nemohou protínat!",tooltip:{start:"Kliknout pro začátek kreslení úsečky.",cont:"Kliknout pro pokračování v kreslení úsečky.",end:"Kliknout na koncový bod k ukončení kreslení úsečky."}},rectangle:{tooltip:{start:"Kliknout a táhnout k nakreslení obdélníku."}},simpleshape:{tooltip:{end:"Pustit myš k dokončení kreslení."}}}},edit:{toolbar:{actions:{save:{title:"Uložit změny.",text:"Uložit"},cancel:{title:"Zrušit úpravu, zruší všechny změny.",text:"Zrušit"},clearAll:{title:"Vymazat všechny vrstvy.",text:"Vymazat vše"}},buttons:{edit:"Upravit vrstvy.",editDisabled:"Žádné vrstvy k úpravě.",remove:"Vymazat vrstvy.",removeDisabled:"Žádná vrstva k vymazání."}},handlers:{edit:{tooltip:{text:"Táhnout za úchopy pro editaci tvaru.",subtext:"Kliknutím na zrušit vrátite změny."}},remove:{tooltip:{text:"Kliknout na tvar pro smazání"}}}}},Yg={draw:{toolbar:{actions:{title:"Zeichnung abbrechen",text:"Abbrechen"},finish:{title:"Zeichnung fertigstellen",text:"Fertigstellen"},undo:{title:"Lösche den zuletzt gezeichneten Punkt",text:"Letzter Punkt löschen"},buttons:{polyline:"Zeichne eine Linie",polygon:"Zeichne ein Polygon",rectangle:"Zeichne ein Rechteck",circle:"Zeichne einen Kreis",marker:"Zeichne einen Marker",circlemarker:"Zeichne einen Kreis-Marker"}},handlers:{circle:{tooltip:{start:"Klicken und ziehen um einen Kreis zu zeichnen."},radius:"Radius"},circlemarker:{tooltip:{start:"Karte anklicken um einen Kreis-Marker zu platzieren."}},marker:{tooltip:{start:"Karte anklicken um einen Marker zu platzieren."}},polygon:{tooltip:{start:"Klicken um mit dem Zeichnen einer Form zu beginnen.",cont:"Klicken um mit dem Zeichnen dieser Form fortzufahren.",end:"Erster Punkt anklicken um diese Form abzuschliessen."}},polyline:{error:"<strong>Fehler:</strong> Form-Ecken dürfen sich nicht überschneiden!",tooltip:{start:"Klicken um mit dem Zeichnen einer Linie zu beginnen.",cont:"Klicken um mit dem Zeichnen dieser Linie fortzufahren.",end:"Erster Punkt anklicken um diese Linie abzuschliessen."}},rectangle:{tooltip:{start:"Klicken und ziehen um ein Rechteck zu zeichnen."}},simpleshape:{tooltip:{end:"Maustaste loslassen um die Zeichnung fertigzustellen."}}}},edit:{toolbar:{actions:{save:{title:"Speichere Änderungen.",text:"Speichern"},cancel:{title:"Bearbeitung abbrechen, alle Änderungen verwerfen.",text:"Abbrechen"},clearAll:{title:"Alle Layer bereinigen.",text:"Alles bereinigen"}},buttons:{edit:"Layer bearbeiten.",editDisabled:"Keine Layer zum bearbeiten.",remove:"Layer löschen.",removeDisabled:"Keine Layer zum löschen."}},handlers:{edit:{tooltip:{text:"Ziehe den Griff oder den Marker um die Eigenschaft zu bearbeiten.",subtext:"Klicke abbrechen um Änderungen rückgängig zu machen."}},remove:{tooltip:{text:"Klicke auf eine Eigenschaft um diese zu entfernen."}}}}},Uh={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes.",text:"Save"},cancel:{title:"Cancel editing, discards all changes.",text:"Cancel"},clearAll:{title:"Clear all layers.",text:"Clear All"}},buttons:{edit:"Edit layers.",editDisabled:"No layers to edit.",remove:"Delete layers.",removeDisabled:"No layers to delete."}},handlers:{edit:{tooltip:{text:"Drag handles, or marker to edit feature.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove"}}}}},Kg={draw:{toolbar:{actions:{title:"Cancelar dibujo",text:"Cancelar"},finish:{title:"Terminar dibujo",text:"Terminar"},undo:{title:"Eliminar último punto dibujado",text:"Eliminar último punto"},buttons:{polyline:"Dibujar una polilínea",polygon:"Dibujar un polígono",rectangle:"Dibujar un rectángulo",circle:"Dibujar un círculo",marker:"Dibujar un marcador",circlemarker:"Dibujar un marcador circular"}},handlers:{circle:{tooltip:{start:"Haz click y arrastra para dibujar un círculo"},radius:"Radio"},circlemarker:{tooltip:{start:"Haz click en el mapa para situar el marcador circular"}},marker:{tooltip:{start:"Haz click en el mapa para situar el marcador"}},polygon:{tooltip:{start:"Haz click para empezar a dibujar la forma",cont:"Haz click para continuar dibujando la forma",end:"Haz click en el primer punto para cerrar la forma"}},polyline:{error:"<strong>Error:</strong> las líneas no deben cruzarse",tooltip:{start:"Haz click para empezar a dibujar la línea",cont:"Haz click para continuar dibujando la línea",end:"Haz click en el último punto para terminar la línea"}},rectangle:{tooltip:{start:"Haz click y arrastra para dibujar un rectángulo"}},simpleshape:{tooltip:{end:"Suelta el ratón para terminar de dibujar"}}}},edit:{toolbar:{actions:{save:{title:"Guardar los cambios",text:"Guardar"},cancel:{title:"Cancelar la edición, descarta todos los cambios",text:"Cancelar"},clearAll:{title:"Limpiar todas las capas",text:"Limpiar todo"}},buttons:{edit:"Editar capas",editDisabled:"No hay capas que editar",remove:"Eliminar capas",removeDisabled:"No hay capas que eliminar"}},handlers:{edit:{tooltip:{text:"Arrastra el marcador para editar la forma",subtext:"Haz click en cancelar para deshacer los cambios"}},remove:{tooltip:{text:"Haz click en una forma para eliminarla"}}}}},qg={draw:{toolbar:{actions:{title:"Peru piirustus",text:"Peru"},finish:{title:"Hyväksy piirustus",text:"Hyväksy"},undo:{title:"Poista viimeinen piirretty piste",text:"Poista viimeinen piste"},buttons:{polyline:"Piirrä murtoviiva",polygon:"Piirrä monikulmio",rectangle:"Piirrä suorakulmio",circle:"Piirrä ympyrä",marker:"Piirrä merkki",circlemarker:"Piirrä piirimerkki"}},handlers:{circle:{tooltip:{start:"Piirrä ympyrä pitämällä hiiri painettuna ja vetämällä."},radius:"Säde"},circlemarker:{tooltip:{start:"Aseta ympyrämerkki painamalla karttaa."}},marker:{tooltip:{start:"Aseta markkeri painamalla karttaa."}},polygon:{tooltip:{start:"Paina aloittaaksesi muodon piirtämisen.",cont:"Paina jatkaaksesi muodon piirtämistä.",end:"Sulje muoto painamalla ensimmäistä pistettä."}},polyline:{error:"<strong>Virhe:</strong> muodon reunaa ei voi ylittää!",tooltip:{start:"Paina aloittaaksesi viivan piirtämisen.",cont:"Paina jatkaaksesi viivan piirtämistä.",end:"Paina viimeistä pistettä päättäksesi viiva."}},rectangle:{tooltip:{start:"Piirrä suorakulmio pitämällä hiiri painettuna ja vetämällä."}},simpleshape:{tooltip:{end:"Vapauta hiiri päättääksesi piirtämisen."}}}},edit:{toolbar:{actions:{save:{title:"Hyväksy muutokset.",text:"Hyväksy"},cancel:{title:"Peru muokkaus, hylkää kaikki muutokset.",text:"Peru"},clearAll:{title:"Poista kaikki tasot.",text:"Poista kaikki"}},buttons:{edit:"Muokkaa tasoja.",editDisabled:"Ei muokattavia tasoja.",remove:"Poista tasot.",removeDisabled:"Ei poistettavia tasoja."}},handlers:{edit:{tooltip:{text:"Vedä pistettä tai markkeria muokataksesi piirrettyjä ominaisuuksia.",subtext:"Kumoa muutokset painamalla peruuta."}},remove:{tooltip:{text:"Paina piirrettyä ominaisuutta poistaaksesi"}}}}},Jg={draw:{toolbar:{actions:{title:"Annuler le dessin",text:"Annuler"},finish:{title:"Terminer le dessin",text:"Terminer"},undo:{title:"Supprimer le dernier point tiré",text:"Supprimer le dernier point"},buttons:{polyline:"Dessinez une polyligne",polygon:"Dessinez un polygone",rectangle:"Dessinez un rectangle",circle:"Dessiner un cercle",marker:"Dessinez un marqueur",circlemarker:"Dessinez un marqueur circulaire"}},handlers:{circle:{tooltip:{start:"Cliquez et faites glisser pour dessiner le cercle."},radius:"Rayon"},circlemarker:{tooltip:{start:"Cliquez sur la carte pour placer le marqueur circulaire."}},marker:{tooltip:{start:"Cliquez sur la carte pour placer le marqueur."}},polygon:{tooltip:{start:"Cliquez pour commencer à dessiner.",cont:"Cliquez pour continuer à dessiner.",end:"Cliquez sur le premier point pour fermer cette forme."}},polyline:{error:"<strong>Erreur:</strong> les polyligne ne peuvent pas traverser!",tooltip:{start:"Cliquez pour commencer à dessiner.",cont:"Cliquez pour continuer à dessiner.",end:"Cliquez sur le dernier point pour fermer cette forme."}},rectangle:{tooltip:{start:"Cliquez et faites glisser pour dessiner le rectangle."}},simpleshape:{tooltip:{end:"Relâchez la souris pour terminer le dessin."}}}},edit:{toolbar:{actions:{save:{title:"Sauvegarder les modifications.",text:"Sauvegarder"},cancel:{title:"Annuler l'édition, rejette toutes les modifications.",text:"Annuler"},clearAll:{title:"Effacez toutes les collections.",text:"Tout effacer"}},buttons:{edit:"Modifier les collections.",editDisabled:"Pas de collections à éditer.",remove:"Supprimez les collections.",removeDisabled:"Pas de collections à supprimer."}},handlers:{edit:{tooltip:{text:"Sélectionnez les poignées ou le marqueur pour modifier l'entité.",subtext:"Cliquez sur annuler pour rétablir les modifications."}},remove:{tooltip:{text:"Cliquez sur une entité pour supprimer"}}}}},Qg={draw:{toolbar:{actions:{title:"Rajzolás elvetése",text:"Mégse"},finish:{title:"Rajzolás befejezése",text:"Befejezés"},undo:{title:"Legutóbbi pont törlése",text:"Legutóbbi pont törlése"},buttons:{polyline:"Útvonal rajzolása",polygon:"Sokszög rajzolása",rectangle:"Négyszög rajzolása",circle:"Kör rajzolása",marker:"Jelölő rajzolása",circlemarker:"Kör-jelölő rajzolása"}},handlers:{circle:{tooltip:{start:"Kattintson és tartsa nyomva a rajzoláshoz."},radius:"Sugár"},circlemarker:{tooltip:{start:"Kör-jelölő elhelyezéséhez kattintson a térképre."}},marker:{tooltip:{start:"Jelölő elhelyezéséhez kattintson a térképre."}},polygon:{tooltip:{start:"Alakzat rajzolásához kattintson a térképre.",cont:"Alakzat folytatásához kattintson a térképre.",end:"Alakzat befejezéséhez kattintson a kezdőpontra."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Útvonal rajzolásához kattintson a térképre.",cont:"Útvonal folytatásához kattintson a térképre.",end:"Útvonal befejezéséhez kattintson a végpontra."}},rectangle:{tooltip:{start:"Kattintson és tartsa nyomva négyszög rajzolásához."}},simpleshape:{tooltip:{end:"Ha elégedett az alakzattal, engedje fel az egér gombját."}}}},edit:{toolbar:{actions:{save:{title:"Változtatások elmentése.",text:"Mentés"},cancel:{title:"Változtatások elvetése.",text:"Mégse"},clearAll:{title:"Összes réteg törlése.",text:"Összes törlése"}},buttons:{edit:"Rétegek szerkesztése.",editDisabled:"Nem állnak rendelkezésre szerkeszthető rétegek.",remove:"Rétegek törlése.",removeDisabled:"Nem állnak rendelkezésre törölhető rétegek."}},handlers:{edit:{tooltip:{text:"Módosításhoz használja a jelölők, alakzatok kezelőit.",subtext:"Változások elvetéséhez kattintson a 'Mégse' gombra."}},remove:{tooltip:{text:"Kattintson a jelölőkre, alakzatokra az eltávolításukhoz."}}}}},$g={draw:{toolbar:{actions:{title:"Annulla disegno",text:"Annulla"},finish:{title:"Completa disegno",text:"Completa"},undo:{title:"Elimina l'ultimo punto disegnato",text:"Elimina l'ultimo punto"},buttons:{polyline:"Disegna una polilinea",polygon:"Disegna un poligono",rectangle:"Disegna un rettangolo",circle:"Disegna un cerchio",marker:"Disegna un marcatore",circlemarker:"Disegna un marker circolare"}},handlers:{circle:{tooltip:{start:"Clicca e trascina per disegnare un cerchio."},radius:"Raggio"},circlemarker:{tooltip:{start:"Clicca la mappa per posizionare un marcatore circolare."}},marker:{tooltip:{start:"Clicca la mappa per posizionare un marcatore."}},polygon:{tooltip:{start:"Clicca per iniziare a disegnare una figura.",cont:"Clicca per continuare a disegnare una figura.",end:"Clicca il primo punto per chiudere questa figura."}},polyline:{error:"<strong>Errore:</strong> i margini della figura non si possono incrociare!",tooltip:{start:"Clicca per iniziare a disegnare una linea.",cont:"Clicca per continuare a disegnare una linea",end:"Clicca l'ultimo punto per finire questa linea"}},rectangle:{tooltip:{start:"Clicca e trascina per disegnare un rettangolo."}},simpleshape:{tooltip:{end:"Rilascia il mouse per finire il disegno."}}}},edit:{toolbar:{actions:{save:{title:"Salva modifiche.",text:"Salva"},cancel:{title:"Annulla tutte le modifiche.",text:"Annulla"},clearAll:{title:"Pulisci tutti i livelli.",text:"Pulisci tutto"}},buttons:{edit:"Modifica i livelli.",editDisabled:"Nessun livello disponibile per la modifica.",remove:"Elimina livelli.",removeDisabled:"Nessun livello disponibile per l'eliminazione."}},handlers:{edit:{tooltip:{text:"Trascina le maniglie, o i marcatori per modificare l'elemento.",subtext:"Clicca annulla per annullare le modifiche."}},remove:{tooltip:{text:"Clicca un elemento per rimuoverlo"}}}}},tp={draw:{toolbar:{actions:{title:"ხატვის გაუქმება",text:"გაუქმება"},finish:{title:"ხატვის დასრულება",text:"დასრულება"},undo:{title:"ბოლო დახატული წერტილის წაშლა",text:"ბოლო წერტილის წაშლა"},buttons:{polyline:"პოლილაინის დახაზვა",polygon:"პოლიგონის დახაზვა",rectangle:"მართკუთხედის დახაზვა",circle:"წრის დახაზვა",marker:"ადგილმდებარეობის დატანა",circlemarker:"ადგილმდებარეობის დატანა(წრის სახით)"}},handlers:{circle:{tooltip:{start:"დააწკაპუნეთ და გადაიტანეთ იმისათვის, რომ წრე დახაზოთ."},radius:"რადიუსი"},circlemarker:{tooltip:{start:"დააწკაპუნეთ რუკაზე ადგილმდებარეობის შესაქმნელად."}},marker:{tooltip:{start:"დააწკაპუნეთ რუკაზე ადგილმდებარეობის შესაქმნელად."}},polygon:{tooltip:{start:"დააწკაპუნეთ, კონტურის ხაზვის დაწყებისთვის.",cont:"დააწკაპუნეთ, კონტრუსი ხაზვის დასრულებისთვის.",end:"დააწკაპუნეთ პირველ წერტილზე, რათა დაასრულოთ კონტურის ხაზვა."}},polyline:{error:"<strong>შეცდომა:</strong> ხაზი ვერ გადაკვეთავს თავის თავს",tooltip:{start:"დააწკაპუნეთ, ხაზის ხაზვის დაწყებისთვის.",cont:"დააწკაპუნეთ, ხაზის ხაზვის დასრულებისთვის.",end:"დააწკაპუნეთ ბოლო წერტილზე, რათა დაასრულოთ ხაზის ხაზვა."}},rectangle:{tooltip:{start:"დააწკაპუნეთ და გადაიტანეთ იმისათვის, რომ მართკუთხედი დახაზოთ."}},simpleshape:{tooltip:{end:"გაათავისუფლეთ თაგვის ღილაკი ხაზვის დასასრულებლად."}}}},edit:{toolbar:{actions:{save:{title:"ცვლილებების შენახვა.",text:"შენახვა"},cancel:{title:"რედაქტირების გაუქმება, დააბრუნე ყველა ცვლილება.",text:"გაუქმება"},clearAll:{title:"ყველა რედაქტირებული ფენის გასუფთავება.",text:"გასუფთავება"}},buttons:{edit:"რედაქტირება.",editDisabled:"ფენები არ არის რედაქტირებისთვის.",remove:"წაშლა.",removeDisabled:"ფენები არ არის წაშლისთვის."}},handlers:{edit:{tooltip:{text:"გადაიტანეთ წვერები ან წერტილები ობიექტის რედაქტირებისთვის.",subtext:'დააჭირეთ "გაუქმება", საწყის მდგომარეობაში დასაბრუნებლად.'}},remove:{tooltip:{text:"დააწკაპუნეთ ობიექტზე წაშლისთვის"}}}}},ep={draw:{toolbar:{actions:{title:"Tekening annuleren",text:"Annuleren"},finish:{title:"Tekening voltooien",text:"Voltooien"},undo:{title:"Laatst getekende punt verwijderen",text:"Verwijder laatst getekende punt"},buttons:{polyline:"Teken een polygonale lijn",polygon:"Teken een polygoon",rectangle:"Teken een rechthoek",circle:"Teken een cirkel",marker:"Plaats een marker",circlemarker:"Teken een cirkelmarkering"}},handlers:{circle:{tooltip:{start:"Klik en sleep om de cirkel te tekenen."},radius:"Radius"},circlemarker:{tooltip:{start:"Klik op de kaart om de cirkelmarkering te plaatsen."}},marker:{tooltip:{start:"Klik op de kaart om de markering te plaatsen."}},polygon:{tooltip:{start:"Klik om te beginnen met het tekenen van de polygoon.",cont:"Klik om door te gaan met het tekenen van de vorm.",end:"Klik op het eerste punt om dit polygoon te sluiten."}},polyline:{error:"<strong>Fout:</strong> vormranden kunnen niet kruisen!",tooltip:{start:"Klik om te beginnen met het tekenen van een lijn.",cont:"Klik om door te gaan met het tekenen van de lijn.",end:"Klik laatst getekende punt om deze lijn te voltooien."}},rectangle:{tooltip:{start:"Klik en sleep om een rechthoek te tekenen."}},simpleshape:{tooltip:{end:"Laat de muis los om de tekening te voltooien."}}}},edit:{toolbar:{actions:{save:{title:"Wijzigingen opslaan.",text:"Opslaan"},cancel:{title:"Annuleer bewerken en verwijder alle wijzigingen.",text:"Annuleren"},clearAll:{title:"Verwijder alle lagen.",text:"Verwijderd alles"}},buttons:{edit:"Lagen bewerken.",editDisabled:"Geen lagen om te bewerken.",remove:"Verwijder lagen.",removeDisabled:"Geen lagen om te verwijderen."}},handlers:{edit:{tooltip:{text:"Sleep hoeken om te schalen of middenpunt om te verplaatsen.",subtext:"Klik op annuleren om wijzigingen ongedaan te maken."}},remove:{tooltip:{text:"Klik op een vorm om die te verwijderen"}}}}},ip={draw:{toolbar:{actions:{title:"Avbryt markering",text:"Avbryt"},finish:{title:"Ferdiggjør markering",text:"Ferdiggjør"},undo:{title:"Ta bort siste punkt",text:"Slett siste punkt"},buttons:{polyline:"Tegn flere linjer",polygon:"Tegn en mangekant",rectangle:"Tegn et rektangel",circle:"Tegn en sirkel",marker:"Sett et markeringspunkt",circlemarker:"Tegn et sirkelpunkt"}},handlers:{circle:{tooltip:{start:"Klikk og dra for å tegne en sirkel."},radius:"Radius"},circlemarker:{tooltip:{start:"Klikk på kartet for å plassere et sirkelpunkt."}},marker:{tooltip:{start:"Klikk på kartet for å markere et punkt."}},polygon:{tooltip:{start:"Klikk for å tegne et område.",cont:"Klikk for å fortsette tegningen.",end:"Klikk på det første punktet for å lukke området."}},polyline:{error:"<strong>Error:</strong> kantene kan ikke krysses!",tooltip:{start:"Klikk for å tegne en linje.",cont:"Klikk for å fortsette å tegne linjen.",end:"Kikk siste punkt for å ferdiggjøre linjen."}},rectangle:{tooltip:{start:"Klikk og dra for å tegne et rektangel."}},simpleshape:{tooltip:{end:"Slipp museknappen for å gjøre tegningen ferdig."}}}},edit:{toolbar:{actions:{save:{title:"Lagre endringer.",text:"Lagre"},cancel:{title:"Avbryt redigering og forkast endringer.",text:"Avbryt"},clearAll:{title:"Nullstill alle figurer.",text:"Nullstill alt."}},buttons:{edit:"Rediger figur.",editDisabled:"Ingen figur å redigere.",remove:"Slett figur.",removeDisabled:"Ingen figur å slette."}},handlers:{edit:{tooltip:{text:"Dra markør for å redigere.",subtext:"Klikk avbryt for å angre endringer."}},remove:{tooltip:{text:"Klikk for å ta bort"}}}}},np={draw:{toolbar:{actions:{title:"Anuluj wyznaczanie",text:"Anuluj"},finish:{title:"Zakończ wyznaczanie",text:"Zakończ"},undo:{title:"Usuń ostatnio wyznaczony punkt",text:"Usuń ostatni punkt"},buttons:{polyline:"Wyznacz wzór",polygon:"Wyznacz wielokąt",rectangle:"Wyznacz prostokąt",circle:"Wyznacz koło",marker:"Umieść znacznik",circlemarker:"Umieść okrągły znacznik"}},handlers:{circle:{tooltip:{start:"Kliknij i przeciągnij, aby wyznaczyć koło."},radius:"Promień"},circlemarker:{tooltip:{start:"Kliknij na mapę, aby umieścić okrągły znacznik."}},marker:{tooltip:{start:"Kliknij na mapę, aby umieścić znacznik."}},polygon:{tooltip:{start:"Kliknij, aby rozpocząć wyznaczanie kształtu.",cont:"Kliknij, aby kontynuować wyznaczanie kształtu.",end:"Kliknij pierwszy punkt, aby zakończyć ten kształt."}},polyline:{error:"<strong>Błąd:</strong> odcinki nie mogą się przecinać!",tooltip:{start:"Kliknij, aby rozpocząć wyznaczanie lini.",cont:"Kliknij, aby kontynuować wyznaczanie lini.",end:"Kliknij ostatni punkt, aby ukończyć linię."}},rectangle:{tooltip:{start:"Kliknij i przeciągnij, aby wyznaczyć prostokąt."}},simpleshape:{tooltip:{end:"Zwolnij przycisk myszy, aby ukończyć wyznaczanie."}}}},edit:{toolbar:{actions:{save:{title:"Zapisz zmiany.",text:"Zapisz"},cancel:{title:"Anuluj edytowanie i odrzuć zmiany.",text:"Anuluj"},clearAll:{title:"Wyczyść wszystkie warstwy.",text:"Wyczyść wszystko"}},buttons:{edit:"Edytuj warstwy.",editDisabled:"Brak warstw do edycji.",remove:"Usuń warstwy.",removeDisabled:"Brak warstw do usunięcia."}},handlers:{edit:{tooltip:{text:"Przeciągnij uchwyt lub znacznik, aby edytować.",subtext:"Kliknij anuluj, aby odrzucić zmiany."}},remove:{tooltip:{text:"Kliknij obiekt, aby go usunąć."}}}}},rp={draw:{toolbar:{actions:{title:"Cancelar desenho",text:"Cancelar"},finish:{title:"Terminar desenho",text:"Terminar"},undo:{title:"Eliminar último ponto desenhado",text:"Eliminar último ponto"},buttons:{polyline:"Desenhar uma polilinha",polygon:"Desenhar um polígono",rectangle:"Desenhar um retângulo",circle:"Desenhar um círculo",marker:"Desenhar un marcador",circlemarker:"Desenhar um marcador circular"}},handlers:{circle:{tooltip:{start:"Clique e arrastrar para desenhar o círculo."},radius:"Raio"},circlemarker:{tooltip:{start:"Clique no mapa para colocar o marcador circular."}},marker:{tooltip:{start:"Clique no mapa para colocar o marcador."}},polygon:{tooltip:{start:"Clique para começar a desenhar a figura.",cont:"Clique para continuar desenhando a figura.",end:"Clique no primeiro ponto para fechar esta figura."}},polyline:{error:"<strong>Erro:</strong> as bordas de uma forma não podem atravessar!",tooltip:{start:"Clique para começar a desenhar a linha.",cont:"Clique para continuar desenhando a linha.",end:"Clique no último ponto para terminar a linha."}},rectangle:{tooltip:{start:"Clique e arrastrar para desenhar o retângulo."}},simpleshape:{tooltip:{end:"Solte o mouse para terminar o desenho."}}}},edit:{toolbar:{actions:{save:{title:"Guardar alterações.",text:"Guardar"},cancel:{title:"Cancelar edição, descarta todas as alterações.",text:"Cancelar"},clearAll:{title:"Limpar todas as camadas.",text:"Limpar tudo"}},buttons:{edit:"Editar camadas.",editDisabled:"Nenhuma camada que editar.",remove:"Eliminar camadas.",removeDisabled:"Nenhuma camada que eliminar."}},handlers:{edit:{tooltip:{text:"Arraste os manipuladores ou marcadores para editar a figura.",subtext:"Clique em cancelar para desfazer as alterações."}},remove:{tooltip:{text:"Clique em uma figura para removê-la"}}}}},sp={draw:{toolbar:{actions:{title:"Отменить рисование",text:"Отмена"},finish:{title:"Завершить рисование",text:"Завершить"},undo:{title:"Удалить последнюю нарисованную точку",text:"Удалить последнюю точку"},buttons:{polyline:"Нарисовать полилинию",polygon:"Нарисовать полигон",rectangle:"Нарисовать прямоугольник",circle:"Нарисовать круг",marker:"Нарисовать точку",circlemarker:"Нарисовать точку(в виде круга)"}},handlers:{circle:{tooltip:{start:"Кликните и перетащите для того, чтобы нарисовать круг."},radius:"Радиус"},circlemarker:{tooltip:{start:"Кликните на карту для установки точки."}},marker:{tooltip:{start:"Кликните на карту для установки точки."}},polygon:{tooltip:{start:"Кликните, чтобы начать рисовать контур.",cont:"Кликните, чтобы завершить рисовать контур.",end:"Кликните на первую точку, чтобы завершить рисование контура."}},polyline:{error:"<strong>Ошибка:</strong> линия не может самопересекаться!",tooltip:{start:"Кликните, чтобы начать рисовать линию.",cont:"Кликните, чтобы завершить рисование линии.",end:"Кликните на последнюю точку, чтобы завершить рисование линии."}},rectangle:{tooltip:{start:"Кликните и перетащите, чтобы нарисовать прямоугольник."}},simpleshape:{tooltip:{end:"Отпустите кнопку мыши для завершения рисования."}}}},edit:{toolbar:{actions:{save:{title:"Сохранить изменения.",text:"Сохранить"},cancel:{title:"Отменить редактирование, откатить все изменения.",text:"Отмена"},clearAll:{title:"Очистить все редактируемые слои.",text:"Очистить всё"}},buttons:{edit:"Редактировать.",editDisabled:"Нет слоёв для редактирования.",remove:"Удалить.",removeDisabled:"Нет слоёв для удаления."}},handlers:{edit:{tooltip:{text:"Перетащите вершины или точки для редактирования фигуры.",subtext:'Нажмите "Отмена", чтобы откатить изменения.'}},remove:{tooltip:{text:"Кликните на фигуру для удаления"}}}}},op={draw:{toolbar:{actions:{title:"Zrušiť kreslenie",text:"Zrušiť"},finish:{title:"Dokončiť kreslenie",text:"Dokončiť"},undo:{title:"Zmazať posledný nakreslený bod",text:"Zmazať posledný bod"},buttons:{polyline:"Nakresliť čiaru",polygon:"Nakresliť polygón",rectangle:"Nakresliť obdĺžnik",circle:"Nakresliť kruh",marker:"Nakresliť bod",circlemarker:"Nakresliť kruhový bod"}},handlers:{circle:{tooltip:{start:"Kliknite a potiahnite, aby ste nakreslili kruh."},radius:"Polomer"},circlemarker:{tooltip:{start:"Kliknite na mapu aby ste umiestnili kruhový bod."}},marker:{tooltip:{start:"Kliknite na mapu aby ste umiestnili bod."}},polygon:{tooltip:{start:"Kliknite, aby ste začali kresliť útvar.",cont:"Kliknite, aby ste nakreslili ďalší bod útvaru.",end:"Kliknite na prvý bod, aby ste uzavreli útvar."}},polyline:{error:"<strong>Chyba:</strong> čiary sa nesmú pretínať!",tooltip:{start:"Kliknite, aby ste začali kresliť čiaru.",cont:"Kliknite, aby ste nakreslili ďalší bod čiary.",end:"Kliknite posledný bod, aby ste dokončili čiaru."}},rectangle:{tooltip:{start:"Kliknite a potiahnite, aby ste nakreslili štvorec."}},simpleshape:{tooltip:{end:"Uvoľnením tlačidla myši ukončíte kreslenie."}}}},edit:{toolbar:{actions:{save:{title:"Uložiť zmeny.",text:"Uložiť"},cancel:{title:"Ukončiť úpravu, zrušiť všetky zmeny.",text:"Zrušiť"},clearAll:{title:"Zmazať všetky vrstvy.",text:"Zmazať všetko"}},buttons:{edit:"Upraviť vrstvy.",editDisabled:"Žiadne vrstvy pre úpravu",remove:"Zmazať vrstvy.",removeDisabled:"Žiadne vrstvy pre zmazanie."}},handlers:{edit:{tooltip:{text:"Potiahnutím vyznačených štvorčekov, alebo bodov upravíte útvar.",subtext:"Kliknite zrušiť, pre zrušenie zmien."}},remove:{tooltip:{text:"Kliknite na útvar pre jeho zmazanie."}}}}},ap={draw:{toolbar:{actions:{title:"Скасувати креслення",text:"Скасувати"},finish:{title:"Завершити креслення",text:"Завершити"},undo:{title:"Видалити останню нанесену точку",text:"Видалити останню точку"},buttons:{polyline:"Накреслити криву",polygon:"Накреслити многокутник",rectangle:"Накреслити прямокутник",circle:"Накреслити коло",marker:"Розмістити маркер",circlemarker:"Розмістити маркер-коло"}},handlers:{circle:{tooltip:{start:"Натисніть і перетягуйте вказівник, щоб накреслити коло."},radius:"Радіус"},circlemarker:{tooltip:{start:"Натисніть на мапу, щоб розмістити маркер-коло."}},marker:{tooltip:{start:"Натисніть на мапу, щоб розмістити маркер."}},polygon:{tooltip:{start:"Натисніть, щоб накреслити фігуру.",cont:"Натисніть, щоб продовжити креслення фігури.",end:"Натисніть на першу точку, щоб замкнути цю фігуру."}},polyline:{error:"<strong>Помилка:</strong> сторони фігури не мають перетинатись!",tooltip:{start:"Натисніть, щоб накреслити лінію.",cont:"Натисніть, щоб продовжити креслення лінії.",end:"Натисніть на останню точку, щоб завершити лінію."}},rectangle:{tooltip:{start:"Натисніть і перетягуйте вказівник, щоб накреслити прямокутник."}},simpleshape:{tooltip:{end:"Відпустіть мишку, щоб завершити рисування."}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни.",text:"Зберегти"},cancel:{title:"Припинити редагування, скасувати всі зміни.",text:"Скасувати"},clearAll:{title:"Очистити всі шари.",text:"Очистити все"}},buttons:{edit:"Редагувати шари.",editDisabled:"Немає шарів для редагування.",remove:"Видалити шари.",removeDisabled:"Немає шарів для видалення."}},handlers:{edit:{tooltip:{text:"Перетягуйте важелі або маркер для редагування фігури.",subtext:"Натисніть «Скасувати» для скасування змін."}},remove:{tooltip:{text:"Натисніть на фігуру для видалення"}}}}},lp={draw:{toolbar:{actions:{title:"الغاء الرسم",text:"الغاء"},finish:{title:"انهاء الرسم",text:"انهاء"},undo:{title:"مسح اخر رسمة",text:"مسح اخر نقطة"},buttons:{polyline:"رسم خط",polygon:"رسم منطقة",rectangle:"رسم مستطيل",circle:"رسم دائرة",marker:"رسم علامة",circlemarker:"رسم علامة دائرة"}},handlers:{circle:{tooltip:{start:"اضغط واسحب لرسم دائرة"},radius:"القطر"},circlemarker:{tooltip:{start:"اضغط على الخريطة لرسم دائرة"}},marker:{tooltip:{start:"اضغط على الخريطة لرسم نقطة"}},polygon:{tooltip:{start:"اضغط لبدء رسم منطقة",cont:"اضغط لاستمرار رسم منطقة",end:"اضغط على اول نقطة لاكمال المنطقة"}},polyline:{error:"<strong>خطأ:</strong> لا يمكن تقاطع الخطوط",tooltip:{start:"اضغط لبدئ رسم الخط",cont:"اضغط لاستكمال رسم الخط",end:"اضغط على اخر نقطة للانهاء"}},rectangle:{tooltip:{start:"اضغط واسحب لرسم مستطيل"}},simpleshape:{tooltip:{end:"اترك الماوس للانهاء"}}}},edit:{toolbar:{actions:{save:{title:"حفظ التغييرات",text:"حفظ"},cancel:{title:"الغاء كل التعديلات",text:"الغاء"},clearAll:{title:"مسح كل الطبقات",text:"مسح الكل"}},buttons:{edit:"تعديل الطبقات",editDisabled:"لاتوجد طبقات للتعديل",remove:"مسح الطبقات",removeDisabled:"لا يوجد طبقات للمسح"}},handlers:{edit:{tooltip:{text:"اسحب للتعديل",subtext:"اضغط الغاء لمسح التعديلات"}},remove:{tooltip:{text:"اضغط على رسمة للمسح"}}}}},hp={draw:{toolbar:{actions:{title:"取消绘制",text:"取消"},finish:{title:"结束绘制",text:"结束"},undo:{title:"删除最后一个绘制点",text:"删除最后一个点"},buttons:{polyline:"绘制折线",polygon:"绘制多边形",rectangle:"绘制矩形",circle:"绘制圆形",marker:"绘制标志物",circlemarker:"绘制圆形标志物"}},handlers:{circle:{tooltip:{start:"单击并拖拽绘制圆形"},radius:"半径"},circlemarker:{tooltip:{start:"单击地图放置圆形标志物"}},marker:{tooltip:{start:"单击地图放置标志物"}},polygon:{tooltip:{start:"单击地图绘制图形",cont:"继续单击绘制图形",end:"单击起始点结束绘制"}},polyline:{error:"<strong>错误:</strong> 图形边缘不能交叉!",tooltip:{start:"单击地图绘制折线",cont:"继续单击绘制下一段折线",end:"单击最后一个点结束绘制"}},rectangle:{tooltip:{start:"单击并拖拽绘制矩形"}},simpleshape:{tooltip:{end:"松开鼠标结束绘制"}}}},edit:{toolbar:{actions:{save:{title:"保存变更",text:"保存"},cancel:{title:"取消编辑,放弃所有变更",text:"取消"},clearAll:{title:"清除所有图形",text:"清除所有"}},buttons:{edit:"编辑图形",editDisabled:"无图形可编辑",remove:"删除图形",removeDisabled:"无图形可删除"}},handlers:{edit:{tooltip:{text:"拖拽线段或标志点以编辑图形",subtext:"点击<strong>取消</strong>按钮撤销变更"}},remove:{tooltip:{text:"单击图形以移除"}}}}},cp={draw:{toolbar:{actions:{title:"Çizimi iptal et",text:"İptal"},finish:{title:"Çizimi Bitir",text:"Bitir"},undo:{title:"Çizilen son noktayı sil",text:"Son noktayı sil"},buttons:{polyline:"Çoklu çizgi çiz",polygon:"Çokgen çiz",rectangle:"Dikdörtgen çiz",circle:"Yuvarlak çiz",marker:"İşaretçi çiz",circlemarker:"Yuvarlak işaretçi çiz"}},handlers:{circle:{tooltip:{start:"Yuvarlak çizmek için tıklayın ve sürükleyin."},radius:"Çap"},circlemarker:{tooltip:{start:"Yuvarlak işaretçi yerleştirmek için haritaya tıklayın."}},marker:{tooltip:{start:"İşaretçi yerleştirmek için haritaya tıklayın."}},polygon:{tooltip:{start:"Şekil çizmeye başlamak için tıklayın.",cont:"Şekil çizmeye devam etmek için tıklayın.",end:"Bu şekli tamamlamak için ilk noktayı tıklayın."}},polyline:{error:"<strong>Hata:</strong> şekil kenarları kesişemez!",tooltip:{start:"Hat çizmeye başlamak için tıklayın.",cont:"Hat çizmeye devam etmek için tıklayın.",end:"Bu hattı tamamlamak için ilk noktayı tıklayın."}},rectangle:{tooltip:{start:"Dikdörtgen çizmek için tıklayın ve sürükleyin."}},simpleshape:{tooltip:{end:"Çizimi bitirmek için fareyi bırakın."}}}},edit:{toolbar:{actions:{save:{title:"Değişiklikleri kaydet.",text:"Kaydet"},cancel:{title:"Düzenlemeyi iptal et, tüm değişiklikleri çıkar.",text:"İptal"},clearAll:{title:"Tüm katmanları temizle.",text:"Hepsini temizle"}},buttons:{edit:"Katmanları düzenle.",editDisabled:"Düzenlenecek katman bulunamadı.",remove:"Katmanları sil.",removeDisabled:"Silinecek katman bulunamadı."}},handlers:{edit:{tooltip:{text:"Çizimi düzenlemek için köşeleri veya işaretçiyi sürükleyin.",subtext:"Değişiklikleri geri almak için iptale tıklayın."}},remove:{tooltip:{text:"Çizimi silmek için tıklayın"}}}}},up={draw:{toolbar:{actions:{title:"Anulați desenul",text:"Anulare"},finish:{title:"Terminați desenul",text:"Termina"},undo:{title:"Șterge ultimul punct desenat",text:"Șterge ultimul punct"},buttons:{polyline:"Desenați o polilinie",polygon:"Desenați un poligon",rectangle:"Desenați un dreptunghi",circle:"Desenează un cerc",marker:"Desenați un marker",circlemarker:"Desenați un marcator de cerc"}},handlers:{circle:{tooltip:{start:"Dați clic și trageți pentru a desena cerc."},radius:"Rază"},circlemarker:{tooltip:{start:"Dați clic pe hartă pentru a plasa marcatorul cercului."}},marker:{tooltip:{start:"Dați clic pe hartă pentru a plasa marcatorul."}},polygon:{tooltip:{start:"Dați clic pentru a începe desenarea parcelei",cont:"Dați clic pentru a continua desenarea parcelei",end:"Dați clic pe primul punct pentru a închide această parcelei."}},polyline:{error:"<strong>Eroare:</strong> marginile formei nu se pot traversa!",tooltip:{start:"Daţi clic pentru a începe să desenezi o linie.",cont:"Daţi clic pentru a continua să desenezi linia.",end:"Dați clic pe ultimul punct pentru a ajunge la linia de sosire."}},rectangle:{tooltip:{start:"Dați clic și trageți pentru a desena dreptunghi."}},simpleshape:{tooltip:{end:"Eliberați mouse-ul pentru a termina desenul."}}}},edit:{toolbar:{actions:{save:{title:"Salvează modificările.",text:"Salvați"},cancel:{title:"Anulează editarea, anulează toate modificările.",text:"Anulare"},clearAll:{title:"Ștergeți toate straturile.",text:"Curata tot"}},buttons:{edit:"Editați straturi.",editDisabled:"Fără straturi de editat.",remove:"Ștergeți straturile.",removeDisabled:"Nu există straturi de șters."}},handlers:{edit:{tooltip:{text:"Trageți mânerele sau marcatorul pentru a edita caracteristica.",subtext:"Dați clic pe Anulare pentru a anula modificările."}},remove:{tooltip:{text:"Dați clic pe o caracteristică pentru a o elimina"}}}}},dp=function(r){var t=Uh;switch(r.toLocaleLowerCase()){case"de":case"de-at":case"de-be":case"de-ch":case"de-de":case"de-li":case"de-lu":case"de-de.utf-8":case"german":t=Yg;break;case"en":case"en-us":case"en-ca":case"en-gb":case"en-us.utf-8":case"english":t=Uh;break;case"ar":case"ar-ae":case"ar-eg":case"arabic":t=lp;break;case"fi":case"fi-fi":case"fi-fi.utf-8":case"finnish":t=qg;break;case"fr":case"fr-us":case"fr-ca":case"fr-us.utf-8":case"french":t=Jg;break;case"es":case"es-us":case"es-ca":case"es-us.utf-8":case"spanish":t=Kg;break;case"sk":case"sk-sk":case"sk-sk.utf-8":case"slovak":t=op;break;case"pl":case"pl-pl":case"pl-pl.utf-8":case"polish":t=np;break;case"pt":case"pt-pt":case"pt-pt.utf-8":case"portuguese":t=rp;break;case"uk":case"uk-ua":case"uk-ua.utf-8":case"ukrainian":t=ap;break;case"cs":case"cs-cz":case"cs-cz.utf-8":case"czech":t=Xg;break;case"ru":case"ru-ru":case"ru-ru.utf-8":case"russian":t=sp;break;case"ka":case"ka-ka":case"ka-ka.utf-8":case"georgian":t=tp;break;case"no":case"no-no":case"no-no.utf-8":case"norwegian":t=ip;break;case"am":case"am-et":case"am-et.utf-8":case"amharic":t=Vg;break;case"nl":case"nl-nl":case"nl-nl.utf-8":case"nl-be":case"nl-be.utf-8":case"dutch":case"belgian":case"flemish":t=ep;break;case"it":case"it-it":case"it-ch":case"it-it.utf-8":case"it-ch.utf-8":case"italiano":case"italian":t=$g;break;case"hu":case"hu-HU":case"hu-hu":case"hu-HU.utf-8":case"hu-hu.utf-8":case"magyar":case"hungarian":t=Qg;break;case"zh":case"zh-cn":case"zh-cn.utf-8":case"chinese":t=hp;break;case"tr":case"tr-tr":case"tr-tr.utf-8":case"turkish":t=cp;break;case"ro":case"ro-ro":case"ro-RO":case"ro-ro.utf-8":case"romanian":t=up;break;default:throw new Error("[language] not found")}try{L&&L.drawLocal&&(L.drawLocal=t)}catch{}return t};function jh(r,t){return function(){return r.apply(t,arguments)}}const{toString:fp}=Object.prototype,{getPrototypeOf:aa}=Object,fs=(r=>t=>{const e=fp.call(t);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),De=r=>(r=r.toLowerCase(),t=>fs(t)===r),gs=r=>t=>typeof t===r,{isArray:vn}=Array,ur=gs("undefined");function gp(r){return r!==null&&!ur(r)&&r.constructor!==null&&!ur(r.constructor)&&ye(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const Zh=De("ArrayBuffer");function pp(r){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(r):t=r&&r.buffer&&Zh(r.buffer),t}const _p=gs("string"),ye=gs("function"),Wh=gs("number"),ps=r=>r!==null&&typeof r=="object",mp=r=>r===!0||r===!1,_s=r=>{if(fs(r)!=="object")return!1;const t=aa(r);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},yp=De("Date"),vp=De("File"),xp=De("Blob"),wp=De("FileList"),Ep=r=>ps(r)&&ye(r.pipe),Lp=r=>{let t;return r&&(typeof FormData=="function"&&r instanceof FormData||ye(r.append)&&((t=fs(r))==="formdata"||t==="object"&&ye(r.toString)&&r.toString()==="[object FormData]"))},bp=De("URLSearchParams"),Tp=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function dr(r,t,{allOwnKeys:e=!1}={}){if(r===null||typeof r>"u")return;let i,n;if(typeof r!="object"&&(r=[r]),vn(r))for(i=0,n=r.length;i<n;i++)t.call(null,r[i],i,r);else{const o=e?Object.getOwnPropertyNames(r):Object.keys(r),a=o.length;let h;for(i=0;i<a;i++)h=o[i],t.call(null,r[h],h,r)}}function Hh(r,t){t=t.toLowerCase();const e=Object.keys(r);let i=e.length,n;for(;i-- >0;)if(n=e[i],t===n.toLowerCase())return n;return null}const Vh=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Xh=r=>!ur(r)&&r!==Vh;function la(){const{caseless:r}=Xh(this)&&this||{},t={},e=(i,n)=>{const o=r&&Hh(t,n)||n;_s(t[o])&&_s(i)?t[o]=la(t[o],i):_s(i)?t[o]=la({},i):vn(i)?t[o]=i.slice():t[o]=i};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&dr(arguments[i],e);return t}const Cp=(r,t,e,{allOwnKeys:i}={})=>(dr(t,(n,o)=>{e&&ye(n)?r[o]=jh(n,e):r[o]=n},{allOwnKeys:i}),r),Mp=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Sp=(r,t,e,i)=>{r.prototype=Object.create(t.prototype,i),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:t.prototype}),e&&Object.assign(r.prototype,e)},Pp=(r,t,e,i)=>{let n,o,a;const h={};if(t=t||{},r==null)return t;do{for(n=Object.getOwnPropertyNames(r),o=n.length;o-- >0;)a=n[o],(!i||i(a,r,t))&&!h[a]&&(t[a]=r[a],h[a]=!0);r=e!==!1&&aa(r)}while(r&&(!e||e(r,t))&&r!==Object.prototype);return t},kp=(r,t,e)=>{r=String(r),(e===void 0||e>r.length)&&(e=r.length),e-=t.length;const i=r.indexOf(t,e);return i!==-1&&i===e},Rp=r=>{if(!r)return null;if(vn(r))return r;let t=r.length;if(!Wh(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=r[t];return e},Ap=(r=>t=>r&&t instanceof r)(typeof Uint8Array<"u"&&aa(Uint8Array)),Ip=(r,t)=>{const i=(r&&r[Symbol.iterator]).call(r);let n;for(;(n=i.next())&&!n.done;){const o=n.value;t.call(r,o[0],o[1])}},Dp=(r,t)=>{let e;const i=[];for(;(e=r.exec(t))!==null;)i.push(e);return i},Op=De("HTMLFormElement"),Fp=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,i,n){return i.toUpperCase()+n}),Yh=(({hasOwnProperty:r})=>(t,e)=>r.call(t,e))(Object.prototype),zp=De("RegExp"),Kh=(r,t)=>{const e=Object.getOwnPropertyDescriptors(r),i={};dr(e,(n,o)=>{let a;(a=t(n,o,r))!==!1&&(i[o]=a||n)}),Object.defineProperties(r,i)},Np=r=>{Kh(r,(t,e)=>{if(ye(r)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const i=r[e];if(ye(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},Bp=(r,t)=>{const e={},i=n=>{n.forEach(o=>{e[o]=!0})};return vn(r)?i(r):i(String(r).split(t)),e},Gp=()=>{},Up=(r,t)=>(r=+r,Number.isFinite(r)?r:t),ha="abcdefghijklmnopqrstuvwxyz",qh="0123456789",Jh={DIGIT:qh,ALPHA:ha,ALPHA_DIGIT:ha+ha.toUpperCase()+qh},jp=(r=16,t=Jh.ALPHA_DIGIT)=>{let e="";const{length:i}=t;for(;r--;)e+=t[Math.random()*i|0];return e};function Zp(r){return!!(r&&ye(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}const Wp=r=>{const t=new Array(10),e=(i,n)=>{if(ps(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[n]=i;const o=vn(i)?[]:{};return dr(i,(a,h)=>{const c=e(a,n+1);!ur(c)&&(o[h]=c)}),t[n]=void 0,o}}return i};return e(r,0)},Hp=De("AsyncFunction"),D={isArray:vn,isArrayBuffer:Zh,isBuffer:gp,isFormData:Lp,isArrayBufferView:pp,isString:_p,isNumber:Wh,isBoolean:mp,isObject:ps,isPlainObject:_s,isUndefined:ur,isDate:yp,isFile:vp,isBlob:xp,isRegExp:zp,isFunction:ye,isStream:Ep,isURLSearchParams:bp,isTypedArray:Ap,isFileList:wp,forEach:dr,merge:la,extend:Cp,trim:Tp,stripBOM:Mp,inherits:Sp,toFlatObject:Pp,kindOf:fs,kindOfTest:De,endsWith:kp,toArray:Rp,forEachEntry:Ip,matchAll:Dp,isHTMLForm:Op,hasOwnProperty:Yh,hasOwnProp:Yh,reduceDescriptors:Kh,freezeMethods:Np,toObjectSet:Bp,toCamelCase:Fp,noop:Gp,toFiniteNumber:Up,findKey:Hh,global:Vh,isContextDefined:Xh,ALPHABET:Jh,generateString:jp,isSpecCompliantForm:Zp,toJSONObject:Wp,isAsyncFn:Hp,isThenable:r=>r&&(ps(r)||ye(r))&&ye(r.then)&&ye(r.catch)};function _t(r,t,e,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),i&&(this.request=i),n&&(this.response=n)}D.inherits(_t,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:D.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Qh=_t.prototype,$h={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{$h[r]={value:r}}),Object.defineProperties(_t,$h),Object.defineProperty(Qh,"isAxiosError",{value:!0}),_t.from=(r,t,e,i,n,o)=>{const a=Object.create(Qh);return D.toFlatObject(r,a,function(c){return c!==Error.prototype},h=>h!=="isAxiosError"),_t.call(a,r.message,t,e,i,n),a.cause=r,a.name=r.name,o&&Object.assign(a,o),a};const Vp=null;function ca(r){return D.isPlainObject(r)||D.isArray(r)}function tc(r){return D.endsWith(r,"[]")?r.slice(0,-2):r}function ec(r,t,e){return r?r.concat(t).map(function(n,o){return n=tc(n),!e&&o?"["+n+"]":n}).join(e?".":""):t}function Xp(r){return D.isArray(r)&&!r.some(ca)}const Yp=D.toFlatObject(D,{},null,function(t){return/^is[A-Z]/.test(t)});function ms(r,t,e){if(!D.isObject(r))throw new TypeError("target must be an object");t=t||new FormData,e=D.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,C){return!D.isUndefined(C[E])});const i=e.metaTokens,n=e.visitor||f,o=e.dots,a=e.indexes,c=(e.Blob||typeof Blob<"u"&&Blob)&&D.isSpecCompliantForm(t);if(!D.isFunction(n))throw new TypeError("visitor must be a function");function d(v){if(v===null)return"";if(D.isDate(v))return v.toISOString();if(!c&&D.isBlob(v))throw new _t("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(v)||D.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function f(v,E,C){let S=v;if(v&&!C&&typeof v=="object"){if(D.endsWith(E,"{}"))E=i?E:E.slice(0,-2),v=JSON.stringify(v);else if(D.isArray(v)&&Xp(v)||(D.isFileList(v)||D.endsWith(E,"[]"))&&(S=D.toArray(v)))return E=tc(E),S.forEach(function(b,T){!(D.isUndefined(b)||b===null)&&t.append(a===!0?ec([E],T,o):a===null?E:E+"[]",d(b))}),!1}return ca(v)?!0:(t.append(ec(C,E,o),d(v)),!1)}const p=[],m=Object.assign(Yp,{defaultVisitor:f,convertValue:d,isVisitable:ca});function y(v,E){if(!D.isUndefined(v)){if(p.indexOf(v)!==-1)throw Error("Circular reference detected in "+E.join("."));p.push(v),D.forEach(v,function(S,w){(!(D.isUndefined(S)||S===null)&&n.call(t,S,D.isString(w)?w.trim():w,E,m))===!0&&y(S,E?E.concat(w):[w])}),p.pop()}}if(!D.isObject(r))throw new TypeError("data must be an object");return y(r),t}function ic(r){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function ua(r,t){this._pairs=[],r&&ms(r,this,t)}const nc=ua.prototype;nc.append=function(t,e){this._pairs.push([t,e])},nc.toString=function(t){const e=t?function(i){return t.call(this,i,ic)}:ic;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function Kp(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function rc(r,t,e){if(!t)return r;const i=e&&e.encode||Kp,n=e&&e.serialize;let o;if(n?o=n(t,e):o=D.isURLSearchParams(t)?t.toString():new ua(t,e).toString(i),o){const a=r.indexOf("#");a!==-1&&(r=r.slice(0,a)),r+=(r.indexOf("?")===-1?"?":"&")+o}return r}class qp{constructor(){this.handlers=[]}use(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){D.forEach(this.handlers,function(i){i!==null&&t(i)})}}const sc=qp,oc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Jp=typeof URLSearchParams<"u"?URLSearchParams:ua,Qp=typeof FormData<"u"?FormData:null,$p=typeof Blob<"u"?Blob:null,t_=(()=>{let r;return typeof navigator<"u"&&((r=navigator.product)==="ReactNative"||r==="NativeScript"||r==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),e_=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Oe={isBrowser:!0,classes:{URLSearchParams:Jp,FormData:Qp,Blob:$p},isStandardBrowserEnv:t_,isStandardBrowserWebWorkerEnv:e_,protocols:["http","https","file","blob","url","data"]};function i_(r,t){return ms(r,new Oe.classes.URLSearchParams,Object.assign({visitor:function(e,i,n,o){return Oe.isNode&&D.isBuffer(e)?(this.append(i,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function n_(r){return D.matchAll(/\w+|\[(\w*)]/g,r).map(t=>t[0]==="[]"?"":t[1]||t[0])}function r_(r){const t={},e=Object.keys(r);let i;const n=e.length;let o;for(i=0;i<n;i++)o=e[i],t[o]=r[o];return t}function ac(r){function t(e,i,n,o){let a=e[o++];const h=Number.isFinite(+a),c=o>=e.length;return a=!a&&D.isArray(n)?n.length:a,c?(D.hasOwnProp(n,a)?n[a]=[n[a],i]:n[a]=i,!h):((!n[a]||!D.isObject(n[a]))&&(n[a]=[]),t(e,i,n[a],o)&&D.isArray(n[a])&&(n[a]=r_(n[a])),!h)}if(D.isFormData(r)&&D.isFunction(r.entries)){const e={};return D.forEachEntry(r,(i,n)=>{t(n_(i),n,e,0)}),e}return null}function s_(r,t,e){if(D.isString(r))try{return(t||JSON.parse)(r),D.trim(r)}catch(i){if(i.name!=="SyntaxError")throw i}return(e||JSON.stringify)(r)}const da={transitional:oc,adapter:["xhr","http"],transformRequest:[function(t,e){const i=e.getContentType()||"",n=i.indexOf("application/json")>-1,o=D.isObject(t);if(o&&D.isHTMLForm(t)&&(t=new FormData(t)),D.isFormData(t))return n&&n?JSON.stringify(ac(t)):t;if(D.isArrayBuffer(t)||D.isBuffer(t)||D.isStream(t)||D.isFile(t)||D.isBlob(t))return t;if(D.isArrayBufferView(t))return t.buffer;if(D.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let h;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return i_(t,this.formSerializer).toString();if((h=D.isFileList(t))||i.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return ms(h?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),s_(t)):t}],transformResponse:[function(t){const e=this.transitional||da.transitional,i=e&&e.forcedJSONParsing,n=this.responseType==="json";if(t&&D.isString(t)&&(i&&!this.responseType||n)){const a=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(h){if(a)throw h.name==="SyntaxError"?_t.from(h,_t.ERR_BAD_RESPONSE,this,null,this.response):h}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Oe.classes.FormData,Blob:Oe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};D.forEach(["delete","get","head","post","put","patch"],r=>{da.headers[r]={}});const fa=da,o_=D.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),a_=r=>{const t={};let e,i,n;return r&&r.split(`
|
|
14
|
-
`).forEach(function(a){n=a.indexOf(":"),e=a.substring(0,n).trim().toLowerCase(),i=a.substring(n+1).trim(),!(!e||t[e]&&
|
|
15
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const i=new this(t);return e.forEach(n=>i.set(n)),i}static accessor(t){const i=(this[lc]=this[lc]={accessors:{}}).accessors,n=this.prototype;function o(a){const h=fr(a);i[h]||(u_(n,a),i[h]=!0)}return D.isArray(t)?t.forEach(o):o(t),this}}vs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),D.reduceDescriptors(vs.prototype,({value:r},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>r,set(i){this[e]=i}}}),D.freezeMethods(vs);const Qe=vs;function pa(r,t){const e=this||fa,i=t||e,n=Qe.from(i.headers);let o=i.data;return D.forEach(r,function(h){o=h.call(e,o,n.normalize(),t?t.status:void 0)}),n.normalize(),o}function hc(r){return!!(r&&r.__CANCEL__)}function gr(r,t,e){_t.call(this,r??"canceled",_t.ERR_CANCELED,t,e),this.name="CanceledError"}D.inherits(gr,_t,{__CANCEL__:!0});function d_(r,t,e){const i=e.config.validateStatus;!e.status||!i||i(e.status)?r(e):t(new _t("Request failed with status code "+e.status,[_t.ERR_BAD_REQUEST,_t.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}const f_=Oe.isStandardBrowserEnv?function(){return{write:function(e,i,n,o,a,h){const c=[];c.push(e+"="+encodeURIComponent(i)),D.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),D.isString(o)&&c.push("path="+o),D.isString(a)&&c.push("domain="+a),h===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(e){const i=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function g_(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function p_(r,t){return t?r.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):r}function cc(r,t){return r&&!g_(t)?p_(r,t):t}const __=Oe.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let i;function n(o){let a=o;return t&&(e.setAttribute("href",a),a=e.href),e.setAttribute("href",a),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return i=n(window.location.href),function(a){const h=D.isString(a)?n(a):a;return h.protocol===i.protocol&&h.host===i.host}}():function(){return function(){return!0}}();function m_(r){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return t&&t[1]||""}function y_(r,t){r=r||10;const e=new Array(r),i=new Array(r);let n=0,o=0,a;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),f=i[o];a||(a=d),e[n]=c,i[n]=d;let p=o,m=0;for(;p!==n;)m+=e[p++],p=p%r;if(n=(n+1)%r,n===o&&(o=(o+1)%r),d-a<t)return;const y=f&&d-f;return y?Math.round(m*1e3/y):void 0}}function uc(r,t){let e=0;const i=y_(50,250);return n=>{const o=n.loaded,a=n.lengthComputable?n.total:void 0,h=o-e,c=i(h),d=o<=a;e=o;const f={loaded:o,total:a,progress:a?o/a:void 0,bytes:h,rate:c||void 0,estimated:c&&a&&d?(a-o)/c:void 0,event:n};f[t?"download":"upload"]=!0,r(f)}}const _a={http:Vp,xhr:typeof XMLHttpRequest<"u"&&function(r){return new Promise(function(e,i){let n=r.data;const o=Qe.from(r.headers).normalize(),a=r.responseType;let h;function c(){r.cancelToken&&r.cancelToken.unsubscribe(h),r.signal&&r.signal.removeEventListener("abort",h)}let d;D.isFormData(n)&&(Oe.isStandardBrowserEnv||Oe.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.getContentType(/^\s*multipart\/form-data/)?D.isString(d=o.getContentType())&&o.setContentType(d.replace(/^\s*(multipart\/form-data);+/,"$1")):o.setContentType("multipart/form-data"));let f=new XMLHttpRequest;if(r.auth){const v=r.auth.username||"",E=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";o.set("Authorization","Basic "+btoa(v+":"+E))}const p=cc(r.baseURL,r.url);f.open(r.method.toUpperCase(),rc(p,r.params,r.paramsSerializer),!0),f.timeout=r.timeout;function m(){if(!f)return;const v=Qe.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),C={data:!a||a==="text"||a==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:v,config:r,request:f};d_(function(w){e(w),c()},function(w){i(w),c()},C),f=null}if("onloadend"in f?f.onloadend=m:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(m)},f.onabort=function(){f&&(i(new _t("Request aborted",_t.ECONNABORTED,r,f)),f=null)},f.onerror=function(){i(new _t("Network Error",_t.ERR_NETWORK,r,f)),f=null},f.ontimeout=function(){let E=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const C=r.transitional||oc;r.timeoutErrorMessage&&(E=r.timeoutErrorMessage),i(new _t(E,C.clarifyTimeoutError?_t.ETIMEDOUT:_t.ECONNABORTED,r,f)),f=null},Oe.isStandardBrowserEnv){const v=(r.withCredentials||__(p))&&r.xsrfCookieName&&f_.read(r.xsrfCookieName);v&&o.set(r.xsrfHeaderName,v)}n===void 0&&o.setContentType(null),"setRequestHeader"in f&&D.forEach(o.toJSON(),function(E,C){f.setRequestHeader(C,E)}),D.isUndefined(r.withCredentials)||(f.withCredentials=!!r.withCredentials),a&&a!=="json"&&(f.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&f.addEventListener("progress",uc(r.onDownloadProgress,!0)),typeof r.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",uc(r.onUploadProgress)),(r.cancelToken||r.signal)&&(h=v=>{f&&(i(!v||v.type?new gr(null,r,f):v),f.abort(),f=null)},r.cancelToken&&r.cancelToken.subscribe(h),r.signal&&(r.signal.aborted?h():r.signal.addEventListener("abort",h)));const y=m_(p);if(y&&Oe.protocols.indexOf(y)===-1){i(new _t("Unsupported protocol "+y+":",_t.ERR_BAD_REQUEST,r));return}f.send(n||null)})}};D.forEach(_a,(r,t)=>{if(r){try{Object.defineProperty(r,"name",{value:t})}catch{}Object.defineProperty(r,"adapterName",{value:t})}});const dc=r=>`- ${r}`,v_=r=>D.isFunction(r)||r===null||r===!1,fc={getAdapter:r=>{r=D.isArray(r)?r:[r];const{length:t}=r;let e,i;const n={};for(let o=0;o<t;o++){e=r[o];let a;if(i=e,!v_(e)&&(i=_a[(a=String(e)).toLowerCase()],i===void 0))throw new _t(`Unknown adapter '${a}'`);if(i)break;n[a||"#"+o]=i}if(!i){const o=Object.entries(n).map(([h,c])=>`adapter ${h} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since :
|
|
16
|
-
|
|
17
|
-
`):" "+dc(o[0]):"as no adapter specified";throw new _t("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return i},adapters:_a};function ma(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new gr(null,r)}function gc(r){return ma(r),r.headers=Qe.from(r.headers),r.data=pa.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),fc.getAdapter(r.adapter||fa.adapter)(r).then(function(i){return ma(r),i.data=pa.call(r,r.transformResponse,i),i.headers=Qe.from(i.headers),i},function(i){return hc(i)||(ma(r),i&&i.response&&(i.response.data=pa.call(r,r.transformResponse,i.response),i.response.headers=Qe.from(i.response.headers))),Promise.reject(i)})}const pc=r=>r instanceof Qe?r.toJSON():r;function xn(r,t){t=t||{};const e={};function i(d,f,p){return D.isPlainObject(d)&&D.isPlainObject(f)?D.merge.call({caseless:p},d,f):D.isPlainObject(f)?D.merge({},f):D.isArray(f)?f.slice():f}function n(d,f,p){if(D.isUndefined(f)){if(!D.isUndefined(d))return i(void 0,d,p)}else return i(d,f,p)}function o(d,f){if(!D.isUndefined(f))return i(void 0,f)}function a(d,f){if(D.isUndefined(f)){if(!D.isUndefined(d))return i(void 0,d)}else return i(void 0,f)}function h(d,f,p){if(p in t)return i(d,f);if(p in r)return i(void 0,d)}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:h,headers:(d,f)=>n(pc(d),pc(f),!0)};return D.forEach(Object.keys(Object.assign({},r,t)),function(f){const p=c[f]||n,m=p(r[f],t[f],f);D.isUndefined(m)&&p!==h||(e[f]=m)}),e}const _c="1.5.1",ya={};["object","boolean","number","function","string","symbol"].forEach((r,t)=>{ya[r]=function(i){return typeof i===r||"a"+(t<1?"n ":" ")+r}});const mc={};ya.transitional=function(t,e,i){function n(o,a){return"[Axios v"+_c+"] Transitional option '"+o+"'"+a+(i?". "+i:"")}return(o,a,h)=>{if(t===!1)throw new _t(n(a," has been removed"+(e?" in "+e:"")),_t.ERR_DEPRECATED);return e&&!mc[a]&&(mc[a]=!0,console.warn(n(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(o,a,h):!0}};function x_(r,t,e){if(typeof r!="object")throw new _t("options must be an object",_t.ERR_BAD_OPTION_VALUE);const i=Object.keys(r);let n=i.length;for(;n-- >0;){const o=i[n],a=t[o];if(a){const h=r[o],c=h===void 0||a(h,o,r);if(c!==!0)throw new _t("option "+o+" must be "+c,_t.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new _t("Unknown option "+o,_t.ERR_BAD_OPTION)}}const va={assertOptions:x_,validators:ya},vi=va.validators;class xs{constructor(t){this.defaults=t,this.interceptors={request:new sc,response:new sc}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=xn(this.defaults,e);const{transitional:i,paramsSerializer:n,headers:o}=e;i!==void 0&&va.assertOptions(i,{silentJSONParsing:vi.transitional(vi.boolean),forcedJSONParsing:vi.transitional(vi.boolean),clarifyTimeoutError:vi.transitional(vi.boolean)},!1),n!=null&&(D.isFunction(n)?e.paramsSerializer={serialize:n}:va.assertOptions(n,{encode:vi.function,serialize:vi.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=o&&D.merge(o.common,o[e.method]);o&&D.forEach(["delete","get","head","post","put","patch","common"],v=>{delete o[v]}),e.headers=Qe.concat(a,o);const h=[];let c=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(e)===!1||(c=c&&E.synchronous,h.unshift(E.fulfilled,E.rejected))});const d=[];this.interceptors.response.forEach(function(E){d.push(E.fulfilled,E.rejected)});let f,p=0,m;if(!c){const v=[gc.bind(this),void 0];for(v.unshift.apply(v,h),v.push.apply(v,d),m=v.length,f=Promise.resolve(e);p<m;)f=f.then(v[p++],v[p++]);return f}m=h.length;let y=e;for(p=0;p<m;){const v=h[p++],E=h[p++];try{y=v(y)}catch(C){E.call(this,C);break}}try{f=gc.call(this,y)}catch(v){return Promise.reject(v)}for(p=0,m=d.length;p<m;)f=f.then(d[p++],d[p++]);return f}getUri(t){t=xn(this.defaults,t);const e=cc(t.baseURL,t.url);return rc(e,t.params,t.paramsSerializer)}}D.forEach(["delete","get","head","options"],function(t){xs.prototype[t]=function(e,i){return this.request(xn(i||{},{method:t,url:e,data:(i||{}).data}))}}),D.forEach(["post","put","patch"],function(t){function e(i){return function(o,a,h){return this.request(xn(h||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}xs.prototype[t]=e(),xs.prototype[t+"Form"]=e(!0)});const ws=xs;class xa{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(o){e=o});const i=this;this.promise.then(n=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](n);i._listeners=null}),this.promise.then=n=>{let o;const a=new Promise(h=>{i.subscribe(h),o=h}).then(n);return a.cancel=function(){i.unsubscribe(o)},a},t(function(o,a,h){i.reason||(i.reason=new gr(o,a,h),e(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}static source(){let t;return{token:new xa(function(n){t=n}),cancel:t}}}const w_=xa;function E_(r){return function(e){return r.apply(null,e)}}function L_(r){return D.isObject(r)&&r.isAxiosError===!0}const wa={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(wa).forEach(([r,t])=>{wa[t]=r});const b_=wa;function yc(r){const t=new ws(r),e=jh(ws.prototype.request,t);return D.extend(e,ws.prototype,t,{allOwnKeys:!0}),D.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return yc(xn(r,n))},e}const Dt=yc(fa);Dt.Axios=ws,Dt.CanceledError=gr,Dt.CancelToken=w_,Dt.isCancel=hc,Dt.VERSION=_c,Dt.toFormData=ms,Dt.AxiosError=_t,Dt.Cancel=Dt.CanceledError,Dt.all=function(t){return Promise.all(t)},Dt.spread=E_,Dt.isAxiosError=L_,Dt.mergeConfig=xn,Dt.AxiosHeaders=Qe,Dt.formToJSON=r=>ac(D.isHTMLForm(r)?new FormData(r):r),Dt.getAdapter=fc.getAdapter,Dt.HttpStatusCode=b_,Dt.default=Dt;const vc=Dt,Es="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBVcGxvYWRlZCB0bzogU1ZHIFJlcG8sIHd3dy5zdmdyZXBvLmNvbSwgR2VuZXJhdG9yOiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4NCjxzdmcgZmlsbD0iIzAwMDAwMCIgaGVpZ2h0PSI4MDBweCIgd2lkdGg9IjgwMHB4IiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiANCgkgdmlld0JveD0iMCAwIDUwMS4zMzcgNTAxLjMzNyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8Zz4NCgkJPHBhdGggZD0iTTQ5Ni45NjIsMi4wMzFjLTIuNzczLTIuMDI3LTYuNC0yLjU2LTkuNi0xLjQ5M0wzMzAuNjY5LDUyLjgwNEwxNzMuOTc1LDAuNTM3Yy0xLjA2Ny0wLjMyLTIuMTMzLTAuNTMzLTMuMi0wLjUzM2gtMC4xMDcNCgkJCWgtMC4xMDdjLTEuMDY3LDAtMi4xMzMsMC4yMTMtMy4yLDAuNTMzbC0xNjAsNTMuMzMzYy00LjM3MywxLjM4Ny03LjM2LDUuNTQ3LTcuMzYsMTAuMTMzdjQyNi4yNGMwLDMuMzA3LDEuMzg3LDYuNjEzLDMuOTQ3LDguNjQNCgkJCWMyLjk4NywyLjQ1Myw2LjgyNywyLjk4NywxMC4xMzMsMS45MmwxNTYuNjkzLTUyLjI2N2wxNTYuNjkzLDUyLjI2N2MxLjA2NywwLjMyLDIuMTMzLDAuNTMzLDMuMiwwLjUzM2gwLjEwN2gwLjEwNw0KCQkJYzEuMDY3LDAsMi4xMzMtMC4yMTMsMy4yLTAuNTMzbDE2MC01My4zMzNjNC4zNzMtMS40OTMsNy4yNTMtNS41NDcsNy4yNTMtMTAuMTMzVjEwLjY3MQ0KCQkJQzUwMS4zMzUsNy4yNTcsNDk5LjczNSw0LjA1Nyw0OTYuOTYyLDIuMDMxeiBNNzQuNjY5LDQ1OC4xMzdsLTUzLjMzMywxNy44MTNWMjg1LjAxN2w1My4zMzMtMTcuODEzVjQ1OC4xMzd6IE0xNjAuMDAyLDQyOS42NTcNCgkJCWwtNjQsMjEuMzMzVjI2MC4xNjRsNjQtMjEuMzMzVjQyOS42NTd6IE0xNjAuMDAyLDIxNi4zMjRsLTY0LDIxLjMzM3YtODUuMjI3bDY0LTE4LjQ1M1YyMTYuMzI0eiBNMTYwLjAwMiwxMTEuODk3bC03Ny42NTMsMjIuNA0KCQkJYy00LjU4NywxLjI4LTcuNjgsNS41NDctNy42OCwxMC4yNHYxMDAuMjY3bC01My4zMzMsMTcuODEzVjcxLjY4NGwxMzguNjY3LTQ2LjE4N1YxMTEuODk3eiBNMzIwLjAwMiw0NzUuOTUxbC01My4zMzMtMTcuNzA3DQoJCQlWMzQxLjAxN2w1My4zMzMsMjEuNzZWNDc1Ljk1MXogTTMyMC4wMDIsMzM5LjczN2wtNTkuOTQ3LTI0LjQyN2MtNS40NC0yLjI0LTExLjczMywwLjQyNy0xMy44NjcsNS44NjcNCgkJCWMtMC41MzMsMS4yOC0wLjc0NywyLjY2Ny0wLjc0Nyw0LjA1M3YxMjUuODY3bC02NC0yMS4zMzNWMjM4Ljg2NmwxMzguNTYsNDYuMTUxVjMzOS43Mzd6IE0zMjAuMDAyLDI2Mi41MTFsLTEzOC42NjctNDYuMTg3DQoJCQlWMjUuNDk3bDEzOC42NjcsNDYuMTg3VjI2Mi41MTF6IE0zNDEuMzM1LDE3OS4wOTdsNjQtMjEuNjUzdjgzLjczM2wtNjQsMjEuMzMzVjE3OS4wOTd6IE00ODAuMDAyLDQyOS42NTdsLTEzOC42NjcsNDYuMTg3DQoJCQlWMjg1LjAxN2wxMzguNjY3LTQ2LjE4N1Y0MjkuNjU3eiBNNDgwLjAwMiwyMTYuMzI0bC01My4zMzMsMTcuODEzdi04My44NGw1My4zMzMtMTguMDI3VjIxNi4zMjR6IE00ODAuMDAyLDEwOS43NjQNCgkJCWwtMTM4LjY2Nyw0Ni44MjdWNzEuNjg0bDEzOC42NjctNDYuMTg3VjEwOS43NjR6Ii8+DQoJPC9nPg0KPC9nPg0KPC9zdmc+",Ls="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBVcGxvYWRlZCB0bzogU1ZHIFJlcG8sIHd3dy5zdmdyZXBvLmNvbSwgR2VuZXJhdG9yOiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4NCjxzdmcgaGVpZ2h0PSI4MDBweCIgd2lkdGg9IjgwMHB4IiB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIA0KCSB2aWV3Qm94PSIwIDAgNTMgNTMiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHBvbHlnb24gc3R5bGU9ImZpbGw6IzQzQjA1QzsiIHBvaW50cz0iMTgsMjMuMjQzIDIuMjU2LDcuNDk5IDAsOCAwLDUxIDIuMDk5LDUwLjUzNCAxOCwzNC42MzIgIi8+DQo8cG9seWdvbiBzdHlsZT0iZmlsbDojNDhBMERDOyIgcG9pbnRzPSI5LjM3Miw0OC45MTcgMTgsNDcgMTgsNDAuMjg5ICIvPg0KPHBvbHlnb24gc3R5bGU9ImZpbGw6IzQzQjA1QzsiIHBvaW50cz0iMTgsNCA2Ljg4NCw2LjQ3IDE4LDE3LjU4NiAiLz4NCjxwb2x5Z29uIHN0eWxlPSJmaWxsOiM0M0IwNUM7IiBwb2ludHM9IjQ5LjQ0OSwzLjE4NCAzNSw4IDM1LDE3LjYzMiAiLz4NCjxwb2x5Z29uIHN0eWxlPSJmaWxsOiM0OEEwREM7IiBwb2ludHM9IjM1LDIzLjI4OSAzNSw1MCA1Myw0MyA1Myw1LjI4OSAiLz4NCjxwb2x5Z29uIHN0eWxlPSJmaWxsOiMzRDk5NEY7IiBwb2ludHM9IjI2LjUyMywyNi4xMDkgMzUsMTcuNjMyIDM1LDggMTgsNCAxOCwxNy41ODYgIi8+DQo8cG9seWdvbiBzdHlsZT0iZmlsbDojM0Q5OTRGOyIgcG9pbnRzPSIxOCwyMy4yNDMgMTgsMzQuNjMyIDIzLjY5NSwyOC45MzggIi8+DQo8cG9seWdvbiBzdHlsZT0iZmlsbDojNDM5M0JGOyIgcG9pbnRzPSIxOCw0MC4yODkgMTgsNDcgMzUsNTAgMzUsMjMuMjg5ICIvPg0KPHBvbHlnb24gc3R5bGU9ImZpbGw6I0VGQ0U0QTsiIHBvaW50cz0iMTgsMTcuNTg2IDYuODg0LDYuNDcgMi4yNTYsNy40OTkgMTgsMjMuMjQzICIvPg0KPHBvbHlnb24gc3R5bGU9ImZpbGw6I0VGQ0U0QTsiIHBvaW50cz0iMTgsMzQuNjMyIDIuMDk5LDUwLjUzNCA5LjM3Miw0OC45MTcgMTgsNDAuMjg5ICIvPg0KPHBvbHlnb24gc3R5bGU9ImZpbGw6I0VGQ0U0QTsiIHBvaW50cz0iMzUsMjMuMjg5IDUzLDUuMjg5IDUzLDIgNDkuNDQ5LDMuMTg0IDM1LDE3LjYzMiAiLz4NCjxwb2x5Z29uIHN0eWxlPSJmaWxsOiNENkI0NDU7IiBwb2ludHM9IjI2LjUyMywyNi4xMDkgMTgsMTcuNTg2IDE4LDIzLjI0MyAyMy42OTUsMjguOTM4IDE4LDM0LjYzMiAxOCw0MC4yODkgMzUsMjMuMjg5IDM1LDE3LjYzMiANCgkiLz4NCjwvc3ZnPg==";Q.Edit.Circle=Q.Edit.CircleMarker.extend({_createResizeMarker:function(){var r=this._shape.getLatLng(),t=this._getResizeMarkerPoint(r);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(t,this.options.resizeIcon))},_getResizeMarkerPoint:function(r){var t=this._shape._radius*Math.cos(Math.PI/4),e=this._map.project(r);return this._map.unproject([e.x+t,e.y-t])},_resize:function(r){var t=this._moveMarker.getLatLng(),e;Q.GeometryUtil.isVersion07x()?e=t.distanceTo(r):e=this._map.distance(t,r),this._shape.setRadius(e),this._map.fire(Q.Draw.Event.EDITRESIZE,{layer:this._shape})}});const T_=j.defineComponent({name:"MapView",props:{loadPolygon:Boolean,reverseCoordinatesPolygon:Boolean,dataPolygon:Object,configurationMap:Object,coordinatesMap:Array,getGeoJSON:Function,getCoodMarker:Function,isSatelite:Boolean},data(){return{idMap:"",mapRender:null,markerRender:null,renderCoordinates:this.coordinatesMap,renderGeojson:this.dataPolygon,markerIcon:{iconUrl:ss,iconSize:[25,41],iconAnchor:[12,41]},layersFeatureGroup:null,featuresData:null,currentTileLayer:null,isSatelliteView:!1}},mounted(){this.makeid(10),this.renderMap()},methods:{createSatelliteControl(){const r=Q.Control.extend({onAdd:t=>{const e=Q.DomUtil.create("div","leaflet-control-draw leaflet-bar leaflet-control"),i=Q.DomUtil.create("a","leaflet-draw-draw-satellite",e);return i.href="#",i.title=this.isSatelliteView?"Vista Normal":"Vista Satélite",i.style.backgroundImage=this.isSatelliteView?`url(${Es})`:`url(${Ls})`,i.style.backgroundPosition="center",i.style.backgroundRepeat="no-repeat",i.style.backgroundSize="20px 20px",Q.DomEvent.disableClickPropagation(i),Q.DomEvent.on(i,"click",this.toggleSatelliteView,this),e}});return new r({position:"topleft"})},toggleSatelliteView(){if(!this.mapRender||!this.currentTileLayer)return;this.isSatelliteView=!this.isSatelliteView,this.mapRender.removeLayer(this.currentTileLayer),this.isSatelliteView?this.currentTileLayer=Q.tileLayer("https://api.maptiler.com/maps/satellite/{z}/{x}/{y}.jpg?key=t8mWT2ozs1JWBqMZOnZr",{attribution:'© <a href="https://www.maptiler.com/">MapTiler</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}):this.currentTileLayer=Q.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),this.currentTileLayer.addTo(this.mapRender),document.querySelectorAll(".leaflet-draw-draw-satellite").forEach(t=>{const e=t;e.style.backgroundImage=this.isSatelliteView?`url(${Es})`:`url(${Ls})`,e.title=this.isSatelliteView?"Vista Normal":"Vista Satélite"})},getLayersFeaturesInGeoJson(){const r=Q.geoJSON().addTo(this.mapRender);return this.featuresData.eachLayer(e=>{r.addLayer(e)}),[r.toGeoJSON()]},triggerSaveEdit(){var t,e,i;(i=(e=(t=(document.getElementsByClassName("leaflet-draw-actions leaflet-draw-actions-top")||document.getElementsByClassName("leaflet-draw-actions leaflet-draw-actions-top leaflet-draw-actions-bottom"))[0])==null?void 0:t.querySelector("li"))==null?void 0:e.querySelector("a"))==null||i.click()},makeid(r){let t="";const e="abcdefghijklmnopqrstuvwxyz",i=e.length;let n=0;for(;n<r;)t+=e.charAt(Math.floor(Math.random()*i)),n+=1;this.idMap=t},renderMap(){dp("es"),setTimeout(()=>{this.loadPolygon?this.viewMap():this.createMap()},500)},createMap(){var a,h,c,d,f,p,m,y,v,E;const r=this.configurationMap?this.configurationMap.iconMarker?this.configurationMap.iconMarker:this.markerIcon:this.markerIcon;window.type=!0;const t=Q.map(this.idMap,{fullscreenControl:!0}).setView([this.renderCoordinates?this.renderCoordinates[0]:0,this.renderCoordinates?this.renderCoordinates[1]:0],this.renderCoordinates?this.renderCoordinates[2]:0);if(this.mapRender=t,this.isSatelliteView=this.isSatelite||!1,this.isSatelliteView?this.currentTileLayer=Q.tileLayer("https://api.maptiler.com/maps/satellite/{z}/{x}/{y}.jpg?key=t8mWT2ozs1JWBqMZOnZr",{attribution:'© <a href="https://www.maptiler.com/">MapTiler</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}):this.currentTileLayer=Q.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),this.currentTileLayer.addTo(t),this.isSatelite!==void 0){const C=this.createSatelliteControl();t.addControl(C)}if(t.setZoom((a=this.configurationMap)==null?void 0:a.maxZoom),this.configurationMap.renderMarker){const C=Q.marker([this.renderCoordinates?this.renderCoordinates[0]:0,this.renderCoordinates?this.renderCoordinates[1]:0],{icon:Q.icon(r),draggable:this.configurationMap.dragMarker}).addTo(t);this.markerRender=C,this.getCoodMarker&&C.on("dragend",S=>{const w=S.target.getLatLng(),b=w.lat,T=w.lng;this.getCoodMarker&&this.getCoodMarker(b,T)})}const e=Q.featureGroup();this.featuresData=e;const i=e.addTo(t);let n={featureGroup:i,edit:!1,remove:(h=this.configurationMap)==null?void 0:h.editFigures.remove};(c=this.configurationMap)!=null&&c.editFigures.edit&&(n={featureGroup:i,...(d=this.configurationMap)==null?void 0:d.editFigures.edit,remove:(f=this.configurationMap)==null?void 0:f.editFigures.remove});const o=new Q.Control.Draw({position:"topleft",draw:{polygon:(p=this.configurationMap)==null?void 0:p.createFigures.polygon,circle:!1,rectangle:(m=this.configurationMap)!=null&&m.createFigures.rectangle?{shapeOptions:{color:"blue"}}:!1,marker:(y=this.configurationMap)!=null&&y.createFigures.marker?{icon:Q.icon(r)}:!1,polyline:(v=this.configurationMap)!=null&&v.createFigures.polyline?{shapeOptions:{color:"blue"}}:!1,circlemarker:(E=this.configurationMap)==null?void 0:E.createFigures.multipoint},edit:n});t.addControl(o),t.on("draw:created",C=>{var b,T,P,R,I,O,U,X,q,Y,rt,pt,V,H,G;const S=C.layer;i.addLayer(S);let w=S.toGeoJSON();C.layerType==="circlemarker"&&(w={type:"Feature",geometry:{type:"MultiPoint",coordinates:[w.geometry.coordinates]},properties:{...w.properties,pointType:"multipoint",style:{color:((P=(T=(b=this.configurationMap)==null?void 0:b.createFigures)==null?void 0:T.multipoint)==null?void 0:P.color)||"green",fillColor:((O=(I=(R=this.configurationMap)==null?void 0:R.createFigures)==null?void 0:I.multipoint)==null?void 0:O.fillColor)||"green",fillOpacity:((q=(X=(U=this.configurationMap)==null?void 0:U.createFigures)==null?void 0:X.multipoint)==null?void 0:q.fillOpacity)||.8,radius:((pt=(rt=(Y=this.configurationMap)==null?void 0:Y.createFigures)==null?void 0:rt.multipoint)==null?void 0:pt.radius)||6,weight:((G=(H=(V=this.configurationMap)==null?void 0:V.createFigures)==null?void 0:H.multipoint)==null?void 0:G.weight)||2}}}),this.getGeoJSON&&this.getGeoJSON([w])}),t.on("draw:edited",C=>{C.layers.eachLayer(w=>{const b=w.toGeoJSON();this.getGeoJSON&&this.getGeoJSON([b])})})},viewMap(){var h,c,d,f,p,m,y,v,E,C;const r=this.configurationMap?this.configurationMap.iconMarker?this.configurationMap.iconMarker:this.markerIcon:this.markerIcon;window.type=!0;const t=Q.map(this.idMap,{fullscreenControl:!0}).setView([this.renderCoordinates?this.renderCoordinates[0]:0,this.renderCoordinates?this.renderCoordinates[1]:0],this.renderCoordinates?this.renderCoordinates[2]:0);if(this.mapRender=t,this.isSatelliteView=this.isSatelite||!1,this.isSatelliteView?this.currentTileLayer=Q.tileLayer("https://api.maptiler.com/maps/satellite/{z}/{x}/{y}.jpg?key=t8mWT2ozs1JWBqMZOnZr",{attribution:'© <a href="https://www.maptiler.com/">MapTiler</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}):this.currentTileLayer=Q.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),this.currentTileLayer.addTo(t),this.isSatelite!==void 0){const S=this.createSatelliteControl();t.addControl(S)}t.setZoom((h=this.configurationMap)==null?void 0:h.maxZoom);const e=Q.featureGroup();this.featuresData=e;const i=e.addTo(t);let n={featureGroup:i,edit:!1,remove:(c=this.configurationMap)==null?void 0:c.editFigures.remove};(d=this.configurationMap)!=null&&d.editFigures.edit&&(n={featureGroup:i,...(f=this.configurationMap)==null?void 0:f.editFigures.edit,remove:(p=this.configurationMap)==null?void 0:p.editFigures.remove});const o=this.renderGeojson;if(o&&o.length){o.forEach(w=>{if(w.type==="FeatureCollection")w.features.forEach(b=>{if(b.geometry.type==="Polygon"||b.geometry.type==="MultiPolygon"||b.geometry.type==="LineString"||b.geometry.type==="MultiLineString"||b.geometry.type==="Point"){const T=this;Q.geoJson(b,{pointToLayer:this.getPointToLayer.bind(this),onEachFeature:function(P,R){if(i.addLayer(R),P.geometry.type==="Point"){var I=T.getPopupContent(P);R.bindPopup(I)}else if(P.geometry.type==="Polygon"||P.geometry.type==="MultiPolygon"){var O=T.getPolygonTooltipContent(P);R.bindPopup(O)}}})}});else if(w.type==="Feature"&&(w.geometry.type==="Polygon"||w.geometry.type==="MultiPolygon"||w.geometry.type==="LineString"||w.geometry.type==="MultiLineString"||w.geometry.type==="Point"||w.geometry.type==="MultiPoint")){const b=this;Q.geoJson(w,{onEachFeature:function(T,P){if(i.addLayer(P),T.geometry.type==="Point"){var R=b.getPopupContent(T);P.bindPopup(R)}else if(T.geometry.type==="Polygon"||T.geometry.type==="MultiPolygon"){var I=b.getPolygonTooltipContent(T);P.bindPopup(I)}}})}});const S=i.getBounds();t.fitBounds(S)}const a=new Q.Control.Draw({position:"topleft",draw:{polygon:(m=this.configurationMap)==null?void 0:m.createFigures.polygon,circle:!1,rectangle:(y=this.configurationMap)!=null&&y.createFigures.rectangle?{shapeOptions:{color:"blue"}}:!1,marker:(v=this.configurationMap)!=null&&v.createFigures.marker?{icon:Q.icon(r)}:!1,polyline:(E=this.configurationMap)!=null&&E.createFigures.polyline?{shapeOptions:{color:"blue"}}:!1,circlemarker:(C=this.configurationMap)==null?void 0:C.createFigures.multipoint},edit:n});t.addControl(a),t.on("draw:created",S=>{var T,P,R,I,O,U,X,q,Y,rt,pt,V,H,G,N;const w=S.layer;i.addLayer(w);let b=w.toGeoJSON();S.layerType==="circlemarker"&&(b={type:"Feature",geometry:{type:"MultiPoint",coordinates:[b.geometry.coordinates]},properties:{...b.properties,pointType:"multipoint",style:{color:((R=(P=(T=this.configurationMap)==null?void 0:T.createFigures)==null?void 0:P.multipoint)==null?void 0:R.color)||"green",fillColor:((U=(O=(I=this.configurationMap)==null?void 0:I.createFigures)==null?void 0:O.multipoint)==null?void 0:U.fillColor)||"green",fillOpacity:((Y=(q=(X=this.configurationMap)==null?void 0:X.createFigures)==null?void 0:q.multipoint)==null?void 0:Y.fillOpacity)||.8,radius:((V=(pt=(rt=this.configurationMap)==null?void 0:rt.createFigures)==null?void 0:pt.multipoint)==null?void 0:V.radius)||6,weight:((N=(G=(H=this.configurationMap)==null?void 0:H.createFigures)==null?void 0:G.multipoint)==null?void 0:N.weight)||2}}}),this.getGeoJSON&&this.getGeoJSON(b)}),t.on("draw:edited",S=>{S.layers.eachLayer(b=>{const T=b.toGeoJSON();this.getGeoJSON&&this.getGeoJSON(T)})})},getPointToLayer(r,t){var i,n;if(((i=r.geometry)==null?void 0:i.type)==="Point"){const o=(n=r.properties)==null?void 0:n.tipo,a=Q.icon({iconUrl:Zg,iconSize:[38,38],iconAnchor:[16,41]}),h=Q.icon({iconUrl:Wg,iconSize:[38,38],iconAnchor:[16,41]});let d=Q.icon({iconUrl:Hg,iconSize:[38,38],iconAnchor:[16,41]});return o===0?d=a:o===1&&(d=h),Q.marker(t,{icon:d})}return Q.marker(t)},async searchAddress(r){const t=await vc.get(location.protocol+"//nominatim.openstreetmap.org/search?",{params:{q:r,limit:1,format:"json"}});if(t.data.length===1){const e=parseFloat(t.data[0].lat),n={lng:parseFloat(t.data[0].lon),lat:e};return this.setCoordinates({...n,moveMarker:!0}),t.data[0]}return t.data},setCoordinates({lat:r,lng:t}){if(this.mapRender){const e=Q.latLng(r,t);this.mapRender.panTo(e,{animate:!0,duration:.5})}},getPopupContent(r){const t=r.properties||{},e=t.descripcion||"",i=t.fechaHoraLlegada||"",n=t.fotoId||"",o=c=>{const d=new Date(c);if(isNaN(d.getTime()))return c;const f=S=>S.toString().padStart(2,"0"),p=f(d.getUTCDate()),m=f(d.getUTCMonth()+1),y=d.getUTCFullYear(),v=f(d.getUTCHours()),E=f(d.getUTCMinutes()),C=f(d.getUTCSeconds());return`${p}-${m}-${y} ${v}:${E}:${C}`};let a="";i&&(a=o(i));let h="<div>";return n&&(h+=`<img src="${n}" style="width: 200px; height: auto; margin-bottom: 5px;"><br>`),h+=`<b>Descripción:</b> ${e}<br>`,a&&(h+=`<b>Fecha Hora Llegada:</b> ${a}<br>`),h+="</div>",h},getPolygonTooltipContent(r){const t=r.properties||{};return`<div style="font-weight: bold; padding: 5px;">${t.descripcion||t.name||"Sin descripción"}</div>`}},watch:{coordinatesMap(r){if(this.renderCoordinates=r,this.mapRender&&this.markerRender){const t=Q.latLng([r[0],r[1]]);this.mapRender.setView([r[0],r[1]],r[2]),this.markerRender.setLatLng(t)}},dataPolygon(r){this.renderGeojson=r}}}),C_=["id"];function M_(r,t,e,i,n,o){var a;return j.openBlock(),j.createElementBlock("div",{class:"map-container",style:j.normalizeStyle(`height:${(a=r.configurationMap)==null?void 0:a.height}`)},[j.createElementVNode("div",{id:r.idMap,style:{height:"100%"}},null,8,C_)],4)}const S_=oa(T_,[["render",M_]]),P_=["id"],k_=j.defineComponent({__name:"MapSearchAddress",props:{configurationMap:{default:()=>({height:"250px",maxZoom:20,iconMarker:{iconUrl:ss,iconSize:[25,41],iconAnchor:[12,41],class:"",type:"image"},dragMarker:!0})},coordinatesMap:{default:()=>({lat:-19.0429,lng:-65.2554,zoom:12})},isSatelite:{type:Boolean}},emits:["updated:coordsMarker"],setup(r,{expose:t,emit:e}){const i=r,n=j.ref(),o=j.ref(i.coordinatesMap),a=j.ref(),h=j.ref(),c=j.ref(null),d=j.ref(!1);j.onMounted(async()=>{await f(10),await p()});const f=async w=>{let b="";const T="abcdefghijklmnopqrstuvwxyz",P=T.length;let R=0;for(;R<w;)b+=T.charAt(Math.floor(Math.random()*P)),R+=1;n.value=b},p=async()=>{await m()},m=async()=>{var T,P;const w=(T=i.configurationMap)==null?void 0:T.iconMarker,b=Q.map(n.value,{fullscreenControl:!0}).setView([o.value.lat,o.value.lng],o.value.zoom);if(b.invalidateSize(),a.value=b,d.value=i.isSatelite||!1,d.value?c.value=Q.tileLayer("https://api.maptiler.com/maps/satellite/{z}/{x}/{y}.jpg?key=t8mWT2ozs1JWBqMZOnZr",{attribution:'© <a href="https://www.maptiler.com/">MapTiler</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}):c.value=Q.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:(P=i.configurationMap)==null?void 0:P.maxZoom,attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),c.value.addTo(b),i.isSatelite!==void 0){const R=y();b.addControl(R)}if(w.type==="image"){const R=Q.marker([o.value.lat,o.value.lng],{icon:Q.icon({iconUrl:w.iconUrl,iconAnchor:w.iconAnchor,iconSize:w.iconSize,className:w.class}),draggable:i.configurationMap.dragMarker}).addTo(b);h.value=R,R.on("dragend",I=>{const O=I.target.getLatLng(),U=O.lat,X=O.lng;C({lat:U,lng:X})})}else if(w.type==="svg"){const R=Q.marker([o.value.lat,o.value.lng],{icon:Q.divIcon({html:w.iconUrl,iconAnchor:w.iconAnchor,iconSize:w.iconSize,className:w.class}),draggable:i.configurationMap.dragMarker}).addTo(b);h.value=R,R.on("dragend",I=>{const O=I.target.getLatLng(),U=O.lat,X=O.lng;C({lat:U,lng:X})})}},y=()=>{const w=Q.Control.extend({onAdd:b=>{const T=Q.DomUtil.create("div","leaflet-control-draw leaflet-bar leaflet-control"),P=Q.DomUtil.create("a","leaflet-draw-draw-satellite",T);return P.href="#",P.title=d.value?"Vista Normal":"Vista Satélite",P.style.backgroundImage=d.value?`url(${Es})`:`url(${Ls})`,P.style.backgroundPosition="center",P.style.backgroundRepeat="no-repeat",P.style.backgroundSize="20px 20px",Q.DomEvent.disableClickPropagation(P),Q.DomEvent.on(P,"click",v),T}});return new w({position:"topleft"})},v=()=>{if(!a.value||!c.value)return;d.value=!d.value,a.value.removeLayer(c.value),d.value?c.value=Q.tileLayer("https://api.maptiler.com/maps/satellite/{z}/{x}/{y}.jpg?key=t8mWT2ozs1JWBqMZOnZr",{attribution:'© <a href="https://www.maptiler.com/">MapTiler</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}):c.value=Q.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),c.value.addTo(a.value),document.querySelectorAll(".leaflet-draw-draw-satellite").forEach(b=>{const T=b;T.style.backgroundImage=d.value?`url(${Es})`:`url(${Ls})`,T.title=d.value?"Vista Normal":"Vista Satélite"})},E=async w=>{const b=await vc.get(location.protocol+"//nominatim.openstreetmap.org/search?",{params:{q:w,limit:1,format:"json"}});if(b.data.length===1){const T=parseFloat(b.data[0].lat),R={lng:parseFloat(b.data[0].lon),lat:T};return C({...R,moveMarker:!0}),b.data[0]}return b.data},C=({lat:w,lng:b,moveMarker:T=!1})=>{var P;e("updated:coordsMarker",{lat:w,lng:b}),T&&((P=h.value)==null||P.setLatLng({lat:w,lng:b})),S({lat:w,lng:b})},S=({lat:w,lng:b})=>{const T=Q.latLng(w,b);a.value.panTo(T,{animate:!0,duration:.5})};return t({searchAddress:E}),(w,b)=>{var T;return j.openBlock(),j.createElementBlock("div",{class:"map-container",style:j.normalizeStyle(`height:${(T=w.configurationMap)==null?void 0:T.height}`)},[j.createElementVNode("div",{id:n.value,style:{height:"100%"}},null,8,P_)],4)}}}),GL="";class R_{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const $e=R_,wn={PROPERTYCHANGE:"propertychange"};class A_{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}const bs=A_;function I_(r,t,e){let i,n;e=e||xi;let o=0,a=r.length,h=!1;for(;o<a;)i=o+(a-o>>1),n=+e(r[i],t),n<0?o=i+1:(a=i,h=!n);return h?o:~o}function xi(r,t){return r>t?1:r<t?-1:0}function Ea(r,t,e){if(r[0]<=t)return 0;const i=r.length;if(t<=r[i-1])return i-1;if(typeof e=="function"){for(let n=1;n<i;++n){const o=r[n];if(o===t)return n;if(o<t)return e(t,r[n-1],o)>0?n-1:n}return i-1}if(e>0){for(let n=1;n<i;++n)if(r[n]<t)return n-1;return i-1}if(e<0){for(let n=1;n<i;++n)if(r[n]<=t)return n;return i-1}for(let n=1;n<i;++n){if(r[n]==t)return n;if(r[n]<t)return r[n-1]-t<t-r[n]?n-1:n}return i-1}function D_(r,t,e){for(;t<e;){const i=r[t];r[t]=r[e],r[e]=i,++t,--e}}function ti(r,t){const e=Array.isArray(t)?t:[t],i=e.length;for(let n=0;n<i;n++)r[r.length]=e[n]}function ei(r,t){const e=r.length;if(e!==t.length)return!1;for(let i=0;i<e;i++)if(r[i]!==t[i])return!1;return!0}function O_(r,t,e){const i=t||xi;return r.every(function(n,o){if(o===0)return!0;const a=i(r[o-1],n);return!(a>0||e&&a===0)})}function pr(){return!0}function Ts(){return!1}function En(){}function F_(r){let t=!1,e,i,n;return function(){const o=Array.prototype.slice.call(arguments);return(!t||this!==n||!ei(o,i))&&(t=!0,n=this,i=o,e=r.apply(this,arguments)),e}}function Ln(r){for(const t in r)delete r[t]}function bn(r){let t;for(t in r)return!1;return!t}class z_ extends bs{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);n.includes(e)||n.push(e)}dispatchEvent(t){const e=typeof t=="string",i=e?t:t.type,n=this.listeners_&&this.listeners_[i];if(!n)return;const o=e?new $e(t):t;o.target||(o.target=this.eventTarget_||this);const a=this.dispatching_||(this.dispatching_={}),h=this.pendingRemovals_||(this.pendingRemovals_={});i in a||(a[i]=0,h[i]=0),++a[i];let c;for(let d=0,f=n.length;d<f;++d)if("handleEvent"in n[d]?c=n[d].handleEvent(o):c=n[d].call(this,o),c===!1||o.propagationStopped){c=!1;break}if(--a[i]===0){let d=h[i];for(delete h[i];d--;)this.removeEventListener(i,En);delete a[i]}return c}disposeInternal(){this.listeners_&&Ln(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return this.listeners_?t?t in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(t,e){const i=this.listeners_&&this.listeners_[t];if(i){const n=i.indexOf(e);n!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=En,++this.pendingRemovals_[t]):(i.splice(n,1),i.length===0&&delete this.listeners_[t]))}}}const Cs=z_,ot={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function ut(r,t,e,i,n){if(i&&i!==r&&(e=e.bind(i)),n){const a=e;e=function(){r.removeEventListener(t,e),a.apply(this,arguments)}}const o={target:r,type:t,listener:e};return r.addEventListener(t,e),o}function Ms(r,t,e,i){return ut(r,t,e,i,!0)}function Et(r){r&&r.target&&(r.target.removeEventListener(r.type,r.listener),Ln(r))}class Ss extends Cs{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(ot.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,n=new Array(i);for(let o=0;o<i;++o)n[o]=ut(this,t[o],e);return n}return ut(this,t,e)}onceInternal(t,e){let i;if(Array.isArray(t)){const n=t.length;i=new Array(n);for(let o=0;o<n;++o)i[o]=Ms(this,t[o],e)}else i=Ms(this,t,e);return e.ol_key=i,i}unInternal(t,e){const i=e.ol_key;if(i)N_(i);else if(Array.isArray(t))for(let n=0,o=t.length;n<o;++n)this.removeEventListener(t[n],e);else this.removeEventListener(t,e)}}Ss.prototype.on,Ss.prototype.once,Ss.prototype.un;function N_(r){if(Array.isArray(r))for(let t=0,e=r.length;t<e;++t)Et(r[t]);else Et(r)}const xc=Ss;function nt(){throw new Error("Unimplemented abstract method.")}let B_=0;function ht(r){return r.ol_uid||(r.ol_uid=String(++B_))}class wc extends $e{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}class G_ extends xc{constructor(t){super(),this.on,this.once,this.un,ht(this),this.values_=null,t!==void 0&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(t,e){let i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new wc(i,t,e)),i=wn.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new wc(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){const n=this.values_||(this.values_={});if(i)n[t]=e;else{const o=n[t];n[t]=e,o!==e&&this.notify(t,o)}}setProperties(t,e){for(const i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const i=this.values_[t];delete this.values_[t],bn(this.values_)&&(this.values_=null),e||this.notify(t,i)}}}const be=G_,Ut={ANIMATING:0,INTERACTING:1},Te={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},U_=42,La=256,_r={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class j_{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||_r[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const Ec=j_,mr=6378137,Tn=Math.PI*mr,Z_=[-Tn,-Tn,Tn,Tn],W_=[-180,-85,180,85],Ps=mr*Math.log(Math.tan(Math.PI/2));class Cn extends Ec{constructor(t){super({code:t,units:"m",extent:Z_,global:!0,worldExtent:W_,getPointResolution:function(e,i){return e/Math.cosh(i[1]/mr)}})}}const Lc=[new Cn("EPSG:3857"),new Cn("EPSG:102100"),new Cn("EPSG:102113"),new Cn("EPSG:900913"),new Cn("http://www.opengis.net/def/crs/EPSG/0/3857"),new Cn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function H_(r,t,e){const i=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(i));for(let n=0;n<i;n+=e){t[n]=Tn*r[n]/180;let o=mr*Math.log(Math.tan(Math.PI*(+r[n+1]+90)/360));o>Ps?o=Ps:o<-Ps&&(o=-Ps),t[n+1]=o}return t}function V_(r,t,e){const i=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(i));for(let n=0;n<i;n+=e)t[n]=180*r[n]/Tn,t[n+1]=360*Math.atan(Math.exp(r[n+1]/mr))/Math.PI-90;return t}const X_=6378137,bc=[-180,-90,180,90],Y_=Math.PI*X_/180;class Vi extends Ec{constructor(t,e){super({code:t,units:"degrees",extent:bc,axisOrientation:e,global:!0,metersPerUnit:Y_,worldExtent:bc})}}const Tc=[new Vi("CRS:84"),new Vi("EPSG:4326","neu"),new Vi("urn:ogc:def:crs:OGC:1.3:CRS84"),new Vi("urn:ogc:def:crs:OGC:2:84"),new Vi("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Vi("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Vi("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let ba={};function K_(r){return ba[r]||ba[r.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function q_(r,t){ba[r]=t}let Mn={};function ks(r,t,e){const i=r.getCode(),n=t.getCode();i in Mn||(Mn[i]={}),Mn[i][n]=e}function J_(r,t){let e;return r in Mn&&t in Mn[r]&&(e=Mn[r][t]),e}const jt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Cc(r){const t=ge();for(let e=0,i=r.length;e<i;++e)vr(t,r[e]);return t}function Rs(r,t,e){return e?(e[0]=r[0]-t,e[1]=r[1]-t,e[2]=r[2]+t,e[3]=r[3]+t,e):[r[0]-t,r[1]-t,r[2]+t,r[3]+t]}function Mc(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r.slice()}function Xi(r,t,e){let i,n;return t<r[0]?i=r[0]-t:r[2]<t?i=t-r[2]:i=0,e<r[1]?n=r[1]-e:r[3]<e?n=e-r[3]:n=0,i*i+n*n}function As(r,t){return Ta(r,t[0],t[1])}function Yi(r,t){return r[0]<=t[0]&&t[2]<=r[2]&&r[1]<=t[1]&&t[3]<=r[3]}function Ta(r,t,e){return r[0]<=t&&t<=r[2]&&r[1]<=e&&e<=r[3]}function Ca(r,t){const e=r[0],i=r[1],n=r[2],o=r[3],a=t[0],h=t[1];let c=jt.UNKNOWN;return a<e?c=c|jt.LEFT:a>n&&(c=c|jt.RIGHT),h<i?c=c|jt.BELOW:h>o&&(c=c|jt.ABOVE),c===jt.UNKNOWN&&(c=jt.INTERSECTING),c}function ge(){return[1/0,1/0,-1/0,-1/0]}function wi(r,t,e,i,n){return n?(n[0]=r,n[1]=t,n[2]=e,n[3]=i,n):[r,t,e,i]}function yr(r){return wi(1/0,1/0,-1/0,-1/0,r)}function Q_(r,t){const e=r[0],i=r[1];return wi(e,i,e,i,t)}function Sc(r,t,e,i,n){const o=yr(n);return kc(o,r,t,e,i)}function Sn(r,t){return r[0]==t[0]&&r[2]==t[2]&&r[1]==t[1]&&r[3]==t[3]}function Pc(r,t){return t[0]<r[0]&&(r[0]=t[0]),t[2]>r[2]&&(r[2]=t[2]),t[1]<r[1]&&(r[1]=t[1]),t[3]>r[3]&&(r[3]=t[3]),r}function vr(r,t){t[0]<r[0]&&(r[0]=t[0]),t[0]>r[2]&&(r[2]=t[0]),t[1]<r[1]&&(r[1]=t[1]),t[1]>r[3]&&(r[3]=t[1])}function kc(r,t,e,i,n){for(;e<i;e+=n)$_(r,t[e],t[e+1]);return r}function $_(r,t,e){r[0]=Math.min(r[0],t),r[1]=Math.min(r[1],e),r[2]=Math.max(r[2],t),r[3]=Math.max(r[3],e)}function Rc(r,t){let e;return e=t(Is(r)),e||(e=t(Ds(r)),e)||(e=t(Os(r)),e)||(e=t(qi(r)),e)?e:!1}function Ma(r){let t=0;return Fs(r)||(t=Tt(r)*Fe(r)),t}function Is(r){return[r[0],r[1]]}function Ds(r){return[r[2],r[1]]}function Ki(r){return[(r[0]+r[2])/2,(r[1]+r[3])/2]}function tm(r,t){let e;if(t==="bottom-left")e=Is(r);else if(t==="bottom-right")e=Ds(r);else if(t==="top-left")e=qi(r);else if(t==="top-right")e=Os(r);else throw new Error("Invalid corner");return e}function Sa(r,t,e,i,n){const[o,a,h,c,d,f,p,m]=Pa(r,t,e,i);return wi(Math.min(o,h,d,p),Math.min(a,c,f,m),Math.max(o,h,d,p),Math.max(a,c,f,m),n)}function Pa(r,t,e,i){const n=t*i[0]/2,o=t*i[1]/2,a=Math.cos(e),h=Math.sin(e),c=n*a,d=n*h,f=o*a,p=o*h,m=r[0],y=r[1];return[m-c+p,y-d-f,m-c-p,y-d+f,m+c-p,y+d+f,m+c+p,y+d-f,m-c+p,y-d-f]}function Fe(r){return r[3]-r[1]}function xr(r,t,e){const i=e||ge();return se(r,t)?(r[0]>t[0]?i[0]=r[0]:i[0]=t[0],r[1]>t[1]?i[1]=r[1]:i[1]=t[1],r[2]<t[2]?i[2]=r[2]:i[2]=t[2],r[3]<t[3]?i[3]=r[3]:i[3]=t[3]):yr(i),i}function qi(r){return[r[0],r[3]]}function Os(r){return[r[2],r[3]]}function Tt(r){return r[2]-r[0]}function se(r,t){return r[0]<=t[2]&&r[2]>=t[0]&&r[1]<=t[3]&&r[3]>=t[1]}function Fs(r){return r[2]<r[0]||r[3]<r[1]}function em(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r}function im(r,t,e){let i=!1;const n=Ca(r,t),o=Ca(r,e);if(n===jt.INTERSECTING||o===jt.INTERSECTING)i=!0;else{const a=r[0],h=r[1],c=r[2],d=r[3],f=t[0],p=t[1],m=e[0],y=e[1],v=(y-p)/(m-f);let E,C;o&jt.ABOVE&&!(n&jt.ABOVE)&&(E=m-(y-d)/v,i=E>=a&&E<=c),!i&&o&jt.RIGHT&&!(n&jt.RIGHT)&&(C=y-(m-c)*v,i=C>=h&&C<=d),!i&&o&jt.BELOW&&!(n&jt.BELOW)&&(E=m-(y-h)/v,i=E>=a&&E<=c),!i&&o&jt.LEFT&&!(n&jt.LEFT)&&(C=y-(m-a)*v,i=C>=h&&C<=d)}return i}function Ac(r,t){const e=t.getExtent(),i=Ki(r);if(t.canWrapX()&&(i[0]<e[0]||i[0]>=e[2])){const n=Tt(e),a=Math.floor((i[0]-e[0])/n)*n;r[0]-=a,r[2]-=a}return r}function nm(r,t){if(t.canWrapX()){const e=t.getExtent();if(!isFinite(r[0])||!isFinite(r[2]))return[[e[0],r[1],e[2],r[3]]];Ac(r,t);const i=Tt(e);if(Tt(r)>i)return[[e[0],r[1],e[2],r[3]]];if(r[0]<e[0])return[[r[0]+i,r[1],e[2],r[3]],[e[0],r[1],r[2],r[3]]];if(r[2]>e[2])return[[r[0],r[1],e[2],r[3]],[e[0],r[1],r[2]-i,r[3]]]}return[r]}function At(r,t,e){return Math.min(Math.max(r,t),e)}function rm(r,t,e,i,n,o){const a=n-e,h=o-i;if(a!==0||h!==0){const c=((r-e)*a+(t-i)*h)/(a*a+h*h);c>1?(e=n,i=o):c>0&&(e+=a*c,i+=h*c)}return Ji(r,t,e,i)}function Ji(r,t,e,i){const n=e-r,o=i-t;return n*n+o*o}function sm(r){const t=r.length;for(let i=0;i<t;i++){let n=i,o=Math.abs(r[i][i]);for(let h=i+1;h<t;h++){const c=Math.abs(r[h][i]);c>o&&(o=c,n=h)}if(o===0)return null;const a=r[n];r[n]=r[i],r[i]=a;for(let h=i+1;h<t;h++){const c=-r[h][i]/r[i][i];for(let d=i;d<t+1;d++)i==d?r[h][d]=0:r[h][d]+=c*r[i][d]}}const e=new Array(t);for(let i=t-1;i>=0;i--){e[i]=r[i][t]/r[i][i];for(let n=i-1;n>=0;n--)r[n][t]-=r[n][i]*e[i]}return e}function zs(r){return r*Math.PI/180}function Pn(r,t){const e=r%t;return e*t<0?e+t:e}function pe(r,t,e){return r+e*(t-r)}function ka(r,t){const e=Math.pow(10,t);return Math.round(r*e)/e}function Ns(r,t){return Math.floor(ka(r,t))}function Bs(r,t){return Math.ceil(ka(r,t))}function om(r,t){return r[0]+=+t[0],r[1]+=+t[1],r}function Gs(r,t){let e=!0;for(let i=r.length-1;i>=0;--i)if(r[i]!=t[i]){e=!1;break}return e}function Ra(r,t){const e=Math.cos(t),i=Math.sin(t),n=r[0]*e-r[1]*i,o=r[1]*e+r[0]*i;return r[0]=n,r[1]=o,r}function am(r,t){return r[0]*=t,r[1]*=t,r}function Ic(r,t){if(t.canWrapX()){const e=Tt(t.getExtent()),i=lm(r,t,e);i&&(r[0]-=i*e)}return r}function lm(r,t,e){const i=t.getExtent();let n=0;return t.canWrapX()&&(r[0]<i[0]||r[0]>i[2])&&(e=e||Tt(i),n=Math.floor((r[0]-i[0])/e)),n}const hm=63710088e-1;function Dc(r,t,e){e=e||hm;const i=zs(r[1]),n=zs(t[1]),o=(n-i)/2,a=zs(t[0]-r[0])/2,h=Math.sin(o)*Math.sin(o)+Math.sin(a)*Math.sin(a)*Math.cos(i)*Math.cos(n);return 2*e*Math.atan2(Math.sqrt(h),Math.sqrt(1-h))}const Oc={info:1,warn:2,error:3,none:4};let cm=Oc.info;function Fc(...r){cm>Oc.warn||console.warn(...r)}let Aa=!0;function zc(r){Aa=!(r===void 0?!0:r)}function Ia(r,t){if(t!==void 0){for(let e=0,i=r.length;e<i;++e)t[e]=r[e];t=t}else t=r.slice();return t}function Nc(r,t){if(t!==void 0&&r!==t){for(let e=0,i=r.length;e<i;++e)t[e]=r[e];r=t}return r}function um(r){q_(r.getCode(),r),ks(r,r,Ia)}function dm(r){r.forEach(um)}function Gt(r){return typeof r=="string"?K_(r):r||null}function Bc(r,t,e,i){r=Gt(r);let n;const o=r.getPointResolutionFunc();if(o){if(n=o(t,e),i&&i!==r.getUnits()){const a=r.getMetersPerUnit();a&&(n=n*a/_r[i])}}else{const a=r.getUnits();if(a=="degrees"&&!i||i=="degrees")n=t;else{const h=Oa(r,Gt("EPSG:4326"));if(h===Nc&&a!=="degrees")n=t*r.getMetersPerUnit();else{let d=[e[0]-t/2,e[1],e[0]+t/2,e[1],e[0],e[1]-t/2,e[0],e[1]+t/2];d=h(d,d,2);const f=Dc(d.slice(0,2),d.slice(2,4)),p=Dc(d.slice(4,6),d.slice(6,8));n=(f+p)/2}const c=i?_r[i]:r.getMetersPerUnit();c!==void 0&&(n/=c)}}return n}function Gc(r){dm(r),r.forEach(function(t){r.forEach(function(e){t!==e&&ks(t,e,Ia)})})}function fm(r,t,e,i){r.forEach(function(n){t.forEach(function(o){ks(n,o,e),ks(o,n,i)})})}function Da(r,t){return r?typeof r=="string"?Gt(r):r:Gt(t)}function Uc(r,t){return zc(),jc(r,"EPSG:4326",t!==void 0?t:"EPSG:3857")}function Qi(r,t){if(r===t)return!0;const e=r.getUnits()===t.getUnits();return(r.getCode()===t.getCode()||Oa(r,t)===Ia)&&e}function Oa(r,t){const e=r.getCode(),i=t.getCode();let n=J_(e,i);return n||(n=Nc),n}function Us(r,t){const e=Gt(r),i=Gt(t);return Oa(e,i)}function jc(r,t,e){return Us(t,e)(r,void 0,r.length)}function Fa(r,t){return r}function ii(r,t){return Aa&&!Gs(r,[0,0])&&r[0]>=-180&&r[0]<=180&&r[1]>=-90&&r[1]<=90&&(Aa=!1,Fc("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),r}function Zc(r,t){return r}function $i(r,t){return r}function gm(){Gc(Lc),Gc(Tc),fm(Tc,Lc,H_,V_)}gm();function gt(r,t){if(!r)throw new Error(t)}function Wc(r,t,e){return function(i,n,o,a,h){if(!i)return;if(!n&&!t)return i;const c=t?0:o[0]*n,d=t?0:o[1]*n,f=h?h[0]:0,p=h?h[1]:0;let m=r[0]+c/2+f,y=r[2]-c/2+f,v=r[1]+d/2+p,E=r[3]-d/2+p;m>y&&(m=(y+m)/2,y=m),v>E&&(v=(E+v)/2,E=v);let C=At(i[0],m,y),S=At(i[1],v,E);if(a&&e&&n){const w=30*n;C+=-w*Math.log(1+Math.max(0,m-i[0])/w)+w*Math.log(1+Math.max(0,i[0]-y)/w),S+=-w*Math.log(1+Math.max(0,v-i[1])/w)+w*Math.log(1+Math.max(0,i[1]-E)/w)}return[C,S]}}function pm(r){return r}function za(r,t,e,i){const n=Tt(t)/e[0],o=Fe(t)/e[1];return i?Math.min(r,Math.max(n,o)):Math.min(r,Math.min(n,o))}function Na(r,t,e){let i=Math.min(r,t);const n=50;return i*=Math.log(1+n*Math.max(0,r/t-1))/n+1,e&&(i=Math.max(i,e),i/=Math.log(1+n*Math.max(0,e/r-1))/n+1),At(i,e/2,t*2)}function _m(r,t,e,i){return t=t!==void 0?t:!0,function(n,o,a,h){if(n!==void 0){const c=r[0],d=r[r.length-1],f=e?za(c,e,a,i):c;if(h)return t?Na(n,f,d):At(n,d,f);const p=Math.min(f,n),m=Math.floor(Ea(r,p,o));return r[m]>f&&m<r.length-1?r[m+1]:r[m]}}}function mm(r,t,e,i,n,o){return i=i!==void 0?i:!0,e=e!==void 0?e:0,function(a,h,c,d){if(a!==void 0){const f=n?za(t,n,c,o):t;if(d)return i?Na(a,f,e):At(a,e,f);const p=1e-9,m=Math.ceil(Math.log(t/f)/Math.log(r)-p),y=-h*(.5-p)+.5,v=Math.min(f,a),E=Math.floor(Math.log(t/v)/Math.log(r)+y),C=Math.max(m,E),S=t/Math.pow(r,C);return At(S,e,f)}}}function Hc(r,t,e,i,n){return e=e!==void 0?e:!0,function(o,a,h,c){if(o!==void 0){const d=i?za(r,i,h,n):r;return!e||!c?At(o,t,d):Na(o,d,t)}}}function Ba(r){if(r!==void 0)return 0}function Vc(r){if(r!==void 0)return r}function ym(r){const t=2*Math.PI/r;return function(e,i){if(i)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e}}function vm(r){return r=r||zs(5),function(t,e){if(e)return t;if(t!==void 0)return Math.abs(t)<=r?0:t}}function Xc(r){return Math.pow(r,3)}function kn(r){return 1-Xc(1-r)}function xm(r){return 3*r*r-2*r*r*r}function wm(r){return r}const Ei=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",Em=Ei.includes("firefox"),Lm=Ei.includes("safari")&&!Ei.includes("chrom")&&(Ei.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Ei)),bm=Ei.includes("webkit")&&!Ei.includes("edge"),Yc=Ei.includes("macintosh"),Kc=typeof devicePixelRatio<"u"?devicePixelRatio:1,Ga=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,qc=typeof Image<"u"&&Image.prototype.decode,Jc=function(){let r=!1;try{const t=Object.defineProperty({},"passive",{get:function(){r=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return r}(),Tm=new Array(6);function Vt(){return[1,0,0,1,0,0]}function Qc(r,t){const e=r[0],i=r[1],n=r[2],o=r[3],a=r[4],h=r[5],c=t[0],d=t[1],f=t[2],p=t[3],m=t[4],y=t[5];return r[0]=e*c+n*d,r[1]=i*c+o*d,r[2]=e*f+n*p,r[3]=i*f+o*p,r[4]=e*m+n*y+a,r[5]=i*m+o*y+h,r}function $c(r,t,e,i,n,o,a){return r[0]=t,r[1]=e,r[2]=i,r[3]=n,r[4]=o,r[5]=a,r}function Cm(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function Ot(r,t){const e=t[0],i=t[1];return t[0]=r[0]*e+r[2]*i+r[4],t[1]=r[1]*e+r[3]*i+r[5],t}function Mm(r,t,e){return $c(r,t,0,0,e,0,0)}function Sm(r,t,e){return Qc(r,$c(Tm,1,0,0,1,t,e))}function ze(r,t,e,i,n,o,a,h){const c=Math.sin(o),d=Math.cos(o);return r[0]=i*d,r[1]=n*c,r[2]=-i*c,r[3]=n*d,r[4]=a*i*d-h*i*c+t,r[5]=a*n*c+h*n*d+e,r}function js(r,t){const e=Pm(t);gt(e!==0,"Transformation matrix cannot be inverted");const i=t[0],n=t[1],o=t[2],a=t[3],h=t[4],c=t[5];return r[0]=a/e,r[1]=-n/e,r[2]=-o/e,r[3]=i/e,r[4]=(o*c-a*h)/e,r[5]=-(i*c-n*h)/e,r}function Pm(r){return r[0]*r[3]-r[1]*r[2]}let tu;function eu(r){const t="matrix("+r.join(", ")+")";if(Ga)return t;const e=tu||(tu=document.createElement("div"));return e.style.transform=t,e.style.transform}function tn(r,t,e,i,n,o){o=o||[];let a=0;for(let h=t;h<e;h+=i){const c=r[h],d=r[h+1];o[a++]=n[0]*c+n[2]*d+n[4],o[a++]=n[1]*c+n[3]*d+n[5]}return o&&o.length!=a&&(o.length=a),o}function iu(r,t,e,i,n,o,a){a=a||[];const h=Math.cos(n),c=Math.sin(n),d=o[0],f=o[1];let p=0;for(let m=t;m<e;m+=i){const y=r[m]-d,v=r[m+1]-f;a[p++]=d+y*h-v*c,a[p++]=f+y*c+v*h;for(let E=m+2;E<m+i;++E)a[p++]=r[E]}return a&&a.length!=p&&(a.length=p),a}function km(r,t,e,i,n,o,a,h){h=h||[];const c=a[0],d=a[1];let f=0;for(let p=t;p<e;p+=i){const m=r[p]-c,y=r[p+1]-d;h[f++]=c+n*m,h[f++]=d+o*y;for(let v=p+2;v<p+i;++v)h[f++]=r[v]}return h&&h.length!=f&&(h.length=f),h}function Rm(r,t,e,i,n,o,a){a=a||[];let h=0;for(let c=t;c<e;c+=i){a[h++]=r[c]+n,a[h++]=r[c+1]+o;for(let d=c+2;d<c+i;++d)a[h++]=r[d]}return a&&a.length!=h&&(a.length=h),a}const nu=Vt();class Am extends be{constructor(){super(),this.extent_=ge(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=F_(function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);const n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return nt()}closestPointXY(t,e,i,n){return nt()}containsXY(t,e){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return nt()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&yr(e),this.extentRevision_=this.getRevision()}return em(this.extent_,t)}rotate(t,e){nt()}scale(t,e,i){nt()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return nt()}getType(){return nt()}applyTransform(t){nt()}intersectsExtent(t){return nt()}translate(t,e){nt()}transform(t,e){const i=Gt(t),n=i.getUnits()=="tile-pixels"?function(o,a,h){const c=i.getExtent(),d=i.getWorldExtent(),f=Fe(d)/Fe(c);return ze(nu,d[0],d[3],f,-f,0,0,0),tn(o,0,o.length,h,nu,a),Us(i,e)(o,a,h)}:Us(i,e);return this.applyTransform(n),this}}const ru=Am;class Im extends ru{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates=null}computeExtent(t){return Sc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return nt()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=su(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){nt()}setLayout(t,e,i){let n;if(t)n=su(t);else{for(let o=0;o<i;++o){if(e.length===0){this.layout="XY",this.stride=2;return}e=e[0]}n=e.length,t=Dm(n)}this.layout=t,this.stride=n}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())}rotate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();iu(i,0,i.length,n,t,e,i),this.changed()}}scale(t,e,i){e===void 0&&(e=t),i||(i=Ki(this.getExtent()));const n=this.getFlatCoordinates();if(n){const o=this.getStride();km(n,0,n.length,o,t,e,i,n),this.changed()}}translate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();Rm(i,0,i.length,n,t,e,i),this.changed()}}}function Dm(r){let t;return r==2?t="XY":r==3?t="XYZ":r==4&&(t="XYZM"),t}function su(r){let t;return r=="XY"?t=2:r=="XYZ"||r=="XYM"?t=3:r=="XYZM"&&(t=4),t}function Om(r,t,e){const i=r.getFlatCoordinates();if(!i)return null;const n=r.getStride();return tn(i,0,i.length,n,t,e)}const en=Im;function ou(r,t,e,i,n,o,a){const h=r[t],c=r[t+1],d=r[e]-h,f=r[e+1]-c;let p;if(d===0&&f===0)p=t;else{const m=((n-h)*d+(o-c)*f)/(d*d+f*f);if(m>1)p=e;else if(m>0){for(let y=0;y<i;++y)a[y]=pe(r[t+y],r[e+y],m);a.length=i;return}else p=t}for(let m=0;m<i;++m)a[m]=r[p+m];a.length=i}function Ua(r,t,e,i,n){let o=r[t],a=r[t+1];for(t+=i;t<e;t+=i){const h=r[t],c=r[t+1],d=Ji(o,a,h,c);d>n&&(n=d),o=h,a=c}return n}function ja(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o){const h=e[o];n=Ua(r,t,h,i,n),t=h}return n}function Fm(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o){const h=e[o];n=ja(r,t,h,i,n),t=h[h.length-1]}return n}function Za(r,t,e,i,n,o,a,h,c,d,f){if(t==e)return d;let p,m;if(n===0){if(m=Ji(a,h,r[t],r[t+1]),m<d){for(p=0;p<i;++p)c[p]=r[t+p];return c.length=i,m}return d}f=f||[NaN,NaN];let y=t+i;for(;y<e;)if(ou(r,y-i,y,i,a,h,f),m=Ji(a,h,f[0],f[1]),m<d){for(d=m,p=0;p<i;++p)c[p]=f[p];c.length=i,y+=i}else y+=i*Math.max((Math.sqrt(m)-Math.sqrt(d))/n|0,1);if(o&&(ou(r,e-i,t,i,a,h,f),m=Ji(a,h,f[0],f[1]),m<d)){for(d=m,p=0;p<i;++p)c[p]=f[p];c.length=i}return d}function Wa(r,t,e,i,n,o,a,h,c,d,f){f=f||[NaN,NaN];for(let p=0,m=e.length;p<m;++p){const y=e[p];d=Za(r,t,y,i,n,o,a,h,c,d,f),t=y}return d}function zm(r,t,e,i,n,o,a,h,c,d,f){f=f||[NaN,NaN];for(let p=0,m=e.length;p<m;++p){const y=e[p];d=Wa(r,t,y,i,n,o,a,h,c,d,f),t=y[y.length-1]}return d}function Nm(r,t,e,i){for(let n=0,o=e.length;n<o;++n)r[t++]=e[n];return t}function Zs(r,t,e,i){for(let n=0,o=e.length;n<o;++n){const a=e[n];for(let h=0;h<i;++h)r[t++]=a[h]}return t}function Ha(r,t,e,i,n){n=n||[];let o=0;for(let a=0,h=e.length;a<h;++a){const c=Zs(r,t,e[a],i);n[o++]=c,t=c}return n.length=o,n}function Bm(r,t,e,i,n){n=n||[];let o=0;for(let a=0,h=e.length;a<h;++a){const c=Ha(r,t,e[a],i,n[o]);c.length===0&&(c[0]=t),n[o++]=c,t=c[c.length-1]}return n.length=o,n}function Va(r,t,e,i,n,o,a){const h=(e-t)/i;if(h<3){for(;t<e;t+=i)o[a++]=r[t],o[a++]=r[t+1];return a}const c=new Array(h);c[0]=1,c[h-1]=1;const d=[t,e-i];let f=0;for(;d.length>0;){const p=d.pop(),m=d.pop();let y=0;const v=r[m],E=r[m+1],C=r[p],S=r[p+1];for(let w=m+i;w<p;w+=i){const b=r[w],T=r[w+1],P=rm(b,T,v,E,C,S);P>y&&(f=w,y=P)}y>n&&(c[(f-t)/i]=1,m+i<f&&d.push(m,f),f+i<p&&d.push(f,p))}for(let p=0;p<h;++p)c[p]&&(o[a++]=r[t+p*i],o[a++]=r[t+p*i+1]);return a}function Gm(r,t,e,i,n,o,a,h){for(let c=0,d=e.length;c<d;++c){const f=e[c];a=Va(r,t,f,i,n,o,a),h.push(a),t=f}return a}function nn(r,t){return t*Math.round(r/t)}function Um(r,t,e,i,n,o,a){if(t==e)return a;let h=nn(r[t],n),c=nn(r[t+1],n);t+=i,o[a++]=h,o[a++]=c;let d,f;do if(d=nn(r[t],n),f=nn(r[t+1],n),t+=i,t==e)return o[a++]=d,o[a++]=f,a;while(d==h&&f==c);for(;t<e;){const p=nn(r[t],n),m=nn(r[t+1],n);if(t+=i,p==d&&m==f)continue;const y=d-h,v=f-c,E=p-h,C=m-c;if(y*C==v*E&&(y<0&&E<y||y==E||y>0&&E>y)&&(v<0&&C<v||v==C||v>0&&C>v)){d=p,f=m;continue}o[a++]=d,o[a++]=f,h=d,c=f,d=p,f=m}return o[a++]=d,o[a++]=f,a}function au(r,t,e,i,n,o,a,h){for(let c=0,d=e.length;c<d;++c){const f=e[c];a=Um(r,t,f,i,n,o,a),h.push(a),t=f}return a}function jm(r,t,e,i,n,o,a,h){for(let c=0,d=e.length;c<d;++c){const f=e[c],p=[];a=au(r,t,f,i,n,o,a,p),h.push(p),t=f[f.length-1]}return a}function Li(r,t,e,i,n){n=n!==void 0?n:[];let o=0;for(let a=t;a<e;a+=i)n[o++]=r.slice(a,a+i);return n.length=o,n}function wr(r,t,e,i,n){n=n!==void 0?n:[];let o=0;for(let a=0,h=e.length;a<h;++a){const c=e[a];n[o++]=Li(r,t,c,i,n[o]),t=c}return n.length=o,n}function Xa(r,t,e,i,n){n=n!==void 0?n:[];let o=0;for(let a=0,h=e.length;a<h;++a){const c=e[a];n[o++]=c.length===1&&c[0]===t?[]:wr(r,t,c,i,n[o]),t=c[c.length-1]}return n.length=o,n}function lu(r,t,e,i){let n=0,o=r[e-i],a=r[e-i+1];for(;t<e;t+=i){const h=r[t],c=r[t+1];n+=a*h-o*c,o=h,a=c}return n/2}function hu(r,t,e,i){let n=0;for(let o=0,a=e.length;o<a;++o){const h=e[o];n+=lu(r,t,h,i),t=h}return n}function Zm(r,t,e,i){let n=0;for(let o=0,a=e.length;o<a;++o){const h=e[o];n+=hu(r,t,h,i),t=h[h.length-1]}return n}class Ws extends en{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}clone(){return new Ws(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,n){return n<Xi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Za(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))}getArea(){return lu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Li(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=Va(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new Ws(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Zs(this.flatCoordinates,0,t,this.stride),this.changed()}}const cu=Ws;class Ya extends en{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new Ya(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){const o=this.flatCoordinates,a=Ji(t,e,o[0],o[1]);if(a<n){const h=this.stride;for(let c=0;c<h;++c)i[c]=o[c];return i.length=h,a}return n}getCoordinates(){return this.flatCoordinates?this.flatCoordinates.slice():[]}computeExtent(t){return Q_(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return Ta(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Nm(this.flatCoordinates,0,t,this.stride),this.changed()}}const Hs=Ya;function Wm(r,t,e,i,n){return!Rc(n,function(a){return!rn(r,t,e,i,a[0],a[1])})}function rn(r,t,e,i,n,o){let a=0,h=r[e-i],c=r[e-i+1];for(;t<e;t+=i){const d=r[t],f=r[t+1];c<=o?f>o&&(d-h)*(o-c)-(n-h)*(f-c)>0&&a++:f<=o&&(d-h)*(o-c)-(n-h)*(f-c)<0&&a--,h=d,c=f}return a!==0}function Ka(r,t,e,i,n,o){if(e.length===0||!rn(r,t,e[0],i,n,o))return!1;for(let a=1,h=e.length;a<h;++a)if(rn(r,e[a-1],e[a],i,n,o))return!1;return!0}function Hm(r,t,e,i,n,o){if(e.length===0)return!1;for(let a=0,h=e.length;a<h;++a){const c=e[a];if(Ka(r,t,c,i,n,o))return!0;t=c[c.length-1]}return!1}function uu(r,t,e,i,n,o,a){let h,c,d,f,p,m,y;const v=n[o+1],E=[];for(let w=0,b=e.length;w<b;++w){const T=e[w];for(f=r[T-i],m=r[T-i+1],h=t;h<T;h+=i)p=r[h],y=r[h+1],(v<=m&&y<=v||m<=v&&v<=y)&&(d=(v-m)/(y-m)*(p-f)+f,E.push(d)),f=p,m=y}let C=NaN,S=-1/0;for(E.sort(xi),f=E[0],h=1,c=E.length;h<c;++h){p=E[h];const w=Math.abs(p-f);w>S&&(d=(f+p)/2,Ka(r,t,e,i,d,v)&&(C=d,S=w)),f=p}return isNaN(C)&&(C=n[o]),a?(a.push(C,v,S),a):[C,v,S]}function Vm(r,t,e,i,n){let o=[];for(let a=0,h=e.length;a<h;++a){const c=e[a];o=uu(r,t,c,i,n,2*a,o),t=c[c.length-1]}return o}function du(r,t,e,i,n){let o;for(t+=i;t<e;t+=i)if(o=n(r.slice(t-i,t),r.slice(t,t+i)),o)return o;return!1}function Vs(r,t,e,i,n){const o=kc(ge(),r,t,e,i);return se(n,o)?Yi(n,o)||o[0]>=n[0]&&o[2]<=n[2]||o[1]>=n[1]&&o[3]<=n[3]?!0:du(r,t,e,i,function(a,h){return im(n,a,h)}):!1}function Xm(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o){if(Vs(r,t,e[o],i,n))return!0;t=e[o]}return!1}function fu(r,t,e,i,n){return!!(Vs(r,t,e,i,n)||rn(r,t,e,i,n[0],n[1])||rn(r,t,e,i,n[0],n[3])||rn(r,t,e,i,n[2],n[1])||rn(r,t,e,i,n[2],n[3]))}function gu(r,t,e,i,n){if(!fu(r,t,e[0],i,n))return!1;if(e.length===1)return!0;for(let o=1,a=e.length;o<a;++o)if(Wm(r,e[o-1],e[o],i,n)&&!Vs(r,e[o-1],e[o],i,n))return!1;return!0}function Ym(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o){const h=e[o];if(gu(r,t,h,i,n))return!0;t=h[h.length-1]}return!1}function Km(r,t,e,i){for(;t<e-i;){for(let n=0;n<i;++n){const o=r[t+n];r[t+n]=r[e-i+n],r[e-i+n]=o}t+=i,e-=i}}function pu(r,t,e,i){let n=0,o=r[e-i],a=r[e-i+1];for(;t<e;t+=i){const h=r[t],c=r[t+1];n+=(h-o)*(c+a),o=h,a=c}return n===0?void 0:n>0}function _u(r,t,e,i,n){n=n!==void 0?n:!1;for(let o=0,a=e.length;o<a;++o){const h=e[o],c=pu(r,t,h,i);if(o===0){if(n&&c||!n&&!c)return!1}else if(n&&!c||!n&&c)return!1;t=h}return!0}function qm(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o){const h=e[o];if(!_u(r,t,h,i,n))return!1;h.length&&(t=h[h.length-1])}return!0}function qa(r,t,e,i,n){n=n!==void 0?n:!1;for(let o=0,a=e.length;o<a;++o){const h=e[o],c=pu(r,t,h,i);(o===0?n&&c||!n&&!c:n&&!c||!n&&c)&&Km(r,t,h,i),t=h}return t}function mu(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o)t=qa(r,t,e[o],i,n);return t}class Er extends en{constructor(t,e,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,e!==void 0&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?ti(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new Er(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Xi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ja(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Wa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return Ka(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return hu(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),qa(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,wr(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Ki(this.getExtent());this.flatInteriorPoint_=uu(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Hs(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new cu(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[];let o=0;for(let a=0,h=i.length;a<h;++a){const c=i[a],d=new cu(e.slice(o,c),t);n.push(d),o=c}return n}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;_u(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=qa(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=au(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i),new Er(e,"XY",i)}getType(){return"Polygon"}intersectsExtent(t){return gu(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Ha(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}const Xs=Er;function yu(r){if(Fs(r))throw new Error("Cannot create polygon from empty extent");const t=r[0],e=r[1],i=r[2],n=r[3],o=[t,e,t,n,i,n,i,e,t,e];return new Er(o,"XY",[o.length])}const Ja=0;class Jm extends be{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=Da(t.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,t.projection&&zc(),t.center&&(t.center=ii(t.center,this.projection_)),t.extent&&(t.extent=$i(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const h in Te)delete e[h];this.setProperties(e,!0);const i=$m(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=i.minZoom;const n=Qm(t),o=i.constraint,a=ty(t);this.constraints_={center:n,resolution:o,rotation:a},this.setRotation(t.rotation!==void 0?t.rotation:0),this.setCenterInternal(t.center!==void 0?t.center:null),t.resolution!==void 0?this.setResolution(t.resolution):t.zoom!==void 0&&this.setZoom(t.zoom)}get padding(){return this.padding_}set padding(t){let e=this.padding_;this.padding_=t;const i=this.getCenterInternal();if(i){const n=t||[0,0,0,0];e=e||[0,0,0,0];const o=this.getResolution(),a=o/2*(n[3]-e[3]+e[1]-n[1]),h=o/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([i[0]+a,i[1]-h])}}getUpdatedOptions_(t){const e=this.getProperties();return e.resolution!==void 0?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Object.assign({},e,t)}animate(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const e=new Array(arguments.length);for(let i=0;i<e.length;++i){let n=arguments[i];n.center&&(n=Object.assign({},n),n.center=ii(n.center,this.getProjection())),n.anchor&&(n=Object.assign({},n),n.anchor=ii(n.anchor,this.getProjection())),e[i]=n}this.animateInternal.apply(this,e)}animateInternal(t){let e=arguments.length,i;e>1&&typeof arguments[e-1]=="function"&&(i=arguments[e-1],--e);let n=0;for(;n<e&&!this.isDef();++n){const f=arguments[n];f.center&&this.setCenterInternal(f.center),f.zoom!==void 0?this.setZoom(f.zoom):f.resolution&&this.setResolution(f.resolution),f.rotation!==void 0&&this.setRotation(f.rotation)}if(n===e){i&&Ys(i,!0);return}let o=Date.now(),a=this.targetCenter_.slice(),h=this.targetResolution_,c=this.targetRotation_;const d=[];for(;n<e;++n){const f=arguments[n],p={start:o,complete:!1,anchor:f.anchor,duration:f.duration!==void 0?f.duration:1e3,easing:f.easing||xm,callback:i};if(f.center&&(p.sourceCenter=a,p.targetCenter=f.center.slice(),a=p.targetCenter),f.zoom!==void 0?(p.sourceResolution=h,p.targetResolution=this.getResolutionForZoom(f.zoom),h=p.targetResolution):f.resolution&&(p.sourceResolution=h,p.targetResolution=f.resolution,h=p.targetResolution),f.rotation!==void 0){p.sourceRotation=c;const m=Pn(f.rotation-c+Math.PI,2*Math.PI)-Math.PI;p.targetRotation=c+m,c=p.targetRotation}ey(p)?p.complete=!0:o+=p.duration,d.push(p)}this.animations_.push(d),this.setHint(Ut.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[Ut.ANIMATING]>0}getInteracting(){return this.hints_[Ut.INTERACTING]>0}cancelAnimations(){this.setHint(Ut.ANIMATING,-this.hints_[Ut.ANIMATING]);let t;for(let e=0,i=this.animations_.length;e<i;++e){const n=this.animations_[e];if(n[0].callback&&Ys(n[0].callback,!1),!t)for(let o=0,a=n.length;o<a;++o){const h=n[o];if(!h.complete){t=h.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;const t=Date.now();let e=!1;for(let i=this.animations_.length-1;i>=0;--i){const n=this.animations_[i];let o=!0;for(let a=0,h=n.length;a<h;++a){const c=n[a];if(c.complete)continue;const d=t-c.start;let f=c.duration>0?d/c.duration:1;f>=1?(c.complete=!0,f=1):o=!1;const p=c.easing(f);if(c.sourceCenter){const m=c.sourceCenter[0],y=c.sourceCenter[1],v=c.targetCenter[0],E=c.targetCenter[1];this.nextCenter_=c.targetCenter;const C=m+p*(v-m),S=y+p*(E-y);this.targetCenter_=[C,S]}if(c.sourceResolution&&c.targetResolution){const m=p===1?c.targetResolution:c.sourceResolution+p*(c.targetResolution-c.sourceResolution);if(c.anchor){const y=this.getViewportSize_(this.getRotation()),v=this.constraints_.resolution(m,0,y,!0);this.targetCenter_=this.calculateCenterZoom(v,c.anchor)}this.nextResolution_=c.targetResolution,this.targetResolution_=m,this.applyTargetState_(!0)}if(c.sourceRotation!==void 0&&c.targetRotation!==void 0){const m=p===1?Pn(c.targetRotation+Math.PI,2*Math.PI)-Math.PI:c.sourceRotation+p*(c.targetRotation-c.sourceRotation);if(c.anchor){const y=this.constraints_.rotation(m,!0);this.targetCenter_=this.calculateCenterRotate(y,c.anchor)}this.nextRotation_=c.targetRotation,this.targetRotation_=m}if(this.applyTargetState_(!0),e=!0,!c.complete)break}if(o){this.animations_[i]=null,this.setHint(Ut.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const a=n[0].callback;a&&Ys(a,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i;const n=this.getCenterInternal();return n!==void 0&&(i=[n[0]-e[0],n[1]-e[1]],Ra(i,t-this.getRotation()),om(i,e)),i}calculateCenterZoom(t,e){let i;const n=this.getCenterInternal(),o=this.getResolution();if(n!==void 0&&o!==void 0){const a=e[0]-t*(e[0]-n[0])/o,h=e[1]-t*(e[1]-n[1])/o;i=[a,h]}return i}getViewportSize_(t){const e=this.viewportSize_;if(t){const i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&Fa(t,this.getProjection())}getCenterInternal(){return this.get(Te.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return Zc(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();gt(e,"The view center is not defined");const i=this.getResolution();gt(i!==void 0,"The view resolution is not defined");const n=this.getRotation();return gt(n!==void 0,"The view rotation is not defined"),Sa(e,i,n,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(Te.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal($i(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const i=Tt(t)/e[0],n=Fe(t)/e[1];return Math.max(i,n)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(e/i)/Math.log(t);return function(o){return e/Math.pow(t,o*n)}}getRotation(){return this.get(Te.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,o=Math.log(i/n)/e;return function(a){return Math.log(i/a)/e/o}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),i=this.getRotation();let n=this.getCenterInternal();const o=this.padding_;if(o){const a=this.getViewportSizeMinusPadding_();n=Qa(n,this.getViewportSize_(),[a[0]/2+o[3],a[1]/2+o[0]],e,i)}return{center:n.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,i,n;if(this.resolutions_){const o=Ea(this.resolutions_,t,1);e=o,i=this.resolutions_[o],o==this.resolutions_.length-1?n=2:n=i/this.resolutions_[o+1]}else i=this.maxResolution_,n=this.zoomFactor_;return e+Math.log(i/t)/Math.log(n)}getResolutionForZoom(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;const e=At(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,At(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if(gt(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){gt(!Fs(t),"Cannot fit empty extent provided as `geometry`");const n=$i(t,this.getProjection());i=yu(n)}else if(t.getType()==="Circle"){const n=$i(t.getExtent(),this.getProjection());i=yu(n),i.rotate(this.getRotation(),Ki(n))}else i=t;this.fitInternal(i,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),i=Math.cos(e),n=Math.sin(-e),o=t.getFlatCoordinates(),a=t.getStride();let h=1/0,c=1/0,d=-1/0,f=-1/0;for(let p=0,m=o.length;p<m;p+=a){const y=o[p]*i-o[p+1]*n,v=o[p]*n+o[p+1]*i;h=Math.min(h,y),c=Math.min(c,v),d=Math.max(d,y),f=Math.max(f,v)}return[h,c,d,f]}fitInternal(t,e){e=e||{};let i=e.size;i||(i=this.getViewportSizeMinusPadding_());const n=e.padding!==void 0?e.padding:[0,0,0,0],o=e.nearest!==void 0?e.nearest:!1;let a;e.minResolution!==void 0?a=e.minResolution:e.maxZoom!==void 0?a=this.getResolutionForZoom(e.maxZoom):a=0;const h=this.rotatedExtentForGeometry(t);let c=this.getResolutionForExtentInternal(h,[i[0]-n[1]-n[3],i[1]-n[0]-n[2]]);c=isNaN(c)?a:Math.max(c,a),c=this.getConstrainedResolution(c,o?0:1);const d=this.getRotation(),f=Math.sin(d),p=Math.cos(d),m=Ki(h);m[0]+=(n[1]-n[3])/2*c,m[1]+=(n[0]-n[2])/2*c;const y=m[0]*p-m[1]*f,v=m[1]*p+m[0]*f,E=this.getConstrainedCenter([y,v],c),C=e.callback?e.callback:En;e.duration!==void 0?this.animateInternal({resolution:c,center:E,duration:e.duration,easing:e.easing},C):(this.targetResolution_=c,this.targetCenter_=E,this.applyTargetState_(!1,!0),Ys(C,!0))}centerOn(t,e,i){this.centerOnInternal(ii(t,this.getProjection()),e,i)}centerOnInternal(t,e,i){this.setCenterInternal(Qa(t,e,i,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,i,n){let o;const a=this.padding_;if(a&&t){const h=this.getViewportSizeMinusPadding_(-i),c=Qa(t,n,[h[0]/2+a[3],h[1]/2+a[0]],e,i);o=[t[0]-c[0],t[1]-c[1]]}return o}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(t){const e=Fa(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])}adjustCenterInternal(t){const e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])}adjustResolution(t,e){e=e&&ii(e,this.getProjection()),this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){const i=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),o=this.constraints_.resolution(this.targetResolution_*t,0,n,i);e&&(this.targetCenter_=this.calculateCenterZoom(o,e)),this.targetResolution_*=t,this.applyTargetState_()}adjustZoom(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)}adjustRotation(t,e){e&&(e=ii(e,this.getProjection())),this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){const i=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t&&ii(t,this.getProjection()))}setCenterInternal(t){this.targetCenter_=t,this.applyTargetState_()}setHint(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]}setResolution(t){this.targetResolution_=t,this.applyTargetState_()}setRotation(t){this.targetRotation_=t,this.applyTargetState_()}setZoom(t){this.setResolution(this.getResolutionForZoom(t))}applyTargetState_(t,e){const i=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,i),o=this.getViewportSize_(n),a=this.constraints_.resolution(this.targetResolution_,0,o,i),h=this.constraints_.center(this.targetCenter_,a,o,i,this.calculateCenterShift(this.targetCenter_,a,n,o));this.get(Te.ROTATION)!==n&&this.set(Te.ROTATION,n),this.get(Te.RESOLUTION)!==a&&(this.set(Te.RESOLUTION,a),this.set("zoom",this.getZoom(),!0)),(!h||!this.get(Te.CENTER)||!Gs(this.get(Te.CENTER),h))&&this.set(Te.CENTER,h),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(t,e,i){t=t!==void 0?t:200;const n=e||0,o=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(o),h=this.constraints_.resolution(this.targetResolution_,n,a),c=this.constraints_.center(this.targetCenter_,h,a,!1,this.calculateCenterShift(this.targetCenter_,h,o,a));if(t===0&&!this.cancelAnchor_){this.targetResolution_=h,this.targetRotation_=o,this.targetCenter_=c,this.applyTargetState_();return}i=i||(t===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==h||this.getRotation()!==o||!this.getCenterInternal()||!Gs(this.getCenterInternal(),c))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:c,resolution:h,duration:t,easing:kn,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(Ut.INTERACTING,1)}endInteraction(t,e,i){i=i&&ii(i,this.getProjection()),this.endInteractionInternal(t,e,i)}endInteractionInternal(t,e,i){this.getInteracting()&&(this.setHint(Ut.INTERACTING,-1),this.resolveConstraints(t,e,i))}getConstrainedCenter(t,e){const i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)}getConstrainedZoom(t,e){const i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))}getConstrainedResolution(t,e){e=e||0;const i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,i)}}function Ys(r,t){setTimeout(function(){r(t)},0)}function Qm(r){if(r.extent!==void 0){const e=r.smoothExtentConstraint!==void 0?r.smoothExtentConstraint:!0;return Wc(r.extent,r.constrainOnlyCenter,e)}const t=Da(r.projection,"EPSG:3857");if(r.multiWorld!==!0&&t.isGlobal()){const e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,Wc(e,!1,!1)}return pm}function $m(r){let t,e,i,a=r.minZoom!==void 0?r.minZoom:Ja,h=r.maxZoom!==void 0?r.maxZoom:28;const c=r.zoomFactor!==void 0?r.zoomFactor:2,d=r.multiWorld!==void 0?r.multiWorld:!1,f=r.smoothResolutionConstraint!==void 0?r.smoothResolutionConstraint:!0,p=r.showFullExtent!==void 0?r.showFullExtent:!1,m=Da(r.projection,"EPSG:3857"),y=m.getExtent();let v=r.constrainOnlyCenter,E=r.extent;if(!d&&!E&&m.isGlobal()&&(v=!1,E=y),r.resolutions!==void 0){const C=r.resolutions;e=C[a],i=C[h]!==void 0?C[h]:C[C.length-1],r.constrainResolution?t=_m(C,f,!v&&E,p):t=Hc(e,i,f,!v&&E,p)}else{const S=(y?Math.max(Tt(y),Fe(y)):360*_r.degrees/m.getMetersPerUnit())/La/Math.pow(2,Ja),w=S/Math.pow(2,28-Ja);e=r.maxResolution,e!==void 0?a=0:e=S/Math.pow(c,a),i=r.minResolution,i===void 0&&(r.maxZoom!==void 0?r.maxResolution!==void 0?i=e/Math.pow(c,h):i=S/Math.pow(c,h):i=w),h=a+Math.floor(Math.log(e/i)/Math.log(c)),i=e/Math.pow(c,h-a),r.constrainResolution?t=mm(c,e,i,f,!v&&E,p):t=Hc(e,i,f,!v&&E,p)}return{constraint:t,maxResolution:e,minResolution:i,minZoom:a,zoomFactor:c}}function ty(r){if(r.enableRotation!==void 0?r.enableRotation:!0){const e=r.constrainRotation;return e===void 0||e===!0?vm():e===!1?Vc:typeof e=="number"?ym(e):Vc}return Ba}function ey(r){return!(r.sourceCenter&&r.targetCenter&&!Gs(r.sourceCenter,r.targetCenter)||r.sourceResolution!==r.targetResolution||r.sourceRotation!==r.targetRotation)}function Qa(r,t,e,i,n){const o=Math.cos(-n);let a=Math.sin(-n),h=r[0]*o-r[1]*a,c=r[1]*o+r[0]*a;h+=(t[0]/2-e[0])*i,c+=(e[1]-t[1]/2)*i,a=-a;const d=h*o-c*a,f=c*o+h*a;return[d,f]}const Ne=Jm,oe={ADD:"add",REMOVE:"remove"},vu={LENGTH:"length"};class Ks extends $e{constructor(t,e,i){super(t),this.element=e,this.index=i}}class iy extends be{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let i=0,n=this.array_.length;i<n;++i)this.assertUnique_(this.array_[i],i);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,i=t.length;e<i;++e)this.push(t[e]);return this}forEach(t){const e=this.array_;for(let i=0,n=e.length;i<n;++i)t(e[i],i,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(vu.LENGTH)}insertAt(t,e){if(t<0||t>this.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new Ks(oe.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let i=0,n=e.length;i<n;++i)if(e[i]===t)return this.removeAt(i)}removeAt(t){if(t<0||t>=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Ks(oe.REMOVE,e,t)),e}setAt(t,e){const i=this.getLength();if(t>=i){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Ks(oe.REMOVE,n,t)),this.dispatchEvent(new Ks(oe.ADD,e,t))}updateLength_(){this.set(vu.LENGTH,this.array_.length)}assertUnique_(t,e){for(let i=0,n=this.array_.length;i<n;++i)if(this.array_[i]===t&&i!==e)throw new Error("Duplicate item added to a unique collection")}}const Be=iy,ny=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,ry=/^([a-z]*)$|^hsla?\(.*\)$/i;function xu(r){return typeof r=="string"?r:Eu(r)}function sy(r){const t=document.createElement("div");if(t.style.color=r,t.style.color!==""){document.body.appendChild(t);const e=getComputedStyle(t).color;return document.body.removeChild(t),e}return""}const oy=function(){const t={};let e=0;return function(i){let n;if(t.hasOwnProperty(i))n=t[i];else{if(e>=1024){let o=0;for(const a in t)o++&3||(delete t[a],--e)}n=ay(i),t[i]=n,++e}return n}}();function Lr(r){return Array.isArray(r)?r:oy(r)}function ay(r){let t,e,i,n,o;if(ry.exec(r)&&(r=sy(r)),ny.exec(r)){const a=r.length-1;let h;a<=4?h=1:h=2;const c=a===4||a===8;t=parseInt(r.substr(1+0*h,h),16),e=parseInt(r.substr(1+1*h,h),16),i=parseInt(r.substr(1+2*h,h),16),c?n=parseInt(r.substr(1+3*h,h),16):n=255,h==1&&(t=(t<<4)+t,e=(e<<4)+e,i=(i<<4)+i,c&&(n=(n<<4)+n)),o=[t,e,i,n/255]}else if(r.startsWith("rgba("))o=r.slice(5,-1).split(",").map(Number),wu(o);else if(r.startsWith("rgb("))o=r.slice(4,-1).split(",").map(Number),o.push(1),wu(o);else throw new Error("Invalid color");return o}function wu(r){return r[0]=At(r[0]+.5|0,0,255),r[1]=At(r[1]+.5|0,0,255),r[2]=At(r[2]+.5|0,0,255),r[3]=At(r[3],0,1),r}function Eu(r){let t=r[0];t!=(t|0)&&(t=t+.5|0);let e=r[1];e!=(e|0)&&(e=e+.5|0);let i=r[2];i!=(i|0)&&(i=i+.5|0);const n=r[3]===void 0?1:Math.round(r[3]*100)/100;return"rgba("+t+","+e+","+i+","+n+")"}class ly{constructor(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const i=this.cache_[e];!(t++&3)&&!i.hasListener()&&(delete this.cache_[e],--this.cacheSize_)}}}get(t,e,i){const n=Lu(t,e,i);return n in this.cache_?this.cache_[n]:null}set(t,e,i,n){const o=Lu(t,e,i);this.cache_[o]=n,++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function Lu(r,t,e){const i=e?xu(e):"null";return t+":"+r+":"+i}const qs=new ly,xt={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};class hy extends be{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);typeof t.properties=="object"&&(delete e.properties,Object.assign(e,t.properties)),e[xt.OPACITY]=t.opacity!==void 0?t.opacity:1,gt(typeof e[xt.OPACITY]=="number","Layer opacity must be a number"),e[xt.VISIBLE]=t.visible!==void 0?t.visible:!0,e[xt.Z_INDEX]=t.zIndex,e[xt.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[xt.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[xt.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[xt.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=e.className!==void 0?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:t===void 0?!0:t},i=this.getZIndex();return e.opacity=At(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=i===void 0&&!e.managed?1/0:i,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return nt()}getLayerStatesArray(t){return nt()}getExtent(){return this.get(xt.EXTENT)}getMaxResolution(){return this.get(xt.MAX_RESOLUTION)}getMinResolution(){return this.get(xt.MIN_RESOLUTION)}getMinZoom(){return this.get(xt.MIN_ZOOM)}getMaxZoom(){return this.get(xt.MAX_ZOOM)}getOpacity(){return this.get(xt.OPACITY)}getSourceState(){return nt()}getVisible(){return this.get(xt.VISIBLE)}getZIndex(){return this.get(xt.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(xt.EXTENT,t)}setMaxResolution(t){this.set(xt.MAX_RESOLUTION,t)}setMinResolution(t){this.set(xt.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(xt.MAX_ZOOM,t)}setMinZoom(t){this.set(xt.MIN_ZOOM,t)}setOpacity(t){gt(typeof t=="number","Layer opacity must be a number"),this.set(xt.OPACITY,t)}setVisible(t){this.set(xt.VISIBLE,t)}setZIndex(t){this.set(xt.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const bu=hy,qt={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class cy extends bu{constructor(t){const e=Object.assign({},t);delete e.source,super(e),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener(xt.SOURCE,this.handleSourcePropertyChange_);const i=t.source?t.source:null;this.setSource(i)}getLayersArray(t){return t=t||[],t.push(this),t}getLayerStatesArray(t){return t=t||[],t.push(this.getLayerState()),t}getSource(){return this.get(xt.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!=="ready")&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(Et(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=ut(t,ot.CHANGE,this.handleSourceChange_,this),t.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e;const i=this.getMapInternal();!t&&i&&(t=i.getView()),t instanceof Ne?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let n;e.layerStatesArray?n=e.layerStatesArray.find(a=>a.layer===this):n=this.getLayerState();const o=this.getExtent();return $a(n,e.viewState)&&(!o||se(o,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];let e;const i=this.getSource();if(i&&(e=i.getAttributions()),!e)return[];const n=t instanceof Ne?t.getViewStateAndExtent():t;let o=e(n);return Array.isArray(o)||(o=[o]),o}render(t,e){const i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}setMapInternal(t){t||this.unrender(),this.set(xt.MAP,t)}getMapInternal(){return this.get(xt.MAP)}setMap(t){this.mapPrecomposeKey_&&(Et(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Et(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=ut(t,qt.PRECOMPOSE,function(e){const n=e.frameState.layerStatesArray,o=this.getLayerState(!1);gt(!n.some(function(a){return a.layer===o.layer}),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),n.push(o)},this),this.mapRenderKey_=ut(this,ot.CHANGE,t.render,t),this.changed())}setSource(t){this.set(xt.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function $a(r,t){if(!r.visible)return!1;const e=t.resolution;if(e<r.minResolution||e>=r.maxResolution)return!1;const i=t.zoom;return i>r.minZoom&&i<=r.maxZoom}const Js=cy;class uy extends bs{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){nt()}calculateMatrices2D(t){const e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;ze(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),js(n,i)}forEachFeatureAtCoordinate(t,e,i,n,o,a,h,c){let d;const f=e.viewState;function p(T,P,R,I){return o.call(a,P,T?R:null,I)}const m=f.projection,y=Ic(t.slice(),m),v=[[0,0]];if(m.canWrapX()&&n){const T=m.getExtent(),P=Tt(T);v.push([-P,0],[P,0])}const E=e.layerStatesArray,C=E.length,S=[],w=[];for(let T=0;T<v.length;T++)for(let P=C-1;P>=0;--P){const R=E[P],I=R.layer;if(I.hasRenderer()&&$a(R,f)&&h.call(c,I)){const O=I.getRenderer(),U=I.getSource();if(O&&U){const X=U.getWrapX()?y:t,q=p.bind(null,R.managed);w[0]=X[0]+v[T][0],w[1]=X[1]+v[T][1],d=O.forEachFeatureAtCoordinate(w,e,i,q,S)}if(d)return d}}if(S.length===0)return;const b=1/S.length;return S.forEach((T,P)=>T.distanceSq+=P*b),S.sort((T,P)=>T.distanceSq-P.distanceSq),S.some(T=>d=T.callback(T.feature,T.layer,T.geometry)),d}hasFeatureAtCoordinate(t,e,i,n,o,a){return this.forEachFeatureAtCoordinate(t,e,i,n,pr,this,o,a)!==void 0}getMap(){return this.map_}renderFrame(t){nt()}flushDeclutterItems(t){}scheduleExpireIconCache(t){qs.canExpireCache()&&t.postRenderFunctions.push(dy)}}function dy(r,t){qs.expire()}const fy=uy;class gy extends $e{constructor(t,e,i,n){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=n}}const br=gy,Qs="ol-hidden",py="ol-selectable",Tr="ol-unselectable",Tu="ol-unsupported",$s="ol-control",Cu="ol-collapsed",_y=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),Mu=["style","variant","weight","size","lineHeight","family"],Su=function(r){const t=r.match(_y);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,n=Mu.length;i<n;++i){const o=t[i+1];o!==void 0&&(e[Mu[i]]=o)}return e.families=e.family.split(/,\s?/),e};function Jt(r,t,e,i){let n;return e&&e.length?n=e.shift():Ga?n=new OffscreenCanvas(r||300,t||300):n=document.createElement("canvas"),r&&(n.width=r),t&&(n.height=t),n.getContext("2d",i)}function to(r){const t=r.canvas;t.width=1,t.height=1,r.clearRect(0,0,1,1)}function my(r){let t=r.offsetWidth;const e=getComputedStyle(r);return t+=parseInt(e.marginLeft,10)+parseInt(e.marginRight,10),t}function yy(r){let t=r.offsetHeight;const e=getComputedStyle(r);return t+=parseInt(e.marginTop,10)+parseInt(e.marginBottom,10),t}function eo(r,t){const e=t.parentNode;e&&e.replaceChild(r,t)}function io(r){return r&&r.parentNode?r.parentNode.removeChild(r):null}function Pu(r){for(;r.lastChild;)r.removeChild(r.lastChild)}function vy(r,t){const e=r.childNodes;for(let i=0;;++i){const n=e[i],o=t[i];if(!n&&!o)break;if(n!==o){if(!n){r.appendChild(o);continue}if(!o){r.removeChild(n),--i;continue}r.insertBefore(o,n)}}}const ku="10px sans-serif",ae="#000",Rn="round",ni=[],ri=0,An="round",Cr=10,Mr="#000",Sr="center",no="middle",sn=[0,0,0,0],Pr=1,si=new be;let In=null,tl;const el={},xy=function(){const t="32px ",e=["monospace","serif"],i=e.length,n="wmytzilWMYTZIL@#/&?$%10";let o,a;function h(d,f,p){let m=!0;for(let y=0;y<i;++y){const v=e[y];if(a=ro(d+" "+f+" "+t+v,n),p!=v){const E=ro(d+" "+f+" "+t+p+","+v,n);m=m&&E!=a}}return!!m}function c(){let d=!0;const f=si.getKeys();for(let p=0,m=f.length;p<m;++p){const y=f[p];si.get(y)<100&&(h.apply(this,y.split(`
|
|
18
|
-
`))?(Ln(el),In=null,tl=void 0,si.set(y,100)):(si.set(y,si.get(y)+1,!0),d=!1))}d&&(clearInterval(o),o=void 0)}return function(d){const f=Su(d);if(!f)return;const p=f.families;for(let m=0,y=p.length;m<y;++m){const v=p[m],E=f.style+`
|
|
13
|
+
*/(function(t,e){r.exports?r.exports=e(J,sp):e(t.L,t.screenfull)})(typeof self<"u"?self:ri,function(t,e){return t.Control.FullScreen=t.Control.extend({options:{position:"topleft",title:"Full Screen",titleCancel:"Exit Full Screen",forceSeparateButton:!1,forcePseudoFullscreen:!1,fullscreenElement:!1},_screenfull:e,onAdd:function(i){var n="leaflet-control-zoom-fullscreen",s,a="";return i.zoomControl&&!this.options.forceSeparateButton?s=i.zoomControl._container:s=t.DomUtil.create("div","leaflet-bar"),this.options.content?a=this.options.content:n+=" fullscreen-icon",this._createButton(this.options.title,n,a,s,this.toggleFullScreen,this),this._map.fullscreenControl=this,this._map.on("enterFullscreen exitFullscreen",this._toggleState,this),s},onRemove:function(){t.DomEvent.off(this.link,"click",t.DomEvent.stop).off(this.link,"click",this.toggleFullScreen,this),this._screenfull.isEnabled&&(t.DomEvent.off(this._container,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).off(this._container,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,this),t.DomEvent.off(document,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).off(document,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,this))},_createButton:function(i,n,s,a,h,c){return this.link=t.DomUtil.create("a",n,a),this.link.href="#",this.link.title=i,this.link.innerHTML=s,this.link.setAttribute("role","button"),this.link.setAttribute("aria-label",i),L.DomEvent.disableClickPropagation(a),t.DomEvent.on(this.link,"click",t.DomEvent.stop).on(this.link,"click",h,c),this._screenfull.isEnabled&&(t.DomEvent.on(a,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).on(a,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,c),t.DomEvent.on(document,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).on(document,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,c)),this.link},toggleFullScreen:function(){var i=this._map;i._exitFired=!1,i._isFullscreen?(this._screenfull.isEnabled&&!this.options.forcePseudoFullscreen?this._screenfull.exit():(t.DomUtil.removeClass(this.options.fullscreenElement?this.options.fullscreenElement:i._container,"leaflet-pseudo-fullscreen"),i.invalidateSize()),i.fire("exitFullscreen"),i._exitFired=!0,i._isFullscreen=!1):(this._screenfull.isEnabled&&!this.options.forcePseudoFullscreen?this._screenfull.request(this.options.fullscreenElement?this.options.fullscreenElement:i._container):(t.DomUtil.addClass(this.options.fullscreenElement?this.options.fullscreenElement:i._container,"leaflet-pseudo-fullscreen"),i.invalidateSize()),i.fire("enterFullscreen"),i._isFullscreen=!0)},_toggleState:function(){this.link.title=this._map._isFullscreen?this.options.title:this.options.titleCancel,this._map._isFullscreen?L.DomUtil.removeClass(this.link,"leaflet-fullscreen-on"):L.DomUtil.addClass(this.link,"leaflet-fullscreen-on")},_handleFullscreenChange:function(){var i=this._map;i.invalidateSize(),!this._screenfull.isFullscreen&&!i._exitFired&&(i.fire("exitFullscreen"),i._exitFired=!0,i._isFullscreen=!1)}}),t.Map.include({toggleFullscreen:function(){this.fullscreenControl.toggleFullScreen()}}),t.Map.addInitHook(function(){this.options.fullscreenControl&&this.addControl(t.control.fullscreen(this.options.fullscreenControlOptions))}),t.control.fullscreen=function(i){return new t.Control.FullScreen(i)},{leaflet:t,screenfull:e}})})(rp);const op=U.defineComponent({name:"CoordinatesVerifyPolygon",props:{dataPolygon:Object,iconMarker:Object,coordinatesMap:Array,checkPointInPolygon:Function},data(){return{markerIconDefault:{iconUrl:Es,iconSize:[25,41],iconAnchor:[12,41]}}},mounted(){this.verificarPuntoEnPoligono()},methods:{verificarPuntoEnPoligono(){var f;const r=this.iconMarker?this.iconMarker:this.markerIconDefault,t=(f=this.dataPolygon)==null?void 0:f.geometry.coordinates[0].map(p=>[p[1],p[0]]),e=JSON.parse(JSON.stringify(t)),i=[this.coordinatesMap?this.coordinatesMap[0]:0,this.coordinatesMap?this.coordinatesMap[1]:0],n=J.map("maps",{fullscreenControl:!0}).setView([this.coordinatesMap?this.coordinatesMap[0]:0,this.coordinatesMap?this.coordinatesMap[1]:0],this.coordinatesMap?this.coordinatesMap[2]:0);J.tileLayer("https://tile.openstreetmaps.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(n),J.polygon(e).addTo(n);const s=[this.coordinatesMap?this.coordinatesMap[0]:0,this.coordinatesMap?this.coordinatesMap[1]:0],a=J.icon(r);J.marker(s,{icon:a}).addTo(n);const h=zg(i),c=Ng([t]),d=Ug(h,c);this.checkPointInPolygon&&this.checkPointInPolygon(d)}}}),pb="",La=(r,t)=>{const e=r.__vccOpts||r;for(const[i,n]of t)e[i]=n;return e},ap={ref:"maps",id:"maps"};function lp(r,t,e,i,n,s){return U.openBlock(),U.createElementBlock("div",ap,null,512)}const hp=La(op,[["render",lp]]),cp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAANHElEQVR4nOWbe3BUVZ7HP/fefiSdTtKEJsggBHnYBqVgwBKNyjiC4ojLw5Wt0t2ZcX2sU1SN1G7t1DijjlU66oiOO85ooazM1uBjRpQRJhAFh4criEEIUcRwI+EVyfOa3KQ7nX7de/eP7gSSe7tzO+ngH/utoiqce87v/M73/n6/8zu/c1swDIP/z3CMpnC/L5APLAMWAfOBywAx9VhI/RsMA6gH9gE7gEpFlcOjpaMwGhbg9wUCwL8BK4FxQByIleh+90RtcrRYH+Mo0oscDlwOwBEjKvaIIboFVWiWztIhtZMg0SeuHXgLeFlR5aO51jWnBPh9ge8AvwDuIfkmI5O0svby2GzfJG2Kb7w2wSEiZbQ6HYOg2GmccjQIXzhrOen46vzHfwQeU1T561zpnDMC/L7A/cCjgA/Qro5dd3pu9FpK9LGzs1IIgQQaAA4k2qQmvcZ1gMOuajFlFRHgIUWVX8iF3iMmwO8LFAJrgbuArvL4nCNLe+/wOw1XuYG1k2epImAQFkLa9vxK/ajzsCPVuA24U1Hl4Iikj4QAvy8wA9gEzBirl554MPiz1gja98XUsoUcLP98aOhExO74tvx3pXpHnQicAW5SVLl+uDKHTYDfF5gNfAi458TmNS/uXTlRwHC5cKAzOltrn3voGFS7d+t78naIQC9wjaLKnw1L5nAI8PsCU4HDAPOjCw7eFLntRrtjDQw0dJxI/TQJCMTREAEJCcMmgfvdu42dee8JJOPC5Yoqn8huJcMgwO8LuIETgK8ieuPB70duWWDH0Asn5TN2TjET5ozholnFuKe4yC9xIQgCkWCc6OkYHXUhzhxqo+tYGOVItx31qXbvMz7I2ywArUCZosrRbNYzHAI+AK5bFLm5dn500dVJNdKjdJ6Pqx6+lOkrJmQ1T/P+Tg4+U0/DlpaM/QQkap3VVHo2AuxUVHlRNvNkRYDfF1gF/LYsMf3MHT33XJo/RCJZ8UQ5Vz1yaTb6mFC/8Sy7HzxCb6v1i026lIuP8jazz/0hwCpFldfalW+bAL8vUEIyK/v60a41/ghxjxvngD4iAkEilE4rZvk7VzNuTrFdPTIiFkyw/YeHOLblLA4kk8UlSCDi4vmiR4gIEYASRZU77cgWh+7Sjz8A4WsiCzUd3ZOPy9ShlziLls3i3i9vsrX4E5WtHF1/esh+rkIH/7B5PteuLkcCU4h04kTEYGF4+fm62oItAvy+wGTgTq9RpC6MLr5EQLTY6gw8Mz3M31yO6BpabO2LDVQu/YQP7qtlx49rbSlb8btyLr+3zGQByV3D4LuJucyMzwb4Z78vMMmOTLsW8BAQuy28Mm2EFZ0i9+9daEvYwUcb2P3TI/0U1m1o5K8/2Gtr7MJX53DRlb60z2/pXd7350N25A1JgN8XcAE/8hre0PTEZdPSiVm6eT55Y8xuMRjv/+QQu3/92YAs0UCj8f1ONl67Dy2mDylj2XvXILmtVS8wPExPzAS42+8LOC07DdB8aNwGSDdEbo6bvQ9A4PL7LmbKreOHFLR9SQ1fvHIaJ5JJhoFO08ff8D+BHajHQxnl5Ptd/ODNKy2fGQgs7l0G4AGWDKWTHQKWArFAfHah1fIll8iC567IKCDWneD1ebs4WnUGZ8at0yB0Ksbrs/bQvD9zEJ9++wTGBAotn5XoY/DpYyBZjMkIOwRUlGllMYfhKrCygInfK8FdnN7Sws1RXrtiJ0pNEBHBRpprkIhobKzYx5ldrRl7Tr7Rn0YCzEi6wQK/L+DJJMMOAaUXJ6Y5nEiWp7uJ149NO7C1RuUv8z8i2BixMc1AGOhsWrSf+r+kr31MXZre7crjswCmAnMyzWOHgNDExGTJKt0VMLj45lLLQac3t/HGvF10NWb25/QwEAyRqjtr+PiROsseZbeMx+1zWtpUygUgWYdMCzsEuHzGGGHwJAk0nPlOLrrCnPAcfaWRyhUHEBBHWBNI7u8Hnqxn5301lj3GzfUimoIq59cUJ2eawQ4B4XyjwBS5JES8l3iQCgaKOPLyaap+coAYiZwWRL5c38TeX5ktoXhqIWDeOp24+/60DhQp2CEg5jJcZooRKfCbI3rjzlZcOBBzXA1KkKDtow5Te1FpHpqFE0hGv8oZg6Cde4Fe0px4BdHc/L0/zKZoeiExNcbJba0EG3ttTJEekluk/IeTkPIl5q4252GCaJ2dOM8d1DJuO3YIKIkT093kDWgUMYj0aKbOBRe5ue7pcgC2/uOBERPg9DpY9N9z0j7vCWo4MDDSW1zGyoodAvLCYk/cqxUNyHMNBEKnw0l+08wdD5kJ6kP+ODeSKznQMKCnyXqrNDSDeI+Gs8DCC4FwYxg9lWEMmJt4358Z7xDsEKCflc5GS7UJBYMf9LbFaP9CZdwsnw0x5zDvP6dR8eRMJGcyBBmGwfG/NrPtnz4dwmDNaP6kk8GDBASCQn+1/Fim8XaCYHuH1IRuOgAnc7qze2zVHQag/F8mIbnE/ttBQRSYccd3cHqs33I6KEe6CTVFTAYYJ4HqaAXoAD7NJMMOATXHHF86tdSebFKiVrWn7Xno/SZuaouHEpZBNRNOVrVa6hQnwQlHA8D/KqrclkmGHQL+3il2aEGxs9FqXz9Z1YqhZ2e3Vv0NPRkLssHJLS2YA5CAWxD5zHkQkrdHGWGHgEogsdf9gWEVaXtaohxcc9yGmNyivbaLpv3mvEBA53Pn532Z4Kah5AxJQKq4+P4RV22JiB62ekn7H60jbrElalHr4oYeN7cbumHZX4vqlhaz/ceH0+pc7foIoMpOYdRuSWydgeHa49qtamhIg4bpCdh6e7VpkJXiAuA0Z9ZILhHDghitV0sGzPNw8DcNtH+uDpKbdNAGsZF2qQng+aEWBdmVxfdLSPOe7nop2kKb1zMoMRIwmHFXGbe+8d3+to5jIQ78ph4tlAyhIjC+YgxzV09DsDhfNvythboNZ+jza1EUuOyeSUy95dyx97Pf1/P31fVIDLQ4DQ0Dkbe962iQGk4pqnxJrglYAfzphuiC2JWRJWPzBsWD5AIFbnzqCmb9Yqotmdmi+Z12/rxyP4JF3hciStDRyPqCdQA/UlT5NTsybd8LKKr8LlDzseuTggKL80XyFt+g6peHqX5q2LfVaXGqqoXXVn6Y9sMiL4Vsy9sK0Gp38ZDdxQjAizEh1lPj2hlL18GNg08erqNyxQFaqrNPkgaj+1SYvT//kneXVOPEaUp5kxDoFptoSfr+6mzkD+dytBqY/e/dj0sFRt6QqfTMuydx1S8vxTfDm9U80a44Nc83UP24PGRfHZG1hU/SKXbWK6ocyGae4RAwH9g+NXFZ9K6eu0vtGtElS8Yz/fYJlC0uxTsx37JPpDPG2Q87OFHZzFdvNxELJiz7Dcanrn1sz98CcLWiyubtKAOG+4HEJmDxvaFV7aXalCnZZPCCKFA83UNRmQePP1m1iQYTdJ/uoftED/GeoS9G+mAAMSHOs0UPA7yjqPLKLFRJ6jNMArxAl4QUXN39sDPf8Hqyy+KTIRPOP033SbCvj4HOOu/vaJdaNKBYUeWerNQg+yAIgKLKIeBfNbTidzxvugSLmlxmnFukMKAtm5chcMC9l3apBeCe4SwehkkAgKLKG4DdZxzHHfUOGXDkuAqYHgYQEmLsynsPYFdKl2Fh2ASksBxIbCrYQI+okL7+kzv0ZZRvF6xFQ0sAt49E3ogIUFS5G1ipofFH70uA+ZyfWxgYSGz0bOCs9DXASkWVu0YicaQWgKLKm4H1XUIXW/O2ESGGY+RiTZAQiQIHnbuQnV8ArE/NPSLkRFNFle8Dvvrc/TG6o5MuRvT1qiW66MEhJtjh2QbwVWrOESOXr2ohwO8LXqBDNNfpRgaBBDFe8j4zYK5cIGcEKKrcCCxPkOBPhc+gC9nfCGfCW4Wv0i10A6xIzZUT5NRZFVXeAjwOsL5gLSqxEV2RORCJEmNT/pu0i60AT+TC789HzqOVosqPAZUtUjOH83cQJmH729/B6CTMGVcdda7DAFsVVf5VLnWFUfrJDIDfF6gHZtwQuZWK6PWWV9hD4ZDjEO8VvAXJoDeyT07TIPf71TlUAME9eVUcdx7FyIIAAWiTWvoWH0zJGhWMGgGKKivA9QAbPa9zQjpOmGjGbwYkRGLEaRXbWOftr2len5I1KhhNCyD1I4alAH/2rsWQetEzJMxR4kiCwbrC5/qalg33hxB2MaoEACiqXAncD/Bf3qdQxG/QLE6PAgYtQhdPFz3S1/SAosp/G239Rp0AAEWVXwV+DvBK4bOEhZDJFRLEeKOw3+wfUlR53YXQ7YIQAKCo8hpgDcALRb8mLJw7vifQeK7oCeJCDGCNosrPWEvJPUZtG0wHvy/wAvAgwH90P4aAyMuFz9GTvM9/UVHln15IfS44AQB+X+AlYJWQqvIbyZiwVlHlVRdal2+FAAC/L/Ay8EDqv+sUVX4gU//RwrdGAIDfF3gWQFHln31bOvwfX7MkK809f/0AAAAASUVORK5CYII=",up="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPI0lEQVR4nMWbe3RU1b3HP/uceWXymoRJQgiIEDGiolARWx/XFz56W7Raq9d6XeqqVltb8d1aqtfWKmpRsFitovVZH3i92qVYpMq1YrHVoghCOEh4hIS8TpKTZPKYmXP2vn/MZMIwk8zkxf2ulbWyf3vv3/79vmefvX+/vc8IpRTjiWCgaipwAjAXOBooB8oAf7xJGGgFGoBtwBfA303L2DKuhsUhxouAYKDqEuAa4DRAH4GKdcALwErTMjrG0LQkjDkBwUDVdcBPgKP6Zb7pXnKOd5NfmUtOuQ+9XEfP0RCAjCrsNgfZKumsCdG9Kay6P+8Vslf2G9YCPAk8bFpG+5gayxgSEAxUnQ08AMwG0As0yhYUU3hGHt5KD7rjwtEclJAIJZL6KhRSKtzChdQkdpcdsT9XzXVrGrtCH/XmAEEgBNxjWsZjY2JwHGNCQDBQ9QhwQ0wjTLpmAhPOL0L4BZoQMNwhNIHjOACodvVxwxMtG1rXdM4CjgE+Aa42LaNu1IYzSgKCgapy4E1gHkDwO0WUXBTAO8mDAJQYHblCCRAghcKxnJU776iv7anuuxAIABeblvH+qAZgFAQEA1UzgQ+AUi1PMOO/DsE/14ca9uPOHkrJvtBfe5+vWVx/KnA4cJlpGS+PRueICAgGqmYAnwF5vmkeDl0yEX9RLlI4o7ElIxQKTWi0r+l8bvd9DecAE4FLTct4ZaQ6h01AMFBVCHwFlOj5GrNWHobm0XF0O2VxGwrx2Q0q9qq4HBdKKBzNGVJPv73tq7rW1j7UOBcoAE43LeODYTkSx0gI+BSYm1PpZco9ZfjLfVn1O8I/g9n5x1LhLSfflU8uflAQ0aOEot20qBaMnq/4R8unREU0C8MF7a+Gqnc/UT+D2DJbYVpGy7CcAVzDaRwMVD1ALKJjxqOTwZPhSWlwUsHXuaBkAXPyj808wAQwy1pZ0/Y+T+97HiTouo5EprYVUPK9wMyG6sa94Q+dycA7wPHD8QeGMQOCgapZwCaAiT8qliXfK9Zcmk66/rrU8bl83Db1Bk4OnDhcmwBoiDTyx6YXWNO0Frfmir8vyVACfL25csPFX4TsLlkALDQt43fDGWc4BGwCZvln5TDjkQo0oaVd74USHFF4OL+auohiV1FKva1szGgrTZFmpJLku/Kp8JaTo+WkHffJlqd5o3YVUW2w10IQqYl0bL16VwExmgpNy+jMyimyJCAYqPo28Jaep3H065VKeETK8xBA1HGYX3Qav6y8PUXH6y1/Zp21nn3hRtqibUl1eXouQXeQWXlHcUnZhUz0lCXV/6vzc241fonLpaW1T0rBrtv3Wl0begLA46Zl/DijU/12Z0nAVmDmxCuCzsQrAzokGyIQ2NLhxKITuHf6XUl1W7qqWV7/B3b07YIsxtLQuGzixVxRflmSfEPX59y6fRG6lppXKSDaEu3YevEuP+AGirPNG9JTuh+CgarjgZkARefmOZrjTmnjSIdc4U9x/q+N73PzjkXs6N2ZlfMAEskLDa9wX+1DSfLj8ufwzSnnEHGiKaG1BuQW5RX6TnC3xkXXZTUYWRAAXAuQc4w76irTPUpLdaQvEuGuI3+WJFsdepflO1fgZLGlpUDA38yPuG37oiTx7aULKRUlSD3ZBgU4IkrFzSUasfOFH2Q7VDYEXABQ+f2pEk2gxAFbkoJvlMxjnm9uQrSu5SOW7XyK7tzQ8BOhOBxhs7FvK0tqHkmS3z/zbkSaLcF22RSWFZYWzMhtByqDgaqKbMYZkoBgoGoeUKz5NMRc5XGlO9cQcP3ka5JES/c9huOEETL7yDAdlGPzbtdaNnZuSsgO81dSrpeltNWUhqNscuZ5mgAJVGYzRqYZ8G8Avtle6RWe1AVTQKV7OtN9hyZE6zv/SacMjVlSpJRkyb7lSbKTCk+IBQEHQHdc5Mz29G8xX8tGfyYCZgPknKA5mkwNGjWlMX/SaUmyJ/Y+xYjnPfAfZRcxr+C4JFlDbyPr2tcnyvNLT0MJlZIz6Gi4j3QFgQiQrGQQZCKgEqC0okT2+npTKoXUODbv6ER5S2gb9ZHGbMZN1QX858RLuXrSFdxXeTdlB8QCfzbfTvw/wzuDUm8QoZLNj7gi5PvypxM7PRqTV6AMQFQIqdupTW09SqEqTJQ3dH4GqTFSRghgQfBbXFn+/YTsxaNW4I9Hh0JBi92a1Odw32E4up2sRwmkkDqxc8TSbMbOREABoPQCPW07N258ujdRrgvXD7rfD0aLAM6dcDY3TEneuv/U+DIRFU006rF7cNTAeUOJuwQtvfk24InbnhGZCPACSnhESjslFV7di1cbIKDdsVIUzM2fw9MzH+M7pedzYAghgLOK53PLIT9Nkq/Y9xzPNryMrQaecFiGCctIojzBV4jtpM0SFdBDLCLMiEzpsASUEGlWNQFImVQhDuBzfvHp/HzqzQBcX3E1jrJ5q3lV4jBkQfBbKU/+d3V/4O3mVYNPmTgyhPCR+F9GZJoBPYCSUWUfWCGEIKyiRPZ7KgF38qw7OvfIpPINk6/j+MK5aMDc/Lkpzq9seZO3m1eRLnzwal68midRbg934kr/ZkKMvq6hHOtHJgJaAWSvk5ZNW9n0yoHdYapvMmq/rWnZ3t/zbuvapD53TvsZ55cs4M5pyRnju23vs6Lu6bTOKwV+PQddDARiTdFmZPpZ4CZGgDW0azFkIqAO0MKN0XC6OalLF02qOVE+ueCklE1gSe3S2OlOHDmaj+sn/xC/PpD/P9XwAg/tWTaoEULAtJxpSbLqnm1IKQ9oJ5CO7AaKiN01ZkQmAqoBEdkSRempC47UbYyOHYny1JxDmOabktRGAa80vZYyE/rxbvtaXm1YGVtsBjFCAP8+4ZxEeVuPQXu0A11LNj9q23ikp4bY9r0tg29AZgI+BYS1MeRLd8ehlOK91g+SZFdMujwlFlDEZsKatmQS1rT/L0t2L00X1Q5AQIm/jHkFA5Ht+60fpm2qC4G1OdRNbPf61xBaE8hEwFqA7i/6/EoKqeSBLAh29u1kW8/2hOTkwq9TIooQaUj47Z6lfNzxCQAfd37Kb3c9nDloVvDz8huTRB91/j19UwG9W/qK48XqTKohAwGmZTQCG5wex9W5trsbdxpzBSyuXZIkuu+wX6HrHqSW/Noo4M6d9/BQ7XLurPn1kE9eKLBzFFdNvJxjCgbC7XXWeswDjtQgdrcghEbbaiuf2Pa9cyjf+pHNecDzgGh5tc2b/mgWarp288F+03Ja7qHcMX0h+d35pDtAWd26JuOg0gXz9NlcVn5xkvyBmqVpYwAhBLLD2di7L+IFVpuWEco4CNkR8CxAaHuvJ7JX2inhHOAWLh5pfCJJdmruKdw89SdIJFKppEOMTNNeaYozgqfy4IzfJMmXNC6nS4bShttKwr5nze3ErtKXZeEXkAUB8SPmFQAtr5launnr0l1YfRa31dxJVA4cgZ1acTKPVT7MGaWnIONxfCbnK/3TuLbsKhZNujVJvrrtPVbV/QW3y5V2kXXa7G2tb3YcB9QN59Y421PhEqAZYNYbh0mVrzSXnnw6JADbcSj3lPPSMU+n6Kju3s7a9g/4tHMDdeF9SXWFrgJm+o/g9KJTOLP4tJS+rzW9wfI9T+Bxp4b3Simi0qHhppZ17Zu7TgQuMC3jrYxO9ds9jIuR3wCL8o7yUfnoVIRSg8brs/KP5K5D76DIFUhb3xhpSroYOcQ7Gc9+Ye7+eKl1JSt2P5ey5/dDKYjW9jZvvXJvLlBtWsawrseGdTkaDFTVARWTf1qiSi4qFqnbYgyOlBS48rht6o2cHPjGcOxJoD7cwIr6Z/jQWo+AlG0VQAiFQldfnr8jZHfY+UClaRlZrf4JHcMkYA6x7wI44oXp+Ka4B83/VXyGfC1/DsflH8uZRadS4ikZUr9C8bf2j/isayOr297DURKUSut83Hy2/2h3b8+2cA5wk2kZy7J2pl/DCK7HbwSW6kUaM146hJwcb6bUNAYlmF14NEf6j2CKdwpF7kIEgj4Zpq6vnj3hPWzq3kpDb+MQDvcbDVKDhudaZPMz7RrwlmkZ5w3LkYSukX0h8jpwYekpxZTeXYQutIxGA0gpEULE/uILiCL2hB3HiddpZNorpEsR/iyKsXA3xJKeCtMyRnQSO5pvhGqBKcE78imfX4bb5UrJzsYDCohIm+0LduP0SICjTMvYOlJ92QRCg+FMAHNxF2KvTl84PApV2UEJEJqi9qr6fud/MBrnYRQEmJbxFXA5wJbrvkIzddRo6MwATWjYMsqeJ1vorg0DPGdaxh9HrXc0nU3LeBF40umT7HyqFrf0ZuwzUkSiEcQmjfY/WQDbTMu4ciz0jvqZmZZxLbC5Z22E0FshvLYPeeAF6iighAIlEO1uttyyE2LLwPyx0j9Wk/YswNn28C7qv2zAa4/dTNCljoODce8OlKMALjQto36s9I8JAaZlNAHnAdTd2oKv15+hR3ZQKLyRHJofbSXyhQOxL8bfHBPlcYzZsmVaxjvA/Tjw5e+r0bWs7iWGhCY1GjY30vQ/7QD/NC3jllErPXCMsVRmWsYdwLr21SEaXmmJJUwjhECgt7vZs7gBYvcTZ4+RmUkYj43rm0DnvsebCX3Zi8p0xTMINOFi8y3bULHTr3OH8+nbsMYZa4WmZXQD5wDsurcJpeyswuT9oRDsur+W8B4b4BemZawbazv7MS6hi2kZ/wAetJuitDzYQaivJ+u+0qXo+zJM2+ougL+YlrF4PGzsxzjGbvwCaGxYbWI+1YbQspsFkYYINYv2QizJGVGGNxyMGwGmZTjEF672/+6md6eNbafcsQ5AgNIlu67bh93pQOxnMUN0GBuM5wzAtIzNwA8Bam7ag78vN+2X35rQkMpm96PNhNuiEPup3DvjaVti7PEewLSMFcCLUcvm88Vb8Nn+lHS/NxxGVWt0rOwE2G1axiXjbVc/xp0AANMyLge2R9dLGp9pwSNj+YJCoRSIao3NP05csp5xMGzqx0EhII6zAGpfaqCppgV/JBdd6SCh+v6a/jaXmpax6yDadPAIMC2jFvguQO3CBpy+KJ6oj85nQqjYl3WPj+bHTyPFuP12eDAEA1XLgIXF5xWQe0YOe29sAthoWsacg2pIHAedAIBgoOoTBn7fEyF2qGkedEM4uGvA/tg/sVnw/+U8wP8BirtMKB0OWwYAAAAASUVORK5CYII=",dp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPDElEQVR4nMWbeZyUxZnHv/W+b3dPz9kwjYKoC4pOUNF4g3hsDIrBAOpKjEfcKJFNVtd4xGvXuCresuvGENe4q0ZX+BDXZI26XjEBjcixHjAgwwvI6SDDvDPzTs/0Md3vW7V/dE8f0z3MO0MP/v5636rnfep5fl1VT9VT1UIpxXAiHGqoAr4NnApMAg4DxgKVGZEEsBtoBtYBnwDvWLYZGVbDMhDDRUA41PAt4ApgNjBqkJ+3A/8LLLZs8+1y25aPshMQDjWcB9wHTOktGyl8TPHVcrJRq47RK8Vo4ade86EjcFDYyqFF9qgNbkysdrpY6XTSJlO9n38M3GHZ5p/LamgGZSMgHGqoBx4HruktO8NXo+b4R6sZvnoRFJrwqiuqXN5y2nk50cJKJzsSXgJutWxzb1kMzqAsBIRDDZcCzwAjAM4UdVwbOEROq6zTUNrQlCpAwLtOB/8Ra2aVGwGIAPMs2/ztfhudwX4TEA413AU8BKixWkA+XjWBqb4aHWEgpCLtyf5jqdOhbuzeLDqVA3C9ZZtPlUPvfhEQDjXcCjwG9Jyq17ovVk+sqNJ0A0G5/M5CCWiVydS1kSbZKKN+4BbLNv9tf/UOmYBwqOE24H7AutY/1rmvctw4JYY3pCohEFIyL2pG3k61+4E7Ldv8xf7oHBIB4VDDVcCTwPa7q8bVzguMORLlYY4TvV1DUSCfT9xAejLVD8W/3PV0fOcI4BrLNl8ZlAP56gZLQDjUMAlYBnRcZhzU/tjIo08VKTnAV+k2jLMmoZ3xDbSJ4yBcg6gKoCJxaO3CbdyKXN6E++nGgUkApB5kdseKdWvd2HjgRMs2twzKkQyGQsB6QB9HMLis/riDNeWr2Nd4FwfXYcw+C+OyMxFHHDygfrl+F86S93FfW47qSvQrp4SBK3rap7St3tWCarZs88JBOdJr32AICIcapgOLqoTuaxw5FUMka4WjZbtlXxj/MBP/9TMh4Bu0YcqO4jz6MqklH/QjIJGGj4jytx7f9qcu4GrLNpcPtp3BErAVGPOrim+surC25hwt6e8zfkHpAjRJ4MG5GN87q6Qe2bgN9WUbMhpFq6lFHB5GO+awkrKpZ94m+ejLCBS4FJKtQAYcft62e/l/OV/WWLZ5gmdnMvBMQDjUMA9YUIeINo46p1Y4qcqiWCdAS4H/pdvRzplYUCU/34n78kc4yz5B7bIyhYCW1qEdMRbjvBPRLp2KduSYgm/dJctI3vECSqdEeNVIGXRMbP0wmYSbLNtc4smhXpMHQUAzUPemb2LLMSNHHKEli2Ucv0HNL65HXPDNXGE8Sc8NC3GXNqJQiH2sDJUGQoI+83QCT/64oE6+9Bei9z+Lnuo73gTSr/PG3i+23KCapWWbDZ4cysDTOjUcapgBjKwVvo5ja+uP0JLFpEmlqPy7aQXOq72dJGbch7O0EZRIOy8oWh2rzDZBZIKJ+/oqEnMehp7shgjtqrPwnzkJKfu2rdBSMK3ukFHA2HCoofS46wdeF+rzAOOiyvo4UtJ31lNCoI2ow7jhklxZNEHPzHuRO5oRvWFNgKirJHDtBQQW30HFnx4m8NxN+K88F/r0RPl/m4hf9nBBWeDB66CmBlSfsCuTBLWKusm+kUngRx59Sps00BAIhxoqgDbA/2HtSa2H6xVj+spIw6Fq4Z2I6cdmyxKz7kOu214oWBcg+NbDiDEjitqRa7cRn/MQIuVkyxTgO+8U/M9cnyt79k1ij7yCcHolcliWau++untjCghbtjnQ4gTw1gPOBowRwtd9uBEoch4h0MeOKXDeff6PyMbtBWJKdwg+fWdJ5wG0E8YTXDAX5eacEkDPn5uQ767Ilc2dgagLFUafjPQU38igDiFgsge/0u16kDkDcC/QRrkl471S+K6eVlCUXPDfhYs5BcY3GxCTx+WK1jaRevF9VHNbzphZk9FqKsgfYpqM4iwsTAoZZx5dcrMVEJo+VauAvGTMQPBCwCRA++vK6hiyH/FJ47OP8oM1yFhRuEY7+tDce1uE+MX/QureF0nMvh/iuZCinXwU+cNSKEiu+wq1aVeu7LRjShihQLlMSo/QQzz4lW7Pg8w4QByrVSdL0S6EQD9idPbdff1D0PU+QoCeo0S1RzMPLqotgkrkCBA1lfRtR+g67qvLsu/6aRP6MVVQi1RA3YBeZWB4kBkFGKOEv6KoRoGYMBpRX5Mtcta0IJwYiBy3AlAd0ey7dtQYjGunIVc0YcyejBhRna1zm3YiROFYE04M57M9WWO18aMRdVWozih9UScMAVQXVfQDLwRUA4kKoVUV1QjgsFzCV3XFUTv2FDjfC2d5E/68d//d3y+SUa2dyC++oih9KDTU1t25d11DHB5GrSsmIJju1IF9u5SDlyFgkM7dF+1olC7QjTwOIzHIC2MFsh3dOP/03D4bcu5+PpMzKIFYDyRzuoXhzy6g8qGnZx+9qKIfeOkBvfG0eAJQoNy8cBvwgSagaLWW9qtn0fu4HSl8s09HTD4q3Y1bO1GrttCzaCnyo/XFv34vfDroeb+XdIsjYc5IT2sA8EZAAhAuShmIgrElXInsyB3giPoaxEEjUXssSu2RhdBw31kBhsA3/qA0ATssUn9Yjlq5D+chvX7II0C2dRatHgFS6QCcKqroB14IsIH6pJIJQ/TtWQK1bW/6F9cECIH2V9W4LRFQxTb4fnIhxnXTESNyk6Z2ypEETrkR1WyRevpNnEXvg+qz71XAhLw1WGcMtbu9pLEJ5QLEPfiVbt+DTDMQaIVu1bdnCaAjgms2Z4uM70xGGX1m8doggadvxHf7pQXOF8iMDeOffzX++d9DVeUHHAmGhu+752RLnNUbEW6JXq4UXeknz+eKXgj4HAh+HNvmoFcWVUo9CJty6Tj9sm8jkon0CkYBPqh4az769BMLbe2MIjc3Q6JwX21cOZ3g83egMrl1pVWgjfShn5db/KgPPkHqJaKyXsGeHgvSexdP8ELAB4DxB5moTnfNQggk7ntrcwUVPvTTjkfpoJQicNV3EIfU5+pbu0jc/AyJqbeSOP9u4lNvpefu3xRMnNqp4/FNPQ6lK5TuYFzwrYI2ZeOXCIptQUk+VEmAlR78SrflQeYtwF3mRMIRp8sumtxUiuTb62BrS7Yo8O8/AkeBpqHfcXFOdP0m4rMeRv7PClQ0/cur9ijOomX0zHwMtu7MyvoX/hhcHc0nMG6bldOxahPOhmaQfecYQaNjsVkmosAfvbnvgQDLNqPAy0DVU9FtUaX3WWMoEErSc/uiXFl9HcEH5mL8zRm5hGjCIX71c8iWXRkOVVaBQJDa9DmJGxfndIQqMS46neCvb4GaYLY4ftdvEG6KopyEHuCJ7m0AL1m2WXoxUgKeUmLhUMNEYEO98MU/HXFqsDj+arhCUf3KLYiTjiupw12+jp4fPFEydAEoJRGaj8rPfgl1wZIy8qUPiN3zLFqflJISgpjrMLFzFcA4yzZ3DOhU1nIPsGyzCXijTaWCi2N7Y0rrOwNLdCmJ3fV7aOksbfzG3fs8LxRCA1yclZ+XFti8k9gTi9BkiUWecFkQ+xLSFyo8Ow/eU2KQTotxV2JL0HJcJ5vAyxohUFu2k5wxv3RDRx0CQYN0XkxlokTeMyDqqtFG1xd/HImRmPHPCNstToRIxSa3h2dTzQA3DMKfdJuDPBe4B7hvdkW9Wlh5lFBF2c30/sA493gCv/5penGUX90WwX33M+TyJuTOVlRXN6KuFm38QWhnH4sx7cSC8Q6guuP0XP447oYdCNct3isIOL9rLRtT0ZuHclo8lKOxBBBYXDlJTa2oFqKfczwxbjT+e69AP2fSYG3KwnltFamHlqBa7JL1Sih+H2vl5sSWrZZtHjmUNoZCwFzgPwWwJnwSI9wA/Z6NAfqcs/D/7BLEQSHPbajtLSQf/C3ue5/1LyRgu+rh7I5PAGZatvmG5wby1QzxePwt4IKLfGGeqGtAdwfQEfBhXDwFY9ZktJMmlDwrVJEY6uNNOK+uwHl99cBGSMn06DqanOjvLNu8dNBOZDBUAgJAK1CzIDiBOcGDEQPpydz5ESNr0CYciqipQAV0RMJBdcaRG3egov2fBhcYLRULU7vVo7EdrcBoyzaHfDNjf26ITAE+AlgbOpmQqEgfYHprNRMSRW5W93LBIv0FK2W3O6ezUQdOsGyzcbC252OIV7jAss0VwN0Av+xpRvoc7/eClCA7byjh2XkAdMHN3aYG3Ly/zkN5boltBBqeMY7j/LpKNOklxTAUuEhfDTdZ63lV7llq2ea55dA65B6QhysB5jnr6VAuw3X1Vhq1vNixilflHoAflkvvfhNg2eYnwG0Af9u1Gemvy6z3y0SEAoWi3a8zP9UF8BPLNncO9JlXlPOq7GvAzO/7qnik9jg0GQA8b8r6hyZIJl3OjnzKbpFcYtnm5fuvNE99GXXNBr5akoryUbwHpZeHWIVgfnIbu0VyW7mdhzISkInF5wJcEVtDxLBzG56hQAGa4N1UOy/0tNCru9woZw/Ass2NwM8B5lk7UY4BRVtnb1C6oLknwXWRDQA/tGxze9kMzUNZCQCwbPMBYMMKp5OnkrtRPq3fJMi+IH0VzI1uBPjUss0Xym1nL8pOQAbnAu6jiS9YG2tHDWoYCCQaD7StYYOKxhmmrt+LYSHAss0W4EKAWV1NRANVKGEwcGhUoFew1LV5NtUGMN2yzdIppjJhuHoAlm2+A8wHuK5jNSoZZ8AzS6HTnrS5LvI5pG+C/2W47OvFsBEAYNnmPcDHy1OdLHZ2ICtKnwr1wg2M4PKuNTioNy3bfHQ4bevFsBKQwQ8A/jGxl13xCIpS1z0VUhgssNfTlD58ufIA2AUcAAIyofGnABdFVpNUMVSfCxRK01mR+IpfxbcBzLVs0x5uu3pxIHoAlm0+CfyuTaa4v3szyhfKqxUoo5q/j20GeMGyzX3foigzhu2Pk6UQDjXsAg7915qjuUQbiaZpCBTXdG/ivVTbZss2jz5gxmRwQHpAHqYB3NK1iXaRwtU0no7v5r10yJu270+HBweUAMs2TeBnAA/GdrIp1c1jiZ0AV5RzizsYHNAh0ItwqGEb6fuHAI1D+aNDuXCgh0Avzst7/u7XZAPwNfUAgHCo4V4gYdnmI1+LARn8P0TdSRGR8ht7AAAAAElFTkSuQmCC";(function(r,t,e){function i(n,s){for(;(n=n.parentElement)&&!n.classList.contains(s););return n}L.drawVersion="1.0.4",L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes",text:"Save"},cancel:{title:"Cancel editing, discards all changes",text:"Cancel"},clearAll:{title:"Clear all layers",text:"Clear All"}},buttons:{edit:"Edit layers",editDisabled:"No layers to edit",remove:"Delete layers",removeDisabled:"No layers to delete"}},handlers:{edit:{tooltip:{text:"Drag handles or markers to edit features.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove."}}}}},L.Draw.Event={},L.Draw.Event.CREATED="draw:created",L.Draw.Event.EDITED="draw:edited",L.Draw.Event.DELETED="draw:deleted",L.Draw.Event.DRAWSTART="draw:drawstart",L.Draw.Event.DRAWSTOP="draw:drawstop",L.Draw.Event.DRAWVERTEX="draw:drawvertex",L.Draw.Event.EDITSTART="draw:editstart",L.Draw.Event.EDITMOVE="draw:editmove",L.Draw.Event.EDITRESIZE="draw:editresize",L.Draw.Event.EDITVERTEX="draw:editvertex",L.Draw.Event.EDITSTOP="draw:editstop",L.Draw.Event.DELETESTART="draw:deletestart",L.Draw.Event.DELETESTOP="draw:deletestop",L.Draw.Event.TOOLBAROPENED="draw:toolbaropened",L.Draw.Event.TOOLBARCLOSED="draw:toolbarclosed",L.Draw.Event.MARKERCONTEXT="draw:markercontext",L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({initialize:function(n,s){this._map=n,this._container=n._container,this._overlayPane=n._panes.overlayPane,this._popupPane=n._panes.popupPane,s&&s.shapeOptions&&(s.shapeOptions=L.Util.extend({},this.options.shapeOptions,s.shapeOptions)),L.setOptions(this,s);var a=L.version.split(".");parseInt(a[0],10)===1&&parseInt(a[1],10)>=2?L.Draw.Feature.include(L.Evented.prototype):L.Draw.Feature.include(L.Mixin.Events)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(L.DomUtil.disableTextSelection(),n.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,"keyup",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,"keyup",this._cancelDrawing,this))},setOptions:function(n){L.setOptions(this,n)},_fireCreatedEvent:function(n){this._map.fire(L.Draw.Event.CREATED,{layer:n,layerType:this.type})},_cancelDrawing:function(n){n.keyCode===27&&(this._map.fire("draw:canceled",{layerType:this.type}),this.disable())}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:"polyline"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},initialize:function(n,s){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,s&&s.drawError&&(s.drawError=L.Util.extend({},this.options.drawError,s.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,n,s)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("mouseout",this._onMouseOut,this).on("mousemove",this._onMouseMove,this).on("mousedown",this._onMouseDown,this).on("mouseup",this._onMouseUp,this).addTo(this._map),this._map.on("mouseup",this._onMouseUp,this).on("mousemove",this._onMouseMove,this).on("zoomlevelschange",this._onZoomEnd,this).on("touchstart",this._onTouch,this).on("zoomend",this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._clearHideErrorTimeout(),this._cleanUpShape(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,this._map.removeLayer(this._poly),delete this._poly,this._mouseMarker.off("mousedown",this._onMouseDown,this).off("mouseout",this._onMouseOut,this).off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._clearGuides(),this._map.off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this).off("zoomlevelschange",this._onZoomEnd,this).off("zoomend",this._onZoomEnd,this).off("touchstart",this._onTouch,this).off("click",this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var n=this._markers.pop(),s=this._poly,a=s.getLatLngs(),h=a.splice(-1,1)[0];this._poly.setLatLngs(a),this._markerGroup.removeLayer(n),s.getLatLngs().length<2&&this._map.removeLayer(s),this._vertexChanged(h,!1)}},addVertex:function(n){if(this._markers.length>=2&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(n))return void this._showErrorTooltip();this._errorShown&&this._hideErrorTooltip(),this._markers.push(this._createMarker(n)),this._poly.addLatLng(n),this._poly.getLatLngs().length===2&&this._map.addLayer(this._poly),this._vertexChanged(n,!0)},completeShape:function(){this._markers.length<=1||!this._shapeIsValid()||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_finishShape:function(){var n=this._poly._defaultShape?this._poly._defaultShape():this._poly.getLatLngs(),s=this._poly.newLatLngIntersects(n[n.length-1]);if(!this.options.allowIntersection&&s||!this._shapeIsValid())return void this._showErrorTooltip();this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_shapeIsValid:function(){return!0},_onZoomEnd:function(){this._markers!==null&&this._updateGuide()},_onMouseMove:function(n){var s=this._map.mouseEventToLayerPoint(n.originalEvent),a=this._map.layerPointToLatLng(s);this._currentLatLng=a,this._updateTooltip(a),this._updateGuide(s),this._mouseMarker.setLatLng(a),L.DomEvent.preventDefault(n.originalEvent)},_vertexChanged:function(n,s){this._map.fire(L.Draw.Event.DRAWVERTEX,{layers:this._markerGroup}),this._updateFinishHandler(),this._updateRunningMeasure(n,s),this._clearGuides(),this._updateTooltip()},_onMouseDown:function(n){if(!this._clickHandled&&!this._touchHandled&&!this._disableMarkers){this._onMouseMove(n),this._clickHandled=!0,this._disableNewMarkers();var s=n.originalEvent,a=s.clientX,h=s.clientY;this._startPoint.call(this,a,h)}},_startPoint:function(n,s){this._mouseDownOrigin=L.point(n,s)},_onMouseUp:function(n){var s=n.originalEvent,a=s.clientX,h=s.clientY;this._endPoint.call(this,a,h,n),this._clickHandled=null},_endPoint:function(n,s,a){if(this._mouseDownOrigin){var h=L.point(n,s).distanceTo(this._mouseDownOrigin),c=this._calculateFinishDistance(a.latlng);this.options.maxPoints>1&&this.options.maxPoints==this._markers.length+1?(this.addVertex(a.latlng),this._finishShape()):c<10&&L.Browser.touch?this._finishShape():Math.abs(h)<9*(r.devicePixelRatio||1)&&this.addVertex(a.latlng),this._enableNewMarkers()}this._mouseDownOrigin=null},_onTouch:function(n){var s,a,h=n.originalEvent;!h.touches||!h.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(s=h.touches[0].clientX,a=h.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,s,a),this._endPoint.call(this,s,a,n),this._touchHandled=null),this._clickHandled=null},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_calculateFinishDistance:function(n){var s;if(this._markers.length>0){var a;if(this.type===L.Draw.Polyline.TYPE)a=this._markers[this._markers.length-1];else{if(this.type!==L.Draw.Polygon.TYPE)return 1/0;a=this._markers[0]}var h=this._map.latLngToContainerPoint(a.getLatLng()),c=new L.Marker(n,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),d=this._map.latLngToContainerPoint(c.getLatLng());s=h.distanceTo(d)}else s=1/0;return s},_updateFinishHandler:function(){var n=this._markers.length;n>1&&this._markers[n-1].on("click",this._finishShape,this),n>2&&this._markers[n-2].off("click",this._finishShape,this)},_createMarker:function(n){var s=new L.Marker(n,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(s),s},_updateGuide:function(n){var s=this._markers?this._markers.length:0;s>0&&(n=n||this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[s-1].getLatLng()),n))},_updateTooltip:function(n){var s=this._getTooltipText();n&&this._tooltip.updatePosition(n),this._errorShown||this._tooltip.updateContent(s)},_drawGuide:function(n,s){var a,h,c,d=Math.floor(Math.sqrt(Math.pow(s.x-n.x,2)+Math.pow(s.y-n.y,2))),f=this.options.guidelineDistance,p=this.options.maxGuideLineLength,_=d>p?d-p:f;for(this._guidesContainer||(this._guidesContainer=L.DomUtil.create("div","leaflet-draw-guides",this._overlayPane));_<d;_+=this.options.guidelineDistance)a=_/d,h={x:Math.floor(n.x*(1-a)+a*s.x),y:Math.floor(n.y*(1-a)+a*s.y)},c=L.DomUtil.create("div","leaflet-draw-guide-dash",this._guidesContainer),c.style.backgroundColor=this._errorShown?this.options.drawError.color:this.options.shapeOptions.color,L.DomUtil.setPosition(c,h)},_updateGuideColor:function(n){if(this._guidesContainer)for(var s=0,a=this._guidesContainer.childNodes.length;s<a;s++)this._guidesContainer.childNodes[s].style.backgroundColor=n},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var n,s,a=this.options.showLength;return this._markers.length===0?n={text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(s=a?this._getMeasurementString():"",n=this._markers.length===1?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:s}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:s}),n},_updateRunningMeasure:function(n,s){var a,h,c=this._markers.length;this._markers.length===1?this._measurementRunningTotal=0:(a=c-(s?2:1),h=L.GeometryUtil.isVersion07x()?n.distanceTo(this._markers[a].getLatLng())*(this.options.factor||1):this._map.distance(n,this._markers[a].getLatLng())*(this.options.factor||1),this._measurementRunningTotal+=h*(s?1:-1))},_getMeasurementString:function(){var n,s=this._currentLatLng,a=this._markers[this._markers.length-1].getLatLng();return n=L.GeometryUtil.isVersion07x()?a&&s&&s.distanceTo?this._measurementRunningTotal+s.distanceTo(a)*(this.options.factor||1):this._measurementRunningTotal||0:a&&s?this._measurementRunningTotal+this._map.distance(s,a)*(this.options.factor||1):this._measurementRunningTotal||0,L.GeometryUtil.readableDistance(n,this.options.metric,this.options.feet,this.options.nautic,this.options.precision)},_showErrorTooltip:function(){this._errorShown=!0,this._tooltip.showAsError().updateContent({text:this.options.drawError.message}),this._updateGuideColor(this.options.drawError.color),this._poly.setStyle({color:this.options.drawError.color}),this._clearHideErrorTimeout(),this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1,this._clearHideErrorTimeout(),this._tooltip.removeError().updateContent(this._getTooltipText()),this._updateGuideColor(this.options.shapeOptions.color),this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&(clearTimeout(this._hideErrorTimeout),this._hideErrorTimeout=null)},_disableNewMarkers:function(){this._disableMarkers=!0},_enableNewMarkers:function(){setTimeout((function(){this._disableMarkers=!1}).bind(this),50)},_cleanUpShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off("click",this._finishShape,this)},_fireCreatedEvent:function(){var n=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)}}),L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:"polygon"},Poly:L.Polygon,options:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},initialize:function(n,s){L.Draw.Polyline.prototype.initialize.call(this,n,s),this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var n=this._markers.length;n===1&&this._markers[0].on("click",this._finishShape,this),n>2&&(this._markers[n-1].on("dblclick",this._finishShape,this),n>3&&this._markers[n-2].off("dblclick",this._finishShape,this))},_getTooltipText:function(){var n,s;return this._markers.length===0?n=L.drawLocal.draw.handlers.polygon.tooltip.start:this._markers.length<3?(n=L.drawLocal.draw.handlers.polygon.tooltip.cont,s=this._getMeasurementString()):(n=L.drawLocal.draw.handlers.polygon.tooltip.end,s=this._getMeasurementString()),{text:n,subtext:s}},_getMeasurementString:function(){var n=this._area,s="";return n||this.options.showLength?(this.options.showLength&&(s=L.Draw.Polyline.prototype._getMeasurementString.call(this)),n&&(s+="<br>"+L.GeometryUtil.readableArea(n,this.options.metric,this.options.precision)),s):null},_shapeIsValid:function(){return this._markers.length>=3},_vertexChanged:function(n,s){var a;!this.options.allowIntersection&&this.options.showArea&&(a=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(a)),L.Draw.Polyline.prototype._vertexChanged.call(this,n,s)},_cleanUpShape:function(){var n=this._markers.length;n>0&&(this._markers[0].off("click",this._finishShape,this),n>2&&this._markers[n-1].off("dblclick",this._finishShape,this))}}),L.SimpleShape={},L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(n,s){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end,L.Draw.Feature.prototype.initialize.call(this,n,s)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor="crosshair",this._tooltip.updateContent({text:this._initialLabelText}),this._map.on("mousedown",this._onMouseDown,this).on("mousemove",this._onMouseMove,this).on("touchstart",this._onMouseDown,this).on("touchmove",this._onMouseMove,this),t.addEventListener("touchstart",L.DomEvent.preventDefault,{passive:!1}))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor="",this._map.off("mousedown",this._onMouseDown,this).off("mousemove",this._onMouseMove,this).off("touchstart",this._onMouseDown,this).off("touchmove",this._onMouseMove,this),L.DomEvent.off(t,"mouseup",this._onMouseUp,this),L.DomEvent.off(t,"touchend",this._onMouseUp,this),t.removeEventListener("touchstart",L.DomEvent.preventDefault),this._shape&&(this._map.removeLayer(this._shape),delete this._shape)),this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(n){this._isDrawing=!0,this._startLatLng=n.latlng,L.DomEvent.on(t,"mouseup",this._onMouseUp,this).on(t,"touchend",this._onMouseUp,this).preventDefault(n.originalEvent)},_onMouseMove:function(n){var s=n.latlng;this._tooltip.updatePosition(s),this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(s))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()}}),L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:"rectangle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showArea:!0,metric:!0},initialize:function(n,s){this.type=L.Draw.Rectangle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,n,s)},disable:function(){this._enabled&&(this._isCurrentlyTwoClickDrawing=!1,L.Draw.SimpleShape.prototype.disable.call(this))},_onMouseUp:function(n){if(!this._shape&&!this._isCurrentlyTwoClickDrawing)return void(this._isCurrentlyTwoClickDrawing=!0);this._isCurrentlyTwoClickDrawing&&!i(n.target,"leaflet-pane")||L.Draw.SimpleShape.prototype._onMouseUp.call(this)},_drawShape:function(n){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,n)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,n),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var n=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,n)},_getTooltipText:function(){var n,s,a,h=L.Draw.SimpleShape.prototype._getTooltipText.call(this),c=this._shape,d=this.options.showArea;return c&&(n=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),s=L.GeometryUtil.geodesicArea(n),a=d?L.GeometryUtil.readableArea(s,this.options.metric):""),{text:h.text,subtext:a}}}),L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:"marker"},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(n,s){this.type=L.Draw.Marker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.marker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,n,s)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._tooltip.updateContent({text:this._initialLabelText}),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("click",this._onClick,this).addTo(this._map),this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._map.off("click",this._onClick,this).off("click",this._onTouch,this),this._marker&&(this._marker.off("click",this._onClick,this),this._map.removeLayer(this._marker),delete this._marker),this._mouseMarker.off("click",this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off("mousemove",this._onMouseMove,this))},_onMouseMove:function(n){var s=n.latlng;this._tooltip.updatePosition(s),this._mouseMarker.setLatLng(s),this._marker?(s=this._mouseMarker.getLatLng(),this._marker.setLatLng(s)):(this._marker=this._createMarker(s),this._marker.on("click",this._onClick,this),this._map.on("click",this._onClick,this).addLayer(this._marker))},_createMarker:function(n){return new L.Marker(n,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset})},_onClick:function(){this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_onTouch:function(n){this._onMouseMove(n),this._onClick()},_fireCreatedEvent:function(){var n=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)}}),L.Draw.CircleMarker=L.Draw.Marker.extend({statics:{TYPE:"circlemarker"},options:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0,zIndexOffset:2e3},initialize:function(n,s){this.type=L.Draw.CircleMarker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circlemarker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,n,s)},_fireCreatedEvent:function(){var n=new L.CircleMarker(this._marker.getLatLng(),this.options);L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)},_createMarker:function(n){return new L.CircleMarker(n,this.options)}}),L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:"circle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},initialize:function(n,s){this.type=L.Draw.Circle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,n,s)},_drawShape:function(n){if(L.GeometryUtil.isVersion07x())var s=this._startLatLng.distanceTo(n);else var s=this._map.distance(this._startLatLng,n);this._shape?this._shape.setRadius(s):(this._shape=new L.Circle(this._startLatLng,s,this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var n=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,n)},_onMouseMove:function(n){var s,a=n.latlng,h=this.options.showRadius,c=this.options.metric;if(this._tooltip.updatePosition(a),this._isDrawing){this._drawShape(a),s=this._shape.getRadius().toFixed(1);var d="";h&&(d=L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(s,c,this.options.feet,this.options.nautic)),this._tooltip.updateContent({text:this._endLabelText,subtext:d})}}}),L.Edit=L.Edit||{},L.Edit.Marker=L.Handler.extend({initialize:function(n,s){this._marker=n,L.setOptions(this,s)},addHooks:function(){var n=this._marker;n.dragging.enable(),n.on("dragend",this._onDragEnd,n),this._toggleMarkerHighlight()},removeHooks:function(){var n=this._marker;n.dragging.disable(),n.off("dragend",this._onDragEnd,n),this._toggleMarkerHighlight()},_onDragEnd:function(n){var s=n.target;s.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:s})},_toggleMarkerHighlight:function(){var n=this._marker._icon;n&&(n.style.display="none",L.DomUtil.hasClass(n,"leaflet-edit-marker-selected")?(L.DomUtil.removeClass(n,"leaflet-edit-marker-selected"),this._offsetMarker(n,-4)):(L.DomUtil.addClass(n,"leaflet-edit-marker-selected"),this._offsetMarker(n,4)),n.style.display="")},_offsetMarker:function(n,s){var a=parseInt(n.style.marginTop,10)-s,h=parseInt(n.style.marginLeft,10)-s;n.style.marginTop=a+"px",n.style.marginLeft=h+"px"}}),L.Marker.addInitHook(function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.Poly=L.Handler.extend({initialize:function(n){this.latlngs=[n._latlngs],n._holes&&(this.latlngs=this.latlngs.concat(n._holes)),this._poly=n,this._poly.on("revert-edited",this._updateLatLngs,this)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._poly._latlngs)?this._poly._latlngs:this._poly._latlngs[0]:this._poly._latlngs},_eachVertexHandler:function(n){for(var s=0;s<this._verticesHandlers.length;s++)n(this._verticesHandlers[s])},addHooks:function(){this._initHandlers(),this._eachVertexHandler(function(n){n.addHooks()})},removeHooks:function(){this._eachVertexHandler(function(n){n.removeHooks()})},updateMarkers:function(){this._eachVertexHandler(function(n){n.updateMarkers()})},_initHandlers:function(){this._verticesHandlers=[];for(var n=0;n<this.latlngs.length;n++)this._verticesHandlers.push(new L.Edit.PolyVerticesEdit(this._poly,this.latlngs[n],this._poly.options.poly))},_updateLatLngs:function(n){this.latlngs=[n.layer._latlngs],n.layer._holes&&(this.latlngs=this.latlngs.concat(n.layer._holes))}}),L.Edit.PolyVerticesEdit=L.Handler.extend({options:{icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),drawError:{color:"#b00b00",timeout:1e3}},initialize:function(n,s,a){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this._poly=n,a&&a.drawError&&(a.drawError=L.Util.extend({},this.options.drawError,a.drawError)),this._latlngs=s,L.setOptions(this,a)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]:this._latlngs},addHooks:function(){var n=this._poly,s=n._path;n instanceof L.Polygon||(n.options.fill=!1,n.options.editing&&(n.options.editing.fill=!1)),s&&n.options.editing&&n.options.editing.className&&(n.options.original.className&&n.options.original.className.split(" ").forEach(function(a){L.DomUtil.removeClass(s,a)}),n.options.editing.className.split(" ").forEach(function(a){L.DomUtil.addClass(s,a)})),n.setStyle(n.options.editing),this._poly._map&&(this._map=this._poly._map,this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var n=this._poly,s=n._path;s&&n.options.editing&&n.options.editing.className&&(n.options.editing.className.split(" ").forEach(function(a){L.DomUtil.removeClass(s,a)}),n.options.original.className&&n.options.original.className.split(" ").forEach(function(a){L.DomUtil.addClass(s,a)})),n.setStyle(n.options.original),n._map&&(n._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._markers=[];var n,s,a,h,c=this._defaultShape();for(n=0,a=c.length;n<a;n++)h=this._createMarker(c[n],n),h.on("click",this._onMarkerClick,this),h.on("contextmenu",this._onContextMenu,this),this._markers.push(h);var d,f;for(n=0,s=a-1;n<a;s=n++)(n!==0||L.Polygon&&this._poly instanceof L.Polygon)&&(d=this._markers[s],f=this._markers[n],this._createMiddleMarker(d,f),this._updatePrevNext(d,f))},_createMarker:function(n,s){var a=new L.Marker.Touch(n,{draggable:!0,icon:this.options.icon});return a._origLatLng=n,a._index=s,a.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._fireEdit,this).on("touchmove",this._onTouchMove,this).on("touchend",this._fireEdit,this).on("MSPointerMove",this._onTouchMove,this).on("MSPointerUp",this._fireEdit,this),this._markerGroup.addLayer(a),a},_onMarkerDragStart:function(){this._poly.fire("editstart")},_spliceLatLngs:function(){var n=this._defaultShape(),s=[].splice.apply(n,arguments);return this._poly._convertLatLngs(n,!0),this._poly.redraw(),s},_removeMarker:function(n){var s=n._index;this._markerGroup.removeLayer(n),this._markers.splice(s,1),this._spliceLatLngs(s,1),this._updateIndexes(s,-1),n.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._fireEdit,this).off("touchmove",this._onMarkerDrag,this).off("touchend",this._fireEdit,this).off("click",this._onMarkerClick,this).off("MSPointerMove",this._onTouchMove,this).off("MSPointerUp",this._fireEdit,this)},_fireEdit:function(){this._poly.edited=!0,this._poly.fire("edit"),this._poly._map.fire(L.Draw.Event.EDITVERTEX,{layers:this._markerGroup,poly:this._poly})},_onMarkerDrag:function(n){var s=n.target,a=this._poly,h=L.LatLngUtil.cloneLatLng(s._origLatLng);if(L.extend(s._origLatLng,s._latlng),a.options.poly){var c=a._map._editTooltip;if(!a.options.poly.allowIntersection&&a.intersects()){L.extend(s._origLatLng,h),s.setLatLng(h);var d=a.options.color;a.setStyle({color:this.options.drawError.color}),c&&c.updateContent({text:L.drawLocal.draw.handlers.polyline.error}),setTimeout(function(){a.setStyle({color:d}),c&&c.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext})},1e3)}}s._middleLeft&&s._middleLeft.setLatLng(this._getMiddleLatLng(s._prev,s)),s._middleRight&&s._middleRight.setLatLng(this._getMiddleLatLng(s,s._next)),this._poly._bounds._southWest=L.latLng(1/0,1/0),this._poly._bounds._northEast=L.latLng(-1/0,-1/0);var f=this._poly.getLatLngs();this._poly._convertLatLngs(f,!0),this._poly.redraw(),this._poly.fire("editdrag")},_onMarkerClick:function(n){var s=L.Polygon&&this._poly instanceof L.Polygon?4:3,a=n.target;this._defaultShape().length<s||(this._removeMarker(a),this._updatePrevNext(a._prev,a._next),a._middleLeft&&this._markerGroup.removeLayer(a._middleLeft),a._middleRight&&this._markerGroup.removeLayer(a._middleRight),a._prev&&a._next?this._createMiddleMarker(a._prev,a._next):a._prev?a._next||(a._prev._middleRight=null):a._next._middleLeft=null,this._fireEdit())},_onContextMenu:function(n){var s=n.target;this._poly,this._poly._map.fire(L.Draw.Event.MARKERCONTEXT,{marker:s,layers:this._markerGroup,poly:this._poly}),L.DomEvent.stopPropagation},_onTouchMove:function(n){var s=this._map.mouseEventToLayerPoint(n.originalEvent.touches[0]),a=this._map.layerPointToLatLng(s),h=n.target;L.extend(h._origLatLng,a),h._middleLeft&&h._middleLeft.setLatLng(this._getMiddleLatLng(h._prev,h)),h._middleRight&&h._middleRight.setLatLng(this._getMiddleLatLng(h,h._next)),this._poly.redraw(),this.updateMarkers()},_updateIndexes:function(n,s){this._markerGroup.eachLayer(function(a){a._index>n&&(a._index+=s)})},_createMiddleMarker:function(n,s){var a,h,c,d=this._getMiddleLatLng(n,s),f=this._createMarker(d);f.setOpacity(.6),n._middleRight=s._middleLeft=f,h=function(){f.off("touchmove",h,this);var p=s._index;f._index=p,f.off("click",a,this).on("click",this._onMarkerClick,this),d.lat=f.getLatLng().lat,d.lng=f.getLatLng().lng,this._spliceLatLngs(p,0,d),this._markers.splice(p,0,f),f.setOpacity(1),this._updateIndexes(p,1),s._index++,this._updatePrevNext(n,f),this._updatePrevNext(f,s),this._poly.fire("editstart")},c=function(){f.off("dragstart",h,this),f.off("dragend",c,this),f.off("touchmove",h,this),this._createMiddleMarker(n,f),this._createMiddleMarker(f,s)},a=function(){h.call(this),c.call(this),this._fireEdit()},f.on("click",a,this).on("dragstart",h,this).on("dragend",c,this).on("touchmove",h,this),this._markerGroup.addLayer(f)},_updatePrevNext:function(n,s){n&&(n._next=s),s&&(s._prev=n)},_getMiddleLatLng:function(n,s){var a=this._poly._map,h=a.project(n.getLatLng()),c=a.project(s.getLatLng());return a.unproject(h._add(c)._divideBy(2))}}),L.Polyline.addInitHook(function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))}),L.Edit=L.Edit||{},L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move"}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize"}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon"}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon"})},initialize:function(n,s){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon),this._shape=n,L.Util.setOptions(this,s)},addHooks:function(){var n=this._shape;this._shape._map&&(this._map=this._shape._map,n.setStyle(n.options.editing),n._map&&(this._map=n._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var n=this._shape;if(n.setStyle(n.options.original),n._map){this._unbindMarker(this._moveMarker);for(var s=0,a=this._resizeMarkers.length;s<a;s++)this._unbindMarker(this._resizeMarkers[s]);this._resizeMarkers=null,this._map.removeLayer(this._markerGroup),delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._createMoveMarker(),this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(n,s){var a=new L.Marker.Touch(n,{draggable:!0,icon:s,zIndexOffset:10});return this._bindMarker(a),this._markerGroup.addLayer(a),a},_bindMarker:function(n){n.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._onMarkerDragEnd,this).on("touchstart",this._onTouchStart,this).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onTouchEnd,this).on("MSPointerUp",this._onTouchEnd,this)},_unbindMarker:function(n){n.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._onMarkerDragEnd,this).off("touchstart",this._onTouchStart,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onTouchEnd,this).off("MSPointerUp",this._onTouchEnd,this)},_onMarkerDragStart:function(n){n.target.setOpacity(0),this._shape.fire("editstart")},_fireEdit:function(){this._shape.edited=!0,this._shape.fire("edit")},_onMarkerDrag:function(n){var s=n.target,a=s.getLatLng();s===this._moveMarker?this._move(a):this._resize(a),this._shape.redraw(),this._shape.fire("editdrag")},_onMarkerDragEnd:function(n){n.target.setOpacity(1),this._fireEdit()},_onTouchStart:function(n){if(L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,n),typeof this._getCorners=="function"){var s=this._getCorners(),a=n.target,h=a._cornerIndex;a.setOpacity(0),this._oppositeCorner=s[(h+2)%4],this._toggleCornerMarkers(0,h)}this._shape.fire("editstart")},_onTouchMove:function(n){var s=this._map.mouseEventToLayerPoint(n.originalEvent.touches[0]),a=this._map.layerPointToLatLng(s);return n.target===this._moveMarker?this._move(a):this._resize(a),this._shape.redraw(),!1},_onTouchEnd:function(n){n.target.setOpacity(1),this.updateMarkers(),this._fireEdit()},_move:function(){},_resize:function(){}}),L.Edit=L.Edit||{},L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var n=this._shape.getBounds(),s=n.getCenter();this._moveMarker=this._createMarker(s,this.options.moveIcon)},_createResizeMarker:function(){var n=this._getCorners();this._resizeMarkers=[];for(var s=0,a=n.length;s<a;s++)this._resizeMarkers.push(this._createMarker(n[s],this.options.resizeIcon)),this._resizeMarkers[s]._cornerIndex=s},_onMarkerDragStart:function(n){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,n);var s=this._getCorners(),a=n.target,h=a._cornerIndex;this._oppositeCorner=s[(h+2)%4],this._toggleCornerMarkers(0,h)},_onMarkerDragEnd:function(n){var s,a,h=n.target;h===this._moveMarker&&(s=this._shape.getBounds(),a=s.getCenter(),h.setLatLng(a)),this._toggleCornerMarkers(1),this._repositionCornerMarkers(),L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,n)},_move:function(n){for(var s,a=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),h=this._shape.getBounds(),c=h.getCenter(),d=[],f=0,p=a.length;f<p;f++)s=[a[f].lat-c.lat,a[f].lng-c.lng],d.push([n.lat+s[0],n.lng+s[1]]);this._shape.setLatLngs(d),this._repositionCornerMarkers(),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})},_resize:function(n){var s;this._shape.setBounds(L.latLngBounds(n,this._oppositeCorner)),s=this._shape.getBounds(),this._moveMarker.setLatLng(s.getCenter()),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})},_getCorners:function(){var n=this._shape.getBounds();return[n.getNorthWest(),n.getNorthEast(),n.getSouthEast(),n.getSouthWest()]},_toggleCornerMarkers:function(n){for(var s=0,a=this._resizeMarkers.length;s<a;s++)this._resizeMarkers[s].setOpacity(n)},_repositionCornerMarkers:function(){for(var n=this._getCorners(),s=0,a=this._resizeMarkers.length;s<a;s++)this._resizeMarkers[s].setLatLng(n[s])}}),L.Rectangle.addInitHook(function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.CircleMarker=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var n=this._shape.getLatLng();this._moveMarker=this._createMarker(n,this.options.moveIcon)},_createResizeMarker:function(){this._resizeMarkers=[]},_move:function(n){if(this._resizeMarkers.length){var s=this._getResizeMarkerPoint(n);this._resizeMarkers[0].setLatLng(s)}this._shape.setLatLng(n),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})}}),L.CircleMarker.addInitHook(function(){L.Edit.CircleMarker&&(this.editing=new L.Edit.CircleMarker(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),L.Edit=L.Edit||{},L.Edit.Circle=L.Edit.CircleMarker.extend({_createResizeMarker:function(){var n=this._shape.getLatLng(),s=this._getResizeMarkerPoint(n);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(s,this.options.resizeIcon))},_getResizeMarkerPoint:function(n){var s=this._shape._radius*Math.cos(Math.PI/4),a=this._map.project(n);return this._map.unproject([a.x+s,a.y-s])},_resize:function(n){var s=this._moveMarker.getLatLng();L.GeometryUtil.isVersion07x()?radius=s.distanceTo(n):radius=this._map.distance(s,n),this._shape.setRadius(radius),this._map.editTooltip&&this._map._editTooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.subtext+"<br />"+L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(radius,!0,this.options.feet,this.options.nautic)}),this._shape.setRadius(radius),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})}}),L.Circle.addInitHook(function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable())}),L.Map.mergeOptions({touchExtend:!0}),L.Map.TouchExtend=L.Handler.extend({initialize:function(n){this._map=n,this._container=n._container,this._pane=n._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.on(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.on(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.on(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.on(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.on(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.on(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.on(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.on(this._container,"touchleave",this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.off(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.off(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.off(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.off(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.off(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.off(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.off(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.off(this._container,"touchleave",this._onTouchLeave,this))},_touchEvent:function(n,s){var a={};if(n.touches!==void 0){if(!n.touches.length)return;a=n.touches[0]}else if(n.pointerType!=="touch"||(a=n,!this._filterClick(n)))return;var h=this._map.mouseEventToContainerPoint(a),c=this._map.mouseEventToLayerPoint(a),d=this._map.layerPointToLatLng(c);this._map.fire(s,{latlng:d,layerPoint:c,containerPoint:h,pageX:a.pageX,pageY:a.pageY,originalEvent:n})},_filterClick:function(n){var s=n.timeStamp||n.originalEvent.timeStamp,a=L.DomEvent._lastClick&&s-L.DomEvent._lastClick;return a&&a>100&&a<500||n.target._simulatedClick&&!n._simulated?(L.DomEvent.stop(n),!1):(L.DomEvent._lastClick=s,!0)},_onTouchStart:function(n){this._map._loaded&&this._touchEvent(n,"touchstart")},_onTouchEnd:function(n){this._map._loaded&&this._touchEvent(n,"touchend")},_onTouchCancel:function(n){if(this._map._loaded){var s="touchcancel";this._detectIE()&&(s="pointercancel"),this._touchEvent(n,s)}},_onTouchLeave:function(n){this._map._loaded&&this._touchEvent(n,"touchleave")},_onTouchMove:function(n){this._map._loaded&&this._touchEvent(n,"touchmove")},_detectIE:function(){var n=r.navigator.userAgent,s=n.indexOf("MSIE ");if(s>0)return parseInt(n.substring(s+5,n.indexOf(".",s)),10);if(n.indexOf("Trident/")>0){var a=n.indexOf("rv:");return parseInt(n.substring(a+3,n.indexOf(".",a)),10)}var h=n.indexOf("Edge/");return h>0&&parseInt(n.substring(h+5,n.indexOf(".",h)),10)}}),L.Map.addInitHook("addHandler","touchExtend",L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){return this.addInteractiveTarget?L.Marker.prototype._initInteraction.apply(this):this._initInteractionLegacy()},_initInteractionLegacy:function(){if(this.options.clickable){var n=this._icon,s=["dblclick","mousedown","mouseover","mouseout","contextmenu","touchstart","touchend","touchmove"];this._detectIE?s.concat(["MSPointerDown","MSPointerUp","MSPointerMove","MSPointerCancel"]):s.concat(["touchcancel"]),L.DomUtil.addClass(n,"leaflet-clickable"),L.DomEvent.on(n,"click",this._onMouseClick,this),L.DomEvent.on(n,"keypress",this._onKeyPress,this);for(var a=0;a<s.length;a++)L.DomEvent.on(n,s[a],this._fireMouseEvent,this);L.Handler.MarkerDrag&&(this.dragging=new L.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_detectIE:function(){var n=r.navigator.userAgent,s=n.indexOf("MSIE ");if(s>0)return parseInt(n.substring(s+5,n.indexOf(".",s)),10);if(n.indexOf("Trident/")>0){var a=n.indexOf("rv:");return parseInt(n.substring(a+3,n.indexOf(".",a)),10)}var h=n.indexOf("Edge/");return h>0&&parseInt(n.substring(h+5,n.indexOf(".",h)),10)}}),L.LatLngUtil={cloneLatLngs:function(n){for(var s=[],a=0,h=n.length;a<h;a++)Array.isArray(n[a])?s.push(L.LatLngUtil.cloneLatLngs(n[a])):s.push(this.cloneLatLng(n[a]));return s},cloneLatLng:function(n){return L.latLng(n.lat,n.lng)}},function(){var n={km:2,ha:2,m:0,mi:2,ac:2,yd:0,ft:0,nm:2};L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(s){var a,h,c=s.length,d=0,f=Math.PI/180;if(c>2){for(var p=0;p<c;p++)a=s[p],h=s[(p+1)%c],d+=(h.lng-a.lng)*f*(2+Math.sin(a.lat*f)+Math.sin(h.lat*f));d=6378137*d*6378137/2}return Math.abs(d)},formattedNumber:function(s,a){var h=parseFloat(s).toFixed(a),c=L.drawLocal.format&&L.drawLocal.format.numeric,d=c&&c.delimiters,f=d&&d.thousands,p=d&&d.decimal;if(f||p){var _=h.split(".");h=f?_[0].replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f):_[0],p=p||".",_.length>1&&(h=h+p+_[1])}return h},readableArea:function(s,a,f){var c,d,f=L.Util.extend({},n,f);return a?(d=["ha","m"],type=typeof a,type==="string"?d=[a]:type!=="boolean"&&(d=a),c=s>=1e6&&d.indexOf("km")!==-1?L.GeometryUtil.formattedNumber(1e-6*s,f.km)+" km²":s>=1e4&&d.indexOf("ha")!==-1?L.GeometryUtil.formattedNumber(1e-4*s,f.ha)+" ha":L.GeometryUtil.formattedNumber(s,f.m)+" m²"):(s/=.836127,c=s>=3097600?L.GeometryUtil.formattedNumber(s/3097600,f.mi)+" mi²":s>=4840?L.GeometryUtil.formattedNumber(s/4840,f.ac)+" acres":L.GeometryUtil.formattedNumber(s,f.yd)+" yd²"),c},readableDistance:function(s,a,h,c,p){var f,p=L.Util.extend({},n,p);switch(a?typeof a=="string"?a:"metric":h?"feet":c?"nauticalMile":"yards"){case"metric":f=s>1e3?L.GeometryUtil.formattedNumber(s/1e3,p.km)+" km":L.GeometryUtil.formattedNumber(s,p.m)+" m";break;case"feet":s*=3.28083,f=L.GeometryUtil.formattedNumber(s,p.ft)+" ft";break;case"nauticalMile":s*=.53996,f=L.GeometryUtil.formattedNumber(s/1e3,p.nm)+" nm";break;case"yards":default:s*=1.09361,f=s>1760?L.GeometryUtil.formattedNumber(s/1760,p.mi)+" miles":L.GeometryUtil.formattedNumber(s,p.yd)+" yd"}return f},isVersion07x:function(){var s=L.version.split(".");return parseInt(s[0],10)===0&&parseInt(s[1],10)===7}})}(),L.Util.extend(L.LineUtil,{segmentsIntersect:function(n,s,a,h){return this._checkCounterclockwise(n,a,h)!==this._checkCounterclockwise(s,a,h)&&this._checkCounterclockwise(n,s,a)!==this._checkCounterclockwise(n,s,h)},_checkCounterclockwise:function(n,s,a){return(a.y-n.y)*(s.x-n.x)>(s.y-n.y)*(a.x-n.x)}}),L.Polyline.include({intersects:function(){var n,s,a,h=this._getProjectedPoints(),c=h?h.length:0;if(this._tooFewPointsForIntersection())return!1;for(n=c-1;n>=3;n--)if(s=h[n-1],a=h[n],this._lineSegmentsIntersectsRange(s,a,n-2))return!0;return!1},newLatLngIntersects:function(n,s){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(n),s)},newPointIntersects:function(n,s){var a=this._getProjectedPoints(),h=a?a.length:0,c=a?a[h-1]:null,d=h-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(c,n,d,s?1:0)},_tooFewPointsForIntersection:function(n){var s=this._getProjectedPoints(),a=s?s.length:0;return a+=n||0,!s||a<=3},_lineSegmentsIntersectsRange:function(n,s,a,h){var c,d,f=this._getProjectedPoints();h=h||0;for(var p=a;p>h;p--)if(c=f[p-1],d=f[p],L.LineUtil.segmentsIntersect(n,s,c,d))return!0;return!1},_getProjectedPoints:function(){if(!this._defaultShape)return this._originalPoints;for(var n=[],s=this._defaultShape(),a=0;a<s.length;a++)n.push(this._map.latLngToLayerPoint(s[a]));return n}}),L.Polygon.include({intersects:function(){var n,s,a,h,c=this._getProjectedPoints();return!this._tooFewPointsForIntersection()&&(!!L.Polyline.prototype.intersects.call(this)||(n=c.length,s=c[0],a=c[n-1],h=n-2,this._lineSegmentsIntersectsRange(a,s,h,1)))}}),L.Control.Draw=L.Control.extend({options:{position:"topleft",draw:{},edit:!1},initialize:function(n){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");L.Control.prototype.initialize.call(this,n);var s;this._toolbars={},L.DrawToolbar&&this.options.draw&&(s=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=s,this._toolbars[L.DrawToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(s=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=s,this._toolbars[L.EditToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.toolbar=this},onAdd:function(n){var s,a=L.DomUtil.create("div","leaflet-draw"),h=!1;for(var c in this._toolbars)this._toolbars.hasOwnProperty(c)&&(s=this._toolbars[c].addToolbar(n))&&(h||(L.DomUtil.hasClass(s,"leaflet-draw-toolbar-top")||L.DomUtil.addClass(s.childNodes[0],"leaflet-draw-toolbar-top"),h=!0),a.appendChild(s));return a},onRemove:function(){for(var n in this._toolbars)this._toolbars.hasOwnProperty(n)&&this._toolbars[n].removeToolbar()},setDrawingOptions:function(n){for(var s in this._toolbars)this._toolbars[s]instanceof L.DrawToolbar&&this._toolbars[s].setOptions(n)},_toolbarEnabled:function(n){var s=n.target;for(var a in this._toolbars)this._toolbars[a]!==s&&this._toolbars[a].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))}),L.Toolbar=L.Class.extend({initialize:function(n){L.setOptions(this,n),this._modes={},this._actionButtons=[],this._activeMode=null;var s=L.version.split(".");parseInt(s[0],10)===1&&parseInt(s[1],10)>=2?L.Toolbar.include(L.Evented.prototype):L.Toolbar.include(L.Mixin.Events)},enabled:function(){return this._activeMode!==null},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(n){var s,a=L.DomUtil.create("div","leaflet-draw-section"),h=0,c=this._toolbarClass||"",d=this.getModeHandlers(n);for(this._toolbarContainer=L.DomUtil.create("div","leaflet-draw-toolbar leaflet-bar"),this._map=n,s=0;s<d.length;s++)d[s].enabled&&this._initModeHandler(d[s].handler,this._toolbarContainer,h++,c,d[s].title);if(h)return this._lastButtonIndex=--h,this._actionsContainer=L.DomUtil.create("ul","leaflet-draw-actions"),a.appendChild(this._toolbarContainer),a.appendChild(this._actionsContainer),a},removeToolbar:function(){for(var n in this._modes)this._modes.hasOwnProperty(n)&&(this._disposeButton(this._modes[n].button,this._modes[n].handler.enable,this._modes[n].handler),this._modes[n].handler.disable(),this._modes[n].handler.off("enabled",this._handlerActivated,this).off("disabled",this._handlerDeactivated,this));this._modes={};for(var s=0,a=this._actionButtons.length;s<a;s++)this._disposeButton(this._actionButtons[s].button,this._actionButtons[s].callback,this);this._actionButtons=[],this._actionsContainer=null},_initModeHandler:function(n,s,a,h,c){var d=n.type;this._modes[d]={},this._modes[d].handler=n,this._modes[d].button=this._createButton({type:d,title:c,className:h+"-"+d,container:s,callback:this._modes[d].handler.enable,context:this._modes[d].handler}),this._modes[d].buttonIndex=a,this._modes[d].handler.on("enabled",this._handlerActivated,this).on("disabled",this._handlerDeactivated,this)},_detectIOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!r.MSStream},_createButton:function(n){var s=L.DomUtil.create("a",n.className||"",n.container),a=L.DomUtil.create("span","sr-only",n.container);s.href="#",s.appendChild(a),n.title&&(s.title=n.title,a.innerHTML=n.title),n.text&&(s.innerHTML=n.text,a.innerHTML=n.text);var h=this._detectIOS()?"touchstart":"click";return L.DomEvent.on(s,"click",L.DomEvent.stopPropagation).on(s,"mousedown",L.DomEvent.stopPropagation).on(s,"dblclick",L.DomEvent.stopPropagation).on(s,"touchstart",L.DomEvent.stopPropagation).on(s,"click",L.DomEvent.preventDefault).on(s,h,n.callback,n.context),s},_disposeButton:function(n,s){var a=this._detectIOS()?"touchstart":"click";L.DomEvent.off(n,"click",L.DomEvent.stopPropagation).off(n,"mousedown",L.DomEvent.stopPropagation).off(n,"dblclick",L.DomEvent.stopPropagation).off(n,"touchstart",L.DomEvent.stopPropagation).off(n,"click",L.DomEvent.preventDefault).off(n,a,s)},_handlerActivated:function(n){this.disable(),this._activeMode=this._modes[n.handler],L.DomUtil.addClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._showActionsToolbar(),this.fire("enable")},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._activeMode=null,this.fire("disable")},_createActions:function(n){var s,a,h,c,d=this._actionsContainer,f=this.getActions(n),p=f.length;for(a=0,h=this._actionButtons.length;a<h;a++)this._disposeButton(this._actionButtons[a].button,this._actionButtons[a].callback);for(this._actionButtons=[];d.firstChild;)d.removeChild(d.firstChild);for(var _=0;_<p;_++)"enabled"in f[_]&&!f[_].enabled||(s=L.DomUtil.create("li","",d),c=this._createButton({title:f[_].title,text:f[_].text,container:s,callback:f[_].callback,context:f[_].context}),this._actionButtons.push({button:c,callback:f[_].callback}))},_showActionsToolbar:function(){var n=this._activeMode.buttonIndex,s=this._lastButtonIndex,a=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=a+"px",n===0&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-top")),n===s&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-bottom")),this._actionsContainer.style.display="block",this._map.fire(L.Draw.Event.TOOLBAROPENED)},_hideActionsToolbar:function(){this._actionsContainer.style.display="none",L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-top"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-bottom"),this._map.fire(L.Draw.Event.TOOLBARCLOSED)}}),L.Draw=L.Draw||{},L.Draw.Tooltip=L.Class.extend({initialize:function(n){this._map=n,this._popupPane=n._panes.popupPane,this._visible=!1,this._container=n.options.drawControlTooltips?L.DomUtil.create("div","leaflet-draw-tooltip",this._popupPane):null,this._singleLineLabel=!1,this._map.on("mouseout",this._onMouseOut,this)},dispose:function(){this._map.off("mouseout",this._onMouseOut,this),this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(n){return this._container?(n.subtext=n.subtext||"",n.subtext.length!==0||this._singleLineLabel?n.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!0),this._container.innerHTML=(n.subtext.length>0?'<span class="leaflet-draw-tooltip-subtext">'+n.subtext+"</span><br />":"")+"<span>"+n.text+"</span>",n.text||n.subtext?(this._visible=!0,this._container.style.visibility="inherit"):(this._visible=!1,this._container.style.visibility="hidden"),this):this},updatePosition:function(n){var s=this._map.latLngToLayerPoint(n),a=this._container;return this._container&&(this._visible&&(a.style.visibility="inherit"),L.DomUtil.setPosition(a,s)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,"leaflet-error-draw-tooltip"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,"leaflet-error-draw-tooltip"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility="hidden")}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:"draw"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{},circlemarker:{}},initialize:function(n){for(var s in this.options)this.options.hasOwnProperty(s)&&n[s]&&(n[s]=L.extend({},this.options[s],n[s]));this._toolbarClass="leaflet-draw-draw",L.Toolbar.prototype.initialize.call(this,n)},getModeHandlers:function(n){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(n,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(n,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(n,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(n,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(n,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker},{enabled:this.options.circlemarker,handler:new L.Draw.CircleMarker(n,this.options.circlemarker),title:L.drawLocal.draw.toolbar.buttons.circlemarker}]},getActions:function(n){return[{enabled:n.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:n.completeShape,context:n},{enabled:n.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:n.deleteLastVertex,context:n},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(n){L.setOptions(this,n);for(var s in this._modes)this._modes.hasOwnProperty(s)&&n.hasOwnProperty(s)&&this._modes[s].handler.setOptions(n[s])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:"edit"},options:{edit:{selectedPathOptions:{dashArray:"10, 10",fill:!0,fillColor:"#fe57a1",fillOpacity:.1,maintainColor:!1}},remove:{},poly:null,featureGroup:null},initialize:function(n){n.edit&&(n.edit.selectedPathOptions===void 0&&(n.edit.selectedPathOptions=this.options.edit.selectedPathOptions),n.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,n.edit.selectedPathOptions)),n.remove&&(n.remove=L.extend({},this.options.remove,n.remove)),n.poly&&(n.poly=L.extend({},this.options.poly,n.poly)),this._toolbarClass="leaflet-draw-edit",L.Toolbar.prototype.initialize.call(this,n),this._selectedFeatureCount=0},getModeHandlers:function(n){var s=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(n,{featureGroup:s,selectedPathOptions:this.options.edit.selectedPathOptions,poly:this.options.poly}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(n,{featureGroup:s}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(n){var s=[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}];return n.removeAllLayers&&s.push({title:L.drawLocal.edit.toolbar.actions.clearAll.title,text:L.drawLocal.edit.toolbar.actions.clearAll.text,callback:this._clearAllLayers,context:this}),s},addToolbar:function(n){var s=L.Toolbar.prototype.addToolbar.call(this,n);return this._checkDisabled(),this.options.featureGroup.on("layeradd layerremove",this._checkDisabled,this),s},removeToolbar:function(){this.options.featureGroup.off("layeradd layerremove",this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode&&this._activeMode.handler.disable()},_clearAllLayers:function(){this._activeMode.handler.removeAllLayers(),this._activeMode&&this._activeMode.handler.disable()},_checkDisabled:function(){var n,s=this.options.featureGroup,a=s.getLayers().length!==0;this.options.edit&&(n=this._modes[L.EditToolbar.Edit.TYPE].button,a?L.DomUtil.removeClass(n,"leaflet-disabled"):L.DomUtil.addClass(n,"leaflet-disabled"),n.setAttribute("title",a?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(n=this._modes[L.EditToolbar.Delete.TYPE].button,a?L.DomUtil.removeClass(n,"leaflet-disabled"):L.DomUtil.addClass(n,"leaflet-disabled"),n.setAttribute("title",a?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:"edit"},initialize:function(n,s){if(L.Handler.prototype.initialize.call(this,n),L.setOptions(this,s),this._featureGroup=s.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE;var a=L.version.split(".");parseInt(a[0],10)===1&&parseInt(a[1],10)>=2?L.EditToolbar.Edit.include(L.Evented.prototype):L.EditToolbar.Edit.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.EDITSTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on("layeradd",this._enableLayerEdit,this).on("layerremove",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off("layeradd",this._enableLayerEdit,this).off("layerremove",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.EDITSTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(n.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),n._editTooltip=this._tooltip,this._updateTooltip(),this._map.on("mousemove",this._onMouseMove,this).on("touchmove",this._onMouseMove,this).on("MSPointerMove",this._onMouseMove,this).on(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this).off("touchmove",this._onMouseMove,this).off("MSPointerMove",this._onMouseMove,this).off(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},revertLayers:function(){this._featureGroup.eachLayer(function(n){this._revertLayer(n)},this)},save:function(){var n=new L.LayerGroup;this._featureGroup.eachLayer(function(s){s.edited&&(n.addLayer(s),s.edited=!1)}),this._map.fire(L.Draw.Event.EDITED,{layers:n})},_backupLayer:function(n){var s=L.Util.stamp(n);this._uneditedLayerProps[s]||(n instanceof L.Polyline||n instanceof L.Polygon||n instanceof L.Rectangle?this._uneditedLayerProps[s]={latlngs:L.LatLngUtil.cloneLatLngs(n.getLatLngs())}:n instanceof L.Circle?this._uneditedLayerProps[s]={latlng:L.LatLngUtil.cloneLatLng(n.getLatLng()),radius:n.getRadius()}:(n instanceof L.Marker||n instanceof L.CircleMarker)&&(this._uneditedLayerProps[s]={latlng:L.LatLngUtil.cloneLatLng(n.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(n){var s=L.Util.stamp(n);n.edited=!1,this._uneditedLayerProps.hasOwnProperty(s)&&(n instanceof L.Polyline||n instanceof L.Polygon||n instanceof L.Rectangle?n.setLatLngs(this._uneditedLayerProps[s].latlngs):n instanceof L.Circle?(n.setLatLng(this._uneditedLayerProps[s].latlng),n.setRadius(this._uneditedLayerProps[s].radius)):(n instanceof L.Marker||n instanceof L.CircleMarker)&&n.setLatLng(this._uneditedLayerProps[s].latlng),n.fire("revert-edited",{layer:n}))},_enableLayerEdit:function(n){var s,a,h=n.layer||n.target||n;this._backupLayer(h),this.options.poly&&(a=L.Util.extend({},this.options.poly),h.options.poly=a),this.options.selectedPathOptions&&(s=L.Util.extend({},this.options.selectedPathOptions),s.maintainColor&&(s.color=h.options.color,s.fillColor=h.options.fillColor),h.options.original=L.extend({},h.options),h.options.editing=s),h instanceof L.Marker?(h.editing&&h.editing.enable(),h.dragging.enable(),h.on("dragend",this._onMarkerDragEnd).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onMarkerDragEnd,this).on("MSPointerUp",this._onMarkerDragEnd,this)):h.editing.enable()},_disableLayerEdit:function(n){var s=n.layer||n.target||n;s.edited=!1,s.editing&&s.editing.disable(),delete s.options.editing,delete s.options.original,this._selectedPathOptions&&(s instanceof L.Marker?this._toggleMarkerHighlight(s):(s.setStyle(s.options.previousOptions),delete s.options.previousOptions)),s instanceof L.Marker?(s.dragging.disable(),s.off("dragend",this._onMarkerDragEnd,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onMarkerDragEnd,this).off("MSPointerUp",this._onMarkerDragEnd,this)):s.editing.disable()},_onMouseMove:function(n){this._tooltip.updatePosition(n.latlng)},_onMarkerDragEnd:function(n){var s=n.target;s.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:s})},_onTouchMove:function(n){var s=n.originalEvent.changedTouches[0],a=this._map.mouseEventToLayerPoint(s),h=this._map.layerPointToLatLng(a);n.target.setLatLng(h)},_hasAvailableLayers:function(){return this._featureGroup.getLayers().length!==0}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:"remove"},initialize:function(n,s){if(L.Handler.prototype.initialize.call(this,n),L.Util.setOptions(this,s),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this.type=L.EditToolbar.Delete.TYPE;var a=L.version.split(".");parseInt(a[0],10)===1&&parseInt(a[1],10)>=2?L.EditToolbar.Delete.include(L.Evented.prototype):L.EditToolbar.Delete.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on("layeradd",this._enableLayerDelete,this).on("layerremove",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off("layeradd",this._enableLayerDelete,this).off("layerremove",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(n.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(n){this._deletableLayers.addLayer(n),n.fire("revert-deleted",{layer:n})},this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer(function(n){this._removeLayer({layer:n})},this),this.save()},_enableLayerDelete:function(n){(n.layer||n.target||n).on("click",this._removeLayer,this)},_disableLayerDelete:function(n){var s=n.layer||n.target||n;s.off("click",this._removeLayer,this),this._deletedLayers.removeLayer(s)},_removeLayer:function(n){var s=n.layer||n.target||n;this._deletableLayers.removeLayer(s),this._deletedLayers.addLayer(s),s.fire("deleted")},_onMouseMove:function(n){this._tooltip.updatePosition(n.latlng)},_hasAvailableLayers:function(){return this._deletableLayers.getLayers().length!==0}})})(window,document);const _b="";var fp={draw:{toolbar:{actions:{title:"መሳል ተው",text:"ተው"},finish:{title:"መሳል ጨርስ",text:"ጨርስ"},undo:{title:"መጨረሻ የተሳለውን ነጥብ አጥፋ",text:"መጨረሻ የተሳለውን ነጥብ አጥፋ"},buttons:{polyline:"ፖሊላየን ሳል",polygon:"ፖሊጎን ሳል",rectangle:"አራት መአዘን ሳል",circle:"ክብ ሳል",marker:"ምልክት ሳል",circlemarker:"ክብ ምልክት ሳል"}},handlers:{circle:{tooltip:{start:"ክብ ለመሳል ተጭንው ይጎትቱ"},radius:"ራዲየስ"},circlemarker:{tooltip:{start:"ክብ ምልክት ለመሳል ካርታውን ይጫኑ ይጎትቱ"}},marker:{tooltip:{start:"ምልክት ለመሳል ካርታውን ይጫኑ ይጎትቱ"}},polygon:{tooltip:{start:"ቅርጽን ለመሳል ካርታውን ተጭነው ይጎትቱ",cont:"ቅርጽን መሳሎን ለመቀጠል ይጫኑ",end:"ቅርጽን ስሎ ለመጨረስ የመጀመሪያውን ነጥብ ይጫኑ"}},polyline:{error:"<strong>ስህተት:</strong> መስመሮች እርስ በእርስ መተላለፍ አይችሉም!",tooltip:{start:"መስመር ለመሳል ካርታውን ተጭነው ይጎትቱ",cont:"መስመር መሳሎን ለመቀጠል ይጫኑ",end:"መስመር ስሎ ለመጨረስ የመጨረሻውን ነጥብ ይጫኑ"}},rectangle:{tooltip:{start:"ዐራት መአዝን ለመሳል ካርታውን ይጫኑ ይጎትቱ"}},simpleshape:{tooltip:{end:"ስለው ለመጨረስ አይጤን ይልቀቁ"}}}},edit:{toolbar:{actions:{save:{title:"ለውጦቹን አኑር",text:"አኑር"},cancel:{title:"ማስተካከሉን ተው፣ ሁሉንም ለውጦች ሰርዝ",text:"ተው"},clearAll:{title:"ሁሉንም የካርታ ገጾች አጥፋ",text:"ሁሉንም አጥፋ"}},buttons:{edit:"የካርታ ገጽ አስተካክል",editDisabled:"የሚስተካከል የካርታ ገጽ የለም",remove:"የካርታ ገጽ ሰርዝ.",removeDisabled:"የሚሰረዝ የካርታ ገጽ የለም"}},handlers:{edit:{tooltip:{text:"ለማስተካከል ምልክቱን ወይም መያዣውን ይጎትቱ",subtext:"ለውጥጡን ለመተው ተው የሚለውን ይጫኑ"}},remove:{tooltip:{text:"ማጥፋት የፈለጉትን ይጫኑ"}}}}},gp={draw:{toolbar:{actions:{title:"Zrušit kreslení",text:"Zrušit"},finish:{title:"Dokončit kreslení",text:"Dokončit"},undo:{title:"Smazat poslední nakreslený bod",text:"Smazat poslední bod"},buttons:{polyline:"Nakreslit mnohoúhelník",polygon:"Nakreslit polygon",rectangle:"Nakreslit obdélník",circle:"Nakreslit kruh",marker:"Nakreslit značku",circlemarker:"Nakreslit kruhovou značku"}},handlers:{circle:{tooltip:{start:"Kliknout a táhnout pro nakreslení kruhu."},radius:"Poloměr"},circlemarker:{tooltip:{start:"Kliknout do mapy pro umístění kruhové značky."}},marker:{tooltip:{start:"Kliknout do mapy pro umístění značky."}},polygon:{tooltip:{start:"Kliknout pro začátek kreslení tvaru.",cont:"Kliknout pro pokračování v kreslení tvaru.",end:"Kliknout na pvní bod k uzavření tvaru."}},polyline:{error:"<strong>Chyba:</strong> hrany tvaru se nemohou protínat!",tooltip:{start:"Kliknout pro začátek kreslení úsečky.",cont:"Kliknout pro pokračování v kreslení úsečky.",end:"Kliknout na koncový bod k ukončení kreslení úsečky."}},rectangle:{tooltip:{start:"Kliknout a táhnout k nakreslení obdélníku."}},simpleshape:{tooltip:{end:"Pustit myš k dokončení kreslení."}}}},edit:{toolbar:{actions:{save:{title:"Uložit změny.",text:"Uložit"},cancel:{title:"Zrušit úpravu, zruší všechny změny.",text:"Zrušit"},clearAll:{title:"Vymazat všechny vrstvy.",text:"Vymazat vše"}},buttons:{edit:"Upravit vrstvy.",editDisabled:"Žádné vrstvy k úpravě.",remove:"Vymazat vrstvy.",removeDisabled:"Žádná vrstva k vymazání."}},handlers:{edit:{tooltip:{text:"Táhnout za úchopy pro editaci tvaru.",subtext:"Kliknutím na zrušit vrátite změny."}},remove:{tooltip:{text:"Kliknout na tvar pro smazání"}}}}},pp={draw:{toolbar:{actions:{title:"Zeichnung abbrechen",text:"Abbrechen"},finish:{title:"Zeichnung fertigstellen",text:"Fertigstellen"},undo:{title:"Lösche den zuletzt gezeichneten Punkt",text:"Letzter Punkt löschen"},buttons:{polyline:"Zeichne eine Linie",polygon:"Zeichne ein Polygon",rectangle:"Zeichne ein Rechteck",circle:"Zeichne einen Kreis",marker:"Zeichne einen Marker",circlemarker:"Zeichne einen Kreis-Marker"}},handlers:{circle:{tooltip:{start:"Klicken und ziehen um einen Kreis zu zeichnen."},radius:"Radius"},circlemarker:{tooltip:{start:"Karte anklicken um einen Kreis-Marker zu platzieren."}},marker:{tooltip:{start:"Karte anklicken um einen Marker zu platzieren."}},polygon:{tooltip:{start:"Klicken um mit dem Zeichnen einer Form zu beginnen.",cont:"Klicken um mit dem Zeichnen dieser Form fortzufahren.",end:"Erster Punkt anklicken um diese Form abzuschliessen."}},polyline:{error:"<strong>Fehler:</strong> Form-Ecken dürfen sich nicht überschneiden!",tooltip:{start:"Klicken um mit dem Zeichnen einer Linie zu beginnen.",cont:"Klicken um mit dem Zeichnen dieser Linie fortzufahren.",end:"Erster Punkt anklicken um diese Linie abzuschliessen."}},rectangle:{tooltip:{start:"Klicken und ziehen um ein Rechteck zu zeichnen."}},simpleshape:{tooltip:{end:"Maustaste loslassen um die Zeichnung fertigzustellen."}}}},edit:{toolbar:{actions:{save:{title:"Speichere Änderungen.",text:"Speichern"},cancel:{title:"Bearbeitung abbrechen, alle Änderungen verwerfen.",text:"Abbrechen"},clearAll:{title:"Alle Layer bereinigen.",text:"Alles bereinigen"}},buttons:{edit:"Layer bearbeiten.",editDisabled:"Keine Layer zum bearbeiten.",remove:"Layer löschen.",removeDisabled:"Keine Layer zum löschen."}},handlers:{edit:{tooltip:{text:"Ziehe den Griff oder den Marker um die Eigenschaft zu bearbeiten.",subtext:"Klicke abbrechen um Änderungen rückgängig zu machen."}},remove:{tooltip:{text:"Klicke auf eine Eigenschaft um diese zu entfernen."}}}}},ac={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes.",text:"Save"},cancel:{title:"Cancel editing, discards all changes.",text:"Cancel"},clearAll:{title:"Clear all layers.",text:"Clear All"}},buttons:{edit:"Edit layers.",editDisabled:"No layers to edit.",remove:"Delete layers.",removeDisabled:"No layers to delete."}},handlers:{edit:{tooltip:{text:"Drag handles, or marker to edit feature.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove"}}}}},_p={draw:{toolbar:{actions:{title:"Cancelar dibujo",text:"Cancelar"},finish:{title:"Terminar dibujo",text:"Terminar"},undo:{title:"Eliminar último punto dibujado",text:"Eliminar último punto"},buttons:{polyline:"Dibujar una polilínea",polygon:"Dibujar un polígono",rectangle:"Dibujar un rectángulo",circle:"Dibujar un círculo",marker:"Dibujar un marcador",circlemarker:"Dibujar un marcador circular"}},handlers:{circle:{tooltip:{start:"Haz click y arrastra para dibujar un círculo"},radius:"Radio"},circlemarker:{tooltip:{start:"Haz click en el mapa para situar el marcador circular"}},marker:{tooltip:{start:"Haz click en el mapa para situar el marcador"}},polygon:{tooltip:{start:"Haz click para empezar a dibujar la forma",cont:"Haz click para continuar dibujando la forma",end:"Haz click en el primer punto para cerrar la forma"}},polyline:{error:"<strong>Error:</strong> las líneas no deben cruzarse",tooltip:{start:"Haz click para empezar a dibujar la línea",cont:"Haz click para continuar dibujando la línea",end:"Haz click en el último punto para terminar la línea"}},rectangle:{tooltip:{start:"Haz click y arrastra para dibujar un rectángulo"}},simpleshape:{tooltip:{end:"Suelta el ratón para terminar de dibujar"}}}},edit:{toolbar:{actions:{save:{title:"Guardar los cambios",text:"Guardar"},cancel:{title:"Cancelar la edición, descarta todos los cambios",text:"Cancelar"},clearAll:{title:"Limpiar todas las capas",text:"Limpiar todo"}},buttons:{edit:"Editar capas",editDisabled:"No hay capas que editar",remove:"Eliminar capas",removeDisabled:"No hay capas que eliminar"}},handlers:{edit:{tooltip:{text:"Arrastra el marcador para editar la forma",subtext:"Haz click en cancelar para deshacer los cambios"}},remove:{tooltip:{text:"Haz click en una forma para eliminarla"}}}}},mp={draw:{toolbar:{actions:{title:"Peru piirustus",text:"Peru"},finish:{title:"Hyväksy piirustus",text:"Hyväksy"},undo:{title:"Poista viimeinen piirretty piste",text:"Poista viimeinen piste"},buttons:{polyline:"Piirrä murtoviiva",polygon:"Piirrä monikulmio",rectangle:"Piirrä suorakulmio",circle:"Piirrä ympyrä",marker:"Piirrä merkki",circlemarker:"Piirrä piirimerkki"}},handlers:{circle:{tooltip:{start:"Piirrä ympyrä pitämällä hiiri painettuna ja vetämällä."},radius:"Säde"},circlemarker:{tooltip:{start:"Aseta ympyrämerkki painamalla karttaa."}},marker:{tooltip:{start:"Aseta markkeri painamalla karttaa."}},polygon:{tooltip:{start:"Paina aloittaaksesi muodon piirtämisen.",cont:"Paina jatkaaksesi muodon piirtämistä.",end:"Sulje muoto painamalla ensimmäistä pistettä."}},polyline:{error:"<strong>Virhe:</strong> muodon reunaa ei voi ylittää!",tooltip:{start:"Paina aloittaaksesi viivan piirtämisen.",cont:"Paina jatkaaksesi viivan piirtämistä.",end:"Paina viimeistä pistettä päättäksesi viiva."}},rectangle:{tooltip:{start:"Piirrä suorakulmio pitämällä hiiri painettuna ja vetämällä."}},simpleshape:{tooltip:{end:"Vapauta hiiri päättääksesi piirtämisen."}}}},edit:{toolbar:{actions:{save:{title:"Hyväksy muutokset.",text:"Hyväksy"},cancel:{title:"Peru muokkaus, hylkää kaikki muutokset.",text:"Peru"},clearAll:{title:"Poista kaikki tasot.",text:"Poista kaikki"}},buttons:{edit:"Muokkaa tasoja.",editDisabled:"Ei muokattavia tasoja.",remove:"Poista tasot.",removeDisabled:"Ei poistettavia tasoja."}},handlers:{edit:{tooltip:{text:"Vedä pistettä tai markkeria muokataksesi piirrettyjä ominaisuuksia.",subtext:"Kumoa muutokset painamalla peruuta."}},remove:{tooltip:{text:"Paina piirrettyä ominaisuutta poistaaksesi"}}}}},yp={draw:{toolbar:{actions:{title:"Annuler le dessin",text:"Annuler"},finish:{title:"Terminer le dessin",text:"Terminer"},undo:{title:"Supprimer le dernier point tiré",text:"Supprimer le dernier point"},buttons:{polyline:"Dessinez une polyligne",polygon:"Dessinez un polygone",rectangle:"Dessinez un rectangle",circle:"Dessiner un cercle",marker:"Dessinez un marqueur",circlemarker:"Dessinez un marqueur circulaire"}},handlers:{circle:{tooltip:{start:"Cliquez et faites glisser pour dessiner le cercle."},radius:"Rayon"},circlemarker:{tooltip:{start:"Cliquez sur la carte pour placer le marqueur circulaire."}},marker:{tooltip:{start:"Cliquez sur la carte pour placer le marqueur."}},polygon:{tooltip:{start:"Cliquez pour commencer à dessiner.",cont:"Cliquez pour continuer à dessiner.",end:"Cliquez sur le premier point pour fermer cette forme."}},polyline:{error:"<strong>Erreur:</strong> les polyligne ne peuvent pas traverser!",tooltip:{start:"Cliquez pour commencer à dessiner.",cont:"Cliquez pour continuer à dessiner.",end:"Cliquez sur le dernier point pour fermer cette forme."}},rectangle:{tooltip:{start:"Cliquez et faites glisser pour dessiner le rectangle."}},simpleshape:{tooltip:{end:"Relâchez la souris pour terminer le dessin."}}}},edit:{toolbar:{actions:{save:{title:"Sauvegarder les modifications.",text:"Sauvegarder"},cancel:{title:"Annuler l'édition, rejette toutes les modifications.",text:"Annuler"},clearAll:{title:"Effacez toutes les collections.",text:"Tout effacer"}},buttons:{edit:"Modifier les collections.",editDisabled:"Pas de collections à éditer.",remove:"Supprimez les collections.",removeDisabled:"Pas de collections à supprimer."}},handlers:{edit:{tooltip:{text:"Sélectionnez les poignées ou le marqueur pour modifier l'entité.",subtext:"Cliquez sur annuler pour rétablir les modifications."}},remove:{tooltip:{text:"Cliquez sur une entité pour supprimer"}}}}},vp={draw:{toolbar:{actions:{title:"Rajzolás elvetése",text:"Mégse"},finish:{title:"Rajzolás befejezése",text:"Befejezés"},undo:{title:"Legutóbbi pont törlése",text:"Legutóbbi pont törlése"},buttons:{polyline:"Útvonal rajzolása",polygon:"Sokszög rajzolása",rectangle:"Négyszög rajzolása",circle:"Kör rajzolása",marker:"Jelölő rajzolása",circlemarker:"Kör-jelölő rajzolása"}},handlers:{circle:{tooltip:{start:"Kattintson és tartsa nyomva a rajzoláshoz."},radius:"Sugár"},circlemarker:{tooltip:{start:"Kör-jelölő elhelyezéséhez kattintson a térképre."}},marker:{tooltip:{start:"Jelölő elhelyezéséhez kattintson a térképre."}},polygon:{tooltip:{start:"Alakzat rajzolásához kattintson a térképre.",cont:"Alakzat folytatásához kattintson a térképre.",end:"Alakzat befejezéséhez kattintson a kezdőpontra."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Útvonal rajzolásához kattintson a térképre.",cont:"Útvonal folytatásához kattintson a térképre.",end:"Útvonal befejezéséhez kattintson a végpontra."}},rectangle:{tooltip:{start:"Kattintson és tartsa nyomva négyszög rajzolásához."}},simpleshape:{tooltip:{end:"Ha elégedett az alakzattal, engedje fel az egér gombját."}}}},edit:{toolbar:{actions:{save:{title:"Változtatások elmentése.",text:"Mentés"},cancel:{title:"Változtatások elvetése.",text:"Mégse"},clearAll:{title:"Összes réteg törlése.",text:"Összes törlése"}},buttons:{edit:"Rétegek szerkesztése.",editDisabled:"Nem állnak rendelkezésre szerkeszthető rétegek.",remove:"Rétegek törlése.",removeDisabled:"Nem állnak rendelkezésre törölhető rétegek."}},handlers:{edit:{tooltip:{text:"Módosításhoz használja a jelölők, alakzatok kezelőit.",subtext:"Változások elvetéséhez kattintson a 'Mégse' gombra."}},remove:{tooltip:{text:"Kattintson a jelölőkre, alakzatokra az eltávolításukhoz."}}}}},xp={draw:{toolbar:{actions:{title:"Annulla disegno",text:"Annulla"},finish:{title:"Completa disegno",text:"Completa"},undo:{title:"Elimina l'ultimo punto disegnato",text:"Elimina l'ultimo punto"},buttons:{polyline:"Disegna una polilinea",polygon:"Disegna un poligono",rectangle:"Disegna un rettangolo",circle:"Disegna un cerchio",marker:"Disegna un marcatore",circlemarker:"Disegna un marker circolare"}},handlers:{circle:{tooltip:{start:"Clicca e trascina per disegnare un cerchio."},radius:"Raggio"},circlemarker:{tooltip:{start:"Clicca la mappa per posizionare un marcatore circolare."}},marker:{tooltip:{start:"Clicca la mappa per posizionare un marcatore."}},polygon:{tooltip:{start:"Clicca per iniziare a disegnare una figura.",cont:"Clicca per continuare a disegnare una figura.",end:"Clicca il primo punto per chiudere questa figura."}},polyline:{error:"<strong>Errore:</strong> i margini della figura non si possono incrociare!",tooltip:{start:"Clicca per iniziare a disegnare una linea.",cont:"Clicca per continuare a disegnare una linea",end:"Clicca l'ultimo punto per finire questa linea"}},rectangle:{tooltip:{start:"Clicca e trascina per disegnare un rettangolo."}},simpleshape:{tooltip:{end:"Rilascia il mouse per finire il disegno."}}}},edit:{toolbar:{actions:{save:{title:"Salva modifiche.",text:"Salva"},cancel:{title:"Annulla tutte le modifiche.",text:"Annulla"},clearAll:{title:"Pulisci tutti i livelli.",text:"Pulisci tutto"}},buttons:{edit:"Modifica i livelli.",editDisabled:"Nessun livello disponibile per la modifica.",remove:"Elimina livelli.",removeDisabled:"Nessun livello disponibile per l'eliminazione."}},handlers:{edit:{tooltip:{text:"Trascina le maniglie, o i marcatori per modificare l'elemento.",subtext:"Clicca annulla per annullare le modifiche."}},remove:{tooltip:{text:"Clicca un elemento per rimuoverlo"}}}}},wp={draw:{toolbar:{actions:{title:"ხატვის გაუქმება",text:"გაუქმება"},finish:{title:"ხატვის დასრულება",text:"დასრულება"},undo:{title:"ბოლო დახატული წერტილის წაშლა",text:"ბოლო წერტილის წაშლა"},buttons:{polyline:"პოლილაინის დახაზვა",polygon:"პოლიგონის დახაზვა",rectangle:"მართკუთხედის დახაზვა",circle:"წრის დახაზვა",marker:"ადგილმდებარეობის დატანა",circlemarker:"ადგილმდებარეობის დატანა(წრის სახით)"}},handlers:{circle:{tooltip:{start:"დააწკაპუნეთ და გადაიტანეთ იმისათვის, რომ წრე დახაზოთ."},radius:"რადიუსი"},circlemarker:{tooltip:{start:"დააწკაპუნეთ რუკაზე ადგილმდებარეობის შესაქმნელად."}},marker:{tooltip:{start:"დააწკაპუნეთ რუკაზე ადგილმდებარეობის შესაქმნელად."}},polygon:{tooltip:{start:"დააწკაპუნეთ, კონტურის ხაზვის დაწყებისთვის.",cont:"დააწკაპუნეთ, კონტრუსი ხაზვის დასრულებისთვის.",end:"დააწკაპუნეთ პირველ წერტილზე, რათა დაასრულოთ კონტურის ხაზვა."}},polyline:{error:"<strong>შეცდომა:</strong> ხაზი ვერ გადაკვეთავს თავის თავს",tooltip:{start:"დააწკაპუნეთ, ხაზის ხაზვის დაწყებისთვის.",cont:"დააწკაპუნეთ, ხაზის ხაზვის დასრულებისთვის.",end:"დააწკაპუნეთ ბოლო წერტილზე, რათა დაასრულოთ ხაზის ხაზვა."}},rectangle:{tooltip:{start:"დააწკაპუნეთ და გადაიტანეთ იმისათვის, რომ მართკუთხედი დახაზოთ."}},simpleshape:{tooltip:{end:"გაათავისუფლეთ თაგვის ღილაკი ხაზვის დასასრულებლად."}}}},edit:{toolbar:{actions:{save:{title:"ცვლილებების შენახვა.",text:"შენახვა"},cancel:{title:"რედაქტირების გაუქმება, დააბრუნე ყველა ცვლილება.",text:"გაუქმება"},clearAll:{title:"ყველა რედაქტირებული ფენის გასუფთავება.",text:"გასუფთავება"}},buttons:{edit:"რედაქტირება.",editDisabled:"ფენები არ არის რედაქტირებისთვის.",remove:"წაშლა.",removeDisabled:"ფენები არ არის წაშლისთვის."}},handlers:{edit:{tooltip:{text:"გადაიტანეთ წვერები ან წერტილები ობიექტის რედაქტირებისთვის.",subtext:'დააჭირეთ "გაუქმება", საწყის მდგომარეობაში დასაბრუნებლად.'}},remove:{tooltip:{text:"დააწკაპუნეთ ობიექტზე წაშლისთვის"}}}}},Ep={draw:{toolbar:{actions:{title:"Tekening annuleren",text:"Annuleren"},finish:{title:"Tekening voltooien",text:"Voltooien"},undo:{title:"Laatst getekende punt verwijderen",text:"Verwijder laatst getekende punt"},buttons:{polyline:"Teken een polygonale lijn",polygon:"Teken een polygoon",rectangle:"Teken een rechthoek",circle:"Teken een cirkel",marker:"Plaats een marker",circlemarker:"Teken een cirkelmarkering"}},handlers:{circle:{tooltip:{start:"Klik en sleep om de cirkel te tekenen."},radius:"Radius"},circlemarker:{tooltip:{start:"Klik op de kaart om de cirkelmarkering te plaatsen."}},marker:{tooltip:{start:"Klik op de kaart om de markering te plaatsen."}},polygon:{tooltip:{start:"Klik om te beginnen met het tekenen van de polygoon.",cont:"Klik om door te gaan met het tekenen van de vorm.",end:"Klik op het eerste punt om dit polygoon te sluiten."}},polyline:{error:"<strong>Fout:</strong> vormranden kunnen niet kruisen!",tooltip:{start:"Klik om te beginnen met het tekenen van een lijn.",cont:"Klik om door te gaan met het tekenen van de lijn.",end:"Klik laatst getekende punt om deze lijn te voltooien."}},rectangle:{tooltip:{start:"Klik en sleep om een rechthoek te tekenen."}},simpleshape:{tooltip:{end:"Laat de muis los om de tekening te voltooien."}}}},edit:{toolbar:{actions:{save:{title:"Wijzigingen opslaan.",text:"Opslaan"},cancel:{title:"Annuleer bewerken en verwijder alle wijzigingen.",text:"Annuleren"},clearAll:{title:"Verwijder alle lagen.",text:"Verwijderd alles"}},buttons:{edit:"Lagen bewerken.",editDisabled:"Geen lagen om te bewerken.",remove:"Verwijder lagen.",removeDisabled:"Geen lagen om te verwijderen."}},handlers:{edit:{tooltip:{text:"Sleep hoeken om te schalen of middenpunt om te verplaatsen.",subtext:"Klik op annuleren om wijzigingen ongedaan te maken."}},remove:{tooltip:{text:"Klik op een vorm om die te verwijderen"}}}}},Lp={draw:{toolbar:{actions:{title:"Avbryt markering",text:"Avbryt"},finish:{title:"Ferdiggjør markering",text:"Ferdiggjør"},undo:{title:"Ta bort siste punkt",text:"Slett siste punkt"},buttons:{polyline:"Tegn flere linjer",polygon:"Tegn en mangekant",rectangle:"Tegn et rektangel",circle:"Tegn en sirkel",marker:"Sett et markeringspunkt",circlemarker:"Tegn et sirkelpunkt"}},handlers:{circle:{tooltip:{start:"Klikk og dra for å tegne en sirkel."},radius:"Radius"},circlemarker:{tooltip:{start:"Klikk på kartet for å plassere et sirkelpunkt."}},marker:{tooltip:{start:"Klikk på kartet for å markere et punkt."}},polygon:{tooltip:{start:"Klikk for å tegne et område.",cont:"Klikk for å fortsette tegningen.",end:"Klikk på det første punktet for å lukke området."}},polyline:{error:"<strong>Error:</strong> kantene kan ikke krysses!",tooltip:{start:"Klikk for å tegne en linje.",cont:"Klikk for å fortsette å tegne linjen.",end:"Kikk siste punkt for å ferdiggjøre linjen."}},rectangle:{tooltip:{start:"Klikk og dra for å tegne et rektangel."}},simpleshape:{tooltip:{end:"Slipp museknappen for å gjøre tegningen ferdig."}}}},edit:{toolbar:{actions:{save:{title:"Lagre endringer.",text:"Lagre"},cancel:{title:"Avbryt redigering og forkast endringer.",text:"Avbryt"},clearAll:{title:"Nullstill alle figurer.",text:"Nullstill alt."}},buttons:{edit:"Rediger figur.",editDisabled:"Ingen figur å redigere.",remove:"Slett figur.",removeDisabled:"Ingen figur å slette."}},handlers:{edit:{tooltip:{text:"Dra markør for å redigere.",subtext:"Klikk avbryt for å angre endringer."}},remove:{tooltip:{text:"Klikk for å ta bort"}}}}},bp={draw:{toolbar:{actions:{title:"Anuluj wyznaczanie",text:"Anuluj"},finish:{title:"Zakończ wyznaczanie",text:"Zakończ"},undo:{title:"Usuń ostatnio wyznaczony punkt",text:"Usuń ostatni punkt"},buttons:{polyline:"Wyznacz wzór",polygon:"Wyznacz wielokąt",rectangle:"Wyznacz prostokąt",circle:"Wyznacz koło",marker:"Umieść znacznik",circlemarker:"Umieść okrągły znacznik"}},handlers:{circle:{tooltip:{start:"Kliknij i przeciągnij, aby wyznaczyć koło."},radius:"Promień"},circlemarker:{tooltip:{start:"Kliknij na mapę, aby umieścić okrągły znacznik."}},marker:{tooltip:{start:"Kliknij na mapę, aby umieścić znacznik."}},polygon:{tooltip:{start:"Kliknij, aby rozpocząć wyznaczanie kształtu.",cont:"Kliknij, aby kontynuować wyznaczanie kształtu.",end:"Kliknij pierwszy punkt, aby zakończyć ten kształt."}},polyline:{error:"<strong>Błąd:</strong> odcinki nie mogą się przecinać!",tooltip:{start:"Kliknij, aby rozpocząć wyznaczanie lini.",cont:"Kliknij, aby kontynuować wyznaczanie lini.",end:"Kliknij ostatni punkt, aby ukończyć linię."}},rectangle:{tooltip:{start:"Kliknij i przeciągnij, aby wyznaczyć prostokąt."}},simpleshape:{tooltip:{end:"Zwolnij przycisk myszy, aby ukończyć wyznaczanie."}}}},edit:{toolbar:{actions:{save:{title:"Zapisz zmiany.",text:"Zapisz"},cancel:{title:"Anuluj edytowanie i odrzuć zmiany.",text:"Anuluj"},clearAll:{title:"Wyczyść wszystkie warstwy.",text:"Wyczyść wszystko"}},buttons:{edit:"Edytuj warstwy.",editDisabled:"Brak warstw do edycji.",remove:"Usuń warstwy.",removeDisabled:"Brak warstw do usunięcia."}},handlers:{edit:{tooltip:{text:"Przeciągnij uchwyt lub znacznik, aby edytować.",subtext:"Kliknij anuluj, aby odrzucić zmiany."}},remove:{tooltip:{text:"Kliknij obiekt, aby go usunąć."}}}}},Tp={draw:{toolbar:{actions:{title:"Cancelar desenho",text:"Cancelar"},finish:{title:"Terminar desenho",text:"Terminar"},undo:{title:"Eliminar último ponto desenhado",text:"Eliminar último ponto"},buttons:{polyline:"Desenhar uma polilinha",polygon:"Desenhar um polígono",rectangle:"Desenhar um retângulo",circle:"Desenhar um círculo",marker:"Desenhar un marcador",circlemarker:"Desenhar um marcador circular"}},handlers:{circle:{tooltip:{start:"Clique e arrastrar para desenhar o círculo."},radius:"Raio"},circlemarker:{tooltip:{start:"Clique no mapa para colocar o marcador circular."}},marker:{tooltip:{start:"Clique no mapa para colocar o marcador."}},polygon:{tooltip:{start:"Clique para começar a desenhar a figura.",cont:"Clique para continuar desenhando a figura.",end:"Clique no primeiro ponto para fechar esta figura."}},polyline:{error:"<strong>Erro:</strong> as bordas de uma forma não podem atravessar!",tooltip:{start:"Clique para começar a desenhar a linha.",cont:"Clique para continuar desenhando a linha.",end:"Clique no último ponto para terminar a linha."}},rectangle:{tooltip:{start:"Clique e arrastrar para desenhar o retângulo."}},simpleshape:{tooltip:{end:"Solte o mouse para terminar o desenho."}}}},edit:{toolbar:{actions:{save:{title:"Guardar alterações.",text:"Guardar"},cancel:{title:"Cancelar edição, descarta todas as alterações.",text:"Cancelar"},clearAll:{title:"Limpar todas as camadas.",text:"Limpar tudo"}},buttons:{edit:"Editar camadas.",editDisabled:"Nenhuma camada que editar.",remove:"Eliminar camadas.",removeDisabled:"Nenhuma camada que eliminar."}},handlers:{edit:{tooltip:{text:"Arraste os manipuladores ou marcadores para editar a figura.",subtext:"Clique em cancelar para desfazer as alterações."}},remove:{tooltip:{text:"Clique em uma figura para removê-la"}}}}},Cp={draw:{toolbar:{actions:{title:"Отменить рисование",text:"Отмена"},finish:{title:"Завершить рисование",text:"Завершить"},undo:{title:"Удалить последнюю нарисованную точку",text:"Удалить последнюю точку"},buttons:{polyline:"Нарисовать полилинию",polygon:"Нарисовать полигон",rectangle:"Нарисовать прямоугольник",circle:"Нарисовать круг",marker:"Нарисовать точку",circlemarker:"Нарисовать точку(в виде круга)"}},handlers:{circle:{tooltip:{start:"Кликните и перетащите для того, чтобы нарисовать круг."},radius:"Радиус"},circlemarker:{tooltip:{start:"Кликните на карту для установки точки."}},marker:{tooltip:{start:"Кликните на карту для установки точки."}},polygon:{tooltip:{start:"Кликните, чтобы начать рисовать контур.",cont:"Кликните, чтобы завершить рисовать контур.",end:"Кликните на первую точку, чтобы завершить рисование контура."}},polyline:{error:"<strong>Ошибка:</strong> линия не может самопересекаться!",tooltip:{start:"Кликните, чтобы начать рисовать линию.",cont:"Кликните, чтобы завершить рисование линии.",end:"Кликните на последнюю точку, чтобы завершить рисование линии."}},rectangle:{tooltip:{start:"Кликните и перетащите, чтобы нарисовать прямоугольник."}},simpleshape:{tooltip:{end:"Отпустите кнопку мыши для завершения рисования."}}}},edit:{toolbar:{actions:{save:{title:"Сохранить изменения.",text:"Сохранить"},cancel:{title:"Отменить редактирование, откатить все изменения.",text:"Отмена"},clearAll:{title:"Очистить все редактируемые слои.",text:"Очистить всё"}},buttons:{edit:"Редактировать.",editDisabled:"Нет слоёв для редактирования.",remove:"Удалить.",removeDisabled:"Нет слоёв для удаления."}},handlers:{edit:{tooltip:{text:"Перетащите вершины или точки для редактирования фигуры.",subtext:'Нажмите "Отмена", чтобы откатить изменения.'}},remove:{tooltip:{text:"Кликните на фигуру для удаления"}}}}},Mp={draw:{toolbar:{actions:{title:"Zrušiť kreslenie",text:"Zrušiť"},finish:{title:"Dokončiť kreslenie",text:"Dokončiť"},undo:{title:"Zmazať posledný nakreslený bod",text:"Zmazať posledný bod"},buttons:{polyline:"Nakresliť čiaru",polygon:"Nakresliť polygón",rectangle:"Nakresliť obdĺžnik",circle:"Nakresliť kruh",marker:"Nakresliť bod",circlemarker:"Nakresliť kruhový bod"}},handlers:{circle:{tooltip:{start:"Kliknite a potiahnite, aby ste nakreslili kruh."},radius:"Polomer"},circlemarker:{tooltip:{start:"Kliknite na mapu aby ste umiestnili kruhový bod."}},marker:{tooltip:{start:"Kliknite na mapu aby ste umiestnili bod."}},polygon:{tooltip:{start:"Kliknite, aby ste začali kresliť útvar.",cont:"Kliknite, aby ste nakreslili ďalší bod útvaru.",end:"Kliknite na prvý bod, aby ste uzavreli útvar."}},polyline:{error:"<strong>Chyba:</strong> čiary sa nesmú pretínať!",tooltip:{start:"Kliknite, aby ste začali kresliť čiaru.",cont:"Kliknite, aby ste nakreslili ďalší bod čiary.",end:"Kliknite posledný bod, aby ste dokončili čiaru."}},rectangle:{tooltip:{start:"Kliknite a potiahnite, aby ste nakreslili štvorec."}},simpleshape:{tooltip:{end:"Uvoľnením tlačidla myši ukončíte kreslenie."}}}},edit:{toolbar:{actions:{save:{title:"Uložiť zmeny.",text:"Uložiť"},cancel:{title:"Ukončiť úpravu, zrušiť všetky zmeny.",text:"Zrušiť"},clearAll:{title:"Zmazať všetky vrstvy.",text:"Zmazať všetko"}},buttons:{edit:"Upraviť vrstvy.",editDisabled:"Žiadne vrstvy pre úpravu",remove:"Zmazať vrstvy.",removeDisabled:"Žiadne vrstvy pre zmazanie."}},handlers:{edit:{tooltip:{text:"Potiahnutím vyznačených štvorčekov, alebo bodov upravíte útvar.",subtext:"Kliknite zrušiť, pre zrušenie zmien."}},remove:{tooltip:{text:"Kliknite na útvar pre jeho zmazanie."}}}}},Sp={draw:{toolbar:{actions:{title:"Скасувати креслення",text:"Скасувати"},finish:{title:"Завершити креслення",text:"Завершити"},undo:{title:"Видалити останню нанесену точку",text:"Видалити останню точку"},buttons:{polyline:"Накреслити криву",polygon:"Накреслити многокутник",rectangle:"Накреслити прямокутник",circle:"Накреслити коло",marker:"Розмістити маркер",circlemarker:"Розмістити маркер-коло"}},handlers:{circle:{tooltip:{start:"Натисніть і перетягуйте вказівник, щоб накреслити коло."},radius:"Радіус"},circlemarker:{tooltip:{start:"Натисніть на мапу, щоб розмістити маркер-коло."}},marker:{tooltip:{start:"Натисніть на мапу, щоб розмістити маркер."}},polygon:{tooltip:{start:"Натисніть, щоб накреслити фігуру.",cont:"Натисніть, щоб продовжити креслення фігури.",end:"Натисніть на першу точку, щоб замкнути цю фігуру."}},polyline:{error:"<strong>Помилка:</strong> сторони фігури не мають перетинатись!",tooltip:{start:"Натисніть, щоб накреслити лінію.",cont:"Натисніть, щоб продовжити креслення лінії.",end:"Натисніть на останню точку, щоб завершити лінію."}},rectangle:{tooltip:{start:"Натисніть і перетягуйте вказівник, щоб накреслити прямокутник."}},simpleshape:{tooltip:{end:"Відпустіть мишку, щоб завершити рисування."}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни.",text:"Зберегти"},cancel:{title:"Припинити редагування, скасувати всі зміни.",text:"Скасувати"},clearAll:{title:"Очистити всі шари.",text:"Очистити все"}},buttons:{edit:"Редагувати шари.",editDisabled:"Немає шарів для редагування.",remove:"Видалити шари.",removeDisabled:"Немає шарів для видалення."}},handlers:{edit:{tooltip:{text:"Перетягуйте важелі або маркер для редагування фігури.",subtext:"Натисніть «Скасувати» для скасування змін."}},remove:{tooltip:{text:"Натисніть на фігуру для видалення"}}}}},Pp={draw:{toolbar:{actions:{title:"الغاء الرسم",text:"الغاء"},finish:{title:"انهاء الرسم",text:"انهاء"},undo:{title:"مسح اخر رسمة",text:"مسح اخر نقطة"},buttons:{polyline:"رسم خط",polygon:"رسم منطقة",rectangle:"رسم مستطيل",circle:"رسم دائرة",marker:"رسم علامة",circlemarker:"رسم علامة دائرة"}},handlers:{circle:{tooltip:{start:"اضغط واسحب لرسم دائرة"},radius:"القطر"},circlemarker:{tooltip:{start:"اضغط على الخريطة لرسم دائرة"}},marker:{tooltip:{start:"اضغط على الخريطة لرسم نقطة"}},polygon:{tooltip:{start:"اضغط لبدء رسم منطقة",cont:"اضغط لاستمرار رسم منطقة",end:"اضغط على اول نقطة لاكمال المنطقة"}},polyline:{error:"<strong>خطأ:</strong> لا يمكن تقاطع الخطوط",tooltip:{start:"اضغط لبدئ رسم الخط",cont:"اضغط لاستكمال رسم الخط",end:"اضغط على اخر نقطة للانهاء"}},rectangle:{tooltip:{start:"اضغط واسحب لرسم مستطيل"}},simpleshape:{tooltip:{end:"اترك الماوس للانهاء"}}}},edit:{toolbar:{actions:{save:{title:"حفظ التغييرات",text:"حفظ"},cancel:{title:"الغاء كل التعديلات",text:"الغاء"},clearAll:{title:"مسح كل الطبقات",text:"مسح الكل"}},buttons:{edit:"تعديل الطبقات",editDisabled:"لاتوجد طبقات للتعديل",remove:"مسح الطبقات",removeDisabled:"لا يوجد طبقات للمسح"}},handlers:{edit:{tooltip:{text:"اسحب للتعديل",subtext:"اضغط الغاء لمسح التعديلات"}},remove:{tooltip:{text:"اضغط على رسمة للمسح"}}}}},kp={draw:{toolbar:{actions:{title:"取消绘制",text:"取消"},finish:{title:"结束绘制",text:"结束"},undo:{title:"删除最后一个绘制点",text:"删除最后一个点"},buttons:{polyline:"绘制折线",polygon:"绘制多边形",rectangle:"绘制矩形",circle:"绘制圆形",marker:"绘制标志物",circlemarker:"绘制圆形标志物"}},handlers:{circle:{tooltip:{start:"单击并拖拽绘制圆形"},radius:"半径"},circlemarker:{tooltip:{start:"单击地图放置圆形标志物"}},marker:{tooltip:{start:"单击地图放置标志物"}},polygon:{tooltip:{start:"单击地图绘制图形",cont:"继续单击绘制图形",end:"单击起始点结束绘制"}},polyline:{error:"<strong>错误:</strong> 图形边缘不能交叉!",tooltip:{start:"单击地图绘制折线",cont:"继续单击绘制下一段折线",end:"单击最后一个点结束绘制"}},rectangle:{tooltip:{start:"单击并拖拽绘制矩形"}},simpleshape:{tooltip:{end:"松开鼠标结束绘制"}}}},edit:{toolbar:{actions:{save:{title:"保存变更",text:"保存"},cancel:{title:"取消编辑,放弃所有变更",text:"取消"},clearAll:{title:"清除所有图形",text:"清除所有"}},buttons:{edit:"编辑图形",editDisabled:"无图形可编辑",remove:"删除图形",removeDisabled:"无图形可删除"}},handlers:{edit:{tooltip:{text:"拖拽线段或标志点以编辑图形",subtext:"点击<strong>取消</strong>按钮撤销变更"}},remove:{tooltip:{text:"单击图形以移除"}}}}},Rp={draw:{toolbar:{actions:{title:"Çizimi iptal et",text:"İptal"},finish:{title:"Çizimi Bitir",text:"Bitir"},undo:{title:"Çizilen son noktayı sil",text:"Son noktayı sil"},buttons:{polyline:"Çoklu çizgi çiz",polygon:"Çokgen çiz",rectangle:"Dikdörtgen çiz",circle:"Yuvarlak çiz",marker:"İşaretçi çiz",circlemarker:"Yuvarlak işaretçi çiz"}},handlers:{circle:{tooltip:{start:"Yuvarlak çizmek için tıklayın ve sürükleyin."},radius:"Çap"},circlemarker:{tooltip:{start:"Yuvarlak işaretçi yerleştirmek için haritaya tıklayın."}},marker:{tooltip:{start:"İşaretçi yerleştirmek için haritaya tıklayın."}},polygon:{tooltip:{start:"Şekil çizmeye başlamak için tıklayın.",cont:"Şekil çizmeye devam etmek için tıklayın.",end:"Bu şekli tamamlamak için ilk noktayı tıklayın."}},polyline:{error:"<strong>Hata:</strong> şekil kenarları kesişemez!",tooltip:{start:"Hat çizmeye başlamak için tıklayın.",cont:"Hat çizmeye devam etmek için tıklayın.",end:"Bu hattı tamamlamak için ilk noktayı tıklayın."}},rectangle:{tooltip:{start:"Dikdörtgen çizmek için tıklayın ve sürükleyin."}},simpleshape:{tooltip:{end:"Çizimi bitirmek için fareyi bırakın."}}}},edit:{toolbar:{actions:{save:{title:"Değişiklikleri kaydet.",text:"Kaydet"},cancel:{title:"Düzenlemeyi iptal et, tüm değişiklikleri çıkar.",text:"İptal"},clearAll:{title:"Tüm katmanları temizle.",text:"Hepsini temizle"}},buttons:{edit:"Katmanları düzenle.",editDisabled:"Düzenlenecek katman bulunamadı.",remove:"Katmanları sil.",removeDisabled:"Silinecek katman bulunamadı."}},handlers:{edit:{tooltip:{text:"Çizimi düzenlemek için köşeleri veya işaretçiyi sürükleyin.",subtext:"Değişiklikleri geri almak için iptale tıklayın."}},remove:{tooltip:{text:"Çizimi silmek için tıklayın"}}}}},Ap={draw:{toolbar:{actions:{title:"Anulați desenul",text:"Anulare"},finish:{title:"Terminați desenul",text:"Termina"},undo:{title:"Șterge ultimul punct desenat",text:"Șterge ultimul punct"},buttons:{polyline:"Desenați o polilinie",polygon:"Desenați un poligon",rectangle:"Desenați un dreptunghi",circle:"Desenează un cerc",marker:"Desenați un marker",circlemarker:"Desenați un marcator de cerc"}},handlers:{circle:{tooltip:{start:"Dați clic și trageți pentru a desena cerc."},radius:"Rază"},circlemarker:{tooltip:{start:"Dați clic pe hartă pentru a plasa marcatorul cercului."}},marker:{tooltip:{start:"Dați clic pe hartă pentru a plasa marcatorul."}},polygon:{tooltip:{start:"Dați clic pentru a începe desenarea parcelei",cont:"Dați clic pentru a continua desenarea parcelei",end:"Dați clic pe primul punct pentru a închide această parcelei."}},polyline:{error:"<strong>Eroare:</strong> marginile formei nu se pot traversa!",tooltip:{start:"Daţi clic pentru a începe să desenezi o linie.",cont:"Daţi clic pentru a continua să desenezi linia.",end:"Dați clic pe ultimul punct pentru a ajunge la linia de sosire."}},rectangle:{tooltip:{start:"Dați clic și trageți pentru a desena dreptunghi."}},simpleshape:{tooltip:{end:"Eliberați mouse-ul pentru a termina desenul."}}}},edit:{toolbar:{actions:{save:{title:"Salvează modificările.",text:"Salvați"},cancel:{title:"Anulează editarea, anulează toate modificările.",text:"Anulare"},clearAll:{title:"Ștergeți toate straturile.",text:"Curata tot"}},buttons:{edit:"Editați straturi.",editDisabled:"Fără straturi de editat.",remove:"Ștergeți straturile.",removeDisabled:"Nu există straturi de șters."}},handlers:{edit:{tooltip:{text:"Trageți mânerele sau marcatorul pentru a edita caracteristica.",subtext:"Dați clic pe Anulare pentru a anula modificările."}},remove:{tooltip:{text:"Dați clic pe o caracteristică pentru a o elimina"}}}}},Ip=function(r){var t=ac;switch(r.toLocaleLowerCase()){case"de":case"de-at":case"de-be":case"de-ch":case"de-de":case"de-li":case"de-lu":case"de-de.utf-8":case"german":t=pp;break;case"en":case"en-us":case"en-ca":case"en-gb":case"en-us.utf-8":case"english":t=ac;break;case"ar":case"ar-ae":case"ar-eg":case"arabic":t=Pp;break;case"fi":case"fi-fi":case"fi-fi.utf-8":case"finnish":t=mp;break;case"fr":case"fr-us":case"fr-ca":case"fr-us.utf-8":case"french":t=yp;break;case"es":case"es-us":case"es-ca":case"es-us.utf-8":case"spanish":t=_p;break;case"sk":case"sk-sk":case"sk-sk.utf-8":case"slovak":t=Mp;break;case"pl":case"pl-pl":case"pl-pl.utf-8":case"polish":t=bp;break;case"pt":case"pt-pt":case"pt-pt.utf-8":case"portuguese":t=Tp;break;case"uk":case"uk-ua":case"uk-ua.utf-8":case"ukrainian":t=Sp;break;case"cs":case"cs-cz":case"cs-cz.utf-8":case"czech":t=gp;break;case"ru":case"ru-ru":case"ru-ru.utf-8":case"russian":t=Cp;break;case"ka":case"ka-ka":case"ka-ka.utf-8":case"georgian":t=wp;break;case"no":case"no-no":case"no-no.utf-8":case"norwegian":t=Lp;break;case"am":case"am-et":case"am-et.utf-8":case"amharic":t=fp;break;case"nl":case"nl-nl":case"nl-nl.utf-8":case"nl-be":case"nl-be.utf-8":case"dutch":case"belgian":case"flemish":t=Ep;break;case"it":case"it-it":case"it-ch":case"it-it.utf-8":case"it-ch.utf-8":case"italiano":case"italian":t=xp;break;case"hu":case"hu-HU":case"hu-hu":case"hu-HU.utf-8":case"hu-hu.utf-8":case"magyar":case"hungarian":t=vp;break;case"zh":case"zh-cn":case"zh-cn.utf-8":case"chinese":t=kp;break;case"tr":case"tr-tr":case"tr-tr.utf-8":case"turkish":t=Rp;break;case"ro":case"ro-ro":case"ro-RO":case"ro-ro.utf-8":case"romanian":t=Ap;break;default:throw new Error("[language] not found")}try{L&&L.drawLocal&&(L.drawLocal=t)}catch{}return t};function lc(r,t){return function(){return r.apply(t,arguments)}}const{toString:Dp}=Object.prototype,{getPrototypeOf:ba}=Object,Ms=(r=>t=>{const e=Dp.call(t);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),je=r=>(r=r.toLowerCase(),t=>Ms(t)===r),Ss=r=>t=>typeof t===r,{isArray:kn}=Array,wr=Ss("undefined");function Op(r){return r!==null&&!wr(r)&&r.constructor!==null&&!wr(r.constructor)&&Te(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const hc=je("ArrayBuffer");function Fp(r){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(r):t=r&&r.buffer&&hc(r.buffer),t}const zp=Ss("string"),Te=Ss("function"),cc=Ss("number"),Ps=r=>r!==null&&typeof r=="object",Np=r=>r===!0||r===!1,ks=r=>{if(Ms(r)!=="object")return!1;const t=ba(r);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},Bp=je("Date"),Gp=je("File"),Up=je("Blob"),jp=je("FileList"),Zp=r=>Ps(r)&&Te(r.pipe),Wp=r=>{let t;return r&&(typeof FormData=="function"&&r instanceof FormData||Te(r.append)&&((t=Ms(r))==="formdata"||t==="object"&&Te(r.toString)&&r.toString()==="[object FormData]"))},Hp=je("URLSearchParams"),Vp=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Er(r,t,{allOwnKeys:e=!1}={}){if(r===null||typeof r>"u")return;let i,n;if(typeof r!="object"&&(r=[r]),kn(r))for(i=0,n=r.length;i<n;i++)t.call(null,r[i],i,r);else{const s=e?Object.getOwnPropertyNames(r):Object.keys(r),a=s.length;let h;for(i=0;i<a;i++)h=s[i],t.call(null,r[h],h,r)}}function uc(r,t){t=t.toLowerCase();const e=Object.keys(r);let i=e.length,n;for(;i-- >0;)if(n=e[i],t===n.toLowerCase())return n;return null}const dc=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),fc=r=>!wr(r)&&r!==dc;function Ta(){const{caseless:r}=fc(this)&&this||{},t={},e=(i,n)=>{const s=r&&uc(t,n)||n;ks(t[s])&&ks(i)?t[s]=Ta(t[s],i):ks(i)?t[s]=Ta({},i):kn(i)?t[s]=i.slice():t[s]=i};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&Er(arguments[i],e);return t}const Xp=(r,t,e,{allOwnKeys:i}={})=>(Er(t,(n,s)=>{e&&Te(n)?r[s]=lc(n,e):r[s]=n},{allOwnKeys:i}),r),Yp=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Kp=(r,t,e,i)=>{r.prototype=Object.create(t.prototype,i),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:t.prototype}),e&&Object.assign(r.prototype,e)},qp=(r,t,e,i)=>{let n,s,a;const h={};if(t=t||{},r==null)return t;do{for(n=Object.getOwnPropertyNames(r),s=n.length;s-- >0;)a=n[s],(!i||i(a,r,t))&&!h[a]&&(t[a]=r[a],h[a]=!0);r=e!==!1&&ba(r)}while(r&&(!e||e(r,t))&&r!==Object.prototype);return t},Jp=(r,t,e)=>{r=String(r),(e===void 0||e>r.length)&&(e=r.length),e-=t.length;const i=r.indexOf(t,e);return i!==-1&&i===e},Qp=r=>{if(!r)return null;if(kn(r))return r;let t=r.length;if(!cc(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=r[t];return e},$p=(r=>t=>r&&t instanceof r)(typeof Uint8Array<"u"&&ba(Uint8Array)),t_=(r,t)=>{const i=(r&&r[Symbol.iterator]).call(r);let n;for(;(n=i.next())&&!n.done;){const s=n.value;t.call(r,s[0],s[1])}},e_=(r,t)=>{let e;const i=[];for(;(e=r.exec(t))!==null;)i.push(e);return i},i_=je("HTMLFormElement"),n_=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,i,n){return i.toUpperCase()+n}),gc=(({hasOwnProperty:r})=>(t,e)=>r.call(t,e))(Object.prototype),r_=je("RegExp"),pc=(r,t)=>{const e=Object.getOwnPropertyDescriptors(r),i={};Er(e,(n,s)=>{t(n,s,r)!==!1&&(i[s]=n)}),Object.defineProperties(r,i)},s_=r=>{pc(r,(t,e)=>{if(Te(r)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const i=r[e];if(Te(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},o_=(r,t)=>{const e={},i=n=>{n.forEach(s=>{e[s]=!0})};return kn(r)?i(r):i(String(r).split(t)),e},a_=()=>{},l_=(r,t)=>(r=+r,Number.isFinite(r)?r:t),Ca="abcdefghijklmnopqrstuvwxyz",_c="0123456789",mc={DIGIT:_c,ALPHA:Ca,ALPHA_DIGIT:Ca+Ca.toUpperCase()+_c},h_=(r=16,t=mc.ALPHA_DIGIT)=>{let e="";const{length:i}=t;for(;r--;)e+=t[Math.random()*i|0];return e};function c_(r){return!!(r&&Te(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}const u_=r=>{const t=new Array(10),e=(i,n)=>{if(Ps(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[n]=i;const s=kn(i)?[]:{};return Er(i,(a,h)=>{const c=e(a,n+1);!wr(c)&&(s[h]=c)}),t[n]=void 0,s}}return i};return e(r,0)},d_=je("AsyncFunction"),I={isArray:kn,isArrayBuffer:hc,isBuffer:Op,isFormData:Wp,isArrayBufferView:Fp,isString:zp,isNumber:cc,isBoolean:Np,isObject:Ps,isPlainObject:ks,isUndefined:wr,isDate:Bp,isFile:Gp,isBlob:Up,isRegExp:r_,isFunction:Te,isStream:Zp,isURLSearchParams:Hp,isTypedArray:$p,isFileList:jp,forEach:Er,merge:Ta,extend:Xp,trim:Vp,stripBOM:Yp,inherits:Kp,toFlatObject:qp,kindOf:Ms,kindOfTest:je,endsWith:Jp,toArray:Qp,forEachEntry:t_,matchAll:e_,isHTMLForm:i_,hasOwnProperty:gc,hasOwnProp:gc,reduceDescriptors:pc,freezeMethods:s_,toObjectSet:o_,toCamelCase:n_,noop:a_,toFiniteNumber:l_,findKey:uc,global:dc,isContextDefined:fc,ALPHABET:mc,generateString:h_,isSpecCompliantForm:c_,toJSONObject:u_,isAsyncFn:d_,isThenable:r=>r&&(Ps(r)||Te(r))&&Te(r.then)&&Te(r.catch)};function vt(r,t,e,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),i&&(this.request=i),n&&(this.response=n)}I.inherits(vt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:I.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const yc=vt.prototype,vc={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{vc[r]={value:r}}),Object.defineProperties(vt,vc),Object.defineProperty(yc,"isAxiosError",{value:!0}),vt.from=(r,t,e,i,n,s)=>{const a=Object.create(yc);return I.toFlatObject(r,a,function(c){return c!==Error.prototype},h=>h!=="isAxiosError"),vt.call(a,r.message,t,e,i,n),a.cause=r,a.name=r.name,s&&Object.assign(a,s),a};const f_=null;function Ma(r){return I.isPlainObject(r)||I.isArray(r)}function xc(r){return I.endsWith(r,"[]")?r.slice(0,-2):r}function wc(r,t,e){return r?r.concat(t).map(function(n,s){return n=xc(n),!e&&s?"["+n+"]":n}).join(e?".":""):t}function g_(r){return I.isArray(r)&&!r.some(Ma)}const p_=I.toFlatObject(I,{},null,function(t){return/^is[A-Z]/.test(t)});function Rs(r,t,e){if(!I.isObject(r))throw new TypeError("target must be an object");t=t||new FormData,e=I.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,T){return!I.isUndefined(T[w])});const i=e.metaTokens,n=e.visitor||f,s=e.dots,a=e.indexes,c=(e.Blob||typeof Blob<"u"&&Blob)&&I.isSpecCompliantForm(t);if(!I.isFunction(n))throw new TypeError("visitor must be a function");function d(v){if(v===null)return"";if(I.isDate(v))return v.toISOString();if(!c&&I.isBlob(v))throw new vt("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(v)||I.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function f(v,w,T){let M=v;if(v&&!T&&typeof v=="object"){if(I.endsWith(w,"{}"))w=i?w:w.slice(0,-2),v=JSON.stringify(v);else if(I.isArray(v)&&g_(v)||(I.isFileList(v)||I.endsWith(w,"[]"))&&(M=I.toArray(v)))return w=xc(w),M.forEach(function(b,C){!(I.isUndefined(b)||b===null)&&t.append(a===!0?wc([w],C,s):a===null?w:w+"[]",d(b))}),!1}return Ma(v)?!0:(t.append(wc(T,w,s),d(v)),!1)}const p=[],_=Object.assign(p_,{defaultVisitor:f,convertValue:d,isVisitable:Ma});function y(v,w){if(!I.isUndefined(v)){if(p.indexOf(v)!==-1)throw Error("Circular reference detected in "+w.join("."));p.push(v),I.forEach(v,function(M,E){(!(I.isUndefined(M)||M===null)&&n.call(t,M,I.isString(E)?E.trim():E,w,_))===!0&&y(M,w?w.concat(E):[E])}),p.pop()}}if(!I.isObject(r))throw new TypeError("data must be an object");return y(r),t}function Ec(r){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function Sa(r,t){this._pairs=[],r&&Rs(r,this,t)}const Lc=Sa.prototype;Lc.append=function(t,e){this._pairs.push([t,e])},Lc.toString=function(t){const e=t?function(i){return t.call(this,i,Ec)}:Ec;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function __(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function bc(r,t,e){if(!t)return r;const i=e&&e.encode||__,n=e&&e.serialize;let s;if(n?s=n(t,e):s=I.isURLSearchParams(t)?t.toString():new Sa(t,e).toString(i),s){const a=r.indexOf("#");a!==-1&&(r=r.slice(0,a)),r+=(r.indexOf("?")===-1?"?":"&")+s}return r}class m_{constructor(){this.handlers=[]}use(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){I.forEach(this.handlers,function(i){i!==null&&t(i)})}}const Tc=m_,Cc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},y_=typeof URLSearchParams<"u"?URLSearchParams:Sa,v_=typeof FormData<"u"?FormData:null,x_=typeof Blob<"u"?Blob:null,w_=(()=>{let r;return typeof navigator<"u"&&((r=navigator.product)==="ReactNative"||r==="NativeScript"||r==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),E_=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Ze={isBrowser:!0,classes:{URLSearchParams:y_,FormData:v_,Blob:x_},isStandardBrowserEnv:w_,isStandardBrowserWebWorkerEnv:E_,protocols:["http","https","file","blob","url","data"]};function L_(r,t){return Rs(r,new Ze.classes.URLSearchParams,Object.assign({visitor:function(e,i,n,s){return Ze.isNode&&I.isBuffer(e)?(this.append(i,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function b_(r){return I.matchAll(/\w+|\[(\w*)]/g,r).map(t=>t[0]==="[]"?"":t[1]||t[0])}function T_(r){const t={},e=Object.keys(r);let i;const n=e.length;let s;for(i=0;i<n;i++)s=e[i],t[s]=r[s];return t}function Mc(r){function t(e,i,n,s){let a=e[s++];const h=Number.isFinite(+a),c=s>=e.length;return a=!a&&I.isArray(n)?n.length:a,c?(I.hasOwnProp(n,a)?n[a]=[n[a],i]:n[a]=i,!h):((!n[a]||!I.isObject(n[a]))&&(n[a]=[]),t(e,i,n[a],s)&&I.isArray(n[a])&&(n[a]=T_(n[a])),!h)}if(I.isFormData(r)&&I.isFunction(r.entries)){const e={};return I.forEachEntry(r,(i,n)=>{t(b_(i),n,e,0)}),e}return null}const C_={"Content-Type":void 0};function M_(r,t,e){if(I.isString(r))try{return(t||JSON.parse)(r),I.trim(r)}catch(i){if(i.name!=="SyntaxError")throw i}return(e||JSON.stringify)(r)}const As={transitional:Cc,adapter:["xhr","http"],transformRequest:[function(t,e){const i=e.getContentType()||"",n=i.indexOf("application/json")>-1,s=I.isObject(t);if(s&&I.isHTMLForm(t)&&(t=new FormData(t)),I.isFormData(t))return n&&n?JSON.stringify(Mc(t)):t;if(I.isArrayBuffer(t)||I.isBuffer(t)||I.isStream(t)||I.isFile(t)||I.isBlob(t))return t;if(I.isArrayBufferView(t))return t.buffer;if(I.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let h;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return L_(t,this.formSerializer).toString();if((h=I.isFileList(t))||i.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Rs(h?{"files[]":t}:t,c&&new c,this.formSerializer)}}return s||n?(e.setContentType("application/json",!1),M_(t)):t}],transformResponse:[function(t){const e=this.transitional||As.transitional,i=e&&e.forcedJSONParsing,n=this.responseType==="json";if(t&&I.isString(t)&&(i&&!this.responseType||n)){const a=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(h){if(a)throw h.name==="SyntaxError"?vt.from(h,vt.ERR_BAD_RESPONSE,this,null,this.response):h}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ze.classes.FormData,Blob:Ze.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};I.forEach(["delete","get","head"],function(t){As.headers[t]={}}),I.forEach(["post","put","patch"],function(t){As.headers[t]=I.merge(C_)});const Pa=As,S_=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),P_=r=>{const t={};let e,i,n;return r&&r.split(`
|
|
14
|
+
`).forEach(function(a){n=a.indexOf(":"),e=a.substring(0,n).trim().toLowerCase(),i=a.substring(n+1).trim(),!(!e||t[e]&&S_[e])&&(e==="set-cookie"?t[e]?t[e].push(i):t[e]=[i]:t[e]=t[e]?t[e]+", "+i:i)}),t},Sc=Symbol("internals");function Lr(r){return r&&String(r).trim().toLowerCase()}function Is(r){return r===!1||r==null?r:I.isArray(r)?r.map(Is):String(r)}function k_(r){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=e.exec(r);)t[i[1]]=i[2];return t}const R_=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function ka(r,t,e,i,n){if(I.isFunction(i))return i.call(this,t,e);if(n&&(t=e),!!I.isString(t)){if(I.isString(i))return t.indexOf(i)!==-1;if(I.isRegExp(i))return i.test(t)}}function A_(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,i)=>e.toUpperCase()+i)}function I_(r,t){const e=I.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(r,i+e,{value:function(n,s,a){return this[i].call(this,t,n,s,a)},configurable:!0})})}class Ds{constructor(t){t&&this.set(t)}set(t,e,i){const n=this;function s(h,c,d){const f=Lr(c);if(!f)throw new Error("header name must be a non-empty string");const p=I.findKey(n,f);(!p||n[p]===void 0||d===!0||d===void 0&&n[p]!==!1)&&(n[p||c]=Is(h))}const a=(h,c)=>I.forEach(h,(d,f)=>s(d,f,c));return I.isPlainObject(t)||t instanceof this.constructor?a(t,e):I.isString(t)&&(t=t.trim())&&!R_(t)?a(P_(t),e):t!=null&&s(e,t,i),this}get(t,e){if(t=Lr(t),t){const i=I.findKey(this,t);if(i){const n=this[i];if(!e)return n;if(e===!0)return k_(n);if(I.isFunction(e))return e.call(this,n,i);if(I.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Lr(t),t){const i=I.findKey(this,t);return!!(i&&this[i]!==void 0&&(!e||ka(this,this[i],i,e)))}return!1}delete(t,e){const i=this;let n=!1;function s(a){if(a=Lr(a),a){const h=I.findKey(i,a);h&&(!e||ka(i,i[h],h,e))&&(delete i[h],n=!0)}}return I.isArray(t)?t.forEach(s):s(t),n}clear(t){const e=Object.keys(this);let i=e.length,n=!1;for(;i--;){const s=e[i];(!t||ka(this,this[s],s,t,!0))&&(delete this[s],n=!0)}return n}normalize(t){const e=this,i={};return I.forEach(this,(n,s)=>{const a=I.findKey(i,s);if(a){e[a]=Is(n),delete e[s];return}const h=t?A_(s):String(s).trim();h!==s&&delete e[s],e[h]=Is(n),i[h]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return I.forEach(this,(i,n)=>{i!=null&&i!==!1&&(e[n]=t&&I.isArray(i)?i.join(", "):i)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
|
|
15
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const i=new this(t);return e.forEach(n=>i.set(n)),i}static accessor(t){const i=(this[Sc]=this[Sc]={accessors:{}}).accessors,n=this.prototype;function s(a){const h=Lr(a);i[h]||(I_(n,a),i[h]=!0)}return I.isArray(t)?t.forEach(s):s(t),this}}Ds.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),I.freezeMethods(Ds.prototype),I.freezeMethods(Ds);const oi=Ds;function Ra(r,t){const e=this||Pa,i=t||e,n=oi.from(i.headers);let s=i.data;return I.forEach(r,function(h){s=h.call(e,s,n.normalize(),t?t.status:void 0)}),n.normalize(),s}function Pc(r){return!!(r&&r.__CANCEL__)}function br(r,t,e){vt.call(this,r??"canceled",vt.ERR_CANCELED,t,e),this.name="CanceledError"}I.inherits(br,vt,{__CANCEL__:!0});function D_(r,t,e){const i=e.config.validateStatus;!e.status||!i||i(e.status)?r(e):t(new vt("Request failed with status code "+e.status,[vt.ERR_BAD_REQUEST,vt.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}const O_=Ze.isStandardBrowserEnv?function(){return{write:function(e,i,n,s,a,h){const c=[];c.push(e+"="+encodeURIComponent(i)),I.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),I.isString(s)&&c.push("path="+s),I.isString(a)&&c.push("domain="+a),h===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(e){const i=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function F_(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function z_(r,t){return t?r.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):r}function kc(r,t){return r&&!F_(t)?z_(r,t):t}const N_=Ze.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let i;function n(s){let a=s;return t&&(e.setAttribute("href",a),a=e.href),e.setAttribute("href",a),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return i=n(window.location.href),function(a){const h=I.isString(a)?n(a):a;return h.protocol===i.protocol&&h.host===i.host}}():function(){return function(){return!0}}();function B_(r){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return t&&t[1]||""}function G_(r,t){r=r||10;const e=new Array(r),i=new Array(r);let n=0,s=0,a;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),f=i[s];a||(a=d),e[n]=c,i[n]=d;let p=s,_=0;for(;p!==n;)_+=e[p++],p=p%r;if(n=(n+1)%r,n===s&&(s=(s+1)%r),d-a<t)return;const y=f&&d-f;return y?Math.round(_*1e3/y):void 0}}function Rc(r,t){let e=0;const i=G_(50,250);return n=>{const s=n.loaded,a=n.lengthComputable?n.total:void 0,h=s-e,c=i(h),d=s<=a;e=s;const f={loaded:s,total:a,progress:a?s/a:void 0,bytes:h,rate:c||void 0,estimated:c&&a&&d?(a-s)/c:void 0,event:n};f[t?"download":"upload"]=!0,r(f)}}const Os={http:f_,xhr:typeof XMLHttpRequest<"u"&&function(r){return new Promise(function(e,i){let n=r.data;const s=oi.from(r.headers).normalize(),a=r.responseType;let h;function c(){r.cancelToken&&r.cancelToken.unsubscribe(h),r.signal&&r.signal.removeEventListener("abort",h)}I.isFormData(n)&&(Ze.isStandardBrowserEnv||Ze.isStandardBrowserWebWorkerEnv?s.setContentType(!1):s.setContentType("multipart/form-data;",!1));let d=new XMLHttpRequest;if(r.auth){const y=r.auth.username||"",v=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";s.set("Authorization","Basic "+btoa(y+":"+v))}const f=kc(r.baseURL,r.url);d.open(r.method.toUpperCase(),bc(f,r.params,r.paramsSerializer),!0),d.timeout=r.timeout;function p(){if(!d)return;const y=oi.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),w={data:!a||a==="text"||a==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:y,config:r,request:d};D_(function(M){e(M),c()},function(M){i(M),c()},w),d=null}if("onloadend"in d?d.onloadend=p:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(p)},d.onabort=function(){d&&(i(new vt("Request aborted",vt.ECONNABORTED,r,d)),d=null)},d.onerror=function(){i(new vt("Network Error",vt.ERR_NETWORK,r,d)),d=null},d.ontimeout=function(){let v=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const w=r.transitional||Cc;r.timeoutErrorMessage&&(v=r.timeoutErrorMessage),i(new vt(v,w.clarifyTimeoutError?vt.ETIMEDOUT:vt.ECONNABORTED,r,d)),d=null},Ze.isStandardBrowserEnv){const y=(r.withCredentials||N_(f))&&r.xsrfCookieName&&O_.read(r.xsrfCookieName);y&&s.set(r.xsrfHeaderName,y)}n===void 0&&s.setContentType(null),"setRequestHeader"in d&&I.forEach(s.toJSON(),function(v,w){d.setRequestHeader(w,v)}),I.isUndefined(r.withCredentials)||(d.withCredentials=!!r.withCredentials),a&&a!=="json"&&(d.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&d.addEventListener("progress",Rc(r.onDownloadProgress,!0)),typeof r.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",Rc(r.onUploadProgress)),(r.cancelToken||r.signal)&&(h=y=>{d&&(i(!y||y.type?new br(null,r,d):y),d.abort(),d=null)},r.cancelToken&&r.cancelToken.subscribe(h),r.signal&&(r.signal.aborted?h():r.signal.addEventListener("abort",h)));const _=B_(f);if(_&&Ze.protocols.indexOf(_)===-1){i(new vt("Unsupported protocol "+_+":",vt.ERR_BAD_REQUEST,r));return}d.send(n||null)})}};I.forEach(Os,(r,t)=>{if(r){try{Object.defineProperty(r,"name",{value:t})}catch{}Object.defineProperty(r,"adapterName",{value:t})}});const U_={getAdapter:r=>{r=I.isArray(r)?r:[r];const{length:t}=r;let e,i;for(let n=0;n<t&&(e=r[n],!(i=I.isString(e)?Os[e.toLowerCase()]:e));n++);if(!i)throw i===!1?new vt(`Adapter ${e} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(I.hasOwnProp(Os,e)?`Adapter '${e}' is not available in the build`:`Unknown adapter '${e}'`);if(!I.isFunction(i))throw new TypeError("adapter is not a function");return i},adapters:Os};function Aa(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new br(null,r)}function Ac(r){return Aa(r),r.headers=oi.from(r.headers),r.data=Ra.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),U_.getAdapter(r.adapter||Pa.adapter)(r).then(function(i){return Aa(r),i.data=Ra.call(r,r.transformResponse,i),i.headers=oi.from(i.headers),i},function(i){return Pc(i)||(Aa(r),i&&i.response&&(i.response.data=Ra.call(r,r.transformResponse,i.response),i.response.headers=oi.from(i.response.headers))),Promise.reject(i)})}const Ic=r=>r instanceof oi?r.toJSON():r;function Rn(r,t){t=t||{};const e={};function i(d,f,p){return I.isPlainObject(d)&&I.isPlainObject(f)?I.merge.call({caseless:p},d,f):I.isPlainObject(f)?I.merge({},f):I.isArray(f)?f.slice():f}function n(d,f,p){if(I.isUndefined(f)){if(!I.isUndefined(d))return i(void 0,d,p)}else return i(d,f,p)}function s(d,f){if(!I.isUndefined(f))return i(void 0,f)}function a(d,f){if(I.isUndefined(f)){if(!I.isUndefined(d))return i(void 0,d)}else return i(void 0,f)}function h(d,f,p){if(p in t)return i(d,f);if(p in r)return i(void 0,d)}const c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:h,headers:(d,f)=>n(Ic(d),Ic(f),!0)};return I.forEach(Object.keys(Object.assign({},r,t)),function(f){const p=c[f]||n,_=p(r[f],t[f],f);I.isUndefined(_)&&p!==h||(e[f]=_)}),e}const Dc="1.4.0",Ia={};["object","boolean","number","function","string","symbol"].forEach((r,t)=>{Ia[r]=function(i){return typeof i===r||"a"+(t<1?"n ":" ")+r}});const Oc={};Ia.transitional=function(t,e,i){function n(s,a){return"[Axios v"+Dc+"] Transitional option '"+s+"'"+a+(i?". "+i:"")}return(s,a,h)=>{if(t===!1)throw new vt(n(a," has been removed"+(e?" in "+e:"")),vt.ERR_DEPRECATED);return e&&!Oc[a]&&(Oc[a]=!0,console.warn(n(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(s,a,h):!0}};function j_(r,t,e){if(typeof r!="object")throw new vt("options must be an object",vt.ERR_BAD_OPTION_VALUE);const i=Object.keys(r);let n=i.length;for(;n-- >0;){const s=i[n],a=t[s];if(a){const h=r[s],c=h===void 0||a(h,s,r);if(c!==!0)throw new vt("option "+s+" must be "+c,vt.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new vt("Unknown option "+s,vt.ERR_BAD_OPTION)}}const Da={assertOptions:j_,validators:Ia},Si=Da.validators;class Fs{constructor(t){this.defaults=t,this.interceptors={request:new Tc,response:new Tc}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Rn(this.defaults,e);const{transitional:i,paramsSerializer:n,headers:s}=e;i!==void 0&&Da.assertOptions(i,{silentJSONParsing:Si.transitional(Si.boolean),forcedJSONParsing:Si.transitional(Si.boolean),clarifyTimeoutError:Si.transitional(Si.boolean)},!1),n!=null&&(I.isFunction(n)?e.paramsSerializer={serialize:n}:Da.assertOptions(n,{encode:Si.function,serialize:Si.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a;a=s&&I.merge(s.common,s[e.method]),a&&I.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),e.headers=oi.concat(a,s);const h=[];let c=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(e)===!1||(c=c&&w.synchronous,h.unshift(w.fulfilled,w.rejected))});const d=[];this.interceptors.response.forEach(function(w){d.push(w.fulfilled,w.rejected)});let f,p=0,_;if(!c){const v=[Ac.bind(this),void 0];for(v.unshift.apply(v,h),v.push.apply(v,d),_=v.length,f=Promise.resolve(e);p<_;)f=f.then(v[p++],v[p++]);return f}_=h.length;let y=e;for(p=0;p<_;){const v=h[p++],w=h[p++];try{y=v(y)}catch(T){w.call(this,T);break}}try{f=Ac.call(this,y)}catch(v){return Promise.reject(v)}for(p=0,_=d.length;p<_;)f=f.then(d[p++],d[p++]);return f}getUri(t){t=Rn(this.defaults,t);const e=kc(t.baseURL,t.url);return bc(e,t.params,t.paramsSerializer)}}I.forEach(["delete","get","head","options"],function(t){Fs.prototype[t]=function(e,i){return this.request(Rn(i||{},{method:t,url:e,data:(i||{}).data}))}}),I.forEach(["post","put","patch"],function(t){function e(i){return function(s,a,h){return this.request(Rn(h||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Fs.prototype[t]=e(),Fs.prototype[t+"Form"]=e(!0)});const zs=Fs;class Oa{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(s){e=s});const i=this;this.promise.then(n=>{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](n);i._listeners=null}),this.promise.then=n=>{let s;const a=new Promise(h=>{i.subscribe(h),s=h}).then(n);return a.cancel=function(){i.unsubscribe(s)},a},t(function(s,a,h){i.reason||(i.reason=new br(s,a,h),e(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}static source(){let t;return{token:new Oa(function(n){t=n}),cancel:t}}}const Z_=Oa;function W_(r){return function(e){return r.apply(null,e)}}function H_(r){return I.isObject(r)&&r.isAxiosError===!0}const Fa={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Fa).forEach(([r,t])=>{Fa[t]=r});const V_=Fa;function Fc(r){const t=new zs(r),e=lc(zs.prototype.request,t);return I.extend(e,zs.prototype,t,{allOwnKeys:!0}),I.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return Fc(Rn(r,n))},e}const jt=Fc(Pa);jt.Axios=zs,jt.CanceledError=br,jt.CancelToken=Z_,jt.isCancel=Pc,jt.VERSION=Dc,jt.toFormData=Rs,jt.AxiosError=vt,jt.Cancel=jt.CanceledError,jt.all=function(t){return Promise.all(t)},jt.spread=W_,jt.isAxiosError=H_,jt.mergeConfig=Rn,jt.AxiosHeaders=oi,jt.formToJSON=r=>Mc(I.isHTMLForm(r)?new FormData(r):r),jt.HttpStatusCode=V_,jt.default=jt;const zc=jt,Ns="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBVcGxvYWRlZCB0bzogU1ZHIFJlcG8sIHd3dy5zdmdyZXBvLmNvbSwgR2VuZXJhdG9yOiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4NCjxzdmcgZmlsbD0iIzAwMDAwMCIgaGVpZ2h0PSI4MDBweCIgd2lkdGg9IjgwMHB4IiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiANCgkgdmlld0JveD0iMCAwIDUwMS4zMzcgNTAxLjMzNyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8Zz4NCgkJPHBhdGggZD0iTTQ5Ni45NjIsMi4wMzFjLTIuNzczLTIuMDI3LTYuNC0yLjU2LTkuNi0xLjQ5M0wzMzAuNjY5LDUyLjgwNEwxNzMuOTc1LDAuNTM3Yy0xLjA2Ny0wLjMyLTIuMTMzLTAuNTMzLTMuMi0wLjUzM2gtMC4xMDcNCgkJCWgtMC4xMDdjLTEuMDY3LDAtMi4xMzMsMC4yMTMtMy4yLDAuNTMzbC0xNjAsNTMuMzMzYy00LjM3MywxLjM4Ny03LjM2LDUuNTQ3LTcuMzYsMTAuMTMzdjQyNi4yNGMwLDMuMzA3LDEuMzg3LDYuNjEzLDMuOTQ3LDguNjQNCgkJCWMyLjk4NywyLjQ1Myw2LjgyNywyLjk4NywxMC4xMzMsMS45MmwxNTYuNjkzLTUyLjI2N2wxNTYuNjkzLDUyLjI2N2MxLjA2NywwLjMyLDIuMTMzLDAuNTMzLDMuMiwwLjUzM2gwLjEwN2gwLjEwNw0KCQkJYzEuMDY3LDAsMi4xMzMtMC4yMTMsMy4yLTAuNTMzbDE2MC01My4zMzNjNC4zNzMtMS40OTMsNy4yNTMtNS41NDcsNy4yNTMtMTAuMTMzVjEwLjY3MQ0KCQkJQzUwMS4zMzUsNy4yNTcsNDk5LjczNSw0LjA1Nyw0OTYuOTYyLDIuMDMxeiBNNzQuNjY5LDQ1OC4xMzdsLTUzLjMzMywxNy44MTNWMjg1LjAxN2w1My4zMzMtMTcuODEzVjQ1OC4xMzd6IE0xNjAuMDAyLDQyOS42NTcNCgkJCWwtNjQsMjEuMzMzVjI2MC4xNjRsNjQtMjEuMzMzVjQyOS42NTd6IE0xNjAuMDAyLDIxNi4zMjRsLTY0LDIxLjMzM3YtODUuMjI3bDY0LTE4LjQ1M1YyMTYuMzI0eiBNMTYwLjAwMiwxMTEuODk3bC03Ny42NTMsMjIuNA0KCQkJYy00LjU4NywxLjI4LTcuNjgsNS41NDctNy42OCwxMC4yNHYxMDAuMjY3bC01My4zMzMsMTcuODEzVjcxLjY4NGwxMzguNjY3LTQ2LjE4N1YxMTEuODk3eiBNMzIwLjAwMiw0NzUuOTUxbC01My4zMzMtMTcuNzA3DQoJCQlWMzQxLjAxN2w1My4zMzMsMjEuNzZWNDc1Ljk1MXogTTMyMC4wMDIsMzM5LjczN2wtNTkuOTQ3LTI0LjQyN2MtNS40NC0yLjI0LTExLjczMywwLjQyNy0xMy44NjcsNS44NjcNCgkJCWMtMC41MzMsMS4yOC0wLjc0NywyLjY2Ny0wLjc0Nyw0LjA1M3YxMjUuODY3bC02NC0yMS4zMzNWMjM4Ljg2NmwxMzguNTYsNDYuMTUxVjMzOS43Mzd6IE0zMjAuMDAyLDI2Mi41MTFsLTEzOC42NjctNDYuMTg3DQoJCQlWMjUuNDk3bDEzOC42NjcsNDYuMTg3VjI2Mi41MTF6IE0zNDEuMzM1LDE3OS4wOTdsNjQtMjEuNjUzdjgzLjczM2wtNjQsMjEuMzMzVjE3OS4wOTd6IE00ODAuMDAyLDQyOS42NTdsLTEzOC42NjcsNDYuMTg3DQoJCQlWMjg1LjAxN2wxMzguNjY3LTQ2LjE4N1Y0MjkuNjU3eiBNNDgwLjAwMiwyMTYuMzI0bC01My4zMzMsMTcuODEzdi04My44NGw1My4zMzMtMTguMDI3VjIxNi4zMjR6IE00ODAuMDAyLDEwOS43NjQNCgkJCWwtMTM4LjY2Nyw0Ni44MjdWNzEuNjg0bDEzOC42NjctNDYuMTg3VjEwOS43NjR6Ii8+DQoJPC9nPg0KPC9nPg0KPC9zdmc+",Bs="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBVcGxvYWRlZCB0bzogU1ZHIFJlcG8sIHd3dy5zdmdyZXBvLmNvbSwgR2VuZXJhdG9yOiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4NCjxzdmcgaGVpZ2h0PSI4MDBweCIgd2lkdGg9IjgwMHB4IiB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIA0KCSB2aWV3Qm94PSIwIDAgNTMgNTMiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHBvbHlnb24gc3R5bGU9ImZpbGw6IzQzQjA1QzsiIHBvaW50cz0iMTgsMjMuMjQzIDIuMjU2LDcuNDk5IDAsOCAwLDUxIDIuMDk5LDUwLjUzNCAxOCwzNC42MzIgIi8+DQo8cG9seWdvbiBzdHlsZT0iZmlsbDojNDhBMERDOyIgcG9pbnRzPSI5LjM3Miw0OC45MTcgMTgsNDcgMTgsNDAuMjg5ICIvPg0KPHBvbHlnb24gc3R5bGU9ImZpbGw6IzQzQjA1QzsiIHBvaW50cz0iMTgsNCA2Ljg4NCw2LjQ3IDE4LDE3LjU4NiAiLz4NCjxwb2x5Z29uIHN0eWxlPSJmaWxsOiM0M0IwNUM7IiBwb2ludHM9IjQ5LjQ0OSwzLjE4NCAzNSw4IDM1LDE3LjYzMiAiLz4NCjxwb2x5Z29uIHN0eWxlPSJmaWxsOiM0OEEwREM7IiBwb2ludHM9IjM1LDIzLjI4OSAzNSw1MCA1Myw0MyA1Myw1LjI4OSAiLz4NCjxwb2x5Z29uIHN0eWxlPSJmaWxsOiMzRDk5NEY7IiBwb2ludHM9IjI2LjUyMywyNi4xMDkgMzUsMTcuNjMyIDM1LDggMTgsNCAxOCwxNy41ODYgIi8+DQo8cG9seWdvbiBzdHlsZT0iZmlsbDojM0Q5OTRGOyIgcG9pbnRzPSIxOCwyMy4yNDMgMTgsMzQuNjMyIDIzLjY5NSwyOC45MzggIi8+DQo8cG9seWdvbiBzdHlsZT0iZmlsbDojNDM5M0JGOyIgcG9pbnRzPSIxOCw0MC4yODkgMTgsNDcgMzUsNTAgMzUsMjMuMjg5ICIvPg0KPHBvbHlnb24gc3R5bGU9ImZpbGw6I0VGQ0U0QTsiIHBvaW50cz0iMTgsMTcuNTg2IDYuODg0LDYuNDcgMi4yNTYsNy40OTkgMTgsMjMuMjQzICIvPg0KPHBvbHlnb24gc3R5bGU9ImZpbGw6I0VGQ0U0QTsiIHBvaW50cz0iMTgsMzQuNjMyIDIuMDk5LDUwLjUzNCA5LjM3Miw0OC45MTcgMTgsNDAuMjg5ICIvPg0KPHBvbHlnb24gc3R5bGU9ImZpbGw6I0VGQ0U0QTsiIHBvaW50cz0iMzUsMjMuMjg5IDUzLDUuMjg5IDUzLDIgNDkuNDQ5LDMuMTg0IDM1LDE3LjYzMiAiLz4NCjxwb2x5Z29uIHN0eWxlPSJmaWxsOiNENkI0NDU7IiBwb2ludHM9IjI2LjUyMywyNi4xMDkgMTgsMTcuNTg2IDE4LDIzLjI0MyAyMy42OTUsMjguOTM4IDE4LDM0LjYzMiAxOCw0MC4yODkgMzUsMjMuMjg5IDM1LDE3LjYzMiANCgkiLz4NCjwvc3ZnPg==";J.Edit.Circle=J.Edit.CircleMarker.extend({_createResizeMarker:function(){var r=this._shape.getLatLng(),t=this._getResizeMarkerPoint(r);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(t,this.options.resizeIcon))},_getResizeMarkerPoint:function(r){var t=this._shape._radius*Math.cos(Math.PI/4),e=this._map.project(r);return this._map.unproject([e.x+t,e.y-t])},_resize:function(r){var t=this._moveMarker.getLatLng(),e;J.GeometryUtil.isVersion07x()?e=t.distanceTo(r):e=this._map.distance(t,r),this._shape.setRadius(e),this._map.fire(J.Draw.Event.EDITRESIZE,{layer:this._shape})}});const X_=U.defineComponent({name:"MapView",props:{loadPolygon:Boolean,reverseCoordinatesPolygon:Boolean,dataPolygon:Object,configurationMap:Object,coordinatesMap:Array,getGeoJSON:Function,getCoodMarker:Function,isSatelite:Boolean},data(){return{idMap:"",mapRender:null,markerRender:null,renderCoordinates:this.coordinatesMap,renderGeojson:this.dataPolygon,markerIcon:{iconUrl:Es,iconSize:[25,41],iconAnchor:[12,41]},layersFeatureGroup:null,featuresData:null,currentTileLayer:null,isSatelliteView:!1}},mounted(){this.makeid(10),this.renderMap()},methods:{createSatelliteControl(){const r=J.Control.extend({onAdd:t=>{const e=J.DomUtil.create("div","leaflet-control-draw leaflet-bar leaflet-control"),i=J.DomUtil.create("a","leaflet-draw-draw-satellite",e);return i.href="#",i.title=this.isSatelliteView?"Vista Normal":"Vista Satélite",i.style.backgroundImage=this.isSatelliteView?`url(${Ns})`:`url(${Bs})`,i.style.backgroundPosition="center",i.style.backgroundRepeat="no-repeat",i.style.backgroundSize="20px 20px",J.DomEvent.disableClickPropagation(i),J.DomEvent.on(i,"click",this.toggleSatelliteView,this),e}});return new r({position:"topleft"})},toggleSatelliteView(){if(!this.mapRender||!this.currentTileLayer)return;this.isSatelliteView=!this.isSatelliteView,this.mapRender.removeLayer(this.currentTileLayer),this.isSatelliteView?this.currentTileLayer=J.tileLayer("https://api.maptiler.com/maps/satellite/{z}/{x}/{y}.jpg?key=t8mWT2ozs1JWBqMZOnZr",{attribution:'© <a href="https://www.maptiler.com/">MapTiler</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}):this.currentTileLayer=J.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),this.currentTileLayer.addTo(this.mapRender),document.querySelectorAll(".leaflet-draw-draw-satellite").forEach(t=>{const e=t;e.style.backgroundImage=this.isSatelliteView?`url(${Ns})`:`url(${Bs})`,e.title=this.isSatelliteView?"Vista Normal":"Vista Satélite"})},getLayersFeaturesInGeoJson(){const r=J.geoJSON().addTo(this.mapRender);return this.featuresData.eachLayer(e=>{r.addLayer(e)}),[r.toGeoJSON()]},triggerSaveEdit(){var t,e,i;(i=(e=(t=(document.getElementsByClassName("leaflet-draw-actions leaflet-draw-actions-top")||document.getElementsByClassName("leaflet-draw-actions leaflet-draw-actions-top leaflet-draw-actions-bottom"))[0])==null?void 0:t.querySelector("li"))==null?void 0:e.querySelector("a"))==null||i.click()},makeid(r){let t="";const e="abcdefghijklmnopqrstuvwxyz",i=e.length;let n=0;for(;n<r;)t+=e.charAt(Math.floor(Math.random()*i)),n+=1;this.idMap=t},renderMap(){Ip("es"),setTimeout(()=>{this.loadPolygon?this.viewMap():this.createMap()},500)},createMap(){var a,h,c,d,f,p,_,y,v,w;const r=this.configurationMap?this.configurationMap.iconMarker?this.configurationMap.iconMarker:this.markerIcon:this.markerIcon;window.type=!0;const t=J.map(this.idMap,{fullscreenControl:!0}).setView([this.renderCoordinates?this.renderCoordinates[0]:0,this.renderCoordinates?this.renderCoordinates[1]:0],this.renderCoordinates?this.renderCoordinates[2]:0);if(this.mapRender=t,this.isSatelliteView=this.isSatelite||!1,this.isSatelliteView?this.currentTileLayer=J.tileLayer("https://api.maptiler.com/maps/satellite/{z}/{x}/{y}.jpg?key=t8mWT2ozs1JWBqMZOnZr",{attribution:'© <a href="https://www.maptiler.com/">MapTiler</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}):this.currentTileLayer=J.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),this.currentTileLayer.addTo(t),this.isSatelite!==void 0){const T=this.createSatelliteControl();t.addControl(T)}if(t.setZoom((a=this.configurationMap)==null?void 0:a.maxZoom),this.configurationMap.renderMarker){const T=J.marker([this.renderCoordinates?this.renderCoordinates[0]:0,this.renderCoordinates?this.renderCoordinates[1]:0],{icon:J.icon(r),draggable:this.configurationMap.dragMarker}).addTo(t);this.markerRender=T,this.getCoodMarker&&T.on("dragend",M=>{const E=M.target.getLatLng(),b=E.lat,C=E.lng;this.getCoodMarker&&this.getCoodMarker(b,C)})}const e=J.featureGroup();this.featuresData=e;const i=e.addTo(t);let n={featureGroup:i,edit:!1,remove:(h=this.configurationMap)==null?void 0:h.editFigures.remove};(c=this.configurationMap)!=null&&c.editFigures.edit&&(n={featureGroup:i,...(d=this.configurationMap)==null?void 0:d.editFigures.edit,remove:(f=this.configurationMap)==null?void 0:f.editFigures.remove});const s=new J.Control.Draw({position:"topleft",draw:{polygon:(p=this.configurationMap)==null?void 0:p.createFigures.polygon,circle:!1,rectangle:(_=this.configurationMap)!=null&&_.createFigures.rectangle?{shapeOptions:{color:"blue"}}:!1,marker:(y=this.configurationMap)!=null&&y.createFigures.marker?{icon:J.icon(r)}:!1,polyline:(v=this.configurationMap)!=null&&v.createFigures.polyline?{shapeOptions:{color:"blue"}}:!1,circlemarker:(w=this.configurationMap)==null?void 0:w.createFigures.multipoint},edit:n});t.addControl(s),t.on("draw:created",T=>{var b,C,P,R,D,O,G,X,Y,q,st,_t,V,H,j;const M=T.layer;i.addLayer(M);let E=M.toGeoJSON();T.layerType==="circlemarker"&&(E={type:"Feature",geometry:{type:"MultiPoint",coordinates:[E.geometry.coordinates]},properties:{...E.properties,pointType:"multipoint",style:{color:((P=(C=(b=this.configurationMap)==null?void 0:b.createFigures)==null?void 0:C.multipoint)==null?void 0:P.color)||"green",fillColor:((O=(D=(R=this.configurationMap)==null?void 0:R.createFigures)==null?void 0:D.multipoint)==null?void 0:O.fillColor)||"green",fillOpacity:((Y=(X=(G=this.configurationMap)==null?void 0:G.createFigures)==null?void 0:X.multipoint)==null?void 0:Y.fillOpacity)||.8,radius:((_t=(st=(q=this.configurationMap)==null?void 0:q.createFigures)==null?void 0:st.multipoint)==null?void 0:_t.radius)||6,weight:((j=(H=(V=this.configurationMap)==null?void 0:V.createFigures)==null?void 0:H.multipoint)==null?void 0:j.weight)||2}}}),this.getGeoJSON&&this.getGeoJSON([E])}),t.on("draw:edited",T=>{T.layers.eachLayer(E=>{const b=E.toGeoJSON();this.getGeoJSON&&this.getGeoJSON([b])})})},viewMap(){var h,c,d,f,p,_,y,v,w,T;const r=this.configurationMap?this.configurationMap.iconMarker?this.configurationMap.iconMarker:this.markerIcon:this.markerIcon;window.type=!0;const t=J.map(this.idMap,{fullscreenControl:!0}).setView([this.renderCoordinates?this.renderCoordinates[0]:0,this.renderCoordinates?this.renderCoordinates[1]:0],this.renderCoordinates?this.renderCoordinates[2]:0);if(this.mapRender=t,this.isSatelliteView=this.isSatelite||!1,this.isSatelliteView?this.currentTileLayer=J.tileLayer("https://api.maptiler.com/maps/satellite/{z}/{x}/{y}.jpg?key=t8mWT2ozs1JWBqMZOnZr",{attribution:'© <a href="https://www.maptiler.com/">MapTiler</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}):this.currentTileLayer=J.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),this.currentTileLayer.addTo(t),this.isSatelite!==void 0){const M=this.createSatelliteControl();t.addControl(M)}t.setZoom((h=this.configurationMap)==null?void 0:h.maxZoom);const e=J.featureGroup();this.featuresData=e;const i=e.addTo(t);let n={featureGroup:i,edit:!1,remove:(c=this.configurationMap)==null?void 0:c.editFigures.remove};(d=this.configurationMap)!=null&&d.editFigures.edit&&(n={featureGroup:i,...(f=this.configurationMap)==null?void 0:f.editFigures.edit,remove:(p=this.configurationMap)==null?void 0:p.editFigures.remove});const s=this.renderGeojson;if(s&&s.length){s.forEach(E=>{const b=this;E.type==="FeatureCollection"?E.features.forEach(C=>{(C.geometry.type==="Polygon"||C.geometry.type==="MultiPolygon"||C.geometry.type==="LineString"||C.geometry.type==="MultiLineString"||C.geometry.type==="Point")&&J.geoJson(C,{pointToLayer:this.getPointToLayer.bind(this),onEachFeature:function(P,R){if(i.addLayer(R),P.geometry.type==="Point"){var D=b.getPopupContent(P);R.bindPopup(D)}else if(P.geometry.type==="Polygon"||P.geometry.type==="MultiPolygon"){var O=b.getPolygonTooltipContent(P);R.bindPopup(O)}}})}):E.type==="Feature"&&(E.geometry.type==="Polygon"||E.geometry.type==="MultiPolygon"||E.geometry.type==="LineString"||E.geometry.type==="MultiLineString"||E.geometry.type==="Point")&&J.geoJson(E,{pointToLayer:this.getPointToLayer.bind(this),onEachFeature:function(C,P){if(i.addLayer(P),C.geometry.type==="Point"){var R=b.getPopupContent(C);P.bindPopup(R)}else if(C.geometry.type==="Polygon"||C.geometry.type==="MultiPolygon"){var D=b.getPolygonTooltipContent(C);P.bindPopup(D)}}})});const M=i.getBounds();t.fitBounds(M)}const a=new J.Control.Draw({position:"topleft",draw:{polygon:(_=this.configurationMap)==null?void 0:_.createFigures.polygon,circle:!1,rectangle:(y=this.configurationMap)!=null&&y.createFigures.rectangle?{shapeOptions:{color:"blue"}}:!1,marker:(v=this.configurationMap)!=null&&v.createFigures.marker?{icon:J.icon(r)}:!1,polyline:(w=this.configurationMap)!=null&&w.createFigures.polyline?{shapeOptions:{color:"blue"}}:!1,circlemarker:(T=this.configurationMap)==null?void 0:T.createFigures.multipoint},edit:n});t.addControl(a),t.on("draw:created",M=>{var C,P,R,D,O,G,X,Y,q,st,_t,V,H,j,B;const E=M.layer;i.addLayer(E);let b=E.toGeoJSON();M.layerType==="circlemarker"&&(b={type:"Feature",geometry:{type:"MultiPoint",coordinates:[b.geometry.coordinates]},properties:{...b.properties,pointType:"multipoint",style:{color:((R=(P=(C=this.configurationMap)==null?void 0:C.createFigures)==null?void 0:P.multipoint)==null?void 0:R.color)||"green",fillColor:((G=(O=(D=this.configurationMap)==null?void 0:D.createFigures)==null?void 0:O.multipoint)==null?void 0:G.fillColor)||"green",fillOpacity:((q=(Y=(X=this.configurationMap)==null?void 0:X.createFigures)==null?void 0:Y.multipoint)==null?void 0:q.fillOpacity)||.8,radius:((V=(_t=(st=this.configurationMap)==null?void 0:st.createFigures)==null?void 0:_t.multipoint)==null?void 0:V.radius)||6,weight:((B=(j=(H=this.configurationMap)==null?void 0:H.createFigures)==null?void 0:j.multipoint)==null?void 0:B.weight)||2}}}),this.getGeoJSON&&this.getGeoJSON(b)}),t.on("draw:edited",M=>{M.layers.eachLayer(b=>{const C=b.toGeoJSON();this.getGeoJSON&&this.getGeoJSON(C)})})},getPointToLayer(r,t){var i,n;if(((i=r.geometry)==null?void 0:i.type)==="Point"){const s=(n=r.properties)==null?void 0:n.tipo,a=J.icon({iconUrl:cp,iconSize:[38,38],iconAnchor:[16,41]}),h=J.icon({iconUrl:up,iconSize:[38,38],iconAnchor:[16,41]});let d=J.icon({iconUrl:dp,iconSize:[38,38],iconAnchor:[16,41]});return s===0?d=a:s===1&&(d=h),J.marker(t,{icon:d})}return J.marker(t)},async searchAddress(r){const t=await zc.get(location.protocol+"//nominatim.openstreetmap.org/search?",{params:{q:r,limit:1,format:"json"}});if(t.data.length===1){const e=parseFloat(t.data[0].lat),n={lng:parseFloat(t.data[0].lon),lat:e};return this.setCoordinates({...n,moveMarker:!0}),t.data[0]}return t.data},setCoordinates({lat:r,lng:t}){if(this.mapRender){const e=J.latLng(r,t);this.mapRender.panTo(e,{animate:!0,duration:.5})}},getPopupContent(r){const t=r.properties||{},e=t.descripcion||"",i=t.fechaHoraLlegada||"",n=t.fotoId||"",s=c=>{const d=new Date(c);if(isNaN(d.getTime()))return c;const f=M=>M.toString().padStart(2,"0"),p=f(d.getUTCDate()),_=f(d.getUTCMonth()+1),y=d.getUTCFullYear(),v=f(d.getUTCHours()),w=f(d.getUTCMinutes()),T=f(d.getUTCSeconds());return`${p}-${_}-${y} ${v}:${w}:${T}`};let a="";i&&(a=s(i));let h="<div>";return n&&(h+=`<img src="${n}" style="width: 200px; height: auto; margin-bottom: 5px;"><br>`),h+=`<b>Descripción:</b> ${e}<br>`,a&&(h+=`<b>Fecha Hora Llegada:</b> ${a}<br>`),h+="</div>",h},getPolygonTooltipContent(r){const t=r.properties||{};return`<div style="font-weight: bold; padding: 5px;">${t.descripcion||t.name||"Sin descripción"}</div>`}},watch:{coordinatesMap(r){if(this.renderCoordinates=r,this.mapRender&&this.markerRender){const t=J.latLng([r[0],r[1]]);this.mapRender.setView([r[0],r[1]],r[2]),this.markerRender.setLatLng(t)}},dataPolygon(r){this.renderGeojson=r}}}),Y_=["id"];function K_(r,t,e,i,n,s){var a;return U.openBlock(),U.createElementBlock("div",{class:"map-container",style:U.normalizeStyle(`height:${(a=r.configurationMap)==null?void 0:a.height}`)},[U.createElementVNode("div",{id:r.idMap,style:{height:"100%"}},null,8,Y_)],4)}const q_=La(X_,[["render",K_]]),J_=["id"],Q_=U.defineComponent({__name:"MapSearchAddress",props:{configurationMap:{default:()=>({height:"250px",maxZoom:20,iconMarker:{iconUrl:Es,iconSize:[25,41],iconAnchor:[12,41],class:"",type:"image"},dragMarker:!0})},coordinatesMap:{default:()=>({lat:-19.0429,lng:-65.2554,zoom:12})},isSatelite:{type:Boolean}},emits:["updated:coordsMarker"],setup(r,{expose:t,emit:e}){const i=r,n=U.ref(),s=U.ref(i.coordinatesMap),a=U.ref(),h=U.ref(),c=U.ref(null),d=U.ref(!1);U.onMounted(async()=>{await f(10),await p()});const f=async E=>{let b="";const C="abcdefghijklmnopqrstuvwxyz",P=C.length;let R=0;for(;R<E;)b+=C.charAt(Math.floor(Math.random()*P)),R+=1;n.value=b},p=async()=>{await _()},_=async()=>{var C,P;const E=(C=i.configurationMap)==null?void 0:C.iconMarker,b=J.map(n.value,{fullscreenControl:!0}).setView([s.value.lat,s.value.lng],s.value.zoom);if(b.invalidateSize(),a.value=b,d.value=i.isSatelite||!1,d.value?c.value=J.tileLayer("https://api.maptiler.com/maps/satellite/{z}/{x}/{y}.jpg?key=t8mWT2ozs1JWBqMZOnZr",{attribution:'© <a href="https://www.maptiler.com/">MapTiler</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}):c.value=J.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:(P=i.configurationMap)==null?void 0:P.maxZoom,attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),c.value.addTo(b),i.isSatelite!==void 0){const R=y();b.addControl(R)}if(E.type==="image"){const R=J.marker([s.value.lat,s.value.lng],{icon:J.icon({iconUrl:E.iconUrl,iconAnchor:E.iconAnchor,iconSize:E.iconSize,className:E.class}),draggable:i.configurationMap.dragMarker}).addTo(b);h.value=R,R.on("dragend",D=>{const O=D.target.getLatLng(),G=O.lat,X=O.lng;T({lat:G,lng:X})})}else if(E.type==="svg"){const R=J.marker([s.value.lat,s.value.lng],{icon:J.divIcon({html:E.iconUrl,iconAnchor:E.iconAnchor,iconSize:E.iconSize,className:E.class}),draggable:i.configurationMap.dragMarker}).addTo(b);h.value=R,R.on("dragend",D=>{const O=D.target.getLatLng(),G=O.lat,X=O.lng;T({lat:G,lng:X})})}},y=()=>{const E=J.Control.extend({onAdd:b=>{const C=J.DomUtil.create("div","leaflet-control-draw leaflet-bar leaflet-control"),P=J.DomUtil.create("a","leaflet-draw-draw-satellite",C);return P.href="#",P.title=d.value?"Vista Normal":"Vista Satélite",P.style.backgroundImage=d.value?`url(${Ns})`:`url(${Bs})`,P.style.backgroundPosition="center",P.style.backgroundRepeat="no-repeat",P.style.backgroundSize="20px 20px",J.DomEvent.disableClickPropagation(P),J.DomEvent.on(P,"click",v),C}});return new E({position:"topleft"})},v=()=>{if(!a.value||!c.value)return;d.value=!d.value,a.value.removeLayer(c.value),d.value?c.value=J.tileLayer("https://api.maptiler.com/maps/satellite/{z}/{x}/{y}.jpg?key=t8mWT2ozs1JWBqMZOnZr",{attribution:'© <a href="https://www.maptiler.com/">MapTiler</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}):c.value=J.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),c.value.addTo(a.value),document.querySelectorAll(".leaflet-draw-draw-satellite").forEach(b=>{const C=b;C.style.backgroundImage=d.value?`url(${Ns})`:`url(${Bs})`,C.title=d.value?"Vista Normal":"Vista Satélite"})},w=async E=>{const b=await zc.get(location.protocol+"//nominatim.openstreetmap.org/search?",{params:{q:E,limit:1,format:"json"}});if(b.data.length===1){const C=parseFloat(b.data[0].lat),R={lng:parseFloat(b.data[0].lon),lat:C};return T({...R,moveMarker:!0}),b.data[0]}return b.data},T=({lat:E,lng:b,moveMarker:C=!1})=>{var P;e("updated:coordsMarker",{lat:E,lng:b}),C&&((P=h.value)==null||P.setLatLng({lat:E,lng:b})),M({lat:E,lng:b})},M=({lat:E,lng:b})=>{const C=J.latLng(E,b);a.value.panTo(C,{animate:!0,duration:.5})};return t({searchAddress:w}),(E,b)=>{var C;return U.openBlock(),U.createElementBlock("div",{class:"map-container",style:U.normalizeStyle(`height:${(C=E.configurationMap)==null?void 0:C.height}`)},[U.createElementVNode("div",{id:n.value,style:{height:"100%"}},null,8,J_)],4)}}}),xb="";class $_{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const ai=$_,An={PROPERTYCHANGE:"propertychange"};class tm{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}const Gs=tm;function em(r,t,e){let i,n;e=e||Pi;let s=0,a=r.length,h=!1;for(;s<a;)i=s+(a-s>>1),n=+e(r[i],t),n<0?s=i+1:(a=i,h=!n);return h?s:~s}function Pi(r,t){return r>t?1:r<t?-1:0}function za(r,t,e){if(r[0]<=t)return 0;const i=r.length;if(t<=r[i-1])return i-1;if(typeof e=="function"){for(let n=1;n<i;++n){const s=r[n];if(s===t)return n;if(s<t)return e(t,r[n-1],s)>0?n-1:n}return i-1}if(e>0){for(let n=1;n<i;++n)if(r[n]<t)return n-1;return i-1}if(e<0){for(let n=1;n<i;++n)if(r[n]<=t)return n;return i-1}for(let n=1;n<i;++n){if(r[n]==t)return n;if(r[n]<t)return r[n-1]-t<t-r[n]?n-1:n}return i-1}function im(r,t,e){for(;t<e;){const i=r[t];r[t]=r[e],r[e]=i,++t,--e}}function We(r,t){const e=Array.isArray(t)?t:[t],i=e.length;for(let n=0;n<i;n++)r[r.length]=e[n]}function li(r,t){const e=r.length;if(e!==t.length)return!1;for(let i=0;i<e;i++)if(r[i]!==t[i])return!1;return!0}function nm(r,t,e){const i=t||Pi;return r.every(function(n,s){if(s===0)return!0;const a=i(r[s-1],n);return!(a>0||e&&a===0)})}function Tr(){return!0}function Us(){return!1}function In(){}function Nc(r){let t=!1,e,i,n;return function(){const s=Array.prototype.slice.call(arguments);return(!t||this!==n||!li(s,i))&&(t=!0,n=this,i=s,e=r.apply(this,arguments)),e}}function Dn(r){for(const t in r)delete r[t]}function on(r){let t;for(t in r)return!1;return!t}class rm extends Gs{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);n.includes(e)||n.push(e)}dispatchEvent(t){const e=typeof t=="string",i=e?t:t.type,n=this.listeners_&&this.listeners_[i];if(!n)return;const s=e?new ai(t):t;s.target||(s.target=this.eventTarget_||this);const a=this.dispatching_||(this.dispatching_={}),h=this.pendingRemovals_||(this.pendingRemovals_={});i in a||(a[i]=0,h[i]=0),++a[i];let c;for(let d=0,f=n.length;d<f;++d)if("handleEvent"in n[d]?c=n[d].handleEvent(s):c=n[d].call(this,s),c===!1||s.propagationStopped){c=!1;break}if(--a[i]===0){let d=h[i];for(delete h[i];d--;)this.removeEventListener(i,In);delete a[i]}return c}disposeInternal(){this.listeners_&&Dn(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return this.listeners_?t?t in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(t,e){if(!this.listeners_)return;const i=this.listeners_[t];if(!i)return;const n=i.indexOf(e);n!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=In,++this.pendingRemovals_[t]):(i.splice(n,1),i.length===0&&delete this.listeners_[t]))}}const js=rm,lt={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function ft(r,t,e,i,n){if(i&&i!==r&&(e=e.bind(i)),n){const a=e;e=function(){r.removeEventListener(t,e),a.apply(this,arguments)}}const s={target:r,type:t,listener:e};return r.addEventListener(t,e),s}function Zs(r,t,e,i){return ft(r,t,e,i,!0)}function Ct(r){r&&r.target&&(r.target.removeEventListener(r.type,r.listener),Dn(r))}class Ws extends js{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(lt.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,n=new Array(i);for(let s=0;s<i;++s)n[s]=ft(this,t[s],e);return n}return ft(this,t,e)}onceInternal(t,e){let i;if(Array.isArray(t)){const n=t.length;i=new Array(n);for(let s=0;s<n;++s)i[s]=Zs(this,t[s],e)}else i=Zs(this,t,e);return e.ol_key=i,i}unInternal(t,e){const i=e.ol_key;if(i)sm(i);else if(Array.isArray(t))for(let n=0,s=t.length;n<s;++n)this.removeEventListener(t[n],e);else this.removeEventListener(t,e)}}Ws.prototype.on,Ws.prototype.once,Ws.prototype.un;function sm(r){if(Array.isArray(r))for(let t=0,e=r.length;t<e;++t)Ct(r[t]);else Ct(r)}const Bc=Ws;function rt(){throw new Error("Unimplemented abstract method.")}let om=0;function ct(r){return r.ol_uid||(r.ol_uid=String(++om))}class Gc extends ai{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}class am extends Bc{constructor(t){super(),this.on,this.once,this.un,ct(this),this.values_=null,t!==void 0&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(t,e){let i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new Gc(i,t,e)),i=An.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new Gc(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){const n=this.values_||(this.values_={});if(i)n[t]=e;else{const s=n[t];n[t]=e,s!==e&&this.notify(t,s)}}setProperties(t,e){for(const i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const i=this.values_[t];delete this.values_[t],on(this.values_)&&(this.values_=null),e||this.notify(t,i)}}}const Re=am,Zt={ANIMATING:0,INTERACTING:1},Ae={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},lm=42,Na=256,Cr={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class hm{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Cr[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const Uc=hm,Mr=6378137,On=Math.PI*Mr,cm=[-On,-On,On,On],um=[-180,-85,180,85],Hs=Mr*Math.log(Math.tan(Math.PI/2));class Fn extends Uc{constructor(t){super({code:t,units:"m",extent:cm,global:!0,worldExtent:um,getPointResolution:function(e,i){return e/Math.cosh(i[1]/Mr)}})}}const jc=[new Fn("EPSG:3857"),new Fn("EPSG:102100"),new Fn("EPSG:102113"),new Fn("EPSG:900913"),new Fn("http://www.opengis.net/def/crs/EPSG/0/3857"),new Fn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function dm(r,t,e){const i=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(i));for(let n=0;n<i;n+=e){t[n]=On*r[n]/180;let s=Mr*Math.log(Math.tan(Math.PI*(+r[n+1]+90)/360));s>Hs?s=Hs:s<-Hs&&(s=-Hs),t[n+1]=s}return t}function fm(r,t,e){const i=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(i));for(let n=0;n<i;n+=e)t[n]=180*r[n]/On,t[n+1]=360*Math.atan(Math.exp(r[n+1]/Mr))/Math.PI-90;return t}const gm=6378137,Zc=[-180,-90,180,90],pm=Math.PI*gm/180;class an extends Uc{constructor(t,e){super({code:t,units:"degrees",extent:Zc,axisOrientation:e,global:!0,metersPerUnit:pm,worldExtent:Zc})}}const Wc=[new an("CRS:84"),new an("EPSG:4326","neu"),new an("urn:ogc:def:crs:OGC:1.3:CRS84"),new an("urn:ogc:def:crs:OGC:2:84"),new an("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new an("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new an("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Ba={};function _m(r){return Ba[r]||Ba[r.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function mm(r,t){Ba[r]=t}let zn={};function Vs(r,t,e){const i=r.getCode(),n=t.getCode();i in zn||(zn[i]={}),zn[i][n]=e}function ym(r,t){let e;return r in zn&&t in zn[r]&&(e=zn[r][t]),e}const Wt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Hc(r){const t=xe();for(let e=0,i=r.length;e<i;++e)Pr(t,r[e]);return t}function Xs(r,t,e){return e?(e[0]=r[0]-t,e[1]=r[1]-t,e[2]=r[2]+t,e[3]=r[3]+t,e):[r[0]-t,r[1]-t,r[2]+t,r[3]+t]}function Vc(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r.slice()}function ln(r,t,e){let i,n;return t<r[0]?i=r[0]-t:r[2]<t?i=t-r[2]:i=0,e<r[1]?n=r[1]-e:r[3]<e?n=e-r[3]:n=0,i*i+n*n}function Ys(r,t){return Ga(r,t[0],t[1])}function hn(r,t){return r[0]<=t[0]&&t[2]<=r[2]&&r[1]<=t[1]&&t[3]<=r[3]}function Ga(r,t,e){return r[0]<=t&&t<=r[2]&&r[1]<=e&&e<=r[3]}function Ua(r,t){const e=r[0],i=r[1],n=r[2],s=r[3],a=t[0],h=t[1];let c=Wt.UNKNOWN;return a<e?c=c|Wt.LEFT:a>n&&(c=c|Wt.RIGHT),h<i?c=c|Wt.BELOW:h>s&&(c=c|Wt.ABOVE),c===Wt.UNKNOWN&&(c=Wt.INTERSECTING),c}function xe(){return[1/0,1/0,-1/0,-1/0]}function ki(r,t,e,i,n){return n?(n[0]=r,n[1]=t,n[2]=e,n[3]=i,n):[r,t,e,i]}function Sr(r){return ki(1/0,1/0,-1/0,-1/0,r)}function Xc(r,t){const e=r[0],i=r[1];return ki(e,i,e,i,t)}function ja(r,t,e,i,n){const s=Sr(n);return Kc(s,r,t,e,i)}function Nn(r,t){return r[0]==t[0]&&r[2]==t[2]&&r[1]==t[1]&&r[3]==t[3]}function Yc(r,t){return t[0]<r[0]&&(r[0]=t[0]),t[2]>r[2]&&(r[2]=t[2]),t[1]<r[1]&&(r[1]=t[1]),t[3]>r[3]&&(r[3]=t[3]),r}function Pr(r,t){t[0]<r[0]&&(r[0]=t[0]),t[0]>r[2]&&(r[2]=t[0]),t[1]<r[1]&&(r[1]=t[1]),t[1]>r[3]&&(r[3]=t[1])}function Kc(r,t,e,i,n){for(;e<i;e+=n)vm(r,t[e],t[e+1]);return r}function vm(r,t,e){r[0]=Math.min(r[0],t),r[1]=Math.min(r[1],e),r[2]=Math.max(r[2],t),r[3]=Math.max(r[3],e)}function qc(r,t){let e;return e=t(Ks(r)),e||(e=t(qs(r)),e)||(e=t(Js(r)),e)||(e=t(cn(r)),e)?e:!1}function Za(r){let t=0;return Qs(r)||(t=Mt(r)*we(r)),t}function Ks(r){return[r[0],r[1]]}function qs(r){return[r[2],r[1]]}function Ri(r){return[(r[0]+r[2])/2,(r[1]+r[3])/2]}function xm(r,t){let e;if(t==="bottom-left")e=Ks(r);else if(t==="bottom-right")e=qs(r);else if(t==="top-left")e=cn(r);else if(t==="top-right")e=Js(r);else throw new Error("Invalid corner");return e}function Wa(r,t,e,i,n){const[s,a,h,c,d,f,p,_]=Ha(r,t,e,i);return ki(Math.min(s,h,d,p),Math.min(a,c,f,_),Math.max(s,h,d,p),Math.max(a,c,f,_),n)}function Ha(r,t,e,i){const n=t*i[0]/2,s=t*i[1]/2,a=Math.cos(e),h=Math.sin(e),c=n*a,d=n*h,f=s*a,p=s*h,_=r[0],y=r[1];return[_-c+p,y-d-f,_-c-p,y-d+f,_+c-p,y+d+f,_+c+p,y+d-f,_-c+p,y-d-f]}function we(r){return r[3]-r[1]}function kr(r,t,e){const i=e||xe();return ce(r,t)?(r[0]>t[0]?i[0]=r[0]:i[0]=t[0],r[1]>t[1]?i[1]=r[1]:i[1]=t[1],r[2]<t[2]?i[2]=r[2]:i[2]=t[2],r[3]<t[3]?i[3]=r[3]:i[3]=t[3]):Sr(i),i}function cn(r){return[r[0],r[3]]}function Js(r){return[r[2],r[3]]}function Mt(r){return r[2]-r[0]}function ce(r,t){return r[0]<=t[2]&&r[2]>=t[0]&&r[1]<=t[3]&&r[3]>=t[1]}function Qs(r){return r[2]<r[0]||r[3]<r[1]}function wm(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r}function Em(r,t,e){let i=!1;const n=Ua(r,t),s=Ua(r,e);if(n===Wt.INTERSECTING||s===Wt.INTERSECTING)i=!0;else{const a=r[0],h=r[1],c=r[2],d=r[3],f=t[0],p=t[1],_=e[0],y=e[1],v=(y-p)/(_-f);let w,T;s&Wt.ABOVE&&!(n&Wt.ABOVE)&&(w=_-(y-d)/v,i=w>=a&&w<=c),!i&&s&Wt.RIGHT&&!(n&Wt.RIGHT)&&(T=y-(_-c)*v,i=T>=h&&T<=d),!i&&s&Wt.BELOW&&!(n&Wt.BELOW)&&(w=_-(y-h)/v,i=w>=a&&w<=c),!i&&s&Wt.LEFT&&!(n&Wt.LEFT)&&(T=y-(_-a)*v,i=T>=h&&T<=d)}return i}function Jc(r,t){const e=t.getExtent(),i=Ri(r);if(t.canWrapX()&&(i[0]<e[0]||i[0]>=e[2])){const n=Mt(e),a=Math.floor((i[0]-e[0])/n)*n;r[0]-=a,r[2]-=a}return r}function Lm(r,t){if(t.canWrapX()){const e=t.getExtent();if(!isFinite(r[0])||!isFinite(r[2]))return[[e[0],r[1],e[2],r[3]]];Jc(r,t);const i=Mt(e);if(Mt(r)>i)return[[e[0],r[1],e[2],r[3]]];if(r[0]<e[0])return[[r[0]+i,r[1],e[2],r[3]],[e[0],r[1],r[2],r[3]]];if(r[2]>e[2])return[[r[0],r[1],e[2],r[3]],[e[0],r[1],r[2]-i,r[3]]]}return[r]}function Dt(r,t,e){return Math.min(Math.max(r,t),e)}function bm(r,t,e,i,n,s){const a=n-e,h=s-i;if(a!==0||h!==0){const c=((r-e)*a+(t-i)*h)/(a*a+h*h);c>1?(e=n,i=s):c>0&&(e+=a*c,i+=h*c)}return un(r,t,e,i)}function un(r,t,e,i){const n=e-r,s=i-t;return n*n+s*s}function Tm(r){const t=r.length;for(let i=0;i<t;i++){let n=i,s=Math.abs(r[i][i]);for(let h=i+1;h<t;h++){const c=Math.abs(r[h][i]);c>s&&(s=c,n=h)}if(s===0)return null;const a=r[n];r[n]=r[i],r[i]=a;for(let h=i+1;h<t;h++){const c=-r[h][i]/r[i][i];for(let d=i;d<t+1;d++)i==d?r[h][d]=0:r[h][d]+=c*r[i][d]}}const e=new Array(t);for(let i=t-1;i>=0;i--){e[i]=r[i][t]/r[i][i];for(let n=i-1;n>=0;n--)r[n][t]-=r[n][i]*e[i]}return e}function $s(r){return r*Math.PI/180}function Bn(r,t){const e=r%t;return e*t<0?e+t:e}function Ee(r,t,e){return r+e*(t-r)}function Va(r,t){const e=Math.pow(10,t);return Math.round(r*e)/e}function to(r,t){return Math.floor(Va(r,t))}function eo(r,t){return Math.ceil(Va(r,t))}function Cm(r,t){return r[0]+=+t[0],r[1]+=+t[1],r}function io(r,t){let e=!0;for(let i=r.length-1;i>=0;--i)if(r[i]!=t[i]){e=!1;break}return e}function Xa(r,t){const e=Math.cos(t),i=Math.sin(t),n=r[0]*e-r[1]*i,s=r[1]*e+r[0]*i;return r[0]=n,r[1]=s,r}function Mm(r,t){return r[0]*=t,r[1]*=t,r}function Qc(r,t){if(t.canWrapX()){const e=Mt(t.getExtent()),i=Sm(r,t,e);i&&(r[0]-=i*e)}return r}function Sm(r,t,e){const i=t.getExtent();let n=0;return t.canWrapX()&&(r[0]<i[0]||r[0]>i[2])&&(e=e||Mt(i),n=Math.floor((r[0]-i[0])/e)),n}const Pm=63710088e-1;function $c(r,t,e){e=e||Pm;const i=$s(r[1]),n=$s(t[1]),s=(n-i)/2,a=$s(t[0]-r[0])/2,h=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(i)*Math.cos(n);return 2*e*Math.atan2(Math.sqrt(h),Math.sqrt(1-h))}const tu={info:1,warn:2,error:3,none:4};let km=tu.info;function eu(...r){km>tu.warn||console.warn(...r)}let Ya=!0;function iu(r){Ya=!(r===void 0?!0:r)}function Ka(r,t){if(t!==void 0){for(let e=0,i=r.length;e<i;++e)t[e]=r[e];t=t}else t=r.slice();return t}function nu(r,t){if(t!==void 0&&r!==t){for(let e=0,i=r.length;e<i;++e)t[e]=r[e];r=t}return r}function Rm(r){mm(r.getCode(),r),Vs(r,r,Ka)}function Am(r){r.forEach(Rm)}function zt(r){return typeof r=="string"?_m(r):r||null}function ru(r,t,e,i){r=zt(r);let n;const s=r.getPointResolutionFunc();if(s){if(n=s(t,e),i&&i!==r.getUnits()){const a=r.getMetersPerUnit();a&&(n=n*a/Cr[i])}}else{const a=r.getUnits();if(a=="degrees"&&!i||i=="degrees")n=t;else{const h=Ja(r,zt("EPSG:4326"));if(h===nu&&a!=="degrees")n=t*r.getMetersPerUnit();else{let d=[e[0]-t/2,e[1],e[0]+t/2,e[1],e[0],e[1]-t/2,e[0],e[1]+t/2];d=h(d,d,2);const f=$c(d.slice(0,2),d.slice(2,4)),p=$c(d.slice(4,6),d.slice(6,8));n=(f+p)/2}const c=i?Cr[i]:r.getMetersPerUnit();c!==void 0&&(n/=c)}}return n}function su(r){Am(r),r.forEach(function(t){r.forEach(function(e){t!==e&&Vs(t,e,Ka)})})}function Im(r,t,e,i){r.forEach(function(n){t.forEach(function(s){Vs(n,s,e),Vs(s,n,i)})})}function qa(r,t){return r?typeof r=="string"?zt(r):r:zt(t)}function ou(r,t){return iu(),au(r,"EPSG:4326",t!==void 0?t:"EPSG:3857")}function dn(r,t){if(r===t)return!0;const e=r.getUnits()===t.getUnits();return(r.getCode()===t.getCode()||Ja(r,t)===Ka)&&e}function Ja(r,t){const e=r.getCode(),i=t.getCode();let n=ym(e,i);return n||(n=nu),n}function Rr(r,t){const e=zt(r),i=zt(t);return Ja(e,i)}function au(r,t,e){return Rr(t,e)(r,void 0,r.length)}function Qa(r,t){return r}function hi(r,t){return Ya&&!io(r,[0,0])&&r[0]>=-180&&r[0]<=180&&r[1]>=-90&&r[1]<=90&&(Ya=!1,eu("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),r}function lu(r,t){return r}function fn(r,t){return r}function Dm(){su(jc),su(Wc),Im(Wc,jc,dm,fm)}Dm();function mt(r,t){if(!r)throw new Error(t)}function hu(r,t,e){return function(i,n,s,a,h){if(!i)return;if(!n&&!t)return i;const c=t?0:s[0]*n,d=t?0:s[1]*n,f=h?h[0]:0,p=h?h[1]:0;let _=r[0]+c/2+f,y=r[2]-c/2+f,v=r[1]+d/2+p,w=r[3]-d/2+p;_>y&&(_=(y+_)/2,y=_),v>w&&(v=(w+v)/2,w=v);let T=Dt(i[0],_,y),M=Dt(i[1],v,w);if(a&&e&&n){const E=30*n;T+=-E*Math.log(1+Math.max(0,_-i[0])/E)+E*Math.log(1+Math.max(0,i[0]-y)/E),M+=-E*Math.log(1+Math.max(0,v-i[1])/E)+E*Math.log(1+Math.max(0,i[1]-w)/E)}return[T,M]}}function Om(r){return r}function $a(r,t,e,i){const n=Mt(t)/e[0],s=we(t)/e[1];return i?Math.min(r,Math.max(n,s)):Math.min(r,Math.min(n,s))}function tl(r,t,e){let i=Math.min(r,t);const n=50;return i*=Math.log(1+n*Math.max(0,r/t-1))/n+1,e&&(i=Math.max(i,e),i/=Math.log(1+n*Math.max(0,e/r-1))/n+1),Dt(i,e/2,t*2)}function Fm(r,t,e,i){return t=t!==void 0?t:!0,function(n,s,a,h){if(n!==void 0){const c=r[0],d=r[r.length-1],f=e?$a(c,e,a,i):c;if(h)return t?tl(n,f,d):Dt(n,d,f);const p=Math.min(f,n),_=Math.floor(za(r,p,s));return r[_]>f&&_<r.length-1?r[_+1]:r[_]}}}function zm(r,t,e,i,n,s){return i=i!==void 0?i:!0,e=e!==void 0?e:0,function(a,h,c,d){if(a!==void 0){const f=n?$a(t,n,c,s):t;if(d)return i?tl(a,f,e):Dt(a,e,f);const p=1e-9,_=Math.ceil(Math.log(t/f)/Math.log(r)-p),y=-h*(.5-p)+.5,v=Math.min(f,a),w=Math.floor(Math.log(t/v)/Math.log(r)+y),T=Math.max(_,w),M=t/Math.pow(r,T);return Dt(M,e,f)}}}function cu(r,t,e,i,n){return e=e!==void 0?e:!0,function(s,a,h,c){if(s!==void 0){const d=i?$a(r,i,h,n):r;return!e||!c?Dt(s,t,d):tl(s,d,t)}}}function el(r){if(r!==void 0)return 0}function uu(r){if(r!==void 0)return r}function Nm(r){const t=2*Math.PI/r;return function(e,i){if(i)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e}}function Bm(r){const t=r===void 0?$s(5):r;return function(e,i){return i||e===void 0?e:Math.abs(e)<=t?0:e}}function du(r){return Math.pow(r,3)}function Gn(r){return 1-du(1-r)}function Gm(r){return 3*r*r-2*r*r*r}function Um(r){return r}const Ai=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",jm=Ai.includes("firefox"),Zm=Ai.includes("safari")&&!Ai.includes("chrom")&&(Ai.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Ai)),Wm=Ai.includes("webkit")&&!Ai.includes("edge"),fu=Ai.includes("macintosh"),gu=typeof devicePixelRatio<"u"?devicePixelRatio:1,il=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,pu=typeof Image<"u"&&Image.prototype.decode,_u=function(){let r=!1;try{const t=Object.defineProperty({},"passive",{get:function(){r=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return r}(),Hm=new Array(6);function Ht(){return[1,0,0,1,0,0]}function mu(r,t){const e=r[0],i=r[1],n=r[2],s=r[3],a=r[4],h=r[5],c=t[0],d=t[1],f=t[2],p=t[3],_=t[4],y=t[5];return r[0]=e*c+n*d,r[1]=i*c+s*d,r[2]=e*f+n*p,r[3]=i*f+s*p,r[4]=e*_+n*y+a,r[5]=i*_+s*y+h,r}function yu(r,t,e,i,n,s,a){return r[0]=t,r[1]=e,r[2]=i,r[3]=n,r[4]=s,r[5]=a,r}function Vm(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function Nt(r,t){const e=t[0],i=t[1];return t[0]=r[0]*e+r[2]*i+r[4],t[1]=r[1]*e+r[3]*i+r[5],t}function Xm(r,t,e){return yu(r,t,0,0,e,0,0)}function Ym(r,t,e){return mu(r,yu(Hm,1,0,0,1,t,e))}function Ie(r,t,e,i,n,s,a,h){const c=Math.sin(s),d=Math.cos(s);return r[0]=i*d,r[1]=n*c,r[2]=-i*c,r[3]=n*d,r[4]=a*i*d-h*i*c+t,r[5]=a*n*c+h*n*d+e,r}function no(r,t){const e=Km(t);mt(e!==0,"Transformation matrix cannot be inverted");const i=t[0],n=t[1],s=t[2],a=t[3],h=t[4],c=t[5];return r[0]=a/e,r[1]=-n/e,r[2]=-s/e,r[3]=i/e,r[4]=(s*c-a*h)/e,r[5]=-(i*c-n*h)/e,r}function Km(r){return r[0]*r[3]-r[1]*r[2]}let vu;function xu(r){const t="matrix("+r.join(", ")+")";if(il)return t;const e=vu||(vu=document.createElement("div"));return e.style.transform=t,e.style.transform}function Ii(r,t,e,i,n,s){s=s||[];let a=0;for(let h=t;h<e;h+=i){const c=r[h],d=r[h+1];s[a++]=n[0]*c+n[2]*d+n[4],s[a++]=n[1]*c+n[3]*d+n[5]}return s&&s.length!=a&&(s.length=a),s}function wu(r,t,e,i,n,s,a){a=a||[];const h=Math.cos(n),c=Math.sin(n),d=s[0],f=s[1];let p=0;for(let _=t;_<e;_+=i){const y=r[_]-d,v=r[_+1]-f;a[p++]=d+y*h-v*c,a[p++]=f+y*c+v*h;for(let w=_+2;w<_+i;++w)a[p++]=r[w]}return a&&a.length!=p&&(a.length=p),a}function qm(r,t,e,i,n,s,a,h){h=h||[];const c=a[0],d=a[1];let f=0;for(let p=t;p<e;p+=i){const _=r[p]-c,y=r[p+1]-d;h[f++]=c+n*_,h[f++]=d+s*y;for(let v=p+2;v<p+i;++v)h[f++]=r[v]}return h&&h.length!=f&&(h.length=f),h}function Jm(r,t,e,i,n,s,a){a=a||[];let h=0;for(let c=t;c<e;c+=i){a[h++]=r[c]+n,a[h++]=r[c+1]+s;for(let d=c+2;d<c+i;++d)a[h++]=r[d]}return a&&a.length!=h&&(a.length=h),a}const Eu=Ht();class Qm extends Re{constructor(){super(),this.extent_=xe(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=Nc((t,e,i)=>{if(!i)return this.getSimplifiedGeometry(e);const n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return rt()}closestPointXY(t,e,i,n){return rt()}containsXY(t,e){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return rt()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Sr(e),this.extentRevision_=this.getRevision()}return wm(this.extent_,t)}rotate(t,e){rt()}scale(t,e,i){rt()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return rt()}getType(){return rt()}applyTransform(t){rt()}intersectsExtent(t){return rt()}translate(t,e){rt()}transform(t,e){const i=zt(t),n=i.getUnits()=="tile-pixels"?function(s,a,h){const c=i.getExtent(),d=i.getWorldExtent(),f=we(d)/we(c);return Ie(Eu,d[0],d[3],f,-f,0,0,0),Ii(s,0,s.length,h,Eu,a),Rr(i,e)(s,a,h)}:Rr(i,e);return this.applyTransform(n),this}}const Lu=Qm;class gn extends Lu{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return ja(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return rt()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=bu(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){rt()}setLayout(t,e,i){let n;if(t)n=bu(t);else{for(let s=0;s<i;++s){if(e.length===0){this.layout="XY",this.stride=2;return}e=e[0]}n=e.length,t=pn(n)}this.layout=t,this.stride=n}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())}rotate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();wu(i,0,i.length,n,t,e,i),this.changed()}}scale(t,e,i){e===void 0&&(e=t),i||(i=Ri(this.getExtent()));const n=this.getFlatCoordinates();if(n){const s=this.getStride();qm(n,0,n.length,s,t,e,i,n),this.changed()}}translate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();Jm(i,0,i.length,n,t,e,i),this.changed()}}}function pn(r){let t;return r==2?t="XY":r==3?t="XYZ":r==4&&(t="XYZM"),t}function bu(r){let t;return r=="XY"?t=2:r=="XYZ"||r=="XYM"?t=3:r=="XYZM"&&(t=4),t}function $m(r,t,e){const i=r.getFlatCoordinates();if(!i)return null;const n=r.getStride();return Ii(i,0,i.length,n,t,e)}function Tu(r,t,e,i,n,s,a){const h=r[t],c=r[t+1],d=r[e]-h,f=r[e+1]-c;let p;if(d===0&&f===0)p=t;else{const _=((n-h)*d+(s-c)*f)/(d*d+f*f);if(_>1)p=e;else if(_>0){for(let y=0;y<i;++y)a[y]=Ee(r[t+y],r[e+y],_);a.length=i;return}else p=t}for(let _=0;_<i;++_)a[_]=r[p+_];a.length=i}function nl(r,t,e,i,n){let s=r[t],a=r[t+1];for(t+=i;t<e;t+=i){const h=r[t],c=r[t+1],d=un(s,a,h,c);d>n&&(n=d),s=h,a=c}return n}function rl(r,t,e,i,n){for(let s=0,a=e.length;s<a;++s){const h=e[s];n=nl(r,t,h,i,n),t=h}return n}function ty(r,t,e,i,n){for(let s=0,a=e.length;s<a;++s){const h=e[s];n=rl(r,t,h,i,n),t=h[h.length-1]}return n}function sl(r,t,e,i,n,s,a,h,c,d,f){if(t==e)return d;let p,_;if(n===0){if(_=un(a,h,r[t],r[t+1]),_<d){for(p=0;p<i;++p)c[p]=r[t+p];return c.length=i,_}return d}f=f||[NaN,NaN];let y=t+i;for(;y<e;)if(Tu(r,y-i,y,i,a,h,f),_=un(a,h,f[0],f[1]),_<d){for(d=_,p=0;p<i;++p)c[p]=f[p];c.length=i,y+=i}else y+=i*Math.max((Math.sqrt(_)-Math.sqrt(d))/n|0,1);if(s&&(Tu(r,e-i,t,i,a,h,f),_=un(a,h,f[0],f[1]),_<d)){for(d=_,p=0;p<i;++p)c[p]=f[p];c.length=i}return d}function ol(r,t,e,i,n,s,a,h,c,d,f){f=f||[NaN,NaN];for(let p=0,_=e.length;p<_;++p){const y=e[p];d=sl(r,t,y,i,n,s,a,h,c,d,f),t=y}return d}function ey(r,t,e,i,n,s,a,h,c,d,f){f=f||[NaN,NaN];for(let p=0,_=e.length;p<_;++p){const y=e[p];d=ol(r,t,y,i,n,s,a,h,c,d,f),t=y[y.length-1]}return d}function iy(r,t,e,i){for(let n=0,s=e.length;n<s;++n)r[t++]=e[n];return t}function ro(r,t,e,i){for(let n=0,s=e.length;n<s;++n){const a=e[n];for(let h=0;h<i;++h)r[t++]=a[h]}return t}function Ar(r,t,e,i,n){n=n||[];let s=0;for(let a=0,h=e.length;a<h;++a){const c=ro(r,t,e[a],i);n[s++]=c,t=c}return n.length=s,n}function Cu(r,t,e,i,n){n=n||[];let s=0;for(let a=0,h=e.length;a<h;++a){const c=Ar(r,t,e[a],i,n[s]);c.length===0&&(c[0]=t),n[s++]=c,t=c[c.length-1]}return n.length=s,n}function so(r,t,e,i,n,s,a){const h=(e-t)/i;if(h<3){for(;t<e;t+=i)s[a++]=r[t],s[a++]=r[t+1];return a}const c=new Array(h);c[0]=1,c[h-1]=1;const d=[t,e-i];let f=0;for(;d.length>0;){const p=d.pop(),_=d.pop();let y=0;const v=r[_],w=r[_+1],T=r[p],M=r[p+1];for(let E=_+i;E<p;E+=i){const b=r[E],C=r[E+1],P=bm(b,C,v,w,T,M);P>y&&(f=E,y=P)}y>n&&(c[(f-t)/i]=1,_+i<f&&d.push(_,f),f+i<p&&d.push(f,p))}for(let p=0;p<h;++p)c[p]&&(s[a++]=r[t+p*i],s[a++]=r[t+p*i+1]);return a}function Mu(r,t,e,i,n,s,a,h){for(let c=0,d=e.length;c<d;++c){const f=e[c];a=so(r,t,f,i,n,s,a),h.push(a),t=f}return a}function _n(r,t){return t*Math.round(r/t)}function ny(r,t,e,i,n,s,a){if(t==e)return a;let h=_n(r[t],n),c=_n(r[t+1],n);t+=i,s[a++]=h,s[a++]=c;let d,f;do if(d=_n(r[t],n),f=_n(r[t+1],n),t+=i,t==e)return s[a++]=d,s[a++]=f,a;while(d==h&&f==c);for(;t<e;){const p=_n(r[t],n),_=_n(r[t+1],n);if(t+=i,p==d&&_==f)continue;const y=d-h,v=f-c,w=p-h,T=_-c;if(y*T==v*w&&(y<0&&w<y||y==w||y>0&&w>y)&&(v<0&&T<v||v==T||v>0&&T>v)){d=p,f=_;continue}s[a++]=d,s[a++]=f,h=d,c=f,d=p,f=_}return s[a++]=d,s[a++]=f,a}function al(r,t,e,i,n,s,a,h){for(let c=0,d=e.length;c<d;++c){const f=e[c];a=ny(r,t,f,i,n,s,a),h.push(a),t=f}return a}function ry(r,t,e,i,n,s,a,h){for(let c=0,d=e.length;c<d;++c){const f=e[c],p=[];a=al(r,t,f,i,n,s,a,p),h.push(p),t=f[f.length-1]}return a}function Di(r,t,e,i,n){n=n!==void 0?n:[];let s=0;for(let a=t;a<e;a+=i)n[s++]=r.slice(a,a+i);return n.length=s,n}function Ir(r,t,e,i,n){n=n!==void 0?n:[];let s=0;for(let a=0,h=e.length;a<h;++a){const c=e[a];n[s++]=Di(r,t,c,i,n[s]),t=c}return n.length=s,n}function ll(r,t,e,i,n){n=n!==void 0?n:[];let s=0;for(let a=0,h=e.length;a<h;++a){const c=e[a];n[s++]=c.length===1&&c[0]===t?[]:Ir(r,t,c,i,n[s]),t=c[c.length-1]}return n.length=s,n}function Su(r,t,e,i){let n=0,s=r[e-i],a=r[e-i+1];for(;t<e;t+=i){const h=r[t],c=r[t+1];n+=a*h-s*c,s=h,a=c}return n/2}function Pu(r,t,e,i){let n=0;for(let s=0,a=e.length;s<a;++s){const h=e[s];n+=Su(r,t,h,i),t=h}return n}function sy(r,t,e,i){let n=0;for(let s=0,a=e.length;s<a;++s){const h=e[s];n+=Pu(r,t,h,i),t=h[h.length-1]}return n}class oo extends gn{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}clone(){return new oo(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,n){return n<ln(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(nl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),sl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))}getArea(){return Su(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Di(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=so(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new oo(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ro(this.flatCoordinates,0,t,this.stride),this.changed()}}const ku=oo;class hl extends gn{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new hl(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){const s=this.flatCoordinates,a=un(t,e,s[0],s[1]);if(a<n){const h=this.stride;for(let c=0;c<h;++c)i[c]=s[c];return i.length=h,a}return n}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return Xc(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return Ga(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=iy(this.flatCoordinates,0,t,this.stride),this.changed()}}const ao=hl;function oy(r,t,e,i,n){return!qc(n,function(a){return!mn(r,t,e,i,a[0],a[1])})}function mn(r,t,e,i,n,s){let a=0,h=r[e-i],c=r[e-i+1];for(;t<e;t+=i){const d=r[t],f=r[t+1];c<=s?f>s&&(d-h)*(s-c)-(n-h)*(f-c)>0&&a++:f<=s&&(d-h)*(s-c)-(n-h)*(f-c)<0&&a--,h=d,c=f}return a!==0}function cl(r,t,e,i,n,s){if(e.length===0||!mn(r,t,e[0],i,n,s))return!1;for(let a=1,h=e.length;a<h;++a)if(mn(r,e[a-1],e[a],i,n,s))return!1;return!0}function ay(r,t,e,i,n,s){if(e.length===0)return!1;for(let a=0,h=e.length;a<h;++a){const c=e[a];if(cl(r,t,c,i,n,s))return!0;t=c[c.length-1]}return!1}function ul(r,t,e,i,n,s,a){let h,c,d,f,p,_,y;const v=n[s+1],w=[];for(let E=0,b=e.length;E<b;++E){const C=e[E];for(f=r[C-i],_=r[C-i+1],h=t;h<C;h+=i)p=r[h],y=r[h+1],(v<=_&&y<=v||_<=v&&v<=y)&&(d=(v-_)/(y-_)*(p-f)+f,w.push(d)),f=p,_=y}let T=NaN,M=-1/0;for(w.sort(Pi),f=w[0],h=1,c=w.length;h<c;++h){p=w[h];const E=Math.abs(p-f);E>M&&(d=(f+p)/2,cl(r,t,e,i,d,v)&&(T=d,M=E)),f=p}return isNaN(T)&&(T=n[s]),a?(a.push(T,v,M),a):[T,v,M]}function Ru(r,t,e,i,n){let s=[];for(let a=0,h=e.length;a<h;++a){const c=e[a];s=ul(r,t,c,i,n,2*a,s),t=c[c.length-1]}return s}function Au(r,t,e,i,n){let s;for(t+=i;t<e;t+=i)if(s=n(r.slice(t-i,t),r.slice(t,t+i)),s)return s;return!1}function lo(r,t,e,i,n){const s=Kc(xe(),r,t,e,i);return ce(n,s)?hn(n,s)||s[0]>=n[0]&&s[2]<=n[2]||s[1]>=n[1]&&s[3]<=n[3]?!0:Au(r,t,e,i,function(a,h){return Em(n,a,h)}):!1}function ly(r,t,e,i,n){for(let s=0,a=e.length;s<a;++s){if(lo(r,t,e[s],i,n))return!0;t=e[s]}return!1}function Iu(r,t,e,i,n){return!!(lo(r,t,e,i,n)||mn(r,t,e,i,n[0],n[1])||mn(r,t,e,i,n[0],n[3])||mn(r,t,e,i,n[2],n[1])||mn(r,t,e,i,n[2],n[3]))}function Du(r,t,e,i,n){if(!Iu(r,t,e[0],i,n))return!1;if(e.length===1)return!0;for(let s=1,a=e.length;s<a;++s)if(oy(r,e[s-1],e[s],i,n)&&!lo(r,e[s-1],e[s],i,n))return!1;return!0}function hy(r,t,e,i,n){for(let s=0,a=e.length;s<a;++s){const h=e[s];if(Du(r,t,h,i,n))return!0;t=h[h.length-1]}return!1}function cy(r,t,e,i){for(;t<e-i;){for(let n=0;n<i;++n){const s=r[t+n];r[t+n]=r[e-i+n],r[e-i+n]=s}t+=i,e-=i}}function dl(r,t,e,i){let n=0,s=r[e-i],a=r[e-i+1];for(;t<e;t+=i){const h=r[t],c=r[t+1];n+=(h-s)*(c+a),s=h,a=c}return n===0?void 0:n>0}function fl(r,t,e,i,n){n=n!==void 0?n:!1;for(let s=0,a=e.length;s<a;++s){const h=e[s],c=dl(r,t,h,i);if(s===0){if(n&&c||!n&&!c)return!1}else if(n&&!c||!n&&c)return!1;t=h}return!0}function Ou(r,t,e,i,n){for(let s=0,a=e.length;s<a;++s){const h=e[s];if(!fl(r,t,h,i,n))return!1;h.length&&(t=h[h.length-1])}return!0}function ho(r,t,e,i,n){n=n!==void 0?n:!1;for(let s=0,a=e.length;s<a;++s){const h=e[s],c=dl(r,t,h,i);(s===0?n&&c||!n&&!c:n&&!c||!n&&c)&&cy(r,t,h,i),t=h}return t}function gl(r,t,e,i,n){for(let s=0,a=e.length;s<a;++s)t=ho(r,t,e[s],i,n);return t}function uy(r,t){const e=[];let i=0,n=0,s;for(let a=0,h=t.length;a<h;++a){const c=t[a],d=dl(r,i,c,2);if(s===void 0&&(s=d),d===s)e.push(t.slice(n,a+1));else{if(e.length===0)continue;e[e.length-1].push(t[n])}n=a+1,i=c}return e}class Oi extends gn{constructor(t,e,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,e!==void 0&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?We(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new Oi(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<ln(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(rl(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ol(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return cl(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return Pu(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),ho(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,Ir(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Ri(this.getExtent());this.flatInteriorPoint_=ul(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new ao(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new ku(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[];let s=0;for(let a=0,h=i.length;a<h;++a){const c=i[a],d=new ku(e.slice(s,c),t);n.push(d),s=c}return n}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;fl(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=ho(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=al(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i),new Oi(e,"XY",i)}getType(){return"Polygon"}intersectsExtent(t){return Du(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Ar(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}function Fu(r){if(Qs(r))throw new Error("Cannot create polygon from empty extent");const t=r[0],e=r[1],i=r[2],n=r[3],s=[t,e,t,n,i,n,i,e,t,e];return new Oi(s,"XY",[s.length])}const pl=0;class dy extends Re{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=qa(t.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,t.projection&&iu(),t.center&&(t.center=hi(t.center,this.projection_)),t.extent&&(t.extent=fn(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const h in Ae)delete e[h];this.setProperties(e,!0);const i=gy(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=i.minZoom;const n=fy(t),s=i.constraint,a=py(t);this.constraints_={center:n,resolution:s,rotation:a},this.setRotation(t.rotation!==void 0?t.rotation:0),this.setCenterInternal(t.center!==void 0?t.center:null),t.resolution!==void 0?this.setResolution(t.resolution):t.zoom!==void 0&&this.setZoom(t.zoom)}get padding(){return this.padding_}set padding(t){let e=this.padding_;this.padding_=t;const i=this.getCenterInternal();if(i){const n=t||[0,0,0,0];e=e||[0,0,0,0];const s=this.getResolution(),a=s/2*(n[3]-e[3]+e[1]-n[1]),h=s/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([i[0]+a,i[1]-h])}}getUpdatedOptions_(t){const e=this.getProperties();return e.resolution!==void 0?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Object.assign({},e,t)}animate(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const e=new Array(arguments.length);for(let i=0;i<e.length;++i){let n=arguments[i];n.center&&(n=Object.assign({},n),n.center=hi(n.center,this.getProjection())),n.anchor&&(n=Object.assign({},n),n.anchor=hi(n.anchor,this.getProjection())),e[i]=n}this.animateInternal.apply(this,e)}animateInternal(t){let e=arguments.length,i;e>1&&typeof arguments[e-1]=="function"&&(i=arguments[e-1],--e);let n=0;for(;n<e&&!this.isDef();++n){const f=arguments[n];f.center&&this.setCenterInternal(f.center),f.zoom!==void 0?this.setZoom(f.zoom):f.resolution&&this.setResolution(f.resolution),f.rotation!==void 0&&this.setRotation(f.rotation)}if(n===e){i&&co(i,!0);return}let s=Date.now(),a=this.targetCenter_.slice(),h=this.targetResolution_,c=this.targetRotation_;const d=[];for(;n<e;++n){const f=arguments[n],p={start:s,complete:!1,anchor:f.anchor,duration:f.duration!==void 0?f.duration:1e3,easing:f.easing||Gm,callback:i};if(f.center&&(p.sourceCenter=a,p.targetCenter=f.center.slice(),a=p.targetCenter),f.zoom!==void 0?(p.sourceResolution=h,p.targetResolution=this.getResolutionForZoom(f.zoom),h=p.targetResolution):f.resolution&&(p.sourceResolution=h,p.targetResolution=f.resolution,h=p.targetResolution),f.rotation!==void 0){p.sourceRotation=c;const _=Bn(f.rotation-c+Math.PI,2*Math.PI)-Math.PI;p.targetRotation=c+_,c=p.targetRotation}_y(p)?p.complete=!0:s+=p.duration,d.push(p)}this.animations_.push(d),this.setHint(Zt.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[Zt.ANIMATING]>0}getInteracting(){return this.hints_[Zt.INTERACTING]>0}cancelAnimations(){this.setHint(Zt.ANIMATING,-this.hints_[Zt.ANIMATING]);let t;for(let e=0,i=this.animations_.length;e<i;++e){const n=this.animations_[e];if(n[0].callback&&co(n[0].callback,!1),!t)for(let s=0,a=n.length;s<a;++s){const h=n[s];if(!h.complete){t=h.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;const t=Date.now();let e=!1;for(let i=this.animations_.length-1;i>=0;--i){const n=this.animations_[i];let s=!0;for(let a=0,h=n.length;a<h;++a){const c=n[a];if(c.complete)continue;const d=t-c.start;let f=c.duration>0?d/c.duration:1;f>=1?(c.complete=!0,f=1):s=!1;const p=c.easing(f);if(c.sourceCenter){const _=c.sourceCenter[0],y=c.sourceCenter[1],v=c.targetCenter[0],w=c.targetCenter[1];this.nextCenter_=c.targetCenter;const T=_+p*(v-_),M=y+p*(w-y);this.targetCenter_=[T,M]}if(c.sourceResolution&&c.targetResolution){const _=p===1?c.targetResolution:c.sourceResolution+p*(c.targetResolution-c.sourceResolution);if(c.anchor){const y=this.getViewportSize_(this.getRotation()),v=this.constraints_.resolution(_,0,y,!0);this.targetCenter_=this.calculateCenterZoom(v,c.anchor)}this.nextResolution_=c.targetResolution,this.targetResolution_=_,this.applyTargetState_(!0)}if(c.sourceRotation!==void 0&&c.targetRotation!==void 0){const _=p===1?Bn(c.targetRotation+Math.PI,2*Math.PI)-Math.PI:c.sourceRotation+p*(c.targetRotation-c.sourceRotation);if(c.anchor){const y=this.constraints_.rotation(_,!0);this.targetCenter_=this.calculateCenterRotate(y,c.anchor)}this.nextRotation_=c.targetRotation,this.targetRotation_=_}if(this.applyTargetState_(!0),e=!0,!c.complete)break}if(s){this.animations_[i]=null,this.setHint(Zt.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const a=n[0].callback;a&&co(a,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i;const n=this.getCenterInternal();return n!==void 0&&(i=[n[0]-e[0],n[1]-e[1]],Xa(i,t-this.getRotation()),Cm(i,e)),i}calculateCenterZoom(t,e){let i;const n=this.getCenterInternal(),s=this.getResolution();if(n!==void 0&&s!==void 0){const a=e[0]-t*(e[0]-n[0])/s,h=e[1]-t*(e[1]-n[1])/s;i=[a,h]}return i}getViewportSize_(t){const e=this.viewportSize_;if(t){const i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&Qa(t,this.getProjection())}getCenterInternal(){return this.get(Ae.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return lu(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();mt(e,"The view center is not defined");const i=this.getResolution();mt(i!==void 0,"The view resolution is not defined");const n=this.getRotation();return mt(n!==void 0,"The view rotation is not defined"),Wa(e,i,n,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(Ae.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(fn(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const i=Mt(t)/e[0],n=we(t)/e[1];return Math.max(i,n)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(e/i)/Math.log(t);return function(s){return e/Math.pow(t,s*n)}}getRotation(){return this.get(Ae.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,s=Math.log(i/n)/e;return function(a){return Math.log(i/a)/e/s}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),i=this.getRotation();let n=this.getCenterInternal();const s=this.padding_;if(s){const a=this.getViewportSizeMinusPadding_();n=_l(n,this.getViewportSize_(),[a[0]/2+s[3],a[1]/2+s[0]],e,i)}return{center:n.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,i,n;if(this.resolutions_){const s=za(this.resolutions_,t,1);e=s,i=this.resolutions_[s],s==this.resolutions_.length-1?n=2:n=i/this.resolutions_[s+1]}else i=this.maxResolution_,n=this.zoomFactor_;return e+Math.log(i/t)/Math.log(n)}getResolutionForZoom(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;const e=Dt(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,Dt(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if(mt(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){mt(!Qs(t),"Cannot fit empty extent provided as `geometry`");const n=fn(t,this.getProjection());i=Fu(n)}else if(t.getType()==="Circle"){const n=fn(t.getExtent(),this.getProjection());i=Fu(n),i.rotate(this.getRotation(),Ri(n))}else i=t;this.fitInternal(i,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),i=Math.cos(e),n=Math.sin(-e),s=t.getFlatCoordinates(),a=t.getStride();let h=1/0,c=1/0,d=-1/0,f=-1/0;for(let p=0,_=s.length;p<_;p+=a){const y=s[p]*i-s[p+1]*n,v=s[p]*n+s[p+1]*i;h=Math.min(h,y),c=Math.min(c,v),d=Math.max(d,y),f=Math.max(f,v)}return[h,c,d,f]}fitInternal(t,e){e=e||{};let i=e.size;i||(i=this.getViewportSizeMinusPadding_());const n=e.padding!==void 0?e.padding:[0,0,0,0],s=e.nearest!==void 0?e.nearest:!1;let a;e.minResolution!==void 0?a=e.minResolution:e.maxZoom!==void 0?a=this.getResolutionForZoom(e.maxZoom):a=0;const h=this.rotatedExtentForGeometry(t);let c=this.getResolutionForExtentInternal(h,[i[0]-n[1]-n[3],i[1]-n[0]-n[2]]);c=isNaN(c)?a:Math.max(c,a),c=this.getConstrainedResolution(c,s?0:1);const d=this.getRotation(),f=Math.sin(d),p=Math.cos(d),_=Ri(h);_[0]+=(n[1]-n[3])/2*c,_[1]+=(n[0]-n[2])/2*c;const y=_[0]*p-_[1]*f,v=_[1]*p+_[0]*f,w=this.getConstrainedCenter([y,v],c),T=e.callback?e.callback:In;e.duration!==void 0?this.animateInternal({resolution:c,center:w,duration:e.duration,easing:e.easing},T):(this.targetResolution_=c,this.targetCenter_=w,this.applyTargetState_(!1,!0),co(T,!0))}centerOn(t,e,i){this.centerOnInternal(hi(t,this.getProjection()),e,i)}centerOnInternal(t,e,i){this.setCenterInternal(_l(t,e,i,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,i,n){let s;const a=this.padding_;if(a&&t){const h=this.getViewportSizeMinusPadding_(-i),c=_l(t,n,[h[0]/2+a[3],h[1]/2+a[0]],e,i);s=[t[0]-c[0],t[1]-c[1]]}return s}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(t){const e=Qa(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])}adjustCenterInternal(t){const e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])}adjustResolution(t,e){e=e&&hi(e,this.getProjection()),this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){const i=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),s=this.constraints_.resolution(this.targetResolution_*t,0,n,i);e&&(this.targetCenter_=this.calculateCenterZoom(s,e)),this.targetResolution_*=t,this.applyTargetState_()}adjustZoom(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)}adjustRotation(t,e){e&&(e=hi(e,this.getProjection())),this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){const i=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t&&hi(t,this.getProjection()))}setCenterInternal(t){this.targetCenter_=t,this.applyTargetState_()}setHint(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]}setResolution(t){this.targetResolution_=t,this.applyTargetState_()}setRotation(t){this.targetRotation_=t,this.applyTargetState_()}setZoom(t){this.setResolution(this.getResolutionForZoom(t))}applyTargetState_(t,e){const i=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,i),s=this.getViewportSize_(n),a=this.constraints_.resolution(this.targetResolution_,0,s,i),h=this.constraints_.center(this.targetCenter_,a,s,i,this.calculateCenterShift(this.targetCenter_,a,n,s));this.get(Ae.ROTATION)!==n&&this.set(Ae.ROTATION,n),this.get(Ae.RESOLUTION)!==a&&(this.set(Ae.RESOLUTION,a),this.set("zoom",this.getZoom(),!0)),(!h||!this.get(Ae.CENTER)||!io(this.get(Ae.CENTER),h))&&this.set(Ae.CENTER,h),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(t,e,i){t=t!==void 0?t:200;const n=e||0,s=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(s),h=this.constraints_.resolution(this.targetResolution_,n,a),c=this.constraints_.center(this.targetCenter_,h,a,!1,this.calculateCenterShift(this.targetCenter_,h,s,a));if(t===0&&!this.cancelAnchor_){this.targetResolution_=h,this.targetRotation_=s,this.targetCenter_=c,this.applyTargetState_();return}i=i||(t===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==h||this.getRotation()!==s||!this.getCenterInternal()||!io(this.getCenterInternal(),c))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:s,center:c,resolution:h,duration:t,easing:Gn,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(Zt.INTERACTING,1)}endInteraction(t,e,i){i=i&&hi(i,this.getProjection()),this.endInteractionInternal(t,e,i)}endInteractionInternal(t,e,i){this.getInteracting()&&(this.setHint(Zt.INTERACTING,-1),this.resolveConstraints(t,e,i))}getConstrainedCenter(t,e){const i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)}getConstrainedZoom(t,e){const i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))}getConstrainedResolution(t,e){e=e||0;const i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,i)}}function co(r,t){setTimeout(function(){r(t)},0)}function fy(r){if(r.extent!==void 0){const e=r.smoothExtentConstraint!==void 0?r.smoothExtentConstraint:!0;return hu(r.extent,r.constrainOnlyCenter,e)}const t=qa(r.projection,"EPSG:3857");if(r.multiWorld!==!0&&t.isGlobal()){const e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,hu(e,!1,!1)}return Om}function gy(r){let t,e,i,a=r.minZoom!==void 0?r.minZoom:pl,h=r.maxZoom!==void 0?r.maxZoom:28;const c=r.zoomFactor!==void 0?r.zoomFactor:2,d=r.multiWorld!==void 0?r.multiWorld:!1,f=r.smoothResolutionConstraint!==void 0?r.smoothResolutionConstraint:!0,p=r.showFullExtent!==void 0?r.showFullExtent:!1,_=qa(r.projection,"EPSG:3857"),y=_.getExtent();let v=r.constrainOnlyCenter,w=r.extent;if(!d&&!w&&_.isGlobal()&&(v=!1,w=y),r.resolutions!==void 0){const T=r.resolutions;e=T[a],i=T[h]!==void 0?T[h]:T[T.length-1],r.constrainResolution?t=Fm(T,f,!v&&w,p):t=cu(e,i,f,!v&&w,p)}else{const M=(y?Math.max(Mt(y),we(y)):360*Cr.degrees/_.getMetersPerUnit())/Na/Math.pow(2,pl),E=M/Math.pow(2,28-pl);e=r.maxResolution,e!==void 0?a=0:e=M/Math.pow(c,a),i=r.minResolution,i===void 0&&(r.maxZoom!==void 0?r.maxResolution!==void 0?i=e/Math.pow(c,h):i=M/Math.pow(c,h):i=E),h=a+Math.floor(Math.log(e/i)/Math.log(c)),i=e/Math.pow(c,h-a),r.constrainResolution?t=zm(c,e,i,f,!v&&w,p):t=cu(e,i,f,!v&&w,p)}return{constraint:t,maxResolution:e,minResolution:i,minZoom:a,zoomFactor:c}}function py(r){if(r.enableRotation!==void 0?r.enableRotation:!0){const e=r.constrainRotation;return e===void 0||e===!0?Bm():e===!1?uu:typeof e=="number"?Nm(e):uu}return el}function _y(r){return!(r.sourceCenter&&r.targetCenter&&!io(r.sourceCenter,r.targetCenter)||r.sourceResolution!==r.targetResolution||r.sourceRotation!==r.targetRotation)}function _l(r,t,e,i,n){const s=Math.cos(-n);let a=Math.sin(-n),h=r[0]*s-r[1]*a,c=r[1]*s+r[0]*a;h+=(t[0]/2-e[0])*i,c+=(e[1]-t[1]/2)*i,a=-a;const d=h*s-c*a,f=c*s+h*a;return[d,f]}const He=dy,ue={ADD:"add",REMOVE:"remove"},zu={LENGTH:"length"};class uo extends ai{constructor(t,e,i){super(t),this.element=e,this.index=i}}class my extends Re{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let i=0,n=this.array_.length;i<n;++i)this.assertUnique_(this.array_[i],i);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,i=t.length;e<i;++e)this.push(t[e]);return this}forEach(t){const e=this.array_;for(let i=0,n=e.length;i<n;++i)t(e[i],i,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(zu.LENGTH)}insertAt(t,e){if(t<0||t>this.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new uo(ue.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let i=0,n=e.length;i<n;++i)if(e[i]===t)return this.removeAt(i)}removeAt(t){if(t<0||t>=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new uo(ue.REMOVE,e,t)),e}setAt(t,e){const i=this.getLength();if(t>=i){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new uo(ue.REMOVE,n,t)),this.dispatchEvent(new uo(ue.ADD,e,t))}updateLength_(){this.set(zu.LENGTH,this.array_.length)}assertUnique_(t,e){for(let i=0,n=this.array_.length;i<n;++i)if(this.array_[i]===t&&i!==e)throw new Error("Duplicate item added to a unique collection")}}const Ve=my,Dr={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},$t={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"],whitepoint:{2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}}};$t.max=$t.whitepoint[2].D65,$t.rgb=function(r,t){t=t||$t.whitepoint[2].E;var e=r[0]/t[0],i=r[1]/t[1],n=r[2]/t[2],s,a,h;return s=e*3.240969941904521+i*-1.537383177570093+n*-.498610760293,a=e*-.96924363628087+i*1.87596750150772+n*.041555057407175,h=e*.055630079696993+i*-.20397695888897+n*1.056971514242878,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s=s*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,h=h>.0031308?1.055*Math.pow(h,1/2.4)-.055:h=h*12.92,s=Math.min(Math.max(0,s),1),a=Math.min(Math.max(0,a),1),h=Math.min(Math.max(0,h),1),[s*255,a*255,h*255]},Dr.xyz=function(r,t){var e=r[0]/255,i=r[1]/255,n=r[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var s=e*.41239079926595+i*.35758433938387+n*.18048078840183,a=e*.21263900587151+i*.71516867876775+n*.072192315360733,h=e*.019330818715591+i*.11919477979462+n*.95053215224966;return t=t||$t.whitepoint[2].E,[s*t[0],a*t[1],h*t[2]]};var ml={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(r,t,e){var i,n,s,a,h,c,d,f,p,_,y,v,w;if(s=r[0],a=r[1],h=r[2],s===0)return[0,0,0];var T=.0011070564598794539;return t=t||"D65",e=e||2,p=$t.whitepoint[e][t][0],_=$t.whitepoint[e][t][1],y=$t.whitepoint[e][t][2],v=4*p/(p+15*_+3*y),w=9*_/(p+15*_+3*y),i=a/(13*s)+v||0,n=h/(13*s)+w||0,d=s>8?_*Math.pow((s+16)/116,3):_*s*T,c=d*9*i/(4*n)||0,f=d*(12-3*i-20*n)/(4*n)||0,[c,d,f]}};$t.luv=function(r,t,e){var i,n,s,a,h,c,d,f,p,_,y,v,w,T=.008856451679035631,M=903.2962962962961;t=t||"D65",e=e||2,p=$t.whitepoint[e][t][0],_=$t.whitepoint[e][t][1],y=$t.whitepoint[e][t][2],v=4*p/(p+15*_+3*y),w=9*_/(p+15*_+3*y),c=r[0],d=r[1],f=r[2],i=4*c/(c+15*d+3*f)||0,n=9*d/(c+15*d+3*f)||0;var E=d/_;return s=E<=T?M*E:116*Math.pow(E,1/3)-16,a=13*s*(i-v),h=13*s*(n-w),[s,a,h]};var Nu={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(r){var t=r[0],e=r[1],i=r[2],n,s,a;return a=i/360*2*Math.PI,n=e*Math.cos(a),s=e*Math.sin(a),[t,n,s]},xyz:function(r){return ml.xyz(Nu.luv(r))}};ml.lchuv=function(r){var t=r[0],e=r[1],i=r[2],n=Math.sqrt(e*e+i*i),s=Math.atan2(i,e),a=s*360/2/Math.PI;return a<0&&(a+=360),[t,n,a]},$t.lchuv=function(r){return ml.lchuv($t.luv(r))};const Bu={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var Gu={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function yy(r){var f,p;var t,e=[],i=1,n;if(typeof r=="number")return{space:"rgb",values:[r>>>16,(r&65280)>>>8,r&255],alpha:1};if(typeof r=="number")return{space:"rgb",values:[r>>>16,(r&65280)>>>8,r&255],alpha:1};if(r=String(r).toLowerCase(),Bu[r])e=Bu[r].slice(),n="rgb";else if(r==="transparent")i=0,n="rgb",e=[0,0,0];else if(r[0]==="#"){var s=r.slice(1),a=s.length,h=a<=4;i=1,h?(e=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],a===4&&(i=parseInt(s[3]+s[3],16)/255)):(e=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],a===8&&(i=parseInt(s[6]+s[7],16)/255)),e[0]||(e[0]=0),e[1]||(e[1]=0),e[2]||(e[2]=0),n="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(r)){var c=t[1];n=c.replace(/a$/,"");var d=n==="cmyk"?4:n==="gray"?1:3;e=t[2].trim().split(/\s*[,\/]\s*|\s+/),n==="color"&&(n=e.shift()),e=e.map(function(_,y){if(_[_.length-1]==="%")return _=parseFloat(_)/100,y===3?_:n==="rgb"?_*255:n[0]==="h"||n[0]==="l"&&!y?_*100:n==="lab"?_*125:n==="lch"?y<2?_*150:_*360:n[0]==="o"&&!y?_:n==="oklab"?_*.4:n==="oklch"?y<2?_*.4:_*360:_;if(n[y]==="h"||y===2&&n[n.length-1]==="h"){if(Gu[_]!==void 0)return Gu[_];if(_.endsWith("deg"))return parseFloat(_);if(_.endsWith("turn"))return parseFloat(_)*360;if(_.endsWith("grad"))return parseFloat(_)*360/400;if(_.endsWith("rad"))return parseFloat(_)*180/Math.PI}return _==="none"?0:parseFloat(_)}),i=e.length>d?e.pop():1}else/[0-9](?:\s|\/|,)/.test(r)&&(e=r.match(/([0-9]+)/g).map(function(_){return parseFloat(_)}),n=((p=(f=r.match(/([a-z])/ig))==null?void 0:f.join(""))==null?void 0:p.toLowerCase())||"rgb");return{space:n,values:e,alpha:i}}var yl={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(r){var t=r[0]/360,e=r[1]/100,i=r[2]/100,n,s,a,h,c,d=0;if(e===0)return c=i*255,[c,c,c];for(s=i<.5?i*(1+e):i+e-i*e,n=2*i-s,h=[0,0,0];d<3;)a=t+1/3*-(d-1),a<0?a++:a>1&&a--,c=6*a<1?n+(s-n)*6*a:2*a<1?s:3*a<2?n+(s-n)*(2/3-a)*6:n,h[d++]=c*255;return h}};Dr.hsl=function(r){var t=r[0]/255,e=r[1]/255,i=r[2]/255,n=Math.min(t,e,i),s=Math.max(t,e,i),a=s-n,h,c,d;return s===n?h=0:t===s?h=(e-i)/a:e===s?h=2+(i-t)/a:i===s&&(h=4+(t-e)/a),h=Math.min(h*60,360),h<0&&(h+=360),d=(n+s)/2,s===n?c=0:d<=.5?c=a/(s+n):c=a/(2-s-n),[h,c*100,d*100]};function vy(r){Array.isArray(r)&&r.raw&&(r=String.raw(...arguments)),r instanceof Number&&(r=+r);var t,e=yy(r);if(!e.space)return[];const i=e.space[0]==="h"?yl.min:Dr.min,n=e.space[0]==="h"?yl.max:Dr.max;return t=Array(3),t[0]=Math.min(Math.max(e.values[0],i[0]),n[0]),t[1]=Math.min(Math.max(e.values[1],i[1]),n[1]),t[2]=Math.min(Math.max(e.values[2],i[2]),n[2]),e.space[0]==="h"&&(t=yl.rgb(t)),t.push(Math.min(Math.max(e.alpha,0),1)),t}function Uu(r){return typeof r=="string"?r:Wu(r)}const xy=1024,Or={};let vl=0;function wy(r){if(r.length===4)return r;const t=r.slice();return t[3]=1,t}function ju(r){const t=$t.lchuv(Dr.xyz(r));return t[3]=r[3],t}function Ey(r){const t=$t.rgb(Nu.xyz(r));return t[3]=r[3],t}function xl(r){if(Or.hasOwnProperty(r))return Or[r];if(vl>=xy){let e=0;for(const i in Or)e++&3||(delete Or[i],--vl)}const t=vy(r);if(t.length!==4)throw new Error('Failed to parse "'+r+'" as color');for(const e of t)if(isNaN(e))throw new Error('Failed to parse "'+r+'" as color');return Zu(t),Or[r]=t,++vl,t}function Fr(r){return Array.isArray(r)?r:xl(r)}function Zu(r){return r[0]=Dt(r[0]+.5|0,0,255),r[1]=Dt(r[1]+.5|0,0,255),r[2]=Dt(r[2]+.5|0,0,255),r[3]=Dt(r[3],0,1),r}function Wu(r){let t=r[0];t!=(t|0)&&(t=t+.5|0);let e=r[1];e!=(e|0)&&(e=e+.5|0);let i=r[2];i!=(i|0)&&(i=i+.5|0);const n=r[3]===void 0?1:Math.round(r[3]*100)/100;return"rgba("+t+","+e+","+i+","+n+")"}function Ly(r){try{return xl(r),!0}catch{return!1}}class by{constructor(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const i=this.cache_[e];!(t++&3)&&!i.hasListener()&&(delete this.cache_[e],--this.cacheSize_)}}}get(t,e,i){const n=Hu(t,e,i);return n in this.cache_?this.cache_[n]:null}set(t,e,i,n){const s=Hu(t,e,i);this.cache_[s]=n,++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function Hu(r,t,e){const i=e?Uu(e):"null";return t+":"+r+":"+i}const fo=new by,bt={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};class Ty extends Re{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);typeof t.properties=="object"&&(delete e.properties,Object.assign(e,t.properties)),e[bt.OPACITY]=t.opacity!==void 0?t.opacity:1,mt(typeof e[bt.OPACITY]=="number","Layer opacity must be a number"),e[bt.VISIBLE]=t.visible!==void 0?t.visible:!0,e[bt.Z_INDEX]=t.zIndex,e[bt.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[bt.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[bt.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[bt.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=e.className!==void 0?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:t===void 0?!0:t},i=this.getZIndex();return e.opacity=Dt(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=i===void 0&&!e.managed?1/0:i,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return rt()}getLayerStatesArray(t){return rt()}getExtent(){return this.get(bt.EXTENT)}getMaxResolution(){return this.get(bt.MAX_RESOLUTION)}getMinResolution(){return this.get(bt.MIN_RESOLUTION)}getMinZoom(){return this.get(bt.MIN_ZOOM)}getMaxZoom(){return this.get(bt.MAX_ZOOM)}getOpacity(){return this.get(bt.OPACITY)}getSourceState(){return rt()}getVisible(){return this.get(bt.VISIBLE)}getZIndex(){return this.get(bt.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(bt.EXTENT,t)}setMaxResolution(t){this.set(bt.MAX_RESOLUTION,t)}setMinResolution(t){this.set(bt.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(bt.MAX_ZOOM,t)}setMinZoom(t){this.set(bt.MIN_ZOOM,t)}setOpacity(t){mt(typeof t=="number","Layer opacity must be a number"),this.set(bt.OPACITY,t)}setVisible(t){this.set(bt.VISIBLE,t)}setZIndex(t){this.set(bt.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const Vu=Ty,te={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class Cy extends Vu{constructor(t){const e=Object.assign({},t);delete e.source,super(e),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener(bt.SOURCE,this.handleSourcePropertyChange_);const i=t.source?t.source:null;this.setSource(i)}getLayersArray(t){return t=t||[],t.push(this),t}getLayerStatesArray(t){return t=t||[],t.push(this.getLayerState()),t}getSource(){return this.get(bt.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!=="ready")&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(Ct(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=ft(t,lt.CHANGE,this.handleSourceChange_,this),t.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e;const i=this.getMapInternal();!t&&i&&(t=i.getView()),t instanceof He?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let n;e.layerStatesArray?n=e.layerStatesArray.find(a=>a.layer===this):n=this.getLayerState();const s=this.getExtent();return wl(n,e.viewState)&&(!s||ce(s,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];let e;const i=this.getSource();if(i&&(e=i.getAttributions()),!e)return[];const n=t instanceof He?t.getViewStateAndExtent():t;let s=e(n);return Array.isArray(s)||(s=[s]),s}render(t,e){const i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}setMapInternal(t){t||this.unrender(),this.set(bt.MAP,t)}getMapInternal(){return this.get(bt.MAP)}setMap(t){this.mapPrecomposeKey_&&(Ct(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Ct(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=ft(t,te.PRECOMPOSE,function(e){const n=e.frameState.layerStatesArray,s=this.getLayerState(!1);mt(!n.some(function(a){return a.layer===s.layer}),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),n.push(s)},this),this.mapRenderKey_=ft(this,lt.CHANGE,t.render,t),this.changed())}setSource(t){this.set(bt.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function wl(r,t){if(!r.visible)return!1;const e=t.resolution;if(e<r.minResolution||e>=r.maxResolution)return!1;const i=t.zoom;return i>r.minZoom&&i<=r.maxZoom}const go=Cy;class My extends Gs{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){rt()}calculateMatrices2D(t){const e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;Ie(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),no(n,i)}forEachFeatureAtCoordinate(t,e,i,n,s,a,h,c){let d;const f=e.viewState;function p(C,P,R,D){return s.call(a,P,C?R:null,D)}const _=f.projection,y=Qc(t.slice(),_),v=[[0,0]];if(_.canWrapX()&&n){const C=_.getExtent(),P=Mt(C);v.push([-P,0],[P,0])}const w=e.layerStatesArray,T=w.length,M=[],E=[];for(let C=0;C<v.length;C++)for(let P=T-1;P>=0;--P){const R=w[P],D=R.layer;if(D.hasRenderer()&&wl(R,f)&&h.call(c,D)){const O=D.getRenderer(),G=D.getSource();if(O&&G){const X=G.getWrapX()?y:t,Y=p.bind(null,R.managed);E[0]=X[0]+v[C][0],E[1]=X[1]+v[C][1],d=O.forEachFeatureAtCoordinate(E,e,i,Y,M)}if(d)return d}}if(M.length===0)return;const b=1/M.length;return M.forEach((C,P)=>C.distanceSq+=P*b),M.sort((C,P)=>C.distanceSq-P.distanceSq),M.some(C=>d=C.callback(C.feature,C.layer,C.geometry)),d}hasFeatureAtCoordinate(t,e,i,n,s,a){return this.forEachFeatureAtCoordinate(t,e,i,n,Tr,this,s,a)!==void 0}getMap(){return this.map_}renderFrame(t){rt()}flushDeclutterItems(t){}scheduleExpireIconCache(t){fo.canExpireCache()&&t.postRenderFunctions.push(Sy)}}function Sy(r,t){fo.expire()}const Py=My;class ky extends ai{constructor(t,e,i,n){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=n}}const zr=ky,po="ol-hidden",Ry="ol-selectable",Nr="ol-unselectable",Xu="ol-unsupported",_o="ol-control",Yu="ol-collapsed",Ay=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),Ku=["style","variant","weight","size","lineHeight","family"],qu=function(r){const t=r.match(Ay);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,n=Ku.length;i<n;++i){const s=t[i+1];s!==void 0&&(e[Ku[i]]=s)}return e.families=e.family.split(/,\s?/),e};function ee(r,t,e,i){let n;return e&&e.length?n=e.shift():il?n=new OffscreenCanvas(r||300,t||300):n=document.createElement("canvas"),r&&(n.width=r),t&&(n.height=t),n.getContext("2d",i)}function mo(r){const t=r.canvas;t.width=1,t.height=1,r.clearRect(0,0,1,1)}function Iy(r){let t=r.offsetWidth;const e=getComputedStyle(r);return t+=parseInt(e.marginLeft,10)+parseInt(e.marginRight,10),t}function Dy(r){let t=r.offsetHeight;const e=getComputedStyle(r);return t+=parseInt(e.marginTop,10)+parseInt(e.marginBottom,10),t}function yo(r,t){const e=t.parentNode;e&&e.replaceChild(r,t)}function vo(r){return r&&r.parentNode?r.parentNode.removeChild(r):null}function Ju(r){for(;r.lastChild;)r.removeChild(r.lastChild)}function Oy(r,t){const e=r.childNodes;for(let i=0;;++i){const n=e[i],s=t[i];if(!n&&!s)break;if(n!==s){if(!n){r.appendChild(s);continue}if(!s){r.removeChild(n),--i;continue}r.insertBefore(s,n)}}}const Qu="10px sans-serif",de="#000",Un="round",ci=[],ui=0,jn="round",Br=10,Gr="#000",Ur="center",xo="middle",yn=[0,0,0,0],jr=1,di=new Re;let Zn=null,El;const Ll={},Fy=function(){const t="32px ",e=["monospace","serif"],i=e.length,n="wmytzilWMYTZIL@#/&?$%10";let s,a;function h(d,f,p){let _=!0;for(let y=0;y<i;++y){const v=e[y];if(a=wo(d+" "+f+" "+t+v,n),p!=v){const w=wo(d+" "+f+" "+t+p+","+v,n);_=_&&w!=a}}return!!_}function c(){let d=!0;const f=di.getKeys();for(let p=0,_=f.length;p<_;++p){const y=f[p];di.get(y)<100&&(h.apply(this,y.split(`
|
|
16
|
+
`))?(Dn(Ll),Zn=null,El=void 0,di.set(y,100)):(di.set(y,di.get(y)+1,!0),d=!1))}d&&(clearInterval(s),s=void 0)}return function(d){const f=qu(d);if(!f)return;const p=f.families;for(let _=0,y=p.length;_<y;++_){const v=p[_],w=f.style+`
|
|
19
17
|
`+f.weight+`
|
|
20
|
-
`+v;
|
|
21
|
-
`).reduce((n,
|
|
22
|
-
`||d===f){o=Math.max(o,a),n.push(a),a=0,h+=c;continue}const m=t[d+1]||r.font,y=ro(m,p);e.push(y),a+=y;const v=wy(m);i.push(v),c=Math.max(c,v)}return{width:o,height:h,widths:e,heights:i,lineWidths:n}}function Ly(r,t,e,i,n,o,a,h,c,d,f){r.save(),e!==1&&(r.globalAlpha*=e),t&&r.transform.apply(r,t),i.contextInstructions?(r.translate(c,d),r.scale(f[0],f[1]),by(i,r)):f[0]<0||f[1]<0?(r.translate(c,d),r.scale(f[0],f[1]),r.drawImage(i,n,o,a,h,0,0,a,h)):r.drawImage(i,n,o,a,h,c,d,a*f[0],h*f[1]),r.restore()}function by(r,t){const e=r.contextInstructions;for(let i=0,n=e.length;i<n;i+=2)Array.isArray(e[i+1])?t[e[i]].apply(t,e[i+1]):t[e[i]]=e[i+1]}class Ty extends fy{constructor(t){super(t),this.fontChangeListenerKey_=ut(si,wn.PROPERTYCHANGE,t.redrawText.bind(t)),this.element_=document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=Tr+" ol-layers";const i=t.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0,this.declutterLayers_=[]}dispatchRenderEvent(t,e){const i=this.getMap();if(i.hasListener(t)){const n=new br(t,void 0,e);i.dispatchEvent(n)}}disposeInternal(){Et(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),super.disposeInternal()}renderFrame(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(qt.PRECOMPOSE,t);const e=t.layerStatesArray.sort(function(a,h){return a.zIndex-h.zIndex}),i=t.viewState;this.children_.length=0;const n=this.declutterLayers_;n.length=0;let o=null;for(let a=0,h=e.length;a<h;++a){const c=e[a];t.layerIndex=a;const d=c.layer,f=d.getSourceState();if(!$a(c,i)||f!="ready"&&f!="undefined"){d.unrender();continue}const p=d.render(t,o);p&&(p!==o&&(this.children_.push(p),o=p),"getDeclutter"in d&&n.push(d))}this.flushDeclutterItems(t),vy(this.element_,this.children_),this.dispatchRenderEvent(qt.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}flushDeclutterItems(t){const e=this.declutterLayers_;for(let i=e.length-1;i>=0;--i)e[i].renderDeclutter(t);e.length=0}}const Cy=Ty;class bi extends $e{constructor(t,e){super(t),this.layer=e}}const il={LAYERS:"layers"};class nl extends bu{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let i=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(il.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new Be(i.slice(),{unique:!0}):gt(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new Be(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(Et),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(ut(t,oe.ADD,this.handleLayersAdd_,this),ut(t,oe.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(Et);Ln(this.listenerKeys_);const e=t.getArray();for(let i=0,n=e.length;i<n;i++){const o=e[i];this.registerLayerListeners_(o),this.dispatchEvent(new bi("addlayer",o))}this.changed()}registerLayerListeners_(t){const e=[ut(t,wn.PROPERTYCHANGE,this.handleLayerChange_,this),ut(t,ot.CHANGE,this.handleLayerChange_,this)];t instanceof nl&&e.push(ut(t,"addlayer",this.handleLayerGroupAdd_,this),ut(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[ht(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new bi("addlayer",t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new bi("removelayer",t.layer))}handleLayersAdd_(t){const e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new bi("addlayer",e)),this.changed()}handleLayersRemove_(t){const e=t.element,i=ht(e);this.listenerKeys_[i].forEach(Et),delete this.listenerKeys_[i],this.dispatchEvent(new bi("removelayer",e)),this.changed()}getLayers(){return this.get(il.LAYERS)}setLayers(t){const e=this.getLayers();if(e){const i=e.getArray();for(let n=0,o=i.length;n<o;++n)this.dispatchEvent(new bi("removelayer",i[n]))}this.set(il.LAYERS,t)}getLayersArray(t){return t=t!==void 0?t:[],this.getLayers().forEach(function(e){e.getLayersArray(t)}),t}getLayerStatesArray(t){const e=t!==void 0?t:[],i=e.length;this.getLayers().forEach(function(a){a.getLayerStatesArray(e)});const n=this.getLayerState();let o=n.zIndex;!t&&n.zIndex===void 0&&(o=0);for(let a=i,h=e.length;a<h;a++){const c=e[a];c.opacity*=n.opacity,c.visible=c.visible&&n.visible,c.maxResolution=Math.min(c.maxResolution,n.maxResolution),c.minResolution=Math.max(c.minResolution,n.minResolution),c.minZoom=Math.max(c.minZoom,n.minZoom),c.maxZoom=Math.min(c.maxZoom,n.maxZoom),n.extent!==void 0&&(c.extent!==void 0?c.extent=xr(c.extent,n.extent):c.extent=n.extent),c.zIndex===void 0&&(c.zIndex=o)}return e}getSourceState(){return"ready"}}const so=nl;class My extends $e{constructor(t,e,i){super(t),this.map=e,this.frameState=i!==void 0?i:null}}const Dn=My;class Sy extends Dn{constructor(t,e,i,n,o,a){super(t,e,o),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=n!==void 0?n:!1,this.activePointers=a}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(t){this.pixel_=t}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(t){this.coordinate_=t}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const Ti=Sy,Rt={SINGLECLICK:"singleclick",CLICK:ot.CLICK,DBLCLICK:ot.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},rl={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};class Py extends Cs{constructor(t,e){super(t),this.map_=t,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=e===void 0?1:e,this.down_=null;const i=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=ut(i,rl.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=ut(i,rl.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(ot.TOUCHMOVE,this.boundHandleTouchMove_,Jc?{passive:!1}:!1)}emulateClick_(t){let e=new Ti(Rt.CLICK,this.map_,t);this.dispatchEvent(e),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Ti(Rt.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const i=new Ti(Rt.SINGLECLICK,this.map_,t);this.dispatchEvent(i)},250)}updateActivePointers_(t){const e=t,i=e.pointerId;if(e.type==Rt.POINTERUP||e.type==Rt.POINTERCANCEL){delete this.trackedTouches_[i];for(const n in this.trackedTouches_)if(this.trackedTouches_[n].target!==e.target){delete this.trackedTouches_[n];break}}else(e.type==Rt.POINTERDOWN||e.type==Rt.POINTERMOVE)&&(this.trackedTouches_[i]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new Ti(Rt.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(Et),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return t.button===0}handlePointerDown_(t){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(t);const e=new Ti(Rt.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),this.dragListenerKeys_.length===0){const i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(ut(i,Rt.POINTERMOVE,this.handlePointerMove_,this),ut(i,Rt.POINTERUP,this.handlePointerUp_,this),ut(this.element_,Rt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(ut(this.element_.getRootNode(),Rt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new Ti(Rt.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new Ti(Rt.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(Et(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(ot.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Et(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Et),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const ky=Py,oi={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Zt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},oo=1/0;class Ry{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Ln(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,i=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const n=this.keyFunction_(i);return delete this.queuedElements_[n],i}enqueue(t){gt(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=oo?(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,i=this.priorities_,n=e.length,o=e[t],a=i[t],h=t;for(;t<n>>1;){const c=this.getLeftChildIndex_(t),d=this.getRightChildIndex_(t),f=d<n&&i[d]<i[c]?d:c;e[t]=e[f],i[t]=i[f],t=f}e[t]=o,i[t]=a,this.siftDown_(h,t)}siftDown_(t,e){const i=this.elements_,n=this.priorities_,o=i[e],a=n[e];for(;e>t;){const h=this.getParentIndex_(e);if(n[h]>a)i[e]=i[h],n[e]=n[h],e=h;else break}i[e]=o,n[e]=a}reprioritize(){const t=this.priorityFunction_,e=this.elements_,i=this.priorities_;let n=0;const o=e.length;let a,h,c;for(h=0;h<o;++h)a=e[h],c=t(a),c==oo?delete this.queuedElements_[this.keyFunction_(a)]:(i[n]=c,e[n++]=a);e.length=n,i.length=n,this.heapify_()}}const Ay=Ry,$={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class Iy extends Ay{constructor(t,e){super(function(i){return t.apply(null,i)},function(i){return i[0].getKey()}),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=e,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(t){const e=super.enqueue(t);return e&&t[0].addEventListener(ot.CHANGE,this.boundHandleTileChange_),e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target,i=e.getState();if(i===$.LOADED||i===$.ERROR||i===$.EMPTY){i!==$.ERROR&&e.removeEventListener(ot.CHANGE,this.boundHandleTileChange_);const n=e.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let i=0,n,o,a;for(;this.tilesLoading_<t&&i<e&&this.getCount()>0;)o=this.dequeue()[0],a=o.getKey(),n=o.getState(),n===$.IDLE&&!(a in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[a]=!0,++this.tilesLoading_,++i,o.load())}}const Dy=Iy;function Oy(r,t,e,i,n){if(!r||!(e in r.wantedTiles)||!r.wantedTiles[e][t.getKey()])return oo;const o=r.viewState.center,a=i[0]-o[0],h=i[1]-o[1];return 65536*Math.log(n)+Math.sqrt(a*a+h*h)/n}class Fy extends be{constructor(t){super();const e=t.element;e&&!t.target&&!e.style.pointerEvents&&(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){io(this.element),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&io(this.element);for(let e=0,i=this.listenerKeys.length;e<i;++e)Et(this.listenerKeys[e]);this.listenerKeys.length=0,this.map_=t,t&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==En&&this.listenerKeys.push(ut(t,oi.POSTRENDER,this.render,this)),t.render())}render(t){}setTarget(t){this.target_=typeof t=="string"?document.getElementById(t):t}}const ao=Fy;class zy extends ao{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=t.collapsed!==void 0?t.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=t.collapsible!==void 0,this.collapsible_=t.collapsible!==void 0?t.collapsible:!0,this.collapsible_||(this.collapsed_=!1);const e=t.className!==void 0?t.className:"ol-attribution",i=t.tipLabel!==void 0?t.tipLabel:"Attributions",n=t.expandClassName!==void 0?t.expandClassName:e+"-expand",o=t.collapseLabel!==void 0?t.collapseLabel:"›",a=t.collapseClassName!==void 0?t.collapseClassName:e+"-collapse";typeof o=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=o,this.collapseLabel_.className=a):this.collapseLabel_=o;const h=t.label!==void 0?t.label:"i";typeof h=="string"?(this.label_=document.createElement("span"),this.label_.textContent=h,this.label_.className=n):this.label_=h;const c=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(c),this.toggleButton_.addEventListener(ot.CLICK,this.handleClick_.bind(this),!1);const d=e+" "+Tr+" "+$s+(this.collapsed_&&this.collapsible_?" "+Cu:"")+(this.collapsible_?"":" ol-uncollapsible"),f=this.element;f.className=d,f.appendChild(this.toggleButton_),f.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){const e=Array.from(new Set(this.getMap().getAllLayers().flatMap(n=>n.getAttributions(t)))),i=!this.getMap().getAllLayers().some(n=>n.getSource()&&n.getSource().getAttributionsCollapsible()===!1);return this.overrideCollapsible_||this.setCollapsible(i),e}updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!ei(e,this.renderedAttributions_)){Pu(this.ulElement_);for(let n=0,o=e.length;n<o;++n){const a=document.createElement("li");a.innerHTML=e[n],this.ulElement_.appendChild(a)}this.renderedAttributions_=e}}handleClick_(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(Cu),this.collapsed_?eo(this.collapseLabel_,this.label_):eo(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(t){this.userCollapsed_=t,!(!this.collapsible_||this.collapsed_===t)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(t){this.updateElement_(t.frameState)}}const Iu=zy;class Ny extends ao{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target});const e=t.className!==void 0?t.className:"ol-rotate",i=t.label!==void 0?t.label:"⇧",n=t.compassClassName!==void 0?t.compassClassName:"ol-compass";this.label_=null,typeof i=="string"?(this.label_=document.createElement("span"),this.label_.className=n,this.label_.textContent=i):(this.label_=i,this.label_.classList.add(n));const o=t.tipLabel?t.tipLabel:"Reset rotation",a=document.createElement("button");a.className=e+"-reset",a.setAttribute("type","button"),a.title=o,a.appendChild(this.label_),a.addEventListener(ot.CLICK,this.handleClick_.bind(this),!1);const h=e+" "+Tr+" "+$s,c=this.element;c.className=h,c.appendChild(a),this.callResetNorth_=t.resetNorth?t.resetNorth:void 0,this.duration_=t.duration!==void 0?t.duration:250,this.autoHide_=t.autoHide!==void 0?t.autoHide:!0,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(Qs)}handleClick_(t){t.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const e=this.getMap().getView();if(!e)return;const i=e.getRotation();i!==void 0&&(this.duration_>0&&i%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:kn}):e.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const i=e.viewState.rotation;if(i!=this.rotation_){const n="rotate("+i+"rad)";if(this.autoHide_){const o=this.element.classList.contains(Qs);!o&&i===0?this.element.classList.add(Qs):o&&i!==0&&this.element.classList.remove(Qs)}this.label_.style.transform=n}this.rotation_=i}}const By=Ny;class Gy extends ao{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=t.className!==void 0?t.className:"ol-zoom",i=t.delta!==void 0?t.delta:1,n=t.zoomInClassName!==void 0?t.zoomInClassName:e+"-in",o=t.zoomOutClassName!==void 0?t.zoomOutClassName:e+"-out",a=t.zoomInLabel!==void 0?t.zoomInLabel:"+",h=t.zoomOutLabel!==void 0?t.zoomOutLabel:"–",c=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",d=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",f=document.createElement("button");f.className=n,f.setAttribute("type","button"),f.title=c,f.appendChild(typeof a=="string"?document.createTextNode(a):a),f.addEventListener(ot.CLICK,this.handleClick_.bind(this,i),!1);const p=document.createElement("button");p.className=o,p.setAttribute("type","button"),p.title=d,p.appendChild(typeof h=="string"?document.createTextNode(h):h),p.addEventListener(ot.CLICK,this.handleClick_.bind(this,-i),!1);const m=e+" "+Tr+" "+$s,y=this.element;y.className=m,y.appendChild(f),y.appendChild(p),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const i=this.getMap().getView();if(!i)return;const n=i.getZoom();if(n!==void 0){const o=i.getConstrainedZoom(n+t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:o,duration:this.duration_,easing:kn})):i.setZoom(o)}}}const Uy=Gy;function Du(r){r=r||{};const t=new Be;return(r.zoom!==void 0?r.zoom:!0)&&t.push(new Uy(r.zoomOptions)),(r.rotate!==void 0?r.rotate:!0)&&t.push(new By(r.rotateOptions)),(r.attribution!==void 0?r.attribution:!0)&&t.push(new Iu(r.attributionOptions)),t}const Ou={ACTIVE:"active"};class jy extends be{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(Ou.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(Ou.ACTIVE,t)}setMap(t){this.map_=t}}function Zy(r,t,e){const i=r.getCenterInternal();if(i){const n=[i[0]+t[0],i[1]+t[1]];r.animateInternal({duration:e!==void 0?e:250,easing:wm,center:r.getConstrainedCenter(n)})}}function sl(r,t,e,i){const n=r.getZoom();if(n===void 0)return;const o=r.getConstrainedZoom(n+t),a=r.getResolutionForZoom(o);r.getAnimating()&&r.cancelAnimations(),r.animate({resolution:a,anchor:e,duration:i!==void 0?i:250,easing:kn})}const kr=jy;class Wy extends kr{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(t){let e=!1;if(t.type==Rt.DBLCLICK){const i=t.originalEvent,n=t.map,o=t.coordinate,a=i.shiftKey?-this.delta_:this.delta_,h=n.getView();sl(h,a,o,this.duration_),i.preventDefault(),e=!0}return!e}}const Hy=Wy;class Vy extends kr{constructor(t){t=t||{},super(t),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Rt.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Rt.POINTERUP){const i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==Rt.POINTERDOWN){const i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==Rt.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function ol(r){const t=r.length;let e=0,i=0;for(let n=0;n<t;n++)e+=r[n].clientX,i+=r[n].clientY;return{clientX:e/t,clientY:i/t}}const Rr=Vy;function al(r){const t=arguments;return function(e){let i=!0;for(let n=0,o=t.length;n<o&&(i=i&&t[n](e),!!i);++n);return i}}const Xy=function(r){const t=r.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},Yy=function(r){const t=r.map.getTargetElement(),e=r.map.getOwnerDocument().activeElement;return t.contains(e)},Fu=function(r){return r.map.getTargetElement().hasAttribute("tabindex")?Yy(r):!0},Ky=pr,zu=function(r){const t=r.originalEvent;return t.button==0&&!(bm&&Yc&&t.ctrlKey)},Nu=function(r){const t=r.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},qy=function(r){const t=r.originalEvent;return Yc?t.metaKey:t.ctrlKey},Jy=function(r){const t=r.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},Bu=function(r){const t=r.originalEvent,e=t.target.tagName;return e!=="INPUT"&&e!=="SELECT"&&e!=="TEXTAREA"&&!t.target.isContentEditable},ll=function(r){const t=r.originalEvent;return gt(t!==void 0,"mapBrowserEvent must originate from a pointer event"),t.pointerType=="mouse"},Qy=function(r){const t=r.originalEvent;return gt(t!==void 0,"mapBrowserEvent must originate from a pointer event"),t.isPrimary&&t.button===0};class $y extends Rr{constructor(t){super({stopDown:Ts}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const e=t.condition?t.condition:al(Nu,Qy);this.condition_=t.onFocusOnly?al(Fu,e):e,this.noKinetic_=!1}handleDragEvent(t){const e=t.map;this.panning_||(this.panning_=!0,e.getView().beginInteraction());const i=this.targetPointers,n=e.getEventPixel(ol(i));if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){const o=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],h=t.map.getView();am(o,h.getResolution()),Ra(o,h.getRotation()),h.adjustCenterInternal(o)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=i.length,t.originalEvent.preventDefault()}handleUpEvent(t){const e=t.map,i=e.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const n=this.kinetic_.getDistance(),o=this.kinetic_.getAngle(),a=i.getCenterInternal(),h=e.getPixelFromCoordinateInternal(a),c=e.getCoordinateFromPixelInternal([h[0]-n*Math.cos(o),h[1]-n*Math.sin(o)]);i.animateInternal({center:i.getConstrainedCenter(c),duration:500,easing:kn})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){const i=t.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}const tv=$y;class ev extends Rr{constructor(t){t=t||{},super({stopDown:Ts}),this.condition_=t.condition?t.condition:Xy,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!ll(t))return;const e=t.map,i=e.getView();if(i.getConstraints().rotation===Ba)return;const n=e.getSize(),o=t.pixel,a=Math.atan2(n[1]/2-o[1],o[0]-n[0]/2);if(this.lastAngle_!==void 0){const h=a-this.lastAngle_;i.adjustRotationInternal(-h)}this.lastAngle_=a}handleUpEvent(t){return ll(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return ll(t)&&zu(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}const iv=ev;class nv extends bs{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){const t=this.startPixel_,e=this.endPixel_,n=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new Xs([n])}getGeometry(){return this.geometry_}}const rv=nv,lo={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class hl extends $e{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}}class sv extends Rr{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.box_=new rv(t.className||"ol-dragbox"),this.minArea_=t.minArea!==void 0?t.minArea:64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition?t.condition:zu,this.boxEndCondition_=t.boxEndCondition?t.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,i){const n=i[0]-e[0],o=i[1]-e[1];return n*n+o*o>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new hl(lo.BOXDRAG,t.coordinate,t))}handleUpEvent(t){this.box_.setMap(null);const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new hl(e?lo.BOXEND:lo.BOXCANCEL,t.coordinate,t)),!1}handleDownEvent(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new hl(lo.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}}const ov=sv;class av extends ov{constructor(t){t=t||{};const e=t.condition?t.condition:Jy;super({condition:e,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(t){const i=this.getMap().getView();let n=this.getGeometry();if(this.out_){const o=i.rotatedExtentForGeometry(n),a=i.getResolutionForExtentInternal(o),h=i.getResolution()/a;n=n.clone(),n.scale(h*h)}i.fitInternal(n,{duration:this.duration_,easing:kn})}}const lv=av,on={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class hv extends kr{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return Nu(e)&&Bu(e)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==ot.KEYDOWN){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&(n==on.DOWN||n==on.LEFT||n==on.RIGHT||n==on.UP)){const a=t.map.getView(),h=a.getResolution()*this.pixelDelta_;let c=0,d=0;n==on.DOWN?d=-h:n==on.LEFT?c=-h:n==on.RIGHT?c=h:d=h;const f=[c,d];Ra(f,a.getRotation()),Zy(a,f,this.duration_),i.preventDefault(),e=!0}}return!e}}const cv=hv;class uv extends kr{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(e){return!qy(e)&&Bu(e)},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(t){let e=!1;if(t.type==ot.KEYDOWN||t.type==ot.KEYPRESS){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&(n==="+"||n==="-")){const o=t.map,a=n==="+"?this.delta_:-this.delta_,h=o.getView();sl(h,a,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}}const dv=uv;class fv{constructor(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;const t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;let i=e-3;for(;i>0&&this.points_[i+2]>t;)i-=3;const n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;const o=this.points_[e]-this.points_[i],a=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(a,o),this.initialVelocity_=Math.sqrt(o*o+a*a)/n,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const gv=fv;class pv extends kr{constructor(t){t=t||{},super(t),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;const e=t.condition?t.condition:Ky;this.condition_=t.onFocusOnly?al(Fu,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();if(!t)return;t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}handleEvent(t){if(!this.condition_(t)||t.type!==ot.WHEEL)return!0;const i=t.map,n=t.originalEvent;n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);let o;if(t.type==ot.WHEEL&&(o=n.deltaY,Em&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(o/=Kc),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(o*=40)),o===0)return!1;this.lastDelta_=o;const a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(o)<4?"trackpad":"wheel");const h=i.getView();if(this.mode_==="trackpad"&&!(h.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(h.getAnimating()&&h.cancelAnimations(),h.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),h.adjustZoom(-o/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=a,!1;this.totalDelta_+=o;const c=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),c),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let i=-At(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),sl(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}}const _v=pv;class mv extends Rr{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=Ts),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){let e=0;const i=this.targetPointers[0],n=this.targetPointers[1],o=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(this.lastAngle_!==void 0){const c=o-this.lastAngle_;this.rotationDelta_+=c,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=c}this.lastAngle_=o;const a=t.map,h=a.getView();h.getConstraints().rotation!==Ba&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(ol(this.targetPointers))),this.rotating_&&(a.render(),h.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return this.targetPointers.length<2?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}const yv=mv;class vv extends Rr{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=Ts),super(e),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1;const i=this.targetPointers[0],n=this.targetPointers[1],o=i.clientX-n.clientX,a=i.clientY-n.clientY,h=Math.sqrt(o*o+a*a);this.lastDistance_!==void 0&&(e=this.lastDistance_/h),this.lastDistance_=h;const c=t.map,d=c.getView();e!=1&&(this.lastScaleDelta_=e),this.anchor_=c.getCoordinateFromPixelInternal(c.getEventPixel(ol(this.targetPointers))),c.render(),d.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const i=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,n),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}const xv=vv;function wv(r){r=r||{};const t=new Be,e=new gv(-.005,.05,100);return(r.altShiftDragRotate!==void 0?r.altShiftDragRotate:!0)&&t.push(new iv),(r.doubleClickZoom!==void 0?r.doubleClickZoom:!0)&&t.push(new Hy({delta:r.zoomDelta,duration:r.zoomDuration})),(r.dragPan!==void 0?r.dragPan:!0)&&t.push(new tv({onFocusOnly:r.onFocusOnly,kinetic:e})),(r.pinchRotate!==void 0?r.pinchRotate:!0)&&t.push(new yv),(r.pinchZoom!==void 0?r.pinchZoom:!0)&&t.push(new xv({duration:r.zoomDuration})),(r.keyboard!==void 0?r.keyboard:!0)&&(t.push(new cv),t.push(new dv({delta:r.zoomDelta,duration:r.zoomDuration}))),(r.mouseWheelZoom!==void 0?r.mouseWheelZoom:!0)&&t.push(new _v({onFocusOnly:r.onFocusOnly,duration:r.zoomDuration})),(r.shiftDragZoom!==void 0?r.shiftDragZoom:!0)&&t.push(new lv({duration:r.zoomDuration})),t}function Gu(r){return r[0]>0&&r[1]>0}function Ev(r,t,e){return e===void 0&&(e=[0,0]),e[0]=r[0]*t+.5|0,e[1]=r[1]*t+.5|0,e}function _e(r,t){return Array.isArray(r)?r:(t===void 0?t=[r,r]:(t[0]=r,t[1]=r),t)}function Uu(r){if(r instanceof Js){r.setMapInternal(null);return}r instanceof so&&r.getLayers().forEach(Uu)}function ju(r,t){if(r instanceof Js){r.setMapInternal(t);return}if(r instanceof so){const e=r.getLayers().getArray();for(let i=0,n=e.length;i<n;++i)ju(e[i],t)}}class Lv extends be{constructor(t){super(),t=t||{},this.on,this.once,this.un;const e=bv(t);this.renderComplete_,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=t.maxTilesLoading!==void 0?t.maxTilesLoading:16,this.pixelRatio_=t.pixelRatio!==void 0?t.pixelRatio:Kc,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=Vt(),this.pixelToCoordinateTransform_=Vt(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=null,this.moveTolerance_=t.moveTolerance,this.keyboardEventTarget_=e.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,this.resizeObserver_=new ResizeObserver(()=>this.updateSize()),this.controls=e.controls||Du(),this.interactions=e.interactions||wv({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new Dy(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Zt.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Zt.VIEW,this.handleViewChanged_),this.addChangeListener(Zt.SIZE,this.handleSizeChanged_),this.addChangeListener(Zt.TARGET,this.handleTargetChanged_),this.setProperties(e.values);const i=this;t.view&&!(t.view instanceof Ne)&&t.view.then(function(n){i.setView(new Ne(n))}),this.controls.addEventListener(oe.ADD,n=>{n.element.setMap(this)}),this.controls.addEventListener(oe.REMOVE,n=>{n.element.setMap(null)}),this.interactions.addEventListener(oe.ADD,n=>{n.element.setMap(this)}),this.interactions.addEventListener(oe.REMOVE,n=>{n.element.setMap(null)}),this.overlays_.addEventListener(oe.ADD,n=>{this.addOverlayInternal_(n.element)}),this.overlays_.addEventListener(oe.REMOVE,n=>{const o=n.element.getId();o!==void 0&&delete this.overlayIdIndex_[o.toString()],n.element.setMap(null)}),this.controls.forEach(n=>{n.setMap(this)}),this.interactions.forEach(n=>{n.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){ju(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();e!==void 0&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,i){if(!this.frameState_||!this.renderer_)return;const n=this.getCoordinateFromPixelInternal(t);i=i!==void 0?i:{};const o=i.hitTolerance!==void 0?i.hitTolerance:0,a=i.layerFilter!==void 0?i.layerFilter:pr,h=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,o,h,e,null,a,null)}getFeaturesAtPixel(t,e){const i=[];return this.forEachFeatureAtPixel(t,function(n){i.push(n)},e),i}getAllLayers(){const t=[];function e(i){i.forEach(function(n){n instanceof so?e(n.getLayers()):t.push(n)})}return e(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};const n=e.layerFilter!==void 0?e.layerFilter:pr,o=e.hitTolerance!==void 0?e.hitTolerance:0,a=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,o,a,n,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const i=this.viewport_.getBoundingClientRect(),n=this.getSize(),o=i.width/n[0],a=i.height/n[1],h="changedTouches"in t?t.changedTouches[0]:t;return[(h.clientX-i.left)/o,(h.clientY-i.top)/a]}getTarget(){return this.get(Zt.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return Fa(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?Ot(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return e!==void 0?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Zt.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof Be){e.setLayers(t);return}const i=e.getLayers();i.clear(),i.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e<i;++e){const n=t[e];if(!n.visible)continue;const o=n.layer.getRenderer();if(o&&!o.ready)return!0;const a=n.layer.getSource();if(a&&a.loading)return!0}return!1}getPixelFromCoordinate(t){const e=ii(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){const e=this.frameState_;return e?Ot(e.coordinateToPixelTransform,t.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(Zt.SIZE)}getView(){return this.get(Zt.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const t=this.getTargetElement();return t?t.ownerDocument:document}getTilePriority(t,e,i,n){return Oy(this.frameState_,t,e,i,n)}handleBrowserEvent(t,e){e=e||t.type;const i=new Ti(e,this,t);this.handleMapBrowserEvent(i)}handleMapBrowserEvent(t){if(!this.frameState_)return;const e=t.originalEvent,i=e.type;if(i===rl.POINTERDOWN||i===ot.WHEEL||i===ot.KEYDOWN){const n=this.getOwnerDocument(),o=this.viewport_.getRootNode?this.viewport_.getRootNode():n,a=e.target;if(this.overlayContainerStopEvent_.contains(a)||!(o===n?n.documentElement:o).contains(a))return}if(t.frameState=this.frameState_,this.dispatchEvent(t)!==!1){const n=this.getInteractions().getArray().slice();for(let o=n.length-1;o>=0;o--){const a=n[o];if(a.getMap()!==this||!a.getActive()||!this.getTargetElement())continue;if(!a.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let n=this.maxTilesLoading_,o=n;if(t){const a=t.viewHints;if(a[Ut.ANIMATING]||a[Ut.INTERACTING]){const h=Date.now()-t.time>8;n=h?0:8,o=h?0:2}}e.getTilesLoading()<n&&(e.reprioritize(),e.loadMoreTiles(n,o))}t&&this.renderer_&&!t.animate&&(this.renderComplete_===!0?(this.hasListener(qt.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(qt.RENDERCOMPLETE,t),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new Dn(oi.LOADEND,this,t)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new Dn(oi.LOADSTART,this,t))));const i=this.postRenderFunctions_;for(let n=0,o=i.length;n<o;++n)i[n](this,t);i.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let i=0,n=this.targetChangeHandlerKeys_.length;i<n;++i)Et(this.targetChangeHandlerKeys_[i]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(ot.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(ot.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,io(this.viewport_)}if(this.targetElement_){this.resizeObserver_.unobserve(this.targetElement_);const i=this.targetElement_.getRootNode();i instanceof ShadowRoot&&this.resizeObserver_.unobserve(i.host),this.setSize(void 0)}const t=this.getTarget(),e=typeof t=="string"?document.getElementById(t):t;if(this.targetElement_=e,!e)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{e.appendChild(this.viewport_),this.renderer_||(this.renderer_=new Cy(this)),this.mapBrowserEventHandler_=new ky(this,this.moveTolerance_);for(const o in Rt)this.mapBrowserEventHandler_.addEventListener(Rt[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(ot.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(ot.WHEEL,this.boundHandleBrowserEvent_,Jc?{passive:!1}:!1);const i=this.keyboardEventTarget_?this.keyboardEventTarget_:e;this.targetChangeHandlerKeys_=[ut(i,ot.KEYDOWN,this.handleBrowserEvent,this),ut(i,ot.KEYPRESS,this.handleBrowserEvent,this)];const n=e.getRootNode();n instanceof ShadowRoot&&this.resizeObserver_.observe(n.host),this.resizeObserver_.observe(e)}this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(Et(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Et(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=ut(t,wn.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=ut(t,ot.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Et),this.layerGroupPropertyListenerKeys_=null);const t=this.getLayerGroup();t&&(this.handleLayerAdd_(new bi("addlayer",t)),this.layerGroupPropertyListenerKeys_=[ut(t,wn.PROPERTYCHANGE,this.render,this),ut(t,ot.CHANGE,this.render,this),ut(t,"addlayer",this.handleLayerAdd_,this),ut(t,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e<i;++e){const n=t[e].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}flushDeclutterItems(){const t=this.frameState_;t&&this.renderer_.flushDeclutterItems(t)}removeControl(t){return this.getControls().remove(t)}removeInteraction(t){return this.getInteractions().remove(t)}removeLayer(t){return this.getLayerGroup().getLayers().remove(t)}handleLayerRemove_(t){Uu(t.layer)}removeOverlay(t){return this.getOverlays().remove(t)}renderFrame_(t){const e=this.getSize(),i=this.getView(),n=this.frameState_;let o=null;if(e!==void 0&&Gu(e)&&i&&i.isDef()){const a=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),h=i.getState();if(o={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:Sa(h.center,h.resolution,h.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:h,viewHints:a,wantedTiles:{},mapId:ht(this),renderTargets:{}},h.nextCenter&&h.nextResolution){const c=isNaN(h.nextRotation)?h.rotation:h.nextRotation;o.nextExtent=Sa(h.nextCenter,h.nextResolution,c,e)}}this.frameState_=o,this.renderer_.renderFrame(o),o&&(o.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions),n&&(!this.previousExtent_||!Fs(this.previousExtent_)&&!Sn(o.extent,this.previousExtent_))&&(this.dispatchEvent(new Dn(oi.MOVESTART,this,n)),this.previousExtent_=yr(this.previousExtent_)),this.previousExtent_&&!o.viewHints[Ut.ANIMATING]&&!o.viewHints[Ut.INTERACTING]&&!Sn(o.extent,this.previousExtent_)&&(this.dispatchEvent(new Dn(oi.MOVEEND,this,o)),Mc(o.extent,this.previousExtent_))),this.dispatchEvent(new Dn(oi.POSTRENDER,this,o)),this.renderComplete_=this.hasListener(oi.LOADSTART)||this.hasListener(oi.LOADEND)||this.hasListener(qt.RENDERCOMPLETE)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new bi("removelayer",e)),this.set(Zt.LAYERGROUP,t)}setSize(t){this.set(Zt.SIZE,t)}setTarget(t){this.set(Zt.TARGET,t)}setView(t){if(!t||t instanceof Ne){this.set(Zt.VIEW,t);return}this.set(Zt.VIEW,new Ne);const e=this;t.then(function(i){e.setView(new Ne(i))})}updateSize(){const t=this.getTargetElement();let e;if(t){const n=getComputedStyle(t),o=t.offsetWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderRightWidth),a=t.offsetHeight-parseFloat(n.borderTopWidth)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderBottomWidth);!isNaN(o)&&!isNaN(a)&&(e=[o,a],!Gu(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&Fc("No map visible because the map container's width or height are 0."))}const i=this.getSize();e&&(!i||!ei(e,i))&&(this.setSize(e),this.updateViewportSize_())}updateViewportSize_(){const t=this.getView();if(t){let e;const i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}}}function bv(r){let t=null;r.keyboardEventTarget!==void 0&&(t=typeof r.keyboardEventTarget=="string"?document.getElementById(r.keyboardEventTarget):r.keyboardEventTarget);const e={},i=r.layers&&typeof r.layers.getLayers=="function"?r.layers:new so({layers:r.layers});e[Zt.LAYERGROUP]=i,e[Zt.TARGET]=r.target,e[Zt.VIEW]=r.view instanceof Ne?r.view:new Ne;let n;r.controls!==void 0&&(Array.isArray(r.controls)?n=new Be(r.controls.slice()):(gt(typeof r.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),n=r.controls));let o;r.interactions!==void 0&&(Array.isArray(r.interactions)?o=new Be(r.interactions.slice()):(gt(typeof r.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),o=r.interactions));let a;return r.overlays!==void 0?Array.isArray(r.overlays)?a=new Be(r.overlays.slice()):(gt(typeof r.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),a=r.overlays):a=new Be,{controls:n,interactions:o,keyboardEventTarget:t,overlays:a,values:e}}const Tv=Lv,Ct={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class cl{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=_e(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new cl({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return nt()}getImage(t){return nt()}getHitDetectionImage(){return nt()}getPixelRatio(t){return 1}getImageState(){return nt()}getImageSize(){return nt()}getOrigin(){return nt()}getSize(){return nt()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=_e(t)}listenImageChange(t){nt()}load(){nt()}unlistenImageChange(t){nt()}}const Zu=cl;function Ge(r){return Array.isArray(r)?Eu(r):r}class ul extends Zu{constructor(t){const e=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:1,rotateWithView:e,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode}),this.canvas_=void 0,this.hitDetectionCanvas_=null,this.fill_=t.fill!==void 0?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=t.radius!==void 0?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=t.angle!==void 0?t.angle:0,this.stroke_=t.stroke!==void 0?t.stroke:null,this.size_=null,this.renderOptions_=null,this.render()}clone(){const t=this.getScale(),e=new ul({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_;if(!t)return null;const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(t){let e=this.canvas_[t];if(!e){const i=this.renderOptions_,n=Jt(i.size*t,i.size*t);this.draw_(i,n,t),e=n.canvas,this.canvas_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return Ct.LOADED}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,i){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let n=this.radius_,o=this.radius2_===void 0?n:this.radius2_;if(n<o){const R=n;n=o,o=R}const a=this.radius2_===void 0?this.points_:this.points_*2,h=2*Math.PI/a,c=o*Math.sin(h),d=Math.sqrt(o*o-c*c),f=n-d,p=Math.sqrt(c*c+f*f),m=p/c;if(t==="miter"&&m<=i)return m*e;const y=e/2/m,v=e/2*(f/p),C=Math.sqrt((n+y)*(n+y)+v*v)-n;if(this.radius2_===void 0||t==="bevel")return C*2;const S=n*Math.sin(h),w=Math.sqrt(n*n-S*S),b=o-w,P=Math.sqrt(S*S+b*b)/S;if(P<=i){const R=P*e/2-o-n;return 2*Math.max(C,R)}return C*2}createRenderOptions(){let t=Rn,e=An,i=0,n=null,o=0,a,h=0;this.stroke_&&(a=this.stroke_.getColor(),a===null&&(a=Mr),a=Ge(a),h=this.stroke_.getWidth(),h===void 0&&(h=Pr),n=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),e=this.stroke_.getLineJoin(),e===void 0&&(e=An),t=this.stroke_.getLineCap(),t===void 0&&(t=Rn),i=this.stroke_.getMiterLimit(),i===void 0&&(i=Cr));const c=this.calculateLineJoinSize_(e,h,i),d=Math.max(this.radius_,this.radius2_||0),f=Math.ceil(2*d+c);return{strokeStyle:a,strokeWidth:h,size:f,lineCap:t,lineDash:n,lineDashOffset:o,lineJoin:e,miterLimit:i}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]}draw_(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let n=this.fill_.getColor();n===null&&(n=ae),e.fillStyle=Ge(n),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}createHitDetectionCanvas_(t){if(this.fill_){let e=this.fill_.getColor(),i=0;if(typeof e=="string"&&(e=Lr(e)),e===null?i=1:Array.isArray(e)&&(i=e.length===4?e[3]:1),i===0){const n=Jt(t.size,t.size);this.hitDetectionCanvas_=n.canvas,this.drawHitDetectionCanvas_(t,n)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))}createPath_(t){let e=this.points_;const i=this.radius_;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{const n=this.radius2_===void 0?i:this.radius2_;this.radius2_!==void 0&&(e*=2);const o=this.angle_-Math.PI/2,a=2*Math.PI/e;for(let h=0;h<e;h++){const c=o+h*a,d=h%2===0?i:n;t.lineTo(d*Math.cos(c),d*Math.sin(c))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=ae,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}}const Wu=ul;class dl extends Wu{constructor(t){t=t||{radius:5},super({points:1/0,fill:t.fill,radius:t.radius,stroke:t.stroke,scale:t.scale!==void 0?t.scale:1,rotation:t.rotation!==void 0?t.rotation:0,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){const t=this.getScale(),e=new dl({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}setRadius(t){this.radius_=t,this.render()}}const Hu=dl;class fl{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null}clone(){const t=this.getColor();return new fl({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){this.color_=t}}const ho=fl;class gl{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new gl({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}const co=gl;class uo{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=Vu,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&typeof t=="object"&&(t=t.clone()),new uo({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){typeof t=="function"?this.geometryFunction_=t:typeof t=="string"?this.geometryFunction_=function(e){return e.get(t)}:t?t!==void 0&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Vu,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function Cv(r){let t;if(typeof r=="function")t=r;else{let e;Array.isArray(r)?e=r:(gt(typeof r.getZIndex=="function","Expected an `Style` or an array of `Style`"),e=[r]),t=function(){return e}}return t}let pl=null;function Mv(r,t){if(!pl){const e=new ho({color:"rgba(255,255,255,0.4)"}),i=new co({color:"#3399CC",width:1.25});pl=[new uo({image:new Hu({fill:e,stroke:i,radius:5}),fill:e,stroke:i})]}return pl}function Vu(r){return r.getGeometry()}const On=uo;function Sv(r,t,e){const i=r;let n=!0,o=!1,a=!1;const h=[Ms(i,ot.LOAD,function(){a=!0,o||t()})];return i.src&&qc?(o=!0,i.decode().then(function(){n&&t()}).catch(function(c){n&&(a?t():e())})):h.push(Ms(i,ot.ERROR,e)),function(){n=!1,h.forEach(Et)}}function Pv(r,t){return new Promise((e,i)=>{function n(){a(),e(r)}function o(){a(),i(new Error("Image load error"))}function a(){r.removeEventListener("load",n),r.removeEventListener("error",o)}r.addEventListener("load",n),r.addEventListener("error",o),t&&(r.src=t)})}function kv(r,t){return t&&(r.src=t),qc?new Promise((e,i)=>r.decode().then(()=>e(r),i)):Pv(r)}let Ar=null;class Rv extends Cs{constructor(t,e,i,n,o){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=o,this.imageState_=n===void 0?Ct.IDLE:n,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===Ct.LOADED){Ar||(Ar=Jt(1,1,void 0,{willReadFrequently:!0})),Ar.drawImage(this.image_,0,0);try{Ar.getImageData(0,0,1,1),this.tainted_=!1}catch{Ar=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(ot.CHANGE)}handleImageError_(){this.imageState_=Ct.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=Ct.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],i=Jt(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===Ct.IDLE){this.image_||this.initializeImage_(),this.imageState_=Ct.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&kv(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==Ct.LOADED)return;const e=this.image_,i=document.createElement("canvas");i.width=Math.ceil(e.width*t),i.height=Math.ceil(e.height*t);const n=i.getContext("2d");n.scale(t,t),n.drawImage(e,0,0),n.globalCompositeOperation="multiply",n.fillStyle=xu(this.color_),n.fillRect(0,0,i.width/t,i.height/t),n.globalCompositeOperation="destination-in",n.drawImage(e,0,0),this.canvas_[t]=i}}function Av(r,t,e,i,n){let o=t===void 0?void 0:qs.get(t,e,n);return o||(o=new Rv(r,r instanceof HTMLImageElement?r.src||void 0:t,e,i,n),qs.set(t,e,n,o)),o}function Xu(r,t,e,i){return e!==void 0&&i!==void 0?[e/r,i/t]:e!==void 0?e/r:i!==void 0?i/t:1}class _l extends Zu{constructor(t){t=t||{};const e=t.opacity!==void 0?t.opacity:1,i=t.rotation!==void 0?t.rotation:0,n=t.scale!==void 0?t.scale:1,o=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:i,scale:n,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:o,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const a=t.img!==void 0?t.img:null;let h=t.src;gt(!(h!==void 0&&a),"`image` and `src` cannot be provided at the same time"),(h===void 0||h.length===0)&&a&&(h=a.src||ht(a)),gt(h!==void 0&&h.length>0,"A defined and non-empty `src` or `image` must be provided"),gt(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let c;if(t.src!==void 0?c=Ct.IDLE:a!==void 0&&(a instanceof HTMLImageElement?a.complete?c=a.src?Ct.LOADED:Ct.IDLE:c=Ct.LOADING:c=Ct.LOADED),this.color_=t.color!==void 0?Lr(t.color):null,this.iconImage_=Av(a,h,this.crossOrigin_,c,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,t.width!==void 0||t.height!==void 0){let d,f;if(t.size)[d,f]=t.size;else{const p=this.getImage(1);if(p.width&&p.height)d=p.width,f=p.height;else if(p instanceof HTMLImageElement){this.initialOptions_=t;const m=()=>{if(this.unlistenImageChange(m),!this.initialOptions_)return;const y=this.iconImage_.getSize();this.setScale(Xu(y[0],y[1],t.width,t.height))};this.listenImageChange(m);return}}d!==void 0&&this.setScale(Xu(d,f,t.width,t.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new _l({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:i,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const n=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!n)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=n[0]),this.anchorYUnits_=="fraction"&&(t[1]*=n[1])}if(this.anchorOrigin_!="top-left"){if(!n)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+n[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+n[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=i[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==Ct.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==Ct.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(ot.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(ot.CHANGE,t)}}const ml=_l,Iv="#333";class yl{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=_e(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new ho({color:Iv}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding}clone(){const t=this.getScale();return new yl({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=_e(t!==void 0?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}const Yu=yl;let Fn=0;const Qt=1<<Fn++,ft=1<<Fn++,zn=1<<Fn++,vl=1<<Fn++,Ir=1<<Fn++,Ce=Math.pow(2,Fn)-1,Ku={[Qt]:"boolean",[ft]:"number",[zn]:"string",[vl]:"color",[Ir]:"number[]"},Dv=Object.keys(Ku).map(Number).sort(xi);function fo(r){const t=[];for(const e of Dv)Ov(r,e)&&t.push(Ku[e]);return t.length===0?"untyped":t.length<3?t.join(" or "):t.slice(0,-1).join(", ")+", or "+t[t.length-1]}function Ov(r,t){return(r&t)===t}function qu(r,t){return!!(r&t)}class Ci{constructor(t,e){this.type=t,this.value=e}}class Fv{constructor(t,e,...i){this.type=t,this.operator=e,this.args=i}}function Ju(){return{variables:new Set,properties:new Set}}function go(r,t){switch(typeof r){case"boolean":return new Ci(Qt,r);case"number":return new Ci(ft,r);case"string":return new Ci(zn,r)}if(!Array.isArray(r))throw new Error("Expression must be an array or a primitive value");if(r.length===0)throw new Error("Empty expression");if(typeof r[0]=="string")return Uv(r,t);for(const i of r)if(typeof i!="number")throw new Error("Expected an array of numbers");let e=Ir;return(r.length===3||r.length===4)&&(e|=vl),new Ci(e,r)}const B={Number:"number",String:"string",Get:"get",Var:"var",Any:"any",All:"all",Not:"!",Resolution:"resolution",Equal:"==",NotEqual:"!=",GreaterThan:">",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match"},zv={[B.Number]:wt(bt(1,1/0,Ce),ft),[B.String]:wt(bt(1,1/0,Ce),zn),[B.Get]:wt(Nv,Ce),[B.Var]:wt(Bv,Ce),[B.Resolution]:wt(Gv,ft),[B.Any]:wt(bt(2,1/0,Qt),Qt),[B.All]:wt(bt(2,1/0,Qt),Qt),[B.Not]:wt(bt(1,1,Qt),Qt),[B.Equal]:wt(bt(2,2,Ce),Qt),[B.NotEqual]:wt(bt(2,2,Ce),Qt),[B.GreaterThan]:wt(bt(2,2,Ce),Qt),[B.GreaterThanOrEqualTo]:wt(bt(2,2,Ce),Qt),[B.LessThan]:wt(bt(2,2,Ce),Qt),[B.LessThanOrEqualTo]:wt(bt(2,2,Ce),Qt),[B.Multiply]:wt(bt(2,1/0,ft),ft),[B.Divide]:wt(bt(2,2,ft),ft),[B.Add]:wt(bt(2,1/0,ft),ft),[B.Subtract]:wt(bt(2,2,ft),ft),[B.Clamp]:wt(bt(3,3,ft),ft),[B.Mod]:wt(bt(2,2,ft),ft),[B.Pow]:wt(bt(2,2,ft),ft),[B.Abs]:wt(bt(1,1,ft),ft),[B.Floor]:wt(bt(1,1,ft),ft),[B.Ceil]:wt(bt(1,1,ft),ft),[B.Round]:wt(bt(1,1,ft),ft),[B.Sin]:wt(bt(1,1,ft),ft),[B.Cos]:wt(bt(1,1,ft),ft),[B.Atan]:wt(bt(1,2,ft),ft),[B.Sqrt]:wt(bt(1,1,ft),ft),[B.Match]:wt(bt(4,1/0,zn|ft),Ce)};function Nv(r,t){if(r.length!==2)throw new Error("Expected 1 argument for get operation");const e=go(r[1],t);if(!(e instanceof Ci))throw new Error("Expected a literal argument for get operation");if(typeof e.value!="string")throw new Error("Expected a string argument for get operation");return t.properties.add(e.value),[e]}function Bv(r,t){if(r.length!==2)throw new Error("Expected 1 argument for var operation");const e=go(r[1],t);if(!(e instanceof Ci))throw new Error("Expected a literal argument for var operation");if(typeof e.value!="string")throw new Error("Expected a string argument for get operation");return t.variables.add(e.value),[e]}function Gv(r,t){const e=r[0];if(r.length!==1)throw new Error(`Expected no arguments for ${e} operation`);return[]}function bt(r,t,e){return function(i,n){const o=i[0],a=i.length-1;if(r===t){if(a!==r){const c=r===1?"":"s";throw new Error(`Expected ${r} argument${c} for operation ${o}, got ${a}`)}}else if(a<r||a>t)throw new Error(`Expected ${r} to ${t} arguments for operation ${o}, got ${a}`);const h=new Array(a);for(let c=0;c<a;++c){const d=go(i[c+1],n);if(!qu(e,d.type)){const f=fo(e),p=fo(d.type);throw new Error(`Unexpected type for argument ${c} of ${o} operation : got ${f} but expected ${p}`)}h[c]=d}return h}}function wt(r,t){return function(e,i){const n=e[0],o=r(e,i);return new Fv(t,n,...o)}}function Uv(r,t){const e=r[0],i=zv[e];if(!i)throw new Error(`Unknown operator: ${e}`);return i(r,t)}function Qu(){return{variables:{},properties:{},resolution:NaN}}function Mi(r,t,e){const i=go(r,e);if(!qu(t,i.type)){const n=fo(t),o=fo(i.type);throw new Error(`Expected expression to be of type ${n}, got ${o}`)}return an(i)}function an(r,t){if(r instanceof Ci)return function(){return r.value};const e=r.operator;switch(e){case B.Number:case B.String:return jv(r);case B.Get:case B.Var:return Zv(r);case B.Resolution:return i=>i.resolution;case B.Any:case B.All:case B.Not:return Hv(r);case B.Equal:case B.NotEqual:case B.LessThan:case B.LessThanOrEqualTo:case B.GreaterThan:case B.GreaterThanOrEqualTo:return Wv(r);case B.Multiply:case B.Divide:case B.Add:case B.Subtract:case B.Clamp:case B.Mod:case B.Pow:case B.Abs:case B.Floor:case B.Ceil:case B.Round:case B.Sin:case B.Cos:case B.Atan:case B.Sqrt:return Vv(r);case B.Match:return Xv(r);default:throw new Error(`Unsupported operator ${e}`)}}function jv(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let o=0;o<i;++o)n[o]=an(r.args[o]);switch(e){case B.Number:case B.String:return o=>{for(let a=0;a<i;++a){const h=n[a](o);if(typeof h===e)return h}throw new Error(`Expected one of the values to be a ${e}`)};default:throw new Error(`Unsupported assertion operator ${e}`)}}function Zv(r,t){const e=r.args[0];if(!(e instanceof Ci))throw new Error("Expected literal name");const i=e.value;if(typeof i!="string")throw new Error("Expected string name");switch(r.operator){case B.Get:return n=>n.properties[i];case B.Var:return n=>n.variables[i];default:throw new Error(`Unsupported accessor operator ${r.operator}`)}}function Wv(r,t){const e=r.operator,i=an(r.args[0]),n=an(r.args[1]);switch(e){case B.Equal:return o=>i(o)===n(o);case B.NotEqual:return o=>i(o)!==n(o);case B.LessThan:return o=>i(o)<n(o);case B.LessThanOrEqualTo:return o=>i(o)<=n(o);case B.GreaterThan:return o=>i(o)>n(o);case B.GreaterThanOrEqualTo:return o=>i(o)>=n(o);default:throw new Error(`Unsupported comparison operator ${e}`)}}function Hv(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let o=0;o<i;++o)n[o]=an(r.args[o]);switch(e){case B.Any:return o=>{for(let a=0;a<i;++a)if(n[a](o))return!0;return!1};case B.All:return o=>{for(let a=0;a<i;++a)if(!n[a](o))return!1;return!0};case B.Not:return o=>!n[0](o);default:throw new Error(`Unsupported logical operator ${e}`)}}function Vv(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let o=0;o<i;++o)n[o]=an(r.args[o]);switch(e){case B.Multiply:return o=>{let a=1;for(let h=0;h<i;++h)a*=n[h](o);return a};case B.Divide:return o=>n[0](o)/n[1](o);case B.Add:return o=>{let a=0;for(let h=0;h<i;++h)a+=n[h](o);return a};case B.Subtract:return o=>n[0](o)-n[1](o);case B.Clamp:return o=>{const a=n[0](o),h=n[1](o);if(a<h)return h;const c=n[2](o);return a>c?c:a};case B.Mod:return o=>n[0](o)%n[1](o);case B.Pow:return o=>Math.pow(n[0](o),n[1](o));case B.Abs:return o=>Math.abs(n[0](o));case B.Floor:return o=>Math.floor(n[0](o));case B.Ceil:return o=>Math.ceil(n[0](o));case B.Round:return o=>Math.round(n[0](o));case B.Sin:return o=>Math.sin(n[0](o));case B.Cos:return o=>Math.cos(n[0](o));case B.Atan:return i===2?o=>Math.atan2(n[0](o),n[1](o)):o=>Math.atan(n[0](o));case B.Sqrt:return o=>Math.sqrt(n[0](o));default:throw new Error(`Unsupported numeric operator ${e}`)}}function Xv(r,t){const e=r.args.length,i=new Array(e);for(let n=0;n<e;++n)i[n]=an(r.args[n]);return n=>{const o=i[0](n);for(let a=1;a<e;a+=2)if(o===i[a](n))return i[a+1](n);return i[e-1](n)}}function Yv(r){return!0}function Kv(r){const t=Ju(),e=qv(r,t),i=Qu();return function(n,o){return i.properties=n.getPropertiesInternal(),i.resolution=o,e(i)}}function $u(r){const t=Ju(),e=r.length,i=new Array(e);for(let a=0;a<e;++a)i[a]=xl(r[a],t);const n=Qu(),o=new Array(e);return function(a,h){n.properties=a.getPropertiesInternal(),n.resolution=h;for(let c=0;c<e;++c)o[c]=i[c](n);return o}}function qv(r,t){const e=r.length,i=new Array(e);for(let n=0;n<e;++n){const o=r[n],a="filter"in o?Mi(o.filter,Qt,t):Yv;let h;if(Array.isArray(o.style)){const c=o.style.length;h=new Array(c);for(let d=0;d<c;++d)h[d]=xl(o.style[d],t)}else h=[xl(o.style,t)];i[n]={filter:a,styles:h}}return function(n){const o=[];let a=!1;for(let h=0;h<e;++h){const c=i[h].filter;if(c(n)&&!(r[h].else&&a)){a=!0;for(const d of i[h].styles){const f=d(n);f&&o.push(f)}}}return o}}function xl(r,t){const e=Dr(r,"",t),i=Or(r,"",t),n=Jv(r,t),o=Qv(r,t),a=le(r,"z-index",t),h=new On;return function(c){let d=!0;if(e){const f=e(c);f&&(d=!1),h.setFill(f)}if(i){const f=i(c);f&&(d=!1),h.setStroke(f)}if(n){const f=n(c);f&&(d=!1),h.setText(f)}if(o){const f=o(c);f&&(d=!1),h.setImage(f)}return a&&h.setZIndex(a(c)),d?null:h}}function Dr(r,t,e){const i=td(r,t+"fill-color",e);if(!i)return null;const n=new ho;return function(o){const a=i(o);return a==="none"?null:(n.setColor(a),n)}}function Or(r,t,e){const i=le(r,t+"stroke-width",e),n=td(r,t+"stroke-color",e);if(!i&&!n)return null;const o=Si(r,t+"stroke-line-cap",e),a=Si(r,t+"stroke-line-join",e),h=ed(r,t+"stroke-line-dash",e),c=le(r,t+"stroke-line-dash-offset",e),d=le(r,t+"stroke-miter-limit",e),f=new co;return function(p){if(n){const m=n(p);if(m==="none")return null;f.setColor(m)}if(i&&f.setWidth(i(p)),o){const m=o(p);if(m!=="butt"&&m!=="round"&&m!=="square")throw new Error("Expected butt, round, or square line cap");f.setLineCap(m)}if(a){const m=a(p);if(m!=="bevel"&&m!=="round"&&m!=="miter")throw new Error("Expected bevel, round, or miter line join");f.setLineJoin(m)}return h&&f.setLineDash(h(p)),c&&f.setLineDashOffset(c(p)),d&&f.setMiterLimit(d(p)),f}}function Jv(r,t){const e="text-",i=Si(r,e+"value",t);if(!i)return null;const n=Dr(r,e,t),o=Dr(r,e+"background-",t),a=Or(r,e,t),h=Or(r,e+"background-",t),c=Si(r,e+"font",t),d=le(r,e+"max-angle",t),f=le(r,e+"offset-x",t),p=le(r,e+"offset-y",t),m=Fr(r,e+"overflow",t),y=Si(r,e+"placement",t),v=le(r,e+"repeat",t),E=_o(r,e+"scale",t),C=Fr(r,e+"rotate-with-view",t),S=le(r,e+"rotation",t),w=Si(r,e+"align",t),b=Si(r,e+"justify",t),T=Si(r,e+"baseline",t),P=ed(r,e+"padding",t),R=new Yu({});return function(I){if(R.setText(i(I)),n&&R.setFill(n(I)),o&&R.setBackgroundFill(o(I)),a&&R.setStroke(a(I)),h&&R.setBackgroundStroke(h(I)),c&&R.setFont(c(I)),d&&R.setMaxAngle(d(I)),f&&R.setOffsetX(f(I)),p&&R.setOffsetY(p(I)),m&&R.setOverflow(m(I)),y){const O=y(I);if(O!=="point"&&O!=="line")throw new Error("Expected point or line for text-placement");R.setPlacement(O)}if(v&&R.setRepeat(v(I)),E&&R.setScale(E(I)),C&&R.setRotateWithView(C(I)),S&&R.setRotation(S(I)),w){const O=w(I);if(O!=="left"&&O!=="center"&&O!=="right"&&O!=="end"&&O!=="start")throw new Error("Expected left, right, center, start, or end for text-align");R.setTextAlign(O)}if(b){const O=b(I);if(O!=="left"&&O!=="right"&&O!=="center")throw new Error("Expected left, right, or center for text-justify");R.setJustify(O)}if(T){const O=T(I);if(O!=="bottom"&&O!=="top"&&O!=="middle"&&O!=="alphabetic"&&O!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");R.setTextBaseline(O)}return P&&R.setPadding(P(I)),R}}function Qv(r,t){return"icon-src"in r?$v(r,t):"shape-points"in r?tx(r,t):"circle-radius"in r?ex(r,t):null}function $v(r,t){const e="icon-",i=e+"src",n=rd(r[i],i),o=po(r,e+"anchor",t),a=_o(r,e+"scale",t),h=le(r,e+"opacity",t),c=po(r,e+"displacement",t),d=le(r,e+"rotation",t),f=Fr(r,e+"rotate-with-view",t),p=id(r,e+"anchor-origin"),m=nd(r,e+"anchor-x-units"),y=nd(r,e+"anchor-y-units"),v=sx(r,e+"color"),E=nx(r,e+"cross-origin"),C=rx(r,e+"offset"),S=id(r,e+"offset-origin"),w=Nn(r,e+"width"),b=Nn(r,e+"height"),T=ix(r,e+"size"),P=wl(r,e+"declutter"),R=new ml({src:n,anchorOrigin:p,anchorXUnits:m,anchorYUnits:y,color:v,crossOrigin:E,offset:C,offsetOrigin:S,height:b,width:w,size:T,declutterMode:P});return function(I){return h&&R.setOpacity(h(I)),c&&R.setDisplacement(c(I)),d&&R.setRotation(d(I)),f&&R.setRotateWithView(f(I)),a&&R.setScale(a(I)),o&&R.setAnchor(o(I)),R}}function tx(r,t){const e="shape-",i=e+"points",n=sd(r[i],i),o=Dr(r,e,t),a=Or(r,e,t),h=_o(r,e+"scale",t),c=po(r,e+"displacement",t),d=le(r,e+"rotation",t),f=Fr(r,e+"rotate-with-view",t),p=Nn(r,e+"radius"),m=Nn(r,e+"radius1"),y=Nn(r,e+"radius2"),v=Nn(r,e+"angle"),E=wl(r,e+"declutter-mode"),C=new Wu({points:n,radius:p,radius1:m,radius2:y,angle:v,declutterMode:E});return function(S){return o&&C.setFill(o(S)),a&&C.setStroke(a(S)),c&&C.setDisplacement(c(S)),d&&C.setRotation(d(S)),f&&C.setRotateWithView(f(S)),h&&C.setScale(h(S)),C}}function ex(r,t){const e="circle-",i=Dr(r,e,t),n=Or(r,e,t),o=le(r,e+"radius",t),a=_o(r,e+"scale",t),h=po(r,e+"displacement",t),c=le(r,e+"rotation",t),d=Fr(r,e+"rotate-with-view",t),f=wl(r,e+"declutter-mode"),p=new Hu({radius:5,declutterMode:f});return function(m){return o&&p.setRadius(o(m)),i&&p.setFill(i(m)),n&&p.setStroke(n(m)),h&&p.setDisplacement(h(m)),c&&p.setRotation(c(m)),d&&p.setRotateWithView(d(m)),a&&p.setScale(a(m)),p}}function le(r,t,e){if(!(t in r))return;const i=Mi(r[t],ft,e);return function(n){return sd(i(n),t)}}function Si(r,t,e){if(!(t in r))return null;const i=Mi(r[t],zn,e);return function(n){return rd(i(n),t)}}function Fr(r,t,e){if(!(t in r))return null;const i=Mi(r[t],Qt,e);return function(n){const o=i(n);if(typeof o!="boolean")throw new Error(`Expected a boolean for ${t}`);return o}}function td(r,t,e){if(!(t in r))return null;const i=Mi(r[t],vl|zn,e);return function(n){return od(i(n),t)}}function ed(r,t,e){if(!(t in r))return null;const i=Mi(r[t],Ir,e);return function(n){return zr(i(n),t)}}function po(r,t,e){if(!(t in r))return null;const i=Mi(r[t],Ir,e);return function(n){const o=zr(i(n),t);if(o.length!==2)throw new Error(`Expected two numbers for ${t}`);return o}}function _o(r,t,e){if(!(t in r))return null;const i=Mi(r[t],Ir|ft,e);return function(n){return ox(i(n),t)}}function Nn(r,t){const e=r[t];if(e!==void 0){if(typeof e!="number")throw new Error(`Expected a number for ${t}`);return e}}function ix(r,t){const e=r[t];if(e!==void 0){if(typeof e=="number")return _e(e);if(!Array.isArray(e))throw new Error(`Expected a number or size array for ${t}`);if(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number")throw new Error(`Expected a number or size array for ${t}`);return e}}function nx(r,t){const e=r[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);return e}}function id(r,t){const e=r[t];if(e!==void 0){if(e!=="bottom-left"&&e!=="bottom-right"&&e!=="top-left"&&e!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return e}}function nd(r,t){const e=r[t];if(e!==void 0){if(e!=="pixels"&&e!=="fraction")throw new Error(`Expected pixels or fraction for ${t}`);return e}}function rx(r,t){const e=r[t];if(e!==void 0)return zr(e,t)}function wl(r,t){const e=r[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);if(e!=="declutter"&&e!=="obstacle"&&e!=="none")throw new Error(`Expected declutter, obstacle, or none for ${t}`);return e}}function sx(r,t){const e=r[t];if(e!==void 0)return od(e,t)}function zr(r,t){if(!Array.isArray(r))throw new Error(`Expected an array for ${t}`);const e=r.length;for(let i=0;i<e;++i)if(typeof r[i]!="number")throw new Error(`Expected an array of numbers for ${t}`);return r}function rd(r,t){if(typeof r!="string")throw new Error(`Expected a string for ${t}`);return r}function sd(r,t){if(typeof r!="number")throw new Error(`Expected a number for ${t}`);return r}function od(r,t){if(typeof r=="string")return r;const e=zr(r,t),i=e.length;if(i<3||i>4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function ox(r,t){if(typeof r=="number")return r;const e=zr(r,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}const ad={RENDER_ORDER:"renderOrder"};class ax extends Js{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter!==void 0?t.declutter:!1,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(ad.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t){t.declutterTree||(t.declutterTree=new Rh(9)),this.getRenderer().renderDeclutter(t)}setRenderOrder(t){this.set(ad.RENDER_ORDER,t)}setStyle(t){this.style_=lx(t),this.styleFunction_=t===null?void 0:Cv(this.style_),this.changed()}}function lx(r){if(r===void 0)return Mv;if(!r)return null;if(typeof r=="function"||r instanceof On)return r;if(!Array.isArray(r))return $u([r]);if(r.length===0)return[];const t=r.length,e=r[0];if(e instanceof On){const n=new Array(t);for(let o=0;o<t;++o){const a=r[o];if(!(a instanceof On))throw new Error("Expected a list of style instances");n[o]=a}return n}if("style"in e){const n=new Array(t);for(let o=0;o<t;++o){const a=r[o];if(!("style"in a))throw new Error("Expected a list of rules with a style property");n[o]=a}return Kv(n)}return $u(r)}const El=ax,ee={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"},Ll=34962,bl=34963,hx=35040,cx=35044,Tl=35048,ux=5121,dx=5123,fx=5125,ld=5126,hd=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function gx(r,t){t=Object.assign({preserveDrawingBuffer:!0,antialias:!Lm},t);const e=hd.length;for(let i=0;i<e;++i)try{const n=r.getContext(hd[i],t);if(n)return n}catch{}return null}const px={STATIC_DRAW:cx,STREAM_DRAW:hx,DYNAMIC_DRAW:Tl};class _x{constructor(t,e){this.array=null,this.type=t,gt(t===Ll||t===bl,"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`"),this.usage=e!==void 0?e:px.STATIC_DRAW}ofSize(t){return this.array=new(Cl(this.type))(t),this}fromArray(t){return this.array=Cl(this.type).from(t),this}fromArrayBuffer(t){return this.array=new(Cl(this.type))(t),this}getType(){return this.type}getArray(){return this.array}getUsage(){return this.usage}getSize(){return this.array?this.array.length:0}}function Cl(r){switch(r){case Ll:return Float32Array;case bl:return Uint32Array;default:return Float32Array}}const cd=_x;class mx extends xc{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.declutterExecutorGroup=null}getFeatures(t){return nt()}getData(t){return null}prepareFrame(t){return nt()}renderFrame(t,e){return nt()}loadedTileCallback(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i}createLoadedTileFinder(t,e,i){return(n,o)=>{const a=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,o,a)}}forEachFeatureAtCoordinate(t,e,i,n,o){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===Ct.LOADED||e.getState()===Ct.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=Ct.LOADED&&e!=Ct.ERROR&&t.addEventListener(ot.CHANGE,this.boundHandleImageChange_),e==Ct.IDLE&&(t.load(),e=t.getState()),e==Ct.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}disposeInternal(){delete this.layer_,super.disposeInternal()}}const ud=mx,mo={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"},yx=`
|
|
18
|
+
`+v;di.get(w)===void 0&&(di.set(w,100,!0),h(f.style,f.weight,v)||(di.set(w,0,!0),s===void 0&&(s=setInterval(c,32))))}}}(),zy=function(){let r;return function(t){let e=Ll[t];if(e==null){if(il){const i=qu(t),n=$u(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else r||(r=document.createElement("div"),r.innerHTML="M",r.style.minHeight="0",r.style.maxHeight="none",r.style.height="auto",r.style.padding="0",r.style.border="none",r.style.position="absolute",r.style.display="block",r.style.left="-99999px"),r.style.font=t,document.body.appendChild(r),e=r.offsetHeight,document.body.removeChild(r);Ll[t]=e}return e}}();function $u(r,t){return Zn||(Zn=ee(1,1)),r!=El&&(Zn.font=r,El=Zn.font),Zn.measureText(t)}function wo(r,t){return $u(r,t).width}function td(r,t,e){if(t in e)return e[t];const i=t.split(`
|
|
19
|
+
`).reduce((n,s)=>Math.max(n,wo(r,s)),0);return e[t]=i,i}function Ny(r,t){const e=[],i=[],n=[];let s=0,a=0,h=0,c=0;for(let d=0,f=t.length;d<=f;d+=2){const p=t[d];if(p===`
|
|
20
|
+
`||d===f){s=Math.max(s,a),n.push(a),a=0,h+=c;continue}const _=t[d+1]||r.font,y=wo(_,p);e.push(y),a+=y;const v=zy(_);i.push(v),c=Math.max(c,v)}return{width:s,height:h,widths:e,heights:i,lineWidths:n}}function By(r,t,e,i,n,s,a,h,c,d,f){r.save(),e!==1&&(r.globalAlpha*=e),t&&r.transform.apply(r,t),i.contextInstructions?(r.translate(c,d),r.scale(f[0],f[1]),Gy(i,r)):f[0]<0||f[1]<0?(r.translate(c,d),r.scale(f[0],f[1]),r.drawImage(i,n,s,a,h,0,0,a,h)):r.drawImage(i,n,s,a,h,c,d,a*f[0],h*f[1]),r.restore()}function Gy(r,t){const e=r.contextInstructions;for(let i=0,n=e.length;i<n;i+=2)Array.isArray(e[i+1])?t[e[i]].apply(t,e[i+1]):t[e[i]]=e[i+1]}class Uy extends Py{constructor(t){super(t),this.fontChangeListenerKey_=ft(di,An.PROPERTYCHANGE,t.redrawText.bind(t)),this.element_=document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=Nr+" ol-layers";const i=t.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0,this.declutterLayers_=[]}dispatchRenderEvent(t,e){const i=this.getMap();if(i.hasListener(t)){const n=new zr(t,void 0,e);i.dispatchEvent(n)}}disposeInternal(){Ct(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),super.disposeInternal()}renderFrame(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(te.PRECOMPOSE,t);const e=t.layerStatesArray.sort(function(a,h){return a.zIndex-h.zIndex}),i=t.viewState;this.children_.length=0;const n=this.declutterLayers_;n.length=0;let s=null;for(let a=0,h=e.length;a<h;++a){const c=e[a];t.layerIndex=a;const d=c.layer,f=d.getSourceState();if(!wl(c,i)||f!="ready"&&f!="undefined"){d.unrender();continue}const p=d.render(t,s);p&&(p!==s&&(this.children_.push(p),s=p),"getDeclutter"in d&&n.push(d))}this.flushDeclutterItems(t),Oy(this.element_,this.children_),this.dispatchRenderEvent(te.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}flushDeclutterItems(t){const e=this.declutterLayers_;for(let i=e.length-1;i>=0;--i)e[i].renderDeclutter(t);e.length=0}}const jy=Uy;class Fi extends ai{constructor(t,e){super(t),this.layer=e}}const bl={LAYERS:"layers"};class Tl extends Vu{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let i=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(bl.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new Ve(i.slice(),{unique:!0}):mt(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new Ve(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(Ct),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(ft(t,ue.ADD,this.handleLayersAdd_,this),ft(t,ue.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(Ct);Dn(this.listenerKeys_);const e=t.getArray();for(let i=0,n=e.length;i<n;i++){const s=e[i];this.registerLayerListeners_(s),this.dispatchEvent(new Fi("addlayer",s))}this.changed()}registerLayerListeners_(t){const e=[ft(t,An.PROPERTYCHANGE,this.handleLayerChange_,this),ft(t,lt.CHANGE,this.handleLayerChange_,this)];t instanceof Tl&&e.push(ft(t,"addlayer",this.handleLayerGroupAdd_,this),ft(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[ct(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new Fi("addlayer",t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new Fi("removelayer",t.layer))}handleLayersAdd_(t){const e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new Fi("addlayer",e)),this.changed()}handleLayersRemove_(t){const e=t.element,i=ct(e);this.listenerKeys_[i].forEach(Ct),delete this.listenerKeys_[i],this.dispatchEvent(new Fi("removelayer",e)),this.changed()}getLayers(){return this.get(bl.LAYERS)}setLayers(t){const e=this.getLayers();if(e){const i=e.getArray();for(let n=0,s=i.length;n<s;++n)this.dispatchEvent(new Fi("removelayer",i[n]))}this.set(bl.LAYERS,t)}getLayersArray(t){return t=t!==void 0?t:[],this.getLayers().forEach(function(e){e.getLayersArray(t)}),t}getLayerStatesArray(t){const e=t!==void 0?t:[],i=e.length;this.getLayers().forEach(function(a){a.getLayerStatesArray(e)});const n=this.getLayerState();let s=n.zIndex;!t&&n.zIndex===void 0&&(s=0);for(let a=i,h=e.length;a<h;a++){const c=e[a];c.opacity*=n.opacity,c.visible=c.visible&&n.visible,c.maxResolution=Math.min(c.maxResolution,n.maxResolution),c.minResolution=Math.max(c.minResolution,n.minResolution),c.minZoom=Math.max(c.minZoom,n.minZoom),c.maxZoom=Math.min(c.maxZoom,n.maxZoom),n.extent!==void 0&&(c.extent!==void 0?c.extent=kr(c.extent,n.extent):c.extent=n.extent),c.zIndex===void 0&&(c.zIndex=s)}return e}getSourceState(){return"ready"}}const Eo=Tl;class Zy extends ai{constructor(t,e,i){super(t),this.map=e,this.frameState=i!==void 0?i:null}}const Wn=Zy;class Wy extends Wn{constructor(t,e,i,n,s,a){super(t,e,s),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=n!==void 0?n:!1,this.activePointers=a}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(t){this.pixel_=t}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(t){this.coordinate_=t}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const zi=Wy,It={SINGLECLICK:"singleclick",CLICK:lt.CLICK,DBLCLICK:lt.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Cl={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};class Hy extends js{constructor(t,e){super(t),this.map_=t,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=e===void 0?1:e,this.down_=null;const i=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=ft(i,Cl.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=ft(i,Cl.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(lt.TOUCHMOVE,this.boundHandleTouchMove_,_u?{passive:!1}:!1)}emulateClick_(t){let e=new zi(It.CLICK,this.map_,t);this.dispatchEvent(e),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new zi(It.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const i=new zi(It.SINGLECLICK,this.map_,t);this.dispatchEvent(i)},250)}updateActivePointers_(t){const e=t,i=e.pointerId;if(e.type==It.POINTERUP||e.type==It.POINTERCANCEL){delete this.trackedTouches_[i];for(const n in this.trackedTouches_)if(this.trackedTouches_[n].target!==e.target){delete this.trackedTouches_[n];break}}else(e.type==It.POINTERDOWN||e.type==It.POINTERMOVE)&&(this.trackedTouches_[i]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new zi(It.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(Ct),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return t.button===0}handlePointerDown_(t){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(t);const e=new zi(It.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),this.dragListenerKeys_.length===0){const i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(ft(i,It.POINTERMOVE,this.handlePointerMove_,this),ft(i,It.POINTERUP,this.handlePointerUp_,this),ft(this.element_,It.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(ft(this.element_.getRootNode(),It.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new zi(It.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new zi(It.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(Ct(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(lt.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Ct(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Ct),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const Vy=Hy,fi={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Vt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},Lo=1/0;class Xy{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Dn(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,i=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const n=this.keyFunction_(i);return delete this.queuedElements_[n],i}enqueue(t){mt(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=Lo?(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,i=this.priorities_,n=e.length,s=e[t],a=i[t],h=t;for(;t<n>>1;){const c=this.getLeftChildIndex_(t),d=this.getRightChildIndex_(t),f=d<n&&i[d]<i[c]?d:c;e[t]=e[f],i[t]=i[f],t=f}e[t]=s,i[t]=a,this.siftDown_(h,t)}siftDown_(t,e){const i=this.elements_,n=this.priorities_,s=i[e],a=n[e];for(;e>t;){const h=this.getParentIndex_(e);if(n[h]>a)i[e]=i[h],n[e]=n[h],e=h;else break}i[e]=s,n[e]=a}reprioritize(){const t=this.priorityFunction_,e=this.elements_,i=this.priorities_;let n=0;const s=e.length;let a,h,c;for(h=0;h<s;++h)a=e[h],c=t(a),c==Lo?delete this.queuedElements_[this.keyFunction_(a)]:(i[n]=c,e[n++]=a);e.length=n,i.length=n,this.heapify_()}}const Yy=Xy,et={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class Ky extends Yy{constructor(t,e){super(function(i){return t.apply(null,i)},function(i){return i[0].getKey()}),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=e,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(t){const e=super.enqueue(t);return e&&t[0].addEventListener(lt.CHANGE,this.boundHandleTileChange_),e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target,i=e.getState();if(i===et.LOADED||i===et.ERROR||i===et.EMPTY){i!==et.ERROR&&e.removeEventListener(lt.CHANGE,this.boundHandleTileChange_);const n=e.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let i=0,n,s,a;for(;this.tilesLoading_<t&&i<e&&this.getCount()>0;)s=this.dequeue()[0],a=s.getKey(),n=s.getState(),n===et.IDLE&&!(a in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[a]=!0,++this.tilesLoading_,++i,s.load())}}const qy=Ky;function Jy(r,t,e,i,n){if(!r||!(e in r.wantedTiles)||!r.wantedTiles[e][t.getKey()])return Lo;const s=r.viewState.center,a=i[0]-s[0],h=i[1]-s[1];return 65536*Math.log(n)+Math.sqrt(a*a+h*h)/n}class Qy extends Re{constructor(t){super();const e=t.element;e&&!t.target&&!e.style.pointerEvents&&(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){vo(this.element),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&vo(this.element);for(let e=0,i=this.listenerKeys.length;e<i;++e)Ct(this.listenerKeys[e]);this.listenerKeys.length=0,this.map_=t,t&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==In&&this.listenerKeys.push(ft(t,fi.POSTRENDER,this.render,this)),t.render())}render(t){}setTarget(t){this.target_=typeof t=="string"?document.getElementById(t):t}}const bo=Qy;class $y extends bo{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=t.collapsed!==void 0?t.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=t.collapsible!==void 0,this.collapsible_=t.collapsible!==void 0?t.collapsible:!0,this.collapsible_||(this.collapsed_=!1);const e=t.className!==void 0?t.className:"ol-attribution",i=t.tipLabel!==void 0?t.tipLabel:"Attributions",n=t.expandClassName!==void 0?t.expandClassName:e+"-expand",s=t.collapseLabel!==void 0?t.collapseLabel:"›",a=t.collapseClassName!==void 0?t.collapseClassName:e+"-collapse";typeof s=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s,this.collapseLabel_.className=a):this.collapseLabel_=s;const h=t.label!==void 0?t.label:"i";typeof h=="string"?(this.label_=document.createElement("span"),this.label_.textContent=h,this.label_.className=n):this.label_=h;const c=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(c),this.toggleButton_.addEventListener(lt.CLICK,this.handleClick_.bind(this),!1);const d=e+" "+Nr+" "+_o+(this.collapsed_&&this.collapsible_?" "+Yu:"")+(this.collapsible_?"":" ol-uncollapsible"),f=this.element;f.className=d,f.appendChild(this.toggleButton_),f.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){const e=Array.from(new Set(this.getMap().getAllLayers().flatMap(n=>n.getAttributions(t)))),i=!this.getMap().getAllLayers().some(n=>n.getSource()&&n.getSource().getAttributionsCollapsible()===!1);return this.overrideCollapsible_||this.setCollapsible(i),e}updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!li(e,this.renderedAttributions_)){Ju(this.ulElement_);for(let n=0,s=e.length;n<s;++n){const a=document.createElement("li");a.innerHTML=e[n],this.ulElement_.appendChild(a)}this.renderedAttributions_=e}}handleClick_(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(Yu),this.collapsed_?yo(this.collapseLabel_,this.label_):yo(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(t){this.userCollapsed_=t,!(!this.collapsible_||this.collapsed_===t)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(t){this.updateElement_(t.frameState)}}const ed=$y;class tv extends bo{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target});const e=t.className!==void 0?t.className:"ol-rotate",i=t.label!==void 0?t.label:"⇧",n=t.compassClassName!==void 0?t.compassClassName:"ol-compass";this.label_=null,typeof i=="string"?(this.label_=document.createElement("span"),this.label_.className=n,this.label_.textContent=i):(this.label_=i,this.label_.classList.add(n));const s=t.tipLabel?t.tipLabel:"Reset rotation",a=document.createElement("button");a.className=e+"-reset",a.setAttribute("type","button"),a.title=s,a.appendChild(this.label_),a.addEventListener(lt.CLICK,this.handleClick_.bind(this),!1);const h=e+" "+Nr+" "+_o,c=this.element;c.className=h,c.appendChild(a),this.callResetNorth_=t.resetNorth?t.resetNorth:void 0,this.duration_=t.duration!==void 0?t.duration:250,this.autoHide_=t.autoHide!==void 0?t.autoHide:!0,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(po)}handleClick_(t){t.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const e=this.getMap().getView();if(!e)return;const i=e.getRotation();i!==void 0&&(this.duration_>0&&i%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:Gn}):e.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const i=e.viewState.rotation;if(i!=this.rotation_){const n="rotate("+i+"rad)";if(this.autoHide_){const s=this.element.classList.contains(po);!s&&i===0?this.element.classList.add(po):s&&i!==0&&this.element.classList.remove(po)}this.label_.style.transform=n}this.rotation_=i}}const ev=tv;class iv extends bo{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=t.className!==void 0?t.className:"ol-zoom",i=t.delta!==void 0?t.delta:1,n=t.zoomInClassName!==void 0?t.zoomInClassName:e+"-in",s=t.zoomOutClassName!==void 0?t.zoomOutClassName:e+"-out",a=t.zoomInLabel!==void 0?t.zoomInLabel:"+",h=t.zoomOutLabel!==void 0?t.zoomOutLabel:"–",c=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",d=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",f=document.createElement("button");f.className=n,f.setAttribute("type","button"),f.title=c,f.appendChild(typeof a=="string"?document.createTextNode(a):a),f.addEventListener(lt.CLICK,this.handleClick_.bind(this,i),!1);const p=document.createElement("button");p.className=s,p.setAttribute("type","button"),p.title=d,p.appendChild(typeof h=="string"?document.createTextNode(h):h),p.addEventListener(lt.CLICK,this.handleClick_.bind(this,-i),!1);const _=e+" "+Nr+" "+_o,y=this.element;y.className=_,y.appendChild(f),y.appendChild(p),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const i=this.getMap().getView();if(!i)return;const n=i.getZoom();if(n!==void 0){const s=i.getConstrainedZoom(n+t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:Gn})):i.setZoom(s)}}}const nv=iv;function id(r){r=r||{};const t=new Ve;return(r.zoom!==void 0?r.zoom:!0)&&t.push(new nv(r.zoomOptions)),(r.rotate!==void 0?r.rotate:!0)&&t.push(new ev(r.rotateOptions)),(r.attribution!==void 0?r.attribution:!0)&&t.push(new ed(r.attributionOptions)),t}const nd={ACTIVE:"active"};class rv extends Re{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(nd.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(nd.ACTIVE,t)}setMap(t){this.map_=t}}function sv(r,t,e){const i=r.getCenterInternal();if(i){const n=[i[0]+t[0],i[1]+t[1]];r.animateInternal({duration:e!==void 0?e:250,easing:Um,center:r.getConstrainedCenter(n)})}}function Ml(r,t,e,i){const n=r.getZoom();if(n===void 0)return;const s=r.getConstrainedZoom(n+t),a=r.getResolutionForZoom(s);r.getAnimating()&&r.cancelAnimations(),r.animate({resolution:a,anchor:e,duration:i!==void 0?i:250,easing:Gn})}const Zr=rv;class ov extends Zr{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(t){let e=!1;if(t.type==It.DBLCLICK){const i=t.originalEvent,n=t.map,s=t.coordinate,a=i.shiftKey?-this.delta_:this.delta_,h=n.getView();Ml(h,a,s,this.duration_),i.preventDefault(),e=!0}return!e}}const av=ov;class lv extends Zr{constructor(t){t=t||{},super(t),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==It.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==It.POINTERUP){const i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==It.POINTERDOWN){const i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==It.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function Sl(r){const t=r.length;let e=0,i=0;for(let n=0;n<t;n++)e+=r[n].clientX,i+=r[n].clientY;return{clientX:e/t,clientY:i/t}}const Wr=lv;function Pl(r){const t=arguments;return function(e){let i=!0;for(let n=0,s=t.length;n<s&&(i=i&&t[n](e),!!i);++n);return i}}const hv=function(r){const t=r.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},cv=function(r){const t=r.map.getTargetElement(),e=r.map.getOwnerDocument().activeElement;return t.contains(e)},rd=function(r){return r.map.getTargetElement().hasAttribute("tabindex")?cv(r):!0},uv=Tr,sd=function(r){const t=r.originalEvent;return t.button==0&&!(Wm&&fu&&t.ctrlKey)},od=function(r){const t=r.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},dv=function(r){const t=r.originalEvent;return fu?t.metaKey:t.ctrlKey},fv=function(r){const t=r.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},ad=function(r){const t=r.originalEvent,e=t.target.tagName;return e!=="INPUT"&&e!=="SELECT"&&e!=="TEXTAREA"&&!t.target.isContentEditable},kl=function(r){const t=r.originalEvent;return mt(t!==void 0,"mapBrowserEvent must originate from a pointer event"),t.pointerType=="mouse"},gv=function(r){const t=r.originalEvent;return mt(t!==void 0,"mapBrowserEvent must originate from a pointer event"),t.isPrimary&&t.button===0};class pv extends Wr{constructor(t){super({stopDown:Us}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const e=t.condition?t.condition:Pl(od,gv);this.condition_=t.onFocusOnly?Pl(rd,e):e,this.noKinetic_=!1}handleDragEvent(t){const e=t.map;this.panning_||(this.panning_=!0,e.getView().beginInteraction());const i=this.targetPointers,n=e.getEventPixel(Sl(i));if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){const s=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],h=t.map.getView();Mm(s,h.getResolution()),Xa(s,h.getRotation()),h.adjustCenterInternal(s)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=i.length,t.originalEvent.preventDefault()}handleUpEvent(t){const e=t.map,i=e.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const n=this.kinetic_.getDistance(),s=this.kinetic_.getAngle(),a=i.getCenterInternal(),h=e.getPixelFromCoordinateInternal(a),c=e.getCoordinateFromPixelInternal([h[0]-n*Math.cos(s),h[1]-n*Math.sin(s)]);i.animateInternal({center:i.getConstrainedCenter(c),duration:500,easing:Gn})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){const i=t.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}const _v=pv;class mv extends Wr{constructor(t){t=t||{},super({stopDown:Us}),this.condition_=t.condition?t.condition:hv,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!kl(t))return;const e=t.map,i=e.getView();if(i.getConstraints().rotation===el)return;const n=e.getSize(),s=t.pixel,a=Math.atan2(n[1]/2-s[1],s[0]-n[0]/2);if(this.lastAngle_!==void 0){const h=a-this.lastAngle_;i.adjustRotationInternal(-h)}this.lastAngle_=a}handleUpEvent(t){return kl(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return kl(t)&&sd(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}const yv=mv;class vv extends Gs{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){const t=this.startPixel_,e=this.endPixel_,n=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new Oi([n])}getGeometry(){return this.geometry_}}const xv=vv,To={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class Rl extends ai{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}}class wv extends Wr{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.box_=new xv(t.className||"ol-dragbox"),this.minArea_=t.minArea!==void 0?t.minArea:64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition?t.condition:sd,this.boxEndCondition_=t.boxEndCondition?t.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,i){const n=i[0]-e[0],s=i[1]-e[1];return n*n+s*s>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Rl(To.BOXDRAG,t.coordinate,t))}handleUpEvent(t){this.box_.setMap(null);const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Rl(e?To.BOXEND:To.BOXCANCEL,t.coordinate,t)),!1}handleDownEvent(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Rl(To.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}}const Ev=wv;class Lv extends Ev{constructor(t){t=t||{};const e=t.condition?t.condition:fv;super({condition:e,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(t){const i=this.getMap().getView();let n=this.getGeometry();if(this.out_){const s=i.rotatedExtentForGeometry(n),a=i.getResolutionForExtentInternal(s),h=i.getResolution()/a;n=n.clone(),n.scale(h*h)}i.fitInternal(n,{duration:this.duration_,easing:Gn})}}const bv=Lv,vn={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class Tv extends Zr{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return od(e)&&ad(e)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==lt.KEYDOWN){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&(n==vn.DOWN||n==vn.LEFT||n==vn.RIGHT||n==vn.UP)){const a=t.map.getView(),h=a.getResolution()*this.pixelDelta_;let c=0,d=0;n==vn.DOWN?d=-h:n==vn.LEFT?c=-h:n==vn.RIGHT?c=h:d=h;const f=[c,d];Xa(f,a.getRotation()),sv(a,f,this.duration_),i.preventDefault(),e=!0}}return!e}}const Cv=Tv;class Mv extends Zr{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(e){return!dv(e)&&ad(e)},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(t){let e=!1;if(t.type==lt.KEYDOWN||t.type==lt.KEYPRESS){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&(n==="+"||n==="-")){const s=t.map,a=n==="+"?this.delta_:-this.delta_,h=s.getView();Ml(h,a,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}}const Sv=Mv;class Pv{constructor(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;const t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;let i=e-3;for(;i>0&&this.points_[i+2]>t;)i-=3;const n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;const s=this.points_[e]-this.points_[i],a=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(a,s),this.initialVelocity_=Math.sqrt(s*s+a*a)/n,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const kv=Pv;class Rv extends Zr{constructor(t){t=t||{},super(t),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;const e=t.condition?t.condition:uv;this.condition_=t.onFocusOnly?Pl(rd,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();if(!t)return;t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}handleEvent(t){if(!this.condition_(t)||t.type!==lt.WHEEL)return!0;const i=t.map,n=t.originalEvent;n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);let s;if(t.type==lt.WHEEL&&(s=n.deltaY,jm&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=gu),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),s===0)return!1;this.lastDelta_=s;const a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?"trackpad":"wheel");const h=i.getView();if(this.mode_==="trackpad"&&!(h.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(h.getAnimating()&&h.cancelAnimations(),h.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),h.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=a,!1;this.totalDelta_+=s;const c=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),c),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let i=-Dt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Ml(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}}const Av=Rv;class Iv extends Wr{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=Us),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){let e=0;const i=this.targetPointers[0],n=this.targetPointers[1],s=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(this.lastAngle_!==void 0){const c=s-this.lastAngle_;this.rotationDelta_+=c,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=c}this.lastAngle_=s;const a=t.map,h=a.getView();h.getConstraints().rotation!==el&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(Sl(this.targetPointers))),this.rotating_&&(a.render(),h.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return this.targetPointers.length<2?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}const Dv=Iv;class Ov extends Wr{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=Us),super(e),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1;const i=this.targetPointers[0],n=this.targetPointers[1],s=i.clientX-n.clientX,a=i.clientY-n.clientY,h=Math.sqrt(s*s+a*a);this.lastDistance_!==void 0&&(e=this.lastDistance_/h),this.lastDistance_=h;const c=t.map,d=c.getView();e!=1&&(this.lastScaleDelta_=e),this.anchor_=c.getCoordinateFromPixelInternal(c.getEventPixel(Sl(this.targetPointers))),c.render(),d.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const i=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,n),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}const Fv=Ov;function zv(r){r=r||{};const t=new Ve,e=new kv(-.005,.05,100);return(r.altShiftDragRotate!==void 0?r.altShiftDragRotate:!0)&&t.push(new yv),(r.doubleClickZoom!==void 0?r.doubleClickZoom:!0)&&t.push(new av({delta:r.zoomDelta,duration:r.zoomDuration})),(r.dragPan!==void 0?r.dragPan:!0)&&t.push(new _v({onFocusOnly:r.onFocusOnly,kinetic:e})),(r.pinchRotate!==void 0?r.pinchRotate:!0)&&t.push(new Dv),(r.pinchZoom!==void 0?r.pinchZoom:!0)&&t.push(new Fv({duration:r.zoomDuration})),(r.keyboard!==void 0?r.keyboard:!0)&&(t.push(new Cv),t.push(new Sv({delta:r.zoomDelta,duration:r.zoomDuration}))),(r.mouseWheelZoom!==void 0?r.mouseWheelZoom:!0)&&t.push(new Av({onFocusOnly:r.onFocusOnly,duration:r.zoomDuration})),(r.shiftDragZoom!==void 0?r.shiftDragZoom:!0)&&t.push(new bv({duration:r.zoomDuration})),t}function ld(r){return r[0]>0&&r[1]>0}function Nv(r,t,e){return e===void 0&&(e=[0,0]),e[0]=r[0]*t+.5|0,e[1]=r[1]*t+.5|0,e}function Le(r,t){return Array.isArray(r)?r:(t===void 0?t=[r,r]:(t[0]=r,t[1]=r),t)}function hd(r){if(r instanceof go){r.setMapInternal(null);return}r instanceof Eo&&r.getLayers().forEach(hd)}function cd(r,t){if(r instanceof go){r.setMapInternal(t);return}if(r instanceof Eo){const e=r.getLayers().getArray();for(let i=0,n=e.length;i<n;++i)cd(e[i],t)}}class Bv extends Re{constructor(t){super(),t=t||{},this.on,this.once,this.un;const e=Gv(t);this.renderComplete_,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=t.maxTilesLoading!==void 0?t.maxTilesLoading:16,this.pixelRatio_=t.pixelRatio!==void 0?t.pixelRatio:gu,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=Ht(),this.pixelToCoordinateTransform_=Ht(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=null,this.moveTolerance_=t.moveTolerance,this.keyboardEventTarget_=e.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,this.resizeObserver_=new ResizeObserver(()=>this.updateSize()),this.controls=e.controls||id(),this.interactions=e.interactions||zv({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new qy(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Vt.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Vt.VIEW,this.handleViewChanged_),this.addChangeListener(Vt.SIZE,this.handleSizeChanged_),this.addChangeListener(Vt.TARGET,this.handleTargetChanged_),this.setProperties(e.values);const i=this;t.view&&!(t.view instanceof He)&&t.view.then(function(n){i.setView(new He(n))}),this.controls.addEventListener(ue.ADD,n=>{n.element.setMap(this)}),this.controls.addEventListener(ue.REMOVE,n=>{n.element.setMap(null)}),this.interactions.addEventListener(ue.ADD,n=>{n.element.setMap(this)}),this.interactions.addEventListener(ue.REMOVE,n=>{n.element.setMap(null)}),this.overlays_.addEventListener(ue.ADD,n=>{this.addOverlayInternal_(n.element)}),this.overlays_.addEventListener(ue.REMOVE,n=>{const s=n.element.getId();s!==void 0&&delete this.overlayIdIndex_[s.toString()],n.element.setMap(null)}),this.controls.forEach(n=>{n.setMap(this)}),this.interactions.forEach(n=>{n.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){cd(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();e!==void 0&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,i){if(!this.frameState_||!this.renderer_)return;const n=this.getCoordinateFromPixelInternal(t);i=i!==void 0?i:{};const s=i.hitTolerance!==void 0?i.hitTolerance:0,a=i.layerFilter!==void 0?i.layerFilter:Tr,h=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,s,h,e,null,a,null)}getFeaturesAtPixel(t,e){const i=[];return this.forEachFeatureAtPixel(t,function(n){i.push(n)},e),i}getAllLayers(){const t=[];function e(i){i.forEach(function(n){n instanceof Eo?e(n.getLayers()):t.push(n)})}return e(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};const n=e.layerFilter!==void 0?e.layerFilter:Tr,s=e.hitTolerance!==void 0?e.hitTolerance:0,a=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,s,a,n,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const i=this.viewport_.getBoundingClientRect(),n=this.getSize(),s=i.width/n[0],a=i.height/n[1],h="changedTouches"in t?t.changedTouches[0]:t;return[(h.clientX-i.left)/s,(h.clientY-i.top)/a]}getTarget(){return this.get(Vt.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return Qa(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?Nt(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return e!==void 0?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Vt.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof Ve){e.setLayers(t);return}const i=e.getLayers();i.clear(),i.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e<i;++e){const n=t[e];if(!n.visible)continue;const s=n.layer.getRenderer();if(s&&!s.ready)return!0;const a=n.layer.getSource();if(a&&a.loading)return!0}return!1}getPixelFromCoordinate(t){const e=hi(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){const e=this.frameState_;return e?Nt(e.coordinateToPixelTransform,t.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(Vt.SIZE)}getView(){return this.get(Vt.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const t=this.getTargetElement();return t?t.ownerDocument:document}getTilePriority(t,e,i,n){return Jy(this.frameState_,t,e,i,n)}handleBrowserEvent(t,e){e=e||t.type;const i=new zi(e,this,t);this.handleMapBrowserEvent(i)}handleMapBrowserEvent(t){if(!this.frameState_)return;const e=t.originalEvent,i=e.type;if(i===Cl.POINTERDOWN||i===lt.WHEEL||i===lt.KEYDOWN){const n=this.getOwnerDocument(),s=this.viewport_.getRootNode?this.viewport_.getRootNode():n,a=e.target;if(this.overlayContainerStopEvent_.contains(a)||!(s===n?n.documentElement:s).contains(a))return}if(t.frameState=this.frameState_,this.dispatchEvent(t)!==!1){const n=this.getInteractions().getArray().slice();for(let s=n.length-1;s>=0;s--){const a=n[s];if(a.getMap()!==this||!a.getActive()||!this.getTargetElement())continue;if(!a.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let n=this.maxTilesLoading_,s=n;if(t){const a=t.viewHints;if(a[Zt.ANIMATING]||a[Zt.INTERACTING]){const h=Date.now()-t.time>8;n=h?0:8,s=h?0:2}}e.getTilesLoading()<n&&(e.reprioritize(),e.loadMoreTiles(n,s))}t&&this.renderer_&&!t.animate&&(this.renderComplete_===!0?(this.hasListener(te.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(te.RENDERCOMPLETE,t),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new Wn(fi.LOADEND,this,t)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new Wn(fi.LOADSTART,this,t))));const i=this.postRenderFunctions_;for(let n=0,s=i.length;n<s;++n)i[n](this,t);i.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let i=0,n=this.targetChangeHandlerKeys_.length;i<n;++i)Ct(this.targetChangeHandlerKeys_[i]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(lt.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(lt.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,vo(this.viewport_)}if(this.targetElement_){this.resizeObserver_.unobserve(this.targetElement_);const i=this.targetElement_.getRootNode();i instanceof ShadowRoot&&this.resizeObserver_.unobserve(i.host),this.setSize(void 0)}const t=this.getTarget(),e=typeof t=="string"?document.getElementById(t):t;if(this.targetElement_=e,!e)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{e.appendChild(this.viewport_),this.renderer_||(this.renderer_=new jy(this)),this.mapBrowserEventHandler_=new Vy(this,this.moveTolerance_);for(const s in It)this.mapBrowserEventHandler_.addEventListener(It[s],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(lt.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(lt.WHEEL,this.boundHandleBrowserEvent_,_u?{passive:!1}:!1);const i=this.keyboardEventTarget_?this.keyboardEventTarget_:e;this.targetChangeHandlerKeys_=[ft(i,lt.KEYDOWN,this.handleBrowserEvent,this),ft(i,lt.KEYPRESS,this.handleBrowserEvent,this)];const n=e.getRootNode();n instanceof ShadowRoot&&this.resizeObserver_.observe(n.host),this.resizeObserver_.observe(e)}this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(Ct(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Ct(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const t=this.getView();t&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=ft(t,An.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=ft(t,lt.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Ct),this.layerGroupPropertyListenerKeys_=null);const t=this.getLayerGroup();t&&(this.handleLayerAdd_(new Fi("addlayer",t)),this.layerGroupPropertyListenerKeys_=[ft(t,An.PROPERTYCHANGE,this.render,this),ft(t,lt.CHANGE,this.render,this),ft(t,"addlayer",this.handleLayerAdd_,this),ft(t,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e<i;++e){const n=t[e].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}flushDeclutterItems(){const t=this.frameState_;t&&this.renderer_.flushDeclutterItems(t)}removeControl(t){return this.getControls().remove(t)}removeInteraction(t){return this.getInteractions().remove(t)}removeLayer(t){return this.getLayerGroup().getLayers().remove(t)}handleLayerRemove_(t){hd(t.layer)}removeOverlay(t){return this.getOverlays().remove(t)}renderFrame_(t){const e=this.getSize(),i=this.getView(),n=this.frameState_;let s=null;if(e!==void 0&&ld(e)&&i&&i.isDef()){const a=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),h=i.getState();if(s={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:Wa(h.center,h.resolution,h.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:h,viewHints:a,wantedTiles:{},mapId:ct(this),renderTargets:{}},h.nextCenter&&h.nextResolution){const c=isNaN(h.nextRotation)?h.rotation:h.nextRotation;s.nextExtent=Wa(h.nextCenter,h.nextResolution,c,e)}}this.frameState_=s,this.renderer_.renderFrame(s),s&&(s.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,s.postRenderFunctions),n&&(!this.previousExtent_||!Qs(this.previousExtent_)&&!Nn(s.extent,this.previousExtent_))&&(this.dispatchEvent(new Wn(fi.MOVESTART,this,n)),this.previousExtent_=Sr(this.previousExtent_)),this.previousExtent_&&!s.viewHints[Zt.ANIMATING]&&!s.viewHints[Zt.INTERACTING]&&!Nn(s.extent,this.previousExtent_)&&(this.dispatchEvent(new Wn(fi.MOVEEND,this,s)),Vc(s.extent,this.previousExtent_))),this.dispatchEvent(new Wn(fi.POSTRENDER,this,s)),this.renderComplete_=this.hasListener(fi.LOADSTART)||this.hasListener(fi.LOADEND)||this.hasListener(te.RENDERCOMPLETE)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new Fi("removelayer",e)),this.set(Vt.LAYERGROUP,t)}setSize(t){this.set(Vt.SIZE,t)}setTarget(t){this.set(Vt.TARGET,t)}setView(t){if(!t||t instanceof He){this.set(Vt.VIEW,t);return}this.set(Vt.VIEW,new He);const e=this;t.then(function(i){e.setView(new He(i))})}updateSize(){const t=this.getTargetElement();let e;if(t){const n=getComputedStyle(t),s=t.offsetWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderRightWidth),a=t.offsetHeight-parseFloat(n.borderTopWidth)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderBottomWidth);!isNaN(s)&&!isNaN(a)&&(e=[s,a],!ld(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&eu("No map visible because the map container's width or height are 0."))}const i=this.getSize();e&&(!i||!li(e,i))&&(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){const e=this.getView();e&&e.setViewportSize(t)}}function Gv(r){let t=null;r.keyboardEventTarget!==void 0&&(t=typeof r.keyboardEventTarget=="string"?document.getElementById(r.keyboardEventTarget):r.keyboardEventTarget);const e={},i=r.layers&&typeof r.layers.getLayers=="function"?r.layers:new Eo({layers:r.layers});e[Vt.LAYERGROUP]=i,e[Vt.TARGET]=r.target,e[Vt.VIEW]=r.view instanceof He?r.view:new He;let n;r.controls!==void 0&&(Array.isArray(r.controls)?n=new Ve(r.controls.slice()):(mt(typeof r.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),n=r.controls));let s;r.interactions!==void 0&&(Array.isArray(r.interactions)?s=new Ve(r.interactions.slice()):(mt(typeof r.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),s=r.interactions));let a;return r.overlays!==void 0?Array.isArray(r.overlays)?a=new Ve(r.overlays.slice()):(mt(typeof r.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),a=r.overlays):a=new Ve,{controls:n,interactions:s,keyboardEventTarget:t,overlays:a,values:e}}const Uv=Bv;function jv(r,t,e,i,n){ud(r,t,e||0,i||r.length-1,n||Zv)}function ud(r,t,e,i,n){for(;i>e;){if(i-e>600){var s=i-e+1,a=t-e+1,h=Math.log(s),c=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*c*(s-c)/s)*(a-s/2<0?-1:1),f=Math.max(e,Math.floor(t-a*c/s+d)),p=Math.min(i,Math.floor(t+(s-a)*c/s+d));ud(r,t,f,p,n)}var _=r[t],y=e,v=i;for(Hr(r,e,t),n(r[i],_)>0&&Hr(r,e,i);y<v;){for(Hr(r,y,v),y++,v--;n(r[y],_)<0;)y++;for(;n(r[v],_)>0;)v--}n(r[e],_)===0?Hr(r,e,v):(v++,Hr(r,v,i)),v<=t&&(e=v+1),t<=v&&(i=v-1)}}function Hr(r,t,e){var i=r[t];r[t]=r[e],r[e]=i}function Zv(r,t){return r<t?-1:r>t?1:0}let dd=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!Mo(t,e))return i;const n=this.toBBox,s=[];for(;e;){for(let a=0;a<e.children.length;a++){const h=e.children[a],c=e.leaf?n(h):h;Mo(t,c)&&(e.leaf?i.push(h):Il(t,c)?this._all(h,i):s.push(h))}e=s.pop()}return i}collides(t){let e=this.data;if(!Mo(t,e))return!1;const i=[];for(;e;){for(let n=0;n<e.children.length;n++){const s=e.children[n],a=e.leaf?this.toBBox(s):s;if(Mo(t,a)){if(e.leaf||Il(t,a))return!0;i.push(s)}}e=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=e;else if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const i=this.data;this.data=e,e=i}this._insert(e,this.data.height-e.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=Vn([]),this}remove(t,e){if(!t)return this;let i=this.data;const n=this.toBBox(t),s=[],a=[];let h,c,d;for(;i||s.length;){if(i||(i=s.pop(),c=s[s.length-1],h=a.pop(),d=!0),i.leaf){const f=Wv(t,i.children,e);if(f!==-1)return i.children.splice(f,1),s.push(i),this._condense(s),this}!d&&!i.leaf&&Il(i,n)?(s.push(i),a.push(h),h=0,c=i,i=i.children[0]):c?(h++,i=c.children[h],d=!1):i=null}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,n){const s=i-e+1;let a=this._maxEntries,h;if(s<=a)return h=Vn(t.slice(e,i+1)),Hn(h,this.toBBox),h;n||(n=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,n-1))),h=Vn([]),h.leaf=!1,h.height=n;const c=Math.ceil(s/a),d=c*Math.ceil(Math.sqrt(a));fd(t,e,i,d,this.compareMinX);for(let f=e;f<=i;f+=d){const p=Math.min(f+d-1,i);fd(t,f,p,c,this.compareMinY);for(let _=f;_<=p;_+=c){const y=Math.min(_+c-1,p);h.children.push(this._build(t,_,y,n-1))}}return Hn(h,this.toBBox),h}_chooseSubtree(t,e,i,n){for(;n.push(e),!(e.leaf||n.length-1===i);){let s=1/0,a=1/0,h;for(let c=0;c<e.children.length;c++){const d=e.children[c],f=Al(d),p=Xv(t,d)-f;p<a?(a=p,s=f<s?f:s,h=d):p===a&&f<s&&(s=f,h=d)}e=h||e.children[0]}return e}_insert(t,e,i){const n=i?t:this.toBBox(t),s=[],a=this._chooseSubtree(n,this.data,e,s);for(a.children.push(t),Xr(a,n);e>=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(n,s,e)}_split(t,e){const i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);const a=this._chooseSplitIndex(i,s,n),h=Vn(i.children.splice(a,i.children.length-a));h.height=i.height,h.leaf=i.leaf,Hn(i,this.toBBox),Hn(h,this.toBBox),e?t[e-1].children.push(h):this._splitRoot(i,h)}_splitRoot(t,e){this.data=Vn([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Hn(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let n,s=1/0,a=1/0;for(let h=e;h<=i-e;h++){const c=Vr(t,0,h,this.toBBox),d=Vr(t,h,i,this.toBBox),f=Yv(c,d),p=Al(c)+Al(d);f<s?(s=f,n=h,a=p<a?p:a):f===s&&p<a&&(a=p,n=h)}return n||i-e}_chooseSplitAxis(t,e,i){const n=t.leaf?this.compareMinX:Hv,s=t.leaf?this.compareMinY:Vv,a=this._allDistMargin(t,e,i,n),h=this._allDistMargin(t,e,i,s);a<h&&t.children.sort(n)}_allDistMargin(t,e,i,n){t.children.sort(n);const s=this.toBBox,a=Vr(t,0,e,s),h=Vr(t,i-e,i,s);let c=Co(a)+Co(h);for(let d=e;d<i-e;d++){const f=t.children[d];Xr(a,t.leaf?s(f):f),c+=Co(a)}for(let d=i-e-1;d>=e;d--){const f=t.children[d];Xr(h,t.leaf?s(f):f),c+=Co(h)}return c}_adjustParentBBoxes(t,e,i){for(let n=i;n>=0;n--)Xr(e[n],t)}_condense(t){for(let e=t.length-1,i;e>=0;e--)t[e].children.length===0?e>0?(i=t[e-1].children,i.splice(i.indexOf(t[e]),1)):this.clear():Hn(t[e],this.toBBox)}};function Wv(r,t,e){if(!e)return t.indexOf(r);for(let i=0;i<t.length;i++)if(e(r,t[i]))return i;return-1}function Hn(r,t){Vr(r,0,r.children.length,t,r)}function Vr(r,t,e,i,n){n||(n=Vn(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let s=t;s<e;s++){const a=r.children[s];Xr(n,r.leaf?i(a):a)}return n}function Xr(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function Hv(r,t){return r.minX-t.minX}function Vv(r,t){return r.minY-t.minY}function Al(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function Co(r){return r.maxX-r.minX+(r.maxY-r.minY)}function Xv(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function Yv(r,t){const e=Math.max(r.minX,t.minX),i=Math.max(r.minY,t.minY),n=Math.min(r.maxX,t.maxX),s=Math.min(r.maxY,t.maxY);return Math.max(0,n-e)*Math.max(0,s-i)}function Il(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function Mo(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function Vn(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function fd(r,t,e,i,n){const s=[t,e];for(;s.length;){if(e=s.pop(),t=s.pop(),e-t<=i)continue;const a=t+Math.ceil((e-t)/i/2)*i;jv(r,a,t,e,n),s.push(t,a,a,e)}}const St={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class Dl{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Le(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new Dl({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return rt()}getImage(t){return rt()}getHitDetectionImage(){return rt()}getPixelRatio(t){return 1}getImageState(){return rt()}getImageSize(){return rt()}getOrigin(){return rt()}getSize(){return rt()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Le(t)}listenImageChange(t){rt()}load(){rt()}unlistenImageChange(t){rt()}}const gd=Dl;function Xe(r){return Array.isArray(r)?Wu(r):r}class Ol extends gd{constructor(t){const e=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:1,rotateWithView:e,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode}),this.canvases_,this.hitDetectionCanvas_=null,this.fill_=t.fill!==void 0?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=t.radius!==void 0?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=t.angle!==void 0?t.angle:0,this.stroke_=t.stroke!==void 0?t.stroke:null,this.size_,this.renderOptions_,this.render()}clone(){const t=this.getScale(),e=new Ol({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){let e=this.canvases_[t];if(!e){const i=this.renderOptions_,n=ee(i.size*t,i.size*t);this.draw_(i,n,t),e=n.canvas,this.canvases_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return St.LOADED}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,i){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let n=this.radius_,s=this.radius2_===void 0?n:this.radius2_;if(n<s){const R=n;n=s,s=R}const a=this.radius2_===void 0?this.points_:this.points_*2,h=2*Math.PI/a,c=s*Math.sin(h),d=Math.sqrt(s*s-c*c),f=n-d,p=Math.sqrt(c*c+f*f),_=p/c;if(t==="miter"&&_<=i)return _*e;const y=e/2/_,v=e/2*(f/p),T=Math.sqrt((n+y)*(n+y)+v*v)-n;if(this.radius2_===void 0||t==="bevel")return T*2;const M=n*Math.sin(h),E=Math.sqrt(n*n-M*M),b=s-E,P=Math.sqrt(M*M+b*b)/M;if(P<=i){const R=P*e/2-s-n;return 2*Math.max(T,R)}return T*2}createRenderOptions(){let t=Un,e=jn,i=0,n=null,s=0,a,h=0;this.stroke_&&(a=Xe(this.stroke_.getColor()??Gr),h=this.stroke_.getWidth()??jr,n=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset()??0,e=this.stroke_.getLineJoin()??jn,t=this.stroke_.getLineCap()??Un,i=this.stroke_.getMiterLimit()??Br);const c=this.calculateLineJoinSize_(e,h,i),d=Math.max(this.radius_,this.radius2_||0),f=Math.ceil(2*d+c);return{strokeStyle:a,strokeWidth:h,size:f,lineCap:t,lineDash:n,lineDashOffset:s,lineJoin:e,miterLimit:i}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.canvases_={},this.hitDetectionCanvas_=null,this.size_=[t,t]}draw_(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let n=this.fill_.getColor();n===null&&(n=de),e.fillStyle=Xe(n),e.fill()}t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}createHitDetectionCanvas_(t){let e;if(this.fill_){let i=this.fill_.getColor(),n=0;typeof i=="string"&&(i=Fr(i)),i===null?n=1:Array.isArray(i)&&(n=i.length===4?i[3]:1),n===0&&(e=ee(t.size,t.size),this.drawHitDetectionCanvas_(t,e))}return e?e.canvas:this.getImage(1)}createPath_(t){let e=this.points_;const i=this.radius_;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{const n=this.radius2_===void 0?i:this.radius2_;this.radius2_!==void 0&&(e*=2);const s=this.angle_-Math.PI/2,a=2*Math.PI/e;for(let h=0;h<e;h++){const c=s+h*a,d=h%2===0?i:n;t.lineTo(d*Math.cos(c),d*Math.sin(c))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=de,e.fill(),t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}}const pd=Ol;class Fl extends pd{constructor(t){t=t||{radius:5},super({points:1/0,fill:t.fill,radius:t.radius,stroke:t.stroke,scale:t.scale!==void 0?t.scale:1,rotation:t.rotation!==void 0?t.rotation:0,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){const t=this.getScale(),e=new Fl({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}setRadius(t){this.radius_=t,this.render()}}const _d=Fl;class zl{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null}clone(){const t=this.getColor();return new zl({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){this.color_=t}}const So=zl;class Nl{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new Nl({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}const Po=Nl;class ko{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=md,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&typeof t=="object"&&(t=t.clone()),new ko({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){typeof t=="function"?this.geometryFunction_=t:typeof t=="string"?this.geometryFunction_=function(e){return e.get(t)}:t?t!==void 0&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=md,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function Kv(r){let t;if(typeof r=="function")t=r;else{let e;Array.isArray(r)?e=r:(mt(typeof r.getZIndex=="function","Expected an `Style` or an array of `Style`"),e=[r]),t=function(){return e}}return t}let Bl=null;function qv(r,t){if(!Bl){const e=new So({color:"rgba(255,255,255,0.4)"}),i=new Po({color:"#3399CC",width:1.25});Bl=[new ko({image:new _d({fill:e,stroke:i,radius:5}),fill:e,stroke:i})]}return Bl}function md(r){return r.getGeometry()}const Xn=ko;function Jv(r,t,e){const i=r;let n=!0,s=!1,a=!1;const h=[Zs(i,lt.LOAD,function(){a=!0,s||t()})];return i.src&&pu?(s=!0,i.decode().then(function(){n&&t()}).catch(function(c){n&&(a?t():e())})):h.push(Zs(i,lt.ERROR,e)),function(){n=!1,h.forEach(Ct)}}function Qv(r,t){return new Promise((e,i)=>{function n(){a(),e(r)}function s(){a(),i(new Error("Image load error"))}function a(){r.removeEventListener("load",n),r.removeEventListener("error",s)}r.addEventListener("load",n),r.addEventListener("error",s),t&&(r.src=t)})}function $v(r,t){return t&&(r.src=t),r.src&&pu?new Promise((e,i)=>r.decode().then(()=>e(r)).catch(n=>r.complete&&r.width?e(r):i(n))):Qv(r)}let Yr=null;class t0 extends js{constructor(t,e,i,n,s){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=s,this.imageState_=n===void 0?St.IDLE:n,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===St.LOADED){Yr||(Yr=ee(1,1,void 0,{willReadFrequently:!0})),Yr.drawImage(this.image_,0,0);try{Yr.getImageData(0,0,1,1),this.tainted_=!1}catch{Yr=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(lt.CHANGE)}handleImageError_(){this.imageState_=St.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=St.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],i=ee(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===St.IDLE){this.image_||this.initializeImage_(),this.imageState_=St.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&$v(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==St.LOADED)return;const e=this.image_,i=document.createElement("canvas");i.width=Math.ceil(e.width*t),i.height=Math.ceil(e.height*t);const n=i.getContext("2d");n.scale(t,t),n.drawImage(e,0,0),n.globalCompositeOperation="multiply",n.fillStyle=Uu(this.color_),n.fillRect(0,0,i.width/t,i.height/t),n.globalCompositeOperation="destination-in",n.drawImage(e,0,0),this.canvas_[t]=i}}function e0(r,t,e,i,n){let s=t===void 0?void 0:fo.get(t,e,n);return s||(s=new t0(r,r instanceof HTMLImageElement?r.src||void 0:t,e,i,n),fo.set(t,e,n,s)),s}function yd(r,t,e,i){return e!==void 0&&i!==void 0?[e/r,i/t]:e!==void 0?e/r:i!==void 0?i/t:1}class Gl extends gd{constructor(t){t=t||{};const e=t.opacity!==void 0?t.opacity:1,i=t.rotation!==void 0?t.rotation:0,n=t.scale!==void 0?t.scale:1,s=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:i,scale:n,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:s,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const a=t.img!==void 0?t.img:null;let h=t.src;mt(!(h!==void 0&&a),"`image` and `src` cannot be provided at the same time"),(h===void 0||h.length===0)&&a&&(h=a.src||ct(a)),mt(h!==void 0&&h.length>0,"A defined and non-empty `src` or `image` must be provided"),mt(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let c;if(t.src!==void 0?c=St.IDLE:a!==void 0&&(a instanceof HTMLImageElement?a.complete?c=a.src?St.LOADED:St.IDLE:c=St.LOADING:c=St.LOADED),this.color_=t.color!==void 0?Fr(t.color):null,this.iconImage_=e0(a,h,this.crossOrigin_,c,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,t.width!==void 0||t.height!==void 0){let d,f;if(t.size)[d,f]=t.size;else{const p=this.getImage(1);if(p.width&&p.height)d=p.width,f=p.height;else if(p instanceof HTMLImageElement){this.initialOptions_=t;const _=()=>{if(this.unlistenImageChange(_),!this.initialOptions_)return;const y=this.iconImage_.getSize();this.setScale(yd(y[0],y[1],t.width,t.height))};this.listenImageChange(_);return}}d!==void 0&&this.setScale(yd(d,f,t.width,t.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new Gl({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:i,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const n=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!n)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=n[0]),this.anchorYUnits_=="fraction"&&(t[1]*=n[1])}if(this.anchorOrigin_!="top-left"){if(!n)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+n[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+n[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=i[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==St.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==St.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(lt.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(lt.CHANGE,t)}}const Ul=Gl,i0="#333";class jl{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=Le(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new So({color:i0}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding}clone(){const t=this.getScale();return new jl({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Le(t!==void 0?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}const vd=jl;let Yn=0;const Kn=0,Ot=1<<Yn++,Q=1<<Yn++,De=1<<Yn++,ie=1<<Yn++,Ni=1<<Yn++,fe=Math.pow(2,Yn)-1,xd={[Ot]:"boolean",[Q]:"number",[De]:"string",[ie]:"color",[Ni]:"number[]"},n0=Object.keys(xd).map(Number).sort(Pi);function ne(r){const t=[];for(const e of n0)r0(r,e)&&t.push(xd[e]);return t.length===0?"untyped":t.length<3?t.join(" or "):t.slice(0,-1).join(", ")+", or "+t[t.length-1]}function r0(r,t){return(r&t)===t}function Ye(r,t){return!!(r&t)}function Ro(r,t){return r===t}class Bi{constructor(t,e){this.type=t,this.value=e}}class s0{constructor(t,e,...i){this.type=t,this.operator=e,this.args=i}}function wd(){return{variables:new Set,properties:new Set,featureId:!1,style:{}}}function o0(r){switch(r){case"string":return De;case"color":return ie;case"number":return Q;case"boolean":return Ot;case"number[]":return Ni;default:throw new Error(`Unrecognized type hint: ${r}`)}}function Tt(r,t,e){switch(typeof r){case"boolean":return new Bi(Ot,r);case"number":return new Bi(Q,r);case"string":{let n=De;return Ly(r)&&(n|=ie),Ro(n&e,Kn)||(n&=e),new Bi(n,r)}}if(!Array.isArray(r))throw new Error("Expression must be an array or a primitive value");if(r.length===0)throw new Error("Empty expression");if(typeof r[0]=="string")return m0(r,t,e);for(const n of r)if(typeof n!="number")throw new Error("Expected an array of numbers");let i=Ni;return(r.length===3||r.length===4)&&(i|=ie),e&&(i&=e),new Bi(i,r)}const F={Get:"get",Var:"var",Concat:"concat",GeometryType:"geometry-type",Any:"any",All:"all",Not:"!",Resolution:"resolution",Zoom:"zoom",Time:"time",Equal:"==",NotEqual:"!=",GreaterThan:">",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette"},a0={[F.Get]:ot(([r,t])=>t!==void 0?o0(t.value):fe,gt(1,2),l0),[F.Var]:ot(([r])=>r.type,gt(1,1),h0),[F.Id]:ot(Q|De,Kr,c0),[F.Concat]:ot(De,gt(2,1/0),Et(fe)),[F.GeometryType]:ot(De,Kr),[F.Resolution]:ot(Q,Kr),[F.Zoom]:ot(Q,Kr),[F.Time]:ot(Q,Kr),[F.Any]:ot(Ot,gt(2,1/0),Et(Ot)),[F.All]:ot(Ot,gt(2,1/0),Et(Ot)),[F.Not]:ot(Ot,gt(1,1),Et(Ot)),[F.Equal]:ot(Ot,gt(2,2),Et(fe),xn),[F.NotEqual]:ot(Ot,gt(2,2),Et(fe),xn),[F.GreaterThan]:ot(Ot,gt(2,2),Et(fe),xn),[F.GreaterThanOrEqualTo]:ot(Ot,gt(2,2),Et(fe),xn),[F.LessThan]:ot(Ot,gt(2,2),Et(fe),xn),[F.LessThanOrEqualTo]:ot(Ot,gt(2,2),Et(fe),xn),[F.Multiply]:ot(r=>{let t=Q|ie;for(let e=0;e<r.length;e++)t&=r[e].type;return t},gt(2,1/0),Et(Q|ie),xn),[F.Divide]:ot(Q,gt(2,2),Et(Q)),[F.Add]:ot(Q,gt(2,1/0),Et(Q)),[F.Subtract]:ot(Q,gt(2,2),Et(Q)),[F.Clamp]:ot(Q,gt(3,3),Et(Q)),[F.Mod]:ot(Q,gt(2,2),Et(Q)),[F.Pow]:ot(Q,gt(2,2),Et(Q)),[F.Abs]:ot(Q,gt(1,1),Et(Q)),[F.Floor]:ot(Q,gt(1,1),Et(Q)),[F.Ceil]:ot(Q,gt(1,1),Et(Q)),[F.Round]:ot(Q,gt(1,1),Et(Q)),[F.Sin]:ot(Q,gt(1,1),Et(Q)),[F.Cos]:ot(Q,gt(1,1),Et(Q)),[F.Atan]:ot(Q,gt(1,2),Et(Q)),[F.Sqrt]:ot(Q,gt(1,1),Et(Q)),[F.Match]:ot(r=>{let t=fe;for(let e=2;e<r.length;e+=2)t&=r[e].type;return t&=r[r.length-1].type,t},gt(4,1/0),Ed,d0),[F.Between]:ot(Ot,gt(3,3),Et(Q)),[F.Interpolate]:ot(r=>{let t=ie|Q;for(let e=3;e<r.length;e+=2)t&=r[e].type;return t},gt(6,1/0),Ed,f0),[F.Case]:ot(r=>{let t=fe;for(let e=1;e<r.length;e+=2)t&=r[e].type;return t&=r[r.length-1].type,t},gt(3,1/0),u0,g0),[F.In]:ot(Ot,gt(2,2),p0),[F.Number]:ot(Q,gt(1,1/0),Et(fe)),[F.String]:ot(De,gt(1,1/0),Et(fe)),[F.Array]:ot(r=>r.length===3||r.length===4?Ni|ie:Ni,gt(1,1/0),Et(Q)),[F.Color]:ot(ie,gt(3,4),Et(Q)),[F.Band]:ot(Q,gt(1,3),Et(Q)),[F.Palette]:ot(ie,gt(2,2),_0)};function l0(r,t){const e=Tt(r[1],t);if(!(e instanceof Bi))throw new Error("Expected a literal argument for get operation");if(typeof e.value!="string")throw new Error("Expected a string argument for get operation");if(t.properties.add(e.value),r.length===3){const i=Tt(r[2],t);return[e,i]}return[e]}function h0(r,t,e,i){const n=r[1];if(typeof n!="string")throw new Error("Expected a string argument for var operation");if(t.variables.add(n),!("variables"in t.style)||t.style.variables[n]===void 0)return[new Bi(fe,n)];const s=t.style.variables[n],a=Tt(s,t);if(a.value=n,i&&!Ye(i,a.type))throw new Error(`The variable ${n} has type ${ne(a.type)} but the following type was expected: ${ne(i)}`);return[a]}function c0(r,t){t.featureId=!0}function Kr(r,t){const e=r[0];if(r.length!==1)throw new Error(`Expected no arguments for ${e} operation`);return[]}function gt(r,t){return function(e,i){const n=e[0],s=e.length-1;if(r===t){if(s!==r){const a=r===1?"":"s";throw new Error(`Expected ${r} argument${a} for ${n}, got ${s}`)}}else if(s<r||s>t){const a=t===1/0?`${r} or more`:`${r} to ${t}`;throw new Error(`Expected ${a} arguments for ${n}, got ${s}`)}}}function Et(r){return function(t,e){const i=t[0],n=t.length-1,s=new Array(n);for(let a=0;a<n;++a){const h=Tt(t[a+1],e);if(!Ye(r,h.type)){const c=ne(r),d=ne(h.type);throw new Error(`Unexpected type for argument ${a} of ${i} operation, got ${c} but expected ${d}`)}h.type&=r,s[a]=h}return s}}function xn(r,t,e){const i=r[0],n=r.length-1;let s=fe;for(let h=0;h<e.length;++h)s&=e[h].type;if(s===Kn)throw new Error(`No common type could be found for arguments of ${i} operation`);const a=new Array(n);for(let h=0;h<n;++h)a[h]=Tt(r[h+1],t,s);return a}function u0(r,t){const e=r[0],i=r.length-1;if(i%2===0)throw new Error(`An odd amount of arguments was expected for operation ${e}, got ${JSON.stringify(i)} instead`)}function Ed(r,t){const e=r[0],i=r.length-1;if(i%2===1)throw new Error(`An even amount of arguments was expected for operation ${e}, got ${JSON.stringify(i)} instead`)}function d0(r,t,e,i){const n=r.length-1;let a=Tt(r[1],t).type;const h=Tt(r[r.length-1],t);let c=i!==void 0?i&h.type:h.type;const d=new Array(n-2);for(let p=0;p<n-2;p+=2){const _=Tt(r[p+2],t),y=Tt(r[p+3],t);a&=_.type,c&=y.type,d[p]=_,d[p+1]=y}const f=De|Q|Ot;if(!Ye(f,a))throw new Error(`Expected an input of type ${ne(f)} for the interpolate operation, got ${ne(a)} instead`);if(Ro(c,Kn))throw new Error("Could not find a common output type for the following match operation: "+JSON.stringify(r));for(let p=0;p<n-2;p+=2){const _=Tt(r[p+2],t,a),y=Tt(r[p+3],t,c);d[p]=_,d[p+1]=y}return[Tt(r[1],t,a),...d,Tt(r[r.length-1],t,c)]}function f0(r,t,e,i){const n=r[1];let s;switch(n[0]){case"linear":s=1;break;case"exponential":if(s=n[1],typeof s!="number")throw new Error(`Expected a number base for exponential interpolation, got ${JSON.stringify(s)} instead`);break;default:s=null}if(!s)throw new Error(`Invalid interpolation type: ${JSON.stringify(n)}`);s=Tt(s,t);let a=Tt(r[2],t);if(!Ye(Q,a.type))throw new Error(`Expected an input of type number for the interpolate operation, got ${ne(a.type)} instead`);a=Tt(r[2],t,Q);const h=new Array(r.length-3);for(let c=0;c<h.length;c+=2){let d=Tt(r[c+3],t);if(!Ye(Q,d.type))throw new Error(`Expected all stop input values in the interpolate operation to be of type number, got ${ne(d.type)} at position ${c+2} instead`);let f=Tt(r[c+4],t);if(!Ye(Q|ie,f.type))throw new Error(`Expected all stop output values in the interpolate operation to be a number or color, got ${ne(f.type)} at position ${c+3} instead`);d=Tt(r[c+3],t,Q),f=Tt(r[c+4],t,Q|ie),h[c]=d,h[c+1]=f}return[s,a,...h]}function g0(r,t,e,i){const n=Tt(r[r.length-1],t);let s=i!==void 0?i&n.type:n.type;const a=new Array(r.length-1);for(let h=0;h<a.length-1;h+=2){const c=Tt(r[h+1],t),d=Tt(r[h+2],t);if(!Ye(Ot,c.type))throw new Error(`Expected all conditions in the case operation to be of type boolean, got ${ne(c.type)} at position ${h} instead`);s&=d.type,a[h]=c,a[h+1]=d}if(Ro(s,Kn))throw new Error("Could not find a common output type for the following case operation: "+JSON.stringify(r));for(let h=0;h<a.length-1;h+=2)a[h+1]=Tt(r[h+2],t,s);return a[a.length-1]=Tt(r[r.length-1],t,s),a}function p0(r,t){let e=r[2];if(!Array.isArray(e))throw new Error('The "in" operator was provided a literal value which was not an array as second argument.');if(typeof e[0]=="string"){if(e[0]!=="literal")throw new Error('For the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions.');if(!Array.isArray(e[1]))throw new Error('The "in" operator was provided a literal value which was not an array as second argument.');e=e[1]}let i=De|Q;const n=new Array(e.length);for(let a=0;a<n.length;a++){const h=Tt(e[a],t);i&=h.type,n[a]=h}if(Ro(i,Kn))throw new Error("Could not find a common type for the following in operation: "+JSON.stringify(r));return[Tt(r[1],t,i),...n]}function _0(r,t){const e=Tt(r[1],t,Q);if(e.type!==Q)throw new Error(`The first argument of palette must be an number, got ${ne(e.type)} instead`);const i=r[2];if(!Array.isArray(i))throw new Error("The second argument of palette must be an array");const n=new Array(i.length);for(let s=0;s<n.length;s++){const a=Tt(i[s],t,ie);if(!(a instanceof Bi))throw new Error(`The palette color at index ${s} must be a literal value`);if(!Ye(a.type,ie))throw new Error(`The palette color at index ${s} should be of type color, got ${ne(a.type)} instead`);n[s]=a}return[e,...n]}function ot(r,...t){return function(e,i,n){const s=e[0];let a=[];for(let c=0;c<t.length;c++)a=t[c](e,i,a,n)||a;let h=typeof r=="function"?r(a):r;if(n!==void 0){if(!Ye(h,n))throw new Error(`The following expression was expected to return ${ne(n)}, but returns ${ne(h)} instead: ${JSON.stringify(e)}`);h&=n}if(h===Kn)throw new Error(`No matching type was found for the following expression: ${JSON.stringify(e)}`);return new s0(h,s,...a)}}function m0(r,t,e){const i=r[0],n=a0[i];if(!n)throw new Error(`Unknown operator: ${i}`);return n(r,t,e)}function Ld(){return{variables:{},properties:{},resolution:NaN,featureId:null}}function Gi(r,t,e){const i=Tt(r,e);if(!Ye(t,i.type)){const n=ne(t),s=ne(i.type);throw new Error(`Expected expression to be of type ${n}, got ${s}`)}return gi(i)}function gi(r,t){if(r instanceof Bi){if(r.type===ie&&typeof r.value=="string"){const i=xl(r.value);return function(){return i}}return function(){return r.value}}const e=r.operator;switch(e){case F.Number:case F.String:return y0(r);case F.Get:case F.Var:return v0(r);case F.Id:return i=>i.featureId;case F.Concat:{const i=r.args.map(n=>gi(n));return n=>"".concat(...i.map(s=>s(n).toString()))}case F.Resolution:return i=>i.resolution;case F.Any:case F.All:case F.Not:return w0(r);case F.Equal:case F.NotEqual:case F.LessThan:case F.LessThanOrEqualTo:case F.GreaterThan:case F.GreaterThanOrEqualTo:return x0(r);case F.Multiply:case F.Divide:case F.Add:case F.Subtract:case F.Clamp:case F.Mod:case F.Pow:case F.Abs:case F.Floor:case F.Ceil:case F.Round:case F.Sin:case F.Cos:case F.Atan:case F.Sqrt:return E0(r);case F.Match:return L0(r);case F.Interpolate:return b0(r);default:throw new Error(`Unsupported operator ${e}`)}}function y0(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let s=0;s<i;++s)n[s]=gi(r.args[s]);switch(e){case F.Number:case F.String:return s=>{for(let a=0;a<i;++a){const h=n[a](s);if(typeof h===e)return h}throw new Error(`Expected one of the values to be a ${e}`)};default:throw new Error(`Unsupported assertion operator ${e}`)}}function v0(r,t){const i=r.args[0].value;switch(r.operator){case F.Get:return n=>n.properties[i];case F.Var:return n=>n.variables[i];default:throw new Error(`Unsupported accessor operator ${r.operator}`)}}function x0(r,t){const e=r.operator,i=gi(r.args[0]),n=gi(r.args[1]);switch(e){case F.Equal:return s=>i(s)===n(s);case F.NotEqual:return s=>i(s)!==n(s);case F.LessThan:return s=>i(s)<n(s);case F.LessThanOrEqualTo:return s=>i(s)<=n(s);case F.GreaterThan:return s=>i(s)>n(s);case F.GreaterThanOrEqualTo:return s=>i(s)>=n(s);default:throw new Error(`Unsupported comparison operator ${e}`)}}function w0(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let s=0;s<i;++s)n[s]=gi(r.args[s]);switch(e){case F.Any:return s=>{for(let a=0;a<i;++a)if(n[a](s))return!0;return!1};case F.All:return s=>{for(let a=0;a<i;++a)if(!n[a](s))return!1;return!0};case F.Not:return s=>!n[0](s);default:throw new Error(`Unsupported logical operator ${e}`)}}function E0(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let s=0;s<i;++s)n[s]=gi(r.args[s]);switch(e){case F.Multiply:return s=>{let a=1;for(let h=0;h<i;++h)a*=n[h](s);return a};case F.Divide:return s=>n[0](s)/n[1](s);case F.Add:return s=>{let a=0;for(let h=0;h<i;++h)a+=n[h](s);return a};case F.Subtract:return s=>n[0](s)-n[1](s);case F.Clamp:return s=>{const a=n[0](s),h=n[1](s);if(a<h)return h;const c=n[2](s);return a>c?c:a};case F.Mod:return s=>n[0](s)%n[1](s);case F.Pow:return s=>Math.pow(n[0](s),n[1](s));case F.Abs:return s=>Math.abs(n[0](s));case F.Floor:return s=>Math.floor(n[0](s));case F.Ceil:return s=>Math.ceil(n[0](s));case F.Round:return s=>Math.round(n[0](s));case F.Sin:return s=>Math.sin(n[0](s));case F.Cos:return s=>Math.cos(n[0](s));case F.Atan:return i===2?s=>Math.atan2(n[0](s),n[1](s)):s=>Math.atan(n[0](s));case F.Sqrt:return s=>Math.sqrt(n[0](s));default:throw new Error(`Unsupported numeric operator ${e}`)}}function L0(r,t){const e=r.args.length,i=new Array(e);for(let n=0;n<e;++n)i[n]=gi(r.args[n]);return n=>{const s=i[0](n);for(let a=1;a<e;a+=2)if(s===i[a](n))return i[a+1](n);return i[e-1](n)}}function b0(r,t){const e=r.args.length,i=new Array(e);for(let n=0;n<e;++n)i[n]=gi(r.args[n]);return n=>{const s=i[0](n),a=i[1](n);let h,c;for(let d=2;d<e;d+=2){const f=i[d](n);let p=i[d+1](n);const _=Array.isArray(p);if(_&&(p=wy(p)),f>=a)return d===2?p:_?T0(s,a,h,c,f,p):qr(s,a,h,c,f,p);h=f,c=p}return c}}function qr(r,t,e,i,n,s){const a=n-e;if(a===0)return i;const h=t-e,c=r===1?h/a:(Math.pow(r,h)-1)/(Math.pow(r,a)-1);return i+c*(s-i)}function T0(r,t,e,i,n,s){if(n-e===0)return i;const h=ju(i),c=ju(s);let d=c[2]-h[2];d>180?d-=360:d<-180&&(d+=360);const f=[qr(r,t,e,h[0],n,c[0]),qr(r,t,e,h[1],n,c[1]),h[2]+qr(r,t,e,0,n,d),qr(r,t,e,i[3],n,s[3])];return Zu(Ey(f))}function C0(r){return!0}function M0(r){const t=wd(),e=S0(r,t),i=Ld();return function(n,s){if(i.properties=n.getPropertiesInternal(),i.resolution=s,t.featureId){const a=n.getId();a!==void 0?i.featureId=a:i.featureId=null}return e(i)}}function bd(r){const t=wd(),e=r.length,i=new Array(e);for(let a=0;a<e;++a)i[a]=Zl(r[a],t);const n=Ld(),s=new Array(e);return function(a,h){if(n.properties=a.getPropertiesInternal(),n.resolution=h,t.featureId){const d=a.getId();d!==void 0?n.featureId=d:n.featureId=null}let c=0;for(let d=0;d<e;++d){const f=i[d](n);f&&(s[c]=f,c+=1)}return s.length=c,s}}function S0(r,t){const e=r.length,i=new Array(e);for(let n=0;n<e;++n){const s=r[n],a="filter"in s?Gi(s.filter,Ot,t):C0;let h;if(Array.isArray(s.style)){const c=s.style.length;h=new Array(c);for(let d=0;d<c;++d)h[d]=Zl(s.style[d],t)}else h=[Zl(s.style,t)];i[n]={filter:a,styles:h}}return function(n){const s=[];let a=!1;for(let h=0;h<e;++h){const c=i[h].filter;if(c(n)&&!(r[h].else&&a)){a=!0;for(const d of i[h].styles){const f=d(n);f&&s.push(f)}}}return s}}function Zl(r,t){const e=Jr(r,"",t),i=Qr(r,"",t),n=P0(r,t),s=k0(r,t),a=ge(r,"z-index",t);if(!e&&!i&&!n&&!s&&!on(r))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(r));const h=new Xn;return function(c){let d=!0;if(e){const f=e(c);f&&(d=!1),h.setFill(f)}if(i){const f=i(c);f&&(d=!1),h.setStroke(f)}if(n){const f=n(c);f&&(d=!1),h.setText(f)}if(s){const f=s(c);f&&(d=!1),h.setImage(f)}return a&&h.setZIndex(a(c)),d?null:h}}function Jr(r,t,e){const i=Td(r,t+"fill-color",e);if(!i)return null;const n=new So;return function(s){const a=i(s);return a==="none"?null:(n.setColor(a),n)}}function Qr(r,t,e){const i=ge(r,t+"stroke-width",e),n=Td(r,t+"stroke-color",e);if(!i&&!n)return null;const s=Ui(r,t+"stroke-line-cap",e),a=Ui(r,t+"stroke-line-join",e),h=Cd(r,t+"stroke-line-dash",e),c=ge(r,t+"stroke-line-dash-offset",e),d=ge(r,t+"stroke-miter-limit",e),f=new Po;return function(p){if(n){const _=n(p);if(_==="none")return null;f.setColor(_)}if(i&&f.setWidth(i(p)),s){const _=s(p);if(_!=="butt"&&_!=="round"&&_!=="square")throw new Error("Expected butt, round, or square line cap");f.setLineCap(_)}if(a){const _=a(p);if(_!=="bevel"&&_!=="round"&&_!=="miter")throw new Error("Expected bevel, round, or miter line join");f.setLineJoin(_)}return h&&f.setLineDash(h(p)),c&&f.setLineDashOffset(c(p)),d&&f.setMiterLimit(d(p)),f}}function P0(r,t){const e="text-",i=Ui(r,e+"value",t);if(!i)return null;const n=Jr(r,e,t),s=Jr(r,e+"background-",t),a=Qr(r,e,t),h=Qr(r,e+"background-",t),c=Ui(r,e+"font",t),d=ge(r,e+"max-angle",t),f=ge(r,e+"offset-x",t),p=ge(r,e+"offset-y",t),_=$r(r,e+"overflow",t),y=Ui(r,e+"placement",t),v=ge(r,e+"repeat",t),w=Io(r,e+"scale",t),T=$r(r,e+"rotate-with-view",t),M=ge(r,e+"rotation",t),E=Ui(r,e+"align",t),b=Ui(r,e+"justify",t),C=Ui(r,e+"baseline",t),P=Cd(r,e+"padding",t),R=new vd({});return function(D){if(R.setText(i(D)),n&&R.setFill(n(D)),s&&R.setBackgroundFill(s(D)),a&&R.setStroke(a(D)),h&&R.setBackgroundStroke(h(D)),c&&R.setFont(c(D)),d&&R.setMaxAngle(d(D)),f&&R.setOffsetX(f(D)),p&&R.setOffsetY(p(D)),_&&R.setOverflow(_(D)),y){const O=y(D);if(O!=="point"&&O!=="line")throw new Error("Expected point or line for text-placement");R.setPlacement(O)}if(v&&R.setRepeat(v(D)),w&&R.setScale(w(D)),T&&R.setRotateWithView(T(D)),M&&R.setRotation(M(D)),E){const O=E(D);if(O!=="left"&&O!=="center"&&O!=="right"&&O!=="end"&&O!=="start")throw new Error("Expected left, right, center, start, or end for text-align");R.setTextAlign(O)}if(b){const O=b(D);if(O!=="left"&&O!=="right"&&O!=="center")throw new Error("Expected left, right, or center for text-justify");R.setJustify(O)}if(C){const O=C(D);if(O!=="bottom"&&O!=="top"&&O!=="middle"&&O!=="alphabetic"&&O!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");R.setTextBaseline(O)}return P&&R.setPadding(P(D)),R}}function k0(r,t){return"icon-src"in r?R0(r,t):"shape-points"in r?A0(r,t):"circle-radius"in r?I0(r,t):null}function R0(r,t){const e="icon-",i=e+"src",n=Pd(r[i],i),s=Ao(r,e+"anchor",t),a=Io(r,e+"scale",t),h=ge(r,e+"opacity",t),c=Ao(r,e+"displacement",t),d=ge(r,e+"rotation",t),f=$r(r,e+"rotate-with-view",t),p=Md(r,e+"anchor-origin"),_=Sd(r,e+"anchor-x-units"),y=Sd(r,e+"anchor-y-units"),v=z0(r,e+"color"),w=O0(r,e+"cross-origin"),T=F0(r,e+"offset"),M=Md(r,e+"offset-origin"),E=qn(r,e+"width"),b=qn(r,e+"height"),C=D0(r,e+"size"),P=Wl(r,e+"declutter"),R=new Ul({src:n,anchorOrigin:p,anchorXUnits:_,anchorYUnits:y,color:v,crossOrigin:w,offset:T,offsetOrigin:M,height:b,width:E,size:C,declutterMode:P});return function(D){return h&&R.setOpacity(h(D)),c&&R.setDisplacement(c(D)),d&&R.setRotation(d(D)),f&&R.setRotateWithView(f(D)),a&&R.setScale(a(D)),s&&R.setAnchor(s(D)),R}}function A0(r,t){const e="shape-",i=e+"points",n=kd(r[i],i),s=Jr(r,e,t),a=Qr(r,e,t),h=Io(r,e+"scale",t),c=Ao(r,e+"displacement",t),d=ge(r,e+"rotation",t),f=$r(r,e+"rotate-with-view",t),p=qn(r,e+"radius"),_=qn(r,e+"radius1"),y=qn(r,e+"radius2"),v=qn(r,e+"angle"),w=Wl(r,e+"declutter-mode"),T=new pd({points:n,radius:p,radius1:_,radius2:y,angle:v,declutterMode:w});return function(M){return s&&T.setFill(s(M)),a&&T.setStroke(a(M)),c&&T.setDisplacement(c(M)),d&&T.setRotation(d(M)),f&&T.setRotateWithView(f(M)),h&&T.setScale(h(M)),T}}function I0(r,t){const e="circle-",i=Jr(r,e,t),n=Qr(r,e,t),s=ge(r,e+"radius",t),a=Io(r,e+"scale",t),h=Ao(r,e+"displacement",t),c=ge(r,e+"rotation",t),d=$r(r,e+"rotate-with-view",t),f=Wl(r,e+"declutter-mode"),p=new _d({radius:5,declutterMode:f});return function(_){return s&&p.setRadius(s(_)),i&&p.setFill(i(_)),n&&p.setStroke(n(_)),h&&p.setDisplacement(h(_)),c&&p.setRotation(c(_)),d&&p.setRotateWithView(d(_)),a&&p.setScale(a(_)),p}}function ge(r,t,e){if(!(t in r))return;const i=Gi(r[t],Q,e);return function(n){return kd(i(n),t)}}function Ui(r,t,e){if(!(t in r))return null;const i=Gi(r[t],De,e);return function(n){return Pd(i(n),t)}}function $r(r,t,e){if(!(t in r))return null;const i=Gi(r[t],Ot,e);return function(n){const s=i(n);if(typeof s!="boolean")throw new Error(`Expected a boolean for ${t}`);return s}}function Td(r,t,e){if(!(t in r))return null;const i=Gi(r[t],ie|De,e);return function(n){return Rd(i(n),t)}}function Cd(r,t,e){if(!(t in r))return null;const i=Gi(r[t],Ni,e);return function(n){return ts(i(n),t)}}function Ao(r,t,e){if(!(t in r))return null;const i=Gi(r[t],Ni,e);return function(n){const s=ts(i(n),t);if(s.length!==2)throw new Error(`Expected two numbers for ${t}`);return s}}function Io(r,t,e){if(!(t in r))return null;const i=Gi(r[t],Ni|Q,e);return function(n){return N0(i(n),t)}}function qn(r,t){const e=r[t];if(e!==void 0){if(typeof e!="number")throw new Error(`Expected a number for ${t}`);return e}}function D0(r,t){const e=r[t];if(e!==void 0){if(typeof e=="number")return Le(e);if(!Array.isArray(e))throw new Error(`Expected a number or size array for ${t}`);if(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number")throw new Error(`Expected a number or size array for ${t}`);return e}}function O0(r,t){const e=r[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);return e}}function Md(r,t){const e=r[t];if(e!==void 0){if(e!=="bottom-left"&&e!=="bottom-right"&&e!=="top-left"&&e!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return e}}function Sd(r,t){const e=r[t];if(e!==void 0){if(e!=="pixels"&&e!=="fraction")throw new Error(`Expected pixels or fraction for ${t}`);return e}}function F0(r,t){const e=r[t];if(e!==void 0)return ts(e,t)}function Wl(r,t){const e=r[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);if(e!=="declutter"&&e!=="obstacle"&&e!=="none")throw new Error(`Expected declutter, obstacle, or none for ${t}`);return e}}function z0(r,t){const e=r[t];if(e!==void 0)return Rd(e,t)}function ts(r,t){if(!Array.isArray(r))throw new Error(`Expected an array for ${t}`);const e=r.length;for(let i=0;i<e;++i)if(typeof r[i]!="number")throw new Error(`Expected an array of numbers for ${t}`);return r}function Pd(r,t){if(typeof r!="string")throw new Error(`Expected a string for ${t}`);return r}function kd(r,t){if(typeof r!="number")throw new Error(`Expected a number for ${t}`);return r}function Rd(r,t){if(typeof r=="string")return r;const e=ts(r,t),i=e.length;if(i<3||i>4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function N0(r,t){if(typeof r=="number")return r;const e=ts(r,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}const Ad={RENDER_ORDER:"renderOrder"};class B0 extends go{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter!==void 0?t.declutter:!1,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Ad.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t){t.declutterTree||(t.declutterTree=new dd(9)),this.getRenderer().renderDeclutter(t)}setRenderOrder(t){this.set(Ad.RENDER_ORDER,t)}setStyle(t){this.style_=G0(t),this.styleFunction_=t===null?void 0:Kv(this.style_),this.changed()}}function G0(r){if(r===void 0)return qv;if(!r)return null;if(typeof r=="function"||r instanceof Xn)return r;if(!Array.isArray(r))return bd([r]);if(r.length===0)return[];const t=r.length,e=r[0];if(e instanceof Xn){const n=new Array(t);for(let s=0;s<t;++s){const a=r[s];if(!(a instanceof Xn))throw new Error("Expected a list of style instances");n[s]=a}return n}if("style"in e){const n=new Array(t);for(let s=0;s<t;++s){const a=r[s];if(!("style"in a))throw new Error("Expected a list of rules with a style property");n[s]=a}return M0(n)}return bd(r)}const Hl=B0,oe={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"},Vl=34962,Xl=34963,U0=35040,j0=35044,Yl=35048,Z0=5121,W0=5123,H0=5125,Id=5126,Dd=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function V0(r,t){t=Object.assign({preserveDrawingBuffer:!0,antialias:!Zm},t);const e=Dd.length;for(let i=0;i<e;++i)try{const n=r.getContext(Dd[i],t);if(n)return n}catch{}return null}const X0={STATIC_DRAW:j0,STREAM_DRAW:U0,DYNAMIC_DRAW:Yl};class Y0{constructor(t,e){this.array_=null,this.type_=t,mt(t===Vl||t===Xl,"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`"),this.usage_=e!==void 0?e:X0.STATIC_DRAW}ofSize(t){return this.array_=new(Kl(this.type_))(t),this}fromArray(t){return this.array_=Kl(this.type_).from(t),this}fromArrayBuffer(t){return this.array_=new(Kl(this.type_))(t),this}getType(){return this.type_}getArray(){return this.array_}getUsage(){return this.usage_}getSize(){return this.array_?this.array_.length:0}}function Kl(r){switch(r){case Vl:return Float32Array;case Xl:return Uint32Array;default:return Float32Array}}const Od=Y0;class K0 extends Bc{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.declutterExecutorGroup=null}getFeatures(t){return rt()}getData(t){return null}prepareFrame(t){return rt()}renderFrame(t,e){return rt()}loadedTileCallback(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i}createLoadedTileFinder(t,e,i){return(n,s)=>{const a=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,s,a)}}forEachFeatureAtCoordinate(t,e,i,n,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===St.LOADED||e.getState()===St.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=St.LOADED&&e!=St.ERROR&&t.addEventListener(lt.CHANGE,this.boundHandleImageChange_),e==St.IDLE&&(t.load(),e=t.getState()),e==St.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}disposeInternal(){delete this.layer_,super.disposeInternal()}}const Fd=K0,Do={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"},q0=`
|
|
23
21
|
precision mediump float;
|
|
24
22
|
|
|
25
23
|
attribute vec2 a_position;
|
|
@@ -33,7 +31,7 @@
|
|
|
33
31
|
v_screenCoord = v_texCoord * u_screenSize;
|
|
34
32
|
gl_Position = vec4(a_position, 0.0, 1.0);
|
|
35
33
|
}
|
|
36
|
-
`,
|
|
34
|
+
`,J0=`
|
|
37
35
|
precision mediump float;
|
|
38
36
|
|
|
39
37
|
uniform sampler2D u_image;
|
|
@@ -44,7 +42,7 @@
|
|
|
44
42
|
void main() {
|
|
45
43
|
gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;
|
|
46
44
|
}
|
|
47
|
-
`;class xx{constructor(t){this.gl_=t.webGlContext;const e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer(),this.depthBuffer_=e.createRenderbuffer();const i=e.createShader(e.VERTEX_SHADER);e.shaderSource(i,t.vertexShader||yx),e.compileShader(i);const n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,t.fragmentShader||vx),e.compileShader(n),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,i),e.attachShader(this.renderTargetProgram_,n),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer();const o=[-1,-1,1,-1,-1,1,1,-1,1,1,-1,1];e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array(o),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(a=>{this.uniforms_.push({value:t.uniforms[a],location:e.getUniformLocation(this.renderTargetProgram_,a)})})}getGL(){return this.gl_}init(t){const e=this.getGL(),i=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.bindRenderbuffer(e.RENDERBUFFER,this.getDepthBuffer()),e.viewport(0,0,i[0],i[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==i[0]||this.renderTargetTextureSize_[1]!==i[1]){this.renderTargetTextureSize_=i;const n=0,o=e.RGBA,a=0,h=e.RGBA,c=e.UNSIGNED_BYTE,d=null;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,n,o,i[0],i[1],a,h,c,d),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,i[0],i[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthBuffer_)}}apply(t,e,i,n){const o=this.getGL(),a=t.size;if(o.bindFramebuffer(o.FRAMEBUFFER,e?e.getFrameBuffer():null),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,this.renderTargetTexture_),!e){const c=ht(o.canvas);if(!t.renderTargets[c]){const d=o.getContextAttributes();d&&d.preserveDrawingBuffer&&(o.clearColor(0,0,0,0),o.clearDepth(1),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT)),t.renderTargets[c]=!0}}o.disable(o.DEPTH_TEST),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),o.viewport(0,0,o.drawingBufferWidth,o.drawingBufferHeight),o.bindBuffer(o.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),o.useProgram(this.renderTargetProgram_),o.enableVertexAttribArray(this.renderTargetAttribLocation_),o.vertexAttribPointer(this.renderTargetAttribLocation_,2,o.FLOAT,!1,0,0),o.uniform2f(this.renderTargetUniformLocation_,a[0],a[1]),o.uniform1i(this.renderTargetTextureLocation_,0);const h=t.layerStatesArray[t.layerIndex].opacity;o.uniform1f(this.renderTargetOpacityLocation_,h),this.applyUniforms(t),i&&i(o,t),o.drawArrays(o.TRIANGLES,0,6),n&&n(o,t)}getFrameBuffer(){return this.frameBuffer_}getDepthBuffer(){return this.depthBuffer_}applyUniforms(t){const e=this.getGL();let i,n=1;this.uniforms_.forEach(function(o){if(i=typeof o.value=="function"?o.value(t):o.value,i instanceof HTMLCanvasElement||i instanceof ImageData)o.texture||(o.texture=e.createTexture()),e.activeTexture(e[`TEXTURE${n}`]),e.bindTexture(e.TEXTURE_2D,o.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),i instanceof ImageData?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,i.width,i.height,0,e.UNSIGNED_BYTE,new Uint8Array(i.data)):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i),e.uniform1i(o.location,n++);else if(Array.isArray(i))switch(i.length){case 2:e.uniform2f(o.location,i[0],i[1]);return;case 3:e.uniform3f(o.location,i[0],i[1],i[2]);return;case 4:e.uniform4f(o.location,i[0],i[1],i[2],i[3]);return;default:return}else typeof i=="number"&&e.uniform1f(o.location,i)})}}const dd=xx;function wx(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Ex(r,t){return r[0]=t[0],r[1]=t[1],r[4]=t[2],r[5]=t[3],r[12]=t[4],r[13]=t[5],r}const ai={PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution",ROTATION:"u_rotation",VIEWPORT_SIZE_PX:"u_viewportSizePx",PIXEL_RATIO:"u_pixelRatio",HIT_DETECTION:"u_hitDetection"},li={UNSIGNED_BYTE:ux,UNSIGNED_SHORT:dx,UNSIGNED_INT:fx,FLOAT:ld},yo={};function fd(r){return"shared/"+r}let gd=0;function Lx(){const r="unique/"+gd;return gd+=1,r}function bx(r){let t=yo[r];if(!t){const e=document.createElement("canvas");e.width=1,e.height=1,e.style.position="absolute",e.style.left="0",t={users:0,context:gx(e)},yo[r]=t}return t.users+=1,t.context}function Tx(r){const t=yo[r];if(!t||(t.users-=1,t.users>0))return;const e=t.context,i=e.getExtension("WEBGL_lose_context");i&&i.loseContext();const n=e.canvas;n.width=1,n.height=1,delete yo[r]}class Cx extends bs{constructor(t){super(),t=t||{},this.boundHandleWebGLContextLost_=this.handleWebGLContextLost.bind(this),this.boundHandleWebGLContextRestored_=this.handleWebGLContextRestored.bind(this),this.canvasCacheKey_=t.canvasCacheKey?fd(t.canvasCacheKey):Lx(),this.gl_=bx(this.canvasCacheKey_),this.bufferCache_={},this.extensionCache_={},this.currentProgram_=null,this.needsToBeRecreated_=!1;const e=this.gl_.canvas;e.addEventListener(mo.LOST,this.boundHandleWebGLContextLost_),e.addEventListener(mo.RESTORED,this.boundHandleWebGLContextRestored_),this.offsetRotateMatrix_=Vt(),this.offsetScaleMatrix_=Vt(),this.tmpMat4_=wx(),this.uniformLocationsByProgram_={},this.attribLocationsByProgram_={},this.uniforms_=[],t.uniforms&&this.setUniforms(t.uniforms),this.postProcessPasses_=t.postProcesses?t.postProcesses.map(i=>new dd({webGlContext:this.gl_,scaleRatio:i.scaleRatio,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,uniforms:i.uniforms})):[new dd({webGlContext:this.gl_})],this.shaderCompileErrors_=null,this.startTime_=Date.now()}setUniforms(t){this.uniforms_=[],this.addUniforms(t)}addUniforms(t){for(const e in t)this.uniforms_.push({name:e,value:t[e]})}canvasCacheKeyMatches(t){return this.canvasCacheKey_===fd(t)}getExtension(t){if(t in this.extensionCache_)return this.extensionCache_[t];const e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e}bindBuffer(t){const e=this.gl_,i=ht(t);let n=this.bufferCache_[i];if(!n){const o=e.createBuffer();n={buffer:t,webGlBuffer:o},this.bufferCache_[i]=n}e.bindBuffer(t.getType(),n.webGlBuffer)}flushBufferData(t){const e=this.gl_;this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())}deleteBuffer(t){const e=this.gl_,i=ht(t),n=this.bufferCache_[i];n&&!e.isContextLost()&&e.deleteBuffer(n.webGlBuffer),delete this.bufferCache_[i]}disposeInternal(){const t=this.gl_.canvas;t.removeEventListener(mo.LOST,this.boundHandleWebGLContextLost_),t.removeEventListener(mo.RESTORED,this.boundHandleWebGLContextRestored_),Tx(this.canvasCacheKey_),delete this.gl_}prepareDraw(t,e,i){const n=this.gl_,o=this.getCanvas(),a=t.size,h=t.pixelRatio;(o.width!==a[0]*h||o.height!==a[1]*h)&&(o.width=a[0]*h,o.height=a[1]*h,o.style.width=a[0]+"px",o.style.height=a[1]+"px");for(let c=this.postProcessPasses_.length-1;c>=0;c--)this.postProcessPasses_[c].init(t);n.bindTexture(n.TEXTURE_2D,null),n.clearColor(0,0,0,0),n.depthRange(0,1),n.clearDepth(1),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,e?n.ZERO:n.ONE_MINUS_SRC_ALPHA),i?(n.enable(n.DEPTH_TEST),n.depthFunc(n.LEQUAL)):n.disable(n.DEPTH_TEST)}bindTexture(t,e,i){const n=this.gl_;n.activeTexture(n.TEXTURE0+e),n.bindTexture(n.TEXTURE_2D,t),n.uniform1i(this.getUniformLocation(i),e)}prepareDrawToRenderTarget(t,e,i,n){const o=this.gl_,a=e.getSize();o.bindFramebuffer(o.FRAMEBUFFER,e.getFramebuffer()),o.bindRenderbuffer(o.RENDERBUFFER,e.getDepthbuffer()),o.viewport(0,0,a[0],a[1]),o.bindTexture(o.TEXTURE_2D,e.getTexture()),o.clearColor(0,0,0,0),o.depthRange(0,1),o.clearDepth(1),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.enable(o.BLEND),o.blendFunc(o.ONE,i?o.ZERO:o.ONE_MINUS_SRC_ALPHA),n?(o.enable(o.DEPTH_TEST),o.depthFunc(o.LEQUAL)):o.disable(o.DEPTH_TEST)}drawElements(t,e){const i=this.gl_;this.getExtension("OES_element_index_uint");const n=i.UNSIGNED_INT,o=4,a=e-t,h=t*o;i.drawElements(i.TRIANGLES,a,n,h)}finalizeDraw(t,e,i){for(let n=0,o=this.postProcessPasses_.length;n<o;n++)n===o-1?this.postProcessPasses_[n].apply(t,null,e,i):this.postProcessPasses_[n].apply(t,this.postProcessPasses_[n+1])}getCanvas(){return this.gl_.canvas}getGL(){return this.gl_}applyFrameState(t){const e=t.size,i=t.viewState.rotation,n=t.pixelRatio;this.setUniformFloatValue(ai.TIME,(Date.now()-this.startTime_)*.001),this.setUniformFloatValue(ai.ZOOM,t.viewState.zoom),this.setUniformFloatValue(ai.RESOLUTION,t.viewState.resolution),this.setUniformFloatValue(ai.PIXEL_RATIO,n),this.setUniformFloatVec2(ai.VIEWPORT_SIZE_PX,[e[0],e[1]]),this.setUniformFloatValue(ai.ROTATION,i)}applyHitDetectionUniform(t){const e=this.getUniformLocation(ai.HIT_DETECTION);this.getGL().uniform1i(e,t?1:0),t&&this.setUniformFloatValue(ai.PIXEL_RATIO,.5)}applyUniforms(t){const e=this.gl_;let i,n=0;this.uniforms_.forEach(o=>{if(i=typeof o.value=="function"?o.value(t):o.value,i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof ImageData)o.texture||(o.prevValue=void 0,o.texture=e.createTexture()),this.bindTexture(o.texture,n,o.name),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),(!(i instanceof HTMLImageElement)||i.complete)&&o.prevValue!==i&&(o.prevValue=i,e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i)),n++;else if(Array.isArray(i)&&i.length===6)this.setUniformMatrixValue(o.name,Ex(this.tmpMat4_,i));else if(Array.isArray(i)&&i.length<=4)switch(i.length){case 2:e.uniform2f(this.getUniformLocation(o.name),i[0],i[1]);return;case 3:e.uniform3f(this.getUniformLocation(o.name),i[0],i[1],i[2]);return;case 4:e.uniform4f(this.getUniformLocation(o.name),i[0],i[1],i[2],i[3]);return;default:return}else typeof i=="number"&&e.uniform1f(this.getUniformLocation(o.name),i)})}useProgram(t,e){this.gl_.useProgram(t),this.currentProgram_=t,this.applyFrameState(e),this.applyUniforms(e)}compileShader(t,e){const i=this.gl_,n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}getProgram(t,e){const i=this.gl_,n=this.compileShader(t,i.FRAGMENT_SHADER),o=this.compileShader(e,i.VERTEX_SHADER),a=i.createProgram();if(i.attachShader(a,n),i.attachShader(a,o),i.linkProgram(a),!i.getShaderParameter(n,i.COMPILE_STATUS)){const h=`Fragment shader compilation failed: ${i.getShaderInfoLog(n)}`;throw new Error(h)}if(i.deleteShader(n),!i.getShaderParameter(o,i.COMPILE_STATUS)){const h=`Vertex shader compilation failed: ${i.getShaderInfoLog(o)}`;throw new Error(h)}if(i.deleteShader(o),!i.getProgramParameter(a,i.LINK_STATUS)){const h=`GL program linking failed: ${i.getProgramInfoLog(a)}`;throw new Error(h)}return a}getUniformLocation(t){const e=ht(this.currentProgram_);return this.uniformLocationsByProgram_[e]===void 0&&(this.uniformLocationsByProgram_[e]={}),this.uniformLocationsByProgram_[e][t]===void 0&&(this.uniformLocationsByProgram_[e][t]=this.gl_.getUniformLocation(this.currentProgram_,t)),this.uniformLocationsByProgram_[e][t]}getAttributeLocation(t){const e=ht(this.currentProgram_);return this.attribLocationsByProgram_[e]===void 0&&(this.attribLocationsByProgram_[e]={}),this.attribLocationsByProgram_[e][t]===void 0&&(this.attribLocationsByProgram_[e][t]=this.gl_.getAttribLocation(this.currentProgram_,t)),this.attribLocationsByProgram_[e][t]}makeProjectionTransform(t,e){const i=t.size,n=t.viewState.rotation,o=t.viewState.resolution,a=t.viewState.center;return ze(e,0,0,2/(o*i[0]),2/(o*i[1]),-n,-a[0],-a[1]),e}setUniformFloatValue(t,e){this.gl_.uniform1f(this.getUniformLocation(t),e)}setUniformFloatVec2(t,e){this.gl_.uniform2fv(this.getUniformLocation(t),e)}setUniformFloatVec4(t,e){this.gl_.uniform4fv(this.getUniformLocation(t),e)}setUniformMatrixValue(t,e){this.gl_.uniformMatrix4fv(this.getUniformLocation(t),!1,e)}enableAttributeArray_(t,e,i,n,o){const a=this.getAttributeLocation(t);a<0||(this.gl_.enableVertexAttribArray(a),this.gl_.vertexAttribPointer(a,e,i,!1,n,o))}enableAttributes(t){const e=Mx(t);let i=0;for(let n=0;n<t.length;n++){const o=t[n];this.enableAttributeArray_(o.name,o.size,o.type||ld,e,i),i+=o.size*pd(o.type)}}handleWebGLContextLost(t){Ln(this.bufferCache_),this.currentProgram_=null,t.preventDefault()}handleWebGLContextRestored(){this.needsToBeRecreated_=!0}needsToBeRecreated(){return this.needsToBeRecreated_}createTexture(t,e,i){const n=this.gl_;i=i||n.createTexture();const o=0,a=n.RGBA,h=0,c=n.RGBA,d=n.UNSIGNED_BYTE;return n.bindTexture(n.TEXTURE_2D,i),e?n.texImage2D(n.TEXTURE_2D,o,a,c,d,e):n.texImage2D(n.TEXTURE_2D,o,a,t[0],t[1],h,c,d,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),i}}function Mx(r){let t=0;for(let e=0;e<r.length;e++){const i=r[e];t+=i.size*pd(i.type)}return t}function pd(r){switch(r){case li.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case li.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case li.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case li.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}class Ml extends ud{constructor(t,e){super(t),e=e||{},this.inversePixelTransform_=Vt(),this.pixelContext_=null,this.postProcesses_=e.postProcesses,this.uniforms_=e.uniforms,this.helper,t.addChangeListener(xt.MAP,this.removeHelper.bind(this)),this.dispatchPreComposeEvent=this.dispatchPreComposeEvent.bind(this),this.dispatchPostComposeEvent=this.dispatchPostComposeEvent.bind(this)}dispatchPreComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(qt.PRECOMPOSE)){const n=new br(qt.PRECOMPOSE,void 0,e,t);i.dispatchEvent(n)}}dispatchPostComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(qt.POSTCOMPOSE)){const n=new br(qt.POSTCOMPOSE,void 0,e,t);i.dispatchEvent(n)}}reset(t){this.uniforms_=t.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)}removeHelper(){this.helper&&(this.helper.dispose(),delete this.helper)}prepareFrame(t){if(this.getLayer().getRenderSource()){let e=!0,i=-1,n;for(let a=0,h=t.layerStatesArray.length;a<h;a++){const c=t.layerStatesArray[a].layer,d=c.getRenderer();if(!(d instanceof Ml)){e=!0;continue}const f=c.getClassName();if((e||f!==n)&&(i+=1,e=!1),n=f,d===this)break}const o="map/"+t.mapId+"/group/"+i;(!this.helper||!this.helper.canvasCacheKeyMatches(o)||this.helper.needsToBeRecreated())&&(this.removeHelper(),this.helper=new Cx({postProcesses:this.postProcesses_,uniforms:this.uniforms_,canvasCacheKey:o}),n&&(this.helper.getCanvas().className=n),this.afterHelperCreated())}return this.prepareFrameInternal(t)}afterHelperCreated(){}prepareFrameInternal(t){return!0}disposeInternal(){this.removeHelper(),super.disposeInternal()}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){ze(this.inversePixelTransform_,0,0,i.pixelRatio,-i.pixelRatio,0,0,-i.size[1]);const o=new br(t,this.inversePixelTransform_,i,e);n.dispatchEvent(o)}}preRender(t,e){this.dispatchRenderEvent_(qt.PRERENDER,t,e)}postRender(t,e){this.dispatchRenderEvent_(qt.POSTRENDER,t,e)}}const Sx=Ml,Ue=new Uint8Array(4);class Px{constructor(t,e){this.helper_=t;const i=t.getGL();this.texture_=i.createTexture(),this.framebuffer_=i.createFramebuffer(),this.depthbuffer_=i.createRenderbuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}setSize(t){ei(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())}getSize(){return this.size_}clearCachedData(){this.dataCacheDirty_=!0}readAll(){if(this.dataCacheDirty_){const t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_}readPixel(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return Ue[0]=0,Ue[1]=0,Ue[2]=0,Ue[3]=0,Ue;this.readAll();const i=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return Ue[0]=this.data_[i*4],Ue[1]=this.data_[i*4+1],Ue[2]=this.data_[i*4+2],Ue[3]=this.data_[i*4+3],Ue}getTexture(){return this.texture_}getFramebuffer(){return this.framebuffer_}getDepthbuffer(){return this.depthbuffer_}updateSize_(){const t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),e.bindRenderbuffer(e.RENDERBUFFER,this.depthbuffer_),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t[0],t[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthbuffer_),this.data_=new Uint8Array(t[0]*t[1]*4)}}const kx=Px,_d={GENERATE_POLYGON_BUFFERS:"GENERATE_POLYGON_BUFFERS",GENERATE_POINT_BUFFERS:"GENERATE_POINT_BUFFERS",GENERATE_LINE_STRING_BUFFERS:"GENERATE_LINE_STRING_BUFFERS"};function Rx(r,t){t=t||[];const e=256,i=e-1;return t[0]=Math.floor(r/e/e/e)/i,t[1]=Math.floor(r/e/e)%e/i,t[2]=Math.floor(r/e)%e/i,t[3]=r%e/i,t}function Ax(r){let t=0;const e=256,i=e-1;return t+=Math.round(r[0]*e*e*e*i),t+=Math.round(r[1]*e*e*i),t+=Math.round(r[2]*e*i),t+=Math.round(r[3]*i),t}function Ix(){const r='const e="GENERATE_POLYGON_BUFFERS",t="GENERATE_POINT_BUFFERS",n="GENERATE_LINE_STRING_BUFFERS";function r(e,t){const n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function x(e,t){const n=(r=t)[0]*r[3]-r[1]*r[2];var r;!function(e,t){if(!e)throw new Error(t)}(0!==n,"Transformation matrix cannot be inverted");const x=t[0],i=t[1],u=t[2],o=t[3],f=t[4],s=t[5];return e[0]=o/n,e[1]=-i/n,e[2]=-u/n,e[3]=x/n,e[4]=(u*s-o*f)/n,e[5]=-(x*s-i*f)/n,e}function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}new Array(6);var u={exports:{}};function o(e,t,n){n=n||2;var r,x,i,u,o,s,l,v=t&&t.length,c=v?t[0]*n:e.length,h=f(e,0,c,n,!0),g=[];if(!h||h.next===h.prev)return g;if(v&&(h=function(e,t,n,r){var x,i,u,o=[];for(x=0,i=t.length;x<i;x++)(u=f(e,t[x]*r,x<i-1?t[x+1]*r:e.length,r,!1))===u.next&&(u.steiner=!0),o.push(d(u));for(o.sort(p),x=0;x<o.length;x++)n=y(o[x],n);return n}(e,t,h,n)),e.length>80*n){r=i=e[0],x=u=e[1];for(var b=n;b<c;b+=n)(o=e[b])<r&&(r=o),(s=e[b+1])<x&&(x=s),o>i&&(i=o),s>u&&(u=s);l=0!==(l=Math.max(i-r,u-x))?32767/l:0}return a(h,g,n,r,x,l,0),g}function f(e,t,n,r,x){var i,u;if(x===O(e,t,n,r)>0)for(i=t;i<n;i+=r)u=P(i,e[i],e[i+1],u);else for(i=n-r;i>=t;i-=r)u=P(i,e[i],e[i+1],u);return u&&m(u,u.next)&&(B(u),u=u.next),u}function s(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!m(r,r.next)&&0!==M(r.prev,r,r.next))r=r.next;else{if(B(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function a(e,t,n,r,x,i,u){if(e){!u&&i&&function(e,t,n,r){var x=e;do{0===x.z&&(x.z=b(x.x,x.y,t,n,r)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next}while(x!==e);x.prevZ.nextZ=null,x.prevZ=null,function(e){var t,n,r,x,i,u,o,f,s=1;do{for(n=e,e=null,i=null,u=0;n;){for(u++,r=n,o=0,t=0;t<s&&(o++,r=r.nextZ);t++);for(f=s;o>0||f>0&&r;)0!==o&&(0===f||!r||n.z<=r.z)?(x=n,n=n.nextZ,o--):(x=r,r=r.nextZ,f--),i?i.nextZ=x:e=x,x.prevZ=i,i=x;n=r}i.nextZ=null,s*=2}while(u>1)}(x)}(e,r,x,i);for(var o,f,p=e;e.prev!==e.next;)if(o=e.prev,f=e.next,i?v(e,r,x,i):l(e))t.push(o.i/n|0),t.push(e.i/n|0),t.push(f.i/n|0),B(e),e=f.next,p=f.next;else if((e=f)===p){u?1===u?a(e=c(s(e),t,n),t,n,r,x,i,2):2===u&&h(e,t,n,r,x,i):a(s(e),t,n,r,x,i,1);break}}}function l(e){var t=e.prev,n=e,r=e.next;if(M(t,n,r)>=0)return!1;for(var x=t.x,i=n.x,u=r.x,o=t.y,f=n.y,s=r.y,a=x<i?x<u?x:u:i<u?i:u,l=o<f?o<s?o:s:f<s?f:s,v=x>i?x>u?x:u:i>u?i:u,c=o>f?o>s?o:s:f>s?f:s,h=r.next;h!==t;){if(h.x>=a&&h.x<=v&&h.y>=l&&h.y<=c&&Z(x,o,i,f,u,s,h.x,h.y)&&M(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function v(e,t,n,r){var x=e.prev,i=e,u=e.next;if(M(x,i,u)>=0)return!1;for(var o=x.x,f=i.x,s=u.x,a=x.y,l=i.y,v=u.y,c=o<f?o<s?o:s:f<s?f:s,h=a<l?a<v?a:v:l<v?l:v,p=o>f?o>s?o:s:f>s?f:s,y=a>l?a>v?a:v:l>v?l:v,g=b(c,h,t,n,r),d=b(p,y,t,n,r),w=e.prevZ,m=e.nextZ;w&&w.z>=g&&m&&m.z<=d;){if(w.x>=c&&w.x<=p&&w.y>=h&&w.y<=y&&w!==x&&w!==u&&Z(o,a,f,l,s,v,w.x,w.y)&&M(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,m.x>=c&&m.x<=p&&m.y>=h&&m.y<=y&&m!==x&&m!==u&&Z(o,a,f,l,s,v,m.x,m.y)&&M(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;w&&w.z>=g;){if(w.x>=c&&w.x<=p&&w.y>=h&&w.y<=y&&w!==x&&w!==u&&Z(o,a,f,l,s,v,w.x,w.y)&&M(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;m&&m.z<=d;){if(m.x>=c&&m.x<=p&&m.y>=h&&m.y<=y&&m!==x&&m!==u&&Z(o,a,f,l,s,v,m.x,m.y)&&M(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function c(e,t,n){var r=e;do{var x=r.prev,i=r.next.next;!m(x,i)&&A(x,r,r.next,i)&&F(x,i)&&F(i,x)&&(t.push(x.i/n|0),t.push(r.i/n|0),t.push(i.i/n|0),B(r),B(r.next),r=e=i),r=r.next}while(r!==e);return s(r)}function h(e,t,n,r,x,i){var u=e;do{for(var o=u.next.next;o!==u.prev;){if(u.i!==o.i&&w(u,o)){var f=I(u,o);return u=s(u,u.next),f=s(f,f.next),a(u,t,n,r,x,i,0),void a(f,t,n,r,x,i,0)}o=o.next}u=u.next}while(u!==e)}function p(e,t){return e.x-t.x}function y(e,t){var n=function(e,t){var n,r=t,x=e.x,i=e.y,u=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var o=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=x&&o>u&&(u=o,n=r.x<r.next.x?r:r.next,o===x))return n}r=r.next}while(r!==t);if(!n)return null;var f,s=n,a=n.x,l=n.y,v=1/0;r=n;do{x>=r.x&&r.x>=a&&x!==r.x&&Z(i<l?x:u,i,a,l,i<l?u:x,i,r.x,r.y)&&(f=Math.abs(i-r.y)/(x-r.x),F(r,e)&&(f<v||f===v&&(r.x>n.x||r.x===n.x&&g(n,r)))&&(n=r,v=f)),r=r.next}while(r!==s);return n}(e,t);if(!n)return t;var r=I(n,e);return s(r,r.next),s(n,n.next)}function g(e,t){return M(e.prev,e,t.prev)<0&&M(t.next,e,e.next)<0}function b(e,t,n,r,x){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*x|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*x|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function d(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Z(e,t,n,r,x,i,u,o){return(x-u)*(t-o)>=(e-u)*(i-o)&&(e-u)*(r-o)>=(n-u)*(t-o)&&(n-u)*(i-o)>=(x-u)*(r-o)}function w(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&A(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(F(e,t)&&F(t,e)&&function(e,t){var n=e,r=!1,x=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&x<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(M(e.prev,e,t.prev)||M(e,t.prev,t))||m(e,t)&&M(e.prev,e,e.next)>0&&M(t.prev,t,t.next)>0)}function M(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function m(e,t){return e.x===t.x&&e.y===t.y}function A(e,t,n,r){var x=z(M(e,t,n)),i=z(M(e,t,r)),u=z(M(n,r,e)),o=z(M(n,r,t));return x!==i&&u!==o||(!(0!==x||!E(e,n,t))||(!(0!==i||!E(e,r,t))||(!(0!==u||!E(n,e,r))||!(0!==o||!E(n,t,r)))))}function E(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function z(e){return e>0?1:e<0?-1:0}function F(e,t){return M(e.prev,e,e.next)<0?M(e,t,e.next)>=0&&M(e,e.prev,t)>=0:M(e,t,e.prev)<0||M(e,e.next,t)<0}function I(e,t){var n=new _(e.i,e.x,e.y),r=new _(t.i,t.x,t.y),x=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=x,x.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function P(e,t,n,r){var x=new _(e,t,n);return r?(x.next=r.next,x.prev=r,r.next.prev=x,r.next=x):(x.prev=x,x.next=x),x}function B(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function _(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(e,t,n,r){for(var x=0,i=t,u=n-r;i<n;i+=r)x+=(e[u]-e[i])*(e[i+1]+e[u+1]),u=i;return x}u.exports=o,u.exports.default=o,o.deviation=function(e,t,n,r){var x=t&&t.length,i=x?t[0]*n:e.length,u=Math.abs(O(e,0,i,n));if(x)for(var o=0,f=t.length;o<f;o++){var s=t[o]*n,a=o<f-1?t[o+1]*n:e.length;u-=Math.abs(O(e,s,a,n))}var l=0;for(o=0;o<r.length;o+=3){var v=r[o]*n,c=r[o+1]*n,h=r[o+2]*n;l+=Math.abs((e[v]-e[h])*(e[c+1]-e[v+1])-(e[v]-e[c])*(e[h+1]-e[v+1]))}return 0===u&&0===l?0:Math.abs((l-u)/u)},o.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,x=0;x<e.length;x++){for(var i=0;i<e[x].length;i++)for(var u=0;u<t;u++)n.vertices.push(e[x][i][u]);x>0&&(r+=e[x-1].length,n.holes.push(r))}return n};var N=i(u.exports);const R=[],S={vertexPosition:0,indexPosition:0};function T(e,t,n,r,x){e[t+0]=n,e[t+1]=r,e[t+2]=x}function U(e,t,n,r,x,i){const u=3+x,o=e[t+0],f=e[t+1],s=R;s.length=x;for(let n=0;n<s.length;n++)s[n]=e[t+2+n];let a=i?i.vertexPosition:0,l=i?i.indexPosition:0;const v=a/u;return T(n,a,o,f,0),s.length&&n.set(s,a+3),a+=u,T(n,a,o,f,1),s.length&&n.set(s,a+3),a+=u,T(n,a,o,f,2),s.length&&n.set(s,a+3),a+=u,T(n,a,o,f,3),s.length&&n.set(s,a+3),a+=u,r[l++]=v,r[l++]=v+1,r[l++]=v+3,r[l++]=v+1,r[l++]=v+2,r[l++]=v+3,S.vertexPosition=a,S.indexPosition=l,S}function k(e,t,n,x,i,u,o,f,s,a){const l=8+f.length,v=u.length/l,c=[e[t+0],e[t+1]],h=[e[n],e[n+1]],p=r(s,[...c]),y=r(s,[...h]);function g(e,t,n){const r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),x=[(t[0]-e[0])/r,(t[1]-e[1])/r],i=[-x[1],x[0]],u=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),o=[(n[0]-e[0])/u,(n[1]-e[1])/u],f=0===r||0===u?0:Math.acos((s=o[0]*x[0]+o[1]*x[1],a=-1,l=1,Math.min(Math.max(s,a),l)));var s,a,l;return o[0]*i[0]+o[1]*i[1]>0?f:2*Math.PI-f}let b=-1,d=-1;const Z=null!==i;if(null!==x){b=g(p,y,r(s,[...[e[x],e[x+1]]]))}if(Z){d=g(y,p,r(s,[...[e[i],e[i+1]]]))}return u.push(c[0],c[1],h[0],h[1],b,d,a,0),u.push(...f),u.push(c[0],c[1],h[0],h[1],b,d,a,1),u.push(...f),u.push(c[0],c[1],h[0],h[1],b,d,a,2),u.push(...f),u.push(c[0],c[1],h[0],h[1],b,d,a,3),u.push(...f),o.push(v,v+1,v+2,v+1,v+3,v+2),a+Math.sqrt((y[0]-p[0])*(y[0]-p[0])+(y[1]-p[1])*(y[1]-p[1]))}function G(e,t,n,r,x){const i=2+x;let u=t;const o=e.slice(u,u+x);u+=x;const f=e[u++];let s=0;const a=new Array(f-1);for(let t=0;t<f;t++)s+=e[u++],t<f-1&&(a[t]=s);const l=e.slice(u,u+2*s),v=N(l,a,2);for(let e=0;e<v.length;e++)r.push(v[e]+n.length/i);for(let e=0;e<l.length;e+=2)n.push(l[e],l[e+1],...o);return u+2*s}const j=self;j.onmessage=r=>{const i=r.data;switch(i.type){case t:{const e=3,t=2,n=i.customAttributesSize,r=t+n,x=new Float32Array(i.renderInstructions),u=x.length/r,o=4*u*(n+e),f=new Uint32Array(6*u),s=new Float32Array(o);let a;for(let e=0;e<x.length;e+=r)a=U(x,e,s,f,n,a);const l=Object.assign({vertexBuffer:s.buffer,indexBuffer:f.buffer,renderInstructions:x.buffer},i);j.postMessage(l,[s.buffer,f.buffer,x.buffer]);break}case n:{const e=[],t=[],n=i.customAttributesSize,r=2,u=new Float32Array(i.renderInstructions);let o=0;const f=[1,0,0,1,0,0];let s,a;for(x(f,i.renderInstructionsTransform);o<u.length;){a=Array.from(u.slice(o,o+n)),o+=n,s=u[o++];const x=o,i=o+(s-1)*r,l=u[x]===u[i]&&u[x+1]===u[i+1];let v=0;for(let n=0;n<s-1;n++){let c=null;n>0?c=o+(n-1)*r:l&&(c=i-r);let h=null;n<s-2?h=o+(n+2)*r:l&&(h=x+r),v=k(u,o+n*r,o+(n+1)*r,c,h,e,t,a,f,v)}o+=s*r}const l=Uint32Array.from(t),v=Float32Array.from(e),c=Object.assign({vertexBuffer:v.buffer,indexBuffer:l.buffer,renderInstructions:u.buffer},i);j.postMessage(c,[v.buffer,l.buffer,u.buffer]);break}case e:{const e=[],t=[],n=i.customAttributesSize,r=new Float32Array(i.renderInstructions);let x=0;for(;x<r.length;)x=G(r,x,e,t,n);const u=Uint32Array.from(t),o=Float32Array.from(e),f=Object.assign({vertexBuffer:o.buffer,indexBuffer:u.buffer,renderInstructions:r.buffer},i);j.postMessage(f,[o.buffer,u.buffer,r.buffer]);break}}};';return new Worker(typeof Blob>"u"?"data:application/javascript;base64,"+Buffer.from(r,"binary").toString("base64"):URL.createObjectURL(new Blob([r],{type:"application/javascript"})))}class Dx extends Sx{constructor(t,e){const i=e.uniforms||{},n=Vt();i[ai.PROJECTION_MATRIX]=n,super(t,{uniforms:i,postProcesses:e.postProcesses}),this.sourceRevision_=-1,this.verticesBuffer_=new cd(Ll,Tl),this.indicesBuffer_=new cd(bl,Tl),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.program_,this.hitDetectionEnabled_=e.hitDetectionEnabled??!0;const o=e.attributes?e.attributes.map(function(h){return{name:"a_"+h.name,size:1,type:li.FLOAT}}):[];this.attributes=[{name:"a_position",size:2,type:li.FLOAT},{name:"a_index",size:1,type:li.FLOAT}],this.hitDetectionEnabled_&&(this.attributes.push({name:"a_hitColor",size:4,type:li.FLOAT}),this.attributes.push({name:"a_featureUid",size:1,type:li.FLOAT})),this.attributes.push(...o),this.customAttributes=e.attributes?e.attributes:[],this.previousExtent_=ge(),this.currentTransform_=n,this.renderTransform_=Vt(),this.invertRenderTransform_=Vt(),this.renderInstructions_=new Float32Array(0),this.hitRenderTarget_,this.lastSentId=0,this.worker_=Ix(),this.worker_.addEventListener("message",h=>{const c=h.data;if(c.type===_d.GENERATE_POINT_BUFFERS){const d=c.projectionTransform;this.verticesBuffer_.fromArrayBuffer(c.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_),this.indicesBuffer_.fromArrayBuffer(c.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=d,js(this.invertRenderTransform_,this.renderTransform_),this.renderInstructions_=new Float32Array(h.data.renderInstructions),c.id===this.lastSentId&&(this.ready=!0),this.getLayer().changed()}}),this.featureCache_={},this.featureCount_=0;const a=this.getLayer().getSource();this.sourceListenKeys_=[ut(a,ee.ADDFEATURE,this.handleSourceFeatureAdded_,this),ut(a,ee.CHANGEFEATURE,this.handleSourceFeatureChanged_,this),ut(a,ee.REMOVEFEATURE,this.handleSourceFeatureDelete_,this),ut(a,ee.CLEAR,this.handleSourceFeatureClear_,this)],a.forEachFeature(h=>{this.featureCache_[ht(h)]={feature:h,properties:h.getProperties(),geometry:h.getGeometry()},this.featureCount_++})}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitRenderTarget_=new kx(this.helper))}handleSourceFeatureAdded_(t){const e=t.feature;this.featureCache_[ht(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++}handleSourceFeatureChanged_(t){const e=t.feature;this.featureCache_[ht(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}}handleSourceFeatureDelete_(t){const e=t.feature;delete this.featureCache_[ht(e)],this.featureCount_--}handleSourceFeatureClear_(){this.featureCache_={},this.featureCount_=0}renderFrame(t){const e=this.helper.getGL();this.preRender(e,t);const[i,n,o]=this.getWorldParameters_(t);this.renderWorlds(t,!1,i,n,o),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);const a=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderWorlds(t,!0,i,n,o),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),a}getWorldParameters_(t){const e=t.viewState.projection,o=this.getLayer().getSource().getWrapX()&&e.canWrapX(),a=e.getExtent(),h=t.extent,c=o?Tt(a):null,d=o?Math.ceil((h[2]-a[2])/c)+1:1;return[o?Math.floor((h[0]-a[0])/c):0,d,c]}prepareFrameInternal(t){const e=this.getLayer(),i=e.getSource(),n=t.viewState,o=!t.viewHints[Ut.ANIMATING]&&!t.viewHints[Ut.INTERACTING],a=!Sn(this.previousExtent_,t.extent),h=this.sourceRevision_<i.getRevision();if(h&&(this.sourceRevision_=i.getRevision()),o&&(a||h)){const c=n.projection,d=n.resolution,f=e instanceof El?e.getRenderBuffer():0,p=Rs(t.extent,f*d);i.loadFeatures(p,d,c),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.useProgram(this.program_,t),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0}rebuildBuffers_(t){const e=Vt();this.helper.makeProjectionTransform(t,e);const n=(this.hitDetectionEnabled_?7:2)+this.customAttributes.length,o=n*this.featureCount_;(!this.renderInstructions_||this.renderInstructions_.length!==o)&&(this.renderInstructions_=new Float32Array(o));let a,h;const c=[],d=[];let f=-1;for(const m in this.featureCache_)if(a=this.featureCache_[m],h=a.geometry,!(!h||h.getType()!=="Point")){if(c[0]=h.getFlatCoordinates()[0],c[1]=h.getFlatCoordinates()[1],Ot(e,c),this.renderInstructions_[++f]=c[0],this.renderInstructions_[++f]=c[1],this.hitDetectionEnabled_){const y=Rx(f+5,d);this.renderInstructions_[++f]=y[0],this.renderInstructions_[++f]=y[1],this.renderInstructions_[++f]=y[2],this.renderInstructions_[++f]=y[3],this.renderInstructions_[++f]=Number(m)}for(let y=0;y<this.customAttributes.length;y++){const v=this.customAttributes[y].callback(a.feature,a.properties);this.renderInstructions_[++f]=v}}const p={id:++this.lastSentId,type:_d.GENERATE_POINT_BUFFERS,renderInstructions:this.renderInstructions_.buffer,customAttributesSize:n-2};p.projectionTransform=e,this.ready=!1,this.worker_.postMessage(p,[this.renderInstructions_.buffer]),this.renderInstructions_=null}forEachFeatureAtCoordinate(t,e,i,n,o){if(gt(this.hitDetectionEnabled_,"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has not been enabled. This is done by providing adequate shaders using the `hitVertexShader` and `hitFragmentShader` properties of `WebGLPointsLayerRenderer`"),!this.renderInstructions_||!this.hitDetectionEnabled_)return;const a=Ot(e.coordinateToPixelTransform,t.slice()),h=this.hitRenderTarget_.readPixel(a[0]/2,a[1]/2),c=[h[0]/255,h[1]/255,h[2]/255,h[3]/255],d=Ax(c),f=this.renderInstructions_[d],p=Math.floor(f).toString(),y=this.getLayer().getSource().getFeatureByUid(p);if(y)return n(y,this.getLayer(),null)}renderWorlds(t,e,i,n,o){let a=i;this.helper.useProgram(this.program_,t),e&&(this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0)),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes);do{this.helper.makeProjectionTransform(t,this.currentTransform_),Sm(this.currentTransform_,a*o,0),Qc(this.currentTransform_,this.invertRenderTransform_),this.helper.applyUniforms(t),this.helper.applyHitDetectionUniform(e);const h=this.indicesBuffer_.getSize();this.helper.drawElements(0,h)}while(++a<n)}disposeInternal(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach(function(t){Et(t)}),this.sourceListenKeys_=null,super.disposeInternal()}}const Ox=Dx,Fx=.5;class zx extends Cs{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.interimTile=null,this.key="",this.transition_=i.transition===void 0?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(ot.CHANGE)}release(){this.state===$.ERROR&&this.setState($.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getInterimTile(){if(!this.interimTile)return this;let t=this.interimTile;do{if(t.getState()==$.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this}refreshInterimChain(){if(!this.interimTile)return;let t=this.interimTile,e=this;do{if(t.getState()==$.LOADED){t.interimTile=null;break}else t.getState()==$.LOADING?e=t:t.getState()==$.IDLE?e.interimTile=t.interimTile:e=t;t=e.interimTile}while(t)}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==$.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){nt()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(!i)i=e,this.transitionStarts_[t]=i;else if(i===-1)return 1;const n=e-i+1e3/60;return n>=this.transition_?1:Xc(n/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}}const md=zx,Nx=10,yd=.25;class Bx{constructor(t,e,i,n,o,a){this.sourceProj_=t,this.targetProj_=e;let h={};const c=Us(this.targetProj_,this.sourceProj_);this.transformInv_=function(w){const b=w[0]+"/"+w[1];return h[b]||(h[b]=c(w)),h[b]},this.maxSourceExtent_=n,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&Tt(n)>=Tt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Tt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Tt(this.targetProj_.getExtent()):null;const d=qi(i),f=Os(i),p=Ds(i),m=Is(i),y=this.transformInv_(d),v=this.transformInv_(f),E=this.transformInv_(p),C=this.transformInv_(m),S=Nx+(a?Math.max(0,Math.ceil(Math.log2(Ma(i)/(a*a*256*256)))):0);if(this.addQuad_(d,f,p,m,y,v,E,C,S),this.wrapsXInSource_){let w=1/0;this.triangles_.forEach(function(b,T,P){w=Math.min(w,b.source[0][0],b.source[1][0],b.source[2][0])}),this.triangles_.forEach(b=>{if(Math.max(b.source[0][0],b.source[1][0],b.source[2][0])-w>this.sourceWorldWidth_/2){const T=[[b.source[0][0],b.source[0][1]],[b.source[1][0],b.source[1][1]],[b.source[2][0],b.source[2][1]]];T[0][0]-w>this.sourceWorldWidth_/2&&(T[0][0]-=this.sourceWorldWidth_),T[1][0]-w>this.sourceWorldWidth_/2&&(T[1][0]-=this.sourceWorldWidth_),T[2][0]-w>this.sourceWorldWidth_/2&&(T[2][0]-=this.sourceWorldWidth_);const P=Math.min(T[0][0],T[1][0],T[2][0]);Math.max(T[0][0],T[1][0],T[2][0])-P<this.sourceWorldWidth_/2&&(b.source=T)}})}h={}}addTriangle_(t,e,i,n,o,a){this.triangles_.push({source:[n,o,a],target:[t,e,i]})}addQuad_(t,e,i,n,o,a,h,c,d){const f=Cc([o,a,h,c]),p=this.sourceWorldWidth_?Tt(f)/this.sourceWorldWidth_:null,m=this.sourceWorldWidth_,y=this.sourceProj_.canWrapX()&&p>.5&&p<1;let v=!1;if(d>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const C=Cc([t,e,i,n]);v=Tt(C)/this.targetWorldWidth_>yd||v}!y&&this.sourceProj_.isGlobal()&&p&&(v=p>yd||v)}if(!v&&this.maxSourceExtent_&&isFinite(f[0])&&isFinite(f[1])&&isFinite(f[2])&&isFinite(f[3])&&!se(f,this.maxSourceExtent_))return;let E=0;if(!v&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(h[0])||!isFinite(h[1])||!isFinite(c[0])||!isFinite(c[1]))){if(d>0)v=!0;else if(E=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(h[0])||!isFinite(h[1])?2:0)+(!isFinite(c[0])||!isFinite(c[1])?1:0),E!=1&&E!=2&&E!=4&&E!=8)return}if(d>0){if(!v){const C=[(t[0]+i[0])/2,(t[1]+i[1])/2],S=this.transformInv_(C);let w;y?w=(Pn(o[0],m)+Pn(h[0],m))/2-Pn(S[0],m):w=(o[0]+h[0])/2-S[0];const b=(o[1]+h[1])/2-S[1];v=w*w+b*b>this.errorThresholdSquared_}if(v){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){const C=[(e[0]+i[0])/2,(e[1]+i[1])/2],S=this.transformInv_(C),w=[(n[0]+t[0])/2,(n[1]+t[1])/2],b=this.transformInv_(w);this.addQuad_(t,e,C,w,o,a,S,b,d-1),this.addQuad_(w,C,i,n,b,S,h,c,d-1)}else{const C=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(C),w=[(i[0]+n[0])/2,(i[1]+n[1])/2],b=this.transformInv_(w);this.addQuad_(t,C,w,n,o,S,b,c,d-1),this.addQuad_(C,e,i,w,S,a,h,b,d-1)}return}}if(y){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}E&11||this.addTriangle_(t,i,n,o,h,c),E&14||this.addTriangle_(t,i,e,o,h,a),E&&(E&13||this.addTriangle_(e,n,t,a,c,o),E&7||this.addTriangle_(e,n,i,a,c,h))}calculateSourceExtent(){const t=ge();return this.triangles_.forEach(function(e,i,n){const o=e.source;vr(t,o[0]),vr(t,o[1]),vr(t,o[2])}),t}getTriangles(){return this.triangles_}}const Gx=Bx;let Sl;const Bn=[];function vd(r,t,e,i,n){r.beginPath(),r.moveTo(0,0),r.lineTo(t,e),r.lineTo(i,n),r.closePath(),r.save(),r.clip(),r.fillRect(0,0,Math.max(t,i)+1,Math.max(e,n)),r.restore()}function Pl(r,t){return Math.abs(r[t*4]-210)>2||Math.abs(r[t*4+3]-.75*255)>2}function Ux(){if(Sl===void 0){const r=Jt(6,6,Bn);r.globalCompositeOperation="lighter",r.fillStyle="rgba(210, 0, 0, 0.75)",vd(r,4,5,4,0),vd(r,4,5,0,5);const t=r.getImageData(0,0,3,3).data;Sl=Pl(t,0)||Pl(t,4)||Pl(t,8),to(r),Bn.push(r.canvas)}return Sl}function xd(r,t,e,i){const n=jc(e,t,r);let o=Bc(t,i,e);const a=t.getMetersPerUnit();a!==void 0&&(o*=a);const h=r.getMetersPerUnit();h!==void 0&&(o/=h);const c=r.getExtent();if(!c||As(c,n)){const d=Bc(r,o,n)/o;isFinite(d)&&d>0&&(o/=d)}return o}function jx(r,t,e,i){const n=Ki(e);let o=xd(r,t,n,i);return(!isFinite(o)||o<=0)&&Rc(e,function(a){return o=xd(r,t,a,i),isFinite(o)&&o>0}),o}function Zx(r,t,e,i,n,o,a,h,c,d,f,p){const m=Jt(Math.round(e*r),Math.round(e*t),Bn);if(p||(m.imageSmoothingEnabled=!1),c.length===0)return m.canvas;m.scale(e,e);function y(T){return Math.round(T*e)/e}m.globalCompositeOperation="lighter";const v=ge();c.forEach(function(T,P,R){Pc(v,T.extent)});const E=Tt(v),C=Fe(v),S=Jt(Math.round(e*E/i),Math.round(e*C/i),Bn);p||(S.imageSmoothingEnabled=!1);const w=e/i;c.forEach(function(T,P,R){const I=T.extent[0]-v[0],O=-(T.extent[3]-v[3]),U=Tt(T.extent),X=Fe(T.extent);T.image.width>0&&T.image.height>0&&S.drawImage(T.image,d,d,T.image.width-2*d,T.image.height-2*d,I*w,O*w,U*w,X*w)});const b=qi(a);return h.getTriangles().forEach(function(T,P,R){const I=T.source,O=T.target;let U=I[0][0],X=I[0][1],q=I[1][0],Y=I[1][1],rt=I[2][0],pt=I[2][1];const V=y((O[0][0]-b[0])/o),H=y(-(O[0][1]-b[1])/o),G=y((O[1][0]-b[0])/o),N=y(-(O[1][1]-b[1])/o),vt=y((O[2][0]-b[0])/o),Z=y(-(O[2][1]-b[1])/o),at=U,z=X;U=0,X=0,q-=at,Y-=z,rt-=at,pt-=z;const Lt=[[q,Y,0,0,G-V],[rt,pt,0,0,vt-V],[0,0,q,Y,N-H],[0,0,rt,pt,Z-H]],tt=sm(Lt);if(tt){if(m.save(),m.beginPath(),Ux()||!p){m.moveTo(G,N);const J=4,st=V-G,Ft=H-N;for(let Mt=0;Mt<J;Mt++)m.lineTo(G+y((Mt+1)*st/J),N+y(Mt*Ft/(J-1))),Mt!=J-1&&m.lineTo(G+y((Mt+1)*st/J),N+y((Mt+1)*Ft/(J-1)));m.lineTo(vt,Z)}else m.moveTo(G,N),m.lineTo(V,H),m.lineTo(vt,Z);m.clip(),m.transform(tt[0],tt[2],tt[1],tt[3],V,H),m.translate(v[0]-at,v[3]-z),m.scale(i/e,-i/e),m.drawImage(S.canvas,0,0),m.restore()}}),to(S),Bn.push(S.canvas),f&&(m.save(),m.globalCompositeOperation="source-over",m.strokeStyle="black",m.lineWidth=1,h.getTriangles().forEach(function(T,P,R){const I=T.target,O=(I[0][0]-b[0])/o,U=-(I[0][1]-b[1])/o,X=(I[1][0]-b[0])/o,q=-(I[1][1]-b[1])/o,Y=(I[2][0]-b[0])/o,rt=-(I[2][1]-b[1])/o;m.beginPath(),m.moveTo(X,q),m.lineTo(O,U),m.lineTo(Y,rt),m.closePath(),m.stroke()}),m.restore()),m.canvas}class Wx extends md{constructor(t,e,i,n,o,a,h,c,d,f,p,m){super(o,$.IDLE,{interpolate:!!m}),this.renderEdges_=p!==void 0?p:!1,this.pixelRatio_=h,this.gutter_=c,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=n,this.wrappedTileCoord_=a||o,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const y=n.getTileCoordExtent(this.wrappedTileCoord_),v=this.targetTileGrid_.getExtent();let E=this.sourceTileGrid_.getExtent();const C=v?xr(y,v):y;if(Ma(C)===0){this.state=$.EMPTY;return}const S=t.getExtent();S&&(E?E=xr(E,S):E=S);const w=n.getResolution(this.wrappedTileCoord_[0]),b=jx(t,i,C,w);if(!isFinite(b)||b<=0){this.state=$.EMPTY;return}const T=f!==void 0?f:Fx;if(this.triangulation_=new Gx(t,i,C,E,b*T,w),this.triangulation_.getTriangles().length===0){this.state=$.EMPTY;return}this.sourceZ_=e.getZForResolution(b);let P=this.triangulation_.calculateSourceExtent();if(E&&(t.canWrapX()?(P[1]=At(P[1],E[1],E[3]),P[3]=At(P[3],E[1],E[3])):P=xr(P,E)),!Ma(P))this.state=$.EMPTY;else{const R=e.getTileRangeForExtentAndZ(P,this.sourceZ_);for(let I=R.minX;I<=R.maxX;I++)for(let O=R.minY;O<=R.maxY;O++){const U=d(this.sourceZ_,I,O,h);U&&this.sourceTiles_.push(U)}this.sourceTiles_.length===0&&(this.state=$.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{e&&e.getState()==$.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}),this.sourceTiles_.length=0,t.length===0)this.state=$.ERROR;else{const e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n=typeof i=="number"?i:i[0],o=typeof i=="number"?i:i[1],a=this.targetTileGrid_.getResolution(e),h=this.sourceTileGrid_.getResolution(this.sourceZ_),c=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Zx(n,o,this.pixelRatio_,h,this.sourceTileGrid_.getExtent(),a,c,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=$.LOADED}this.changed()}load(){if(this.state==$.IDLE){this.state=$.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(e=>{const i=e.getState();if(i==$.IDLE||i==$.LOADING){t++;const n=ut(e,ot.CHANGE,function(o){const a=e.getState();(a==$.LOADED||a==$.ERROR||a==$.EMPTY)&&(Et(n),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(n)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(e,i,n){e.getState()==$.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(Et),this.sourcesListenerKeys_=null}release(){this.canvas_&&(to(this.canvas_.getContext("2d")),Bn.push(this.canvas_),this.canvas_=null),super.release()}}const kl=Wx;class Hx extends md{constructor(t,e,i,n,o,a){super(t,e,a),this.crossOrigin_=n,this.src_=i,this.key=i,this.image_=new Image,n!==null&&(this.image_.crossOrigin=n),this.unlisten_=null,this.tileLoadFunction_=o}getImage(){return this.image_}setImage(t){this.image_=t,this.state=$.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=$.ERROR,this.unlistenImage_(),this.image_=Vx(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=$.LOADED:this.state=$.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==$.ERROR&&(this.state=$.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==$.IDLE&&(this.state=$.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Sv(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function Vx(){const r=Jt(1,1);return r.fillStyle="rgba(0,0,0,0)",r.fillRect(0,0,1,1),r.canvas}const wd=Hx;class Xx{constructor(t){this.highWaterMark=t!==void 0?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const i=this.entries_[t];return gt(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(t){const e=this.entries_[t];return gt(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.key_;return t}getValues(){const t=new Array(this.count_);let e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){if(this.containsKey(t))return this.entries_[t].value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){gt(!(t in this.entries_),"Tried to set a value for a key that is used already");const i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_}setSize(t){this.highWaterMark=t}}const Yx=Xx;class Ed{constructor(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function Gn(r,t,e,i,n){return n!==void 0?(n.minX=r,n.maxX=t,n.minY=e,n.maxY=i,n):new Ed(r,t,e,i)}const Ld=Ed;function bd(r,t,e,i){return i!==void 0?(i[0]=r,i[1]=t,i[2]=e,i):[r,t,e]}function vo(r,t,e){return r+"/"+t+"/"+e}function Td(r){return vo(r[0],r[1],r[2])}function Kx(r){return r.split("/").map(Number)}function qx(r){return(r[1]<<r[0])+r[2]}function Jx(r,t){const e=r[0],i=r[1],n=r[2];if(t.getMinZoom()>e||e>t.getMaxZoom())return!1;const o=t.getFullTileRange(e);return o?o.containsXY(i,n):!0}function Nr(r){const t=r.toString();return t.includes(".")?t:t+".0"}function Qx(r){if(r.length<2||r.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return`vec${r.length}(${r.map(Nr).join(", ")})`}function Rl(r){const t=Lr(r),e=t.length>3?t[3]:1;return Qx([t[0]/255*e,t[1]/255*e,t[2]/255*e,e])}const Al={};let $x=0;function t0(r){return r in Al||(Al[r]=$x++),Al[r]}function Un(r){return Nr(t0(r))}function e0(){return{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"#3399CC","stroke-width":1.25,"circle-radius":5,"circle-fill-color":"rgba(255,255,255,0.4)","circle-stroke-width":1.25,"circle-stroke-color":"#3399CC"}}const jn=`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
45
|
+
`;class Q0{constructor(t){this.gl_=t.webGlContext;const e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer(),this.depthBuffer_=e.createRenderbuffer();const i=e.createShader(e.VERTEX_SHADER);e.shaderSource(i,t.vertexShader||q0),e.compileShader(i);const n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,t.fragmentShader||J0),e.compileShader(n),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,i),e.attachShader(this.renderTargetProgram_,n),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer();const s=[-1,-1,1,-1,-1,1,1,-1,1,1,-1,1];e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array(s),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(a=>{this.uniforms_.push({value:t.uniforms[a],location:e.getUniformLocation(this.renderTargetProgram_,a)})})}getGL(){return this.gl_}init(t){const e=this.getGL(),i=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.bindRenderbuffer(e.RENDERBUFFER,this.getDepthBuffer()),e.viewport(0,0,i[0],i[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==i[0]||this.renderTargetTextureSize_[1]!==i[1]){this.renderTargetTextureSize_=i;const n=0,s=e.RGBA,a=0,h=e.RGBA,c=e.UNSIGNED_BYTE,d=null;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,n,s,i[0],i[1],a,h,c,d),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,i[0],i[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthBuffer_)}}apply(t,e,i,n){const s=this.getGL(),a=t.size;if(s.bindFramebuffer(s.FRAMEBUFFER,e?e.getFrameBuffer():null),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,this.renderTargetTexture_),!e){const c=ct(s.canvas);if(!t.renderTargets[c]){const d=s.getContextAttributes();d&&d.preserveDrawingBuffer&&(s.clearColor(0,0,0,0),s.clearDepth(1),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT)),t.renderTargets[c]=!0}}s.disable(s.DEPTH_TEST),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA),s.viewport(0,0,s.drawingBufferWidth,s.drawingBufferHeight),s.bindBuffer(s.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),s.useProgram(this.renderTargetProgram_),s.enableVertexAttribArray(this.renderTargetAttribLocation_),s.vertexAttribPointer(this.renderTargetAttribLocation_,2,s.FLOAT,!1,0,0),s.uniform2f(this.renderTargetUniformLocation_,a[0],a[1]),s.uniform1i(this.renderTargetTextureLocation_,0);const h=t.layerStatesArray[t.layerIndex].opacity;s.uniform1f(this.renderTargetOpacityLocation_,h),this.applyUniforms(t),i&&i(s,t),s.drawArrays(s.TRIANGLES,0,6),n&&n(s,t)}getFrameBuffer(){return this.frameBuffer_}getDepthBuffer(){return this.depthBuffer_}applyUniforms(t){const e=this.getGL();let i,n=1;this.uniforms_.forEach(function(s){if(i=typeof s.value=="function"?s.value(t):s.value,i instanceof HTMLCanvasElement||i instanceof ImageData)s.texture||(s.texture=e.createTexture()),e.activeTexture(e[`TEXTURE${n}`]),e.bindTexture(e.TEXTURE_2D,s.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),i instanceof ImageData?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,i.width,i.height,0,e.UNSIGNED_BYTE,new Uint8Array(i.data)):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i),e.uniform1i(s.location,n++);else if(Array.isArray(i))switch(i.length){case 2:e.uniform2f(s.location,i[0],i[1]);return;case 3:e.uniform3f(s.location,i[0],i[1],i[2]);return;case 4:e.uniform4f(s.location,i[0],i[1],i[2],i[3]);return;default:return}else typeof i=="number"&&e.uniform1f(s.location,i)})}}const zd=Q0;function $0(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function tx(r,t){return r[0]=t[0],r[1]=t[1],r[4]=t[2],r[5]=t[3],r[12]=t[4],r[13]=t[5],r}const pi={PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution",ROTATION:"u_rotation",VIEWPORT_SIZE_PX:"u_viewportSizePx",PIXEL_RATIO:"u_pixelRatio",HIT_DETECTION:"u_hitDetection"},_i={UNSIGNED_BYTE:Z0,UNSIGNED_SHORT:W0,UNSIGNED_INT:H0,FLOAT:Id},Oo={};function Nd(r){return"shared/"+r}let Bd=0;function ex(){const r="unique/"+Bd;return Bd+=1,r}function ix(r){let t=Oo[r];if(!t){const e=document.createElement("canvas");e.width=1,e.height=1,e.style.position="absolute",e.style.left="0",t={users:0,context:V0(e)},Oo[r]=t}return t.users+=1,t.context}function nx(r){const t=Oo[r];if(!t||(t.users-=1,t.users>0))return;const e=t.context,i=e.getExtension("WEBGL_lose_context");i&&i.loseContext();const n=e.canvas;n.width=1,n.height=1,delete Oo[r]}class rx extends Gs{constructor(t){super(),t=t||{},this.boundHandleWebGLContextLost_=this.handleWebGLContextLost.bind(this),this.boundHandleWebGLContextRestored_=this.handleWebGLContextRestored.bind(this),this.canvasCacheKey_=t.canvasCacheKey?Nd(t.canvasCacheKey):ex(),this.gl_=ix(this.canvasCacheKey_),this.bufferCache_={},this.extensionCache_={},this.currentProgram_=null,this.needsToBeRecreated_=!1;const e=this.gl_.canvas;e.addEventListener(Do.LOST,this.boundHandleWebGLContextLost_),e.addEventListener(Do.RESTORED,this.boundHandleWebGLContextRestored_),this.offsetRotateMatrix_=Ht(),this.offsetScaleMatrix_=Ht(),this.tmpMat4_=$0(),this.uniformLocationsByProgram_={},this.attribLocationsByProgram_={},this.uniforms_=[],t.uniforms&&this.setUniforms(t.uniforms),this.postProcessPasses_=t.postProcesses?t.postProcesses.map(i=>new zd({webGlContext:this.gl_,scaleRatio:i.scaleRatio,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,uniforms:i.uniforms})):[new zd({webGlContext:this.gl_})],this.shaderCompileErrors_=null,this.startTime_=Date.now()}setUniforms(t){this.uniforms_=[],this.addUniforms(t)}addUniforms(t){for(const e in t)this.uniforms_.push({name:e,value:t[e]})}canvasCacheKeyMatches(t){return this.canvasCacheKey_===Nd(t)}getExtension(t){if(t in this.extensionCache_)return this.extensionCache_[t];const e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e}bindBuffer(t){const e=this.gl_,i=ct(t);let n=this.bufferCache_[i];if(!n){const s=e.createBuffer();n={buffer:t,webGlBuffer:s},this.bufferCache_[i]=n}e.bindBuffer(t.getType(),n.webGlBuffer)}flushBufferData(t){const e=this.gl_;this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())}deleteBuffer(t){const e=this.gl_,i=ct(t),n=this.bufferCache_[i];n&&!e.isContextLost()&&e.deleteBuffer(n.webGlBuffer),delete this.bufferCache_[i]}disposeInternal(){const t=this.gl_.canvas;t.removeEventListener(Do.LOST,this.boundHandleWebGLContextLost_),t.removeEventListener(Do.RESTORED,this.boundHandleWebGLContextRestored_),nx(this.canvasCacheKey_),delete this.gl_}prepareDraw(t,e,i){const n=this.gl_,s=this.getCanvas(),a=t.size,h=t.pixelRatio;(s.width!==a[0]*h||s.height!==a[1]*h)&&(s.width=a[0]*h,s.height=a[1]*h,s.style.width=a[0]+"px",s.style.height=a[1]+"px");for(let c=this.postProcessPasses_.length-1;c>=0;c--)this.postProcessPasses_[c].init(t);n.bindTexture(n.TEXTURE_2D,null),n.clearColor(0,0,0,0),n.depthRange(0,1),n.clearDepth(1),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,e?n.ZERO:n.ONE_MINUS_SRC_ALPHA),i?(n.enable(n.DEPTH_TEST),n.depthFunc(n.LEQUAL)):n.disable(n.DEPTH_TEST)}bindTexture(t,e,i){const n=this.gl_;n.activeTexture(n.TEXTURE0+e),n.bindTexture(n.TEXTURE_2D,t),n.uniform1i(this.getUniformLocation(i),e)}prepareDrawToRenderTarget(t,e,i,n){const s=this.gl_,a=e.getSize();s.bindFramebuffer(s.FRAMEBUFFER,e.getFramebuffer()),s.bindRenderbuffer(s.RENDERBUFFER,e.getDepthbuffer()),s.viewport(0,0,a[0],a[1]),s.bindTexture(s.TEXTURE_2D,e.getTexture()),s.clearColor(0,0,0,0),s.depthRange(0,1),s.clearDepth(1),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.enable(s.BLEND),s.blendFunc(s.ONE,i?s.ZERO:s.ONE_MINUS_SRC_ALPHA),n?(s.enable(s.DEPTH_TEST),s.depthFunc(s.LEQUAL)):s.disable(s.DEPTH_TEST)}drawElements(t,e){const i=this.gl_;this.getExtension("OES_element_index_uint");const n=i.UNSIGNED_INT,s=4,a=e-t,h=t*s;i.drawElements(i.TRIANGLES,a,n,h)}finalizeDraw(t,e,i){for(let n=0,s=this.postProcessPasses_.length;n<s;n++)n===s-1?this.postProcessPasses_[n].apply(t,null,e,i):this.postProcessPasses_[n].apply(t,this.postProcessPasses_[n+1])}getCanvas(){return this.gl_.canvas}getGL(){return this.gl_}applyFrameState(t){const e=t.size,i=t.viewState.rotation,n=t.pixelRatio;this.setUniformFloatValue(pi.TIME,(Date.now()-this.startTime_)*.001),this.setUniformFloatValue(pi.ZOOM,t.viewState.zoom),this.setUniformFloatValue(pi.RESOLUTION,t.viewState.resolution),this.setUniformFloatValue(pi.PIXEL_RATIO,n),this.setUniformFloatVec2(pi.VIEWPORT_SIZE_PX,[e[0],e[1]]),this.setUniformFloatValue(pi.ROTATION,i)}applyHitDetectionUniform(t){const e=this.getUniformLocation(pi.HIT_DETECTION);this.getGL().uniform1i(e,t?1:0),t&&this.setUniformFloatValue(pi.PIXEL_RATIO,.5)}applyUniforms(t){const e=this.gl_;let i,n=0;this.uniforms_.forEach(s=>{if(i=typeof s.value=="function"?s.value(t):s.value,i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof ImageData)s.texture||(s.prevValue=void 0,s.texture=e.createTexture()),this.bindTexture(s.texture,n,s.name),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),(!(i instanceof HTMLImageElement)||i.complete)&&s.prevValue!==i&&(s.prevValue=i,e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i)),n++;else if(Array.isArray(i)&&i.length===6)this.setUniformMatrixValue(s.name,tx(this.tmpMat4_,i));else if(Array.isArray(i)&&i.length<=4)switch(i.length){case 2:e.uniform2f(this.getUniformLocation(s.name),i[0],i[1]);return;case 3:e.uniform3f(this.getUniformLocation(s.name),i[0],i[1],i[2]);return;case 4:e.uniform4f(this.getUniformLocation(s.name),i[0],i[1],i[2],i[3]);return;default:return}else typeof i=="number"&&e.uniform1f(this.getUniformLocation(s.name),i)})}useProgram(t,e){this.gl_.useProgram(t),this.currentProgram_=t,this.applyFrameState(e),this.applyUniforms(e)}compileShader(t,e){const i=this.gl_,n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}getProgram(t,e){const i=this.gl_,n=this.compileShader(t,i.FRAGMENT_SHADER),s=this.compileShader(e,i.VERTEX_SHADER),a=i.createProgram();if(i.attachShader(a,n),i.attachShader(a,s),i.linkProgram(a),!i.getShaderParameter(n,i.COMPILE_STATUS)){const h=`Fragment shader compilation failed: ${i.getShaderInfoLog(n)}`;throw new Error(h)}if(i.deleteShader(n),!i.getShaderParameter(s,i.COMPILE_STATUS)){const h=`Vertex shader compilation failed: ${i.getShaderInfoLog(s)}`;throw new Error(h)}if(i.deleteShader(s),!i.getProgramParameter(a,i.LINK_STATUS)){const h=`GL program linking failed: ${i.getProgramInfoLog(a)}`;throw new Error(h)}return a}getUniformLocation(t){const e=ct(this.currentProgram_);return this.uniformLocationsByProgram_[e]===void 0&&(this.uniformLocationsByProgram_[e]={}),this.uniformLocationsByProgram_[e][t]===void 0&&(this.uniformLocationsByProgram_[e][t]=this.gl_.getUniformLocation(this.currentProgram_,t)),this.uniformLocationsByProgram_[e][t]}getAttributeLocation(t){const e=ct(this.currentProgram_);return this.attribLocationsByProgram_[e]===void 0&&(this.attribLocationsByProgram_[e]={}),this.attribLocationsByProgram_[e][t]===void 0&&(this.attribLocationsByProgram_[e][t]=this.gl_.getAttribLocation(this.currentProgram_,t)),this.attribLocationsByProgram_[e][t]}makeProjectionTransform(t,e){const i=t.size,n=t.viewState.rotation,s=t.viewState.resolution,a=t.viewState.center;return Ie(e,0,0,2/(s*i[0]),2/(s*i[1]),-n,-a[0],-a[1]),e}setUniformFloatValue(t,e){this.gl_.uniform1f(this.getUniformLocation(t),e)}setUniformFloatVec2(t,e){this.gl_.uniform2fv(this.getUniformLocation(t),e)}setUniformFloatVec4(t,e){this.gl_.uniform4fv(this.getUniformLocation(t),e)}setUniformMatrixValue(t,e){this.gl_.uniformMatrix4fv(this.getUniformLocation(t),!1,e)}enableAttributeArray_(t,e,i,n,s){const a=this.getAttributeLocation(t);a<0||(this.gl_.enableVertexAttribArray(a),this.gl_.vertexAttribPointer(a,e,i,!1,n,s))}enableAttributes(t){const e=sx(t);let i=0;for(let n=0;n<t.length;n++){const s=t[n];this.enableAttributeArray_(s.name,s.size,s.type||Id,e,i),i+=s.size*Gd(s.type)}}handleWebGLContextLost(t){Dn(this.bufferCache_),this.currentProgram_=null,t.preventDefault()}handleWebGLContextRestored(){this.needsToBeRecreated_=!0}needsToBeRecreated(){return this.needsToBeRecreated_}createTexture(t,e,i){const n=this.gl_;i=i||n.createTexture();const s=0,a=n.RGBA,h=0,c=n.RGBA,d=n.UNSIGNED_BYTE;return n.bindTexture(n.TEXTURE_2D,i),e?n.texImage2D(n.TEXTURE_2D,s,a,c,d,e):n.texImage2D(n.TEXTURE_2D,s,a,t[0],t[1],h,c,d,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),i}}function sx(r){let t=0;for(let e=0;e<r.length;e++){const i=r[e];t+=i.size*Gd(i.type)}return t}function Gd(r){switch(r){case _i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case _i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case _i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case _i.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}class ql extends Fd{constructor(t,e){super(t),e=e||{},this.inversePixelTransform_=Ht(),this.pixelContext_=null,this.postProcesses_=e.postProcesses,this.uniforms_=e.uniforms,this.helper,t.addChangeListener(bt.MAP,this.removeHelper.bind(this)),this.dispatchPreComposeEvent=this.dispatchPreComposeEvent.bind(this),this.dispatchPostComposeEvent=this.dispatchPostComposeEvent.bind(this)}dispatchPreComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(te.PRECOMPOSE)){const n=new zr(te.PRECOMPOSE,void 0,e,t);i.dispatchEvent(n)}}dispatchPostComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(te.POSTCOMPOSE)){const n=new zr(te.POSTCOMPOSE,void 0,e,t);i.dispatchEvent(n)}}reset(t){this.uniforms_=t.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)}removeHelper(){this.helper&&(this.helper.dispose(),delete this.helper)}prepareFrame(t){if(this.getLayer().getRenderSource()){let e=!0,i=-1,n;for(let a=0,h=t.layerStatesArray.length;a<h;a++){const c=t.layerStatesArray[a].layer,d=c.getRenderer();if(!(d instanceof ql)){e=!0;continue}const f=c.getClassName();if((e||f!==n)&&(i+=1,e=!1),n=f,d===this)break}const s="map/"+t.mapId+"/group/"+i;(!this.helper||!this.helper.canvasCacheKeyMatches(s)||this.helper.needsToBeRecreated())&&(this.removeHelper(),this.helper=new rx({postProcesses:this.postProcesses_,uniforms:this.uniforms_,canvasCacheKey:s}),n&&(this.helper.getCanvas().className=n),this.afterHelperCreated())}return this.prepareFrameInternal(t)}afterHelperCreated(){}prepareFrameInternal(t){return!0}disposeInternal(){this.removeHelper(),super.disposeInternal()}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){Ie(this.inversePixelTransform_,0,0,i.pixelRatio,-i.pixelRatio,0,0,-i.size[1]);const s=new zr(t,this.inversePixelTransform_,i,e);n.dispatchEvent(s)}}preRender(t,e){this.dispatchRenderEvent_(te.PRERENDER,t,e)}postRender(t,e){this.dispatchRenderEvent_(te.POSTRENDER,t,e)}}const ox=ql,Ke=new Uint8Array(4);class ax{constructor(t,e){this.helper_=t;const i=t.getGL();this.texture_=i.createTexture(),this.framebuffer_=i.createFramebuffer(),this.depthbuffer_=i.createRenderbuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}setSize(t){li(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())}getSize(){return this.size_}clearCachedData(){this.dataCacheDirty_=!0}readAll(){if(this.dataCacheDirty_){const t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_}readPixel(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return Ke[0]=0,Ke[1]=0,Ke[2]=0,Ke[3]=0,Ke;this.readAll();const i=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return Ke[0]=this.data_[i*4],Ke[1]=this.data_[i*4+1],Ke[2]=this.data_[i*4+2],Ke[3]=this.data_[i*4+3],Ke}getTexture(){return this.texture_}getFramebuffer(){return this.framebuffer_}getDepthbuffer(){return this.depthbuffer_}updateSize_(){const t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),e.bindRenderbuffer(e.RENDERBUFFER,this.depthbuffer_),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t[0],t[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthbuffer_),this.data_=new Uint8Array(t[0]*t[1]*4)}}const lx=ax,Ud={GENERATE_POLYGON_BUFFERS:"GENERATE_POLYGON_BUFFERS",GENERATE_POINT_BUFFERS:"GENERATE_POINT_BUFFERS",GENERATE_LINE_STRING_BUFFERS:"GENERATE_LINE_STRING_BUFFERS"},jd=.985;function hx(r,t){t=t||[];const e=256,i=e-1;return t[0]=Math.floor(r/e/e/e)/i,t[1]=Math.floor(r/e/e)%e/i,t[2]=Math.floor(r/e)%e/i,t[3]=r%e/i,t}function cx(r){let t=0;const e=256,i=e-1;return t+=Math.round(r[0]*e*e*e*i),t+=Math.round(r[1]*e*e*i),t+=Math.round(r[2]*e*i),t+=Math.round(r[3]*i),t}function ux(){const r='const e="GENERATE_POLYGON_BUFFERS",t="GENERATE_POINT_BUFFERS",n="GENERATE_LINE_STRING_BUFFERS";function r(e,t){const n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function x(e,t){const n=(r=t)[0]*r[3]-r[1]*r[2];var r;!function(e,t){if(!e)throw new Error(t)}(0!==n,"Transformation matrix cannot be inverted");const x=t[0],i=t[1],u=t[2],o=t[3],f=t[4],s=t[5];return e[0]=o/n,e[1]=-i/n,e[2]=-u/n,e[3]=x/n,e[4]=(u*s-o*f)/n,e[5]=-(x*s-i*f)/n,e}function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}new Array(6);var u={exports:{}};function o(e,t,n){n=n||2;var r,x,i,u,o,s,l,v=t&&t.length,h=v?t[0]*n:e.length,c=f(e,0,h,n,!0),g=[];if(!c||c.next===c.prev)return g;if(v&&(c=function(e,t,n,r){var x,i,u,o=[];for(x=0,i=t.length;x<i;x++)(u=f(e,t[x]*r,x<i-1?t[x+1]*r:e.length,r,!1))===u.next&&(u.steiner=!0),o.push(d(u));for(o.sort(p),x=0;x<o.length;x++)n=y(o[x],n);return n}(e,t,c,n)),e.length>80*n){r=i=e[0],x=u=e[1];for(var b=n;b<h;b+=n)(o=e[b])<r&&(r=o),(s=e[b+1])<x&&(x=s),o>i&&(i=o),s>u&&(u=s);l=0!==(l=Math.max(i-r,u-x))?32767/l:0}return a(c,g,n,r,x,l,0),g}function f(e,t,n,r,x){var i,u;if(x===O(e,t,n,r)>0)for(i=t;i<n;i+=r)u=P(i,e[i],e[i+1],u);else for(i=n-r;i>=t;i-=r)u=P(i,e[i],e[i+1],u);return u&&m(u,u.next)&&(B(u),u=u.next),u}function s(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!m(r,r.next)&&0!==w(r.prev,r,r.next))r=r.next;else{if(B(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function a(e,t,n,r,x,i,u){if(e){!u&&i&&function(e,t,n,r){var x=e;do{0===x.z&&(x.z=b(x.x,x.y,t,n,r)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next}while(x!==e);x.prevZ.nextZ=null,x.prevZ=null,function(e){var t,n,r,x,i,u,o,f,s=1;do{for(n=e,e=null,i=null,u=0;n;){for(u++,r=n,o=0,t=0;t<s&&(o++,r=r.nextZ);t++);for(f=s;o>0||f>0&&r;)0!==o&&(0===f||!r||n.z<=r.z)?(x=n,n=n.nextZ,o--):(x=r,r=r.nextZ,f--),i?i.nextZ=x:e=x,x.prevZ=i,i=x;n=r}i.nextZ=null,s*=2}while(u>1)}(x)}(e,r,x,i);for(var o,f,p=e;e.prev!==e.next;)if(o=e.prev,f=e.next,i?v(e,r,x,i):l(e))t.push(o.i/n|0),t.push(e.i/n|0),t.push(f.i/n|0),B(e),e=f.next,p=f.next;else if((e=f)===p){u?1===u?a(e=h(s(e),t,n),t,n,r,x,i,2):2===u&&c(e,t,n,r,x,i):a(s(e),t,n,r,x,i,1);break}}}function l(e){var t=e.prev,n=e,r=e.next;if(w(t,n,r)>=0)return!1;for(var x=t.x,i=n.x,u=r.x,o=t.y,f=n.y,s=r.y,a=x<i?x<u?x:u:i<u?i:u,l=o<f?o<s?o:s:f<s?f:s,v=x>i?x>u?x:u:i>u?i:u,h=o>f?o>s?o:s:f>s?f:s,c=r.next;c!==t;){if(c.x>=a&&c.x<=v&&c.y>=l&&c.y<=h&&M(x,o,i,f,u,s,c.x,c.y)&&w(c.prev,c,c.next)>=0)return!1;c=c.next}return!0}function v(e,t,n,r){var x=e.prev,i=e,u=e.next;if(w(x,i,u)>=0)return!1;for(var o=x.x,f=i.x,s=u.x,a=x.y,l=i.y,v=u.y,h=o<f?o<s?o:s:f<s?f:s,c=a<l?a<v?a:v:l<v?l:v,p=o>f?o>s?o:s:f>s?f:s,y=a>l?a>v?a:v:l>v?l:v,g=b(h,c,t,n,r),d=b(p,y,t,n,r),Z=e.prevZ,m=e.nextZ;Z&&Z.z>=g&&m&&m.z<=d;){if(Z.x>=h&&Z.x<=p&&Z.y>=c&&Z.y<=y&&Z!==x&&Z!==u&&M(o,a,f,l,s,v,Z.x,Z.y)&&w(Z.prev,Z,Z.next)>=0)return!1;if(Z=Z.prevZ,m.x>=h&&m.x<=p&&m.y>=c&&m.y<=y&&m!==x&&m!==u&&M(o,a,f,l,s,v,m.x,m.y)&&w(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;Z&&Z.z>=g;){if(Z.x>=h&&Z.x<=p&&Z.y>=c&&Z.y<=y&&Z!==x&&Z!==u&&M(o,a,f,l,s,v,Z.x,Z.y)&&w(Z.prev,Z,Z.next)>=0)return!1;Z=Z.prevZ}for(;m&&m.z<=d;){if(m.x>=h&&m.x<=p&&m.y>=c&&m.y<=y&&m!==x&&m!==u&&M(o,a,f,l,s,v,m.x,m.y)&&w(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function h(e,t,n){var r=e;do{var x=r.prev,i=r.next.next;!m(x,i)&&A(x,r,r.next,i)&&z(x,i)&&z(i,x)&&(t.push(x.i/n|0),t.push(r.i/n|0),t.push(i.i/n|0),B(r),B(r.next),r=e=i),r=r.next}while(r!==e);return s(r)}function c(e,t,n,r,x,i){var u=e;do{for(var o=u.next.next;o!==u.prev;){if(u.i!==o.i&&Z(u,o)){var f=F(u,o);return u=s(u,u.next),f=s(f,f.next),a(u,t,n,r,x,i,0),void a(f,t,n,r,x,i,0)}o=o.next}u=u.next}while(u!==e)}function p(e,t){return e.x-t.x}function y(e,t){var n=function(e,t){var n,r=t,x=e.x,i=e.y,u=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var o=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=x&&o>u&&(u=o,n=r.x<r.next.x?r:r.next,o===x))return n}r=r.next}while(r!==t);if(!n)return null;var f,s=n,a=n.x,l=n.y,v=1/0;r=n;do{x>=r.x&&r.x>=a&&x!==r.x&&M(i<l?x:u,i,a,l,i<l?u:x,i,r.x,r.y)&&(f=Math.abs(i-r.y)/(x-r.x),z(r,e)&&(f<v||f===v&&(r.x>n.x||r.x===n.x&&g(n,r)))&&(n=r,v=f)),r=r.next}while(r!==s);return n}(e,t);if(!n)return t;var r=F(n,e);return s(r,r.next),s(n,n.next)}function g(e,t){return w(e.prev,e,t.prev)<0&&w(t.next,e,e.next)<0}function b(e,t,n,r,x){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*x|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*x|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function d(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function M(e,t,n,r,x,i,u,o){return(x-u)*(t-o)>=(e-u)*(i-o)&&(e-u)*(r-o)>=(n-u)*(t-o)&&(n-u)*(i-o)>=(x-u)*(r-o)}function Z(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&A(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(z(e,t)&&z(t,e)&&function(e,t){var n=e,r=!1,x=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&x<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(w(e.prev,e,t.prev)||w(e,t.prev,t))||m(e,t)&&w(e.prev,e,e.next)>0&&w(t.prev,t,t.next)>0)}function w(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function m(e,t){return e.x===t.x&&e.y===t.y}function A(e,t,n,r){var x=I(w(e,t,n)),i=I(w(e,t,r)),u=I(w(n,r,e)),o=I(w(n,r,t));return x!==i&&u!==o||(!(0!==x||!E(e,n,t))||(!(0!==i||!E(e,r,t))||(!(0!==u||!E(n,e,r))||!(0!==o||!E(n,t,r)))))}function E(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function I(e){return e>0?1:e<0?-1:0}function z(e,t){return w(e.prev,e,e.next)<0?w(e,t,e.next)>=0&&w(e,e.prev,t)>=0:w(e,t,e.prev)<0||w(e,e.next,t)<0}function F(e,t){var n=new _(e.i,e.x,e.y),r=new _(t.i,t.x,t.y),x=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=x,x.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function P(e,t,n,r){var x=new _(e,t,n);return r?(x.next=r.next,x.prev=r,r.next.prev=x,r.next=x):(x.prev=x,x.next=x),x}function B(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function _(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(e,t,n,r){for(var x=0,i=t,u=n-r;i<n;i+=r)x+=(e[u]-e[i])*(e[i+1]+e[u+1]),u=i;return x}u.exports=o,u.exports.default=o,o.deviation=function(e,t,n,r){var x=t&&t.length,i=x?t[0]*n:e.length,u=Math.abs(O(e,0,i,n));if(x)for(var o=0,f=t.length;o<f;o++){var s=t[o]*n,a=o<f-1?t[o+1]*n:e.length;u-=Math.abs(O(e,s,a,n))}var l=0;for(o=0;o<r.length;o+=3){var v=r[o]*n,h=r[o+1]*n,c=r[o+2]*n;l+=Math.abs((e[v]-e[c])*(e[h+1]-e[v+1])-(e[v]-e[h])*(e[c+1]-e[v+1]))}return 0===u&&0===l?0:Math.abs((l-u)/u)},o.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,x=0;x<e.length;x++){for(var i=0;i<e[x].length;i++)for(var u=0;u<t;u++)n.vertices.push(e[x][i][u]);x>0&&(r+=e[x-1].length,n.holes.push(r))}return n};var N=i(u.exports);const R=[],S={vertexPosition:0,indexPosition:0};function T(e,t,n,r,x){e[t+0]=n,e[t+1]=r,e[t+2]=x}function U(e,t,n,r,x,i){const u=3+x,o=e[t+0],f=e[t+1],s=R;s.length=x;for(let n=0;n<s.length;n++)s[n]=e[t+2+n];let a=i?i.vertexPosition:0,l=i?i.indexPosition:0;const v=a/u;return T(n,a,o,f,0),s.length&&n.set(s,a+3),a+=u,T(n,a,o,f,1),s.length&&n.set(s,a+3),a+=u,T(n,a,o,f,2),s.length&&n.set(s,a+3),a+=u,T(n,a,o,f,3),s.length&&n.set(s,a+3),a+=u,r[l++]=v,r[l++]=v+1,r[l++]=v+3,r[l++]=v+1,r[l++]=v+2,r[l++]=v+3,S.vertexPosition=a,S.indexPosition=l,S}function k(e,t,n,x,i,u,o,f,s,a,l){const v=8+f.length,h=u.length/v,c=[e[t+0],e[t+1]],p=[e[n],e[n+1]],y=r(s,[...c]),g=r(s,[...p]);function b(e,t,n){const r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),x=[(t[0]-e[0])/r,(t[1]-e[1])/r],i=[-x[1],x[0]],u=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),o=[(n[0]-e[0])/u,(n[1]-e[1])/u],f=0===r||0===u?0:Math.acos((s=o[0]*x[0]+o[1]*x[1],a=-1,l=1,Math.min(Math.max(s,a),l)));var s,a,l;return o[0]*i[0]+o[1]*i[1]>0?f:2*Math.PI-f}let d=-1,M=-1,Z=l;const w=null!==i;if(null!==x){d=b(y,g,r(s,[...[e[x],e[x+1]]])),Math.cos(d)<=.985&&(Z+=Math.tan((d-Math.PI)/2))}if(w){M=b(g,y,r(s,[...[e[i],e[i+1]]])),Math.cos(M)<=.985&&(Z+=Math.tan((Math.PI-M)/2))}function m(e,t){return 0===t?1e4*e:Math.sign(t)*(1e4*e+Math.abs(t))}return u.push(c[0],c[1],p[0],p[1],d,M,a,m(0,l)),u.push(...f),u.push(c[0],c[1],p[0],p[1],d,M,a,m(1,l)),u.push(...f),u.push(c[0],c[1],p[0],p[1],d,M,a,m(2,l)),u.push(...f),u.push(c[0],c[1],p[0],p[1],d,M,a,m(3,l)),u.push(...f),o.push(h,h+1,h+2,h+1,h+3,h+2),{length:a+Math.sqrt((g[0]-y[0])*(g[0]-y[0])+(g[1]-y[1])*(g[1]-y[1])),angle:Z}}function G(e,t,n,r,x){const i=2+x;let u=t;const o=e.slice(u,u+x);u+=x;const f=e[u++];let s=0;const a=new Array(f-1);for(let t=0;t<f;t++)s+=e[u++],t<f-1&&(a[t]=s);const l=e.slice(u,u+2*s),v=N(l,a,2);for(let e=0;e<v.length;e++)r.push(v[e]+n.length/i);for(let e=0;e<l.length;e+=2)n.push(l[e],l[e+1],...o);return u+2*s}const j=self;j.onmessage=r=>{const i=r.data;switch(i.type){case t:{const e=3,t=2,n=i.customAttributesSize,r=t+n,x=new Float32Array(i.renderInstructions),u=x.length/r,o=4*u*(n+e),f=new Uint32Array(6*u),s=new Float32Array(o);let a;for(let e=0;e<x.length;e+=r)a=U(x,e,s,f,n,a);const l=Object.assign({vertexBuffer:s.buffer,indexBuffer:f.buffer,renderInstructions:x.buffer},i);j.postMessage(l,[s.buffer,f.buffer,x.buffer]);break}case n:{const e=[],t=[],n=i.customAttributesSize,r=2,u=new Float32Array(i.renderInstructions);let o=0;const f=[1,0,0,1,0,0];let s,a;for(x(f,i.renderInstructionsTransform);o<u.length;){a=Array.from(u.slice(o,o+n)),o+=n,s=u[o++];const x=o,i=o+(s-1)*r,l=u[x]===u[i]&&u[x+1]===u[i+1];let v=0,h=0;for(let n=0;n<s-1;n++){let c=null;n>0?c=o+(n-1)*r:l&&(c=i-r);let p=null;n<s-2?p=o+(n+2)*r:l&&(p=x+r);const y=k(u,o+n*r,o+(n+1)*r,c,p,e,t,a,f,v,h);v=y.length,h=y.angle}o+=s*r}const l=Uint32Array.from(t),v=Float32Array.from(e),h=Object.assign({vertexBuffer:v.buffer,indexBuffer:l.buffer,renderInstructions:u.buffer},i);j.postMessage(h,[v.buffer,l.buffer,u.buffer]);break}case e:{const e=[],t=[],n=i.customAttributesSize,r=new Float32Array(i.renderInstructions);let x=0;for(;x<r.length;)x=G(r,x,e,t,n);const u=Uint32Array.from(t),o=Float32Array.from(e),f=Object.assign({vertexBuffer:o.buffer,indexBuffer:u.buffer,renderInstructions:r.buffer},i);j.postMessage(f,[o.buffer,u.buffer,r.buffer]);break}}};';return new Worker(typeof Blob>"u"?"data:application/javascript;base64,"+Buffer.from(r,"binary").toString("base64"):URL.createObjectURL(new Blob([r],{type:"application/javascript"})))}function dx(r,t){const e=r.viewState.projection,n=t.getSource().getWrapX()&&e.canWrapX(),s=e.getExtent(),a=r.extent,h=n?Mt(s):null,c=n?Math.ceil((a[2]-s[2])/h)+1:1;return[n?Math.floor((a[0]-s[0])/h):0,c,h]}class fx extends ox{constructor(t,e){const i=e.uniforms||{},n=Ht();i[pi.PROJECTION_MATRIX]=n,super(t,{uniforms:i,postProcesses:e.postProcesses}),this.sourceRevision_=-1,this.verticesBuffer_=new Od(Vl,Yl),this.indicesBuffer_=new Od(Xl,Yl),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.program_,this.hitDetectionEnabled_=e.hitDetectionEnabled??!0;const s=e.attributes?e.attributes.map(function(h){return{name:"a_prop_"+h.name,size:1,type:_i.FLOAT}}):[];this.attributes=[{name:"a_position",size:2,type:_i.FLOAT},{name:"a_index",size:1,type:_i.FLOAT}],this.hitDetectionEnabled_&&(this.attributes.push({name:"a_hitColor",size:4,type:_i.FLOAT}),this.attributes.push({name:"a_featureUid",size:1,type:_i.FLOAT})),this.attributes.push(...s),this.customAttributes=e.attributes?e.attributes:[],this.previousExtent_=xe(),this.currentTransform_=n,this.renderTransform_=Ht(),this.invertRenderTransform_=Ht(),this.renderInstructions_=new Float32Array(0),this.hitRenderTarget_,this.lastSentId=0,this.worker_=ux(),this.worker_.addEventListener("message",h=>{const c=h.data;if(c.type===Ud.GENERATE_POINT_BUFFERS){const d=c.projectionTransform;this.verticesBuffer_.fromArrayBuffer(c.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_),this.indicesBuffer_.fromArrayBuffer(c.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=d,no(this.invertRenderTransform_,this.renderTransform_),this.renderInstructions_=new Float32Array(h.data.renderInstructions),c.id===this.lastSentId&&(this.ready=!0),this.getLayer().changed()}}),this.featureCache_={},this.featureCount_=0;const a=this.getLayer().getSource();this.sourceListenKeys_=[ft(a,oe.ADDFEATURE,this.handleSourceFeatureAdded_,this),ft(a,oe.CHANGEFEATURE,this.handleSourceFeatureChanged_,this),ft(a,oe.REMOVEFEATURE,this.handleSourceFeatureDelete_,this),ft(a,oe.CLEAR,this.handleSourceFeatureClear_,this)],a.forEachFeature(h=>{this.featureCache_[ct(h)]={feature:h,properties:h.getProperties(),geometry:h.getGeometry()},this.featureCount_++})}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitRenderTarget_=new lx(this.helper))}handleSourceFeatureAdded_(t){const e=t.feature;this.featureCache_[ct(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++}handleSourceFeatureChanged_(t){const e=t.feature;this.featureCache_[ct(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}}handleSourceFeatureDelete_(t){const e=t.feature;delete this.featureCache_[ct(e)],this.featureCount_--}handleSourceFeatureClear_(){this.featureCache_={},this.featureCount_=0}renderFrame(t){const e=this.helper.getGL();this.preRender(e,t);const[i,n,s]=dx(t,this.getLayer());return this.renderWorlds(t,!1,i,n,s),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent),this.hitDetectionEnabled_&&(this.renderWorlds(t,!0,i,n,s),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),this.helper.getCanvas()}prepareFrameInternal(t){const e=this.getLayer(),i=e.getSource(),n=t.viewState,s=!t.viewHints[Zt.ANIMATING]&&!t.viewHints[Zt.INTERACTING],a=!Nn(this.previousExtent_,t.extent),h=this.sourceRevision_<i.getRevision();if(h&&(this.sourceRevision_=i.getRevision()),s&&(a||h)){const c=n.projection,d=n.resolution,f=e instanceof Hl?e.getRenderBuffer():0,p=Xs(t.extent,f*d);i.loadFeatures(p,d,c),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.useProgram(this.program_,t),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0}rebuildBuffers_(t){const e=Ht();this.helper.makeProjectionTransform(t,e);const n=(this.hitDetectionEnabled_?7:2)+this.customAttributes.length,s=n*this.featureCount_;(!this.renderInstructions_||this.renderInstructions_.length!==s)&&(this.renderInstructions_=new Float32Array(s));let a,h;const c=[],d=[];let f=-1;for(const _ in this.featureCache_)if(a=this.featureCache_[_],h=a.geometry,!(!h||h.getType()!=="Point")){if(c[0]=h.getFlatCoordinates()[0],c[1]=h.getFlatCoordinates()[1],Nt(e,c),this.renderInstructions_[++f]=c[0],this.renderInstructions_[++f]=c[1],this.hitDetectionEnabled_){const y=hx(f+5,d);this.renderInstructions_[++f]=y[0],this.renderInstructions_[++f]=y[1],this.renderInstructions_[++f]=y[2],this.renderInstructions_[++f]=y[3],this.renderInstructions_[++f]=Number(_)}for(let y=0;y<this.customAttributes.length;y++){const v=this.customAttributes[y].callback(a.feature,a.properties);this.renderInstructions_[++f]=v}}const p={id:++this.lastSentId,type:Ud.GENERATE_POINT_BUFFERS,renderInstructions:this.renderInstructions_.buffer,customAttributesSize:n-2};p.projectionTransform=e,this.ready=!1,this.worker_.postMessage(p,[this.renderInstructions_.buffer]),this.renderInstructions_=null}forEachFeatureAtCoordinate(t,e,i,n,s){if(mt(this.hitDetectionEnabled_,"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has been disabled using the `disableHitDetection: true` option."),!this.renderInstructions_||!this.hitDetectionEnabled_)return;const a=Nt(e.coordinateToPixelTransform,t.slice()),h=this.hitRenderTarget_.readPixel(a[0]/2,a[1]/2),c=[h[0]/255,h[1]/255,h[2]/255,h[3]/255],d=cx(c),f=this.renderInstructions_[d],p=Math.floor(f).toString(),y=this.getLayer().getSource().getFeatureByUid(p);if(y)return n(y,this.getLayer(),null)}renderWorlds(t,e,i,n,s){let a=i;this.helper.useProgram(this.program_,t),e&&(this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0)),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes);do{this.helper.makeProjectionTransform(t,this.currentTransform_),Ym(this.currentTransform_,a*s,0),mu(this.currentTransform_,this.invertRenderTransform_),this.helper.applyUniforms(t),this.helper.applyHitDetectionUniform(e);const h=this.indicesBuffer_.getSize();this.helper.drawElements(0,h)}while(++a<n)}disposeInternal(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach(function(t){Ct(t)}),this.sourceListenKeys_=null,super.disposeInternal()}}const gx=fx,px=.5;class _x extends js{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.interimTile=null,this.key="",this.transition_=i.transition===void 0?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(lt.CHANGE)}release(){this.state===et.ERROR&&this.setState(et.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getInterimTile(){let t=this.interimTile;if(!t)return this;do{if(t.getState()==et.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this}refreshInterimChain(){let t=this.interimTile;if(!t)return;let e=this;do{if(t.getState()==et.LOADED){t.interimTile=null;break}t.getState()==et.LOADING?e=t:t.getState()==et.IDLE?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==et.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){rt()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(!i)i=e,this.transitionStarts_[t]=i;else if(i===-1)return 1;const n=e-i+1e3/60;return n>=this.transition_?1:du(n/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}}const Zd=_x,mx=10,Wd=.25;class yx{constructor(t,e,i,n,s,a){this.sourceProj_=t,this.targetProj_=e;let h={};const c=Rr(this.targetProj_,this.sourceProj_);this.transformInv_=function(E){const b=E[0]+"/"+E[1];return h[b]||(h[b]=c(E)),h[b]},this.maxSourceExtent_=n,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&Mt(n)>=Mt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Mt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Mt(this.targetProj_.getExtent()):null;const d=cn(i),f=Js(i),p=qs(i),_=Ks(i),y=this.transformInv_(d),v=this.transformInv_(f),w=this.transformInv_(p),T=this.transformInv_(_),M=mx+(a?Math.max(0,Math.ceil(Math.log2(Za(i)/(a*a*256*256)))):0);if(this.addQuad_(d,f,p,_,y,v,w,T,M),this.wrapsXInSource_){let E=1/0;this.triangles_.forEach(function(b,C,P){E=Math.min(E,b.source[0][0],b.source[1][0],b.source[2][0])}),this.triangles_.forEach(b=>{if(Math.max(b.source[0][0],b.source[1][0],b.source[2][0])-E>this.sourceWorldWidth_/2){const C=[[b.source[0][0],b.source[0][1]],[b.source[1][0],b.source[1][1]],[b.source[2][0],b.source[2][1]]];C[0][0]-E>this.sourceWorldWidth_/2&&(C[0][0]-=this.sourceWorldWidth_),C[1][0]-E>this.sourceWorldWidth_/2&&(C[1][0]-=this.sourceWorldWidth_),C[2][0]-E>this.sourceWorldWidth_/2&&(C[2][0]-=this.sourceWorldWidth_);const P=Math.min(C[0][0],C[1][0],C[2][0]);Math.max(C[0][0],C[1][0],C[2][0])-P<this.sourceWorldWidth_/2&&(b.source=C)}})}h={}}addTriangle_(t,e,i,n,s,a){this.triangles_.push({source:[n,s,a],target:[t,e,i]})}addQuad_(t,e,i,n,s,a,h,c,d){const f=Hc([s,a,h,c]),p=this.sourceWorldWidth_?Mt(f)/this.sourceWorldWidth_:null,_=this.sourceWorldWidth_,y=this.sourceProj_.canWrapX()&&p>.5&&p<1;let v=!1;if(d>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const T=Hc([t,e,i,n]);v=Mt(T)/this.targetWorldWidth_>Wd||v}!y&&this.sourceProj_.isGlobal()&&p&&(v=p>Wd||v)}if(!v&&this.maxSourceExtent_&&isFinite(f[0])&&isFinite(f[1])&&isFinite(f[2])&&isFinite(f[3])&&!ce(f,this.maxSourceExtent_))return;let w=0;if(!v&&(!isFinite(s[0])||!isFinite(s[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(h[0])||!isFinite(h[1])||!isFinite(c[0])||!isFinite(c[1]))){if(d>0)v=!0;else if(w=(!isFinite(s[0])||!isFinite(s[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(h[0])||!isFinite(h[1])?2:0)+(!isFinite(c[0])||!isFinite(c[1])?1:0),w!=1&&w!=2&&w!=4&&w!=8)return}if(d>0){if(!v){const T=[(t[0]+i[0])/2,(t[1]+i[1])/2],M=this.transformInv_(T);let E;y?E=(Bn(s[0],_)+Bn(h[0],_))/2-Bn(M[0],_):E=(s[0]+h[0])/2-M[0];const b=(s[1]+h[1])/2-M[1];v=E*E+b*b>this.errorThresholdSquared_}if(v){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){const T=[(e[0]+i[0])/2,(e[1]+i[1])/2],M=this.transformInv_(T),E=[(n[0]+t[0])/2,(n[1]+t[1])/2],b=this.transformInv_(E);this.addQuad_(t,e,T,E,s,a,M,b,d-1),this.addQuad_(E,T,i,n,b,M,h,c,d-1)}else{const T=[(t[0]+e[0])/2,(t[1]+e[1])/2],M=this.transformInv_(T),E=[(i[0]+n[0])/2,(i[1]+n[1])/2],b=this.transformInv_(E);this.addQuad_(t,T,E,n,s,M,b,c,d-1),this.addQuad_(T,e,i,E,M,a,h,b,d-1)}return}}if(y){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}w&11||this.addTriangle_(t,i,n,s,h,c),w&14||this.addTriangle_(t,i,e,s,h,a),w&&(w&13||this.addTriangle_(e,n,t,a,c,s),w&7||this.addTriangle_(e,n,i,a,c,h))}calculateSourceExtent(){const t=xe();return this.triangles_.forEach(function(e,i,n){const s=e.source;Pr(t,s[0]),Pr(t,s[1]),Pr(t,s[2])}),t}getTriangles(){return this.triangles_}}const vx=yx;let Jl;const Jn=[];function Hd(r,t,e,i,n){r.beginPath(),r.moveTo(0,0),r.lineTo(t,e),r.lineTo(i,n),r.closePath(),r.save(),r.clip(),r.fillRect(0,0,Math.max(t,i)+1,Math.max(e,n)),r.restore()}function Ql(r,t){return Math.abs(r[t*4]-210)>2||Math.abs(r[t*4+3]-.75*255)>2}function xx(){if(Jl===void 0){const r=ee(6,6,Jn);r.globalCompositeOperation="lighter",r.fillStyle="rgba(210, 0, 0, 0.75)",Hd(r,4,5,4,0),Hd(r,4,5,0,5);const t=r.getImageData(0,0,3,3).data;Jl=Ql(t,0)||Ql(t,4)||Ql(t,8),mo(r),Jn.push(r.canvas)}return Jl}function Vd(r,t,e,i){const n=au(e,t,r);let s=ru(t,i,e);const a=t.getMetersPerUnit();a!==void 0&&(s*=a);const h=r.getMetersPerUnit();h!==void 0&&(s/=h);const c=r.getExtent();if(!c||Ys(c,n)){const d=ru(r,s,n)/s;isFinite(d)&&d>0&&(s/=d)}return s}function wx(r,t,e,i){const n=Ri(e);let s=Vd(r,t,n,i);return(!isFinite(s)||s<=0)&&qc(e,function(a){return s=Vd(r,t,a,i),isFinite(s)&&s>0}),s}function Ex(r,t,e,i,n,s,a,h,c,d,f,p,_){const y=ee(Math.round(e*r),Math.round(e*t),Jn);if(p||(y.imageSmoothingEnabled=!1),c.length===0)return y.canvas;y.scale(e,e);function v(E){return Math.round(E*e)/e}y.globalCompositeOperation="lighter";const w=xe();c.forEach(function(E,b,C){Yc(w,E.extent)});let T;if(!_||c.length!==1||d!==0){const E=Mt(w),b=we(w);T=ee(Math.round(e*E/i),Math.round(e*b/i),Jn),p||(T.imageSmoothingEnabled=!1);const C=e/i;c.forEach(function(P,R,D){const O=P.extent[0]-w[0],G=-(P.extent[3]-w[3]),X=Mt(P.extent),Y=we(P.extent);P.image.width>0&&P.image.height>0&&T.drawImage(P.image,d,d,P.image.width-2*d,P.image.height-2*d,O*C,G*C,X*C,Y*C)})}const M=cn(a);return h.getTriangles().forEach(function(E,b,C){const P=E.source,R=E.target;let D=P[0][0],O=P[0][1],G=P[1][0],X=P[1][1],Y=P[2][0],q=P[2][1];const st=v((R[0][0]-M[0])/s),_t=v(-(R[0][1]-M[1])/s),V=v((R[1][0]-M[0])/s),H=v(-(R[1][1]-M[1])/s),j=v((R[2][0]-M[0])/s),B=v(-(R[2][1]-M[1])/s),Lt=D,Z=O;D=0,O=0,G-=Lt,X-=Z,Y-=Lt,q-=Z;const ut=[[G,X,0,0,V-st],[Y,q,0,0,j-st],[0,0,G,X,H-_t],[0,0,Y,q,B-_t]],z=Tm(ut);if(!z)return;if(y.save(),y.beginPath(),xx()||!p){y.moveTo(V,H);const $=4,tt=st-V,at=_t-H;for(let kt=0;kt<$;kt++)y.lineTo(V+v((kt+1)*tt/$),H+v(kt*at/($-1))),kt!=$-1&&y.lineTo(V+v((kt+1)*tt/$),H+v((kt+1)*at/($-1)));y.lineTo(j,B)}else y.moveTo(V,H),y.lineTo(st,_t),y.lineTo(j,B);y.clip(),y.transform(z[0],z[2],z[1],z[3],st,_t),y.translate(w[0]-Lt,w[3]-Z);let xt;if(T)xt=T.canvas,y.scale(i/e,-i/e);else{const $=c[0],tt=$.extent;xt=$.image,y.scale(Mt(tt)/xt.width,-we(tt)/xt.height)}y.drawImage(xt,0,0),y.restore()}),T&&(mo(T),Jn.push(T.canvas)),f&&(y.save(),y.globalCompositeOperation="source-over",y.strokeStyle="black",y.lineWidth=1,h.getTriangles().forEach(function(E,b,C){const P=E.target,R=(P[0][0]-M[0])/s,D=-(P[0][1]-M[1])/s,O=(P[1][0]-M[0])/s,G=-(P[1][1]-M[1])/s,X=(P[2][0]-M[0])/s,Y=-(P[2][1]-M[1])/s;y.beginPath(),y.moveTo(O,G),y.lineTo(R,D),y.lineTo(X,Y),y.closePath(),y.stroke()}),y.restore()),y.canvas}class Lx extends Zd{constructor(t,e,i,n,s,a,h,c,d,f,p,_){super(s,et.IDLE,_),this.renderEdges_=p!==void 0?p:!1,this.pixelRatio_=h,this.gutter_=c,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=n,this.wrappedTileCoord_=a||s,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const y=n.getTileCoordExtent(this.wrappedTileCoord_),v=this.targetTileGrid_.getExtent();let w=this.sourceTileGrid_.getExtent();const T=v?kr(y,v):y;if(Za(T)===0){this.state=et.EMPTY;return}const M=t.getExtent();M&&(w?w=kr(w,M):w=M);const E=n.getResolution(this.wrappedTileCoord_[0]),b=wx(t,i,T,E);if(!isFinite(b)||b<=0){this.state=et.EMPTY;return}const C=f!==void 0?f:px;if(this.triangulation_=new vx(t,i,T,w,b*C,E),this.triangulation_.getTriangles().length===0){this.state=et.EMPTY;return}this.sourceZ_=e.getZForResolution(b);let P=this.triangulation_.calculateSourceExtent();if(w&&(t.canWrapX()?(P[1]=Dt(P[1],w[1],w[3]),P[3]=Dt(P[3],w[1],w[3])):P=kr(P,w)),!Za(P))this.state=et.EMPTY;else{const R=e.getTileRangeForExtentAndZ(P,this.sourceZ_);for(let D=R.minX;D<=R.maxX;D++)for(let O=R.minY;O<=R.maxY;O++){const G=d(this.sourceZ_,D,O,h);G&&this.sourceTiles_.push(G)}this.sourceTiles_.length===0&&(this.state=et.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{e&&e.getState()==et.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}),this.sourceTiles_.length=0,t.length===0)this.state=et.ERROR;else{const e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n=typeof i=="number"?i:i[0],s=typeof i=="number"?i:i[1],a=this.targetTileGrid_.getResolution(e),h=this.sourceTileGrid_.getResolution(this.sourceZ_),c=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Ex(n,s,this.pixelRatio_,h,this.sourceTileGrid_.getExtent(),a,c,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=et.LOADED}this.changed()}load(){if(this.state==et.IDLE){this.state=et.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(e=>{const i=e.getState();if(i==et.IDLE||i==et.LOADING){t++;const n=ft(e,lt.CHANGE,function(s){const a=e.getState();(a==et.LOADED||a==et.ERROR||a==et.EMPTY)&&(Ct(n),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(n)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(e,i,n){e.getState()==et.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(Ct),this.sourcesListenerKeys_=null}release(){this.canvas_&&(mo(this.canvas_.getContext("2d")),Jn.push(this.canvas_),this.canvas_=null),super.release()}}const $l=Lx;class bx extends Zd{constructor(t,e,i,n,s,a){super(t,e,a),this.crossOrigin_=n,this.src_=i,this.key=i,this.image_=new Image,n!==null&&(this.image_.crossOrigin=n),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(t){this.image_=t,this.state=et.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=et.ERROR,this.unlistenImage_(),this.image_=Tx(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=et.LOADED:this.state=et.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==et.ERROR&&(this.state=et.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==et.IDLE&&(this.state=et.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Jv(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function Tx(){const r=ee(1,1);return r.fillStyle="rgba(0,0,0,0)",r.fillRect(0,0,1,1),r.canvas}const Xd=bx;class Cx{constructor(t){this.highWaterMark=t!==void 0?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const i=this.entries_[t];return mt(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(t){const e=this.entries_[t];return mt(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.key_;return t}getValues(){const t=new Array(this.count_);let e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){var e;return(e=this.entries_[t])==null?void 0:e.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){mt(!(t in this.entries_),"Tried to set a value for a key that is used already");const i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_}setSize(t){this.highWaterMark=t}}const Mx=Cx;class Yd{constructor(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function Qn(r,t,e,i,n){return n!==void 0?(n.minX=r,n.maxX=t,n.minY=e,n.maxY=i,n):new Yd(r,t,e,i)}const Kd=Yd;function qd(r,t,e,i){return i!==void 0?(i[0]=r,i[1]=t,i[2]=e,i):[r,t,e]}function Fo(r,t,e){return r+"/"+t+"/"+e}function Jd(r){return Fo(r[0],r[1],r[2])}function Sx(r){return r.split("/").map(Number)}function Px(r){return(r[1]<<r[0])+r[2]}function kx(r,t){const e=r[0],i=r[1],n=r[2];if(t.getMinZoom()>e||e>t.getMaxZoom())return!1;const s=t.getFullTileRange(e);return s?s.containsXY(i,n):!0}function es(r){const t=r.toString();return t.includes(".")?t:t+".0"}function Rx(r){if(r.length<2||r.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return`vec${r.length}(${r.map(es).join(", ")})`}function th(r){const t=Fr(r),e=t.length>3?t[3]:1;return Rx([t[0]/255*e,t[1]/255*e,t[2]/255*e,e])}const eh={};let Ax=0;function Ix(r){return r in eh||(eh[r]=Ax++),eh[r]}function $n(r){return es(Ix(r))}function Dx(){return{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"#3399CC","stroke-width":1.25,"circle-radius":5,"circle-fill-color":"rgba(255,255,255,0.4)","circle-stroke-width":1.25,"circle-stroke-color":"#3399CC"}}const tr=`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
48
46
|
precision highp float;
|
|
49
47
|
#else
|
|
50
48
|
precision mediump float;
|
|
@@ -59,11 +57,19 @@ uniform float u_zoom;
|
|
|
59
57
|
uniform float u_resolution;
|
|
60
58
|
uniform float u_rotation;
|
|
61
59
|
uniform vec4 u_renderExtent;
|
|
60
|
+
uniform vec2 u_patternOrigin;
|
|
61
|
+
uniform float u_depth;
|
|
62
62
|
uniform mediump int u_hitDetection;
|
|
63
63
|
|
|
64
64
|
const float PI = 3.141592653589793238;
|
|
65
65
|
const float TWO_PI = 2.0 * PI;
|
|
66
|
-
|
|
66
|
+
|
|
67
|
+
// this used to produce an alpha-premultiplied color from a texture
|
|
68
|
+
vec4 samplePremultiplied(sampler2D sampler, vec2 texCoord) {
|
|
69
|
+
vec4 color = texture2D(sampler, texCoord);
|
|
70
|
+
return vec4(color.rgb * color.a, color.a);
|
|
71
|
+
}
|
|
72
|
+
`,er=Dx();class Ox{constructor(){this.uniforms_=[],this.attributes_=[],this.varyings_=[],this.hasSymbol_=!1,this.symbolSizeExpression_=`vec2(${es(er["circle-radius"])} + ${es(er["circle-stroke-width"]*.5)})`,this.symbolRotationExpression_="0.0",this.symbolOffsetExpression_="vec2(0.0)",this.symbolColorExpression_=th(er["circle-fill-color"]),this.texCoordExpression_="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression_="false",this.symbolRotateWithView_=!1,this.hasStroke_=!1,this.strokeWidthExpression_=es(er["stroke-width"]),this.strokeColorExpression_=th(er["stroke-color"]),this.strokeOffsetExpression_="0.",this.strokeCapExpression_=$n("round"),this.strokeJoinExpression_=$n("round"),this.strokeMiterLimitExpression_="10.",this.strokeDistanceFieldExpression_="-1000.",this.hasFill_=!1,this.fillColorExpression_=th(er["fill-color"]),this.vertexShaderFunctions_=[],this.fragmentShaderFunctions_=[]}addUniform(t){return this.uniforms_.push(t),this}addAttribute(t){return this.attributes_.push(t),this}addVarying(t,e,i){return this.varyings_.push({name:t,type:e,expression:i}),this}setSymbolSizeExpression(t){return this.hasSymbol_=!0,this.symbolSizeExpression_=t,this}getSymbolSizeExpression(){return this.symbolSizeExpression_}setSymbolRotationExpression(t){return this.symbolRotationExpression_=t,this}setSymbolOffsetExpression(t){return this.symbolOffsetExpression_=t,this}getSymbolOffsetExpression(){return this.symbolOffsetExpression_}setSymbolColorExpression(t){return this.hasSymbol_=!0,this.symbolColorExpression_=t,this}getSymbolColorExpression(){return this.symbolColorExpression_}setTextureCoordinateExpression(t){return this.texCoordExpression_=t,this}setFragmentDiscardExpression(t){return this.discardExpression_=t,this}getFragmentDiscardExpression(){return this.discardExpression_}setSymbolRotateWithView(t){return this.symbolRotateWithView_=t,this}setStrokeWidthExpression(t){return this.hasStroke_=!0,this.strokeWidthExpression_=t,this}setStrokeColorExpression(t){return this.hasStroke_=!0,this.strokeColorExpression_=t,this}getStrokeColorExpression(){return this.strokeColorExpression_}setStrokeOffsetExpression(t){return this.strokeOffsetExpression_=t,this}setStrokeCapExpression(t){return this.strokeCapExpression_=t,this}setStrokeJoinExpression(t){return this.strokeJoinExpression_=t,this}setStrokeMiterLimitExpression(t){return this.strokeMiterLimitExpression_=t,this}setStrokeDistanceFieldExpression(t){return this.strokeDistanceFieldExpression_=t,this}setFillColorExpression(t){return this.hasFill_=!0,this.fillColorExpression_=t,this}getFillColorExpression(){return this.fillColorExpression_}addVertexShaderFunction(t){this.vertexShaderFunctions_.includes(t)||this.vertexShaderFunctions_.push(t)}addFragmentShaderFunction(t){this.fragmentShaderFunctions_.includes(t)||this.fragmentShaderFunctions_.push(t)}getSymbolVertexShader(){return this.hasSymbol_?`${tr}
|
|
67
73
|
${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
|
|
68
74
|
`)}
|
|
69
75
|
attribute vec2 a_position;
|
|
@@ -83,7 +89,6 @@ ${this.vertexShaderFunctions_.join(`
|
|
|
83
89
|
`)}
|
|
84
90
|
vec2 pxToScreen(vec2 coordPx) {
|
|
85
91
|
vec2 scaled = coordPx / u_viewportSizePx / 0.5;
|
|
86
|
-
${this.symbolRotateWithView_?"scaled = vec2(scaled.x * cos(-u_rotation) - scaled.y * sin(-u_rotation), scaled.x * sin(-u_rotation) + scaled.y * cos(-u_rotation));":""}
|
|
87
92
|
return scaled;
|
|
88
93
|
}
|
|
89
94
|
|
|
@@ -106,25 +111,25 @@ void main(void) {
|
|
|
106
111
|
offsetPx += halfSizePx * vec2(-1., 1.);
|
|
107
112
|
}
|
|
108
113
|
float angle = ${this.symbolRotationExpression_};
|
|
114
|
+
${this.symbolRotateWithView_?"angle += u_rotation;":""}
|
|
109
115
|
float c = cos(-angle);
|
|
110
116
|
float s = sin(-angle);
|
|
111
117
|
offsetPx = vec2(c * offsetPx.x - s * offsetPx.y, s * offsetPx.x + c * offsetPx.y);
|
|
112
118
|
vec4 center = u_projectionMatrix * vec4(a_position, 0.0, 1.0);
|
|
113
|
-
gl_Position = center + vec4(pxToScreen(offsetPx),
|
|
119
|
+
gl_Position = center + vec4(pxToScreen(offsetPx), u_depth, 0.);
|
|
114
120
|
vec4 texCoord = ${this.texCoordExpression_};
|
|
115
121
|
float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;
|
|
116
122
|
float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;
|
|
117
123
|
v_texCoord = vec2(u, v);
|
|
118
124
|
v_hitColor = a_hitColor;
|
|
119
125
|
v_angle = angle;
|
|
120
|
-
${this.symbolRotateWithView_?"v_angle += u_rotation;":""}
|
|
121
126
|
c = cos(-v_angle);
|
|
122
127
|
s = sin(-v_angle);
|
|
123
128
|
centerOffsetPx = vec2(c * centerOffsetPx.x - s * centerOffsetPx.y, s * centerOffsetPx.x + c * centerOffsetPx.y);
|
|
124
129
|
v_centerPx = screenToPx(center.xy) + centerOffsetPx;
|
|
125
130
|
${this.varyings_.map(function(t){return" "+t.name+" = "+t.expression+";"}).join(`
|
|
126
131
|
`)}
|
|
127
|
-
}`:null}getSymbolFragmentShader(){return this.hasSymbol_?`${
|
|
132
|
+
}`:null}getSymbolFragmentShader(){return this.hasSymbol_?`${tr}
|
|
128
133
|
${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
|
|
129
134
|
`)}
|
|
130
135
|
varying vec2 v_texCoord;
|
|
@@ -148,7 +153,7 @@ void main(void) {
|
|
|
148
153
|
if (gl_FragColor.a < 0.05) { discard; };
|
|
149
154
|
gl_FragColor = v_hitColor;
|
|
150
155
|
}
|
|
151
|
-
}`:null}getStrokeVertexShader(){return this.hasStroke_?`${
|
|
156
|
+
}`:null}getStrokeVertexShader(){return this.hasStroke_?`${tr}
|
|
152
157
|
${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
|
|
153
158
|
`)}
|
|
154
159
|
attribute vec2 a_position;
|
|
@@ -179,7 +184,7 @@ vec2 worldToPx(vec2 worldPos) {
|
|
|
179
184
|
|
|
180
185
|
vec4 pxToScreen(vec2 pxPos) {
|
|
181
186
|
vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0;
|
|
182
|
-
return vec4(screenPos,
|
|
187
|
+
return vec4(screenPos, u_depth, 1.0);
|
|
183
188
|
}
|
|
184
189
|
|
|
185
190
|
bool isCap(float joinAngle) {
|
|
@@ -207,7 +212,9 @@ vec2 getOffsetPoint(vec2 point, vec2 normal, float joinAngle, float offsetPx) {
|
|
|
207
212
|
void main(void) {
|
|
208
213
|
v_angleStart = a_joinAngles.x;
|
|
209
214
|
v_angleEnd = a_joinAngles.y;
|
|
210
|
-
float vertexNumber = a_parameters;
|
|
215
|
+
float vertexNumber = floor(abs(a_parameters) / 10000. + 0.5);
|
|
216
|
+
// we're reading the fractional part while keeping the sign (so -4.12 gives -0.12, 3.45 gives 0.45)
|
|
217
|
+
float angleTangentSum = fract(abs(a_parameters) / 10000.) * 10000. * sign(a_parameters);
|
|
211
218
|
|
|
212
219
|
float lineWidth = ${this.strokeWidthExpression_};
|
|
213
220
|
float lineOffsetPx = ${this.strokeOffsetExpression_};
|
|
@@ -227,7 +234,7 @@ void main(void) {
|
|
|
227
234
|
vec2 joinDirection;
|
|
228
235
|
vec2 positionPx = vertexNumber < 1.5 ? segmentStartPx : segmentEndPx;
|
|
229
236
|
// if angle is too high, do not make a proper join
|
|
230
|
-
if (cos(angle) >
|
|
237
|
+
if (cos(angle) > ${jd} || isCap(angle)) {
|
|
231
238
|
joinDirection = normalPx * normalDir - tangentPx * tangentDir;
|
|
232
239
|
} else {
|
|
233
240
|
joinDirection = getJoinOffsetDirection(normalPx * normalDir, angle);
|
|
@@ -239,10 +246,10 @@ void main(void) {
|
|
|
239
246
|
v_segmentEnd = segmentEndPx;
|
|
240
247
|
v_width = lineWidth;
|
|
241
248
|
v_hitColor = a_hitColor;
|
|
242
|
-
v_distanceOffsetPx = a_distance / u_resolution;
|
|
249
|
+
v_distanceOffsetPx = a_distance / u_resolution - (lineOffsetPx * angleTangentSum);
|
|
243
250
|
${this.varyings_.map(function(t){return" "+t.name+" = "+t.expression+";"}).join(`
|
|
244
251
|
`)}
|
|
245
|
-
}`:null}getStrokeFragmentShader(){return this.hasStroke_?`${
|
|
252
|
+
}`:null}getStrokeFragmentShader(){return this.hasStroke_?`${tr}
|
|
246
253
|
${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
|
|
247
254
|
`)}
|
|
248
255
|
varying vec2 v_segmentStart;
|
|
@@ -304,7 +311,7 @@ float bevelJoinField(vec2 point, vec2 start, vec2 end, float width, float joinAn
|
|
|
304
311
|
}
|
|
305
312
|
|
|
306
313
|
float miterJoinDistanceField(vec2 point, vec2 start, vec2 end, float width, float joinAngle) {
|
|
307
|
-
if (cos(joinAngle) >
|
|
314
|
+
if (cos(joinAngle) > ${jd}) { // avoid risking a division by zero
|
|
308
315
|
return bevelJoinField(point, start, end, width, joinAngle);
|
|
309
316
|
}
|
|
310
317
|
float miterLength = 1. / sin(joinAngle * 0.5);
|
|
@@ -316,18 +323,18 @@ float miterJoinDistanceField(vec2 point, vec2 start, vec2 end, float width, floa
|
|
|
316
323
|
}
|
|
317
324
|
|
|
318
325
|
float capDistanceField(vec2 point, vec2 start, vec2 end, float width, float capType) {
|
|
319
|
-
if (capType == ${
|
|
326
|
+
if (capType == ${$n("butt")}) {
|
|
320
327
|
return buttCapDistanceField(point, start, end);
|
|
321
|
-
} else if (capType == ${
|
|
328
|
+
} else if (capType == ${$n("square")}) {
|
|
322
329
|
return squareCapDistanceField(point, start, end, width);
|
|
323
330
|
}
|
|
324
331
|
return roundCapDistanceField(point, start, end, width);
|
|
325
332
|
}
|
|
326
333
|
|
|
327
334
|
float joinDistanceField(vec2 point, vec2 start, vec2 end, float width, float joinAngle, float joinType) {
|
|
328
|
-
if (joinType == ${
|
|
335
|
+
if (joinType == ${$n("bevel")}) {
|
|
329
336
|
return bevelJoinField(point, start, end, width, joinAngle);
|
|
330
|
-
} else if (joinType == ${
|
|
337
|
+
} else if (joinType == ${$n("miter")}) {
|
|
331
338
|
return miterJoinDistanceField(point, start, end, width, joinAngle);
|
|
332
339
|
}
|
|
333
340
|
return roundJoinDistanceField(point, start, end, width);
|
|
@@ -343,13 +350,13 @@ float computeSegmentPointDistance(vec2 point, vec2 start, vec2 end, float width,
|
|
|
343
350
|
void main(void) {
|
|
344
351
|
vec2 currentPoint = gl_FragCoord.xy / u_pixelRatio;
|
|
345
352
|
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
346
|
-
vec2
|
|
353
|
+
vec2 worldPos = pxToWorld(currentPoint);
|
|
347
354
|
if (
|
|
348
355
|
abs(u_renderExtent[0] - u_renderExtent[2]) > 0.0 && (
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
356
|
+
worldPos[0] < u_renderExtent[0] ||
|
|
357
|
+
worldPos[1] < u_renderExtent[1] ||
|
|
358
|
+
worldPos[0] > u_renderExtent[2] ||
|
|
359
|
+
worldPos[1] > u_renderExtent[3]
|
|
353
360
|
)
|
|
354
361
|
) {
|
|
355
362
|
discard;
|
|
@@ -363,6 +370,7 @@ void main(void) {
|
|
|
363
370
|
vec2 startToPoint = currentPoint - v_segmentStart;
|
|
364
371
|
float currentLengthPx = max(0., min(dot(segmentTangent, startToPoint), segmentLength)) + v_distanceOffsetPx;
|
|
365
372
|
float currentRadiusPx = abs(dot(segmentNormal, startToPoint));
|
|
373
|
+
float currentRadiusRatio = dot(segmentNormal, startToPoint) * 2. / v_width;
|
|
366
374
|
vec4 color = ${this.strokeColorExpression_} * u_globalAlpha;
|
|
367
375
|
float capType = ${this.strokeCapExpression_};
|
|
368
376
|
float joinType = ${this.strokeJoinExpression_};
|
|
@@ -378,7 +386,7 @@ void main(void) {
|
|
|
378
386
|
if (gl_FragColor.a < 0.1) { discard; };
|
|
379
387
|
gl_FragColor = v_hitColor;
|
|
380
388
|
}
|
|
381
|
-
}`:null}getFillVertexShader(){return this.hasFill_?`${
|
|
389
|
+
}`:null}getFillVertexShader(){return this.hasFill_?`${tr}
|
|
382
390
|
${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
|
|
383
391
|
`)}
|
|
384
392
|
attribute vec2 a_position;
|
|
@@ -391,10 +399,11 @@ ${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(`
|
|
|
391
399
|
${this.vertexShaderFunctions_.join(`
|
|
392
400
|
`)}
|
|
393
401
|
void main(void) {
|
|
394
|
-
gl_Position = u_projectionMatrix * vec4(a_position,
|
|
402
|
+
gl_Position = u_projectionMatrix * vec4(a_position, u_depth, 1.0);
|
|
403
|
+
v_hitColor = a_hitColor;
|
|
395
404
|
${this.varyings_.map(function(t){return" "+t.name+" = "+t.expression+";"}).join(`
|
|
396
405
|
`)}
|
|
397
|
-
}`:null}getFillFragmentShader(){return this.hasFill_?`${
|
|
406
|
+
}`:null}getFillFragmentShader(){return this.hasFill_?`${tr}
|
|
398
407
|
${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
|
|
399
408
|
`)}
|
|
400
409
|
varying vec4 v_hitColor;
|
|
@@ -407,15 +416,22 @@ vec2 pxToWorld(vec2 pxPos) {
|
|
|
407
416
|
return (u_screenToWorldMatrix * vec4(screenPos, 0.0, 1.0)).xy;
|
|
408
417
|
}
|
|
409
418
|
|
|
419
|
+
vec2 worldToPx(vec2 worldPos) {
|
|
420
|
+
vec4 screenPos = u_projectionMatrix * vec4(worldPos, 0.0, 1.0);
|
|
421
|
+
return (0.5 * screenPos.xy + 0.5) * u_viewportSizePx;
|
|
422
|
+
}
|
|
423
|
+
|
|
410
424
|
void main(void) {
|
|
425
|
+
vec2 pxPos = gl_FragCoord.xy / u_pixelRatio;
|
|
426
|
+
vec2 pxOrigin = worldToPx(u_patternOrigin);
|
|
411
427
|
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
412
|
-
vec2
|
|
428
|
+
vec2 worldPos = pxToWorld(pxPos);
|
|
413
429
|
if (
|
|
414
430
|
abs(u_renderExtent[0] - u_renderExtent[2]) > 0.0 && (
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
431
|
+
worldPos[0] < u_renderExtent[0] ||
|
|
432
|
+
worldPos[1] < u_renderExtent[1] ||
|
|
433
|
+
worldPos[0] > u_renderExtent[2] ||
|
|
434
|
+
worldPos[1] > u_renderExtent[3]
|
|
419
435
|
)
|
|
420
436
|
) {
|
|
421
437
|
discard;
|
|
@@ -427,7 +443,7 @@ void main(void) {
|
|
|
427
443
|
if (gl_FragColor.a < 0.1) { discard; };
|
|
428
444
|
gl_FragColor = v_hitColor;
|
|
429
445
|
}
|
|
430
|
-
}`:null}}const
|
|
446
|
+
}`:null}}const Oe={BLUR:"blur",GRADIENT:"gradient",RADIUS:"radius"},Fx=["#00f","#0ff","#0f0","#ff0","#f00"];class zx extends Hl{constructor(t){t=t||{};const e=Object.assign({},t);delete e.gradient,delete e.radius,delete e.blur,delete e.weight,super(e),this.gradient_=null,this.addChangeListener(Oe.GRADIENT,this.handleGradientChanged_),this.setGradient(t.gradient?t.gradient:Fx),this.setBlur(t.blur!==void 0?t.blur:15),this.setRadius(t.radius!==void 0?t.radius:8);const i=t.weight?t.weight:"weight";typeof i=="string"?this.weightFunction_=function(n){return n.get(i)}:this.weightFunction_=i,this.setRenderOrder(null)}getBlur(){return this.get(Oe.BLUR)}getGradient(){return this.get(Oe.GRADIENT)}getRadius(){return this.get(Oe.RADIUS)}handleGradientChanged_(){this.gradient_=Nx(this.getGradient())}setBlur(t){this.set(Oe.BLUR,t)}setGradient(t){this.set(Oe.GRADIENT,t)}setRadius(t){this.set(Oe.RADIUS,t)}createRenderer(){const t=new Ox().addAttribute("float a_prop_weight").addVarying("v_prop_weight","float","a_prop_weight").addUniform("float u_size").addUniform("float u_blurSlope").setSymbolSizeExpression("vec2(u_size)").setSymbolColorExpression("vec4(smoothstep(0., 1., (1. - length(coordsPx * 2. / v_quadSizePx)) * u_blurSlope) * v_prop_weight)");return new gx(this,{className:this.getClassName(),attributes:[{name:"weight",callback:e=>{const i=this.weightFunction_(e);return i!==void 0?Dt(i,0,1):1}}],uniforms:{u_size:()=>(this.get(Oe.RADIUS)+this.get(Oe.BLUR))*2,u_blurSlope:()=>this.get(Oe.RADIUS)/Math.max(1,this.get(Oe.BLUR))},hitDetectionEnabled:!0,vertexShader:t.getSymbolVertexShader(),fragmentShader:t.getSymbolFragmentShader(),postProcesses:[{fragmentShader:`
|
|
431
447
|
precision mediump float;
|
|
432
448
|
|
|
433
449
|
uniform sampler2D u_image;
|
|
@@ -441,8 +457,8 @@ void main(void) {
|
|
|
441
457
|
gl_FragColor.a = color.a * u_opacity;
|
|
442
458
|
gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;
|
|
443
459
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
444
|
-
}`,uniforms:{u_gradientTexture:()=>this.gradient_,u_opacity:()=>this.getOpacity()}}]})}renderDeclutter(){}}function s0(r){const i=Jt(1,256),n=i.createLinearGradient(0,0,1,256),o=1/(r.length-1);for(let a=0,h=r.length;a<h;++a)n.addColorStop(a*o,r[a]);return i.fillStyle=n,i.fillRect(0,0,1,256),i.canvas}const o0=r0;class a0 extends Yx{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()}pruneExceptNewestZ(){if(this.getCount()===0)return;const t=this.peekFirstKey(),i=Kx(t)[0];this.forEach(n=>{n.tileCoord[0]!==i&&(this.remove(Td(n.tileCoord)),n.release())})}}const Cd=a0,Il={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class l0 extends be{constructor(t){super(),this.projection=Gt(t.projection),this.attributions_=Md(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible!==void 0?t.attributionsCollapsible:!0,this.loading=!1,this.state_=t.state!==void 0?t.state:"ready",this.wrapX_=t.wrapX!==void 0?t.wrapX:!1,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise(function(i,n){e.viewResolver=i,e.viewRejector=n})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=Md(t),this.changed()}setState(t){this.state_=t,this.changed()}}function Md(r){return r?Array.isArray(r)?function(t){return r}:typeof r=="function"?r:function(t){return[r]}:null}const Sd=l0,Wn=[0,0,0],Pi=5;class h0{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,gt(O_(this.resolutions_,function(n,o){return o-n},!0),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let n=0,o=this.resolutions_.length-1;n<o;++n)if(!e)e=this.resolutions_[n]/this.resolutions_[n+1];else if(this.resolutions_[n]/this.resolutions_[n+1]!==e){e=void 0;break}}this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=t.origin!==void 0?t.origin:null,this.origins_=null,t.origins!==void 0&&(this.origins_=t.origins,gt(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const i=t.extent;i!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=qi(i)),gt(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,t.tileSizes!==void 0&&(this.tileSizes_=t.tileSizes,gt(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=t.tileSize!==void 0?t.tileSize:this.tileSizes_?null:La,gt(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=i!==void 0?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],t.sizes!==void 0?this.fullTileRanges_=t.sizes.map(function(n,o){const a=new Ld(Math.min(0,n[0]),Math.max(n[0]-1,-1),Math.min(0,n[1]),Math.max(n[1]-1,-1));if(i){const h=this.getTileRangeForExtentAndZ(i,o);a.minX=Math.max(h.minX,a.minX),a.maxX=Math.min(h.maxX,a.maxX),a.minY=Math.max(h.minY,a.minY),a.maxY=Math.min(h.maxY,a.maxY)}return a},this):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){const n=this.getTileRangeForExtentAndZ(t,e);for(let o=n.minX,a=n.maxX;o<=a;++o)for(let h=n.minY,c=n.maxY;h<=c;++h)i([e,o,h])}forEachTileCoordParentTileRange(t,e,i,n){let o,a,h,c=null,d=t[0]-1;for(this.zoomFactor_===2?(a=t[1],h=t[2]):c=this.getTileCoordExtent(t,n);d>=this.minZoom;){if(this.zoomFactor_===2?(a=Math.floor(a/2),h=Math.floor(h/2),o=Gn(a,a,h,h,i)):o=this.getTileRangeForExtentAndZ(c,d,i),e(d,o))return!0;--d}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,i){if(t[0]<this.maxZoom){if(this.zoomFactor_===2){const o=t[1]*2,a=t[2]*2;return Gn(o,o+1,a,a+1,e)}const n=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(n,t[0]+1,e)}return null}getTileRangeForTileCoordAndZ(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;const n=t[0],o=t[1],a=t[2];if(e===n)return Gn(o,a,o,a,i);if(this.zoomFactor_){const c=Math.pow(this.zoomFactor_,e-n),d=Math.floor(o*c),f=Math.floor(a*c);if(e<n)return Gn(d,d,f,f,i);const p=Math.floor(c*(o+1))-1,m=Math.floor(c*(a+1))-1;return Gn(d,p,f,m,i)}const h=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(h,e,i)}getTileRangeForExtentAndZ(t,e,i){this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,Wn);const n=Wn[1],o=Wn[2];this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,Wn);const a=Wn[1],h=Wn[2];return Gn(n,a,o,h,i)}getTileCoordCenter(t){const e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=_e(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*i,e[1]-(t[2]+.5)*n[1]*i]}getTileCoordExtent(t,e){const i=this.getOrigin(t[0]),n=this.getResolution(t[0]),o=_e(this.getTileSize(t[0]),this.tmpSize_),a=i[0]+t[1]*o[0]*n,h=i[1]-(t[2]+1)*o[1]*n,c=a+o[0]*n,d=h+o[1]*n;return wi(a,h,c,d,e)}getTileCoordForCoordAndResolution(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)}getTileCoordForXYAndResolution_(t,e,i,n,o){const a=this.getZForResolution(i),h=i/this.getResolution(a),c=this.getOrigin(a),d=_e(this.getTileSize(a),this.tmpSize_);let f=h*(t-c[0])/i/d[0],p=h*(c[1]-e)/i/d[1];return n?(f=Bs(f,Pi)-1,p=Bs(p,Pi)-1):(f=Ns(f,Pi),p=Ns(p,Pi)),bd(a,f,p,o)}getTileCoordForXYAndZ_(t,e,i,n,o){const a=this.getOrigin(i),h=this.getResolution(i),c=_e(this.getTileSize(i),this.tmpSize_);let d=(t-a[0])/h/c[0],f=(a[1]-e)/h/c[1];return n?(d=Bs(d,Pi)-1,f=Bs(f,Pi)-1):(d=Ns(d,Pi),f=Ns(f,Pi)),bd(i,d,f,o)}getTileCoordForCoordAndZ(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)}getTileCoordResolution(t){return this.resolutions_[t[0]]}getTileSize(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]}getFullTileRange(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null}getZForResolution(t,e){const i=Ea(this.resolutions_,t,e||0);return At(i,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return fu(e,0,e.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){const e=this.resolutions_.length,i=new Array(e);for(let n=this.minZoom;n<e;++n)i[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=i}}const Pd=h0;function kd(r){let t=r.getDefaultTileGrid();return t||(t=f0(r),r.setDefaultTileGrid(t)),t}function c0(r,t,e){const i=t[0],n=r.getTileCoordCenter(t),o=Dl(e);if(!As(o,n)){const a=Tt(o),h=Math.ceil((o[0]-n[0])/a);return n[0]+=a*h,r.getTileCoordForCoordAndZ(n,i)}return t}function u0(r,t,e,i){i=i!==void 0?i:"top-left";const n=Rd(r,t,e);return new Pd({extent:r,origin:tm(r,i),resolutions:n,tileSize:e})}function d0(r){const t=r||{},e=t.extent||Gt("EPSG:3857").getExtent(),i={extent:e,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:Rd(e,t.maxZoom,t.tileSize,t.maxResolution)};return new Pd(i)}function Rd(r,t,e,i){t=t!==void 0?t:U_,e=_e(e!==void 0?e:La);const n=Fe(r),o=Tt(r);i=i>0?i:Math.max(o/e[0],n/e[1]);const a=t+1,h=new Array(a);for(let c=0;c<a;++c)h[c]=i/Math.pow(2,c);return h}function f0(r,t,e,i){const n=Dl(r);return u0(n,t,e,i)}function Dl(r){r=Gt(r);let t=r.getExtent();if(!t){const e=180*_r.degrees/r.getMetersPerUnit();t=wi(-e,-e,e,e)}return t}class g0 extends Sd{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate}),this.on,this.once,this.un,this.opaque_=t.opaque!==void 0?t.opaque:!1,this.tilePixelRatio_=t.tilePixelRatio!==void 0?t.tilePixelRatio:1,this.tileGrid=t.tileGrid!==void 0?t.tileGrid:null;const e=[256,256];this.tileGrid&&_e(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),e),this.tileCache=new Cd(t.cacheSize||0),this.tmpSize=[0,0],this.key_=t.key||"",this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}canExpireCache(){return this.tileCache.canExpireCache()}expireCache(t,e){const i=this.getTileCacheForProjection(t);i&&i.expireCache(e)}forEachLoadedTile(t,e,i,n){const o=this.getTileCacheForProjection(t);if(!o)return!1;let a=!0,h,c,d;for(let f=i.minX;f<=i.maxX;++f)for(let p=i.minY;p<=i.maxY;++p)c=vo(e,f,p),d=!1,o.containsKey(c)&&(h=o.get(c),d=h.getState()===$.LOADED,d&&(d=n(h)!==!1)),d||(a=!1);return a}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getOpaque(t){return this.opaque_}getResolutions(t){const e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,i,n,o){return nt()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:kd(t)}getTileCacheForProjection(t){const e=this.getProjection();return gt(e===null||Qi(e,t),"A VectorTile source can only be rendered if it has a projection compatible with the view projection."),this.tileCache}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,i){const n=this.getTileGridForProjection(i),o=this.getTilePixelRatio(e),a=_e(n.getTileSize(t),this.tmpSize);return o==1?a:Ev(a,o,this.tmpSize)}getTileCoordForTileUrlFunction(t,e){e=e!==void 0?e:this.getProjection();const i=this.getTileGridForProjection(e);return this.getWrapX()&&e.isGlobal()&&(t=c0(i,t,e)),Jx(t,i)?t:null}clear(){this.tileCache.clear()}refresh(){this.clear(),super.refresh()}updateCacheSize(t,e){const i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)}useTile(t,e,i,n){}}class p0 extends $e{constructor(t,e){super(t),this.tile=e}}const _0=g0;function m0(r,t){const e=/\{z\}/g,i=/\{x\}/g,n=/\{y\}/g,o=/\{-y\}/g;return function(a,h,c){if(a)return r.replace(e,a[0].toString()).replace(i,a[1].toString()).replace(n,a[2].toString()).replace(o,function(){const d=a[0],f=t.getFullTileRange(d);return gt(f,"The {-y} placeholder requires a tile grid with extent"),(f.getHeight()-a[2]-1).toString()})}}function y0(r,t){const e=r.length,i=new Array(e);for(let n=0;n<e;++n)i[n]=m0(r[n],t);return v0(i)}function v0(r){return r.length===1?r[0]:function(t,e,i){if(!t)return;const n=qx(t),o=Pn(n,r.length);return r[o](t,e,i)}}function x0(r){const t=[];let e=/\{([a-z])-([a-z])\}/.exec(r);if(e){const i=e[1].charCodeAt(0),n=e[2].charCodeAt(0);let o;for(o=i;o<=n;++o)t.push(r.replace(e[0],String.fromCharCode(o)));return t}if(e=/\{(\d+)-(\d+)\}/.exec(r),e){const i=parseInt(e[2],10);for(let n=parseInt(e[1],10);n<=i;n++)t.push(r.replace(e[0],n.toString()));return t}return t.push(r),t}class Ol extends _0{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===Ol.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(t){const e=t.target,i=ht(e),n=e.getState();let o;n==$.LOADING?(this.tileLoadingKeys_[i]=!0,o=Il.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],o=n==$.ERROR?Il.TILELOADERROR:n==$.LOADED?Il.TILELOADEND:void 0),o!=null&&this.dispatchEvent(new p0(o,e))}setTileLoadFunction(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),typeof e<"u"?this.setKey(e):this.changed()}setUrl(t){const e=x0(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join(`
|
|
445
|
-
`);this.generateTileUrlFunction_?this.setTileUrlFunction(y0(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,i){}useTile(t,e,i){const n=vo(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)}}const w0=Ol;class E0 extends w0{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:L0,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate!==void 0?t.interpolate:!0,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=t.crossOrigin!==void 0?t.crossOrigin:null,this.tileClass=t.tileClass!==void 0?t.tileClass:wd,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}canExpireCache(){if(this.tileCache.canExpireCache())return!0;for(const t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1}expireCache(t,e){const i=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==i?e:{});for(const n in this.tileCacheForProjection){const o=this.tileCacheForProjection[n];o.expireCache(o==i?e:{})}}getGutterForProjection(t){return this.getProjection()&&t&&!Qi(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getOpaque(t){return this.getProjection()&&t&&!Qi(this.getProjection(),t)?!1:super.getOpaque(t)}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||Qi(e,t)))return this.tileGrid;const i=ht(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=kd(t)),this.tileGridForProjection[i]}getTileCacheForProjection(t){const e=this.getProjection();if(!e||Qi(e,t))return this.tileCache;const i=ht(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Cd(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]}createTile_(t,e,i,n,o,a){const h=[t,e,i],c=this.getTileCoordForTileUrlFunction(h,o),d=c?this.tileUrlFunction(c,n,o):void 0,f=new this.tileClass(h,d!==void 0?$.IDLE:$.EMPTY,d!==void 0?d:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return f.key=a,f.addEventListener(ot.CHANGE,this.handleTileChange.bind(this)),f}getTile(t,e,i,n,o){const a=this.getProjection();if(!a||!o||Qi(a,o))return this.getTileInternal(t,e,i,n,a||o);const h=this.getTileCacheForProjection(o),c=[t,e,i];let d;const f=Td(c);h.containsKey(f)&&(d=h.get(f));const p=this.getKey();if(d&&d.key==p)return d;const m=this.getTileGridForProjection(a),y=this.getTileGridForProjection(o),v=this.getTileCoordForTileUrlFunction(c,o),E=new kl(a,m,o,y,c,v,this.getTilePixelRatio(n),this.getGutter(),(C,S,w,b)=>this.getTileInternal(C,S,w,b,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return E.key=p,d?(E.interimTile=d,E.refreshInterimChain(),h.replace(f,E)):h.set(f,E),E}getTileInternal(t,e,i,n,o){let a=null;const h=vo(t,e,i),c=this.getKey();if(!this.tileCache.containsKey(h))a=this.createTile_(t,e,i,n,o,c),this.tileCache.set(h,a);else if(a=this.tileCache.get(h),a.key!=c){const d=a;a=this.createTile_(t,e,i,n,o,c),d.getState()==$.IDLE?a.interimTile=d.interimTile:a.interimTile=d,a.refreshInterimChain(),this.tileCache.replace(h,a)}return a}setRenderReprojectionEdges(t){if(this.renderReprojectionEdges_!=t){this.renderReprojectionEdges_=t;for(const e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}}setTileGridForProjection(t,e){const i=Gt(t);if(i){const n=ht(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}}clear(){super.clear();for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear()}}function L0(r,t){r.getImage().src=t}const b0=E0;class T0 extends b0{constructor(t){t=t||{};const e=t.projection!==void 0?t.projection:"EPSG:3857",i=t.tileGrid!==void 0?t.tileGrid:d0({extent:Dl(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,opaque:t.opaque,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}}const C0=T0,M0='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class S0 extends C0{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[M0];const i=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",n=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:i,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,opaque:t.opaque!==void 0?t.opaque:!0,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:n,wrapX:t.wrapX,zDirection:t.zDirection})}}const P0=S0,xo={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class k0 extends Js{constructor(t){t=t||{};const e=Object.assign({},t);delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getPreload(){return this.get(xo.PRELOAD)}setPreload(t){this.set(xo.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(xo.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(xo.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}const R0=k0,Ad=[];let Hn=null;function A0(){Hn=Jt(1,1,void 0,{willReadFrequently:!0})}class I0 extends ud{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=Vt(),this.pixelTransform=Vt(),this.inversePixelTransform=Vt(),this.context=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(t,e,i){Hn||A0(),Hn.clearRect(0,0,1,1);let n;try{Hn.drawImage(t,e,i,1,1,0,0,1,1),n=Hn.getImageData(0,0,1,1).data}catch{return Hn=null,null}return n}getBackground(t){let i=this.getLayer().getBackground();return typeof i=="function"&&(i=i(t.viewState.resolution)),i||void 0}useContainer(t,e,i){const n=this.getLayer().getClassName();let o,a;if(t&&t.className===n&&(!i||t&&t.style.backgroundColor&&ei(Lr(t.style.backgroundColor),Lr(i)))){const h=t.firstElementChild;h instanceof HTMLCanvasElement&&(a=h.getContext("2d"))}if(a&&a.canvas.style.transform===e?(this.container=t,this.context=a,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){o=document.createElement("div"),o.className=n;let h=o.style;h.position="absolute",h.width="100%",h.height="100%",a=Jt();const c=a.canvas;o.appendChild(c),h=c.style,h.position="absolute",h.left="0",h.transformOrigin="top left",this.container=o,this.context=a}!this.containerReused&&i&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=i)}clipUnrotated(t,e,i){const n=qi(i),o=Os(i),a=Ds(i),h=Is(i);Ot(e.coordinateToPixelTransform,n),Ot(e.coordinateToPixelTransform,o),Ot(e.coordinateToPixelTransform,a),Ot(e.coordinateToPixelTransform,h);const c=this.inversePixelTransform;Ot(c,n),Ot(c,o),Ot(c,a),Ot(c,h),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.lineTo(Math.round(h[0]),Math.round(h[1])),t.clip()}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){const o=new br(t,this.inversePixelTransform,i,e);n.dispatchEvent(o)}}preRender(t,e){this.frameState=e,this.dispatchRenderEvent_(qt.PRERENDER,t,e)}postRender(t,e){this.dispatchRenderEvent_(qt.POSTRENDER,t,e)}getRenderTransform(t,e,i,n,o,a,h){const c=o/2,d=a/2,f=n/e,p=-f,m=-t[0]+h,y=-t[1];return ze(this.tempTransform,c,d,f,p,-i,m,y)}disposeInternal(){delete this.frameState,super.disposeInternal()}}const Id=I0;class D0 extends Id{constructor(t){super(t),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=ge(),this.tmpTileRange_=new Ld(0,0,0,0)}isDrawableTile(t){const e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==$.LOADED||i==$.EMPTY||i==$.ERROR&&!n}getTile(t,e,i,n){const o=n.pixelRatio,a=n.viewState.projection,h=this.getLayer();let d=h.getSource().getTile(t,e,i,o,a);return d.getState()==$.ERROR&&h.getUseInterimTilesOnError()&&h.getPreload()>0&&(this.newTiles_=!0),this.isDrawableTile(d)||(d=d.getInterimTile()),d}getData(t){const e=this.frameState;if(!e)return null;const i=this.getLayer(),n=Ot(e.pixelToCoordinateTransform,t.slice()),o=i.getExtent();if(o&&!As(o,n))return null;const a=e.pixelRatio,h=e.viewState.projection,c=e.viewState,d=i.getRenderSource(),f=d.getTileGridForProjection(c.projection),p=d.getTilePixelRatio(e.pixelRatio);for(let m=f.getZForResolution(c.resolution);m>=f.getMinZoom();--m){const y=f.getTileCoordForCoordAndZ(n,m),v=d.getTile(m,y[1],y[2],a,h);if(!(v instanceof wd||v instanceof kl)||v instanceof kl&&v.getState()===$.EMPTY)return null;if(v.getState()!==$.LOADED)continue;const E=f.getOrigin(m),C=_e(f.getTileSize(m)),S=f.getResolution(m),w=Math.floor(p*((n[0]-E[0])/S-y[1]*C[0])),b=Math.floor(p*((E[1]-n[1])/S-y[2]*C[1])),T=Math.round(p*d.getGutterForProjection(c.projection));return this.getImageData(v.getImage(),w+T,b+T)}return null}loadedTileCallback(t,e,i){return this.isDrawableTile(i)?super.loadedTileCallback(t,e,i):!1}prepareFrame(t){return!!this.getLayer().getSource()}renderFrame(t,e){const i=t.layerStatesArray[t.layerIndex],n=t.viewState,o=n.projection,a=n.resolution,h=n.center,c=n.rotation,d=t.pixelRatio,f=this.getLayer(),p=f.getSource(),m=p.getRevision(),y=p.getTileGridForProjection(o),v=y.getZForResolution(a,p.zDirection),E=y.getResolution(v);let C=t.extent;const S=t.viewState.resolution,w=p.getTilePixelRatio(d),b=Math.round(Tt(C)/S*d),T=Math.round(Fe(C)/S*d),P=i.extent&&$i(i.extent);P&&(C=xr(C,$i(i.extent)));const R=E*b/2/w,I=E*T/2/w,O=[h[0]-R,h[1]-I,h[0]+R,h[1]+I],U=y.getTileRangeForExtentAndZ(C,v),X={};X[v]={};const q=this.createLoadedTileFinder(p,o,X),Y=this.tmpExtent,rt=this.tmpTileRange_;this.newTiles_=!1;const pt=c?Pa(n.center,S,c,t.size):void 0;for(let Lt=U.minX;Lt<=U.maxX;++Lt)for(let tt=U.minY;tt<=U.maxY;++tt){if(c&&!y.tileCoordIntersectsViewport([v,Lt,tt],pt))continue;const J=this.getTile(v,Lt,tt,t);if(this.isDrawableTile(J)){const Mt=ht(this);if(J.getState()==$.LOADED){X[v][J.tileCoord.toString()]=J;let ve=J.inTransition(Mt);ve&&i.opacity!==1&&(J.endTransition(Mt),ve=!1),!this.newTiles_&&(ve||!this.renderedTiles.includes(J))&&(this.newTiles_=!0)}if(J.getAlpha(Mt,t.time)===1)continue}const st=y.getTileCoordChildTileRange(J.tileCoord,rt,Y);let Ft=!1;st&&(Ft=q(v+1,st)),Ft||y.forEachTileCoordParentTileRange(J.tileCoord,q,rt,Y)}const V=E/a*d/w;ze(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/d,1/d,c,-b/2,-T/2);const H=eu(this.pixelTransform);this.useContainer(e,H,this.getBackground(t));const G=this.context,N=G.canvas;js(this.inversePixelTransform,this.pixelTransform),ze(this.tempTransform,b/2,T/2,V,V,0,-b/2,-T/2),N.width!=b||N.height!=T?(N.width=b,N.height=T):this.containerReused||G.clearRect(0,0,b,T),P&&this.clipUnrotated(G,t,P),p.getInterpolate()||(G.imageSmoothingEnabled=!1),this.preRender(G,t),this.renderedTiles.length=0;let vt=Object.keys(X).map(Number);vt.sort(xi);let Z,at,z;i.opacity===1&&(!this.containerReused||p.getOpaque(t.viewState.projection))?vt=vt.reverse():(Z=[],at=[]);for(let Lt=vt.length-1;Lt>=0;--Lt){const tt=vt[Lt],J=p.getTilePixelSize(tt,d,o),Ft=y.getResolution(tt)/E,Mt=J[0]*Ft*V,ve=J[1]*Ft*V,Ze=y.getTileCoordForCoordAndZ(qi(O),tt),Di=y.getTileCoordExtent(Ze),xe=Ot(this.tempTransform,[w*(Di[0]-O[0])/E,w*(O[3]-Di[3])/E]),Oi=w*p.getGutterForProjection(o),We=X[tt];for(const Fi in We){const Se=We[Fi],zi=Se.tileCoord,di=Ze[1]-zi[1],Xn=Math.round(xe[0]-(di-1)*Mt),fi=Ze[2]-zi[2],hn=Math.round(xe[1]-(fi-1)*ve),Xt=Math.round(xe[0]-di*Mt),ie=Math.round(xe[1]-fi*ve),me=Xn-Xt,Pe=hn-ie,He=v===tt,Ve=He&&Se.getAlpha(ht(this),t.time)!==1;let ke=!1;if(!Ve)if(Z){z=[Xt,ie,Xt+me,ie,Xt+me,ie+Pe,Xt,ie+Pe];for(let Ni=0,cn=Z.length;Ni<cn;++Ni)if(v!==tt&&tt<at[Ni]){const Wt=Z[Ni];se([Xt,ie,Xt+me,ie+Pe],[Wt[0],Wt[3],Wt[4],Wt[7]])&&(ke||(G.save(),ke=!0),G.beginPath(),G.moveTo(z[0],z[1]),G.lineTo(z[2],z[3]),G.lineTo(z[4],z[5]),G.lineTo(z[6],z[7]),G.moveTo(Wt[6],Wt[7]),G.lineTo(Wt[4],Wt[5]),G.lineTo(Wt[2],Wt[3]),G.lineTo(Wt[0],Wt[1]),G.clip())}Z.push(z),at.push(tt)}else G.clearRect(Xt,ie,me,Pe);this.drawTileImage(Se,t,Xt,ie,me,Pe,Oi,He),Z&&!Ve?(ke&&G.restore(),this.renderedTiles.unshift(Se)):this.renderedTiles.push(Se),this.updateUsedTiles(t.usedTiles,p,Se)}}return this.renderedRevision=m,this.renderedResolution=E,this.extentChanged=!this.renderedExtent_||!Sn(this.renderedExtent_,O),this.renderedExtent_=O,this.renderedPixelRatio=d,this.renderedProjection=o,this.manageTilePyramid(t,p,y,d,o,C,v,f.getPreload()),this.scheduleExpireCache(t,p),this.postRender(G,t),i.extent&&G.restore(),G.imageSmoothingEnabled=!0,H!==N.style.transform&&(N.style.transform=H),this.container}drawTileImage(t,e,i,n,o,a,h,c){const d=this.getTileImage(t);if(!d)return;const f=ht(this),p=e.layerStatesArray[e.layerIndex],m=p.opacity*(c?t.getAlpha(f,e.time):1),y=m!==this.context.globalAlpha;y&&(this.context.save(),this.context.globalAlpha=m),this.context.drawImage(d,h,h,d.width-2*h,d.height-2*h,i,n,o,a),y&&this.context.restore(),m!==p.opacity?e.animate=!0:c&&t.endTransition(f)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}scheduleExpireCache(t,e){if(e.canExpireCache()){const i=(function(n,o,a){const h=ht(n);h in a.usedTiles&&n.expireCache(a.viewState.projection,a.usedTiles[h])}).bind(null,e);t.postRenderFunctions.push(i)}}updateUsedTiles(t,e,i){const n=ht(e);n in t||(t[n]={}),t[n][i.getKey()]=!0}manageTilePyramid(t,e,i,n,o,a,h,c,d){const f=ht(e);f in t.wantedTiles||(t.wantedTiles[f]={});const p=t.wantedTiles[f],m=t.tileQueue,y=i.getMinZoom(),v=t.viewState.rotation,E=v?Pa(t.viewState.center,t.viewState.resolution,v,t.size):void 0;let C=0,S,w,b,T,P,R;for(R=y;R<=h;++R)for(w=i.getTileRangeForExtentAndZ(a,R,w),b=i.getResolution(R),T=w.minX;T<=w.maxX;++T)for(P=w.minY;P<=w.maxY;++P)v&&!i.tileCoordIntersectsViewport([R,T,P],E)||(h-R<=c?(++C,S=e.getTile(R,T,P,n,o),S.getState()==$.IDLE&&(p[S.getKey()]=!0,m.isKeyQueued(S.getKey())||m.enqueue([S,f,i.getTileCoordCenter(S.tileCoord),b])),d!==void 0&&d(S)):e.useTile(R,T,P,o));e.updateCacheSize(C,o)}}const O0=D0;class F0 extends R0{constructor(t){super(t)}createRenderer(){return new O0(this)}}const z0=F0;class N0{constructor(t){this.rbush_=new Rh(t),this.items_={}}insert(t,e){const i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[ht(e)]=i}load(t,e){const i=new Array(e.length);for(let n=0,o=e.length;n<o;n++){const a=t[n],h=e[n],c={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:h};i[n]=c,this.items_[ht(h)]=c}this.rbush_.load(i)}remove(t){const e=ht(t),i=this.items_[e];return delete this.items_[e],this.rbush_.remove(i)!==null}update(t,e){const i=this.items_[ht(e)],n=[i.minX,i.minY,i.maxX,i.maxY];Sn(n,t)||(this.remove(e),this.insert(t,e))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(t){const e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(n){return n.value})}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,e){return this.forEach_(this.getInExtent(t),e)}forEach_(t,e){let i;for(let n=0,o=t.length;n<o;n++)if(i=e(t[n]),i)return i;return i}isEmpty(){return bn(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const e=this.rbush_.toJSON();return wi(e.minX,e.minY,e.maxX,e.maxY,t)}concat(t){this.rbush_.load(t.rbush_.all());for(const e in t.items_)this.items_[e]=t.items_[e]}}const Dd=N0;function B0(r,t){return[[-1/0,-1/0,1/0,1/0]]}let G0=!1;function U0(r,t,e,i,n,o,a){const h=new XMLHttpRequest;h.open("GET",typeof r=="function"?r(e,i,n):r,!0),t.getType()=="arraybuffer"&&(h.responseType="arraybuffer"),h.withCredentials=G0,h.onload=function(c){if(!h.status||h.status>=200&&h.status<300){const d=t.getType();let f;d=="json"||d=="text"?f=h.responseText:d=="xml"?(f=h.responseXML,f||(f=new DOMParser().parseFromString(h.responseText,"application/xml"))):d=="arraybuffer"&&(f=h.response),f?o(t.readFeatures(f,{extent:e,featureProjection:n}),t.readProjection(f)):a()}else a()},h.onerror=a,h.send()}function Od(r,t){return function(e,i,n,o,a){const h=this;U0(r,t,e,i,n,function(c,d){h.addFeatures(c),o!==void 0&&o(c)},a||En)}}class ki extends $e{constructor(t,e,i){super(t),this.feature=e,this.features=i}}class j0 extends Sd{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=En,this.format_=t.format,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(gt(this.format_,"`format` must be set when `url` is set"),this.loader_=Od(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:B0;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new Dd:null,this.loadedExtentsRtree_=new Dd,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,n;Array.isArray(t.features)?n=t.features:t.features&&(i=t.features,n=i.getArray()),!e&&i===void 0&&(i=new Be(n)),n!==void 0&&this.addFeaturesInternal(n),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=ht(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const i=t.getGeometry();if(i){const n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new ki(ee.ADDFEATURE,t))}setupChangeEvents_(t,e){this.featureChangeKeys_[t]=[ut(e,ot.CHANGE,this.handleFeatureChange_,this),ut(e,wn.PROPERTYCHANGE,this.handleFeatureChange_,this)]}addToIndex_(t,e){let i=!0;const n=e.getId();return n!==void 0&&(n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e),i&&(gt(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),i}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],i=[],n=[];for(let o=0,a=t.length;o<a;o++){const h=t[o],c=ht(h);this.addToIndex_(c,h)&&i.push(h)}for(let o=0,a=i.length;o<a;o++){const h=i[o],c=ht(h);this.setupChangeEvents_(c,h);const d=h.getGeometry();if(d){const f=d.getExtent();e.push(f),n.push(h)}else this.nullGeometryFeatures_[c]=h}if(this.featuresRtree_&&this.featuresRtree_.load(e,n),this.hasListener(ee.ADDFEATURE))for(let o=0,a=i.length;o<a;o++)this.dispatchEvent(new ki(ee.ADDFEATURE,i[o]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener(ee.ADDFEATURE,function(i){e||(e=!0,t.push(i.feature),e=!1)}),this.addEventListener(ee.REMOVEFEATURE,function(i){e||(e=!0,t.remove(i.feature),e=!1)}),t.addEventListener(oe.ADD,i=>{e||(e=!0,this.addFeature(i.element),e=!1)}),t.addEventListener(oe.REMOVE,i=>{e||(e=!0,this.removeFeature(i.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(Et);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const i=n=>{this.removeFeatureInternal(n)};this.featuresRtree_.forEach(i);for(const n in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new ki(ee.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,function(n){if(n.getGeometry().intersectsCoordinate(t))return e(n)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(i){if(i.getGeometry().intersectsExtent(t)){const o=e(i);if(o)return o}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),bn(this.nullGeometryFeatures_)||ti(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(i){e.push(i)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const n=nm(t,e);return[].concat(...n.map(o=>this.featuresRtree_.getInExtent(o)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const i=t[0],n=t[1];let o=null;const a=[NaN,NaN];let h=1/0;const c=[-1/0,-1/0,1/0,1/0];return e=e||pr,this.featuresRtree_.forEachInExtent(c,function(d){if(e(d)){const f=d.getGeometry(),p=h;if(h=f.closestPointXY(i,n,a,h),h<p){o=d;const m=Math.sqrt(h);c[0]=i-m,c[1]=n-m,c[2]=i+m,c[3]=n+m}}}),o}getExtent(t){return this.featuresRtree_.getExtent(t)}getFeatureById(t){const e=this.idIndex_[t.toString()];return e!==void 0?e:null}getFeatureByUid(t){const e=this.uidIndex_[t];return e!==void 0?e:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(t){const e=t.target,i=ht(e),n=e.getGeometry();if(!n)i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);else{const a=n.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(a,e)):this.featuresRtree_&&this.featuresRtree_.update(a,e)}const o=e.getId();if(o!==void 0){const a=o.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new ki(ee.CHANGEFEATURE,e))}hasFeature(t){const e=t.getId();return e!==void 0?e in this.idIndex_:ht(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&bn(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(t,e,i){const n=this.loadedExtentsRtree_,o=this.strategy_(t,e,i);for(let a=0,h=o.length;a<h;++a){const c=o[a];n.forEachInExtent(c,function(f){return Yi(f.extent,c)})||(++this.loadingExtentsCount_,this.dispatchEvent(new ki(ee.FEATURESLOADSTART)),this.loader_.call(this,c,e,i,f=>{--this.loadingExtentsCount_,this.dispatchEvent(new ki(ee.FEATURESLOADEND,void 0,f))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new ki(ee.FEATURESLOADERROR))}),n.insert(c,{extent:c.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_;let i;e.forEachInExtent(t,function(n){if(Sn(n.extent,t))return i=n,!0}),i&&e.remove(i)}removeFeature(t){if(!t)return;const e=ht(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=ht(t),i=this.featureChangeKeys_[e];if(!i)return;i.forEach(Et),delete this.featureChangeKeys_[e];const n=t.getId();return n!==void 0&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new ki(ee.REMOVEFEATURE,t)),t}removeFromIdIndex_(t){let e=!1;for(const i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e}setLoader(t){this.loader_=t}setUrl(t){gt(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(Od(t,this.format_))}}const wo=j0;class Fl extends be{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new Fl(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(Et(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=ut(t,ot.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?Z0(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function Z0(r){if(typeof r=="function")return r;let t;return Array.isArray(r)?t=r:(gt(typeof r.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[r]),function(){return t}}const W0=Fl;class Eo extends ru{constructor(t){super(),this.geometries_=t||null,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Et),this.changeEventsKeys_.length=0}listenGeometriesChange_(){if(this.geometries_)for(let t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(ut(this.geometries_[t],ot.CHANGE,this.changed,this))}clone(){const t=new Eo(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<Xi(this.getExtent(),t,e))return n;const o=this.geometries_;for(let a=0,h=o.length;a<h;++a)n=o[a].closestPointXY(t,e,i,n);return n}containsXY(t,e){const i=this.geometries_;for(let n=0,o=i.length;n<o;++n)if(i[n].containsXY(t,e))return!0;return!1}computeExtent(t){yr(t);const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)Pc(t,e[i].getExtent());return t}getGeometries(){return Fd(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[];const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);return t}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=[],i=this.geometries_;let n=!1;for(let o=0,a=i.length;o<a;++o){const h=i[o],c=h.getSimplifiedGeometry(t);e.push(c),c!==h&&(n=!0)}if(n){const o=new Eo(null);return o.setGeometriesArray(e),o}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this}getType(){return"GeometryCollection"}intersectsExtent(t){const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)if(e[i].intersectsExtent(t))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(t,e){const i=this.geometries_;for(let n=0,o=i.length;n<o;++n)i[n].rotate(t,e);this.changed()}scale(t,e,i){i||(i=Ki(this.getExtent()));const n=this.geometries_;for(let o=0,a=n.length;o<a;++o)n[o].scale(t,e,i);this.changed()}setGeometries(t){this.setGeometriesArray(Fd(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)e[i].applyTransform(t);this.changed()}translate(t,e){const i=this.geometries_;for(let n=0,o=i.length;n<o;++n)i[n].translate(t,e);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function Fd(r){const t=[];for(let e=0,i=r.length;e<i;++e)t.push(r[e].clone());return t}const H0=Eo;class V0{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let i=e.dataProjection?Gt(e.dataProjection):this.readProjection(t);e.extent&&i&&i.getUnits()==="tile-pixels"&&(i=Gt(i),i.setWorldExtent(e.extent)),e={dataProjection:i,featureProjection:e.featureProjection}}return this.adaptOptions(e)}adaptOptions(t){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)}getType(){return nt()}readFeature(t,e){return nt()}readFeatures(t,e){return nt()}readGeometry(t,e){return nt()}readProjection(t){return nt()}writeFeature(t,e){return nt()}writeFeatures(t,e){return nt()}writeGeometry(t,e){return nt()}}function zd(r,t,e){const i=e?Gt(e.featureProjection):null,n=e?Gt(e.dataProjection):null;let o;if(i&&n&&!Qi(i,n)?o=(t?r.clone():r).transform(t?i:n,t?n:i):o=r,t&&e&&e.decimals!==void 0){const a=Math.pow(10,e.decimals),h=function(c){for(let d=0,f=c.length;d<f;++d)c[d]=Math.round(c[d]*a)/a;return c};o===r&&(o=r.clone()),o.applyTransform(h)}return o}class X0 extends V0{constructor(){super()}getType(){return"json"}readFeature(t,e){return this.readFeatureFromObject(Lo(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(Lo(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return nt()}readFeaturesFromObject(t,e){return nt()}readGeometry(t,e){return this.readGeometryFromObject(Lo(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return nt()}readProjection(t){return this.readProjectionFromObject(Lo(t))}readProjectionFromObject(t){return nt()}writeFeature(t,e){return JSON.stringify(this.writeFeatureObject(t,e))}writeFeatureObject(t,e){return nt()}writeFeatures(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))}writeFeaturesObject(t,e){return nt()}writeGeometry(t,e){return JSON.stringify(this.writeGeometryObject(t,e))}writeGeometryObject(t,e){return nt()}}function Lo(r){if(typeof r=="string"){const t=JSON.parse(r);return t||null}return r!==null?r:null}const Y0=X0;function Nd(r,t,e,i,n,o,a){let h,c;const d=(e-t)/i;if(d===1)h=t;else if(d===2)h=t,c=n;else if(d!==0){let f=r[t],p=r[t+1],m=0;const y=[0];for(let C=t+i;C<e;C+=i){const S=r[C],w=r[C+1];m+=Math.sqrt((S-f)*(S-f)+(w-p)*(w-p)),y.push(m),f=S,p=w}const v=n*m,E=I_(y,v);E<0?(c=(v-y[-E-2])/(y[-E-1]-y[-E-2]),h=t+(-E-2)*i):h=t+E*i}a=a>1?a:2,o=o||new Array(a);for(let f=0;f<a;++f)o[f]=h===void 0?NaN:c===void 0?r[h+f]:pe(r[h+f],r[h+i+f],c);return o}function zl(r,t,e,i,n,o){if(e==t)return null;let a;if(n<r[t+i-1])return o?(a=r.slice(t,t+i),a[i-1]=n,a):null;if(r[e-1]<n)return o?(a=r.slice(e-i,e),a[i-1]=n,a):null;if(n==r[t+i-1])return r.slice(t,t+i);let h=t/i,c=e/i;for(;h<c;){const m=h+c>>1;n<r[(m+1)*i-1]?c=m:h=m+1}const d=r[h*i-1];if(n==d)return r.slice((h-1)*i,(h-1)*i+i);const f=r[(h+1)*i-1],p=(n-d)/(f-d);a=[];for(let m=0;m<i-1;++m)a.push(pe(r[(h-1)*i+m],r[h*i+m],p));return a.push(n),a}function K0(r,t,e,i,n,o,a){if(a)return zl(r,t,e[e.length-1],i,n,o);let h;if(n<r[i-1])return o?(h=r.slice(0,i),h[i-1]=n,h):null;if(r[r.length-1]<n)return o?(h=r.slice(r.length-i),h[i-1]=n,h):null;for(let c=0,d=e.length;c<d;++c){const f=e[c];if(t!=f){if(n<r[t+i-1])return null;if(n<=r[f-1])return zl(r,t,f,i,n,!1);t=f}}return null}function Bd(r,t,e,i){let n=r[t],o=r[t+1],a=0;for(let h=t+i;h<e;h+=i){const c=r[h],d=r[h+1];a+=Math.sqrt((c-n)*(c-n)+(d-o)*(d-o)),n=c,o=d}return a}class bo extends en{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendCoordinate(t){this.flatCoordinates?ti(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()}clone(){const t=new bo(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Xi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Za(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,n))}forEachSegment(t){return du(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){return this.layout!="XYM"&&this.layout!="XYZM"?null:(e=e!==void 0?e:!1,zl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return Li(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return Nd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return Bd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const e=[];return e.length=Va(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new bo(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return Vs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Zs(this.flatCoordinates,0,t,this.stride),this.changed()}}const Nl=bo;class To extends en{constructor(t,e,i){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(e!==void 0&&i)this.setFlatCoordinates(e,t),this.ends_=i;else{let n=this.getLayout();const o=t,a=[],h=[];for(let c=0,d=o.length;c<d;++c){const f=o[c];c===0&&(n=f.getLayout()),ti(a,f.getFlatCoordinates()),h.push(a.length)}this.setFlatCoordinates(n,a),this.ends_=h}}appendLineString(t){this.flatCoordinates?ti(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new To(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Xi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ja(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Wa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,n))}getCoordinateAtM(t,e,i){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(e=e!==void 0?e:!1,i=i!==void 0?i:!1,K0(this.flatCoordinates,0,this.ends_,this.stride,t,e,i))}getCoordinates(){return wr(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new Nl(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLineStrings(){const t=this.flatCoordinates,e=this.ends_,i=this.layout,n=[];let o=0;for(let a=0,h=e.length;a<h;++a){const c=e[a],d=new Nl(t.slice(o,c),i);n.push(d),o=c}return n}getFlatMidpoints(){const t=[],e=this.flatCoordinates;let i=0;const n=this.ends_,o=this.stride;for(let a=0,h=n.length;a<h;++a){const c=n[a],d=Nd(e,i,c,o,.5);ti(t,d),i=c}return t}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=Gm(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,i),new To(e,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(t){return Xm(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Ha(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}const q0=To;class Bl extends en{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){this.flatCoordinates?ti(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()}clone(){const t=new Bl(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<Xi(this.getExtent(),t,e))return n;const o=this.flatCoordinates,a=this.stride;for(let h=0,c=o.length;h<c;h+=a){const d=Ji(t,e,o[h],o[h+1]);if(d<n){n=d;for(let f=0;f<a;++f)i[f]=o[h+f];i.length=a}}return n}getCoordinates(){return Li(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new Hs(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){const t=this.flatCoordinates,e=this.layout,i=this.stride,n=[];for(let o=0,a=t.length;o<a;o+=i){const h=new Hs(t.slice(o,o+i),e);n.push(h)}return n}getType(){return"MultiPoint"}intersectsExtent(t){const e=this.flatCoordinates,i=this.stride;for(let n=0,o=e.length;n<o;n+=i){const a=e[n],h=e[n+1];if(Ta(t,a,h))return!0}return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Zs(this.flatCoordinates,0,t,this.stride),this.changed()}}const Gd=Bl;function J0(r,t,e,i){const n=[];let o=ge();for(let a=0,h=e.length;a<h;++a){const c=e[a];o=Sc(r,t,c[0],i),n.push((o[0]+o[2])/2,(o[1]+o[3])/2),t=c[c.length-1]}return n}class Co extends en{constructor(t,e,i){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(t[0])){let n=this.getLayout();const o=t,a=[],h=[];for(let c=0,d=o.length;c<d;++c){const f=o[c];c===0&&(n=f.getLayout());const p=a.length,m=f.getEnds();for(let y=0,v=m.length;y<v;++y)m[y]+=p;ti(a,f.getFlatCoordinates()),h.push(m)}e=n,t=a,i=h}e!==void 0&&i?(this.setFlatCoordinates(e,t),this.endss_=i):this.setCoordinates(t,e)}appendPolygon(t){let e;if(!this.flatCoordinates)this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();else{const i=this.flatCoordinates.length;ti(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(let n=0,o=e.length;n<o;++n)e[n]+=i}this.endss_.push(e),this.changed()}clone(){const t=this.endss_.length,e=new Array(t);for(let n=0;n<t;++n)e[n]=this.endss_[n].slice();const i=new Co(this.flatCoordinates.slice(),this.layout,e);return i.applyProperties(this),i}closestPointXY(t,e,i,n){return n<Xi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Fm(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),zm(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return Hm(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return Zm(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),mu(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,Xa(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=J0(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Vm(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Gd(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;qm(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=mu(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=jm(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,i),new Co(e,"XY",i)}getPolygon(t){if(t<0||this.endss_.length<=t)return null;let e;if(t===0)e=0;else{const o=this.endss_[t-1];e=o[o.length-1]}const i=this.endss_[t].slice(),n=i[i.length-1];if(e!==0)for(let o=0,a=i.length;o<a;++o)i[o]-=e;return new Xs(this.flatCoordinates.slice(e,n),this.layout,i)}getPolygons(){const t=this.layout,e=this.flatCoordinates,i=this.endss_,n=[];let o=0;for(let a=0,h=i.length;a<h;++a){const c=i[a].slice(),d=c[c.length-1];if(o!==0)for(let p=0,m=c.length;p<m;++p)c[p]-=o;const f=new Xs(e.slice(o,d),t,c);n.push(f),o=d}return n}getType(){return"MultiPolygon"}intersectsExtent(t){return Ym(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=Bm(this.flatCoordinates,0,t,this.stride,this.endss_);if(i.length===0)this.flatCoordinates.length=0;else{const n=i[i.length-1];this.flatCoordinates.length=n.length===0?0:n[n.length-1]}this.changed()}}const Q0=Co;class $0 extends Y0{constructor(t){t=t||{},super(),this.dataProjection=Gt(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=Gt(t.featureProjection)),this.geometryName_=t.geometryName,this.extractGeometryName_=t.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(t,e){let i=null;t.type==="Feature"?i=t:i={type:"Feature",geometry:t,properties:null};const n=Gl(i.geometry,e),o=new W0;return this.geometryName_?o.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&o.setGeometryName(i.geometry_name),o.setGeometry(n),"id"in i&&o.setId(i.id),i.properties&&o.setProperties(i.properties,!0),o}readFeaturesFromObject(t,e){const i=t;let n=null;if(i.type==="FeatureCollection"){const o=t;n=[];const a=o.features;for(let h=0,c=a.length;h<c;++h)n.push(this.readFeatureFromObject(a[h],e))}else n=[this.readFeatureFromObject(t,e)];return n}readGeometryFromObject(t,e){return Gl(t,e)}readProjectionFromObject(t){const e=t.crs;let i;if(e)if(e.type=="name")i=Gt(e.properties.name);else if(e.type==="EPSG")i=Gt("EPSG:"+e.properties.code);else throw new Error("Unknown SRS type");else i=this.dataProjection;return i}writeFeatureObject(t,e){e=this.adaptOptions(e);const i={type:"Feature",geometry:null,properties:null},n=t.getId();if(n!==void 0&&(i.id=n),!t.hasProperties())return i;const o=t.getProperties(),a=t.getGeometry();return a&&(i.geometry=Ul(a,e),delete o[t.getGeometryName()]),bn(o)||(i.properties=o),i}writeFeaturesObject(t,e){e=this.adaptOptions(e);const i=[];for(let n=0,o=t.length;n<o;++n)i.push(this.writeFeatureObject(t[n],e));return{type:"FeatureCollection",features:i}}writeGeometryObject(t,e){return Ul(t,this.adaptOptions(e))}}function Gl(r,t){if(!r)return null;let e;switch(r.type){case"Point":{e=ew(r);break}case"LineString":{e=iw(r);break}case"Polygon":{e=ow(r);break}case"MultiPoint":{e=rw(r);break}case"MultiLineString":{e=nw(r);break}case"MultiPolygon":{e=sw(r);break}case"GeometryCollection":{e=tw(r);break}default:throw new Error("Unsupported GeoJSON type: "+r.type)}return zd(e,!1,t)}function tw(r,t){const e=r.geometries.map(function(i){return Gl(i,t)});return new H0(e)}function ew(r){return new Hs(r.coordinates)}function iw(r){return new Nl(r.coordinates)}function nw(r){return new q0(r.coordinates)}function rw(r){return new Gd(r.coordinates)}function sw(r){return new Q0(r.coordinates)}function ow(r){return new Xs(r.coordinates)}function Ul(r,t){r=zd(r,!0,t);const e=r.getType();let i;switch(e){case"Point":{i=dw(r);break}case"LineString":{i=lw(r);break}case"Polygon":{i=fw(r,t);break}case"MultiPoint":{i=cw(r);break}case"MultiLineString":{i=hw(r);break}case"MultiPolygon":{i=uw(r,t);break}case"GeometryCollection":{i=aw(r,t);break}case"Circle":{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+e)}return i}function aw(r,t){return t=Object.assign({},t),delete t.featureProjection,{type:"GeometryCollection",geometries:r.getGeometriesArray().map(function(i){return Ul(i,t)})}}function lw(r,t){return{type:"LineString",coordinates:r.getCoordinates()}}function hw(r,t){return{type:"MultiLineString",coordinates:r.getCoordinates()}}function cw(r,t){return{type:"MultiPoint",coordinates:r.getCoordinates()}}function uw(r,t){let e;return t&&(e=t.rightHanded),{type:"MultiPolygon",coordinates:r.getCoordinates(e)}}function dw(r,t){return{type:"Point",coordinates:r.getCoordinates()}}function fw(r,t){let e;return t&&(e=t.rightHanded),{type:"Polygon",coordinates:r.getCoordinates(e)}}const Mo=$0,Br={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},So=[Br.FILL],Ri=[Br.STROKE],ln=[Br.BEGIN_PATH],Ud=[Br.CLOSE_PATH],et=Br;class gw{drawCustom(t,e,i,n){}drawGeometry(t){}setStyle(t){}drawCircle(t,e){}drawFeature(t,e){}drawGeometryCollection(t,e){}drawLineString(t,e){}drawMultiLineString(t,e){}drawMultiPoint(t,e){}drawMultiPolygon(t,e){}drawPoint(t,e){}drawPolygon(t,e){}drawText(t,e){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}const jd=gw;class pw extends jd{constructor(t,e,i,n){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=n,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const e=this.pixelRatio;return e==1?t:t.map(function(i){return i*e})}appendFlatPointCoordinates(t,e){const i=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,o=this.coordinates;let a=o.length;for(let h=0,c=t.length;h<c;h+=e)n[0]=t[h],n[1]=t[h+1],As(i,n)&&(o[a++]=n[0],o[a++]=n[1]);return a}appendFlatLineCoordinates(t,e,i,n,o,a){const h=this.coordinates;let c=h.length;const d=this.getBufferedMaxExtent();a&&(e+=n);let f=t[e],p=t[e+1];const m=this.tmpCoordinate_;let y=!0,v,E,C;for(v=e+n;v<i;v+=n)m[0]=t[v],m[1]=t[v+1],C=Ca(d,m),C!==E?(y&&(h[c++]=f,h[c++]=p,y=!1),h[c++]=m[0],h[c++]=m[1]):C===jt.INTERSECTING?(h[c++]=m[0],h[c++]=m[1],y=!1):y=!0,f=m[0],p=m[1],E=C;return(o&&y||v===e+n)&&(h[c++]=f,h[c++]=p),c}drawCustomCoordinates_(t,e,i,n,o){for(let a=0,h=i.length;a<h;++a){const c=i[a],d=this.appendFlatLineCoordinates(t,e,c,n,!1,!1);o.push(d),e=c}return e}drawCustom(t,e,i,n){this.beginGeometry(t,e);const o=t.getType(),a=t.getStride(),h=this.coordinates.length;let c,d,f,p,m;switch(o){case"MultiPolygon":c=t.getOrientedFlatCoordinates(),p=[];const y=t.getEndss();m=0;for(let v=0,E=y.length;v<E;++v){const C=[];m=this.drawCustomCoordinates_(c,m,y[v],a,C),p.push(C)}this.instructions.push([et.CUSTOM,h,p,t,i,Xa]),this.hitDetectionInstructions.push([et.CUSTOM,h,p,t,n||i,Xa]);break;case"Polygon":case"MultiLineString":f=[],c=o=="Polygon"?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),m=this.drawCustomCoordinates_(c,0,t.getEnds(),a,f),this.instructions.push([et.CUSTOM,h,f,t,i,wr]),this.hitDetectionInstructions.push([et.CUSTOM,h,f,t,n||i,wr]);break;case"LineString":case"Circle":c=t.getFlatCoordinates(),d=this.appendFlatLineCoordinates(c,0,c.length,a,!1,!1),this.instructions.push([et.CUSTOM,h,d,t,i,Li]),this.hitDetectionInstructions.push([et.CUSTOM,h,d,t,n||i,Li]);break;case"MultiPoint":c=t.getFlatCoordinates(),d=this.appendFlatPointCoordinates(c,a),d>h&&(this.instructions.push([et.CUSTOM,h,d,t,i,Li]),this.hitDetectionInstructions.push([et.CUSTOM,h,d,t,n||i,Li]));break;case"Point":c=t.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),d=this.coordinates.length,this.instructions.push([et.CUSTOM,h,d,t,i]),this.hitDetectionInstructions.push([et.CUSTOM,h,d,t,n||i]);break}this.endGeometry(e)}beginGeometry(t,e){this.beginGeometryInstruction1_=[et.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[et.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const i=t.length;let n,o,a=-1;for(e=0;e<i;++e)n=t[e],o=n[0],o==et.END_GEOMETRY?a=e:o==et.BEGIN_GEOMETRY&&(n[2]=e,D_(this.hitDetectionInstructions,a,e),a=-1)}setFillStrokeStyle(t,e){const i=this.state;if(t){const n=t.getColor();i.fillStyle=Ge(n||ae)}else i.fillStyle=void 0;if(e){const n=e.getColor();i.strokeStyle=Ge(n||Mr);const o=e.getLineCap();i.lineCap=o!==void 0?o:Rn;const a=e.getLineDash();i.lineDash=a?a.slice():ni;const h=e.getLineDashOffset();i.lineDashOffset=h||ri;const c=e.getLineJoin();i.lineJoin=c!==void 0?c:An;const d=e.getWidth();i.lineWidth=d!==void 0?d:Pr;const f=e.getMiterLimit();i.miterLimit=f!==void 0?f:Cr,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(t){const e=t.fillStyle,i=[et.SET_FILL_STYLE,e];return typeof e!="string"&&i.push(!0),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[et.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const i=t.fillStyle;(typeof i!="string"||t.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){const i=t.strokeStyle,n=t.lineCap,o=t.lineDash,a=t.lineDashOffset,h=t.lineJoin,c=t.lineWidth,d=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||o!=t.currentLineDash&&!ei(t.currentLineDash,o)||t.currentLineDashOffset!=a||t.currentLineJoin!=h||t.currentLineWidth!=c||t.currentMiterLimit!=d)&&(i!==void 0&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=o,t.currentLineDashOffset=a,t.currentLineJoin=h,t.currentLineWidth=c,t.currentMiterLimit=d)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[et.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Mc(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;Rs(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}const Gr=pw;class _w extends Gr{constructor(t,e,i,n){super(t,e,i,n),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(i,n);this.instructions.push([et.DRAW_IMAGE,o,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([et.DRAW_IMAGE,o,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(i,n);this.instructions.push([et.DRAW_IMAGE,o,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([et.DRAW_IMAGE,o,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(t,e){const i=t.getAnchor(),n=t.getSize(),o=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=o[0],this.originY_=o[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const mw=_w;class yw extends Gr{constructor(t,e,i,n){super(t,e,i,n)}drawFlatCoordinates_(t,e,i,n){const o=this.coordinates.length,a=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),h=[et.MOVE_TO_LINE_TO,o,a];return this.instructions.push(h),this.hitDetectionInstructions.push(h),i}drawLineString(t,e){const i=this.state,n=i.strokeStyle,o=i.lineWidth;if(n===void 0||o===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([et.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ni,ri],ln);const a=t.getFlatCoordinates(),h=t.getStride();this.drawFlatCoordinates_(a,0,a.length,h),this.hitDetectionInstructions.push(Ri),this.endGeometry(e)}drawMultiLineString(t,e){const i=this.state,n=i.strokeStyle,o=i.lineWidth;if(n===void 0||o===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([et.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ni,ri],ln);const a=t.getEnds(),h=t.getFlatCoordinates(),c=t.getStride();let d=0;for(let f=0,p=a.length;f<p;++f)d=this.drawFlatCoordinates_(h,d,a[f],c);this.hitDetectionInstructions.push(Ri),this.endGeometry(e)}finish(){const t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(Ri),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(Ri),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(ln)}}const vw=yw;class xw extends Gr{constructor(t,e,i,n){super(t,e,i,n)}drawFlatCoordinatess_(t,e,i,n){const o=this.state,a=o.fillStyle!==void 0,h=o.strokeStyle!==void 0,c=i.length;this.instructions.push(ln),this.hitDetectionInstructions.push(ln);for(let d=0;d<c;++d){const f=i[d],p=this.coordinates.length,m=this.appendFlatLineCoordinates(t,e,f,n,!0,!h),y=[et.MOVE_TO_LINE_TO,p,m];this.instructions.push(y),this.hitDetectionInstructions.push(y),h&&(this.instructions.push(Ud),this.hitDetectionInstructions.push(Ud)),e=f}return a&&(this.instructions.push(So),this.hitDetectionInstructions.push(So)),h&&(this.instructions.push(Ri),this.hitDetectionInstructions.push(Ri)),e}drawCircle(t,e){const i=this.state,n=i.fillStyle,o=i.strokeStyle;if(n===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([et.SET_FILL_STYLE,ae]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([et.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ni,ri]);const a=t.getFlatCoordinates(),h=t.getStride(),c=this.coordinates.length;this.appendFlatLineCoordinates(a,0,a.length,h,!1,!1);const d=[et.CIRCLE,c];this.instructions.push(ln,d),this.hitDetectionInstructions.push(ln,d),i.fillStyle!==void 0&&(this.instructions.push(So),this.hitDetectionInstructions.push(So)),i.strokeStyle!==void 0&&(this.instructions.push(Ri),this.hitDetectionInstructions.push(Ri)),this.endGeometry(e)}drawPolygon(t,e){const i=this.state,n=i.fillStyle,o=i.strokeStyle;if(n===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([et.SET_FILL_STYLE,ae]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([et.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ni,ri]);const a=t.getEnds(),h=t.getOrientedFlatCoordinates(),c=t.getStride();this.drawFlatCoordinatess_(h,0,a,c),this.endGeometry(e)}drawMultiPolygon(t,e){const i=this.state,n=i.fillStyle,o=i.strokeStyle;if(n===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([et.SET_FILL_STYLE,ae]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([et.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ni,ri]);const a=t.getEndss(),h=t.getOrientedFlatCoordinates(),c=t.getStride();let d=0;for(let f=0,p=a.length;f<p;++f)d=this.drawFlatCoordinatess_(h,d,a[f],c);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(t!==0){const e=this.coordinates;for(let i=0,n=e.length;i<n;++i)e[i]=nn(e[i],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;t.fillStyle!==void 0&&this.updateFillStyle(t,this.createFill),t.strokeStyle!==void 0&&this.updateStrokeStyle(t,this.applyStroke)}}const Zd=xw;function ww(r,t,e,i,n){const o=[];let a=e,h=0,c=t.slice(e,2);for(;h<r&&a+n<i;){const[d,f]=c.slice(-2),p=t[a+n],m=t[a+n+1],y=Math.sqrt((p-d)*(p-d)+(m-f)*(m-f));if(h+=y,h>=r){const v=(r-h+y)/y,E=pe(d,p,v),C=pe(f,m,v);c.push(E,C),o.push(c),c=[E,C],h==r&&(a+=n),h=0}else if(h<r)c.push(t[a+n],t[a+n+1]),a+=n;else{const v=y-h,E=pe(d,p,v/y),C=pe(f,m,v/y);c.push(E,C),o.push(c),c=[E,C],h=0,a+=n}}return h>0&&o.push(c),o}function Ew(r,t,e,i,n){let o=e,a=e,h=0,c=0,d=e,f,p,m,y,v,E,C,S,w,b;for(p=e;p<i;p+=n){const T=t[p],P=t[p+1];v!==void 0&&(w=T-v,b=P-E,y=Math.sqrt(w*w+b*b),C!==void 0&&(c+=m,f=Math.acos((C*w+S*b)/(m*y)),f>r&&(c>h&&(h=c,o=d,a=p),c=0,d=p-n)),m=y,C=w,S=b),v=T,E=P}return c+=y,c>h?[d,p]:[o,a]}const Po={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class Lw extends Gr{constructor(t,e,i,n){super(t,e,i,n),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[ae]={fillStyle:ae},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e){const i=this.textFillState_,n=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!i&&!n)return;const a=this.coordinates;let h=a.length;const c=t.getType();let d=null,f=t.getStride();if(o.placement==="line"&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!se(this.getBufferedMaxExtent(),t.getExtent()))return;let p;if(d=t.getFlatCoordinates(),c=="LineString")p=[d.length];else if(c=="MultiLineString")p=t.getEnds();else if(c=="Polygon")p=t.getEnds().slice(0,1);else if(c=="MultiPolygon"){const E=t.getEndss();p=[];for(let C=0,S=E.length;C<S;++C)p.push(E[C][0])}this.beginGeometry(t,e);const m=o.repeat,y=m?void 0:o.textAlign;let v=0;for(let E=0,C=p.length;E<C;++E){let S;m?S=ww(m*this.resolution,d,v,p[E],f):S=[d.slice(v,p[E])];for(let w=0,b=S.length;w<b;++w){const T=S[w];let P=0,R=T.length;if(y==null){const O=Ew(o.maxAngle,T,0,T.length,2);P=O[0],R=O[1]}for(let O=P;O<R;O+=f)a.push(T[O],T[O+1]);const I=a.length;v=p[E],this.drawChars_(h,I),h=I}}this.endGeometry(e)}else{let p=o.overflow?null:[];switch(c){case"Point":case"MultiPoint":d=t.getFlatCoordinates();break;case"LineString":d=t.getFlatMidpoint();break;case"Circle":d=t.getCenter();break;case"MultiLineString":d=t.getFlatMidpoints(),f=2;break;case"Polygon":d=t.getFlatInteriorPoint(),o.overflow||p.push(d[2]/this.resolution),f=3;break;case"MultiPolygon":const S=t.getFlatInteriorPoints();d=[];for(let w=0,b=S.length;w<b;w+=3)o.overflow||p.push(S[w+2]/this.resolution),d.push(S[w],S[w+1]);if(d.length===0)return;f=2;break}const m=this.appendFlatPointCoordinates(d,f);if(m===h)return;if(p&&(m-h)/2!==d.length/f){let S=h/2;p=p.filter((w,b)=>{const T=a[(S+b)*2]===d[b*f]&&a[(S+b)*2+1]===d[b*f+1];return T||--S,T})}this.saveTextStates_(),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&this.updateFillStyle(this.state,this.createFill),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);let y=o.padding;if(y!=sn&&(o.scale[0]<0||o.scale[1]<0)){let S=o.padding[0],w=o.padding[1],b=o.padding[2],T=o.padding[3];o.scale[0]<0&&(w=-w,T=-T),o.scale[1]<0&&(S=-S,b=-b),y=[S,w,b,T]}const v=this.pixelRatio;this.instructions.push([et.DRAW_IMAGE,h,m,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,y==sn?sn:y.map(function(S){return S*v}),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]);const E=1/v,C=this.state.fillStyle;o.backgroundFill&&(this.state.fillStyle=ae,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([et.DRAW_IMAGE,h,m,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[E,E],NaN,void 0,this.declutterImageWithText_,y,!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?ae:this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]),o.backgroundFill&&(this.state.fillStyle=C,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,n=this.strokeKey_;t&&(n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const o=this.textKey_;o in this.textStates||(this.textStates[o]={font:e.font,textAlign:e.textAlign||Sr,justify:e.justify,textBaseline:e.textBaseline||no,scale:e.scale});const a=this.fillKey_;i&&(a in this.fillStates||(this.fillStates[a]={fillStyle:i.fillStyle}))}drawChars_(t,e){const i=this.textStrokeState_,n=this.textState_,o=this.strokeKey_,a=this.textKey_,h=this.fillKey_;this.saveTextStates_();const c=this.pixelRatio,d=Po[n.textBaseline],f=this.textOffsetY_*c,p=this.text_,m=i?i.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([et.DRAW_CHARS,t,e,d,n.overflow,h,n.maxAngle,c,f,o,m*c,p,a,1]),this.hitDetectionInstructions.push([et.DRAW_CHARS,t,e,d,n.overflow,h&&ae,n.maxAngle,c,f,o,m*c,p,a,1/c])}setTextStyle(t,e){let i,n,o;if(!t)this.text_="";else{const a=t.getFill();a?(n=this.textFillState_,n||(n={},this.textFillState_=n),n.fillStyle=Ge(a.getColor()||ae)):(n=null,this.textFillState_=n);const h=t.getStroke();if(!h)o=null,this.textStrokeState_=o;else{o=this.textStrokeState_,o||(o={},this.textStrokeState_=o);const v=h.getLineDash(),E=h.getLineDashOffset(),C=h.getWidth(),S=h.getMiterLimit();o.lineCap=h.getLineCap()||Rn,o.lineDash=v?v.slice():ni,o.lineDashOffset=E===void 0?ri:E,o.lineJoin=h.getLineJoin()||An,o.lineWidth=C===void 0?Pr:C,o.miterLimit=S===void 0?Cr:S,o.strokeStyle=Ge(h.getColor()||Mr)}i=this.textState_;const c=t.getFont()||ku;xy(c);const d=t.getScaleArray();i.overflow=t.getOverflow(),i.font=c,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.repeat=t.getRepeat(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||no,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||sn,i.scale=d===void 0?[1,1]:d;const f=t.getOffsetX(),p=t.getOffsetY(),m=t.getRotateWithView(),y=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=f===void 0?0:f,this.textOffsetY_=p===void 0?0:p,this.textRotateWithView_=m===void 0?!1:m,this.textRotation_=y===void 0?0:y,this.strokeKey_=o?(typeof o.strokeStyle=="string"?o.strokeStyle:ht(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=n?typeof n.fillStyle=="string"?n.fillStyle:"|"+ht(n.fillStyle):""}this.declutterImageWithText_=e}}const bw={Circle:Zd,Default:Gr,Image:mw,LineString:vw,Polygon:Zd,Text:Lw};class Tw{constructor(t,e,i,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=i,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const i=this.buildersByZIndex_[e];for(const n in i){const o=i[n].finish();t[e][n]=o}}return t}getBuilder(t,e){const i=t!==void 0?t.toString():"0";let n=this.buildersByZIndex_[i];n===void 0&&(n={},this.buildersByZIndex_[i]=n);let o=n[e];if(o===void 0){const a=bw[e];o=new a(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=o}return o}}const Wd=Tw;function Cw(r,t,e,i,n,o,a,h,c,d,f,p){let m=r[t],y=r[t+1],v=0,E=0,C=0,S=0;function w(){v=m,E=y,t+=i,m=r[t],y=r[t+1],S+=C,C=Math.sqrt((m-v)*(m-v)+(y-E)*(y-E))}do w();while(t<e-i&&S+C<o);let b=C===0?0:(o-S)/C;const T=pe(v,m,b),P=pe(E,y,b),R=t-i,I=S,O=o+h*c(d,n,f);for(;t<e-i&&S+C<O;)w();b=C===0?0:(O-S)/C;const U=pe(v,m,b),X=pe(E,y,b);let q;if(p){const H=[T,P,U,X];iu(H,0,4,2,p,H,H),q=H[0]>H[2]}else q=T>U;const Y=Math.PI,rt=[],pt=R+i===t;t=R,C=0,S=I,m=r[t],y=r[t+1];let V;if(pt){w(),V=Math.atan2(y-E,m-v),q&&(V+=V>0?-Y:Y);const H=(U+T)/2,G=(X+P)/2;return rt[0]=[H,G,(O-o)/2,V,n],rt}n=n.replace(/\n/g," ");for(let H=0,G=n.length;H<G;){w();let N=Math.atan2(y-E,m-v);if(q&&(N+=N>0?-Y:Y),V!==void 0){let tt=N-V;if(tt+=tt>Y?-2*Y:tt<-Y?2*Y:0,Math.abs(tt)>a)return null}V=N;const vt=H;let Z=0;for(;H<G;++H){const tt=q?G-H-1:H,J=h*c(d,n[tt],f);if(t+i<e&&S+C<o+Z+J/2)break;Z+=J}if(H===vt)continue;const at=q?n.substring(G-vt,G-H):n.substring(vt,H);b=C===0?0:(o+Z/2-S)/C;const z=pe(v,m,b),Lt=pe(E,y,b);rt.push([z,Lt,Z/2,N,at]),o+=Z}return rt}const Vn=ge(),Ai=[],hi=[],ci=[],Ii=[];function Hd(r){return r[3].declutterBox}const Vd=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function jl(r,t){return t==="start"?t=Vd.test(r)?"right":"left":t==="end"&&(t=Vd.test(r)?"left":"right"),Po[t]}function Mw(r,t,e){return e>0&&r.push(`
|
|
446
|
-
`,""),r.push(t,""),r}class
|
|
447
|
-
`).reduce(
|
|
448
|
-
`){pt+=rt,rt=0,X=m*T+U*y,++H;continue}const at=v[N+1]||c.font;at!==G&&(n&&q.push("font",at),i&&Y.push("font",at),G=at),rt=Math.max(rt,w[V]);const z=[Z,X+U*S[V]+m*(S[V]-b[H]),.5*(y+rt)+pt];X+=S[V],n&&q.push("strokeText",z),i&&Y.push("fillText",z),++V}return Array.prototype.push.apply(P,q),Array.prototype.push.apply(P,Y),this.labels_[o]=O,O}replayTextBackground_(t,e,i,n,o,a,h){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,o),t.lineTo.apply(t,e),a&&(this.alignFill_=a[2],this.fill_(t)),h&&(this.setStrokeStyle_(t,h),t.stroke())}calculateImageOrLabelDimensions_(t,e,i,n,o,a,h,c,d,f,p,m,y,v,E,C){h*=m[0],c*=m[1];let S=i-h,w=n-c;const b=o+d>t?t-d:o,T=a+f>e?e-f:a,P=v[3]+b*m[0]+v[1],R=v[0]+T*m[1]+v[2],I=S-v[3],O=w-v[0];(E||p!==0)&&(Ai[0]=I,Ii[0]=I,Ai[1]=O,hi[1]=O,hi[0]=I+P,ci[0]=hi[0],ci[1]=O+R,Ii[1]=ci[1]);let U;return p!==0?(U=ze(Vt(),i,n,1,1,p,-i,-n),Ot(U,Ai),Ot(U,hi),Ot(U,ci),Ot(U,Ii),wi(Math.min(Ai[0],hi[0],ci[0],Ii[0]),Math.min(Ai[1],hi[1],ci[1],Ii[1]),Math.max(Ai[0],hi[0],ci[0],Ii[0]),Math.max(Ai[1],hi[1],ci[1],Ii[1]),Vn)):wi(Math.min(I,I+P),Math.min(O,O+R),Math.max(I,I+P),Math.max(O,O+R),Vn),y&&(S=Math.round(S),w=Math.round(w)),{drawImageX:S,drawImageY:w,drawImageW:b,drawImageH:T,originX:d,originY:f,declutterBox:{minX:Vn[0],minY:Vn[1],maxX:Vn[2],maxY:Vn[3],value:C},canvasTransform:U,scale:m}}replayImageOrLabel_(t,e,i,n,o,a,h){const c=!!(a||h),d=n.declutterBox,f=t.canvas,p=h?h[2]*n.scale[0]/2:0;return d.minX-p<=f.width/e&&d.maxX+p>=0&&d.minY-p<=f.height/e&&d.maxY+p>=0&&(c&&this.replayTextBackground_(t,Ai,hi,ci,Ii,a,h),Ly(t,n.canvasTransform,o,i,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0}fill_(t){if(this.alignFill_){const e=Ot(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,i,n){const o=this.textStates[e],a=this.createLabel(t,e,n,i),h=this.strokeStates[i],c=this.pixelRatio,d=jl(Array.isArray(t)?t[0]:t,o.textAlign||Sr),f=Po[o.textBaseline||no],p=h&&h.lineWidth?h.lineWidth:0,m=a.width/c-2*o.scale[0],y=d*m+2*(.5-d)*p,v=f*a.height/c+2*(.5-f)*p;return{label:a,anchorX:y,anchorY:v}}execute_(t,e,i,n,o,a,h,c){let d;this.pixelCoordinates_&&ei(i,this.renderedTransform_)?d=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),d=tn(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Cm(this.renderedTransform_,i));let f=0;const p=n.length;let m=0,y,v,E,C,S,w,b,T,P,R,I,O,U=0,X=0,q=null,Y=null;const rt=this.coordinateCache_,pt=this.viewRotation_,V=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,H={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:pt},G=this.instructions!=n||this.overlaps?0:200;let N,vt,Z,at;for(;f<p;){const z=n[f];switch(z[0]){case et.BEGIN_GEOMETRY:N=z[1],at=z[3],N.getGeometry()?h!==void 0&&!se(h,at.getExtent())?f=z[2]+1:++f:f=z[2];break;case et.BEGIN_PATH:U>G&&(this.fill_(t),U=0),X>G&&(t.stroke(),X=0),!U&&!X&&(t.beginPath(),C=NaN,S=NaN),++f;break;case et.CIRCLE:m=z[1];const tt=d[m],J=d[m+1],st=d[m+2],Ft=d[m+3],Mt=st-tt,ve=Ft-J,Ze=Math.sqrt(Mt*Mt+ve*ve);t.moveTo(tt+Ze,J),t.arc(tt,J,Ze,0,2*Math.PI,!0),++f;break;case et.CLOSE_PATH:t.closePath(),++f;break;case et.CUSTOM:m=z[1],y=z[2];const Di=z[3],xe=z[4],Oi=z.length==6?z[5]:void 0;H.geometry=Di,H.feature=N,f in rt||(rt[f]=[]);const We=rt[f];Oi?Oi(d,m,y,2,We):(We[0]=d[m],We[1]=d[m+1],We.length=2),xe(We,H),++f;break;case et.DRAW_IMAGE:m=z[1],y=z[2],T=z[3],v=z[4],E=z[5];let Fi=z[6];const Se=z[7],zi=z[8],di=z[9],Xn=z[10];let fi=z[11];const hn=z[12];let Xt=z[13];const ie=z[14],me=z[15];if(!T&&z.length>=20){P=z[19],R=z[20],I=z[21],O=z[22];const ne=this.drawLabelWithPointPlacement_(P,R,I,O);T=ne.label,z[3]=T;const ji=z[23];v=(ne.anchorX-ji)*this.pixelRatio,z[4]=v;const he=z[24];E=(ne.anchorY-he)*this.pixelRatio,z[5]=E,Fi=T.height,z[6]=Fi,Xt=T.width,z[13]=Xt}let Pe;z.length>25&&(Pe=z[25]);let He,Ve,ke;z.length>17?(He=z[16],Ve=z[17],ke=z[18]):(He=sn,Ve=!1,ke=!1),Xn&&V?fi+=pt:!Xn&&!V&&(fi-=pt);let Ni=0;for(;m<y;m+=2){if(Pe&&Pe[Ni++]<Xt/this.pixelRatio)continue;const ne=this.calculateImageOrLabelDimensions_(T.width,T.height,d[m],d[m+1],Xt,Fi,v,E,zi,di,fi,hn,o,He,Ve||ke,N),ji=[t,e,T,ne,Se,Ve?q:null,ke?Y:null];if(c){if(ie==="none")continue;if(ie==="obstacle"){c.insert(ne.declutterBox);continue}else{let he,Re;if(me){const Yt=y-m;if(!me[Yt]){me[Yt]=ji;continue}if(he=me[Yt],delete me[Yt],Re=Hd(he),c.collides(Re))continue}if(c.collides(ne.declutterBox))continue;he&&(c.insert(Re),this.replayImageOrLabel_.apply(this,he)),c.insert(ne.declutterBox)}}this.replayImageOrLabel_.apply(this,ji)}++f;break;case et.DRAW_CHARS:const cn=z[1],Wt=z[2],Ur=z[3],ko=z[4];O=z[5];const jr=z[6],Zr=z[7],Ro=z[8];I=z[9];const gi=z[10];P=z[11],R=z[12];const Ao=[z[13],z[13]],Wr=this.textStates[R],Bi=Wr.font,Gi=[Wr.scale[0]*Zr,Wr.scale[1]*Zr];let Ui;Bi in this.widths_?Ui=this.widths_[Bi]:(Ui={},this.widths_[Bi]=Ui);const Io=Bd(d,cn,Wt,2),Do=Math.abs(Gi[0])*Au(Bi,P,Ui);if(ko||Do<=Io){const ne=this.textStates[R].textAlign,ji=(Io-Do)*jl(P,ne),he=Cw(d,cn,Wt,2,P,ji,jr,Math.abs(Gi[0]),Au,Bi,Ui,V?0:this.viewRotation_);t:if(he){const Re=[];let Yt,Yn,Kn,te,ce;if(I)for(Yt=0,Yn=he.length;Yt<Yn;++Yt){ce=he[Yt],Kn=ce[4],te=this.createLabel(Kn,R,"",I),v=ce[2]+(Gi[0]<0?-gi:gi),E=Ur*te.height+(.5-Ur)*2*gi*Gi[1]/Gi[0]-Ro;const zt=this.calculateImageOrLabelDimensions_(te.width,te.height,ce[0],ce[1],te.width,te.height,v,E,0,0,ce[3],Ao,!1,sn,!1,N);if(c&&c.collides(zt.declutterBox))break t;Re.push([t,e,te,zt,1,null,null])}if(O)for(Yt=0,Yn=he.length;Yt<Yn;++Yt){ce=he[Yt],Kn=ce[4],te=this.createLabel(Kn,R,O,""),v=ce[2],E=Ur*te.height-Ro;const zt=this.calculateImageOrLabelDimensions_(te.width,te.height,ce[0],ce[1],te.width,te.height,v,E,0,0,ce[3],Ao,!1,sn,!1,N);if(c&&c.collides(zt.declutterBox))break t;Re.push([t,e,te,zt,1,null,null])}c&&c.load(Re.map(Hd));for(let zt=0,K=Re.length;zt<K;++zt)this.replayImageOrLabel_.apply(this,Re[zt])}}++f;break;case et.END_GEOMETRY:if(a!==void 0){N=z[1];const ne=a(N,at);if(ne)return ne}++f;break;case et.FILL:G?U++:this.fill_(t),++f;break;case et.MOVE_TO_LINE_TO:for(m=z[1],y=z[2],vt=d[m],Z=d[m+1],w=vt+.5|0,b=Z+.5|0,(w!==C||b!==S)&&(t.moveTo(vt,Z),C=w,S=b),m+=2;m<y;m+=2)vt=d[m],Z=d[m+1],w=vt+.5|0,b=Z+.5|0,(m==y-2||w!==C||b!==S)&&(t.lineTo(vt,Z),C=w,S=b);++f;break;case et.SET_FILL_STYLE:q=z,this.alignFill_=z[2],U&&(this.fill_(t),U=0,X&&(t.stroke(),X=0)),t.fillStyle=z[1],++f;break;case et.SET_STROKE_STYLE:Y=z,X&&(t.stroke(),X=0),this.setStrokeStyle_(t,z),++f;break;case et.STROKE:G?X++:t.stroke(),++f;break;default:++f;break}}U&&this.fill_(t),X&&t.stroke()}execute(t,e,i,n,o,a){this.viewRotation_=n,this.execute_(t,e,i,this.instructions,o,void 0,void 0,a)}executeHitDetection(t,e,i,n,o){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,n,o)}}const Pw=Sw,Zl=["Polygon","Circle","LineString","Image","Text","Default"];class kw{constructor(t,e,i,n,o,a){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Vt(),this.createExecutors_(o)}clip(t,e){const i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t){for(const e in t){let i=this.executorsByZIndex_[e];i===void 0&&(i={},this.executorsByZIndex_[e]=i);const n=t[e];for(const o in n){const a=n[o];i[o]=new Pw(this.resolution_,this.pixelRatio_,this.overlaps_,a)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const i=this.executorsByZIndex_[e];for(let n=0,o=t.length;n<o;++n)if(t[n]in i)return!0}return!1}forEachFeatureAtCoordinate(t,e,i,n,o,a){n=Math.round(n);const h=n*2+1,c=ze(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-i,-t[0],-t[1]),d=!this.hitDetectionContext_;d&&(this.hitDetectionContext_=Jt(h,h,void 0,{willReadFrequently:!0}));const f=this.hitDetectionContext_;f.canvas.width!==h||f.canvas.height!==h?(f.canvas.width=h,f.canvas.height=h):d||f.clearRect(0,0,h,h);let p;this.renderBuffer_!==void 0&&(p=ge(),vr(p,t),Rs(p,e*(this.renderBuffer_+n),p));const m=Rw(n);let y;function v(P,R){const I=f.getImageData(0,0,h,h).data;for(let O=0,U=m.length;O<U;O++)if(I[m[O]]>0){if(!a||y!=="Image"&&y!=="Text"||a.includes(P)){const X=(m[O]-3)/4,q=n-X%h,Y=n-(X/h|0),rt=o(P,R,q*q+Y*Y);if(rt)return rt}f.clearRect(0,0,h,h);break}}const E=Object.keys(this.executorsByZIndex_).map(Number);E.sort(xi);let C,S,w,b,T;for(C=E.length-1;C>=0;--C){const P=E[C].toString();for(w=this.executorsByZIndex_[P],S=Zl.length-1;S>=0;--S)if(y=Zl[S],b=w[y],b!==void 0&&(T=b.executeHitDetection(f,c,i,v,p),T))return T}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const i=e[0],n=e[1],o=e[2],a=e[3],h=[i,n,i,a,o,a,o,n];return tn(h,0,8,2,t,h),h}isEmpty(){return bn(this.executorsByZIndex_)}execute(t,e,i,n,o,a,h){const c=Object.keys(this.executorsByZIndex_).map(Number);c.sort(xi),this.maxExtent_&&(t.save(),this.clip(t,i)),a=a||Zl;let d,f,p,m,y,v;for(h&&c.reverse(),d=0,f=c.length;d<f;++d){const E=c[d].toString();for(y=this.executorsByZIndex_[E],p=0,m=a.length;p<m;++p){const C=a[p];v=y[C],v!==void 0&&v.execute(t,e,i,n,o,h)}}this.maxExtent_&&t.restore()}}const Wl={};function Rw(r){if(Wl[r]!==void 0)return Wl[r];const t=r*2+1,e=r*r,i=new Array(e+1);for(let o=0;o<=r;++o)for(let a=0;a<=r;++a){const h=o*o+a*a;if(h>e)break;let c=i[h];c||(c=[],i[h]=c),c.push(((r+o)*t+(r+a))*4+3),o>0&&c.push(((r-o)*t+(r+a))*4+3),a>0&&(c.push(((r+o)*t+(r-a))*4+3),o>0&&c.push(((r-o)*t+(r-a))*4+3))}const n=[];for(let o=0,a=i.length;o<a;++o)i[o]&&n.push(...i[o]);return Wl[r]=n,n}const Xd=kw;class Aw extends jd{constructor(t,e,i,n,o,a,h){super(),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=n,this.transformRotation_=n?ka(Math.atan2(n[1],n[0]),10):0,this.viewRotation_=o,this.squaredTolerance_=a,this.userTransform_=h,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=Vt()}drawImages_(t,e,i,n){if(!this.image_)return;const o=tn(t,e,i,n,this.transform_,this.pixelCoordinates_),a=this.context_,h=this.tmpLocalTransform_,c=a.globalAlpha;this.imageOpacity_!=1&&(a.globalAlpha=c*this.imageOpacity_);let d=this.imageRotation_;this.transformRotation_===0&&(d-=this.viewRotation_),this.imageRotateWithView_&&(d+=this.viewRotation_);for(let f=0,p=o.length;f<p;f+=2){const m=o[f]-this.imageAnchorX_,y=o[f+1]-this.imageAnchorY_;if(d!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const v=m+this.imageAnchorX_,E=y+this.imageAnchorY_;ze(h,v,E,1,1,d,-v,-E),a.save(),a.transform.apply(a,h),a.translate(v,E),a.scale(this.imageScale_[0],this.imageScale_[1]),a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),a.restore()}else a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,m,y,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(a.globalAlpha=c)}drawText_(t,e,i,n){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const o=tn(t,e,i,n,this.transform_,this.pixelCoordinates_),a=this.context_;let h=this.textRotation_;for(this.transformRotation_===0&&(h-=this.viewRotation_),this.textRotateWithView_&&(h+=this.viewRotation_);e<i;e+=n){const c=o[e]+this.textOffsetX_,d=o[e+1]+this.textOffsetY_;h!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(a.save(),a.translate(c-this.textOffsetX_,d-this.textOffsetY_),a.rotate(h),a.translate(this.textOffsetX_,this.textOffsetY_),a.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&a.strokeText(this.text_,0,0),this.textFillState_&&a.fillText(this.text_,0,0),a.restore()):(this.textStrokeState_&&a.strokeText(this.text_,c,d),this.textFillState_&&a.fillText(this.text_,c,d))}}moveToLineTo_(t,e,i,n,o){const a=this.context_,h=tn(t,e,i,n,this.transform_,this.pixelCoordinates_);a.moveTo(h[0],h[1]);let c=h.length;o&&(c-=2);for(let d=2;d<c;d+=2)a.lineTo(h[d],h[d+1]);return o&&a.closePath(),i}drawRings_(t,e,i,n){for(let o=0,a=i.length;o<a;++o)e=this.moveToLineTo_(t,e,i[o],n,!0);return e}drawCircle(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!se(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=Om(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],n=e[3]-e[1],o=Math.sqrt(i*i+n*n),a=this.context_;a.beginPath(),a.arc(e[0],e[1],o,0,2*Math.PI),this.fillState_&&a.fill(),this.strokeState_&&a.stroke()}this.text_!==""&&this.drawText_(t.getCenter(),0,2,2)}}setStyle(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())}setTransform(t){this.transform_=t}drawGeometry(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t);break}}drawFeature(t,e){const i=e.getGeometryFunction()(t);i&&(this.setStyle(e),this.drawGeometry(i))}drawGeometryCollection(t){const e=t.getGeometriesArray();for(let i=0,n=e.length;i<n;++i)this.drawGeometry(e[i])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),this.text_!==""&&this.drawText_(e,0,e.length,i)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),this.text_!==""&&this.drawText_(e,0,e.length,i)}drawLineString(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!se(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(this.text_!==""){const e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}}}drawMultiLineString(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getExtent();if(se(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const i=this.context_,n=t.getFlatCoordinates();let o=0;const a=t.getEnds(),h=t.getStride();i.beginPath();for(let c=0,d=a.length;c<d;++c)o=this.moveToLineTo_(n,o,a[c],h,!1);i.stroke()}if(this.text_!==""){const i=t.getFlatMidpoints();this.drawText_(i,0,i.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!se(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoint();this.drawText_(e,0,2,2)}}}drawMultiPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!se(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_,i=t.getOrientedFlatCoordinates();let n=0;const o=t.getEndss(),a=t.getStride();e.beginPath();for(let h=0,c=o.length;h<c;++h){const d=o[h];n=this.drawRings_(i,n,d,a)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoints();this.drawText_(e,0,e.length,2)}}}setContextFillState_(t){const e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){const e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),ei(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset,e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})}setContextTextState_(t){const e=this.context_,i=this.contextTextState_,n=t.textAlign?t.textAlign:Sr;i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=n&&(i.textAlign=n,e.textAlign=n),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(!t)this.fillState_=null;else{const i=t.getColor();this.fillState_={fillStyle:Ge(i||ae)}}if(!e)this.strokeState_=null;else{const i=e.getColor(),n=e.getLineCap(),o=e.getLineDash(),a=e.getLineDashOffset(),h=e.getLineJoin(),c=e.getWidth(),d=e.getMiterLimit(),f=o||ni;this.strokeState_={lineCap:n!==void 0?n:Rn,lineDash:this.pixelRatio_===1?f:f.map(p=>p*this.pixelRatio_),lineDashOffset:(a||ri)*this.pixelRatio_,lineJoin:h!==void 0?h:An,lineWidth:(c!==void 0?c:Pr)*this.pixelRatio_,miterLimit:d!==void 0?d:Cr,strokeStyle:Ge(i||Mr)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const i=t.getPixelRatio(this.pixelRatio_),n=t.getAnchor(),o=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*i,this.imageAnchorY_=n[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=o[0],this.imageOriginY_=o[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const a=t.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/i,a[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const y=e.getColor();this.textFillState_={fillStyle:Ge(y||ae)}}const i=t.getStroke();if(!i)this.textStrokeState_=null;else{const y=i.getColor(),v=i.getLineCap(),E=i.getLineDash(),C=i.getLineDashOffset(),S=i.getLineJoin(),w=i.getWidth(),b=i.getMiterLimit();this.textStrokeState_={lineCap:v!==void 0?v:Rn,lineDash:E||ni,lineDashOffset:C||ri,lineJoin:S!==void 0?S:An,lineWidth:w!==void 0?w:Pr,miterLimit:b!==void 0?b:Cr,strokeStyle:Ge(y||Mr)}}const n=t.getFont(),o=t.getOffsetX(),a=t.getOffsetY(),h=t.getRotateWithView(),c=t.getRotation(),d=t.getScaleArray(),f=t.getText(),p=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:n!==void 0?n:ku,textAlign:p!==void 0?p:Sr,textBaseline:m!==void 0?m:no},this.text_=f!==void 0?Array.isArray(f)?f.reduce((y,v,E)=>y+=E%2?" ":v,""):f:"",this.textOffsetX_=o!==void 0?this.pixelRatio_*o:0,this.textOffsetY_=a!==void 0?this.pixelRatio_*a:0,this.textRotateWithView_=h!==void 0?h:!1,this.textRotation_=c!==void 0?c:0,this.textScale_=[this.pixelRatio_*d[0],this.pixelRatio_*d[1]]}}}const Iw=Aw,je=.5;function Dw(r,t,e,i,n,o,a){const h=r[0]*je,c=r[1]*je,d=Jt(h,c);d.imageSmoothingEnabled=!1;const f=d.canvas,p=new Iw(d,je,n,null,a),m=e.length,y=Math.floor((256*256*256-1)/m),v={};for(let C=1;C<=m;++C){const S=e[C-1],w=S.getStyleFunction()||i;if(!w)continue;let b=w(S,o);if(!b)continue;Array.isArray(b)||(b=[b]);const P=(C*y).toString(16).padStart(7,"#00000");for(let R=0,I=b.length;R<I;++R){const O=b[R],U=O.getGeometryFunction()(S);if(!U||!se(n,U.getExtent()))continue;const X=O.clone(),q=X.getFill();q&&q.setColor(P);const Y=X.getStroke();Y&&(Y.setColor(P),Y.setLineDash(null)),X.setText(void 0);const rt=O.getImage();if(rt){const G=rt.getImageSize();if(!G)continue;const N=Jt(G[0],G[1],void 0,{alpha:!1}),vt=N.canvas;N.fillStyle=P,N.fillRect(0,0,vt.width,vt.height),X.setImage(new ml({img:vt,anchor:rt.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:rt.getOrigin(),opacity:1,size:rt.getSize(),scale:rt.getScale(),rotation:rt.getRotation(),rotateWithView:rt.getRotateWithView()}))}const pt=X.getZIndex()||0;let V=v[pt];V||(V={},v[pt]=V,V.Polygon=[],V.Circle=[],V.LineString=[],V.Point=[]);const H=U.getType();if(H==="GeometryCollection"){const G=U.getGeometriesArrayRecursive();for(let N=0,vt=G.length;N<vt;++N){const Z=G[N];V[Z.getType().replace("Multi","")].push(Z,X)}}else V[H.replace("Multi","")].push(U,X)}}const E=Object.keys(v).map(Number).sort(xi);for(let C=0,S=E.length;C<S;++C){const w=v[E[C]];for(const b in w){const T=w[b];for(let P=0,R=T.length;P<R;P+=2){p.setStyle(T[P+1]);for(let I=0,O=t.length;I<O;++I)p.setTransform(t[I]),p.drawGeometry(T[P])}}}return d.getImageData(0,0,f.width,f.height)}function Ow(r,t,e){const i=[];if(e){const n=Math.floor(Math.round(r[0])*je),o=Math.floor(Math.round(r[1])*je),a=(At(n,0,e.width-1)+At(o,0,e.height-1)*e.width)*4,h=e.data[a],c=e.data[a+1],f=e.data[a+2]+256*(c+256*h),p=Math.floor((256*256*256-1)/t.length);f&&f%p===0&&i.push(t[f/p-1])}return i}const Fw=.5,Yd={Point:Hw,LineString:jw,Polygon:Xw,MultiPoint:Vw,MultiLineString:Zw,MultiPolygon:Ww,GeometryCollection:Uw,Circle:Bw};function zw(r,t){return parseInt(ht(r),10)-parseInt(ht(t),10)}function Nw(r,t){const e=Hl(r,t);return e*e}function Hl(r,t){return Fw*r/t}function Bw(r,t,e,i,n){const o=e.getFill(),a=e.getStroke();if(o||a){const c=r.getBuilder(e.getZIndex(),"Circle");c.setFillStrokeStyle(o,a),c.drawCircle(t,i)}const h=e.getText();if(h&&h.getText()){const c=(n||r).getBuilder(e.getZIndex(),"Text");c.setTextStyle(h),c.drawText(t,i)}}function Kd(r,t,e,i,n,o,a){let h=!1;const c=e.getImage();if(c){const d=c.getImageState();d==Ct.LOADED||d==Ct.ERROR?c.unlistenImageChange(n):(d==Ct.IDLE&&c.load(),c.listenImageChange(n),h=!0)}return Gw(r,t,e,i,o,a),h}function Gw(r,t,e,i,n,o){const a=e.getGeometryFunction()(t);if(!a)return;const h=a.simplifyTransformed(i,n);if(e.getRenderer())qd(r,h,e,t);else{const d=Yd[h.getType()];d(r,h,e,t,o)}}function qd(r,t,e,i){if(t.getType()=="GeometryCollection"){const o=t.getGeometries();for(let a=0,h=o.length;a<h;++a)qd(r,o[a],e,i);return}r.getBuilder(e.getZIndex(),"Default").drawCustom(t,i,e.getRenderer(),e.getHitDetectionRenderer())}function Uw(r,t,e,i,n){const o=t.getGeometriesArray();let a,h;for(a=0,h=o.length;a<h;++a){const c=Yd[o[a].getType()];c(r,o[a],e,i,n)}}function jw(r,t,e,i,n){const o=e.getStroke();if(o){const h=r.getBuilder(e.getZIndex(),"LineString");h.setFillStrokeStyle(null,o),h.drawLineString(t,i)}const a=e.getText();if(a&&a.getText()){const h=(n||r).getBuilder(e.getZIndex(),"Text");h.setTextStyle(a),h.drawText(t,i)}}function Zw(r,t,e,i,n){const o=e.getStroke();if(o){const h=r.getBuilder(e.getZIndex(),"LineString");h.setFillStrokeStyle(null,o),h.drawMultiLineString(t,i)}const a=e.getText();if(a&&a.getText()){const h=(n||r).getBuilder(e.getZIndex(),"Text");h.setTextStyle(a),h.drawText(t,i)}}function Ww(r,t,e,i,n){const o=e.getFill(),a=e.getStroke();if(a||o){const c=r.getBuilder(e.getZIndex(),"Polygon");c.setFillStrokeStyle(o,a),c.drawMultiPolygon(t,i)}const h=e.getText();if(h&&h.getText()){const c=(n||r).getBuilder(e.getZIndex(),"Text");c.setTextStyle(h),c.drawText(t,i)}}function Hw(r,t,e,i,n){const o=e.getImage(),a=e.getText();let h;if(o){if(o.getImageState()!=Ct.LOADED)return;let c=r;if(n){const f=o.getDeclutterMode();if(f!=="none")if(c=n,f==="obstacle"){const p=r.getBuilder(e.getZIndex(),"Image");p.setImageStyle(o,h),p.drawPoint(t,i)}else a&&a.getText()&&(h={})}const d=c.getBuilder(e.getZIndex(),"Image");d.setImageStyle(o,h),d.drawPoint(t,i)}if(a&&a.getText()){let c=r;n&&(c=n);const d=c.getBuilder(e.getZIndex(),"Text");d.setTextStyle(a,h),d.drawText(t,i)}}function Vw(r,t,e,i,n){const o=e.getImage(),a=e.getText();let h;if(o){if(o.getImageState()!=Ct.LOADED)return;let c=r;if(n){const f=o.getDeclutterMode();if(f!=="none")if(c=n,f==="obstacle"){const p=r.getBuilder(e.getZIndex(),"Image");p.setImageStyle(o,h),p.drawMultiPoint(t,i)}else a&&a.getText()&&(h={})}const d=c.getBuilder(e.getZIndex(),"Image");d.setImageStyle(o,h),d.drawMultiPoint(t,i)}if(a&&a.getText()){let c=r;n&&(c=n);const d=c.getBuilder(e.getZIndex(),"Text");d.setTextStyle(a,h),d.drawText(t,i)}}function Xw(r,t,e,i,n){const o=e.getFill(),a=e.getStroke();if(o||a){const c=r.getBuilder(e.getZIndex(),"Polygon");c.setFillStrokeStyle(o,a),c.drawPolygon(t,i)}const h=e.getText();if(h&&h.getText()){const c=(n||r).getBuilder(e.getZIndex(),"Text");c.setTextStyle(h),c.drawText(t,i)}}class Yw extends Id{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=ge(),this.wrappedRenderedExtent_=ge(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.declutterExecutorGroup=null,this.clipping=!0,this.compositionContext_=null,this.opacity_=1}renderWorlds(t,e,i){const n=e.extent,o=e.viewState,a=o.center,h=o.resolution,c=o.projection,d=o.rotation,f=c.getExtent(),p=this.getLayer().getSource(),m=e.pixelRatio,y=e.viewHints,v=!(y[Ut.ANIMATING]||y[Ut.INTERACTING]),E=this.compositionContext_,C=Math.round(e.size[0]*m),S=Math.round(e.size[1]*m),w=p.getWrapX()&&c.canWrapX(),b=w?Tt(f):null,T=w?Math.ceil((n[2]-f[2])/b)+1:1;let P=w?Math.floor((n[0]-f[0])/b):0;do{const R=this.getRenderTransform(a,h,d,m,C,S,P*b);t.execute(E,1,R,d,v,void 0,i)}while(++P<T)}setupCompositionContext_(){if(this.opacity_!==1){const t=Jt(this.context.canvas.width,this.context.canvas.height,Ad);this.compositionContext_=t}else this.compositionContext_=this.context}releaseCompositionContext_(){if(this.opacity_!==1){const t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,to(this.compositionContext_),Ad.push(this.compositionContext_.canvas),this.compositionContext_=null}}renderDeclutter(t){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.releaseCompositionContext_())}renderFrame(t,e){const i=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];Mm(this.pixelTransform,1/i,1/i),js(this.inversePixelTransform,this.pixelTransform);const o=eu(this.pixelTransform);this.useContainer(e,o,this.getBackground(t));const a=this.context,h=a.canvas,c=this.replayGroup_,d=this.declutterExecutorGroup;let f=c&&!c.isEmpty()||d&&!d.isEmpty();if(!f&&!(this.getLayer().hasListener(qt.PRERENDER)||this.getLayer().hasListener(qt.POSTRENDER)))return null;const p=Math.round(t.size[0]*i),m=Math.round(t.size[1]*i);h.width!=p||h.height!=m?(h.width=p,h.height=m,h.style.transform!==o&&(h.style.transform=o)):this.containerReused||a.clearRect(0,0,p,m),this.preRender(a,t);const y=t.viewState;y.projection,this.opacity_=n.opacity,this.setupCompositionContext_();let v=!1;if(f&&n.extent&&this.clipping){const E=$i(n.extent);f=se(E,t.extent),v=f&&!Yi(E,t.extent),v&&this.clipUnrotated(this.compositionContext_,t,E)}return f&&this.renderWorlds(c,t),v&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(a,t),this.renderedRotation_!==y.rotation&&(this.renderedRotation_=y.rotation,this.hitDetectionImageData_=null),this.container}getFeatures(t){return new Promise(e=>{if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=[this.context.canvas.width,this.context.canvas.height];Ot(this.pixelTransform,i);const n=this.renderedCenter_,o=this.renderedResolution_,a=this.renderedRotation_,h=this.renderedProjection_,c=this.wrappedRenderedExtent_,d=this.getLayer(),f=[],p=i[0]*je,m=i[1]*je;f.push(this.getRenderTransform(n,o,a,je,p,m,0).slice());const y=d.getSource(),v=h.getExtent();if(y.getWrapX()&&h.canWrapX()&&!Yi(v,c)){let E=c[0];const C=Tt(v);let S=0,w;for(;E<v[0];)--S,w=C*S,f.push(this.getRenderTransform(n,o,a,je,p,m,w).slice()),E+=C;for(S=0,E=c[2];E>v[2];)++S,w=C*S,f.push(this.getRenderTransform(n,o,a,je,p,m,w).slice()),E-=C}this.hitDetectionImageData_=Dw(i,f,this.renderedFeatures_,d.getStyleFunction(),c,o,a)}e(Ow(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,i,n,o){if(!this.replayGroup_)return;const a=e.viewState.resolution,h=e.viewState.rotation,c=this.getLayer(),d={},f=function(y,v,E){const C=ht(y),S=d[C];if(S){if(S!==!0&&E<S.distanceSq){if(E===0)return d[C]=!0,o.splice(o.lastIndexOf(S),1),n(y,c,v);S.geometry=v,S.distanceSq=E}}else{if(E===0)return d[C]=!0,n(y,c,v);o.push(d[C]={feature:y,layer:c,geometry:v,distanceSq:E,callback:n})}};let p;const m=[this.replayGroup_];return this.declutterExecutorGroup&&m.push(this.declutterExecutorGroup),m.some(y=>p=y.forEachFeatureAtCoordinate(t,a,h,i,f,y===this.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map(v=>v.value):null)),p}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),i=e.getSource();if(!i)return!1;const n=t.viewHints[Ut.ANIMATING],o=t.viewHints[Ut.INTERACTING],a=e.getUpdateWhileAnimating(),h=e.getUpdateWhileInteracting();if(this.ready&&!a&&n||!h&&o)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const c=t.extent,d=t.viewState,f=d.projection,p=d.resolution,m=t.pixelRatio,y=e.getRevision(),v=e.getRenderBuffer();let E=e.getRenderOrder();E===void 0&&(E=zw);const C=d.center.slice(),S=Rs(c,v*p),w=S.slice(),b=[S.slice()],T=f.getExtent();if(i.getWrapX()&&f.canWrapX()&&!Yi(T,t.extent)){const V=Tt(T),H=Math.max(Tt(S)/2,V);S[0]=T[0]-H,S[2]=T[2]+H,Ic(C,f);const G=Ac(b[0],f);G[0]<T[0]&&G[2]<T[2]?b.push([G[0]+V,G[1],G[2]+V,G[3]]):G[0]>T[0]&&G[2]>T[2]&&b.push([G[0]-V,G[1],G[2]-V,G[3]])}if(this.ready&&this.renderedResolution_==p&&this.renderedRevision_==y&&this.renderedRenderOrder_==E&&Yi(this.wrappedRenderedExtent_,S))return ei(this.renderedExtent_,w)||(this.hitDetectionImageData_=null,this.renderedExtent_=w),this.renderedCenter_=C,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const P=new Wd(Hl(p,m),S,p,m);let R;this.getLayer().getDeclutter()&&(R=new Wd(Hl(p,m),S,p,m));let I;for(let V=0,H=b.length;V<H;++V)i.loadFeatures(b[V],p,f);const O=Nw(p,m);let U=!0;const X=V=>{let H;const G=V.getStyleFunction()||e.getStyleFunction();if(G&&(H=G(V,p)),H){const N=this.renderFeature(V,O,H,P,I,R);U=U&&!N}},q=Zc(S),Y=i.getFeaturesInExtent(q);E&&Y.sort(E);for(let V=0,H=Y.length;V<H;++V)X(Y[V]);this.renderedFeatures_=Y,this.ready=U;const rt=P.finish(),pt=new Xd(S,p,m,i.getOverlaps(),rt,e.getRenderBuffer());return R&&(this.declutterExecutorGroup=new Xd(S,p,m,i.getOverlaps(),R.finish(),e.getRenderBuffer())),this.renderedResolution_=p,this.renderedRevision_=y,this.renderedRenderOrder_=E,this.renderedExtent_=w,this.wrappedRenderedExtent_=S,this.renderedCenter_=C,this.renderedProjection_=f,this.replayGroup_=pt,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,i,n,o,a){if(!i)return!1;let h=!1;if(Array.isArray(i))for(let c=0,d=i.length;c<d;++c)h=Kd(n,t,i[c],e,this.boundHandleStyleImageChange_,o,a)||h;else h=Kd(n,t,i,e,this.boundHandleStyleImageChange_,o,a);return h}}const Kw=Yw;class qw extends El{constructor(t){super(t)}createRenderer(){return new Kw(this)}}const Jd=qw,$t={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class Jw extends be{constructor(t){super(),this.on,this.once,this.un,this.options=t,this.id=t.id,this.insertFirst=t.insertFirst!==void 0?t.insertFirst:!0,this.stopEvent=t.stopEvent!==void 0?t.stopEvent:!0,this.element=document.createElement("div"),this.element.className=t.className!==void 0?t.className:"ol-overlay-container "+py,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=t.autoPan===!0?{}:t.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener($t.ELEMENT,this.handleElementChanged),this.addChangeListener($t.MAP,this.handleMapChanged),this.addChangeListener($t.OFFSET,this.handleOffsetChanged),this.addChangeListener($t.POSITION,this.handlePositionChanged),this.addChangeListener($t.POSITIONING,this.handlePositioningChanged),t.element!==void 0&&this.setElement(t.element),this.setOffset(t.offset!==void 0?t.offset:[0,0]),this.setPositioning(t.positioning||"top-left"),t.position!==void 0&&this.setPosition(t.position)}getElement(){return this.get($t.ELEMENT)}getId(){return this.id}getMap(){return this.get($t.MAP)||null}getOffset(){return this.get($t.OFFSET)}getPosition(){return this.get($t.POSITION)}getPositioning(){return this.get($t.POSITIONING)}handleElementChanged(){Pu(this.element);const t=this.getElement();t&&this.element.appendChild(t)}handleMapChanged(){this.mapPostrenderListenerKey&&(io(this.element),Et(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const t=this.getMap();if(t){this.mapPostrenderListenerKey=ut(t,oi.POSTRENDER,this.render,this),this.updatePixelPosition();const e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(t){this.set($t.ELEMENT,t)}setMap(t){this.set($t.MAP,t)}setOffset(t){this.set($t.OFFSET,t)}setPosition(t){this.set($t.POSITION,t)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(t){const e=this.getMap();if(!e||!e.getTargetElement()||!this.get($t.POSITION))return;const i=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),o=this.getRect(n,[my(n),yy(n)]);t=t||{};const a=t.margin===void 0?20:t.margin;if(!Yi(i,o)){const h=o[0]-i[0],c=i[2]-o[2],d=o[1]-i[1],f=i[3]-o[3],p=[0,0];if(h<0?p[0]=h-a:c<0&&(p[0]=Math.abs(c)+a),d<0?p[1]=d-a:f<0&&(p[1]=Math.abs(f)+a),p[0]!==0||p[1]!==0){const m=e.getView().getCenterInternal(),y=e.getPixelFromCoordinateInternal(m);if(!y)return;const v=[y[0]+p[0],y[1]+p[1]],E=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(v),duration:E.duration,easing:E.easing})}}}getRect(t,e){const i=t.getBoundingClientRect(),n=i.left+window.pageXOffset,o=i.top+window.pageYOffset;return[n,o,n+e[0],o+e[1]]}setPositioning(t){this.set($t.POSITIONING,t)}setVisible(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)}updatePixelPosition(){const t=this.getMap(),e=this.getPosition();if(!t||!t.isRendered()||!e){this.setVisible(!1);return}const i=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(i,n)}updateRenderedPosition(t,e){const i=this.element.style,n=this.getOffset(),o=this.getPositioning();this.setVisible(!0);const a=Math.round(t[0]+n[0])+"px",h=Math.round(t[1]+n[1])+"px";let c="0%",d="0%";o=="bottom-right"||o=="center-right"||o=="top-right"?c="-100%":(o=="bottom-center"||o=="center-center"||o=="top-center")&&(c="-50%"),o=="bottom-left"||o=="bottom-center"||o=="bottom-right"?d="-100%":(o=="center-left"||o=="center-center"||o=="center-right")&&(d="-50%");const f=`translate(${c}, ${d}) translate(${a}, ${h})`;this.rendered.transform_!=f&&(this.rendered.transform_=f,i.transform=f)}getOptions(){return this.options}}const Qw=Jw,Qd=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],$d={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"};class $w extends ao{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target}),this.on,this.once,this.un,this.keys_=t.keys!==void 0?t.keys:!1,this.source_=t.source,this.isInFullscreen_=!1,this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this),this.cssClassName_=t.className!==void 0?t.className:"ol-full-screen",this.documentListeners_=[],this.activeClassName_=t.activeClassName!==void 0?t.activeClassName.split(" "):[this.cssClassName_+"-true"],this.inactiveClassName_=t.inactiveClassName!==void 0?t.inactiveClassName.split(" "):[this.cssClassName_+"-false"];const e=t.label!==void 0?t.label:"⤢";this.labelNode_=typeof e=="string"?document.createTextNode(e):e;const i=t.labelActive!==void 0?t.labelActive:"×";this.labelActiveNode_=typeof i=="string"?document.createTextNode(i):i;const n=t.tipLabel?t.tipLabel:"Toggle full-screen";this.button_=document.createElement("button"),this.button_.title=n,this.button_.setAttribute("type","button"),this.button_.appendChild(this.labelNode_),this.button_.addEventListener(ot.CLICK,this.handleClick_.bind(this),!1),this.setClassName_(this.button_,this.isInFullscreen_),this.element.className=`${this.cssClassName_} ${Tr} ${$s}`,this.element.appendChild(this.button_)}handleClick_(t){t.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){const t=this.getMap();if(!t)return;const e=t.getOwnerDocument();if(tf(e))if(ef(e))eE(e);else{let i;this.source_?i=typeof this.source_=="string"?e.getElementById(this.source_):this.source_:i=t.getTargetElement(),this.keys_?tE(i):nf(i)}}handleFullScreenChange_(){const t=this.getMap();if(!t)return;const e=this.isInFullscreen_;this.isInFullscreen_=ef(t.getOwnerDocument()),e!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(eo(this.labelActiveNode_,this.labelNode_),this.dispatchEvent($d.ENTERFULLSCREEN)):(eo(this.labelNode_,this.labelActiveNode_),this.dispatchEvent($d.LEAVEFULLSCREEN)),t.updateSize())}setClassName_(t,e){e?(t.classList.remove(...this.inactiveClassName_),t.classList.add(...this.activeClassName_)):(t.classList.remove(...this.activeClassName_),t.classList.add(...this.inactiveClassName_))}setMap(t){const e=this.getMap();e&&e.removeChangeListener(Zt.TARGET,this.boundHandleMapTargetChange_),super.setMap(t),this.handleMapTargetChange_(),t&&t.addChangeListener(Zt.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){const t=this.documentListeners_;for(let i=0,n=t.length;i<n;++i)Et(t[i]);t.length=0;const e=this.getMap();if(e){const i=e.getOwnerDocument();tf(i)?this.element.classList.remove(Tu):this.element.classList.add(Tu);for(let n=0,o=Qd.length;n<o;++n)t.push(ut(i,Qd[n],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}}function tf(r){const t=r.body;return!!(t.webkitRequestFullscreen||t.requestFullscreen&&r.fullscreenEnabled)}function ef(r){return!!(r.webkitIsFullScreen||r.fullscreenElement)}function nf(r){r.requestFullscreen?r.requestFullscreen():r.webkitRequestFullscreen&&r.webkitRequestFullscreen()}function tE(r){r.webkitRequestFullscreen?r.webkitRequestFullscreen():nf(r)}function eE(r){r.exitFullscreen?r.exitFullscreen():r.webkitExitFullscreen&&r.webkitExitFullscreen()}const iE=$w,nE=j.defineComponent({name:"MapHeat",props:{coords:Object,loadMapa:Object,typeMap:String,abrirCerrarLoader:Function,onClickMarket:Function,configurationMap:{default:()=>({strokeColor:"#f47521",copyright:"© 2021 Desarrollado por UTIC - Ministerio Público",height:"250px",maxZoom:20,iconMarker:{image:ss,color:"#f47521",iconUrl:"/image/gmap01.png",iconSize:[25,41],iconAnchor:[12,41],scale:1,class:"",type:"image"},dragMarker:!0})}},data:()=>({radius:10,blur:20,zoom:5,type:"0",olMap:null,heatLayer:null,pointLayer:null,countryLayer:null,overlay:null,showSetting:!1,cantidad:0}),watch:{radius(r){this.setRadius(r)},blur(r){this.setBlur(r)},coords(r){this.cantidad=r.features.length,this.updateSource(r),this.updatePointSource(r)},loadMapa(r){this.changeCountryLayer(r)},typeMap(r){this.changeTypeMap(r)},type(r){this.changeTypeMap(r)}},methods:{changeTypeMap(r){r==="0"?(this.heatLayer.setVisible(!0),this.pointLayer.setVisible(!1),this.olMap.removeEventListener("click",this.onClickListener)):(this.heatLayer.setVisible(!1),this.pointLayer.setVisible(!0),this.initClick())},initMap(){const r=`<span class='map-copyright-text' >${this.configurationMap.copyright}</span>`,t=new On({stroke:new co({color:this.configurationMap.strokeColor,width:3}),text:new Yu({font:"12px Roboto",fill:new ho({color:"#000"}),stroke:new co({color:"#fff",width:1})})});this.countryLayer=new Jd({source:new wo({url:`${this.loadMapa.data}`,format:new Mo}),style:function(i){const n=t.getText();return n&&n.setText(i.get("name")),t}}),this.heatLayer=new o0({source:new wo({features:[]}),visible:!1,radius:10,blur:25});try{this.pointLayer=this.configurationMap?new Jd({source:new wo({features:[]}),visible:!1,style:i=>{var a,h,c;return new On({image:new ml({src:(h=(a=this.configurationMap)==null?void 0:a.iconMarker)==null?void 0:h.iconUrl,color:(c=this.configurationMap.iconMarker)==null?void 0:c.color,scale:this.configurationMap.iconMarker.scale}),zIndex:1})}}):void 0}catch(i){console.log(i)}this.olMap=new Tv({controls:Du({attribution:!1}).extend([new iE({tipLabel:"Pantalla completa"})]).extend([new Iu({collapsible:!1})]),layers:[new z0({source:new P0({attributions:r})}),this.countryLayer,this.heatLayer,this.pointLayer],target:this.$refs["map-root"],view:new Ne({center:[0,0],zoom:this.zoom})});const e=Uc([this.loadMapa.lng,this.loadMapa.lat]);this.olMap.getView().adjustCenter(e),this.fitMap()},initClick(){const r=document.getElementById("popup"),t=document.getElementById("popup-closer");this.overlay=new Qw({element:r,autoPan:!0}),this.olMap.addOverlay(this.overlay),t.onclick=()=>this.closeOverlay(),this.olMap.addEventListener("click",this.onClickListener)},closeOverlay(){const r=document.getElementById("popup-closer");return this.overlay.setPosition(void 0),r.blur(),!1},async onClickListener(r){const t=document.getElementById("popup-content"),e=document.getElementById("popup-closer");if(this.olMap.hasFeatureAtPixel(r.pixel)===!0){const i=this.olMap.getFeaturesAtPixel(r.pixel)[0];if(i.getGeometry().getType()==="Point"){const o=this.olMap.getFeaturesAtPixel(r.pixel)[0].getProperties(),a=r.coordinate;this.abrirCerrarLoader&&this.abrirCerrarLoader(!0);try{this.abrirCerrarLoader&&this.abrirCerrarLoader(!1);let h="";this.onClickMarket&&(h=await this.onClickMarket(o)),t.innerHTML=h;const c=this.olMap.getView(),d=i.getGeometry().getExtent(),f=c.getCenter(),p=c.getZoom();c.fit(d,{padding:[325,75,0,75],maxZoom:p});const m=c.getCenter();c.setCenter(f),c.animate({center:m})}catch{this.abrirCerrarLoader&&this.abrirCerrarLoader(!1)}this.overlay.setPosition(a)}}else this.overlay.setPosition(void 0),e.blur()},updateSource(r){if(r&&r.features.length===0){this.heatLayer.getSource().clear();return}if(r){const t=this.heatLayer.getSource(),e=new Mo({featureProjection:"EPSG:3857"}).readFeatures(r);t.clear(),t.addFeatures(e)}},updatePointSource(r){if(r&&r.features.length===0){this.pointLayer.getSource().clear();return}if(r){const t=this.pointLayer.getSource(),e=new Mo({featureProjection:"EPSG:3857"}).readFeatures(r);t.clear(),t.addFeatures(e)}},async changeCountryLayer(r){if(this.countryLayer){const e=new wo({url:`${r.data}`,format:new Mo});await this.countryLayer.setSource(e)}},fitMap(){this.countryLayer.addEventListener("change",this.countryFunction)},countryFunction(r){const t=this.olMap.getView();if(r.target.getSource().getFeatures()[0]){const i=r.target.getSource().getExtent(),n=t.getZoom(),o=t.getCenter();t.fit(i,{padding:[75,75,75,75],maxZoom:6});const a=t.getZoom(),h=t.getCenter();t.setCenter(o),t.setZoom(n),t.animate({center:h}),t.animate({zoom:a})}},setRadius(r){this.heatLayer.setRadius(parseInt(r,10))},setBlur(r){this.heatLayer.setBlur(parseInt(r,10))},irACiudad(){if(this.loadMapa&&this.loadMapa.country!=="Bolivia"){const r=this.olMap.getView(),t=r.getZoom(),e=r.getCenter();r.setCenter(Uc([this.loadMapa.lng,this.loadMapa.lat]));const i=13,n=r.getCenter();r.setCenter(e),r.setZoom(t),r.animate({center:n}),r.animate({zoom:i})}},toggleSettings(){this.showSetting=!this.showSetting}},mounted(){this.countryLayer=this.loadMapa,this.initMap()},beforeDestroy(){this.countryLayer.removeEventListener("change",this.countryFunction),this.olMap.removeEventListener("click",this.onClickListener)}}),jL="",ZL="",ui=r=>(j.pushScopeId("data-v-6d32e204"),r=r(),j.popScopeId(),r),rE={ref:"map-root",style:{width:"100%",height:"100%",position:"relative"}},sE={class:"btn-zoom-container ol-control"},oE=[ui(()=>j.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[j.createElementVNode("path",{d:"M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224v114.8l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288h114.8l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z"})],-1))],aE={class:"type-map-container ol-control"},lE=[ui(()=>j.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},[j.createElementVNode("path",{d:"M215.7 499.2C267 435 384 279.4 384 192 384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2 12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"})],-1))],hE=[ui(()=>j.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},[j.createElementVNode("path",{d:"m153.6 29.9 16-21.3c4-5.4 10.4-8.6 17.1-8.6C198.4 0 208 9.6 208 21.3v22.2c0 13.1 5.4 25.7 14.9 34.7l84.7 80.8c48.8 46.6 76.4 111.2 76.4 178.7C384 434 306 512 209.7 512H192C86 512 0 426 0 320v-3.8c0-48.8 19.4-95.6 53.9-130.1l3.5-3.5c4.2-4.2 10-6.6 16-6.6 12.5 0 22.6 10.1 22.6 22.6V288c0 35.3 28.7 64 64 64s64-28.7 64-64v-3.9c0-18-7.2-35.3-19.9-48l-38.6-38.6c-24-24-37.5-56.7-37.5-90.7 0-27.7 9-54.8 25.6-76.9z"})],-1))],cE={class:"btn-settings ol-control"},uE=[ui(()=>j.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[j.createElementVNode("path",{d:"M495.9 166.6c3.2 8.7.5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4l-55.6 17.8c-8.8 2.8-18.6.3-24.5-6.8-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4c-1.1-8.4-1.7-16.9-1.7-25.5s.6-17.1 1.7-25.4l-43.3-39.4c-6.9-6.2-9.6-15.9-6.4-24.6 4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2 5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8 8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"})],-1))],dE={class:"control-container"},fE={class:"map-flex"},gE=ui(()=>j.createElementVNode("label",null,"Tamaño del radio",-1)),pE={class:"map-flex"},_E=ui(()=>j.createElementVNode("label",null,"Difuminado",-1)),mE={class:"cant-casos ol-attribution ol-unselectable ol-control ol-uncollapsible"},yE={class:"text-cantidad"},vE=ui(()=>j.createElementVNode("span",{class:"ol-bold"},"Casos: ",-1)),xE={id:"popup",class:"ol-popup"},wE=[ui(()=>j.createElementVNode("a",{id:"popup-closer",class:"ol-popup-closer"},null,-1)),ui(()=>j.createElementVNode("div",{id:"popup-content"},null,-1))];function EE(r,t,e,i,n,o){var a;return j.openBlock(),j.createElementBlock("div",{class:"map-container",style:j.normalizeStyle(`height:${(a=r.configurationMap)==null?void 0:a.height}`)},[j.createElementVNode("div",rE,[j.withDirectives(j.createElementVNode("div",sE,[j.createElementVNode("button",{title:"Ir a la ciudad",class:"jl2-button-map",onClick:t[0]||(t[0]=(...h)=>r.irACiudad&&r.irACiudad(...h))},oE)],512),[[j.vShow,r.loadMapa.country!=="Bolivia"]]),j.createElementVNode("div",aE,[j.createElementVNode("button",{title:"Mapa con Marcador",class:j.normalizeClass(["jl2-button-map",{"jl2-button-map-select":r.type=="1"}]),onClick:t[1]||(t[1]=()=>r.type="1")},lE,2),j.createElementVNode("button",{title:"Mapa de Calor",class:j.normalizeClass(["jl2-button-map",{"jl2-button-map-select":r.type=="0"}]),onClick:t[2]||(t[2]=()=>r.type="0")},hE,2)]),j.withDirectives(j.createElementVNode("div",cE,[j.createElementVNode("button",{title:"Ver Opciones",class:"jl2-button-map",onClick:t[3]||(t[3]=(...h)=>r.toggleSettings&&r.toggleSettings(...h))},uE)],512),[[j.vShow,!r.showSetting&&r.type==="0"]]),j.withDirectives(j.createElementVNode("div",dE,[j.createElementVNode("a",{onClick:t[4]||(t[4]=(...h)=>r.toggleSettings&&r.toggleSettings(...h)),class:"ol-popup-closer"}),j.createElementVNode("div",fE,[gE,j.withDirectives(j.createElementVNode("input",{id:"radius",type:"range",min:"1",max:"50",step:"1","onUpdate:modelValue":t[5]||(t[5]=h=>r.radius=h)},null,512),[[j.vModelText,r.radius]])]),j.createElementVNode("div",pE,[_E,j.withDirectives(j.createElementVNode("input",{id:"blur",type:"range",min:"1",max:"50",step:"1","onUpdate:modelValue":t[6]||(t[6]=h=>r.blur=h)},null,512),[[j.vModelText,r.blur]])])],512),[[j.vShow,r.type==="0"&&r.showSetting]]),j.createElementVNode("div",mE,[j.createElementVNode("p",yE,[vE,j.createTextVNode(j.toDisplayString(r.cantidad),1)])])],512),j.withDirectives(j.createElementVNode("div",xE,wE,512),[[j.vShow,r.type==="1"]])],4)}const LE=oa(nE,[["render",EE],["__scopeId","data-v-6d32e204"]]);de.CoordinatesVerifyPolygon=jg,de.MapHeatComponent=LE,de.MapSearchAddress=k_,de.MapView=S_,de.listenServiceGoogleMaps=og,de.searchAutomaticGoogleMaps=lg,de.searchManualGoogleMaps=ag,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});
|
|
460
|
+
}`,uniforms:{u_gradientTexture:()=>this.gradient_,u_opacity:()=>this.getOpacity()}}]})}renderDeclutter(){}}function Nx(r){const i=ee(1,256),n=i.createLinearGradient(0,0,1,256),s=1/(r.length-1);for(let a=0,h=r.length;a<h;++a)n.addColorStop(a*s,r[a]);return i.fillStyle=n,i.fillRect(0,0,1,256),i.canvas}const Bx=zx;class Gx extends Mx{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()}pruneExceptNewestZ(){if(this.getCount()===0)return;const t=this.peekFirstKey(),i=Sx(t)[0];this.forEach(n=>{n.tileCoord[0]!==i&&(this.remove(Jd(n.tileCoord)),n.release())})}}const Qd=Gx,ih={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class Ux extends Re{constructor(t){super(),this.projection=zt(t.projection),this.attributions_=$d(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible!==void 0?t.attributionsCollapsible:!0,this.loading=!1,this.state_=t.state!==void 0?t.state:"ready",this.wrapX_=t.wrapX!==void 0?t.wrapX:!1,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise(function(i,n){e.viewResolver=i,e.viewRejector=n})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=$d(t),this.changed()}setState(t){this.state_=t,this.changed()}}function $d(r){return r?Array.isArray(r)?function(t){return r}:typeof r=="function"?r:function(t){return[r]}:null}const tf=Ux,ir=[0,0,0],ji=5;class jx{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,mt(nm(this.resolutions_,(n,s)=>s-n,!0),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let n=0,s=this.resolutions_.length-1;n<s;++n)if(!e)e=this.resolutions_[n]/this.resolutions_[n+1];else if(this.resolutions_[n]/this.resolutions_[n+1]!==e){e=void 0;break}}this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=t.origin!==void 0?t.origin:null,this.origins_=null,t.origins!==void 0&&(this.origins_=t.origins,mt(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const i=t.extent;i!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=cn(i)),mt(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,t.tileSizes!==void 0&&(this.tileSizes_=t.tileSizes,mt(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=t.tileSize!==void 0?t.tileSize:this.tileSizes_?null:Na,mt(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=i!==void 0?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],t.sizes!==void 0?this.fullTileRanges_=t.sizes.map((n,s)=>{const a=new Kd(Math.min(0,n[0]),Math.max(n[0]-1,-1),Math.min(0,n[1]),Math.max(n[1]-1,-1));if(i){const h=this.getTileRangeForExtentAndZ(i,s);a.minX=Math.max(h.minX,a.minX),a.maxX=Math.min(h.maxX,a.maxX),a.minY=Math.max(h.minY,a.minY),a.maxY=Math.min(h.maxY,a.maxY)}return a}):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){const n=this.getTileRangeForExtentAndZ(t,e);for(let s=n.minX,a=n.maxX;s<=a;++s)for(let h=n.minY,c=n.maxY;h<=c;++h)i([e,s,h])}forEachTileCoordParentTileRange(t,e,i,n){let s,a,h,c=null,d=t[0]-1;for(this.zoomFactor_===2?(a=t[1],h=t[2]):c=this.getTileCoordExtent(t,n);d>=this.minZoom;){if(a!==void 0&&h!==void 0?(a=Math.floor(a/2),h=Math.floor(h/2),s=Qn(a,a,h,h,i)):s=this.getTileRangeForExtentAndZ(c,d,i),e(d,s))return!0;--d}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,i){if(t[0]<this.maxZoom){if(this.zoomFactor_===2){const s=t[1]*2,a=t[2]*2;return Qn(s,s+1,a,a+1,e)}const n=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(n,t[0]+1,e)}return null}getTileRangeForTileCoordAndZ(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;const n=t[0],s=t[1],a=t[2];if(e===n)return Qn(s,a,s,a,i);if(this.zoomFactor_){const c=Math.pow(this.zoomFactor_,e-n),d=Math.floor(s*c),f=Math.floor(a*c);if(e<n)return Qn(d,d,f,f,i);const p=Math.floor(c*(s+1))-1,_=Math.floor(c*(a+1))-1;return Qn(d,p,f,_,i)}const h=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(h,e,i)}getTileRangeForExtentAndZ(t,e,i){this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,ir);const n=ir[1],s=ir[2];this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,ir);const a=ir[1],h=ir[2];return Qn(n,a,s,h,i)}getTileCoordCenter(t){const e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=Le(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*i,e[1]-(t[2]+.5)*n[1]*i]}getTileCoordExtent(t,e){const i=this.getOrigin(t[0]),n=this.getResolution(t[0]),s=Le(this.getTileSize(t[0]),this.tmpSize_),a=i[0]+t[1]*s[0]*n,h=i[1]-(t[2]+1)*s[1]*n,c=a+s[0]*n,d=h+s[1]*n;return ki(a,h,c,d,e)}getTileCoordForCoordAndResolution(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)}getTileCoordForXYAndResolution_(t,e,i,n,s){const a=this.getZForResolution(i),h=i/this.getResolution(a),c=this.getOrigin(a),d=Le(this.getTileSize(a),this.tmpSize_);let f=h*(t-c[0])/i/d[0],p=h*(c[1]-e)/i/d[1];return n?(f=eo(f,ji)-1,p=eo(p,ji)-1):(f=to(f,ji),p=to(p,ji)),qd(a,f,p,s)}getTileCoordForXYAndZ_(t,e,i,n,s){const a=this.getOrigin(i),h=this.getResolution(i),c=Le(this.getTileSize(i),this.tmpSize_);let d=(t-a[0])/h/c[0],f=(a[1]-e)/h/c[1];return n?(d=eo(d,ji)-1,f=eo(f,ji)-1):(d=to(d,ji),f=to(f,ji)),qd(i,d,f,s)}getTileCoordForCoordAndZ(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)}getTileCoordResolution(t){return this.resolutions_[t[0]]}getTileSize(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]}getFullTileRange(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null}getZForResolution(t,e){const i=za(this.resolutions_,t,e||0);return Dt(i,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return Iu(e,0,e.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){const e=this.resolutions_.length,i=new Array(e);for(let n=this.minZoom;n<e;++n)i[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=i}}const ef=jx;function nf(r){let t=r.getDefaultTileGrid();return t||(t=Vx(r),r.setDefaultTileGrid(t)),t}function Zx(r,t,e){const i=t[0],n=r.getTileCoordCenter(t),s=nh(e);if(!Ys(s,n)){const a=Mt(s),h=Math.ceil((s[0]-n[0])/a);return n[0]+=a*h,r.getTileCoordForCoordAndZ(n,i)}return t}function Wx(r,t,e,i){i=i!==void 0?i:"top-left";const n=rf(r,t,e);return new ef({extent:r,origin:xm(r,i),resolutions:n,tileSize:e})}function Hx(r){const t=r||{},e=t.extent||zt("EPSG:3857").getExtent(),i={extent:e,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:rf(e,t.maxZoom,t.tileSize,t.maxResolution)};return new ef(i)}function rf(r,t,e,i){t=t!==void 0?t:lm,e=Le(e!==void 0?e:Na);const n=we(r),s=Mt(r);i=i>0?i:Math.max(s/e[0],n/e[1]);const a=t+1,h=new Array(a);for(let c=0;c<a;++c)h[c]=i/Math.pow(2,c);return h}function Vx(r,t,e,i){const n=nh(r);return Wx(n,t,e,i)}function nh(r){r=zt(r);let t=r.getExtent();if(!t){const e=180*Cr.degrees/r.getMetersPerUnit();t=ki(-e,-e,e,e)}return t}class Xx extends tf{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate}),this.on,this.once,this.un,this.opaque_=t.opaque!==void 0?t.opaque:!1,this.tilePixelRatio_=t.tilePixelRatio!==void 0?t.tilePixelRatio:1,this.tileGrid=t.tileGrid!==void 0?t.tileGrid:null;const e=[256,256];this.tileGrid&&Le(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),e),this.tileCache=new Qd(t.cacheSize||0),this.tmpSize=[0,0],this.key_=t.key||"",this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}canExpireCache(){return this.tileCache.canExpireCache()}expireCache(t,e){const i=this.getTileCacheForProjection(t);i&&i.expireCache(e)}forEachLoadedTile(t,e,i,n){const s=this.getTileCacheForProjection(t);if(!s)return!1;let a=!0,h,c,d;for(let f=i.minX;f<=i.maxX;++f)for(let p=i.minY;p<=i.maxY;++p)c=Fo(e,f,p),d=!1,s.containsKey(c)&&(h=s.get(c),d=h.getState()===et.LOADED,d&&(d=n(h)!==!1)),d||(a=!1);return a}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getOpaque(t){return this.opaque_}getResolutions(t){const e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,i,n,s){return rt()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:nf(t)}getTileCacheForProjection(t){const e=this.getProjection();return mt(e===null||dn(e,t),"A VectorTile source can only be rendered if it has a projection compatible with the view projection."),this.tileCache}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,i){const n=this.getTileGridForProjection(i),s=this.getTilePixelRatio(e),a=Le(n.getTileSize(t),this.tmpSize);return s==1?a:Nv(a,s,this.tmpSize)}getTileCoordForTileUrlFunction(t,e){e=e!==void 0?e:this.getProjection();const i=this.getTileGridForProjection(e);return this.getWrapX()&&e.isGlobal()&&(t=Zx(i,t,e)),kx(t,i)?t:null}clear(){this.tileCache.clear()}refresh(){this.clear(),super.refresh()}updateCacheSize(t,e){const i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)}useTile(t,e,i,n){}}class Yx extends ai{constructor(t,e){super(t),this.tile=e}}const Kx=Xx;function qx(r,t){const e=/\{z\}/g,i=/\{x\}/g,n=/\{y\}/g,s=/\{-y\}/g;return function(a,h,c){if(a)return r.replace(e,a[0].toString()).replace(i,a[1].toString()).replace(n,a[2].toString()).replace(s,function(){const d=a[0],f=t.getFullTileRange(d);if(!f)throw new Error("The {-y} placeholder requires a tile grid with extent");return(f.getHeight()-a[2]-1).toString()})}}function Jx(r,t){const e=r.length,i=new Array(e);for(let n=0;n<e;++n)i[n]=qx(r[n],t);return Qx(i)}function Qx(r){return r.length===1?r[0]:function(t,e,i){if(!t)return;const n=Px(t),s=Bn(n,r.length);return r[s](t,e,i)}}function $x(r){const t=[];let e=/\{([a-z])-([a-z])\}/.exec(r);if(e){const i=e[1].charCodeAt(0),n=e[2].charCodeAt(0);let s;for(s=i;s<=n;++s)t.push(r.replace(e[0],String.fromCharCode(s)));return t}if(e=/\{(\d+)-(\d+)\}/.exec(r),e){const i=parseInt(e[2],10);for(let n=parseInt(e[1],10);n<=i;n++)t.push(r.replace(e[0],n.toString()));return t}return t.push(r),t}class rh extends Kx{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===rh.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(t){const e=t.target,i=ct(e),n=e.getState();let s;n==et.LOADING?(this.tileLoadingKeys_[i]=!0,s=ih.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=n==et.ERROR?ih.TILELOADERROR:n==et.LOADED?ih.TILELOADEND:void 0),s!=null&&this.dispatchEvent(new Yx(s,e))}setTileLoadFunction(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),typeof e<"u"?this.setKey(e):this.changed()}setUrl(t){const e=$x(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join(`
|
|
461
|
+
`);this.generateTileUrlFunction_?this.setTileUrlFunction(Jx(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,i){}useTile(t,e,i){const n=Fo(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)}}const tw=rh;class ew extends tw{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:iw,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate!==void 0?t.interpolate:!0,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=t.crossOrigin!==void 0?t.crossOrigin:null,this.tileClass=t.tileClass!==void 0?t.tileClass:Xd,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}canExpireCache(){if(this.tileCache.canExpireCache())return!0;for(const t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1}expireCache(t,e){const i=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==i?e:{});for(const n in this.tileCacheForProjection){const s=this.tileCacheForProjection[n];s.expireCache(s==i?e:{})}}getGutterForProjection(t){return this.getProjection()&&t&&!dn(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getOpaque(t){return this.getProjection()&&t&&!dn(this.getProjection(),t)?!1:super.getOpaque(t)}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||dn(e,t)))return this.tileGrid;const i=ct(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=nf(t)),this.tileGridForProjection[i]}getTileCacheForProjection(t){const e=this.getProjection();if(!e||dn(e,t))return this.tileCache;const i=ct(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Qd(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]}createTile_(t,e,i,n,s,a){const h=[t,e,i],c=this.getTileCoordForTileUrlFunction(h,s),d=c?this.tileUrlFunction(c,n,s):void 0,f=new this.tileClass(h,d!==void 0?et.IDLE:et.EMPTY,d!==void 0?d:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return f.key=a,f.addEventListener(lt.CHANGE,this.handleTileChange.bind(this)),f}getTile(t,e,i,n,s){const a=this.getProjection();if(!a||!s||dn(a,s))return this.getTileInternal(t,e,i,n,a||s);const h=this.getTileCacheForProjection(s),c=[t,e,i];let d;const f=Jd(c);h.containsKey(f)&&(d=h.get(f));const p=this.getKey();if(d&&d.key==p)return d;const _=this.getTileGridForProjection(a),y=this.getTileGridForProjection(s),v=this.getTileCoordForTileUrlFunction(c,s),w=new $l(a,_,s,y,c,v,this.getTilePixelRatio(n),this.getGutter(),(T,M,E,b)=>this.getTileInternal(T,M,E,b,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return w.key=p,d?(w.interimTile=d,w.refreshInterimChain(),h.replace(f,w)):h.set(f,w),w}getTileInternal(t,e,i,n,s){let a=null;const h=Fo(t,e,i),c=this.getKey();if(!this.tileCache.containsKey(h))a=this.createTile_(t,e,i,n,s,c),this.tileCache.set(h,a);else if(a=this.tileCache.get(h),a.key!=c){const d=a;a=this.createTile_(t,e,i,n,s,c),d.getState()==et.IDLE?a.interimTile=d.interimTile:a.interimTile=d,a.refreshInterimChain(),this.tileCache.replace(h,a)}return a}setRenderReprojectionEdges(t){if(this.renderReprojectionEdges_!=t){this.renderReprojectionEdges_=t;for(const e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}}setTileGridForProjection(t,e){const i=zt(t);if(i){const n=ct(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}}clear(){super.clear();for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear()}}function iw(r,t){r.getImage().src=t}const nw=ew;class rw extends nw{constructor(t){t=t||{};const e=t.projection!==void 0?t.projection:"EPSG:3857",i=t.tileGrid!==void 0?t.tileGrid:Hx({extent:nh(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,opaque:t.opaque,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}}const sw=rw,ow='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class aw extends sw{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[ow];const i=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",n=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:i,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,opaque:t.opaque!==void 0?t.opaque:!0,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:n,wrapX:t.wrapX,zDirection:t.zDirection})}}const lw=aw,zo={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class hw extends go{constructor(t){t=t||{};const e=Object.assign({},t);delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getPreload(){return this.get(zo.PRELOAD)}setPreload(t){this.set(zo.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(zo.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(zo.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}const cw=hw,sf=[];let nr=null;function uw(){nr=ee(1,1,void 0,{willReadFrequently:!0})}class dw extends Fd{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=Ht(),this.pixelTransform=Ht(),this.inversePixelTransform=Ht(),this.context=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(t,e,i){nr||uw(),nr.clearRect(0,0,1,1);let n;try{nr.drawImage(t,e,i,1,1,0,0,1,1),n=nr.getImageData(0,0,1,1).data}catch{return nr=null,null}return n}getBackground(t){let i=this.getLayer().getBackground();return typeof i=="function"&&(i=i(t.viewState.resolution)),i||void 0}useContainer(t,e,i){const n=this.getLayer().getClassName();let s,a;if(t&&t.className===n&&(!i||t&&t.style.backgroundColor&&li(Fr(t.style.backgroundColor),Fr(i)))){const h=t.firstElementChild;h instanceof HTMLCanvasElement&&(a=h.getContext("2d"))}if(a&&a.canvas.style.transform===e?(this.container=t,this.context=a,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){s=document.createElement("div"),s.className=n;let h=s.style;h.position="absolute",h.width="100%",h.height="100%",a=ee();const c=a.canvas;s.appendChild(c),h=c.style,h.position="absolute",h.left="0",h.transformOrigin="top left",this.container=s,this.context=a}!this.containerReused&&i&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=i)}clipUnrotated(t,e,i){const n=cn(i),s=Js(i),a=qs(i),h=Ks(i);Nt(e.coordinateToPixelTransform,n),Nt(e.coordinateToPixelTransform,s),Nt(e.coordinateToPixelTransform,a),Nt(e.coordinateToPixelTransform,h);const c=this.inversePixelTransform;Nt(c,n),Nt(c,s),Nt(c,a),Nt(c,h),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.lineTo(Math.round(h[0]),Math.round(h[1])),t.clip()}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){const s=new zr(t,this.inversePixelTransform,i,e);n.dispatchEvent(s)}}preRender(t,e){this.frameState=e,this.dispatchRenderEvent_(te.PRERENDER,t,e)}postRender(t,e){this.dispatchRenderEvent_(te.POSTRENDER,t,e)}getRenderTransform(t,e,i,n,s,a,h){const c=s/2,d=a/2,f=n/e,p=-f,_=-t[0]+h,y=-t[1];return Ie(this.tempTransform,c,d,f,p,-i,_,y)}disposeInternal(){delete this.frameState,super.disposeInternal()}}const of=dw;class fw extends of{constructor(t){super(t),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=xe(),this.tmpTileRange_=new Kd(0,0,0,0)}isDrawableTile(t){const e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==et.LOADED||i==et.EMPTY||i==et.ERROR&&!n}getTile(t,e,i,n){const s=n.pixelRatio,a=n.viewState.projection,h=this.getLayer();let d=h.getSource().getTile(t,e,i,s,a);return d.getState()==et.ERROR&&h.getUseInterimTilesOnError()&&h.getPreload()>0&&(this.newTiles_=!0),this.isDrawableTile(d)||(d=d.getInterimTile()),d}getData(t){const e=this.frameState;if(!e)return null;const i=this.getLayer(),n=Nt(e.pixelToCoordinateTransform,t.slice()),s=i.getExtent();if(s&&!Ys(s,n))return null;const a=e.pixelRatio,h=e.viewState.projection,c=e.viewState,d=i.getRenderSource(),f=d.getTileGridForProjection(c.projection),p=d.getTilePixelRatio(e.pixelRatio);for(let _=f.getZForResolution(c.resolution);_>=f.getMinZoom();--_){const y=f.getTileCoordForCoordAndZ(n,_),v=d.getTile(_,y[1],y[2],a,h);if(!(v instanceof Xd||v instanceof $l)||v instanceof $l&&v.getState()===et.EMPTY)return null;if(v.getState()!==et.LOADED)continue;const w=f.getOrigin(_),T=Le(f.getTileSize(_)),M=f.getResolution(_),E=Math.floor(p*((n[0]-w[0])/M-y[1]*T[0])),b=Math.floor(p*((w[1]-n[1])/M-y[2]*T[1])),C=Math.round(p*d.getGutterForProjection(c.projection));return this.getImageData(v.getImage(),E+C,b+C)}return null}loadedTileCallback(t,e,i){return this.isDrawableTile(i)?super.loadedTileCallback(t,e,i):!1}prepareFrame(t){return!!this.getLayer().getSource()}renderFrame(t,e){const i=t.layerStatesArray[t.layerIndex],n=t.viewState,s=n.projection,a=n.resolution,h=n.center,c=n.rotation,d=t.pixelRatio,f=this.getLayer(),p=f.getSource(),_=p.getRevision(),y=p.getTileGridForProjection(s),v=y.getZForResolution(a,p.zDirection),w=y.getResolution(v);let T=t.extent;const M=t.viewState.resolution,E=p.getTilePixelRatio(d),b=Math.round(Mt(T)/M*d),C=Math.round(we(T)/M*d),P=i.extent&&fn(i.extent);P&&(T=kr(T,fn(i.extent)));const R=w*b/2/E,D=w*C/2/E,O=[h[0]-R,h[1]-D,h[0]+R,h[1]+D],G=y.getTileRangeForExtentAndZ(T,v),X={};X[v]={};const Y=this.createLoadedTileFinder(p,s,X),q=this.tmpExtent,st=this.tmpTileRange_;this.newTiles_=!1;const _t=c?Ha(n.center,M,c,t.size):void 0;for(let xt=G.minX;xt<=G.maxX;++xt)for(let $=G.minY;$<=G.maxY;++$){if(c&&!y.tileCoordIntersectsViewport([v,xt,$],_t))continue;const tt=this.getTile(v,xt,$,t);if(this.isDrawableTile(tt)){const Xt=ct(this);if(tt.getState()==et.LOADED){X[v][tt.tileCoord.toString()]=tt;let Ce=tt.inTransition(Xt);Ce&&i.opacity!==1&&(tt.endTransition(Xt),Ce=!1),!this.newTiles_&&(Ce||!this.renderedTiles.includes(tt))&&(this.newTiles_=!0)}if(tt.getAlpha(Xt,t.time)===1)continue}const at=y.getTileCoordChildTileRange(tt.tileCoord,st,q);let kt=!1;at&&(kt=Y(v+1,at)),kt||y.forEachTileCoordParentTileRange(tt.tileCoord,Y,st,q)}const V=w/a*d/E;Ie(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/d,1/d,c,-b/2,-C/2);const H=xu(this.pixelTransform);this.useContainer(e,H,this.getBackground(t));const j=this.context,B=j.canvas;no(this.inversePixelTransform,this.pixelTransform),Ie(this.tempTransform,b/2,C/2,V,V,0,-b/2,-C/2),B.width!=b||B.height!=C?(B.width=b,B.height=C):this.containerReused||j.clearRect(0,0,b,C),P&&this.clipUnrotated(j,t,P),p.getInterpolate()||(j.imageSmoothingEnabled=!1),this.preRender(j,t),this.renderedTiles.length=0;let Lt=Object.keys(X).map(Number);Lt.sort(Pi);let Z,ut,z;i.opacity===1&&(!this.containerReused||p.getOpaque(t.viewState.projection))?Lt=Lt.reverse():(Z=[],ut=[]);for(let xt=Lt.length-1;xt>=0;--xt){const $=Lt[xt],tt=p.getTilePixelSize($,d,s),kt=y.getResolution($)/w,Xt=tt[0]*kt*V,Ce=tt[1]*kt*V,Je=y.getTileCoordForCoordAndZ(cn(O),$),Xi=y.getTileCoordExtent(Je),Me=Nt(this.tempTransform,[E*(Xi[0]-O[0])/w,E*(O[3]-Xi[3])/w]),Yi=E*p.getGutterForProjection(s),Qe=X[$];for(const Ki in Qe){const Fe=Qe[Ki],qi=Fe.tileCoord,wi=Je[1]-qi[1],or=Math.round(Me[0]-(wi-1)*Xt),Ei=Je[2]-qi[2],En=Math.round(Me[1]-(Ei-1)*Ce),qt=Math.round(Me[0]-wi*Xt),ae=Math.round(Me[1]-Ei*Ce),be=or-qt,ze=En-ae,$e=v===$,ti=$e&&Fe.getAlpha(ct(this),t.time)!==1;let Ne=!1;if(!ti)if(Z){z=[qt,ae,qt+be,ae,qt+be,ae+ze,qt,ae+ze];for(let Ji=0,Ln=Z.length;Ji<Ln;++Ji)if(v!==$&&$<ut[Ji]){const Yt=Z[Ji];ce([qt,ae,qt+be,ae+ze],[Yt[0],Yt[3],Yt[4],Yt[7]])&&(Ne||(j.save(),Ne=!0),j.beginPath(),j.moveTo(z[0],z[1]),j.lineTo(z[2],z[3]),j.lineTo(z[4],z[5]),j.lineTo(z[6],z[7]),j.moveTo(Yt[6],Yt[7]),j.lineTo(Yt[4],Yt[5]),j.lineTo(Yt[2],Yt[3]),j.lineTo(Yt[0],Yt[1]),j.clip())}Z.push(z),ut.push($)}else j.clearRect(qt,ae,be,ze);this.drawTileImage(Fe,t,qt,ae,be,ze,Yi,$e),Z&&!ti?(Ne&&j.restore(),this.renderedTiles.unshift(Fe)):this.renderedTiles.push(Fe),this.updateUsedTiles(t.usedTiles,p,Fe)}}return this.renderedRevision=_,this.renderedResolution=w,this.extentChanged=!this.renderedExtent_||!Nn(this.renderedExtent_,O),this.renderedExtent_=O,this.renderedPixelRatio=d,this.renderedProjection=s,this.manageTilePyramid(t,p,y,d,s,T,v,f.getPreload()),this.scheduleExpireCache(t,p),this.postRender(j,t),i.extent&&j.restore(),j.imageSmoothingEnabled=!0,H!==B.style.transform&&(B.style.transform=H),this.container}drawTileImage(t,e,i,n,s,a,h,c){const d=this.getTileImage(t);if(!d)return;const f=ct(this),p=e.layerStatesArray[e.layerIndex],_=p.opacity*(c?t.getAlpha(f,e.time):1),y=_!==this.context.globalAlpha;y&&(this.context.save(),this.context.globalAlpha=_),this.context.drawImage(d,h,h,d.width-2*h,d.height-2*h,i,n,s,a),y&&this.context.restore(),_!==p.opacity?e.animate=!0:c&&t.endTransition(f)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}scheduleExpireCache(t,e){if(e.canExpireCache()){const i=(function(n,s,a){const h=ct(n);h in a.usedTiles&&n.expireCache(a.viewState.projection,a.usedTiles[h])}).bind(null,e);t.postRenderFunctions.push(i)}}updateUsedTiles(t,e,i){const n=ct(e);n in t||(t[n]={}),t[n][i.getKey()]=!0}manageTilePyramid(t,e,i,n,s,a,h,c,d){const f=ct(e);f in t.wantedTiles||(t.wantedTiles[f]={});const p=t.wantedTiles[f],_=t.tileQueue,y=i.getMinZoom(),v=t.viewState.rotation,w=v?Ha(t.viewState.center,t.viewState.resolution,v,t.size):void 0;let T=0,M,E,b,C,P,R;for(R=y;R<=h;++R)for(E=i.getTileRangeForExtentAndZ(a,R,E),b=i.getResolution(R),C=E.minX;C<=E.maxX;++C)for(P=E.minY;P<=E.maxY;++P)v&&!i.tileCoordIntersectsViewport([R,C,P],w)||(h-R<=c?(++T,M=e.getTile(R,C,P,n,s),M.getState()==et.IDLE&&(p[M.getKey()]=!0,_.isKeyQueued(M.getKey())||_.enqueue([M,f,i.getTileCoordCenter(M.tileCoord),b])),d!==void 0&&d(M)):e.useTile(R,C,P,s));e.updateCacheSize(T,s)}}const gw=fw;class pw extends cw{constructor(t){super(t)}createRenderer(){return new gw(this)}}const _w=pw;class mw{constructor(t){this.rbush_=new dd(t),this.items_={}}insert(t,e){const i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[ct(e)]=i}load(t,e){const i=new Array(e.length);for(let n=0,s=e.length;n<s;n++){const a=t[n],h=e[n],c={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:h};i[n]=c,this.items_[ct(h)]=c}this.rbush_.load(i)}remove(t){const e=ct(t),i=this.items_[e];return delete this.items_[e],this.rbush_.remove(i)!==null}update(t,e){const i=this.items_[ct(e)],n=[i.minX,i.minY,i.maxX,i.maxY];Nn(n,t)||(this.remove(e),this.insert(t,e))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(t){const e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(n){return n.value})}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,e){return this.forEach_(this.getInExtent(t),e)}forEach_(t,e){let i;for(let n=0,s=t.length;n<s;n++)if(i=e(t[n]),i)return i;return i}isEmpty(){return on(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const e=this.rbush_.toJSON();return ki(e.minX,e.minY,e.maxX,e.maxY,t)}concat(t){this.rbush_.load(t.rbush_.all());for(const e in t.items_)this.items_[e]=t.items_[e]}}const af=mw;class sh extends Re{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new sh(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(Ct(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=ft(t,lt.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?yw(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function yw(r){if(typeof r=="function")return r;let t;return Array.isArray(r)?t=r:(mt(typeof r.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[r]),function(){return t}}const lf=sh;class No extends Lu{constructor(t){super(),this.geometries_=t||null,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Ct),this.changeEventsKeys_.length=0}listenGeometriesChange_(){if(this.geometries_)for(let t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(ft(this.geometries_[t],lt.CHANGE,this.changed,this))}clone(){const t=new No(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<ln(this.getExtent(),t,e))return n;const s=this.geometries_;for(let a=0,h=s.length;a<h;++a)n=s[a].closestPointXY(t,e,i,n);return n}containsXY(t,e){const i=this.geometries_;for(let n=0,s=i.length;n<s;++n)if(i[n].containsXY(t,e))return!0;return!1}computeExtent(t){Sr(t);const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)Yc(t,e[i].getExtent());return t}getGeometries(){return hf(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[];const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);return t}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=[],i=this.geometries_;let n=!1;for(let s=0,a=i.length;s<a;++s){const h=i[s],c=h.getSimplifiedGeometry(t);e.push(c),c!==h&&(n=!0)}if(n){const s=new No(null);return s.setGeometriesArray(e),s}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this}getType(){return"GeometryCollection"}intersectsExtent(t){const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)if(e[i].intersectsExtent(t))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(t,e){const i=this.geometries_;for(let n=0,s=i.length;n<s;++n)i[n].rotate(t,e);this.changed()}scale(t,e,i){i||(i=Ri(this.getExtent()));const n=this.geometries_;for(let s=0,a=n.length;s<a;++s)n[s].scale(t,e,i);this.changed()}setGeometries(t){this.setGeometriesArray(hf(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)e[i].applyTransform(t);this.changed()}translate(t,e){const i=this.geometries_;for(let n=0,s=i.length;n<s;++n)i[n].translate(t,e);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function hf(r){const t=[];for(let e=0,i=r.length;e<i;++e)t.push(r[e].clone());return t}const vw=No;function Bo(r,t,e,i,n,s,a){let h,c;const d=(e-t)/i;if(d===1)h=t;else if(d===2)h=t,c=n;else if(d!==0){let f=r[t],p=r[t+1],_=0;const y=[0];for(let T=t+i;T<e;T+=i){const M=r[T],E=r[T+1];_+=Math.sqrt((M-f)*(M-f)+(E-p)*(E-p)),y.push(_),f=M,p=E}const v=n*_,w=em(y,v);w<0?(c=(v-y[-w-2])/(y[-w-1]-y[-w-2]),h=t+(-w-2)*i):h=t+w*i}a=a>1?a:2,s=s||new Array(a);for(let f=0;f<a;++f)s[f]=h===void 0?NaN:c===void 0?r[h+f]:Ee(r[h+f],r[h+i+f],c);return s}function oh(r,t,e,i,n,s){if(e==t)return null;let a;if(n<r[t+i-1])return s?(a=r.slice(t,t+i),a[i-1]=n,a):null;if(r[e-1]<n)return s?(a=r.slice(e-i,e),a[i-1]=n,a):null;if(n==r[t+i-1])return r.slice(t,t+i);let h=t/i,c=e/i;for(;h<c;){const _=h+c>>1;n<r[(_+1)*i-1]?c=_:h=_+1}const d=r[h*i-1];if(n==d)return r.slice((h-1)*i,(h-1)*i+i);const f=r[(h+1)*i-1],p=(n-d)/(f-d);a=[];for(let _=0;_<i-1;++_)a.push(Ee(r[(h-1)*i+_],r[h*i+_],p));return a.push(n),a}function xw(r,t,e,i,n,s,a){if(a)return oh(r,t,e[e.length-1],i,n,s);let h;if(n<r[i-1])return s?(h=r.slice(0,i),h[i-1]=n,h):null;if(r[r.length-1]<n)return s?(h=r.slice(r.length-i),h[i-1]=n,h):null;for(let c=0,d=e.length;c<d;++c){const f=e[c];if(t!=f){if(n<r[t+i-1])return null;if(n<=r[f-1])return oh(r,t,f,i,n,!1);t=f}}return null}function cf(r,t,e,i){let n=r[t],s=r[t+1],a=0;for(let h=t+i;h<e;h+=i){const c=r[h],d=r[h+1];a+=Math.sqrt((c-n)*(c-n)+(d-s)*(d-s)),n=c,s=d}return a}class Go extends gn{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendCoordinate(t){We(this.flatCoordinates,t),this.changed()}clone(){const t=new Go(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<ln(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(nl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),sl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,n))}forEachSegment(t){return Au(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){return this.layout!="XYM"&&this.layout!="XYZM"?null:(e=e!==void 0?e:!1,oh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return Di(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return Bo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return cf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const e=[];return e.length=so(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new Go(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return lo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ro(this.flatCoordinates,0,t,this.stride),this.changed()}}const ah=Go;class Uo extends gn{constructor(t,e,i){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(e!==void 0&&i)this.setFlatCoordinates(e,t),this.ends_=i;else{const n=t,s=[],a=[];for(let c=0,d=n.length;c<d;++c){const f=n[c];We(s,f.getFlatCoordinates()),a.push(s.length)}const h=n.length===0?this.getLayout():n[0].getLayout();this.setFlatCoordinates(h,s),this.ends_=a}}appendLineString(t){We(this.flatCoordinates,t.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new Uo(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<ln(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(rl(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ol(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,n))}getCoordinateAtM(t,e,i){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(e=e!==void 0?e:!1,i=i!==void 0?i:!1,xw(this.flatCoordinates,0,this.ends_,this.stride,t,e,i))}getCoordinates(){return Ir(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new ah(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLineStrings(){const t=this.flatCoordinates,e=this.ends_,i=this.layout,n=[];let s=0;for(let a=0,h=e.length;a<h;++a){const c=e[a],d=new ah(t.slice(s,c),i);n.push(d),s=c}return n}getFlatMidpoints(){const t=[],e=this.flatCoordinates;let i=0;const n=this.ends_,s=this.stride;for(let a=0,h=n.length;a<h;++a){const c=n[a],d=Bo(e,i,c,s,.5);We(t,d),i=c}return t}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=Mu(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,i),new Uo(e,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(t){return ly(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Ar(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}const ww=Uo;class lh extends gn{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){We(this.flatCoordinates,t.getFlatCoordinates()),this.changed()}clone(){const t=new lh(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<ln(this.getExtent(),t,e))return n;const s=this.flatCoordinates,a=this.stride;for(let h=0,c=s.length;h<c;h+=a){const d=un(t,e,s[h],s[h+1]);if(d<n){n=d;for(let f=0;f<a;++f)i[f]=s[h+f];i.length=a}}return n}getCoordinates(){return Di(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const e=this.flatCoordinates.length/this.stride;return t<0||e<=t?null:new ao(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){const t=this.flatCoordinates,e=this.layout,i=this.stride,n=[];for(let s=0,a=t.length;s<a;s+=i){const h=new ao(t.slice(s,s+i),e);n.push(h)}return n}getType(){return"MultiPoint"}intersectsExtent(t){const e=this.flatCoordinates,i=this.stride;for(let n=0,s=e.length;n<s;n+=i){const a=e[n],h=e[n+1];if(Ga(t,a,h))return!0}return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ro(this.flatCoordinates,0,t,this.stride),this.changed()}}const uf=lh;function df(r,t,e,i){const n=[];let s=xe();for(let a=0,h=e.length;a<h;++a){const c=e[a];s=ja(r,t,c[0],i),n.push((s[0]+s[2])/2,(s[1]+s[3])/2),t=c[c.length-1]}return n}class jo extends gn{constructor(t,e,i){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(t[0])){const n=t,s=[],a=[];for(let h=0,c=n.length;h<c;++h){const d=n[h],f=s.length,p=d.getEnds();for(let _=0,y=p.length;_<y;++_)p[_]+=f;We(s,d.getFlatCoordinates()),a.push(p)}e=n.length===0?this.getLayout():n[0].getLayout(),t=s,i=a}e!==void 0&&i?(this.setFlatCoordinates(e,t),this.endss_=i):this.setCoordinates(t,e)}appendPolygon(t){let e;if(!this.flatCoordinates)this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();else{const i=this.flatCoordinates.length;We(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(let n=0,s=e.length;n<s;++n)e[n]+=i}this.endss_.push(e),this.changed()}clone(){const t=this.endss_.length,e=new Array(t);for(let n=0;n<t;++n)e[n]=this.endss_[n].slice();const i=new jo(this.flatCoordinates.slice(),this.layout,e);return i.applyProperties(this),i}closestPointXY(t,e,i,n){return n<ln(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ty(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ey(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return ay(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return sy(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),gl(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,ll(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=df(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Ru(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new uf(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;Ou(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=gl(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=ry(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,i),new jo(e,"XY",i)}getPolygon(t){if(t<0||this.endss_.length<=t)return null;let e;if(t===0)e=0;else{const s=this.endss_[t-1];e=s[s.length-1]}const i=this.endss_[t].slice(),n=i[i.length-1];if(e!==0)for(let s=0,a=i.length;s<a;++s)i[s]-=e;return new Oi(this.flatCoordinates.slice(e,n),this.layout,i)}getPolygons(){const t=this.layout,e=this.flatCoordinates,i=this.endss_,n=[];let s=0;for(let a=0,h=i.length;a<h;++a){const c=i[a].slice(),d=c[c.length-1];if(s!==0)for(let p=0,_=c.length;p<_;++p)c[p]-=s;const f=new Oi(e.slice(s,d),t,c);n.push(f),s=d}return n}getType(){return"MultiPolygon"}intersectsExtent(t){return hy(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=Cu(this.flatCoordinates,0,t,this.stride,this.endss_);if(i.length===0)this.flatCoordinates.length=0;else{const n=i[i.length-1];this.flatCoordinates.length=n.length===0?0:n[n.length-1]}this.changed()}}const Ew=jo,ff=Ht();class rr{constructor(t,e,i,n,s,a){this.styleFunction,this.extent_,this.id_=a,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=s,this.squaredTolerance_,this.stride_=n,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?Xc(this.flatCoordinates_):ja(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=Ri(this.getExtent());this.flatInteriorPoints_=ul(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=uy(this.flatCoordinates_,this.ends_),e=df(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=Ru(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=Bo(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let e=0;const i=this.ends_;for(let n=0,s=i.length;n<s;++n){const a=i[n],h=Bo(t,e,a,2,.5);We(this.flatMidpoints_,h),e=a}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(t){return this}simplifyTransformed(t,e){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(t){t=zt(t);const e=t.getExtent(),i=t.getWorldExtent();if(e&&i){const n=we(i)/we(e);Ie(ff,i[0],i[3],n,-n,0,0,0),Ii(this.flatCoordinates_,0,this.flatCoordinates_.length,2,ff,this.flatCoordinates_)}}applyTransform(t){t(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new rr(this.type_,this.flatCoordinates_.slice(),this.ends_.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=Nc((t,e)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const i=this.simplifiedGeometry_.getFlatCoordinates();let n;switch(this.type_){case"LineString":i.length=so(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),n=[i.length];break;case"MultiLineString":n=[],i.length=Mu(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,n);break;case"Polygon":n=[],i.length=al(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,n);break}return n&&(this.simplifiedGeometry_=new rr(this.type_,i,n,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}rr.prototype.getFlatCoordinates=rr.prototype.getOrientedFlatCoordinates;const mi=rr;function Lw(r,t){return[[-1/0,-1/0,1/0,1/0]]}let bw=!1;function Tw(r,t,e,i,n,s,a){const h=new XMLHttpRequest;h.open("GET",typeof r=="function"?r(e,i,n):r,!0),t.getType()=="arraybuffer"&&(h.responseType="arraybuffer"),h.withCredentials=bw,h.onload=function(c){if(!h.status||h.status>=200&&h.status<300){const d=t.getType();let f;d=="json"?f=JSON.parse(h.responseText):d=="text"?f=h.responseText:d=="xml"?(f=h.responseXML,f||(f=new DOMParser().parseFromString(h.responseText,"application/xml"))):d=="arraybuffer"&&(f=h.response),f?s(t.readFeatures(f,{extent:e,featureProjection:n}),t.readProjection(f)):a()}else a()},h.onerror=a,h.send()}function gf(r,t){return function(e,i,n,s,a){const h=this;Tw(r,t,e,i,n,function(c,d){h.addFeatures(c),s!==void 0&&s(c)},a||In)}}class Zi extends ai{constructor(t,e,i){super(t),this.feature=e,this.features=i}}class Cw extends tf{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=In,this.format_=t.format,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(mt(this.format_,"`format` must be set when `url` is set"),this.loader_=gf(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:Lw;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new af:null,this.loadedExtentsRtree_=new af,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,n;Array.isArray(t.features)?n=t.features:t.features&&(i=t.features,n=i.getArray()),!e&&i===void 0&&(i=new Ve(n)),n!==void 0&&this.addFeaturesInternal(n),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=ct(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const i=t.getGeometry();if(i){const n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Zi(oe.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof mi||(this.featureChangeKeys_[t]=[ft(e,lt.CHANGE,this.handleFeatureChange_,this),ft(e,An.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let i=!0;if(e.getId()!==void 0){const n=String(e.getId());if(!(n in this.idIndex_))this.idIndex_[n]=e;else if(e instanceof mi){const s=this.idIndex_[n];s instanceof mi?Array.isArray(s)?s.push(e):this.idIndex_[n]=[s,e]:i=!1}else i=!1}return i&&(mt(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),i}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],i=[],n=[];for(let s=0,a=t.length;s<a;s++){const h=t[s],c=ct(h);this.addToIndex_(c,h)&&i.push(h)}for(let s=0,a=i.length;s<a;s++){const h=i[s],c=ct(h);this.setupChangeEvents_(c,h);const d=h.getGeometry();if(d){const f=d.getExtent();e.push(f),n.push(h)}else this.nullGeometryFeatures_[c]=h}if(this.featuresRtree_&&this.featuresRtree_.load(e,n),this.hasListener(oe.ADDFEATURE))for(let s=0,a=i.length;s<a;s++)this.dispatchEvent(new Zi(oe.ADDFEATURE,i[s]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener(oe.ADDFEATURE,function(i){e||(e=!0,t.push(i.feature),e=!1)}),this.addEventListener(oe.REMOVEFEATURE,function(i){e||(e=!0,t.remove(i.feature),e=!1)}),t.addEventListener(ue.ADD,i=>{e||(e=!0,this.addFeature(i.element),e=!1)}),t.addEventListener(ue.REMOVE,i=>{e||(e=!0,this.removeFeature(i.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(Ct);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const i=n=>{this.removeFeatureInternal(n)};this.featuresRtree_.forEach(i);for(const n in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new Zi(oe.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,function(n){const s=n.getGeometry();if(s instanceof mi||s.intersectsCoordinate(t))return e(n)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(i){const n=i.getGeometry();if(n instanceof mi||n.intersectsExtent(t)){const s=e(i);if(s)return s}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),on(this.nullGeometryFeatures_)||We(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(i){e.push(i)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const n=Lm(t,e);return[].concat(...n.map(s=>this.featuresRtree_.getInExtent(s)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const i=t[0],n=t[1];let s=null;const a=[NaN,NaN];let h=1/0;const c=[-1/0,-1/0,1/0,1/0];return e=e||Tr,this.featuresRtree_.forEachInExtent(c,function(d){if(e(d)){const f=d.getGeometry(),p=h;if(h=f instanceof mi?0:f.closestPointXY(i,n,a,h),h<p){s=d;const _=Math.sqrt(h);c[0]=i-_,c[1]=n-_,c[2]=i+_,c[3]=n+_}}}),s}getExtent(t){return this.featuresRtree_.getExtent(t)}getFeatureById(t){const e=this.idIndex_[t.toString()];return e!==void 0?e:null}getFeatureByUid(t){const e=this.uidIndex_[t];return e!==void 0?e:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(t){const e=t.target,i=ct(e),n=e.getGeometry();if(!n)i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);else{const a=n.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(a,e)):this.featuresRtree_&&this.featuresRtree_.update(a,e)}const s=e.getId();if(s!==void 0){const a=s.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Zi(oe.CHANGEFEATURE,e))}hasFeature(t){const e=t.getId();return e!==void 0?e in this.idIndex_:ct(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&on(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(t,e,i){const n=this.loadedExtentsRtree_,s=this.strategy_(t,e,i);for(let a=0,h=s.length;a<h;++a){const c=s[a];n.forEachInExtent(c,function(f){return hn(f.extent,c)})||(++this.loadingExtentsCount_,this.dispatchEvent(new Zi(oe.FEATURESLOADSTART)),this.loader_.call(this,c,e,i,f=>{--this.loadingExtentsCount_,this.dispatchEvent(new Zi(oe.FEATURESLOADEND,void 0,f))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Zi(oe.FEATURESLOADERROR))}),n.insert(c,{extent:c.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_;let i;e.forEachInExtent(t,function(n){if(Nn(n.extent,t))return i=n,!0}),i&&e.remove(i)}removeFeature(t){if(!t)return;const e=ct(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=ct(t),i=this.featureChangeKeys_[e];if(!i)return;i.forEach(Ct),delete this.featureChangeKeys_[e];const n=t.getId();return n!==void 0&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Zi(oe.REMOVEFEATURE,t)),t}removeFromIdIndex_(t){let e=!1;for(const i in this.idIndex_){const n=this.idIndex_[i];if(t instanceof mi&&Array.isArray(n)&&n.includes(t))n.splice(n.indexOf(t),1);else if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}}return e}setLoader(t){this.loader_=t}setUrl(t){mt(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(gf(t,this.format_))}}const Zo=Cw;class Mw{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=lf,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let i=e.dataProjection?zt(e.dataProjection):this.readProjection(t);e.extent&&i&&i.getUnits()==="tile-pixels"&&(i=zt(i),i.setWorldExtent(e.extent)),e={dataProjection:i,featureProjection:e.featureProjection}}return this.adaptOptions(e)}adaptOptions(t){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},t)}getType(){return rt()}readFeature(t,e){return rt()}readFeatures(t,e){return rt()}readGeometry(t,e){return rt()}readProjection(t){return rt()}writeFeature(t,e){return rt()}writeFeatures(t,e){return rt()}writeGeometry(t,e){return rt()}}function hh(r,t,e){const i=e?zt(e.featureProjection):null,n=e?zt(e.dataProjection):null;let s=r;if(i&&n&&!dn(i,n)){t&&(s=r.clone());const a=t?i:n,h=t?n:i;a.getUnits()==="tile-pixels"?s.transform(a,h):s.applyTransform(Rr(a,h))}if(t&&e&&e.decimals!==void 0){const a=Math.pow(10,e.decimals),h=function(c){for(let d=0,f=c.length;d<f;++d)c[d]=Math.round(c[d]*a)/a;return c};s===r&&(s=r.clone()),s.applyTransform(h)}return s}const Sw={Point:ao,LineString:ah,Polygon:Oi,MultiPoint:uf,MultiLineString:ww,MultiPolygon:Ew};function Pw(r,t,e){return Array.isArray(t[0])?(Ou(r,0,t,e)||(r=r.slice(),gl(r,0,t,e)),r):(fl(r,0,t,e)||(r=r.slice(),ho(r,0,t,e)),r)}function pf(r,t){var s;const e=r.geometry;if(!e)return[];if(Array.isArray(e))return e.map(a=>pf({...r,geometry:a})).flat();const i=e.type==="MultiPolygon"?"Polygon":e.type;if(i==="GeometryCollection"||i==="Circle")throw new Error("Unsupported geometry type: "+i);const n=e.layout.length;return hh(new mi(i,i==="Polygon"?Pw(e.flatCoordinates,e.ends,n):e.flatCoordinates,(s=e.ends)==null?void 0:s.flat(),n,r.properties||{},r.id).enableSimplifyTransformed(),!1,t)}function ch(r,t){if(!r)return null;if(Array.isArray(r)){const i=r.map(n=>ch(n,t));return new vw(i)}const e=Sw[r.type];return hh(new e(r.flatCoordinates,r.layout,r.ends),!1,t)}class kw extends Mw{constructor(){super()}getType(){return"json"}readFeature(t,e){return this.readFeatureFromObject(Wo(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(Wo(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return rt()}readFeaturesFromObject(t,e){return rt()}readGeometry(t,e){return this.readGeometryFromObject(Wo(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return rt()}readProjection(t){return this.readProjectionFromObject(Wo(t))}readProjectionFromObject(t){return rt()}writeFeature(t,e){return JSON.stringify(this.writeFeatureObject(t,e))}writeFeatureObject(t,e){return rt()}writeFeatures(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))}writeFeaturesObject(t,e){return rt()}writeGeometry(t,e){return JSON.stringify(this.writeGeometryObject(t,e))}writeGeometryObject(t,e){return rt()}}function Wo(r){if(typeof r=="string"){const t=JSON.parse(r);return t||null}return r!==null?r:null}const Rw=kw;class Aw extends Rw{constructor(t){t=t||{},super(),this.dataProjection=zt(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=zt(t.featureProjection)),t.featureClass&&(this.featureClass=t.featureClass),this.geometryName_=t.geometryName,this.extractGeometryName_=t.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(t,e){let i=null;t.type==="Feature"?i=t:i={type:"Feature",geometry:t,properties:null};const n=uh(i.geometry);if(this.featureClass===mi)return pf({geometry:n,id:i.id,properties:i.properties},e);const s=new lf;return this.geometryName_?s.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&s.setGeometryName(i.geometry_name),s.setGeometry(ch(n,e)),"id"in i&&s.setId(i.id),i.properties&&s.setProperties(i.properties,!0),s}readFeaturesFromObject(t,e){const i=t;let n=null;if(i.type==="FeatureCollection"){const s=t;n=[];const a=s.features;for(let h=0,c=a.length;h<c;++h){const d=this.readFeatureFromObject(a[h],e);d&&n.push(d)}}else n=[this.readFeatureFromObject(t,e)];return n.flat()}readGeometryFromObject(t,e){return Iw(t,e)}readProjectionFromObject(t){const e=t.crs;let i;if(e)if(e.type=="name")i=zt(e.properties.name);else if(e.type==="EPSG")i=zt("EPSG:"+e.properties.code);else throw new Error("Unknown SRS type");else i=this.dataProjection;return i}writeFeatureObject(t,e){e=this.adaptOptions(e);const i={type:"Feature",geometry:null,properties:null},n=t.getId();if(n!==void 0&&(i.id=n),!t.hasProperties())return i;const s=t.getProperties(),a=t.getGeometry();return a&&(i.geometry=dh(a,e),delete s[t.getGeometryName()]),on(s)||(i.properties=s),i}writeFeaturesObject(t,e){e=this.adaptOptions(e);const i=[];for(let n=0,s=t.length;n<s;++n)i.push(this.writeFeatureObject(t[n],e));return{type:"FeatureCollection",features:i}}writeGeometryObject(t,e){return dh(t,this.adaptOptions(e))}}function uh(r,t){if(!r)return null;let e;switch(r.type){case"Point":{e=Ow(r);break}case"LineString":{e=Fw(r);break}case"Polygon":{e=Gw(r);break}case"MultiPoint":{e=Nw(r);break}case"MultiLineString":{e=zw(r);break}case"MultiPolygon":{e=Bw(r);break}case"GeometryCollection":{e=Dw(r);break}default:throw new Error("Unsupported GeoJSON type: "+r.type)}return e}function Iw(r,t){const e=uh(r);return ch(e,t)}function Dw(r,t){return r.geometries.map(function(i){return uh(i)})}function Ow(r){const t=r.coordinates;return{type:"Point",flatCoordinates:t,layout:pn(t.length)}}function Fw(r){const t=r.coordinates,e=t.flat();return{type:"LineString",flatCoordinates:e,ends:[e.length],layout:pn(t[0].length)}}function zw(r){const t=r.coordinates,e=t[0][0].length,i=[],n=Ar(i,0,t,e);return{type:"MultiLineString",flatCoordinates:i,ends:n,layout:pn(e)}}function Nw(r){const t=r.coordinates;return{type:"MultiPoint",flatCoordinates:t.flat(),layout:pn(t[0].length)}}function Bw(r){const t=r.coordinates,e=[],i=t[0][0][0].length,n=Cu(e,0,t,i);return{type:"MultiPolygon",flatCoordinates:e,ends:n,layout:pn(i)}}function Gw(r){const t=r.coordinates,e=[],i=t[0][0].length,n=Ar(e,0,t,i);return{type:"Polygon",flatCoordinates:e,ends:n,layout:pn(i)}}function dh(r,t){r=hh(r,!0,t);const e=r.getType();let i;switch(e){case"Point":{i=Vw(r);break}case"LineString":{i=jw(r);break}case"Polygon":{i=Xw(r,t);break}case"MultiPoint":{i=Ww(r);break}case"MultiLineString":{i=Zw(r);break}case"MultiPolygon":{i=Hw(r,t);break}case"GeometryCollection":{i=Uw(r,t);break}case"Circle":{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+e)}return i}function Uw(r,t){return t=Object.assign({},t),delete t.featureProjection,{type:"GeometryCollection",geometries:r.getGeometriesArray().map(function(i){return dh(i,t)})}}function jw(r,t){return{type:"LineString",coordinates:r.getCoordinates()}}function Zw(r,t){return{type:"MultiLineString",coordinates:r.getCoordinates()}}function Ww(r,t){return{type:"MultiPoint",coordinates:r.getCoordinates()}}function Hw(r,t){let e;return t&&(e=t.rightHanded),{type:"MultiPolygon",coordinates:r.getCoordinates(e)}}function Vw(r,t){return{type:"Point",coordinates:r.getCoordinates()}}function Xw(r,t){let e;return t&&(e=t.rightHanded),{type:"Polygon",coordinates:r.getCoordinates(e)}}const Ho=Aw,is={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Vo=[is.FILL],Wi=[is.STROKE],wn=[is.BEGIN_PATH],_f=[is.CLOSE_PATH],it=is;class Yw{drawCustom(t,e,i,n){}drawGeometry(t){}setStyle(t){}drawCircle(t,e){}drawFeature(t,e){}drawGeometryCollection(t,e){}drawLineString(t,e){}drawMultiLineString(t,e){}drawMultiPoint(t,e){}drawMultiPolygon(t,e){}drawPoint(t,e){}drawPolygon(t,e){}drawText(t,e){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}const mf=Yw;class Kw extends mf{constructor(t,e,i,n){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=n,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const e=this.pixelRatio;return e==1?t:t.map(function(i){return i*e})}appendFlatPointCoordinates(t,e){const i=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,s=this.coordinates;let a=s.length;for(let h=0,c=t.length;h<c;h+=e)n[0]=t[h],n[1]=t[h+1],Ys(i,n)&&(s[a++]=n[0],s[a++]=n[1]);return a}appendFlatLineCoordinates(t,e,i,n,s,a){const h=this.coordinates;let c=h.length;const d=this.getBufferedMaxExtent();a&&(e+=n);let f=t[e],p=t[e+1];const _=this.tmpCoordinate_;let y=!0,v,w,T;for(v=e+n;v<i;v+=n)_[0]=t[v],_[1]=t[v+1],T=Ua(d,_),T!==w?(y&&(h[c++]=f,h[c++]=p,y=!1),h[c++]=_[0],h[c++]=_[1]):T===Wt.INTERSECTING?(h[c++]=_[0],h[c++]=_[1],y=!1):y=!0,f=_[0],p=_[1],w=T;return(s&&y||v===e+n)&&(h[c++]=f,h[c++]=p),c}drawCustomCoordinates_(t,e,i,n,s){for(let a=0,h=i.length;a<h;++a){const c=i[a],d=this.appendFlatLineCoordinates(t,e,c,n,!1,!1);s.push(d),e=c}return e}drawCustom(t,e,i,n){this.beginGeometry(t,e);const s=t.getType(),a=t.getStride(),h=this.coordinates.length;let c,d,f,p,_;switch(s){case"MultiPolygon":c=t.getOrientedFlatCoordinates(),p=[];const y=t.getEndss();_=0;for(let v=0,w=y.length;v<w;++v){const T=[];_=this.drawCustomCoordinates_(c,_,y[v],a,T),p.push(T)}this.instructions.push([it.CUSTOM,h,p,t,i,ll]),this.hitDetectionInstructions.push([it.CUSTOM,h,p,t,n||i,ll]);break;case"Polygon":case"MultiLineString":f=[],c=s=="Polygon"?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),_=this.drawCustomCoordinates_(c,0,t.getEnds(),a,f),this.instructions.push([it.CUSTOM,h,f,t,i,Ir]),this.hitDetectionInstructions.push([it.CUSTOM,h,f,t,n||i,Ir]);break;case"LineString":case"Circle":c=t.getFlatCoordinates(),d=this.appendFlatLineCoordinates(c,0,c.length,a,!1,!1),this.instructions.push([it.CUSTOM,h,d,t,i,Di]),this.hitDetectionInstructions.push([it.CUSTOM,h,d,t,n||i,Di]);break;case"MultiPoint":c=t.getFlatCoordinates(),d=this.appendFlatPointCoordinates(c,a),d>h&&(this.instructions.push([it.CUSTOM,h,d,t,i,Di]),this.hitDetectionInstructions.push([it.CUSTOM,h,d,t,n||i,Di]));break;case"Point":c=t.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),d=this.coordinates.length,this.instructions.push([it.CUSTOM,h,d,t,i]),this.hitDetectionInstructions.push([it.CUSTOM,h,d,t,n||i]);break}this.endGeometry(e)}beginGeometry(t,e){this.beginGeometryInstruction1_=[it.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[it.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const i=t.length;let n,s,a=-1;for(e=0;e<i;++e)n=t[e],s=n[0],s==it.END_GEOMETRY?a=e:s==it.BEGIN_GEOMETRY&&(n[2]=e,im(this.hitDetectionInstructions,a,e),a=-1)}setFillStrokeStyle(t,e){const i=this.state;if(t){const n=t.getColor();i.fillStyle=Xe(n||de)}else i.fillStyle=void 0;if(e){const n=e.getColor();i.strokeStyle=Xe(n||Gr);const s=e.getLineCap();i.lineCap=s!==void 0?s:Un;const a=e.getLineDash();i.lineDash=a?a.slice():ci;const h=e.getLineDashOffset();i.lineDashOffset=h||ui;const c=e.getLineJoin();i.lineJoin=c!==void 0?c:jn;const d=e.getWidth();i.lineWidth=d!==void 0?d:jr;const f=e.getMiterLimit();i.miterLimit=f!==void 0?f:Br,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(t){const e=t.fillStyle,i=[it.SET_FILL_STYLE,e];return typeof e!="string"&&i.push(!0),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[it.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const i=t.fillStyle;(typeof i!="string"||t.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){const i=t.strokeStyle,n=t.lineCap,s=t.lineDash,a=t.lineDashOffset,h=t.lineJoin,c=t.lineWidth,d=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||s!=t.currentLineDash&&!li(t.currentLineDash,s)||t.currentLineDashOffset!=a||t.currentLineJoin!=h||t.currentLineWidth!=c||t.currentMiterLimit!=d)&&(i!==void 0&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=s,t.currentLineDashOffset=a,t.currentLineJoin=h,t.currentLineWidth=c,t.currentMiterLimit=d)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[it.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Vc(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;Xs(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}const ns=Kw;class qw extends ns{constructor(t,e,i,n){super(t,e,i,n),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const i=t.getFlatCoordinates(),n=t.getStride(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,n);this.instructions.push([it.DRAW_IMAGE,s,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([it.DRAW_IMAGE,s,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const i=t.getFlatCoordinates(),n=t.getStride(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,n);this.instructions.push([it.DRAW_IMAGE,s,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([it.DRAW_IMAGE,s,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(t,e){const i=t.getAnchor(),n=t.getSize(),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const Jw=qw;class Qw extends ns{constructor(t,e,i,n){super(t,e,i,n)}drawFlatCoordinates_(t,e,i,n){const s=this.coordinates.length,a=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),h=[it.MOVE_TO_LINE_TO,s,a];return this.instructions.push(h),this.hitDetectionInstructions.push(h),i}drawLineString(t,e){const i=this.state,n=i.strokeStyle,s=i.lineWidth;if(n===void 0||s===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([it.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ci,ui],wn);const a=t.getFlatCoordinates(),h=t.getStride();this.drawFlatCoordinates_(a,0,a.length,h),this.hitDetectionInstructions.push(Wi),this.endGeometry(e)}drawMultiLineString(t,e){const i=this.state,n=i.strokeStyle,s=i.lineWidth;if(n===void 0||s===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([it.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ci,ui],wn);const a=t.getEnds(),h=t.getFlatCoordinates(),c=t.getStride();let d=0;for(let f=0,p=a.length;f<p;++f)d=this.drawFlatCoordinates_(h,d,a[f],c);this.hitDetectionInstructions.push(Wi),this.endGeometry(e)}finish(){const t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(Wi),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(Wi),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(wn)}}const $w=Qw;class tE extends ns{constructor(t,e,i,n){super(t,e,i,n)}drawFlatCoordinatess_(t,e,i,n){const s=this.state,a=s.fillStyle!==void 0,h=s.strokeStyle!==void 0,c=i.length;this.instructions.push(wn),this.hitDetectionInstructions.push(wn);for(let d=0;d<c;++d){const f=i[d],p=this.coordinates.length,_=this.appendFlatLineCoordinates(t,e,f,n,!0,!h),y=[it.MOVE_TO_LINE_TO,p,_];this.instructions.push(y),this.hitDetectionInstructions.push(y),h&&(this.instructions.push(_f),this.hitDetectionInstructions.push(_f)),e=f}return a&&(this.instructions.push(Vo),this.hitDetectionInstructions.push(Vo)),h&&(this.instructions.push(Wi),this.hitDetectionInstructions.push(Wi)),e}drawCircle(t,e){const i=this.state,n=i.fillStyle,s=i.strokeStyle;if(n===void 0&&s===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([it.SET_FILL_STYLE,de]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([it.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ci,ui]);const a=t.getFlatCoordinates(),h=t.getStride(),c=this.coordinates.length;this.appendFlatLineCoordinates(a,0,a.length,h,!1,!1);const d=[it.CIRCLE,c];this.instructions.push(wn,d),this.hitDetectionInstructions.push(wn,d),i.fillStyle!==void 0&&(this.instructions.push(Vo),this.hitDetectionInstructions.push(Vo)),i.strokeStyle!==void 0&&(this.instructions.push(Wi),this.hitDetectionInstructions.push(Wi)),this.endGeometry(e)}drawPolygon(t,e){const i=this.state,n=i.fillStyle,s=i.strokeStyle;if(n===void 0&&s===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([it.SET_FILL_STYLE,de]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([it.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ci,ui]);const a=t.getEnds(),h=t.getOrientedFlatCoordinates(),c=t.getStride();this.drawFlatCoordinatess_(h,0,a,c),this.endGeometry(e)}drawMultiPolygon(t,e){const i=this.state,n=i.fillStyle,s=i.strokeStyle;if(n===void 0&&s===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([it.SET_FILL_STYLE,de]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([it.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ci,ui]);const a=t.getEndss(),h=t.getOrientedFlatCoordinates(),c=t.getStride();let d=0;for(let f=0,p=a.length;f<p;++f)d=this.drawFlatCoordinatess_(h,d,a[f],c);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(t!==0){const e=this.coordinates;for(let i=0,n=e.length;i<n;++i)e[i]=_n(e[i],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;t.fillStyle!==void 0&&this.updateFillStyle(t,this.createFill),t.strokeStyle!==void 0&&this.updateStrokeStyle(t,this.applyStroke)}}const yf=tE;function eE(r,t,e,i,n){const s=[];let a=e,h=0,c=t.slice(e,2);for(;h<r&&a+n<i;){const[d,f]=c.slice(-2),p=t[a+n],_=t[a+n+1],y=Math.sqrt((p-d)*(p-d)+(_-f)*(_-f));if(h+=y,h>=r){const v=(r-h+y)/y,w=Ee(d,p,v),T=Ee(f,_,v);c.push(w,T),s.push(c),c=[w,T],h==r&&(a+=n),h=0}else if(h<r)c.push(t[a+n],t[a+n+1]),a+=n;else{const v=y-h,w=Ee(d,p,v/y),T=Ee(f,_,v/y);c.push(w,T),s.push(c),c=[w,T],h=0,a+=n}}return h>0&&s.push(c),s}function iE(r,t,e,i,n){let s=e,a=e,h=0,c=0,d=e,f,p,_,y,v,w,T,M,E,b;for(p=e;p<i;p+=n){const C=t[p],P=t[p+1];v!==void 0&&(E=C-v,b=P-w,y=Math.sqrt(E*E+b*b),T!==void 0&&(c+=_,f=Math.acos((T*E+M*b)/(_*y)),f>r&&(c>h&&(h=c,s=d,a=p),c=0,d=p-n)),_=y,T=E,M=b),v=C,w=P}return c+=y,c>h?[d,p]:[s,a]}const Xo={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class nE extends ns{constructor(t,e,i,n){super(t,e,i,n),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[de]={fillStyle:de},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e){const i=this.textFillState_,n=this.textStrokeState_,s=this.textState_;if(this.text_===""||!s||!i&&!n)return;const a=this.coordinates;let h=a.length;const c=t.getType();let d=null,f=t.getStride();if(s.placement==="line"&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!ce(this.getBufferedMaxExtent(),t.getExtent()))return;let p;if(d=t.getFlatCoordinates(),c=="LineString")p=[d.length];else if(c=="MultiLineString")p=t.getEnds();else if(c=="Polygon")p=t.getEnds().slice(0,1);else if(c=="MultiPolygon"){const w=t.getEndss();p=[];for(let T=0,M=w.length;T<M;++T)p.push(w[T][0])}this.beginGeometry(t,e);const _=s.repeat,y=_?void 0:s.textAlign;let v=0;for(let w=0,T=p.length;w<T;++w){let M;_?M=eE(_*this.resolution,d,v,p[w],f):M=[d.slice(v,p[w])];for(let E=0,b=M.length;E<b;++E){const C=M[E];let P=0,R=C.length;if(y==null){const O=iE(s.maxAngle,C,0,C.length,2);P=O[0],R=O[1]}for(let O=P;O<R;O+=f)a.push(C[O],C[O+1]);const D=a.length;v=p[w],this.drawChars_(h,D),h=D}}this.endGeometry(e)}else{let p=s.overflow?null:[];switch(c){case"Point":case"MultiPoint":d=t.getFlatCoordinates();break;case"LineString":d=t.getFlatMidpoint();break;case"Circle":d=t.getCenter();break;case"MultiLineString":d=t.getFlatMidpoints(),f=2;break;case"Polygon":d=t.getFlatInteriorPoint(),s.overflow||p.push(d[2]/this.resolution),f=3;break;case"MultiPolygon":const M=t.getFlatInteriorPoints();d=[];for(let E=0,b=M.length;E<b;E+=3)s.overflow||p.push(M[E+2]/this.resolution),d.push(M[E],M[E+1]);if(d.length===0)return;f=2;break}const _=this.appendFlatPointCoordinates(d,f);if(_===h)return;if(p&&(_-h)/2!==d.length/f){let M=h/2;p=p.filter((E,b)=>{const C=a[(M+b)*2]===d[b*f]&&a[(M+b)*2+1]===d[b*f+1];return C||--M,C})}this.saveTextStates_(),(s.backgroundFill||s.backgroundStroke)&&(this.setFillStrokeStyle(s.backgroundFill,s.backgroundStroke),s.backgroundFill&&this.updateFillStyle(this.state,this.createFill),s.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);let y=s.padding;if(y!=yn&&(s.scale[0]<0||s.scale[1]<0)){let M=s.padding[0],E=s.padding[1],b=s.padding[2],C=s.padding[3];s.scale[0]<0&&(E=-E,C=-C),s.scale[1]<0&&(M=-M,b=-b),y=[M,E,b,C]}const v=this.pixelRatio;this.instructions.push([it.DRAW_IMAGE,h,_,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,y==yn?yn:y.map(function(M){return M*v}),!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]);const w=1/v,T=this.state.fillStyle;s.backgroundFill&&(this.state.fillStyle=de,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([it.DRAW_IMAGE,h,_,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[w,w],NaN,void 0,this.declutterImageWithText_,y,!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?de:this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]),s.backgroundFill&&(this.state.fillStyle=T,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,n=this.strokeKey_;t&&(n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const s=this.textKey_;s in this.textStates||(this.textStates[s]={font:e.font,textAlign:e.textAlign||Ur,justify:e.justify,textBaseline:e.textBaseline||xo,scale:e.scale});const a=this.fillKey_;i&&(a in this.fillStates||(this.fillStates[a]={fillStyle:i.fillStyle}))}drawChars_(t,e){const i=this.textStrokeState_,n=this.textState_,s=this.strokeKey_,a=this.textKey_,h=this.fillKey_;this.saveTextStates_();const c=this.pixelRatio,d=Xo[n.textBaseline],f=this.textOffsetY_*c,p=this.text_,_=i?i.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([it.DRAW_CHARS,t,e,d,n.overflow,h,n.maxAngle,c,f,s,_*c,p,a,1]),this.hitDetectionInstructions.push([it.DRAW_CHARS,t,e,d,n.overflow,h&&de,n.maxAngle,c,f,s,_*c,p,a,1/c])}setTextStyle(t,e){let i,n,s;if(!t)this.text_="";else{const a=t.getFill();a?(n=this.textFillState_,n||(n={},this.textFillState_=n),n.fillStyle=Xe(a.getColor()||de)):(n=null,this.textFillState_=n);const h=t.getStroke();if(!h)s=null,this.textStrokeState_=s;else{s=this.textStrokeState_,s||(s={},this.textStrokeState_=s);const v=h.getLineDash(),w=h.getLineDashOffset(),T=h.getWidth(),M=h.getMiterLimit();s.lineCap=h.getLineCap()||Un,s.lineDash=v?v.slice():ci,s.lineDashOffset=w===void 0?ui:w,s.lineJoin=h.getLineJoin()||jn,s.lineWidth=T===void 0?jr:T,s.miterLimit=M===void 0?Br:M,s.strokeStyle=Xe(h.getColor()||Gr)}i=this.textState_;const c=t.getFont()||Qu;Fy(c);const d=t.getScaleArray();i.overflow=t.getOverflow(),i.font=c,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.repeat=t.getRepeat(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||xo,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||yn,i.scale=d===void 0?[1,1]:d;const f=t.getOffsetX(),p=t.getOffsetY(),_=t.getRotateWithView(),y=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=f===void 0?0:f,this.textOffsetY_=p===void 0?0:p,this.textRotateWithView_=_===void 0?!1:_,this.textRotation_=y===void 0?0:y,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:ct(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=n?typeof n.fillStyle=="string"?n.fillStyle:"|"+ct(n.fillStyle):""}this.declutterImageWithText_=e}}const rE={Circle:yf,Default:ns,Image:Jw,LineString:$w,Polygon:yf,Text:nE};class sE{constructor(t,e,i,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=i,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const i=this.buildersByZIndex_[e];for(const n in i){const s=i[n].finish();t[e][n]=s}}return t}getBuilder(t,e){const i=t!==void 0?t.toString():"0";let n=this.buildersByZIndex_[i];n===void 0&&(n={},this.buildersByZIndex_[i]=n);let s=n[e];if(s===void 0){const a=rE[e];s=new a(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=s}return s}}const vf=sE;function oE(r,t,e,i,n,s,a,h,c,d,f,p){let _=r[t],y=r[t+1],v=0,w=0,T=0,M=0;function E(){v=_,w=y,t+=i,_=r[t],y=r[t+1],M+=T,T=Math.sqrt((_-v)*(_-v)+(y-w)*(y-w))}do E();while(t<e-i&&M+T<s);let b=T===0?0:(s-M)/T;const C=Ee(v,_,b),P=Ee(w,y,b),R=t-i,D=M,O=s+h*c(d,n,f);for(;t<e-i&&M+T<O;)E();b=T===0?0:(O-M)/T;const G=Ee(v,_,b),X=Ee(w,y,b);let Y;if(p){const H=[C,P,G,X];wu(H,0,4,2,p,H,H),Y=H[0]>H[2]}else Y=C>G;const q=Math.PI,st=[],_t=R+i===t;t=R,T=0,M=D,_=r[t],y=r[t+1];let V;if(_t){E(),V=Math.atan2(y-w,_-v),Y&&(V+=V>0?-q:q);const H=(G+C)/2,j=(X+P)/2;return st[0]=[H,j,(O-s)/2,V,n],st}n=n.replace(/\n/g," ");for(let H=0,j=n.length;H<j;){E();let B=Math.atan2(y-w,_-v);if(Y&&(B+=B>0?-q:q),V!==void 0){let $=B-V;if($+=$>q?-2*q:$<-q?2*q:0,Math.abs($)>a)return null}V=B;const Lt=H;let Z=0;for(;H<j;++H){const $=Y?j-H-1:H,tt=h*c(d,n[$],f);if(t+i<e&&M+T<s+Z+tt/2)break;Z+=tt}if(H===Lt)continue;const ut=Y?n.substring(j-Lt,j-H):n.substring(Lt,H);b=T===0?0:(s+Z/2-M)/T;const z=Ee(v,_,b),xt=Ee(w,y,b);st.push([z,xt,Z/2,B,ut]),s+=Z}return st}const sr=xe(),Hi=[],yi=[],vi=[],Vi=[];function xf(r){return r[3].declutterBox}const wf=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function fh(r,t){return t==="start"?t=wf.test(r)?"right":"left":t==="end"&&(t=wf.test(r)?"left":"right"),Xo[t]}function aE(r,t,e){return e>0&&r.push(`
|
|
462
|
+
`,""),r.push(t,""),r}class lE{constructor(t,e,i,n){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=Ht(),this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}createLabel(t,e,i,n){const s=t+e+i+n;if(this.labels_[s])return this.labels_[s];const a=n?this.strokeStates[n]:null,h=i?this.fillStates[i]:null,c=this.textStates[e],d=this.pixelRatio,f=[c.scale[0]*d,c.scale[1]*d],p=Array.isArray(t),_=c.justify?Xo[c.justify]:fh(Array.isArray(t)?t[0]:t,c.textAlign||Ur),y=n&&a.lineWidth?a.lineWidth:0,v=p?t:t.split(`
|
|
463
|
+
`).reduce(aE,[]),{width:w,height:T,widths:M,heights:E,lineWidths:b}=Ny(c,v),C=w+y,P=[],R=(C+2)*f[0],D=(T+y)*f[1],O={width:R<0?Math.floor(R):Math.ceil(R),height:D<0?Math.floor(D):Math.ceil(D),contextInstructions:P};(f[0]!=1||f[1]!=1)&&P.push("scale",f),n&&(P.push("strokeStyle",a.strokeStyle),P.push("lineWidth",y),P.push("lineCap",a.lineCap),P.push("lineJoin",a.lineJoin),P.push("miterLimit",a.miterLimit),P.push("setLineDash",[a.lineDash]),P.push("lineDashOffset",a.lineDashOffset)),i&&P.push("fillStyle",h.fillStyle),P.push("textBaseline","middle"),P.push("textAlign","center");const G=.5-_;let X=_*C+G*y;const Y=[],q=[];let st=0,_t=0,V=0,H=0,j;for(let B=0,Lt=v.length;B<Lt;B+=2){const Z=v[B];if(Z===`
|
|
464
|
+
`){_t+=st,st=0,X=_*C+G*y,++H;continue}const ut=v[B+1]||c.font;ut!==j&&(n&&Y.push("font",ut),i&&q.push("font",ut),j=ut),st=Math.max(st,E[V]);const z=[Z,X+G*M[V]+_*(M[V]-b[H]),.5*(y+st)+_t];X+=M[V],n&&Y.push("strokeText",z),i&&q.push("fillText",z),++V}return Array.prototype.push.apply(P,Y),Array.prototype.push.apply(P,q),this.labels_[s]=O,O}replayTextBackground_(t,e,i,n,s,a,h){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,s),t.lineTo.apply(t,e),a&&(this.alignFill_=a[2],this.fill_(t)),h&&(this.setStrokeStyle_(t,h),t.stroke())}calculateImageOrLabelDimensions_(t,e,i,n,s,a,h,c,d,f,p,_,y,v,w,T){h*=_[0],c*=_[1];let M=i-h,E=n-c;const b=s+d>t?t-d:s,C=a+f>e?e-f:a,P=v[3]+b*_[0]+v[1],R=v[0]+C*_[1]+v[2],D=M-v[3],O=E-v[0];(w||p!==0)&&(Hi[0]=D,Vi[0]=D,Hi[1]=O,yi[1]=O,yi[0]=D+P,vi[0]=yi[0],vi[1]=O+R,Vi[1]=vi[1]);let G;return p!==0?(G=Ie(Ht(),i,n,1,1,p,-i,-n),Nt(G,Hi),Nt(G,yi),Nt(G,vi),Nt(G,Vi),ki(Math.min(Hi[0],yi[0],vi[0],Vi[0]),Math.min(Hi[1],yi[1],vi[1],Vi[1]),Math.max(Hi[0],yi[0],vi[0],Vi[0]),Math.max(Hi[1],yi[1],vi[1],Vi[1]),sr)):ki(Math.min(D,D+P),Math.min(O,O+R),Math.max(D,D+P),Math.max(O,O+R),sr),y&&(M=Math.round(M),E=Math.round(E)),{drawImageX:M,drawImageY:E,drawImageW:b,drawImageH:C,originX:d,originY:f,declutterBox:{minX:sr[0],minY:sr[1],maxX:sr[2],maxY:sr[3],value:T},canvasTransform:G,scale:_}}replayImageOrLabel_(t,e,i,n,s,a,h){const c=!!(a||h),d=n.declutterBox,f=t.canvas,p=h?h[2]*n.scale[0]/2:0;return d.minX-p<=f.width/e&&d.maxX+p>=0&&d.minY-p<=f.height/e&&d.maxY+p>=0&&(c&&this.replayTextBackground_(t,Hi,yi,vi,Vi,a,h),By(t,n.canvasTransform,s,i,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0}fill_(t){if(this.alignFill_){const e=Nt(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,i,n){const s=this.textStates[e],a=this.createLabel(t,e,n,i),h=this.strokeStates[i],c=this.pixelRatio,d=fh(Array.isArray(t)?t[0]:t,s.textAlign||Ur),f=Xo[s.textBaseline||xo],p=h&&h.lineWidth?h.lineWidth:0,_=a.width/c-2*s.scale[0],y=d*_+2*(.5-d)*p,v=f*a.height/c+2*(.5-f)*p;return{label:a,anchorX:y,anchorY:v}}execute_(t,e,i,n,s,a,h,c){let d;this.pixelCoordinates_&&li(i,this.renderedTransform_)?d=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),d=Ii(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Vm(this.renderedTransform_,i));let f=0;const p=n.length;let _=0,y,v,w,T,M,E,b,C,P,R,D,O,G=0,X=0,Y=null,q=null;const st=this.coordinateCache_,_t=this.viewRotation_,V=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,H={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:_t},j=this.instructions!=n||this.overlaps?0:200;let B,Lt,Z,ut;for(;f<p;){const z=n[f];switch(z[0]){case it.BEGIN_GEOMETRY:B=z[1],ut=z[3],B.getGeometry()?h!==void 0&&!ce(h,ut.getExtent())?f=z[2]+1:++f:f=z[2];break;case it.BEGIN_PATH:G>j&&(this.fill_(t),G=0),X>j&&(t.stroke(),X=0),!G&&!X&&(t.beginPath(),T=NaN,M=NaN),++f;break;case it.CIRCLE:_=z[1];const $=d[_],tt=d[_+1],at=d[_+2],kt=d[_+3],Xt=at-$,Ce=kt-tt,Je=Math.sqrt(Xt*Xt+Ce*Ce);t.moveTo($+Je,tt),t.arc($,tt,Je,0,2*Math.PI,!0),++f;break;case it.CLOSE_PATH:t.closePath(),++f;break;case it.CUSTOM:_=z[1],y=z[2];const Xi=z[3],Me=z[4],Yi=z.length==6?z[5]:void 0;H.geometry=Xi,H.feature=B,f in st||(st[f]=[]);const Qe=st[f];Yi?Yi(d,_,y,2,Qe):(Qe[0]=d[_],Qe[1]=d[_+1],Qe.length=2),Me(Qe,H),++f;break;case it.DRAW_IMAGE:_=z[1],y=z[2],C=z[3],v=z[4],w=z[5];let Ki=z[6];const Fe=z[7],qi=z[8],wi=z[9],or=z[10];let Ei=z[11];const En=z[12];let qt=z[13];const ae=z[14],be=z[15];if(!C&&z.length>=20){P=z[19],R=z[20],D=z[21],O=z[22];const le=this.drawLabelWithPointPlacement_(P,R,D,O);C=le.label,z[3]=C;const en=z[23];v=(le.anchorX-en)*this.pixelRatio,z[4]=v;const pe=z[24];w=(le.anchorY-pe)*this.pixelRatio,z[5]=w,Ki=C.height,z[6]=Ki,qt=C.width,z[13]=qt}let ze;z.length>25&&(ze=z[25]);let $e,ti,Ne;z.length>17?($e=z[16],ti=z[17],Ne=z[18]):($e=yn,ti=!1,Ne=!1),or&&V?Ei+=_t:!or&&!V&&(Ei-=_t);let Ji=0;for(;_<y;_+=2){if(ze&&ze[Ji++]<qt/this.pixelRatio)continue;const le=this.calculateImageOrLabelDimensions_(C.width,C.height,d[_],d[_+1],qt,Ki,v,w,qi,wi,Ei,En,s,$e,ti||Ne,B),en=[t,e,C,le,Fe,ti?Y:null,Ne?q:null];if(c){if(ae==="none")continue;if(ae==="obstacle"){c.insert(le.declutterBox);continue}else{let pe,Be;if(be){const Jt=y-_;if(!be[Jt]){be[Jt]=en;continue}if(pe=be[Jt],delete be[Jt],Be=xf(pe),c.collides(Be))continue}if(c.collides(le.declutterBox))continue;pe&&(c.insert(Be),this.replayImageOrLabel_.apply(this,pe)),c.insert(le.declutterBox)}}this.replayImageOrLabel_.apply(this,en)}++f;break;case it.DRAW_CHARS:const Ln=z[1],Yt=z[2],rs=z[3],Yo=z[4];O=z[5];const ss=z[6],os=z[7],Ko=z[8];D=z[9];const Li=z[10];P=z[11],R=z[12];const qo=[z[13],z[13]],as=this.textStates[R],Qi=as.font,$i=[as.scale[0]*os,as.scale[1]*os];let tn;Qi in this.widths_?tn=this.widths_[Qi]:(tn={},this.widths_[Qi]=tn);const Jo=cf(d,Ln,Yt,2),Qo=Math.abs($i[0])*td(Qi,P,tn);if(Yo||Qo<=Jo){const le=this.textStates[R].textAlign,en=(Jo-Qo)*fh(P,le),pe=oE(d,Ln,Yt,2,P,en,ss,Math.abs($i[0]),td,Qi,tn,V?0:this.viewRotation_);t:if(pe){const Be=[];let Jt,ar,lr,se,_e;if(D)for(Jt=0,ar=pe.length;Jt<ar;++Jt){_e=pe[Jt],lr=_e[4],se=this.createLabel(lr,R,"",D),v=_e[2]+($i[0]<0?-Li:Li),w=rs*se.height+(.5-rs)*2*Li*$i[1]/$i[0]-Ko;const Bt=this.calculateImageOrLabelDimensions_(se.width,se.height,_e[0],_e[1],se.width,se.height,v,w,0,0,_e[3],qo,!1,yn,!1,B);if(c&&c.collides(Bt.declutterBox))break t;Be.push([t,e,se,Bt,1,null,null])}if(O)for(Jt=0,ar=pe.length;Jt<ar;++Jt){_e=pe[Jt],lr=_e[4],se=this.createLabel(lr,R,O,""),v=_e[2],w=rs*se.height-Ko;const Bt=this.calculateImageOrLabelDimensions_(se.width,se.height,_e[0],_e[1],se.width,se.height,v,w,0,0,_e[3],qo,!1,yn,!1,B);if(c&&c.collides(Bt.declutterBox))break t;Be.push([t,e,se,Bt,1,null,null])}c&&c.load(Be.map(xf));for(let Bt=0,K=Be.length;Bt<K;++Bt)this.replayImageOrLabel_.apply(this,Be[Bt])}}++f;break;case it.END_GEOMETRY:if(a!==void 0){B=z[1];const le=a(B,ut);if(le)return le}++f;break;case it.FILL:j?G++:this.fill_(t),++f;break;case it.MOVE_TO_LINE_TO:for(_=z[1],y=z[2],Lt=d[_],Z=d[_+1],E=Lt+.5|0,b=Z+.5|0,(E!==T||b!==M)&&(t.moveTo(Lt,Z),T=E,M=b),_+=2;_<y;_+=2)Lt=d[_],Z=d[_+1],E=Lt+.5|0,b=Z+.5|0,(_==y-2||E!==T||b!==M)&&(t.lineTo(Lt,Z),T=E,M=b);++f;break;case it.SET_FILL_STYLE:Y=z,this.alignFill_=z[2],G&&(this.fill_(t),G=0,X&&(t.stroke(),X=0)),t.fillStyle=z[1],++f;break;case it.SET_STROKE_STYLE:q=z,X&&(t.stroke(),X=0),this.setStrokeStyle_(t,z),++f;break;case it.STROKE:j?X++:t.stroke(),++f;break;default:++f;break}}G&&this.fill_(t),X&&t.stroke()}execute(t,e,i,n,s,a){this.viewRotation_=n,this.execute_(t,e,i,this.instructions,s,void 0,void 0,a)}executeHitDetection(t,e,i,n,s){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,n,s)}}const hE=lE,gh=["Polygon","Circle","LineString","Image","Text","Default"];class cE{constructor(t,e,i,n,s,a){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Ht(),this.createExecutors_(s)}clip(t,e){const i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t){for(const e in t){let i=this.executorsByZIndex_[e];i===void 0&&(i={},this.executorsByZIndex_[e]=i);const n=t[e];for(const s in n){const a=n[s];i[s]=new hE(this.resolution_,this.pixelRatio_,this.overlaps_,a)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const i=this.executorsByZIndex_[e];for(let n=0,s=t.length;n<s;++n)if(t[n]in i)return!0}return!1}forEachFeatureAtCoordinate(t,e,i,n,s,a){n=Math.round(n);const h=n*2+1,c=Ie(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-i,-t[0],-t[1]),d=!this.hitDetectionContext_;d&&(this.hitDetectionContext_=ee(h,h,void 0,{willReadFrequently:!0}));const f=this.hitDetectionContext_;f.canvas.width!==h||f.canvas.height!==h?(f.canvas.width=h,f.canvas.height=h):d||f.clearRect(0,0,h,h);let p;this.renderBuffer_!==void 0&&(p=xe(),Pr(p,t),Xs(p,e*(this.renderBuffer_+n),p));const _=uE(n);let y;function v(P,R){const D=f.getImageData(0,0,h,h).data;for(let O=0,G=_.length;O<G;O++)if(D[_[O]]>0){if(!a||y!=="Image"&&y!=="Text"||a.includes(P)){const X=(_[O]-3)/4,Y=n-X%h,q=n-(X/h|0),st=s(P,R,Y*Y+q*q);if(st)return st}f.clearRect(0,0,h,h);break}}const w=Object.keys(this.executorsByZIndex_).map(Number);w.sort(Pi);let T,M,E,b,C;for(T=w.length-1;T>=0;--T){const P=w[T].toString();for(E=this.executorsByZIndex_[P],M=gh.length-1;M>=0;--M)if(y=gh[M],b=E[y],b!==void 0&&(C=b.executeHitDetection(f,c,i,v,p),C))return C}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const i=e[0],n=e[1],s=e[2],a=e[3],h=[i,n,i,a,s,a,s,n];return Ii(h,0,8,2,t,h),h}isEmpty(){return on(this.executorsByZIndex_)}execute(t,e,i,n,s,a,h){const c=Object.keys(this.executorsByZIndex_).map(Number);c.sort(Pi),this.maxExtent_&&(t.save(),this.clip(t,i)),a=a||gh;let d,f,p,_,y,v;for(h&&c.reverse(),d=0,f=c.length;d<f;++d){const w=c[d].toString();for(y=this.executorsByZIndex_[w],p=0,_=a.length;p<_;++p){const T=a[p];v=y[T],v!==void 0&&v.execute(t,e,i,n,s,h)}}this.maxExtent_&&t.restore()}}const ph={};function uE(r){if(ph[r]!==void 0)return ph[r];const t=r*2+1,e=r*r,i=new Array(e+1);for(let s=0;s<=r;++s)for(let a=0;a<=r;++a){const h=s*s+a*a;if(h>e)break;let c=i[h];c||(c=[],i[h]=c),c.push(((r+s)*t+(r+a))*4+3),s>0&&c.push(((r-s)*t+(r+a))*4+3),a>0&&(c.push(((r+s)*t+(r-a))*4+3),s>0&&c.push(((r-s)*t+(r-a))*4+3))}const n=[];for(let s=0,a=i.length;s<a;++s)i[s]&&n.push(...i[s]);return ph[r]=n,n}const Ef=cE;class dE extends mf{constructor(t,e,i,n,s,a,h){super(),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=n,this.transformRotation_=n?Va(Math.atan2(n[1],n[0]),10):0,this.viewRotation_=s,this.squaredTolerance_=a,this.userTransform_=h,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=Ht()}drawImages_(t,e,i,n){if(!this.image_)return;const s=Ii(t,e,i,n,this.transform_,this.pixelCoordinates_),a=this.context_,h=this.tmpLocalTransform_,c=a.globalAlpha;this.imageOpacity_!=1&&(a.globalAlpha=c*this.imageOpacity_);let d=this.imageRotation_;this.transformRotation_===0&&(d-=this.viewRotation_),this.imageRotateWithView_&&(d+=this.viewRotation_);for(let f=0,p=s.length;f<p;f+=2){const _=s[f]-this.imageAnchorX_,y=s[f+1]-this.imageAnchorY_;if(d!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const v=_+this.imageAnchorX_,w=y+this.imageAnchorY_;Ie(h,v,w,1,1,d,-v,-w),a.save(),a.transform.apply(a,h),a.translate(v,w),a.scale(this.imageScale_[0],this.imageScale_[1]),a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),a.restore()}else a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,_,y,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(a.globalAlpha=c)}drawText_(t,e,i,n){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const s=Ii(t,e,i,n,this.transform_,this.pixelCoordinates_),a=this.context_;let h=this.textRotation_;for(this.transformRotation_===0&&(h-=this.viewRotation_),this.textRotateWithView_&&(h+=this.viewRotation_);e<i;e+=n){const c=s[e]+this.textOffsetX_,d=s[e+1]+this.textOffsetY_;h!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(a.save(),a.translate(c-this.textOffsetX_,d-this.textOffsetY_),a.rotate(h),a.translate(this.textOffsetX_,this.textOffsetY_),a.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&a.strokeText(this.text_,0,0),this.textFillState_&&a.fillText(this.text_,0,0),a.restore()):(this.textStrokeState_&&a.strokeText(this.text_,c,d),this.textFillState_&&a.fillText(this.text_,c,d))}}moveToLineTo_(t,e,i,n,s){const a=this.context_,h=Ii(t,e,i,n,this.transform_,this.pixelCoordinates_);a.moveTo(h[0],h[1]);let c=h.length;s&&(c-=2);for(let d=2;d<c;d+=2)a.lineTo(h[d],h[d+1]);return s&&a.closePath(),i}drawRings_(t,e,i,n){for(let s=0,a=i.length;s<a;++s)e=this.moveToLineTo_(t,e,i[s],n,!0);return e}drawCircle(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ce(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=$m(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],n=e[3]-e[1],s=Math.sqrt(i*i+n*n),a=this.context_;a.beginPath(),a.arc(e[0],e[1],s,0,2*Math.PI),this.fillState_&&a.fill(),this.strokeState_&&a.stroke()}this.text_!==""&&this.drawText_(t.getCenter(),0,2,2)}}setStyle(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())}setTransform(t){this.transform_=t}drawGeometry(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t);break}}drawFeature(t,e){const i=e.getGeometryFunction()(t);i&&(this.setStyle(e),this.drawGeometry(i))}drawGeometryCollection(t){const e=t.getGeometriesArray();for(let i=0,n=e.length;i<n;++i)this.drawGeometry(e[i])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),this.text_!==""&&this.drawText_(e,0,e.length,i)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),this.text_!==""&&this.drawText_(e,0,e.length,i)}drawLineString(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ce(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(this.text_!==""){const e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}}}drawMultiLineString(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getExtent();if(ce(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const i=this.context_,n=t.getFlatCoordinates();let s=0;const a=t.getEnds(),h=t.getStride();i.beginPath();for(let c=0,d=a.length;c<d;++c)s=this.moveToLineTo_(n,s,a[c],h,!1);i.stroke()}if(this.text_!==""){const i=t.getFlatMidpoints();this.drawText_(i,0,i.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ce(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoint();this.drawText_(e,0,2,2)}}}drawMultiPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ce(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_,i=t.getOrientedFlatCoordinates();let n=0;const s=t.getEndss(),a=t.getStride();e.beginPath();for(let h=0,c=s.length;h<c;++h){const d=s[h];n=this.drawRings_(i,n,d,a)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoints();this.drawText_(e,0,e.length,2)}}}setContextFillState_(t){const e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){const e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),li(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset,e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})}setContextTextState_(t){const e=this.context_,i=this.contextTextState_,n=t.textAlign?t.textAlign:Ur;i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=n&&(i.textAlign=n,e.textAlign=n),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(!t)this.fillState_=null;else{const i=t.getColor();this.fillState_={fillStyle:Xe(i||de)}}if(!e)this.strokeState_=null;else{const i=e.getColor(),n=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),h=e.getLineJoin(),c=e.getWidth(),d=e.getMiterLimit(),f=s||ci;this.strokeState_={lineCap:n!==void 0?n:Un,lineDash:this.pixelRatio_===1?f:f.map(p=>p*this.pixelRatio_),lineDashOffset:(a||ui)*this.pixelRatio_,lineJoin:h!==void 0?h:jn,lineWidth:(c!==void 0?c:jr)*this.pixelRatio_,miterLimit:d!==void 0?d:Br,strokeStyle:Xe(i||Gr)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const i=t.getPixelRatio(this.pixelRatio_),n=t.getAnchor(),s=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*i,this.imageAnchorY_=n[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const a=t.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/i,a[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const y=e.getColor();this.textFillState_={fillStyle:Xe(y||de)}}const i=t.getStroke();if(!i)this.textStrokeState_=null;else{const y=i.getColor(),v=i.getLineCap(),w=i.getLineDash(),T=i.getLineDashOffset(),M=i.getLineJoin(),E=i.getWidth(),b=i.getMiterLimit();this.textStrokeState_={lineCap:v!==void 0?v:Un,lineDash:w||ci,lineDashOffset:T||ui,lineJoin:M!==void 0?M:jn,lineWidth:E!==void 0?E:jr,miterLimit:b!==void 0?b:Br,strokeStyle:Xe(y||Gr)}}const n=t.getFont(),s=t.getOffsetX(),a=t.getOffsetY(),h=t.getRotateWithView(),c=t.getRotation(),d=t.getScaleArray(),f=t.getText(),p=t.getTextAlign(),_=t.getTextBaseline();this.textState_={font:n!==void 0?n:Qu,textAlign:p!==void 0?p:Ur,textBaseline:_!==void 0?_:xo},this.text_=f!==void 0?Array.isArray(f)?f.reduce((y,v,w)=>y+=w%2?" ":v,""):f:"",this.textOffsetX_=s!==void 0?this.pixelRatio_*s:0,this.textOffsetY_=a!==void 0?this.pixelRatio_*a:0,this.textRotateWithView_=h!==void 0?h:!1,this.textRotation_=c!==void 0?c:0,this.textScale_=[this.pixelRatio_*d[0],this.pixelRatio_*d[1]]}}}const fE=dE,qe=.5;function gE(r,t,e,i,n,s,a){const h=r[0]*qe,c=r[1]*qe,d=ee(h,c);d.imageSmoothingEnabled=!1;const f=d.canvas,p=new fE(d,qe,n,null,a),_=e.length,y=Math.floor((256*256*256-1)/_),v={};for(let T=1;T<=_;++T){const M=e[T-1],E=M.getStyleFunction()||i;if(!E)continue;let b=E(M,s);if(!b)continue;Array.isArray(b)||(b=[b]);const P=(T*y).toString(16).padStart(7,"#00000");for(let R=0,D=b.length;R<D;++R){const O=b[R],G=O.getGeometryFunction()(M);if(!G||!ce(n,G.getExtent()))continue;const X=O.clone(),Y=X.getFill();Y&&Y.setColor(P);const q=X.getStroke();q&&(q.setColor(P),q.setLineDash(null)),X.setText(void 0);const st=O.getImage();if(st){const j=st.getImageSize();if(!j)continue;const B=ee(j[0],j[1],void 0,{alpha:!1}),Lt=B.canvas;B.fillStyle=P,B.fillRect(0,0,Lt.width,Lt.height),X.setImage(new Ul({img:Lt,anchor:st.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:st.getOrigin(),opacity:1,size:st.getSize(),scale:st.getScale(),rotation:st.getRotation(),rotateWithView:st.getRotateWithView()}))}const _t=X.getZIndex()||0;let V=v[_t];V||(V={},v[_t]=V,V.Polygon=[],V.Circle=[],V.LineString=[],V.Point=[]);const H=G.getType();if(H==="GeometryCollection"){const j=G.getGeometriesArrayRecursive();for(let B=0,Lt=j.length;B<Lt;++B){const Z=j[B];V[Z.getType().replace("Multi","")].push(Z,X)}}else V[H.replace("Multi","")].push(G,X)}}const w=Object.keys(v).map(Number).sort(Pi);for(let T=0,M=w.length;T<M;++T){const E=v[w[T]];for(const b in E){const C=E[b];for(let P=0,R=C.length;P<R;P+=2){p.setStyle(C[P+1]);for(let D=0,O=t.length;D<O;++D)p.setTransform(t[D]),p.drawGeometry(C[P])}}}return d.getImageData(0,0,f.width,f.height)}function pE(r,t,e){const i=[];if(e){const n=Math.floor(Math.round(r[0])*qe),s=Math.floor(Math.round(r[1])*qe),a=(Dt(n,0,e.width-1)+Dt(s,0,e.height-1)*e.width)*4,h=e.data[a],c=e.data[a+1],f=e.data[a+2]+256*(c+256*h),p=Math.floor((256*256*256-1)/t.length);f&&f%p===0&&i.push(t[f/p-1])}return i}const _E=.5,Lf={Point:TE,LineString:EE,Polygon:ME,MultiPoint:CE,MultiLineString:LE,MultiPolygon:bE,GeometryCollection:wE,Circle:vE};function mE(r,t){return parseInt(ct(r),10)-parseInt(ct(t),10)}function yE(r,t){const e=_h(r,t);return e*e}function _h(r,t){return _E*r/t}function vE(r,t,e,i,n){const s=e.getFill(),a=e.getStroke();if(s||a){const c=r.getBuilder(e.getZIndex(),"Circle");c.setFillStrokeStyle(s,a),c.drawCircle(t,i)}const h=e.getText();if(h&&h.getText()){const c=(n||r).getBuilder(e.getZIndex(),"Text");c.setTextStyle(h),c.drawText(t,i)}}function bf(r,t,e,i,n,s,a){let h=!1;const c=e.getImage();if(c){const d=c.getImageState();d==St.LOADED||d==St.ERROR?c.unlistenImageChange(n):(d==St.IDLE&&c.load(),c.listenImageChange(n),h=!0)}return xE(r,t,e,i,s,a),h}function xE(r,t,e,i,n,s){const a=e.getGeometryFunction()(t);if(!a)return;const h=a.simplifyTransformed(i,n);if(e.getRenderer())Tf(r,h,e,t);else{const d=Lf[h.getType()];d(r,h,e,t,s)}}function Tf(r,t,e,i){if(t.getType()=="GeometryCollection"){const s=t.getGeometries();for(let a=0,h=s.length;a<h;++a)Tf(r,s[a],e,i);return}r.getBuilder(e.getZIndex(),"Default").drawCustom(t,i,e.getRenderer(),e.getHitDetectionRenderer())}function wE(r,t,e,i,n){const s=t.getGeometriesArray();let a,h;for(a=0,h=s.length;a<h;++a){const c=Lf[s[a].getType()];c(r,s[a],e,i,n)}}function EE(r,t,e,i,n){const s=e.getStroke();if(s){const h=r.getBuilder(e.getZIndex(),"LineString");h.setFillStrokeStyle(null,s),h.drawLineString(t,i)}const a=e.getText();if(a&&a.getText()){const h=(n||r).getBuilder(e.getZIndex(),"Text");h.setTextStyle(a),h.drawText(t,i)}}function LE(r,t,e,i,n){const s=e.getStroke();if(s){const h=r.getBuilder(e.getZIndex(),"LineString");h.setFillStrokeStyle(null,s),h.drawMultiLineString(t,i)}const a=e.getText();if(a&&a.getText()){const h=(n||r).getBuilder(e.getZIndex(),"Text");h.setTextStyle(a),h.drawText(t,i)}}function bE(r,t,e,i,n){const s=e.getFill(),a=e.getStroke();if(a||s){const c=r.getBuilder(e.getZIndex(),"Polygon");c.setFillStrokeStyle(s,a),c.drawMultiPolygon(t,i)}const h=e.getText();if(h&&h.getText()){const c=(n||r).getBuilder(e.getZIndex(),"Text");c.setTextStyle(h),c.drawText(t,i)}}function TE(r,t,e,i,n){const s=e.getImage(),a=e.getText();let h;if(s){if(s.getImageState()!=St.LOADED)return;let c=r;if(n){const f=s.getDeclutterMode();if(f!=="none")if(c=n,f==="obstacle"){const p=r.getBuilder(e.getZIndex(),"Image");p.setImageStyle(s,h),p.drawPoint(t,i)}else a&&a.getText()&&(h={})}const d=c.getBuilder(e.getZIndex(),"Image");d.setImageStyle(s,h),d.drawPoint(t,i)}if(a&&a.getText()){let c=r;n&&(c=n);const d=c.getBuilder(e.getZIndex(),"Text");d.setTextStyle(a,h),d.drawText(t,i)}}function CE(r,t,e,i,n){const s=e.getImage(),a=e.getText();let h;if(s){if(s.getImageState()!=St.LOADED)return;let c=r;if(n){const f=s.getDeclutterMode();if(f!=="none")if(c=n,f==="obstacle"){const p=r.getBuilder(e.getZIndex(),"Image");p.setImageStyle(s,h),p.drawMultiPoint(t,i)}else a&&a.getText()&&(h={})}const d=c.getBuilder(e.getZIndex(),"Image");d.setImageStyle(s,h),d.drawMultiPoint(t,i)}if(a&&a.getText()){let c=r;n&&(c=n);const d=c.getBuilder(e.getZIndex(),"Text");d.setTextStyle(a,h),d.drawText(t,i)}}function ME(r,t,e,i,n){const s=e.getFill(),a=e.getStroke();if(s||a){const c=r.getBuilder(e.getZIndex(),"Polygon");c.setFillStrokeStyle(s,a),c.drawPolygon(t,i)}const h=e.getText();if(h&&h.getText()){const c=(n||r).getBuilder(e.getZIndex(),"Text");c.setTextStyle(h),c.drawText(t,i)}}class SE extends of{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=xe(),this.wrappedRenderedExtent_=xe(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.declutterExecutorGroup=null,this.clipping=!0,this.compositionContext_=null,this.opacity_=1}renderWorlds(t,e,i){const n=e.extent,s=e.viewState,a=s.center,h=s.resolution,c=s.projection,d=s.rotation,f=c.getExtent(),p=this.getLayer().getSource(),_=e.pixelRatio,y=e.viewHints,v=!(y[Zt.ANIMATING]||y[Zt.INTERACTING]),w=this.compositionContext_,T=Math.round(e.size[0]*_),M=Math.round(e.size[1]*_),E=p.getWrapX()&&c.canWrapX(),b=E?Mt(f):null,C=E?Math.ceil((n[2]-f[2])/b)+1:1;let P=E?Math.floor((n[0]-f[0])/b):0;do{const R=this.getRenderTransform(a,h,d,_,T,M,P*b);t.execute(w,1,R,d,v,void 0,i)}while(++P<C)}setupCompositionContext_(){if(this.opacity_!==1){const t=ee(this.context.canvas.width,this.context.canvas.height,sf);this.compositionContext_=t}else this.compositionContext_=this.context}releaseCompositionContext_(){if(this.opacity_!==1){const t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,mo(this.compositionContext_),sf.push(this.compositionContext_.canvas),this.compositionContext_=null}}renderDeclutter(t){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.releaseCompositionContext_())}renderFrame(t,e){const i=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];Xm(this.pixelTransform,1/i,1/i),no(this.inversePixelTransform,this.pixelTransform);const s=xu(this.pixelTransform);this.useContainer(e,s,this.getBackground(t));const a=this.context,h=a.canvas,c=this.replayGroup_,d=this.declutterExecutorGroup;let f=c&&!c.isEmpty()||d&&!d.isEmpty();if(!f&&!(this.getLayer().hasListener(te.PRERENDER)||this.getLayer().hasListener(te.POSTRENDER)))return null;const p=Math.round(t.size[0]*i),_=Math.round(t.size[1]*i);h.width!=p||h.height!=_?(h.width=p,h.height=_,h.style.transform!==s&&(h.style.transform=s)):this.containerReused||a.clearRect(0,0,p,_),this.preRender(a,t);const y=t.viewState;y.projection,this.opacity_=n.opacity,this.setupCompositionContext_();let v=!1;if(f&&n.extent&&this.clipping){const w=fn(n.extent);f=ce(w,t.extent),v=f&&!hn(w,t.extent),v&&this.clipUnrotated(this.compositionContext_,t,w)}return f&&this.renderWorlds(c,t),v&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(a,t),this.renderedRotation_!==y.rotation&&(this.renderedRotation_=y.rotation,this.hitDetectionImageData_=null),this.container}getFeatures(t){return new Promise(e=>{if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=[this.context.canvas.width,this.context.canvas.height];Nt(this.pixelTransform,i);const n=this.renderedCenter_,s=this.renderedResolution_,a=this.renderedRotation_,h=this.renderedProjection_,c=this.wrappedRenderedExtent_,d=this.getLayer(),f=[],p=i[0]*qe,_=i[1]*qe;f.push(this.getRenderTransform(n,s,a,qe,p,_,0).slice());const y=d.getSource(),v=h.getExtent();if(y.getWrapX()&&h.canWrapX()&&!hn(v,c)){let w=c[0];const T=Mt(v);let M=0,E;for(;w<v[0];)--M,E=T*M,f.push(this.getRenderTransform(n,s,a,qe,p,_,E).slice()),w+=T;for(M=0,w=c[2];w>v[2];)++M,E=T*M,f.push(this.getRenderTransform(n,s,a,qe,p,_,E).slice()),w-=T}this.hitDetectionImageData_=gE(i,f,this.renderedFeatures_,d.getStyleFunction(),c,s,a)}e(pE(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,i,n,s){if(!this.replayGroup_)return;const a=e.viewState.resolution,h=e.viewState.rotation,c=this.getLayer(),d={},f=function(y,v,w){const T=ct(y),M=d[T];if(M){if(M!==!0&&w<M.distanceSq){if(w===0)return d[T]=!0,s.splice(s.lastIndexOf(M),1),n(y,c,v);M.geometry=v,M.distanceSq=w}}else{if(w===0)return d[T]=!0,n(y,c,v);s.push(d[T]={feature:y,layer:c,geometry:v,distanceSq:w,callback:n})}};let p;const _=[this.replayGroup_];return this.declutterExecutorGroup&&_.push(this.declutterExecutorGroup),_.some(y=>p=y.forEachFeatureAtCoordinate(t,a,h,i,f,y===this.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map(v=>v.value):null)),p}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),i=e.getSource();if(!i)return!1;const n=t.viewHints[Zt.ANIMATING],s=t.viewHints[Zt.INTERACTING],a=e.getUpdateWhileAnimating(),h=e.getUpdateWhileInteracting();if(this.ready&&!a&&n||!h&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const c=t.extent,d=t.viewState,f=d.projection,p=d.resolution,_=t.pixelRatio,y=e.getRevision(),v=e.getRenderBuffer();let w=e.getRenderOrder();w===void 0&&(w=mE);const T=d.center.slice(),M=Xs(c,v*p),E=M.slice(),b=[M.slice()],C=f.getExtent();if(i.getWrapX()&&f.canWrapX()&&!hn(C,t.extent)){const V=Mt(C),H=Math.max(Mt(M)/2,V);M[0]=C[0]-H,M[2]=C[2]+H,Qc(T,f);const j=Jc(b[0],f);j[0]<C[0]&&j[2]<C[2]?b.push([j[0]+V,j[1],j[2]+V,j[3]]):j[0]>C[0]&&j[2]>C[2]&&b.push([j[0]-V,j[1],j[2]-V,j[3]])}if(this.ready&&this.renderedResolution_==p&&this.renderedRevision_==y&&this.renderedRenderOrder_==w&&hn(this.wrappedRenderedExtent_,M))return li(this.renderedExtent_,E)||(this.hitDetectionImageData_=null,this.renderedExtent_=E),this.renderedCenter_=T,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const P=new vf(_h(p,_),M,p,_);let R;this.getLayer().getDeclutter()&&(R=new vf(_h(p,_),M,p,_));let D;for(let V=0,H=b.length;V<H;++V)i.loadFeatures(b[V],p,f);const O=yE(p,_);let G=!0;const X=V=>{let H;const j=V.getStyleFunction()||e.getStyleFunction();if(j&&(H=j(V,p)),H){const B=this.renderFeature(V,O,H,P,D,R);G=G&&!B}},Y=lu(M),q=i.getFeaturesInExtent(Y);w&&q.sort(w);for(let V=0,H=q.length;V<H;++V)X(q[V]);this.renderedFeatures_=q,this.ready=G;const st=P.finish(),_t=new Ef(M,p,_,i.getOverlaps(),st,e.getRenderBuffer());return R&&(this.declutterExecutorGroup=new Ef(M,p,_,i.getOverlaps(),R.finish(),e.getRenderBuffer())),this.renderedResolution_=p,this.renderedRevision_=y,this.renderedRenderOrder_=w,this.renderedExtent_=E,this.wrappedRenderedExtent_=M,this.renderedCenter_=T,this.renderedProjection_=f,this.replayGroup_=_t,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,i,n,s,a){if(!i)return!1;let h=!1;if(Array.isArray(i))for(let c=0,d=i.length;c<d;++c)h=bf(n,t,i[c],e,this.boundHandleStyleImageChange_,s,a)||h;else h=bf(n,t,i,e,this.boundHandleStyleImageChange_,s,a);return h}}const PE=SE;class kE extends Hl{constructor(t){super(t)}createRenderer(){return new PE(this)}}const Cf=kE,re={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class RE extends Re{constructor(t){super(),this.on,this.once,this.un,this.options=t,this.id=t.id,this.insertFirst=t.insertFirst!==void 0?t.insertFirst:!0,this.stopEvent=t.stopEvent!==void 0?t.stopEvent:!0,this.element=document.createElement("div"),this.element.className=t.className!==void 0?t.className:"ol-overlay-container "+Ry,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=t.autoPan===!0?{}:t.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(re.ELEMENT,this.handleElementChanged),this.addChangeListener(re.MAP,this.handleMapChanged),this.addChangeListener(re.OFFSET,this.handleOffsetChanged),this.addChangeListener(re.POSITION,this.handlePositionChanged),this.addChangeListener(re.POSITIONING,this.handlePositioningChanged),t.element!==void 0&&this.setElement(t.element),this.setOffset(t.offset!==void 0?t.offset:[0,0]),this.setPositioning(t.positioning||"top-left"),t.position!==void 0&&this.setPosition(t.position)}getElement(){return this.get(re.ELEMENT)}getId(){return this.id}getMap(){return this.get(re.MAP)||null}getOffset(){return this.get(re.OFFSET)}getPosition(){return this.get(re.POSITION)}getPositioning(){return this.get(re.POSITIONING)}handleElementChanged(){Ju(this.element);const t=this.getElement();t&&this.element.appendChild(t)}handleMapChanged(){this.mapPostrenderListenerKey&&(vo(this.element),Ct(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const t=this.getMap();if(t){this.mapPostrenderListenerKey=ft(t,fi.POSTRENDER,this.render,this),this.updatePixelPosition();const e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(t){this.set(re.ELEMENT,t)}setMap(t){this.set(re.MAP,t)}setOffset(t){this.set(re.OFFSET,t)}setPosition(t){this.set(re.POSITION,t)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(t){const e=this.getMap();if(!e||!e.getTargetElement()||!this.get(re.POSITION))return;const i=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),s=this.getRect(n,[Iy(n),Dy(n)]);t=t||{};const a=t.margin===void 0?20:t.margin;if(!hn(i,s)){const h=s[0]-i[0],c=i[2]-s[2],d=s[1]-i[1],f=i[3]-s[3],p=[0,0];if(h<0?p[0]=h-a:c<0&&(p[0]=Math.abs(c)+a),d<0?p[1]=d-a:f<0&&(p[1]=Math.abs(f)+a),p[0]!==0||p[1]!==0){const _=e.getView().getCenterInternal(),y=e.getPixelFromCoordinateInternal(_);if(!y)return;const v=[y[0]+p[0],y[1]+p[1]],w=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(v),duration:w.duration,easing:w.easing})}}}getRect(t,e){const i=t.getBoundingClientRect(),n=i.left+window.pageXOffset,s=i.top+window.pageYOffset;return[n,s,n+e[0],s+e[1]]}setPositioning(t){this.set(re.POSITIONING,t)}setVisible(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)}updatePixelPosition(){const t=this.getMap(),e=this.getPosition();if(!t||!t.isRendered()||!e){this.setVisible(!1);return}const i=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(i,n)}updateRenderedPosition(t,e){const i=this.element.style,n=this.getOffset(),s=this.getPositioning();this.setVisible(!0);const a=Math.round(t[0]+n[0])+"px",h=Math.round(t[1]+n[1])+"px";let c="0%",d="0%";s=="bottom-right"||s=="center-right"||s=="top-right"?c="-100%":(s=="bottom-center"||s=="center-center"||s=="top-center")&&(c="-50%"),s=="bottom-left"||s=="bottom-center"||s=="bottom-right"?d="-100%":(s=="center-left"||s=="center-center"||s=="center-right")&&(d="-50%");const f=`translate(${c}, ${d}) translate(${a}, ${h})`;this.rendered.transform_!=f&&(this.rendered.transform_=f,i.transform=f)}getOptions(){return this.options}}const AE=RE,Mf=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],Sf={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"};class IE extends bo{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target}),this.on,this.once,this.un,this.keys_=t.keys!==void 0?t.keys:!1,this.source_=t.source,this.isInFullscreen_=!1,this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this),this.cssClassName_=t.className!==void 0?t.className:"ol-full-screen",this.documentListeners_=[],this.activeClassName_=t.activeClassName!==void 0?t.activeClassName.split(" "):[this.cssClassName_+"-true"],this.inactiveClassName_=t.inactiveClassName!==void 0?t.inactiveClassName.split(" "):[this.cssClassName_+"-false"];const e=t.label!==void 0?t.label:"⤢";this.labelNode_=typeof e=="string"?document.createTextNode(e):e;const i=t.labelActive!==void 0?t.labelActive:"×";this.labelActiveNode_=typeof i=="string"?document.createTextNode(i):i;const n=t.tipLabel?t.tipLabel:"Toggle full-screen";this.button_=document.createElement("button"),this.button_.title=n,this.button_.setAttribute("type","button"),this.button_.appendChild(this.labelNode_),this.button_.addEventListener(lt.CLICK,this.handleClick_.bind(this),!1),this.setClassName_(this.button_,this.isInFullscreen_),this.element.className=`${this.cssClassName_} ${Nr} ${_o}`,this.element.appendChild(this.button_)}handleClick_(t){t.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){const t=this.getMap();if(!t)return;const e=t.getOwnerDocument();if(Pf(e))if(kf(e))OE(e);else{let i;this.source_?i=typeof this.source_=="string"?e.getElementById(this.source_):this.source_:i=t.getTargetElement(),this.keys_?DE(i):Rf(i)}}handleFullScreenChange_(){const t=this.getMap();if(!t)return;const e=this.isInFullscreen_;this.isInFullscreen_=kf(t.getOwnerDocument()),e!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(yo(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(Sf.ENTERFULLSCREEN)):(yo(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(Sf.LEAVEFULLSCREEN)),t.updateSize())}setClassName_(t,e){e?(t.classList.remove(...this.inactiveClassName_),t.classList.add(...this.activeClassName_)):(t.classList.remove(...this.activeClassName_),t.classList.add(...this.inactiveClassName_))}setMap(t){const e=this.getMap();e&&e.removeChangeListener(Vt.TARGET,this.boundHandleMapTargetChange_),super.setMap(t),this.handleMapTargetChange_(),t&&t.addChangeListener(Vt.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){const t=this.documentListeners_;for(let i=0,n=t.length;i<n;++i)Ct(t[i]);t.length=0;const e=this.getMap();if(e){const i=e.getOwnerDocument();Pf(i)?this.element.classList.remove(Xu):this.element.classList.add(Xu);for(let n=0,s=Mf.length;n<s;++n)t.push(ft(i,Mf[n],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}}function Pf(r){const t=r.body;return!!(t.webkitRequestFullscreen||t.requestFullscreen&&r.fullscreenEnabled)}function kf(r){return!!(r.webkitIsFullScreen||r.fullscreenElement)}function Rf(r){r.requestFullscreen?r.requestFullscreen():r.webkitRequestFullscreen&&r.webkitRequestFullscreen()}function DE(r){r.webkitRequestFullscreen?r.webkitRequestFullscreen():Rf(r)}function OE(r){r.exitFullscreen?r.exitFullscreen():r.webkitExitFullscreen&&r.webkitExitFullscreen()}const FE=IE,zE=U.defineComponent({name:"MapHeat",props:{coords:Object,loadMapa:Object,typeMap:String,abrirCerrarLoader:Function,onClickMarket:Function,configurationMap:{default:()=>({strokeColor:"#f47521",copyright:"© 2021 Desarrollado por UTIC - Ministerio Público",height:"250px",maxZoom:20,iconMarker:{image:Es,color:"#f47521",iconUrl:"/image/gmap01.png",iconSize:[25,41],iconAnchor:[12,41],scale:1,class:"",type:"image"},dragMarker:!0})}},data:()=>({radius:10,blur:20,zoom:5,type:"0",olMap:null,heatLayer:null,pointLayer:null,countryLayer:null,overlay:null,showSetting:!1,cantidad:0}),watch:{radius(r){this.setRadius(r)},blur(r){this.setBlur(r)},coords(r){this.cantidad=r.features.length,this.updateSource(r),this.updatePointSource(r)},loadMapa(r){this.changeCountryLayer(r)},typeMap(r){this.changeTypeMap(r)},type(r){this.changeTypeMap(r)}},methods:{changeTypeMap(r){r==="0"?(this.heatLayer.setVisible(!0),this.pointLayer.setVisible(!1),this.olMap.removeEventListener("click",this.onClickListener)):(this.heatLayer.setVisible(!1),this.pointLayer.setVisible(!0),this.initClick())},initMap(){const r=`<span class='map-copyright-text' >${this.configurationMap.copyright}</span>`,t=new Xn({stroke:new Po({color:this.configurationMap.strokeColor,width:3}),text:new vd({font:"12px Roboto",fill:new So({color:"#000"}),stroke:new Po({color:"#fff",width:1})})});this.countryLayer=new Cf({source:new Zo({url:`${this.loadMapa.data}`,format:new Ho}),style:function(i){const n=t.getText();return n&&n.setText(i.get("name")),t}}),this.heatLayer=new Bx({source:new Zo({features:[]}),visible:!1,radius:10,blur:25});try{this.pointLayer=this.configurationMap?new Cf({source:new Zo({features:[]}),visible:!1,style:i=>{var a,h,c;return new Xn({image:new Ul({src:(h=(a=this.configurationMap)==null?void 0:a.iconMarker)==null?void 0:h.iconUrl,color:(c=this.configurationMap.iconMarker)==null?void 0:c.color,scale:this.configurationMap.iconMarker.scale}),zIndex:1})}}):void 0}catch(i){console.log(i)}this.olMap=new Uv({controls:id({attribution:!1}).extend([new FE({tipLabel:"Pantalla completa"})]).extend([new ed({collapsible:!1})]),layers:[new _w({source:new lw({attributions:r})}),this.countryLayer,this.heatLayer,this.pointLayer],target:this.$refs["map-root"],view:new He({center:[0,0],zoom:this.zoom})});const e=ou([this.loadMapa.lng,this.loadMapa.lat]);this.olMap.getView().adjustCenter(e),this.fitMap()},initClick(){const r=document.getElementById("popup"),t=document.getElementById("popup-closer");this.overlay=new AE({element:r,autoPan:!0}),this.olMap.addOverlay(this.overlay),t.onclick=()=>this.closeOverlay(),this.olMap.addEventListener("click",this.onClickListener)},closeOverlay(){const r=document.getElementById("popup-closer");return this.overlay.setPosition(void 0),r.blur(),!1},async onClickListener(r){const t=document.getElementById("popup-content"),e=document.getElementById("popup-closer");if(this.olMap.hasFeatureAtPixel(r.pixel)===!0){const i=this.olMap.getFeaturesAtPixel(r.pixel)[0];if(i.getGeometry().getType()==="Point"){const s=this.olMap.getFeaturesAtPixel(r.pixel)[0].getProperties(),a=r.coordinate;this.abrirCerrarLoader&&this.abrirCerrarLoader(!0);try{this.abrirCerrarLoader&&this.abrirCerrarLoader(!1);let h="";this.onClickMarket&&(h=await this.onClickMarket(s)),t.innerHTML=h;const c=this.olMap.getView(),d=i.getGeometry().getExtent(),f=c.getCenter(),p=c.getZoom();c.fit(d,{padding:[325,75,0,75],maxZoom:p});const _=c.getCenter();c.setCenter(f),c.animate({center:_})}catch{this.abrirCerrarLoader&&this.abrirCerrarLoader(!1)}this.overlay.setPosition(a)}}else this.overlay.setPosition(void 0),e.blur()},updateSource(r){if(r&&r.features.length===0){this.heatLayer.getSource().clear();return}if(r){const t=this.heatLayer.getSource(),e=new Ho({featureProjection:"EPSG:3857"}).readFeatures(r);t.clear(),t.addFeatures(e)}},updatePointSource(r){if(r&&r.features.length===0){this.pointLayer.getSource().clear();return}if(r){const t=this.pointLayer.getSource(),e=new Ho({featureProjection:"EPSG:3857"}).readFeatures(r);t.clear(),t.addFeatures(e)}},async changeCountryLayer(r){if(this.countryLayer){const e=new Zo({url:`${r.data}`,format:new Ho});await this.countryLayer.setSource(e)}},fitMap(){this.countryLayer.addEventListener("change",this.countryFunction)},countryFunction(r){const t=this.olMap.getView();if(r.target.getSource().getFeatures()[0]){const i=r.target.getSource().getExtent(),n=t.getZoom(),s=t.getCenter();t.fit(i,{padding:[75,75,75,75],maxZoom:6});const a=t.getZoom(),h=t.getCenter();t.setCenter(s),t.setZoom(n),t.animate({center:h}),t.animate({zoom:a})}},setRadius(r){this.heatLayer.setRadius(parseInt(r,10))},setBlur(r){this.heatLayer.setBlur(parseInt(r,10))},irACiudad(){if(this.loadMapa&&this.loadMapa.country!=="Bolivia"){const r=this.olMap.getView(),t=r.getZoom(),e=r.getCenter();r.setCenter(ou([this.loadMapa.lng,this.loadMapa.lat]));const i=13,n=r.getCenter();r.setCenter(e),r.setZoom(t),r.animate({center:n}),r.animate({zoom:i})}},toggleSettings(){this.showSetting=!this.showSetting}},mounted(){this.countryLayer=this.loadMapa,this.initMap()},beforeDestroy(){this.countryLayer.removeEventListener("change",this.countryFunction),this.olMap.removeEventListener("click",this.onClickListener)}}),Eb="",Lb="",xi=r=>(U.pushScopeId("data-v-5030ee80"),r=r(),U.popScopeId(),r),NE={ref:"map-root",style:{width:"100%",height:"100%",position:"relative"}},BE={class:"btn-zoom-container ol-control"},GE=[xi(()=>U.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[U.createElementVNode("path",{d:"M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224v114.8l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288h114.8l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z"})],-1))],UE={class:"type-map-container ol-control"},jE=[xi(()=>U.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},[U.createElementVNode("path",{d:"M215.7 499.2C267 435 384 279.4 384 192 384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2 12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"})],-1))],ZE=[xi(()=>U.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},[U.createElementVNode("path",{d:"m153.6 29.9 16-21.3c4-5.4 10.4-8.6 17.1-8.6C198.4 0 208 9.6 208 21.3v22.2c0 13.1 5.4 25.7 14.9 34.7l84.7 80.8c48.8 46.6 76.4 111.2 76.4 178.7C384 434 306 512 209.7 512H192C86 512 0 426 0 320v-3.8c0-48.8 19.4-95.6 53.9-130.1l3.5-3.5c4.2-4.2 10-6.6 16-6.6 12.5 0 22.6 10.1 22.6 22.6V288c0 35.3 28.7 64 64 64s64-28.7 64-64v-3.9c0-18-7.2-35.3-19.9-48l-38.6-38.6c-24-24-37.5-56.7-37.5-90.7 0-27.7 9-54.8 25.6-76.9z"})],-1))],WE={class:"btn-settings ol-control"},HE=[xi(()=>U.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[U.createElementVNode("path",{d:"M495.9 166.6c3.2 8.7.5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4l-55.6 17.8c-8.8 2.8-18.6.3-24.5-6.8-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4c-1.1-8.4-1.7-16.9-1.7-25.5s.6-17.1 1.7-25.4l-43.3-39.4c-6.9-6.2-9.6-15.9-6.4-24.6 4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2 5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8 8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"})],-1))],VE={class:"control-container"},XE={class:"map-flex"},YE=xi(()=>U.createElementVNode("label",null,"Tamaño del radio",-1)),KE={class:"map-flex"},qE=xi(()=>U.createElementVNode("label",null,"Difuminado",-1)),JE={class:"cant-casos ol-attribution ol-unselectable ol-control ol-uncollapsible"},QE={class:"text-cantidad"},$E=xi(()=>U.createElementVNode("span",{class:"ol-bold"},"Casos: ",-1)),tL={id:"popup",class:"ol-popup"},eL=[xi(()=>U.createElementVNode("a",{id:"popup-closer",class:"ol-popup-closer"},null,-1)),xi(()=>U.createElementVNode("div",{id:"popup-content"},null,-1))];function iL(r,t,e,i,n,s){var a;return U.openBlock(),U.createElementBlock("div",{class:"map-container",style:U.normalizeStyle(`height:${(a=r.configurationMap)==null?void 0:a.height}`)},[U.createElementVNode("div",NE,[U.withDirectives(U.createElementVNode("div",BE,[U.createElementVNode("button",{title:"Ir a la ciudad",class:"jl2-button-map",onClick:t[0]||(t[0]=(...h)=>r.irACiudad&&r.irACiudad(...h))},GE)],512),[[U.vShow,r.loadMapa.country!=="Bolivia"]]),U.createElementVNode("div",UE,[U.createElementVNode("button",{title:"Mapa con Marcador",class:U.normalizeClass(["jl2-button-map",{"jl2-button-map-select":r.type=="1"}]),onClick:t[1]||(t[1]=()=>r.type="1")},jE,2),U.createElementVNode("button",{title:"Mapa de Calor",class:U.normalizeClass(["jl2-button-map",{"jl2-button-map-select":r.type=="0"}]),onClick:t[2]||(t[2]=()=>r.type="0")},ZE,2)]),U.withDirectives(U.createElementVNode("div",WE,[U.createElementVNode("button",{title:"Ver Opciones",class:"jl2-button-map",onClick:t[3]||(t[3]=(...h)=>r.toggleSettings&&r.toggleSettings(...h))},HE)],512),[[U.vShow,!r.showSetting&&r.type==="0"]]),U.withDirectives(U.createElementVNode("div",VE,[U.createElementVNode("a",{onClick:t[4]||(t[4]=(...h)=>r.toggleSettings&&r.toggleSettings(...h)),class:"ol-popup-closer"}),U.createElementVNode("div",XE,[YE,U.withDirectives(U.createElementVNode("input",{id:"radius",type:"range",min:"1",max:"50",step:"1","onUpdate:modelValue":t[5]||(t[5]=h=>r.radius=h)},null,512),[[U.vModelText,r.radius]])]),U.createElementVNode("div",KE,[qE,U.withDirectives(U.createElementVNode("input",{id:"blur",type:"range",min:"1",max:"50",step:"1","onUpdate:modelValue":t[6]||(t[6]=h=>r.blur=h)},null,512),[[U.vModelText,r.blur]])])],512),[[U.vShow,r.type==="0"&&r.showSetting]]),U.createElementVNode("div",JE,[U.createElementVNode("p",QE,[$E,U.createTextVNode(U.toDisplayString(r.cantidad),1)])])],512),U.withDirectives(U.createElementVNode("div",tL,eL,512),[[U.vShow,r.type==="1"]])],4)}const nL=La(zE,[["render",iL],["__scopeId","data-v-5030ee80"]]);ye.CoordinatesVerifyPolygon=hp,ye.MapHeatComponent=nL,ye.MapSearchAddress=Q_,ye.MapView=q_,ye.listenServiceGoogleMaps=Dg,ye.searchAutomaticGoogleMaps=Fg,ye.searchManualGoogleMaps=Og,Object.defineProperty(ye,Symbol.toStringTag,{value:"Module"})});
|