@nextgis/ngw-leaflet 4.0.0-rc.0 → 4.0.0-rc.1

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.
@@ -1,6 +1,6 @@
1
- var NgwLeaflet=function(){"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,s=(e,i,o)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[i]=o;const a=new WeakMap;function l(t={}){var a,l,c;return l=((t,e)=>{for(var i in e||(e={}))n.call(e,i)&&s(t,i,e[i]);if(o)for(var i of o(e))r.call(e,i)&&s(t,i,e[i]);return t})({},t),c={margin:null!=(a=t.margin)?a:t.bar},e(l,i(c))}function c(t,e={}){a.set(t,l(e))}function h(t){return t?a.get(t):void 0}function u(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}u('.webmap-ctrl-bottom-left,.webmap-ctrl-bottom-right,.webmap-ctrl-left,.webmap-ctrl-right,.webmap-ctrl-top-left,.webmap-ctrl-top-right{position:absolute;pointer-events:none;z-index:9999}.webmap-ctrl-left,.webmap-ctrl-right{height:100%}.webmap-ctrl-left{padding-right:0}.webmap-ctrl-right{padding-left:0}.webmap-ctrl-top-left{top:0;left:0}.webmap-ctrl-top-right{top:0;right:0}.webmap-ctrl-bottom-left{bottom:0;left:0}.webmap-ctrl-bottom-right{right:0;bottom:0}.webmap-ctrl,.webmap-ctrl-wrapper{clear:both;pointer-events:auto;transform:translate(0)}.webmap-ctrl-top-left>.webmap-ctrl,.webmap-ctrl-top-left>.webmap-ctrl-wrapper{float:left}.webmap-ctrl-top-right>.webmap-ctrl,.webmap-ctrl-top-right>.webmap-ctrl-wrapper{float:right}.webmap-ctrl-bottom-left>.webmap-ctrl,.webmap-ctrl-bottom-left>.webmap-ctrl-wrapper{float:left}.webmap-ctrl-bottom-right>.webmap-ctrl,.webmap-ctrl-bottom-right>.webmap-ctrl-wrapper{float:right}.webmap-ctrl-top-left>.webmap-ctrl-margin{margin:10px 0 0 10px}.webmap-ctrl-top-right>.webmap-ctrl-margin{margin:10px 10px 0 0}.webmap-ctrl-bottom-left>.webmap-ctrl-margin{margin:0 0 10px 10px}.webmap-ctrl-bottom-right>.webmap-ctrl-margin{margin:0 10px 10px 0}.webmap-ctrl-group{border-radius:4px;background:#fff}.webmap-ctrl .webmap-ctrl-wrapper{clear:none;float:none;margin:0}.webmap-ctrl .webmap-ctrl-wrapper>.webmap-ctrl,.webmap-ctrl>.webmap-ctrl{clear:none;float:none;margin:0!important}.webmap-ctrl-horizontal,.webmap-ctrl-vertical{display:flex}.webmap-ctrl-vertical{flex-direction:column;align-items:var(--webmap-ctrl-align,flex-start)}.webmap-ctrl-horizontal{flex-direction:row;align-items:var(--webmap-ctrl-align,stretch)}.webmap-ctrl:not(.webmap-ctrl-group).webmap-ctrl-horizontal,.webmap-ctrl:not(.webmap-ctrl-group).webmap-ctrl-vertical{gap:var(--webmap-ctrl-gap,0)}.webmap-ctrl-gapless:not(.webmap-ctrl-group){border:2px solid rgba(0,0,0,.1);border-radius:4px;box-sizing:border-box;background:#fff;overflow:hidden}.webmap-ctrl-gapless:not(.webmap-ctrl-group):not(:empty){box-shadow:none}.webmap-ctrl-gapless>.webmap-ctrl-group,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.webmap-ctrl-group{border-radius:0;border:0!important;box-shadow:none!important}.webmap-ctrl-gapless>.leaflet-bar,.webmap-ctrl-gapless>.maplibregl-ctrl-group,.webmap-ctrl-gapless>.ol-control,.webmap-ctrl-gapless>.webmap-ctrl,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.leaflet-bar,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.maplibregl-ctrl-group,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.ol-control,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.webmap-ctrl{border:0!important;box-shadow:none!important}.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-group:first-child,.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-wrapper:first-child>.webmap-ctrl-group{border-radius:4px 0 0 4px}.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-group:last-child,.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-wrapper:last-child>.webmap-ctrl-group{border-radius:0 4px 4px 0}.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-group:first-child,.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-wrapper:first-child>.webmap-ctrl-group{border-radius:4px 4px 0 0}.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-group:last-child,.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-wrapper:last-child>.webmap-ctrl-group{border-radius:0 0 4px 4px}.webmap-ctrl-gapless>.webmap-ctrl-group:only-child,.webmap-ctrl-gapless>.webmap-ctrl-wrapper:only-child>.webmap-ctrl-group{border-radius:4px}.webmap-ctrl-horizontal>.webmap-ctrl-wrapper,.webmap-ctrl-vertical>.webmap-ctrl-wrapper{display:flex}.webmap-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.webmap-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}.webmap-ctrl-gapless:not(.webmap-ctrl-group){border-color:ButtonText}}.webmap-ctrl-gapless>.webmap-ctrl-group:not(:empty),.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.webmap-ctrl-group:not(:empty){border:0!important;box-shadow:none!important}.webmap-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.webmap-ctrl-button{line-height:inherit!important;font-weight:400!important}.webmap-ctrl-group button+button{border-top:1px solid #ddd}.webmap-ctrl-group.webmap-ctrl-horizontal>button+button{border-top:0;border-left:1px solid #ddd}.webmap-ctrl-gapless .webmap-ctrl-group button+button,.webmap-ctrl-group.webmap-ctrl-gapless button+button{border-top:0!important;border-left:0!important}.webmap-ctrl-gapless .webmap-ctrl-group button{border:0!important;border-radius:0!important;box-shadow:none!important}.webmap-ctrl button .webmap-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.webmap-ctrl-icon{background-color:transparent}.webmap-ctrl-group button+button{border-top:1px solid ButtonText}}.webmap-ctrl button::-moz-focus-inner{border:0;padding:0}.webmap-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.webmap-ctrl button:disabled{cursor:not-allowed}.webmap-ctrl button:disabled .webmap-ctrl-icon{opacity:.25}.webmap-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.webmap-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.webmap-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.webmap-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.webmap-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.webmap-ctrl-group button:focus:only-child{border-radius:inherit}.webmap-ctrl button.webmap-ctrl-zoom-out .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.webmap-ctrl button.webmap-ctrl-zoom-in .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}@media (-ms-high-contrast:active){.webmap-ctrl button.webmap-ctrl-zoom-out .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.webmap-ctrl button.webmap-ctrl-zoom-in .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}}@media (-ms-high-contrast:black-on-white){.webmap-ctrl button.webmap-ctrl-zoom-out .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.webmap-ctrl button.webmap-ctrl-zoom-in .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}}');var p=Object.defineProperty,d=(t,e,i)=>((t,e,i)=>e in t?p(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class f{constructor(t={}){d(this,"classPrefix","webmap"),d(this,"addClass"),d(this,"map"),d(this,"wrapperClass"),d(this,"ownsContainer"),d(this,"_container"),d(this,"_positionsContainers"),d(this,"_targets",new Set),d(this,"_idContainers",new Map),d(this,"_pendingChildren",new Map),d(this,"_orders",new WeakMap),d(this,"_targetOptions",new WeakMap),d(this,"_switchGroups",new WeakMap),d(this,"_switchBindings",new WeakMap),this.classPrefix=t.classPrefix||this.classPrefix,this.addClass=t.addClass,this.map=t.map,this.wrapperClass=t.wrapperClass;const e=["top-right","top-left","bottom-right","bottom-left"].some(e=>{var i;return!!(null==(i=t.positionContainers)?void 0:i[e])})?t.positionContainers:void 0;this.ownsContainer=!t.container&&!e;const{element:i,positionsContainers:o}=this.createContainerElement(t.container,e);this._container=i,this._positionsContainers=o}addTo(t){if(!this.ownsContainer)return this;const e=function(t){if("string"==typeof t){let i=document.getElementById(t);if(!i)try{i=document.querySelector(t)}catch(e){}return i||void 0}return t}(t);return e&&e.appendChild(this._container),this}detach(){if(!this.ownsContainer)return Array.from(this._targets).forEach(t=>this.removeTarget(t)),void this._pendingChildren.clear();const t=this._container.parentElement;t&&t.removeChild(this._container)}getContainer(){return this._container}getPositionContainer(t){return this._positionsContainers[t]}newPositionContainer(t,e=0,i){var o;const n=document.createElement("div");return n.className=`${this.classPrefix}-ctrl-wrapper`+(this.wrapperClass?" "+this.wrapperClass:""),(null==(o=h(i))?void 0:o.margin)&&n.classList.add(`${this.classPrefix}-ctrl-margin`),this.append(n,t,e,i),n}addControl(t,e,i={}){const o=t.onAdd(this.map);if(o instanceof HTMLElement){const n=this.newPositionContainer(e,i.order,t);if(n)return n.appendChild(o),i.id&&this.registerIDContainer(i.id,o,t),n}}append(t,e,i=0,o){const n=this._normalizeElement(t);if(!n)return;const r=this._resolveTargetContainer(e);if(r)return this._insertSorted(r,n,i),this._registerSwitchControl(n,o,r),r;"string"!=typeof e&&this._appendPending(e.inside,n,i,o)}registerIDContainer(t,e,i){this._idContainers.set(t,e),this._registerTargetOptions(e,i),this._flushPending(t,e)}unregisterIDContainer(t){const e=this._idContainers.get(t);e&&this._targetOptions.delete(e),this._idContainers.delete(t),this._pendingChildren.delete(t)}removeTarget(t){const e=t.parentElement;e&&e.removeChild(t),this._unregisterSwitchControl(t),this._removePending(t),this._targets.delete(t)}createContainerElement(t,e){const i=t||document.createElement("div");t||(i.className=`${this.classPrefix}-control-container`+(this.addClass?" "+this.addClass:""));const o={};return["top-right","top-left","bottom-right","bottom-left"].forEach(t=>{const n=(null==e?void 0:e[t])||this._createPositionContainer(t);o[t]=n,(null==e?void 0:e[t])||i.appendChild(n)}),{element:i,positionsContainers:o}}_createPositionContainer(t){const e=document.createElement("div");return e.className=`${this.classPrefix}-ctrl-${t}`,e}_resolveTargetContainer(t){return"string"==typeof t?this._positionsContainers[t]:this._idContainers.get(t.inside)}_normalizeElement(t){if("string"!=typeof t)return t;const e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstElementChild}_insertSorted(t,e,i){this._orders.set(e,i),e.style.order=String(i);const o=this._isBottomPositionContainer(t),n=Array.from(t.children).find(t=>{var n;if(t===e)return!1;const r=null!=(n=this._orders.get(t))?n:Number.POSITIVE_INFINITY;return o?r<=i:r>i});if(n)t.insertBefore(e,n);else{if(e.parentElement===t)return;t.appendChild(e)}this._targets.add(e)}_isBottomPositionContainer(t){return t===this._positionsContainers["bottom-left"]||t===this._positionsContainers["bottom-right"]}_appendPending(t,e,i,o){const n=e.parentElement;n&&n.removeChild(e);const r=this._pendingChildren.get(t)||[];r.push({element:e,order:i,control:o}),r.sort((t,e)=>t.order-e.order),this._pendingChildren.set(t,r),this._targets.add(e)}_flushPending(t,e){const i=this._pendingChildren.get(t);if(i){for(const{element:t,order:o,control:n}of i)this._insertSorted(e,t,o),this._registerSwitchControl(t,n,e);this._pendingChildren.delete(t)}}_removePending(t){this._pendingChildren.forEach((e,i)=>{const o=e.filter(({element:e})=>e!==t);o.length?this._pendingChildren.set(i,o):this._pendingChildren.delete(i)})}_registerSwitchControl(t,e,i){if(!this._isSwitchToggleControl(e))return;this._unregisterSwitchControl(t);const o=this._getSwitchGroup(i,"string"==typeof e.switch?e.switch:"default"),n=Object.prototype.hasOwnProperty.call(e,"disableOnSecondClick"),r=e.disableOnSecondClick,s=void 0===e.disableOnSecondClick?this._getTargetDisableOnSecondClick(i):void 0;void 0!==s&&(e.disableOnSecondClick=s),o.add(e);const a=e.onStatusChange(t=>{t&&this._disableSwitchSiblings(e,o)});this._switchBindings.set(t,{control:e,group:o,unsubscribe:a,hadDisableOnSecondClick:n,previousDisableOnSecondClick:r}),e.getStatus()&&this._disableSwitchSiblings(e,o)}_unregisterSwitchControl(t){const e=this._switchBindings.get(t);e&&(e.unsubscribe(),e.group.delete(e.control),e.hadDisableOnSecondClick?e.control.disableOnSecondClick=e.previousDisableOnSecondClick:delete e.control.disableOnSecondClick,this._switchBindings.delete(t)),Array.from(t.children).forEach(t=>{t instanceof HTMLElement&&this._unregisterSwitchControl(t)})}_getSwitchGroup(t,e){let i=this._switchGroups.get(t);i||(i=new Map,this._switchGroups.set(t,i));let o=i.get(e);return o||(o=new Set,i.set(e,o)),o}_disableSwitchSiblings(t,e){e.forEach(e=>{e!==t&&e.getStatus()&&e.onClick(!1)})}_getTargetDisableOnSecondClick(t){var e;return null==(e=this._targetOptions.get(t))?void 0:e.disableOnSecondClick}_isSwitchToggleControl(t){return!(!(null==t?void 0:t.switch)||"function"!=typeof t.onStatusChange||"function"!=typeof t.getStatus||"function"!=typeof t.onClick)}_registerTargetOptions(t,e){const i=h(e)||h(t);i?this._targetOptions.set(t,i):this._targetOptions.delete(t)}}const m=["wheel","click","mouseup","touchend","dblclick","pointerup","mousedown","touchstart","pointerdown"];function g(t,e){e&&e.split(" ").filter(Boolean).forEach(e=>t.classList.add(e))}function y(t){t.stopPropagation()}function _(t={}){const e=l(t),i=document.createElement("div");i.className="webmap-ctrl",e.bar&&i.classList.add("webmap-ctrl-group"),e.margin&&i.classList.add("webmap-ctrl-margin");const o=e.orientation||e.direction;if(o&&i.classList.add(`webmap-ctrl-${o}`),void 0!==e.gap){i.style.setProperty("--webmap-ctrl-gap","number"==typeof e.gap?`${e.gap}px`:e.gap),function(t){return"number"==typeof t?0===t:"string"==typeof t&&t.trim().split(/\s+/).every(t=>/^0(?:\.0+)?(?:[a-z%]+)?$/i.test(t))}(e.gap)&&i.classList.add("webmap-ctrl-gapless")}const n=function(t){return"start"===t?"flex-start":"end"===t?"flex-end":t}(e.align);return n&&i.style.setProperty("--webmap-ctrl-align",n),g(i,e.addClass),function(t){m.forEach(e=>{t.addEventListener(e,y)})}(i),i}function v(t,e){e instanceof HTMLElement?t.appendChild(e):"string"==typeof e&&(t.innerHTML=e)}function b(t){let e;const i=e=>{e.preventDefault(),e.stopPropagation(),t.onClick()},o={onAdd:()=>(e=document.createElement("button"),e.type="button",e.className="webmap-ctrl-button",g(e,t.addClass),t.title&&(e.title=t.title,e.setAttribute("aria-label",t.title)),v(e,t.html),e.addEventListener("click",i),e),onRemove(){var t;e&&(e.removeEventListener("click",i),(null==(t=e)?void 0:t.parentNode)&&t.parentNode.removeChild(t),e=void 0)},getContainer:()=>e,remove:()=>{o.onRemove()}};return o}var w,x={exports:{}};
1
+ var NgwLeaflet=function(){"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,s=(e,i,o)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[i]=o;const a=new WeakMap;function l(t={}){var a,l,c;return l=((t,e)=>{for(var i in e||(e={}))r.call(e,i)&&s(t,i,e[i]);if(o)for(var i of o(e))n.call(e,i)&&s(t,i,e[i]);return t})({},t),c={margin:null!=(a=t.margin)?a:t.bar},e(l,i(c))}function c(t,e={}){a.set(t,l(e))}function h(t){return t?a.get(t):void 0}function u(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}u('.webmap-ctrl-bottom-left,.webmap-ctrl-bottom-right,.webmap-ctrl-left,.webmap-ctrl-right,.webmap-ctrl-top-left,.webmap-ctrl-top-right{position:absolute;pointer-events:none;z-index:9999}.webmap-ctrl-left,.webmap-ctrl-right{height:100%}.webmap-ctrl-left{padding-right:0}.webmap-ctrl-right{padding-left:0}.webmap-ctrl-top-left{top:0;left:0}.webmap-ctrl-top-right{top:0;right:0}.webmap-ctrl-bottom-left{bottom:0;left:0}.webmap-ctrl-bottom-right{right:0;bottom:0}.webmap-ctrl,.webmap-ctrl-wrapper{clear:both;pointer-events:auto;transform:translate(0)}.webmap-ctrl-top-left>.webmap-ctrl,.webmap-ctrl-top-left>.webmap-ctrl-wrapper{float:left}.webmap-ctrl-top-right>.webmap-ctrl,.webmap-ctrl-top-right>.webmap-ctrl-wrapper{float:right}.webmap-ctrl-bottom-left>.webmap-ctrl,.webmap-ctrl-bottom-left>.webmap-ctrl-wrapper{float:left}.webmap-ctrl-bottom-right>.webmap-ctrl,.webmap-ctrl-bottom-right>.webmap-ctrl-wrapper{float:right}.webmap-ctrl-top-left>.webmap-ctrl-margin{margin:10px 0 0 10px}.webmap-ctrl-top-right>.webmap-ctrl-margin{margin:10px 10px 0 0}.webmap-ctrl-bottom-left>.webmap-ctrl-margin{margin:0 0 10px 10px}.webmap-ctrl-bottom-right>.webmap-ctrl-margin{margin:0 10px 10px 0}.webmap-ctrl-group{border-radius:4px;background:#fff}.webmap-ctrl .webmap-ctrl-wrapper{clear:none;float:none;margin:0}.webmap-ctrl .webmap-ctrl-wrapper>.webmap-ctrl,.webmap-ctrl>.webmap-ctrl{clear:none;float:none;margin:0!important}.webmap-ctrl-horizontal,.webmap-ctrl-vertical{display:flex}.webmap-ctrl-vertical{flex-direction:column;align-items:var(--webmap-ctrl-align,flex-start)}.webmap-ctrl-horizontal{flex-direction:row;align-items:var(--webmap-ctrl-align,stretch)}.webmap-ctrl:not(.webmap-ctrl-group).webmap-ctrl-horizontal,.webmap-ctrl:not(.webmap-ctrl-group).webmap-ctrl-vertical{gap:var(--webmap-ctrl-gap,0)}.webmap-ctrl-gapless:not(.webmap-ctrl-group){border:2px solid rgba(0,0,0,.1);border-radius:4px;box-sizing:border-box;background:#fff;overflow:hidden}.webmap-ctrl-gapless:not(.webmap-ctrl-group):not(:empty){box-shadow:none}.webmap-ctrl-gapless>.webmap-ctrl-group,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.webmap-ctrl-group{border-radius:0;border:0!important;box-shadow:none!important}.webmap-ctrl-gapless>.leaflet-bar,.webmap-ctrl-gapless>.maplibregl-ctrl-group,.webmap-ctrl-gapless>.ol-control,.webmap-ctrl-gapless>.webmap-ctrl,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.leaflet-bar,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.maplibregl-ctrl-group,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.ol-control,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.webmap-ctrl{border:0!important;box-shadow:none!important}.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-group:first-child,.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-wrapper:first-child>.webmap-ctrl-group{border-radius:4px 0 0 4px}.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-group:last-child,.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-wrapper:last-child>.webmap-ctrl-group{border-radius:0 4px 4px 0}.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-group:first-child,.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-wrapper:first-child>.webmap-ctrl-group{border-radius:4px 4px 0 0}.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-group:last-child,.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-wrapper:last-child>.webmap-ctrl-group{border-radius:0 0 4px 4px}.webmap-ctrl-gapless>.webmap-ctrl-group:only-child,.webmap-ctrl-gapless>.webmap-ctrl-wrapper:only-child>.webmap-ctrl-group{border-radius:4px}.webmap-ctrl-horizontal>.webmap-ctrl-wrapper,.webmap-ctrl-vertical>.webmap-ctrl-wrapper{display:flex}.webmap-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.webmap-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}.webmap-ctrl-gapless:not(.webmap-ctrl-group){border-color:ButtonText}}.webmap-ctrl-gapless>.webmap-ctrl-group:not(:empty),.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.webmap-ctrl-group:not(:empty){border:0!important;box-shadow:none!important}.webmap-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.webmap-ctrl-button{line-height:inherit!important;font-weight:400!important}.webmap-ctrl-group button+button{border-top:1px solid #ddd}.webmap-ctrl-group.webmap-ctrl-horizontal>button+button{border-top:0;border-left:1px solid #ddd}.webmap-ctrl-gapless .webmap-ctrl-group button+button,.webmap-ctrl-group.webmap-ctrl-gapless button+button{border-top:0!important;border-left:0!important}.webmap-ctrl-gapless .webmap-ctrl-group button{border:0!important;border-radius:0!important;box-shadow:none!important}.webmap-ctrl button .webmap-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.webmap-ctrl-icon{background-color:transparent}.webmap-ctrl-group button+button{border-top:1px solid ButtonText}}.webmap-ctrl button::-moz-focus-inner{border:0;padding:0}.webmap-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.webmap-ctrl button:disabled{cursor:not-allowed}.webmap-ctrl button:disabled .webmap-ctrl-icon{opacity:.25}.webmap-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.webmap-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.webmap-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.webmap-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.webmap-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.webmap-ctrl-group button:focus:only-child{border-radius:inherit}.webmap-ctrl button.webmap-ctrl-zoom-out .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.webmap-ctrl button.webmap-ctrl-zoom-in .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}@media (-ms-high-contrast:active){.webmap-ctrl button.webmap-ctrl-zoom-out .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.webmap-ctrl button.webmap-ctrl-zoom-in .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}}@media (-ms-high-contrast:black-on-white){.webmap-ctrl button.webmap-ctrl-zoom-out .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.webmap-ctrl button.webmap-ctrl-zoom-in .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}}');var p=Object.defineProperty,d=(t,e,i)=>((t,e,i)=>e in t?p(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class f{constructor(t={}){d(this,"classPrefix","webmap"),d(this,"addClass"),d(this,"map"),d(this,"wrapperClass"),d(this,"ownsContainer"),d(this,"_container"),d(this,"_positionsContainers"),d(this,"_targets",new Set),d(this,"_idContainers",new Map),d(this,"_pendingChildren",new Map),d(this,"_orders",new WeakMap),d(this,"_targetOptions",new WeakMap),d(this,"_switchGroups",new WeakMap),d(this,"_switchBindings",new WeakMap),this.classPrefix=t.classPrefix||this.classPrefix,this.addClass=t.addClass,this.map=t.map,this.wrapperClass=t.wrapperClass;const e=["top-right","top-left","bottom-right","bottom-left"].some(e=>{var i;return!!(null==(i=t.positionContainers)?void 0:i[e])})?t.positionContainers:void 0;this.ownsContainer=!t.container&&!e;const{element:i,positionsContainers:o}=this.createContainerElement(t.container,e);this._container=i,this._positionsContainers=o}addTo(t){if(!this.ownsContainer)return this;const e=function(t){if("string"==typeof t){let i=document.getElementById(t);if(!i)try{i=document.querySelector(t)}catch(e){}return i||void 0}return t}(t);return e&&e.appendChild(this._container),this}detach(){if(!this.ownsContainer)return Array.from(this._targets).forEach(t=>this.removeTarget(t)),void this._pendingChildren.clear();const t=this._container.parentElement;t&&t.removeChild(this._container)}getContainer(){return this._container}getPositionContainer(t){return this._positionsContainers[t]}newPositionContainer(t,e=0,i){var o;const r=document.createElement("div");return r.className=`${this.classPrefix}-ctrl-wrapper`+(this.wrapperClass?" "+this.wrapperClass:""),(null==(o=h(i))?void 0:o.margin)&&r.classList.add(`${this.classPrefix}-ctrl-margin`),this.append(r,t,e,i),r}addControl(t,e,i={}){const o=t.onAdd(this.map);if(o instanceof HTMLElement){const r=this.newPositionContainer(e,i.order,t);if(r)return r.appendChild(o),i.id&&this.registerIDContainer(i.id,o,t),r}}append(t,e,i=0,o){const r=this._normalizeElement(t);if(!r)return;const n=this._resolveTargetContainer(e);if(n)return this._insertSorted(n,r,i),this._registerSwitchControl(r,o,n),n;"string"!=typeof e&&this._appendPending(e.inside,r,i,o)}registerIDContainer(t,e,i){this._idContainers.set(t,e),this._registerTargetOptions(e,i),this._flushPending(t,e)}unregisterIDContainer(t){const e=this._idContainers.get(t);e&&this._targetOptions.delete(e),this._idContainers.delete(t),this._pendingChildren.delete(t)}removeTarget(t){const e=t.parentElement;e&&e.removeChild(t),this._unregisterSwitchControl(t),this._removePending(t),this._targets.delete(t)}createContainerElement(t,e){const i=t||document.createElement("div");t||(i.className=`${this.classPrefix}-control-container`+(this.addClass?" "+this.addClass:""));const o={};return["top-right","top-left","bottom-right","bottom-left"].forEach(t=>{const r=(null==e?void 0:e[t])||this._createPositionContainer(t);o[t]=r,(null==e?void 0:e[t])||i.appendChild(r)}),{element:i,positionsContainers:o}}_createPositionContainer(t){const e=document.createElement("div");return e.className=`${this.classPrefix}-ctrl-${t}`,e}_resolveTargetContainer(t){return"string"==typeof t?this._positionsContainers[t]:this._idContainers.get(t.inside)}_normalizeElement(t){if("string"!=typeof t)return t;const e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstElementChild}_insertSorted(t,e,i){this._orders.set(e,i),e.style.order=String(i);const o=this._isBottomPositionContainer(t),r=Array.from(t.children).find(t=>{var r;if(t===e)return!1;const n=null!=(r=this._orders.get(t))?r:Number.POSITIVE_INFINITY;return o?n<=i:n>i});if(r)t.insertBefore(e,r);else{if(e.parentElement===t)return;t.appendChild(e)}this._targets.add(e)}_isBottomPositionContainer(t){return t===this._positionsContainers["bottom-left"]||t===this._positionsContainers["bottom-right"]}_appendPending(t,e,i,o){const r=e.parentElement;r&&r.removeChild(e);const n=this._pendingChildren.get(t)||[];n.push({element:e,order:i,control:o}),n.sort((t,e)=>t.order-e.order),this._pendingChildren.set(t,n),this._targets.add(e)}_flushPending(t,e){const i=this._pendingChildren.get(t);if(i){for(const{element:t,order:o,control:r}of i)this._insertSorted(e,t,o),this._registerSwitchControl(t,r,e);this._pendingChildren.delete(t)}}_removePending(t){this._pendingChildren.forEach((e,i)=>{const o=e.filter(({element:e})=>e!==t);o.length?this._pendingChildren.set(i,o):this._pendingChildren.delete(i)})}_registerSwitchControl(t,e,i){if(!this._isSwitchToggleControl(e))return;this._unregisterSwitchControl(t);const o=this._getSwitchGroup(i,"string"==typeof e.switch?e.switch:"default"),r=Object.prototype.hasOwnProperty.call(e,"disableOnSecondClick"),n=e.disableOnSecondClick,s=void 0===e.disableOnSecondClick?this._getTargetDisableOnSecondClick(i):void 0;void 0!==s&&(e.disableOnSecondClick=s),o.add(e);const a=e.onStatusChange(t=>{t&&this._disableSwitchSiblings(e,o)});this._switchBindings.set(t,{control:e,group:o,unsubscribe:a,hadDisableOnSecondClick:r,previousDisableOnSecondClick:n}),e.getStatus()&&this._disableSwitchSiblings(e,o)}_unregisterSwitchControl(t){const e=this._switchBindings.get(t);e&&(e.unsubscribe(),e.group.delete(e.control),e.hadDisableOnSecondClick?e.control.disableOnSecondClick=e.previousDisableOnSecondClick:delete e.control.disableOnSecondClick,this._switchBindings.delete(t)),Array.from(t.children).forEach(t=>{t instanceof HTMLElement&&this._unregisterSwitchControl(t)})}_getSwitchGroup(t,e){let i=this._switchGroups.get(t);i||(i=new Map,this._switchGroups.set(t,i));let o=i.get(e);return o||(o=new Set,i.set(e,o)),o}_disableSwitchSiblings(t,e){e.forEach(e=>{e!==t&&e.getStatus()&&e.onClick(!1)})}_getTargetDisableOnSecondClick(t){var e;return null==(e=this._targetOptions.get(t))?void 0:e.disableOnSecondClick}_isSwitchToggleControl(t){return!(!(null==t?void 0:t.switch)||"function"!=typeof t.onStatusChange||"function"!=typeof t.getStatus||"function"!=typeof t.onClick)}_registerTargetOptions(t,e){const i=h(e)||h(t);i?this._targetOptions.set(t,i):this._targetOptions.delete(t)}}const m=["wheel","click","mouseup","touchend","dblclick","pointerup","mousedown","touchstart","pointerdown"];function g(t,e){e&&e.split(" ").filter(Boolean).forEach(e=>t.classList.add(e))}function y(t){t.stopPropagation()}function _(t={}){const e=l(t),i=document.createElement("div");i.className="webmap-ctrl",e.bar&&i.classList.add("webmap-ctrl-group"),e.margin&&i.classList.add("webmap-ctrl-margin");const o=e.orientation||e.direction;if(o&&i.classList.add(`webmap-ctrl-${o}`),void 0!==e.gap){i.style.setProperty("--webmap-ctrl-gap","number"==typeof e.gap?`${e.gap}px`:e.gap),function(t){return"number"==typeof t?0===t:"string"==typeof t&&t.trim().split(/\s+/).every(t=>/^0(?:\.0+)?(?:[a-z%]+)?$/i.test(t))}(e.gap)&&i.classList.add("webmap-ctrl-gapless")}const r=function(t){return"start"===t?"flex-start":"end"===t?"flex-end":t}(e.align);return r&&i.style.setProperty("--webmap-ctrl-align",r),g(i,e.addClass),function(t){m.forEach(e=>{t.addEventListener(e,y)})}(i),i}function b(t,e){e instanceof HTMLElement?t.appendChild(e):"string"==typeof e&&(t.innerHTML=e)}function v(t){let e;const i=e=>{e.preventDefault(),e.stopPropagation(),t.onClick()},o={onAdd:()=>(e=document.createElement("button"),e.type="button",e.className="webmap-ctrl-button",g(e,t.addClass),t.title&&(e.title=t.title,e.setAttribute("aria-label",t.title)),b(e,t.html),e.addEventListener("click",i),e),onRemove(){var t;e&&(e.removeEventListener("click",i),(null==(t=e)?void 0:t.parentNode)&&t.parentNode.removeChild(t),e=void 0)},getContainer:()=>e,remove:()=>{o.onRemove()}};return o}var w,x={exports:{}};
2
2
  /* @preserve
3
3
  * Leaflet 1.7.1, a JS library for interactive maps. http://leafletjs.com
4
4
  * (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade
5
- */var P=(w||(w=1,function(t){var e="1.7.1";function i(t){var e,i,o,n;for(i=1,o=arguments.length;i<o;i++)for(e in n=arguments[i])t[e]=n[e];return t}var o=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function n(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var o=i.call(arguments,2);return function(){return t.apply(e,o.length?o.concat(i.call(arguments)):arguments)}}var r=0;function s(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function a(t,e,i){var o,n,r,s;return s=function(){o=!1,n&&(r.apply(i,n),n=!1)},r=function(){o?n=arguments:(t.apply(i,arguments),setTimeout(s,e),o=!0)},r}function l(t,e,i){var o=e[1],n=e[0],r=o-n;return t===o&&i?t:((t-n)%r+r)%r+n}function c(){return!1}function h(t,e){var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function u(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return u(t).split(/\s+/)}function d(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?o(t.options):{}),e)t.options[i]=e[i];return t.options}function f(t,e,i){var o=[];for(var n in t)o.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+o.join("&")}var m=/\{ *([\w_-]+) *\}/g;function g(t,e){return t.replace(m,function(t,i){var o=e[i];if(void 0===o)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o})}var y=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function _(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var v="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function b(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function x(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var P=window.requestAnimationFrame||b("RequestAnimationFrame")||x,O=window.cancelAnimationFrame||b("CancelAnimationFrame")||b("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function C(t,e,i){if(!i||P!==x)return P.call(window,n(t,e));t.call(e)}function k(t){t&&O.call(window,t)}var E={extend:i,create:o,bind:n,lastId:r,stamp:s,throttle:a,wrapNum:l,falseFn:c,formatNum:h,trim:u,splitWords:p,setOptions:d,getParamString:f,template:g,isArray:y,indexOf:_,emptyImageUrl:v,requestFn:P,cancelFn:O,requestAnimFrame:C,cancelAnimFrame:k};function M(){}function A(t){if("undefined"!=typeof L&&L&&L.Mixin){t=y(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}M.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},n=e.__super__=this.prototype,r=o(n);for(var s in r.constructor=e,e.prototype=r,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(e[s]=this[s]);return t.statics&&(i(e,t.statics),delete t.statics),t.includes&&(A(t.includes),i.apply(null,[r].concat(t.includes)),delete t.includes),r.options&&(t.options=i(o(r.options),t.options)),i(r,t),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){n.callInitHooks&&n.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=r._initHooks.length;t<e;t++)r._initHooks[t].call(this)}},e},M.include=function(t){return i(this.prototype,t),this},M.mergeOptions=function(t){return i(this.prototype.options,t),this},M.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var T={on:function(t,e,i){if("object"==typeof t)for(var o in t)this._on(o,t[o],e);else for(var n=0,r=(t=p(t)).length;n<r;n++)this._on(t[n],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var o in t)this._off(o,t[o],e);else for(var n=0,r=(t=p(t)).length;n<r;n++)this._off(t[n],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var o=this._events[t];o||(this._events[t]=o=[]),i===this&&(i=void 0);for(var n={fn:e,ctx:i},r=o,s=0,a=r.length;s<a;s++)if(r[s].fn===e&&r[s].ctx===i)return;r.push(n)},_off:function(t,e,i){var o,n,r;if(this._events&&(o=this._events[t]))if(e){if(i===this&&(i=void 0),o)for(n=0,r=o.length;n<r;n++){var s=o[n];if(s.ctx===i&&s.fn===e)return s.fn=c,this._firingCount&&(this._events[t]=o=o.slice()),void o.splice(n,1)}}else{for(n=0,r=o.length;n<r;n++)o[n].fn=c;delete this._events[t]}},fire:function(t,e,o){if(!this.listens(t,o))return this;var n=i({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var s=0,a=r.length;s<a;s++){var l=r[s];l.fn.call(l.ctx||this,n)}this._firingCount--}}return o&&this._propagateEvent(n),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var o in this._eventParents)if(this._eventParents[o].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var o in t)this.once(o,t[o],e);return this}var r=n(function(){this.off(t,e,i).off(t,r,i)},this);return this.on(t,e,i).on(t,r,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[s(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[s(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,i({layer:t.target,propagatedFrom:t.target},t),!0)}};T.addEventListener=T.on,T.removeEventListener=T.clearAllEventListeners=T.off,T.addOneTimeEventListener=T.once,T.fireEvent=T.fire,T.hasEventListeners=T.listens;var S=M.extend(T);function I(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var z=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function j(t,e,i){return t instanceof I?t:y(t)?new I(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new I(t.x,t.y):new I(t,e,i)}function B(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function Z(t,e){return!t||t instanceof B?t:new B(t,e)}function N(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function R(t,e){return t instanceof N?t:new N(t,e)}function D(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function q(t,e,i){return t instanceof D?t:y(t)&&"object"!=typeof t[0]?3===t.length?new D(t[0],t[1],t[2]):2===t.length?new D(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new D(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new D(t,e,i)}I.prototype={clone:function(){return new I(this.x,this.y)},add:function(t){return this.clone()._add(j(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(j(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new I(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new I(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=z(this.x),this.y=z(this.y),this},distanceTo:function(t){var e=(t=j(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=j(t)).x===this.x&&t.y===this.y},contains:function(t){return t=j(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+h(this.x)+", "+h(this.y)+")"}},B.prototype={extend:function(t){return t=j(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new I((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new I(this.min.x,this.max.y)},getTopRight:function(){return new I(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof I?j(t):Z(t))instanceof B?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=Z(t);var e=this.min,i=this.max,o=t.min,n=t.max;return n.x>=e.x&&o.x<=i.x&&n.y>=e.y&&o.y<=i.y},overlaps:function(t){t=Z(t);var e=this.min,i=this.max,o=t.min,n=t.max;return n.x>e.x&&o.x<i.x&&n.y>e.y&&o.y<i.y},isValid:function(){return!(!this.min||!this.max)}},N.prototype={extend:function(t){var e,i,o=this._southWest,n=this._northEast;if(t instanceof D)e=t,i=t;else{if(!(t instanceof N))return t?this.extend(q(t)||R(t)):this;if(i=t._northEast,!(e=t._southWest)||!i)return this}return o||n?(o.lat=Math.min(e.lat,o.lat),o.lng=Math.min(e.lng,o.lng),n.lat=Math.max(i.lat,n.lat),n.lng=Math.max(i.lng,n.lng)):(this._southWest=new D(e.lat,e.lng),this._northEast=new D(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,n=Math.abs(e.lng-i.lng)*t;return new N(new D(e.lat-o,e.lng-n),new D(i.lat+o,i.lng+n))},getCenter:function(){return new D((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 D(this.getNorth(),this.getWest())},getSouthEast:function(){return new D(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof D||"lat"in t?q(t):R(t);var e,i,o=this._southWest,n=this._northEast;return t instanceof N?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=n.lat&&e.lng>=o.lng&&i.lng<=n.lng},intersects:function(t){t=R(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast();return n.lat>=e.lat&&o.lat<=i.lat&&n.lng>=e.lng&&o.lng<=i.lng},overlaps:function(t){t=R(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast();return n.lat>e.lat&&o.lat<i.lat&&n.lng>e.lng&&o.lng<i.lng},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=R(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},D.prototype={equals:function(t,e){return!!t&&(t=q(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+h(this.lat,t)+", "+h(this.lng,t)+")"},distanceTo:function(t){return W.distance(this,q(t))},wrap:function(){return W.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return R([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new D(this.lat,this.lng,this.alt)}};var F,U={latLngToPoint:function(t,e){var i=this.projection.project(t),o=this.scale(e);return this.transformation._transform(i,o)},pointToLatLng:function(t,e){var i=this.scale(e),o=this.transformation.untransform(t,i);return this.projection.unproject(o)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new B(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?l(t.lng,this.wrapLng,!0):t.lng;return new D(this.wrapLat?l(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),o=e.lat-i.lat,n=e.lng-i.lng;if(0===o&&0===n)return t;var r=t.getSouthWest(),s=t.getNorthEast();return new N(new D(r.lat-o,r.lng-n),new D(s.lat-o,s.lng-n))}},W=i({},U,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,o=t.lat*i,n=e.lat*i,r=Math.sin((e.lat-t.lat)*i/2),s=Math.sin((e.lng-t.lng)*i/2),a=r*r+Math.cos(o)*Math.cos(n)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),H=6378137,V={R:H,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),n=Math.sin(o*e);return new I(this.R*t.lng*e,this.R*Math.log((1+n)/(1-n))/2)},unproject:function(t){var e=180/Math.PI;return new D((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(F=H*Math.PI,new B([-F,-F],[F,F]))};function G(t,e,i,o){if(y(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=o}function J(t,e,i,o){return new G(t,e,i,o)}G.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return t.x=(e=e||1)*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return new I((t.x/(e=e||1)-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=i({},W,{code:"EPSG:3857",projection:V,transformation:function(){var t=.5/(Math.PI*V.R);return J(t,.5,-t,.5)}()}),Y=i({},K,{code:"EPSG:900913"});function Q(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function $(t,e){var i,o,n,r,s,a,l="";for(i=0,n=t.length;i<n;i++){for(o=0,r=(s=t[i]).length;o<r;o++)l+=(o?"L":"M")+(a=s[o]).x+" "+a.y;l+=e?At?"z":"x":""}return l||"M0 0"}var X=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),ot=St("webkit"),nt=St("android"),rt=St("android 2")||St("android 3"),st=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=nt&&St("Google")&&st<537&&!("AudioNode"in window),lt=!!window.opera,ct=!it&&St("chrome"),ht=St("gecko")&&!ot&&!lt&&!tt,ut=!ct&&St("safari"),pt=St("phantom"),dt="OTransition"in X,ft=0===navigator.platform.indexOf("Win"),mt=tt&&"transition"in X,gt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!rt,yt="MozPerspective"in X,_t=!window.L_DISABLE_3D&&(mt||gt||yt)&&!dt&&!pt,vt="undefined"!=typeof orientation||St("mobile"),bt=vt&&ot,wt=vt&&gt,xt=!window.PointerEvent&&window.MSPointerEvent,Pt=!(!window.PointerEvent&&!xt),Lt=!window.L_NO_TOUCH&&(Pt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Ot=vt&&lt,Ct=vt&&ht,kt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Et=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",c,e),window.removeEventListener("testPassiveEventSupport",c,e)}catch(i){}return t}(),Mt=!!document.createElement("canvas").getContext,At=!(!document.createElementNS||!Q("svg").createSVGRect),Tt=!At&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(i){return!1}}();function St(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var It={ie:tt,ielt9:et,edge:it,webkit:ot,android:nt,android23:rt,androidStock:at,opera:lt,chrome:ct,gecko:ht,safari:ut,phantom:pt,opera12:dt,win:ft,ie3d:mt,webkit3d:gt,gecko3d:yt,any3d:_t,mobile:vt,mobileWebkit:bt,mobileWebkit3d:wt,msPointer:xt,pointer:Pt,touch:Lt,mobileOpera:Ot,mobileGecko:Ct,retina:kt,passiveEvents:Et,canvas:Mt,svg:At,vml:Tt},zt=xt?"MSPointerDown":"pointerdown",jt=xt?"MSPointerMove":"pointermove",Bt=xt?"MSPointerUp":"pointerup",Zt=xt?"MSPointerCancel":"pointercancel",Nt={},Rt=!1;function Dt(t,e,i,o){return"touchstart"===e?Ft(t,i,o):"touchmove"===e?Gt(t,i,o):"touchend"===e&&Jt(t,i,o),this}function qt(t,e,i){var o=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(zt,o,!1):"touchmove"===e?t.removeEventListener(jt,o,!1):"touchend"===e&&(t.removeEventListener(Bt,o,!1),t.removeEventListener(Zt,o,!1)),this}function Ft(t,e,i){var o=n(function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&We(t),Vt(t,e)});t["_leaflet_touchstart"+i]=o,t.addEventListener(zt,o,!1),Rt||(document.addEventListener(zt,Ut,!0),document.addEventListener(jt,Wt,!0),document.addEventListener(Bt,Ht,!0),document.addEventListener(Zt,Ht,!0),Rt=!0)}function Ut(t){Nt[t.pointerId]=t}function Wt(t){Nt[t.pointerId]&&(Nt[t.pointerId]=t)}function Ht(t){delete Nt[t.pointerId]}function Vt(t,e){for(var i in t.touches=[],Nt)t.touches.push(Nt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var o=function(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||Vt(t,e)};t["_leaflet_touchmove"+i]=o,t.addEventListener(jt,o,!1)}function Jt(t,e,i){var o=function(t){Vt(t,e)};t["_leaflet_touchend"+i]=o,t.addEventListener(Bt,o,!1),t.addEventListener(Zt,o,!1)}var Kt=xt?"MSPointerDown":Pt?"pointerdown":"touchstart",Yt=xt?"MSPointerUp":Pt?"pointerup":"touchend",Qt="_leaflet_";function $t(t,e,i){var o,n,r=!1,s=250;function a(t){if(Pt){if(!t.isPrimary)return;if("mouse"===t.pointerType)return}else if(t.touches.length>1)return;var e=Date.now(),i=e-(o||e);n=t.touches?t.touches[0]:t,r=i>0&&i<=s,o=e}function l(t){if(r&&!n.cancelBubble){if(Pt){if("mouse"===t.pointerType)return;var i,s,a={};for(s in n)a[s]=(i=n[s])&&i.bind?i.bind(n):i;n=a}n.type="dblclick",n.button=0,e(n),o=null}}return t[Qt+Kt+i]=a,t[Qt+Yt+i]=l,t[Qt+"dblclick"+i]=e,t.addEventListener(Kt,a,!!Et&&{passive:!1}),t.addEventListener(Yt,l,!!Et&&{passive:!1}),t.addEventListener("dblclick",e,!1),this}function Xt(t,e){var i=t[Qt+Yt+e],o=t[Qt+"dblclick"+e];return t.removeEventListener(Kt,t[Qt+Kt+e],!!Et&&{passive:!1}),t.removeEventListener(Yt,i,!!Et&&{passive:!1}),t.removeEventListener("dblclick",o,!1),this}var te,ee,ie,oe,ne,re=xe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),se=xe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ae="webkitTransition"===se||"OTransition"===se?se+"End":"transitionend";function le(t){return"string"==typeof t?document.getElementById(t):t}function ce(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var o=document.defaultView.getComputedStyle(t,null);i=o?o[e]:null}return"auto"===i?null:i}function he(t,e,i){var o=document.createElement(t);return o.className=e||"",i&&i.appendChild(o),o}function ue(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function de(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function me(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=ve(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function ge(t,e){if(void 0!==t.classList)for(var i=p(e),o=0,n=i.length;o<n;o++)t.classList.add(i[o]);else if(!me(t,e)){var r=ve(t);_e(t,(r?r+" ":"")+e)}}function ye(t,e){void 0!==t.classList?t.classList.remove(e):_e(t,u((" "+ve(t)+" ").replace(" "+e+" "," ")))}function _e(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function ve(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function be(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,o="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(o)}catch(n){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+o+"(opacity="+e+")"}function xe(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Pe(t,e,i){var o=e||new I(0,0);t.style[re]=(mt?"translate("+o.x+"px,"+o.y+"px)":"translate3d("+o.x+"px,"+o.y+"px,0)")+(i?" scale("+i+")":"")}function Le(t,e){t._leaflet_pos=e,_t?Pe(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Oe(t){return t._leaflet_pos||new I(0,0)}if("onselectstart"in document)te=function(){ze(window,"selectstart",We)},ee=function(){Be(window,"selectstart",We)};else{var Ce=xe(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);te=function(){if(Ce){var t=document.documentElement.style;ie=t[Ce],t[Ce]="none"}},ee=function(){Ce&&(document.documentElement.style[Ce]=ie,ie=void 0)}}function ke(){ze(window,"dragstart",We)}function Ee(){Be(window,"dragstart",We)}function Me(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Ae(),oe=t,ne=t.style.outline,t.style.outline="none",ze(window,"keydown",Ae))}function Ae(){oe&&(oe.style.outline=ne,oe=void 0,ne=void 0,Be(window,"keydown",Ae))}function Te(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Se(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Ie={TRANSFORM:re,TRANSITION:se,TRANSITION_END:ae,get:le,getStyle:ce,create:he,remove:ue,empty:pe,toFront:de,toBack:fe,hasClass:me,addClass:ge,removeClass:ye,setClass:_e,getClass:ve,setOpacity:be,testProp:xe,setTransform:Pe,setPosition:Le,getPosition:Oe,disableTextSelection:te,enableTextSelection:ee,disableImageDrag:ke,enableImageDrag:Ee,preventOutline:Me,restoreOutline:Ae,getSizedParentNode:Te,getScale:Se};function ze(t,e,i,o){if("object"==typeof e)for(var n in e)Re(t,n,e[n],i);else for(var r=0,s=(e=p(e)).length;r<s;r++)Re(t,e[r],i,o);return this}var je="_leaflet_events";function Be(t,e,i,o){if("object"==typeof e)for(var n in e)De(t,n,e[n],i);else if(e)for(var r=0,s=(e=p(e)).length;r<s;r++)De(t,e[r],i,o);else{for(var a in t[je])De(t,a,t[je][a]);delete t[je]}return this}function Ze(){if(Pt)return!(it||ut)}var Ne={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Re(t,e,i,o){var n=e+s(i)+(o?"_"+s(o):"");if(t[je]&&t[je][n])return this;var r=function(e){return i.call(o||t,e||window.event)},a=r;Pt&&0===e.indexOf("touch")?Dt(t,e,r,n):Lt&&"dblclick"===e&&!Ze()?$t(t,r,n):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Ne[e]||e,r,!!Et&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?t.addEventListener(Ne[e],r=function(e){e=e||window.event,$e(t,e)&&a(e)},!1):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,r),t[je]=t[je]||{},t[je][n]=r}function De(t,e,i,o){var n=e+s(i)+(o?"_"+s(o):""),r=t[je]&&t[je][n];if(!r)return this;Pt&&0===e.indexOf("touch")?qt(t,e,n):Lt&&"dblclick"===e&&!Ze()?Xt(t,n):"removeEventListener"in t?t.removeEventListener(Ne[e]||e,r,!1):"detachEvent"in t&&t.detachEvent("on"+e,r),t[je][n]=null}function qe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Qe(t),this}function Fe(t){return Re(t,"wheel",qe),this}function Ue(t){return ze(t,"mousedown touchstart dblclick",qe),Re(t,"click",Ye),this}function We(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function He(t){return We(t),qe(t),this}function Ve(t,e){if(!e)return new I(t.clientX,t.clientY);var i=Se(e),o=i.boundingClientRect;return new I((t.clientX-o.left)/i.x-e.clientLeft,(t.clientY-o.top)/i.y-e.clientTop)}var Ge=ft&&ct?2*window.devicePixelRatio:ht?window.devicePixelRatio:1;function Je(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Ge:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ke={};function Ye(t){Ke[t.type]=!0}function Qe(t){var e=Ke[t.type];return Ke[t.type]=!1,e}function $e(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(o){return!1}return i!==t}var Xe={on:ze,off:Be,stopPropagation:qe,disableScrollPropagation:Fe,disableClickPropagation:Ue,preventDefault:We,stop:He,getMousePosition:Ve,getWheelDelta:Je,fakeStop:Ye,skipped:Qe,isExternalTarget:$e,addListener:ze,removeListener:Be},ti=S.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(o||.5,.2),this._startPos=Oe(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=C(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Le(this._el,i),this.fire("step")},_complete:function(){k(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ei=S.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=d(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=n(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(q(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=se&&_t&&!Ot&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ze(this._proxy,ae,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,o){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(q(t),e,this.options.maxBounds),o=o||{},this._stop(),this._loaded&&!o.reset&&!0!==o&&(void 0!==o.animate&&(o.zoom=i({animate:o.animate},o.zoom),o.pan=i({animate:o.animate,duration:o.duration},o.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,o.zoom):this._tryAnimatedPan(t,o.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t=t||(_t?this.options.zoomDelta:1)),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t=t||(_t?this.options.zoomDelta:1)),e)},setZoomAround:function(t,e,i){var o=this.getZoomScale(e),n=this.getSize().divideBy(2),r=(t instanceof I?t:this.latLngToContainerPoint(t)).subtract(n).multiplyBy(1-1/o),s=this.containerPointToLatLng(n.add(r));return this.setView(s,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():R(t);var i=j(e.paddingTopLeft||e.padding||[0,0]),o=j(e.paddingBottomRight||e.padding||[0,0]),n=this.getBoundsZoom(t,!1,i.add(o));if((n="number"==typeof e.maxZoom?Math.min(e.maxZoom,n):n)===1/0)return{center:t.getCenter(),zoom:n};var r=o.subtract(i).divideBy(2),s=this.project(t.getSouthWest(),n),a=this.project(t.getNorthEast(),n);return{center:this.unproject(s.add(a).divideBy(2).add(r),n),zoom:n}},fitBounds:function(t,e){if(!(t=R(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=j(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ti,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){ge(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!_t)return this.setView(t,e,i);this._stop();var o=this.project(this.getCenter()),n=this.project(t),r=this.getSize(),s=this._zoom;t=q(t),e=void 0===e?s:e;var a=Math.max(r.x,r.y),l=a*this.getZoomScale(s,e),c=n.distanceTo(o)||1,h=1.42,u=h*h;function p(t){var e=(l*l-a*a+(t?-1:1)*u*u*c*c)/(2*(t?l:a)*u*c),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function d(t){return(Math.exp(t)-Math.exp(-t))/2}function f(t){return(Math.exp(t)+Math.exp(-t))/2}function m(t){return d(t)/f(t)}var g=p(0);function y(t){return a*(f(g)/f(g+h*t))}function _(t){return a*(f(g)*m(g+h*t)-d(g))/u}function v(t){return 1-Math.pow(1-t,1.5)}var b=Date.now(),w=(p(1)-g)/h,x=i.duration?1e3*i.duration:1e3*w*.8;function P(){var i=(Date.now()-b)/x,r=v(i)*w;i<=1?(this._flyToFrame=C(P,this),this._move(this.unproject(o.add(n.subtract(o).multiplyBy(_(r)/c)),s),this.getScaleZoom(a/y(r),s),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),P.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=R(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),o=this._limitCenter(i,this._zoom,R(t));return i.equals(o)||this.panTo(o,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=j((e=e||{}).paddingTopLeft||e.padding||[0,0]),o=j(e.paddingBottomRight||e.padding||[0,0]),n=this.getCenter(),r=this.project(n),s=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),c=Z([a.min.add(i),a.max.subtract(o)]);if(!c.contains(s)){this._enforcingBounds=!0;var h=r.subtract(s),u=j(s.x+h.x,s.y+h.y);(s.x<c.min.x||s.x>c.max.x)&&(u.x=r.x-h.x,h.x>0?u.x+=l.x-i.x:u.x-=l.x-o.x),(s.y<c.min.y||s.y>c.max.y)&&(u.y=r.y-h.y,h.y>0?u.y+=l.y-i.y:u.y-=l.y-o.y),this.panTo(this.unproject(u),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),r=e.divideBy(2).round(),s=o.divideBy(2).round(),a=r.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(n(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=n(this._handleGeolocationResponse,this),o=n(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,o,t):navigator.geolocation.getCurrentPosition(e,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new D(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),o=this._locateOptions;if(o.setView){var n=this.getBoundsZoom(i);this.setView(e,o.maxZoom?Math.min(n,o.maxZoom):n)}var r={latlng:e,bounds:i,timestamp:t.timestamp};for(var s in t.coords)"number"==typeof t.coords[s]&&(r[s]=t.coords[s]);this.fire("locationfound",r)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.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(e){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ue(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(k(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ue(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=he("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new N(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=R(t),i=j(i||[0,0]);var o=this.getZoom()||0,n=this.getMinZoom(),r=this.getMaxZoom(),s=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),c=Z(this.project(a,o),this.project(s,o)).getSize(),h=_t?this.options.zoomSnap:1,u=l.x/c.x,p=l.y/c.y,d=e?Math.max(u,p):Math.min(u,p);return o=this.getScaleZoom(d,o),h&&(o=Math.round(o/(h/100))*(h/100),o=e?Math.ceil(o/h)*h:Math.floor(o/h)*h),Math.max(n,Math.min(r,o))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new I(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new B(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,o=i.zoom(t*i.scale(e=void 0===e?this._zoom:e));return isNaN(o)?1/0:o},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(q(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(j(t),e)},layerPointToLatLng:function(t){var e=j(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(q(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(q(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(R(t))},distance:function(t,e){return this.options.crs.distance(q(t),q(e))},containerPointToLayerPoint:function(t){return j(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return j(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(j(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(q(t)))},mouseEventToContainerPoint:function(t){return Ve(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=le(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");ze(e,"scroll",this._onScroll,this),this._containerId=s(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&_t,ge(t,"leaflet-container"+(Lt?" leaflet-touch":"")+(kt?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(ut?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=ce(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Le(this._mapPane,new I(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ge(t.markerPane,"leaflet-zoom-hide"),ge(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Le(this._mapPane,new I(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,!1)._move(t,e)._moveEnd(o),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return k(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Le(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[s(this._container)]=this;var e=t?Be:ze;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),_t&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){k(this._resizeRequest),this._resizeRequest=C(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,o=[],n="mouseout"===e||"mouseover"===e,r=t.target||t.srcElement,a=!1;r;){if((i=this._targets[s(r)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(n&&!$e(r,t))break;if(o.push(i),n)break}if(r===this._container)break;r=r.parentNode}return o.length||a||n||!$e(r,t)||(o=[this]),o},_handleDOMEvent:function(t){if(this._loaded&&!Qe(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Me(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,o){if("click"===t.type){var n=i({},t);n.type="preclick",this._fireDOMEvent(n,n.type,o)}if(!t._stopped&&(o=(o||[]).concat(this._findEventTargets(t,e))).length){var r=o[0];"contextmenu"===e&&r.listens(e,!0)&&We(t);var s={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=r.getLatLng&&(!r._radius||r._radius<=10);s.containerPoint=a?this.latLngToContainerPoint(r.getLatLng()):this.mouseEventToContainerPoint(t),s.layerPoint=this.containerPointToLayerPoint(s.containerPoint),s.latlng=a?r.getLatLng():this.layerPointToLatLng(s.layerPoint)}for(var l=0;l<o.length;l++)if(o[l].fire(e,s,!0),s.originalEvent._stopped||!1===o[l].options.bubblingMouseEvents&&-1!==_(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Oe(this._mapPane)||new I(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(o)},_latLngBoundsToNewLayerBounds:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return Z([this.project(t.getSouthWest(),e)._subtract(o),this.project(t.getNorthWest(),e)._subtract(o),this.project(t.getSouthEast(),e)._subtract(o),this.project(t.getNorthEast(),e)._subtract(o)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var o=this.project(t,e),n=this.getSize().divideBy(2),r=new B(o.subtract(n),o.add(n)),s=this._getBoundsOffset(r,i,e);return s.round().equals([0,0])?t:this.unproject(o.add(s),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),o=new B(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(o,e))},_getBoundsOffset:function(t,e,i){var o=Z(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),n=o.min.subtract(t.min),r=o.max.subtract(t.max);return new I(this._rebound(n.x,-r.x),this._rebound(n.y,-r.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),o=_t?this.options.zoomSnap:1;return o&&(t=Math.round(t/o)*o),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ye(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=he("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=re,i=this._proxy.style[e];Pe(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ue(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Pe(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var o=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/o);return!(!0!==i.animate&&!this.getSize().contains(n)||(C(function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)},this),0))},_animateZoom:function(t,e,i,o){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ge(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:o}),setTimeout(n(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ye(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),C(function(){this._moveEnd(!0)},this))}});function ii(t,e){return new ei(t,e)}var oi=M.extend({options:{position:"topright"},initialize:function(t){d(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),o=t._controlCorners[i];return ge(e,"leaflet-control"),-1!==i.indexOf("bottom")?o.insertBefore(e,o.firstChild):o.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ue(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ni=function(t){return new oi(t)};ei.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=he("div",e+"control-container",this._container);function o(o,n){t[o+n]=he("div",e+o+" "+e+n,i)}o("top","left"),o("top","right"),o("bottom","left"),o("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ue(this._controlCorners[t]);ue(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ri=oi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,o){return i<o?-1:o<i?1:0}},initialize:function(t,e,i){for(var o in d(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[o],o);for(o in e)this._addLayer(e[o],o,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return oi.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(s(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){ge(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(ge(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ye(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ye(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=he("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),Ue(e),Fe(e);var o=this._section=he("section",t+"-list");i&&(this._map.on("click",this.collapse,this),nt||ze(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var n=this._layersLink=he("a",t+"-toggle",e);n.href="#",n.title="Layers",Lt?(ze(n,"click",He),ze(n,"click",this.expand,this)):ze(n,"focus",this.expand,this),i||this.expand(),this._baseLayersList=he("div",t+"-base",o),this._separator=he("div",t+"-separator",o),this._overlaysList=he("div",t+"-overlays",o),e.appendChild(o)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&s(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(n(function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,o,n=0;for(i=0;i<this._layers.length;i++)this._addItem(o=this._layers[i]),e=e||o.overlay,t=t||!o.overlay,n+=o.overlay?0:1;return this.options.hideSingleBase&&(this._baseLayersList.style.display=(t=t&&n>1)?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(s(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",o=document.createElement("div");return o.innerHTML=i,o.firstChild},_addItem:function(t){var e,i=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=o):e=this._createRadioElement("leaflet-base-layers_"+s(this),o),this._layerControlInputs.push(e),e.layerId=s(t.layer),ze(e,"click",this._onInputClick,this);var n=document.createElement("span");n.innerHTML=" "+t.name;var r=document.createElement("div");return i.appendChild(r),r.appendChild(e),r.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,o=[],n=[];this._handlingClick=!0;for(var r=i.length-1;r>=0;r--)e=this._getLayer((t=i[r]).layerId).layer,t.checked?o.push(e):t.checked||n.push(e);for(r=0;r<n.length;r++)this._map.hasLayer(n[r])&&this._map.removeLayer(n[r]);for(r=0;r<o.length;r++)this._map.hasLayer(o[r])||this._map.addLayer(o[r]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,o=this._map.getZoom(),n=i.length-1;n>=0;n--)e=this._getLayer((t=i[n]).layerId).layer,t.disabled=void 0!==e.options.minZoom&&o<e.options.minZoom||void 0!==e.options.maxZoom&&o>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),si=function(t,e,i){return new ri(t,e,i)},ai=oi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=he("div",e+" leaflet-bar"),o=this.options;return this._zoomInButton=this._createButton(o.zoomInText,o.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(o.zoomOutText,o.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,o,n){var r=he("a",i,o);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),Ue(r),ze(r,"click",He),ze(r,"click",n,this),ze(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ye(this._zoomInButton,e),ye(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&ge(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&ge(this._zoomInButton,e)}});ei.mergeOptions({zoomControl:!0}),ei.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new ai,this.addControl(this.zoomControl))});var li=function(t){return new ai(t)},ci=oi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=he("div",e),o=this.options;return this._addScales(o,e+"-line",i),t.on(o.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=he("div",e,i)),t.imperial&&(this._iScale=he("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,o,n=3.2808399*t;n>5280?(i=this._getRoundNum(e=n/5280),this._updateScale(this._iScale,i+" mi",i/e)):(o=this._getRoundNum(n),this._updateScale(this._iScale,o+" ft",o/n))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),hi=function(t){return new ci(t)},ui=oi.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){d(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=he("div","leaflet-control-attribution"),Ue(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});ei.mergeOptions({attributionControl:!0}),ei.addInitHook(function(){this.options.attributionControl&&(new ui).addTo(this)});var pi=function(t){return new ui(t)};oi.Layers=ri,oi.Zoom=ai,oi.Scale=ci,oi.Attribution=ui,ni.layers=si,ni.zoom=li,ni.scale=hi,ni.attribution=pi;var di=M.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});di.addTo=function(t,e){return t.addHandler(e,this),this};var fi,mi={Events:T},gi=Lt?"touchstart mousedown":"mousedown",yi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},_i={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},vi=S.extend({options:{clickTolerance:3},initialize:function(t,e,i,o){d(this,o),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(ze(this._dragStartTarget,gi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(vi._dragging===this&&this.finishDrag(),Be(this._dragStartTarget,gi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!me(this._element,"leaflet-zoom-anim")&&!(vi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(vi._dragging=this,this._preventOutline&&Me(this._element),ke(),te(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Te(this._element);this._startPoint=new I(e.clientX,e.clientY),this._parentScale=Se(i),ze(document,_i[t.type],this._onMove,this),ze(document,yi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new I(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,We(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Oe(this._element).subtract(i),ge(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ge(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,k(this._animRequest),this._lastEvent=t,this._animRequest=C(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Le(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in ye(document.body,"leaflet-dragging"),this._lastTarget&&(ye(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),_i)Be(document,_i[t],this._onMove,this),Be(document,yi[t],this._onUp,this);Ee(),ee(),this._moved&&this._moving&&(k(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,vi._dragging=!1}});function bi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Pi(t=Oi(t,i),i)}function wi(t,e,i){return Math.sqrt(Ai(t,e,i,!0))}function xi(t,e,i){return Ai(t,e,i)}function Pi(t,e){var i=t.length,o=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);o[0]=o[i-1]=1,Li(t,o,e,0,i-1);var n,r=[];for(n=0;n<i;n++)o[n]&&r.push(t[n]);return r}function Li(t,e,i,o,n){var r,s,a,l=0;for(s=o+1;s<=n-1;s++)(a=Ai(t[s],t[o],t[n],!0))>l&&(r=s,l=a);l>i&&(e[r]=1,Li(t,e,i,o,r),Li(t,e,i,r,n))}function Oi(t,e){for(var i=[t[0]],o=1,n=0,r=t.length;o<r;o++)Mi(t[o],t[n])>e&&(i.push(t[o]),n=o);return n<r-1&&i.push(t[r-1]),i}function Ci(t,e,i,o,n){var r,s,a,l=o?fi:Ei(t,i),c=Ei(e,i);for(fi=c;;){if(!(l|c))return[t,e];if(l&c)return!1;a=Ei(s=ki(t,e,r=l||c,i,n),i),r===l?(t=s,l=a):(e=s,c=a)}}function ki(t,e,i,o,n){var r,s,a=e.x-t.x,l=e.y-t.y,c=o.min,h=o.max;return 8&i?(r=t.x+a*(h.y-t.y)/l,s=h.y):4&i?(r=t.x+a*(c.y-t.y)/l,s=c.y):2&i?(r=h.x,s=t.y+l*(h.x-t.x)/a):1&i&&(r=c.x,s=t.y+l*(c.x-t.x)/a),new I(r,s,n)}function Ei(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Mi(t,e){var i=e.x-t.x,o=e.y-t.y;return i*i+o*o}function Ai(t,e,i,o){var n,r=e.x,s=e.y,a=i.x-r,l=i.y-s,c=a*a+l*l;return c>0&&((n=((t.x-r)*a+(t.y-s)*l)/c)>1?(r=i.x,s=i.y):n>0&&(r+=a*n,s+=l*n)),a=t.x-r,l=t.y-s,o?a*a+l*l:new I(r,s)}function Ti(t){return!y(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Si(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ti(t)}var Ii={simplify:bi,pointToSegmentDistance:wi,closestPointOnSegment:xi,clipSegment:Ci,_getEdgeIntersection:ki,_getBitCode:Ei,_sqClosestPointOnSegment:Ai,isFlat:Ti,_flat:Si};function zi(t,e,i){var o,n,r,s,a,l,c,h,u,p=[1,4,2,8];for(n=0,c=t.length;n<c;n++)t[n]._code=Ei(t[n],e);for(s=0;s<4;s++){for(h=p[s],o=[],n=0,r=(c=t.length)-1;n<c;r=n++)l=t[r],(a=t[n])._code&h?l._code&h||((u=ki(l,a,h,e,i))._code=Ei(u,e),o.push(u)):(l._code&h&&((u=ki(l,a,h,e,i))._code=Ei(u,e),o.push(u)),o.push(a));t=o}return t}var ji={clipPolygon:zi},Bi={project:function(t){return new I(t.lng,t.lat)},unproject:function(t){return new D(t.y,t.x)},bounds:new B([-180,-90],[180,90])},Zi={R:6378137,R_MINOR:6356752.314245179,bounds:new B([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,o=t.lat*e,n=this.R_MINOR/i,r=Math.sqrt(1-n*n),s=r*Math.sin(o),a=Math.tan(Math.PI/4-o/2)/Math.pow((1-s)/(1+s),r/2);return o=-i*Math.log(Math.max(a,1e-10)),new I(t.lng*e*i,o)},unproject:function(t){for(var e,i=180/Math.PI,o=this.R,n=this.R_MINOR/o,r=Math.sqrt(1-n*n),s=Math.exp(-t.y/o),a=Math.PI/2-2*Math.atan(s),l=0,c=.1;l<15&&Math.abs(c)>1e-7;l++)e=r*Math.sin(a),e=Math.pow((1-e)/(1+e),r/2),a+=c=Math.PI/2-2*Math.atan(s*e)-a;return new D(a*i,t.x*i/o)}},Ni={LonLat:Bi,Mercator:Zi,SphericalMercator:V},Ri=i({},W,{code:"EPSG:3395",projection:Zi,transformation:function(){var t=.5/(Math.PI*Zi.R);return J(t,.5,-t,.5)}()}),Di=i({},W,{code:"EPSG:4326",projection:Bi,transformation:J(1/180,1,-1/180,.5)}),qi=i({},U,{projection:Bi,transformation:J(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,o=e.lat-t.lat;return Math.sqrt(i*i+o*o)},infinite:!0});U.Earth=W,U.EPSG3395=Ri,U.EPSG3857=K,U.EPSG900913=Y,U.EPSG4326=Di,U.Simple=qi;var Fi=S.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[s(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[s(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",function(){e.off(i,this)},this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ei.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=s(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=s(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&s(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?y(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[s(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=s(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var o in this._zoomBoundLayers){var n=this._zoomBoundLayers[o].options;t=void 0===n.minZoom?t:Math.min(t,n.minZoom),e=void 0===n.maxZoom?e:Math.max(e,n.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Ui=Fi.extend({initialize:function(t,e){var i,o;if(d(this,e),this._layers={},t)for(i=0,o=t.length;i<o;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,o=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,o);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return s(t)}}),Wi=function(t,e){return new Ui(t,e)},Hi=Ui.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Ui.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Ui.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new N;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Vi=function(t,e){return new Hi(t,e)},Gi=M.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){d(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var o=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(o,t),o},_setIconStyles:function(t,e){var i=this.options,o=i[e+"Size"];"number"==typeof o&&(o=[o,o]);var n=j(o),r=j("shadow"===e&&i.shadowAnchor||i.iconAnchor||n&&n.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),r&&(t.style.marginLeft=-r.x+"px",t.style.marginTop=-r.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return kt&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Ji(t){return new Gi(t)}var Ki=Gi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Ki.imagePath||(Ki.imagePath=this._detectIconPath()),(this.options.imagePath||Ki.imagePath)+Gi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=he("div","leaflet-default-icon-path",document.body),e=ce(t,"background-image")||ce(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Yi=di.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new vi(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ge(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ye(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,o=this._marker.options.autoPanSpeed,n=this._marker.options.autoPanPadding,r=Oe(e._icon),s=i.getPixelBounds(),a=i.getPixelOrigin(),l=Z(s.min._subtract(a).add(n),s.max._subtract(a).subtract(n));if(!l.contains(r)){var c=j((Math.max(l.max.x,r.x)-l.max.x)/(s.max.x-l.max.x)-(Math.min(l.min.x,r.x)-l.min.x)/(s.min.x-l.min.x),(Math.max(l.max.y,r.y)-l.max.y)/(s.max.y-l.max.y)-(Math.min(l.min.y,r.y)-l.min.y)/(s.min.y-l.min.y)).multiplyBy(o);i.panBy(c,{animate:!1}),this._draggable._newPos._add(c),this._draggable._startPos._add(c),Le(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=C(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(k(this._panRequest),this._panRequest=C(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,o=Oe(e._icon),n=e._map.layerPointToLatLng(o);i&&Le(i,o),e._latlng=n,t.latlng=n,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){k(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Qi=Fi.extend({options:{icon:new Ki,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){d(this,e),this._latlng=q(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=q(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),o=!1;i!==this._icon&&(this._icon&&this._removeIcon(),o=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),ge(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var n=t.icon.createShadow(this._shadow),r=!1;n!==this._shadow&&(this._removeShadow(),r=!0),n&&(ge(n,e),n.alt=""),this._shadow=n,t.opacity<1&&this._updateOpacity(),o&&this.getPane().appendChild(this._icon),this._initInteraction(),n&&r&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ue(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ue(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Le(this._icon,t),this._shadow&&Le(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(ge(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Yi)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Yi(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&be(this._icon,t),this._shadow&&be(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function $i(t,e){return new Qi(t,e)}var Xi=Fi.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return d(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),to=Xi.extend({options:{fill:!0,radius:10},initialize:function(t,e){d(this,e),this._latlng=q(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=q(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return Xi.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),o=[t+i,e+i];this._pxBounds=new B(this._point.subtract(o),this._point.add(o))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function eo(t,e){return new to(t,e)}var io=to.extend({initialize:function(t,e,o){if("number"==typeof e&&(e=i({},o,{radius:e})),d(this,e),this._latlng=q(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new N(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:Xi.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,o=i.options.crs;if(o.distance===W.distance){var n=Math.PI/180,r=this._mRadius/W.R/n,s=i.project([e+r,t]),a=i.project([e-r,t]),l=s.add(a).divideBy(2),c=i.unproject(l).lat,h=Math.acos((Math.cos(r*n)-Math.sin(e*n)*Math.sin(c*n))/(Math.cos(e*n)*Math.cos(c*n)))/n;(isNaN(h)||0===h)&&(h=r/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(h)?0:l.x-i.project([c,t-h]).x,this._radiusY=l.y-s.y}else{var u=o.unproject(o.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(u).x}this._updateBounds()}});function oo(t,e,i){return new io(t,e,i)}var no=Xi.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){d(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,o=1/0,n=null,r=Ai,s=0,a=this._parts.length;s<a;s++)for(var l=this._parts[s],c=1,h=l.length;c<h;c++){var u=r(t,e=l[c-1],i=l[c],!0);u<o&&(o=u,n=r(t,e,i))}return n&&(n.distance=Math.sqrt(o)),n},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,n,r,s,a=this._rings[0],l=a.length;if(!l)return null;for(t=0,e=0;t<l-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,o=0;t<l-1;t++)if((o+=i=(n=a[t]).distanceTo(r=a[t+1]))>e)return this._map.layerPointToLatLng([r.x-(s=(o-e)/i)*(r.x-n.x),r.y-s*(r.y-n.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=q(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new N,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Ti(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Ti(t),o=0,n=t.length;o<n;o++)i?(e[o]=q(t[o]),this._bounds.extend(e[o])):e[o]=this._convertLatLngs(t[o]);return e},_project:function(){var t=new B;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new I(t,t);this._pxBounds=new B([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var o,n,r=t.length;if(t[0]instanceof D){for(n=[],o=0;o<r;o++)n[o]=this._map.latLngToLayerPoint(t[o]),i.extend(n[o]);e.push(n)}else for(o=0;o<r;o++)this._projectLatlngs(t[o],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,o,n,r,s,a,l=this._parts;for(e=0,o=0,n=this._rings.length;e<n;e++)for(i=0,r=(a=this._rings[e]).length;i<r-1;i++)(s=Ci(a[i],a[i+1],t,i,!0))&&(l[o]=l[o]||[],l[o].push(s[0]),s[1]===a[i+1]&&i!==r-2||(l[o].push(s[1]),o++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,o=t.length;i<o;i++)t[i]=bi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,o,n,r,s,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,r=this._parts.length;i<r;i++)for(o=0,n=(s=(a=this._parts[i]).length)-1;o<s;n=o++)if((e||0!==o)&&wi(t,a[n],a[o])<=l)return!0;return!1}});function ro(t,e){return new no(t,e)}no._flat=Si;var so=no.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,n,r,s,a,l=this._rings[0],c=l.length;if(!c)return null;for(r=s=a=0,t=0,e=c-1;t<c;e=t++)s+=((i=l[t]).x+(o=l[e]).x)*(n=i.y*o.x-o.y*i.x),a+=(i.y+o.y)*n,r+=3*n;return this._map.layerPointToLatLng(0===r?l[0]:[s/r,a/r])},_convertLatLngs:function(t){var e=no.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof D&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){no.prototype._setLatLngs.call(this,t),Ti(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ti(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new I(e,e);if(t=new B(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var o,n=0,r=this._rings.length;n<r;n++)(o=zi(this._rings[n],t,!0)).length&&this._parts.push(o)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,o,n,r,s,a,l,c=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(n=0,a=this._parts.length;n<a;n++)for(r=0,s=(l=(e=this._parts[n]).length)-1;r<l;s=r++)(i=e[r]).y>t.y!=(o=e[s]).y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(c=!c);return c||no.prototype._containsPoint.call(this,t,!0)}});function ao(t,e){return new so(t,e)}var lo=Hi.extend({initialize:function(t,e){d(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o,n=y(t)?t:t.features;if(n){for(e=0,i=n.length;e<i;e++)((o=n[e]).geometries||o.geometry||o.features||o.coordinates)&&this.addData(o);return this}var r=this.options;if(r.filter&&!r.filter(t))return this;var s=co(t,r);return s?(s.feature=yo(t),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=i({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function co(t,e){var i,o,n,r,s="Feature"===t.type?t.geometry:t,a=s?s.coordinates:null,l=[],c=e&&e.pointToLayer,h=e&&e.coordsToLatLng||uo;if(!a&&!s)return null;switch(s.type){case"Point":return ho(c,t,i=h(a),e);case"MultiPoint":for(n=0,r=a.length;n<r;n++)i=h(a[n]),l.push(ho(c,t,i,e));return new Hi(l);case"LineString":case"MultiLineString":return o=po(a,"LineString"===s.type?0:1,h),new no(o,e);case"Polygon":case"MultiPolygon":return o=po(a,"Polygon"===s.type?1:2,h),new so(o,e);case"GeometryCollection":for(n=0,r=s.geometries.length;n<r;n++){var u=co({geometry:s.geometries[n],type:"Feature",properties:t.properties},e);u&&l.push(u)}return new Hi(l);default:throw new Error("Invalid GeoJSON object.")}}function ho(t,e,i,o){return t?t(e,i):new Qi(i,o&&o.markersInheritOptions&&o)}function uo(t){return new D(t[1],t[0],t[2])}function po(t,e,i){for(var o,n=[],r=0,s=t.length;r<s;r++)o=e?po(t[r],e-1,i):(i||uo)(t[r]),n.push(o);return n}function fo(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[h(t.lng,e),h(t.lat,e),h(t.alt,e)]:[h(t.lng,e),h(t.lat,e)]}function mo(t,e,i,o){for(var n=[],r=0,s=t.length;r<s;r++)n.push(e?mo(t[r],e-1,i,o):fo(t[r],o));return!e&&i&&n.push(n[0]),n}function go(t,e){return t.feature?i({},t.feature,{geometry:e}):yo(e)}function yo(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var _o={toGeoJSON:function(t){return go(this,{type:"Point",coordinates:fo(this.getLatLng(),t)})}};function vo(t,e){return new lo(t,e)}Qi.include(_o),io.include(_o),to.include(_o),no.include({toGeoJSON:function(t){var e=!Ti(this._latlngs);return go(this,{type:(e?"Multi":"")+"LineString",coordinates:mo(this._latlngs,e?1:0,!1,t)})}}),so.include({toGeoJSON:function(t){var e=!Ti(this._latlngs),i=e&&!Ti(this._latlngs[0]),o=mo(this._latlngs,i?2:e?1:0,!0,t);return e||(o=[o]),go(this,{type:(i?"Multi":"")+"Polygon",coordinates:o})}}),Ui.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(i){e.push(i.toGeoJSON(t).geometry.coordinates)}),go(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,o=[];return this.eachLayer(function(e){if(e.toGeoJSON){var n=e.toGeoJSON(t);if(i)o.push(n.geometry);else{var r=yo(n);"FeatureCollection"===r.type?o.push.apply(o,r.features):o.push(r)}}}),i?go(this,{geometries:o,type:"GeometryCollection"}):{type:"FeatureCollection",features:o}}});var bo=vo,wo=Fi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=R(e),d(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ge(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ue(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&de(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=R(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:he("img");ge(e,"leaflet-image-layer"),this._zoomAnimated&&ge(e,"leaflet-zoom-animated"),this.options.className&&ge(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onload=n(this.fire,this,"load"),e.onerror=n(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Pe(this._image,i,e)},_reset:function(){var t=this._image,e=new B(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Le(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){be(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&null!=this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),xo=function(t,e,i){return new wo(t,e,i)},Po=wo.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:he("video");if(ge(e,"leaflet-image-layer"),this._zoomAnimated&&ge(e,"leaflet-zoom-animated"),this.options.className&&ge(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onloadeddata=n(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),o=[],r=0;r<i.length;r++)o.push(i[r].src);this._url=i.length>0?o:[e.src]}else{y(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted;for(var s=0;s<this._url.length;s++){var a=he("source");a.src=this._url[s],e.appendChild(a)}}}});function Lo(t,e,i){return new Po(t,e,i)}var Oo=wo.extend({_initImage:function(){var t=this._image=this._url;ge(t,"leaflet-image-layer"),this._zoomAnimated&&ge(t,"leaflet-zoom-animated"),this.options.className&&ge(t,this.options.className),t.onselectstart=c,t.onmousemove=c}});function Co(t,e,i){return new Oo(t,e,i)}var ko=Fi.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){d(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&be(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&be(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(be(this._container,0),this._removeTimeout=setTimeout(n(ue,void 0,this._container),200)):ue(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=q(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&de(this._container),this},bringToBack:function(){return this._map&&fe(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Fi||(i=e,e=t),e instanceof Hi)for(var o in t._layers){e=t._layers[o];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=j(this.options.offset),i=this._getAnchor();this._zoomAnimated?Le(this._container,t.add(i)):e=e.add(t).add(i);var o=this._containerBottom=-e.y,n=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=o+"px",this._container.style.left=n+"px"}},_getAnchor:function(){return[0,0]}}),Eo=ko.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){ko.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Xi||this._source.on("preclick",qe))},onRemove:function(t){ko.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Xi||this._source.off("preclick",qe))},getEvents:function(){var t=ko.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=he("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=he("div",t+"-content-wrapper",e);if(this._contentNode=he("div",t+"-content",i),Ue(e),Fe(this._contentNode),ze(e,"contextmenu",qe),this._tipContainer=he("div",t+"-tip-container",e),this._tip=he("div",t+"-tip",this._tipContainer),this.options.closeButton){var o=this._closeButton=he("a",t+"-close-button",e);o.href="#close",o.innerHTML="&#215;",ze(o,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var o=this.options.maxHeight,n="leaflet-popup-scrolled";o&&t.offsetHeight>o?(e.height=o+"px",ge(t,n)):ye(t,n),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Le(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(ce(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,o=this._containerWidth,n=new I(this._containerLeft,-i-this._containerBottom);n._add(Oe(this._container));var r=t.layerPointToContainerPoint(n),s=j(this.options.autoPanPadding),a=j(this.options.autoPanPaddingTopLeft||s),l=j(this.options.autoPanPaddingBottomRight||s),c=t.getSize(),h=0,u=0;r.x+o+l.x>c.x&&(h=r.x+o-c.x+l.x),r.x-h-a.x<0&&(h=r.x-a.x),r.y+i+l.y>c.y&&(u=r.y+i-c.y+l.y),r.y-u-a.y<0&&(u=r.y-a.y),(h||u)&&t.fire("autopanstart").panBy([h,u])}},_onCloseButtonClick:function(t){this._close(),He(t)},_getAnchor:function(){return j(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Mo=function(t,e){return new Eo(t,e)};ei.mergeOptions({closePopupOnClick:!0}),ei.include({openPopup:function(t,e,i){return t instanceof Eo||(t=new Eo(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Fi.include({bindPopup:function(t,e){return t instanceof Eo?(d(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new Eo(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(He(t),e instanceof Xi?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Ao=ko.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){ko.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){ko.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=ko.prototype.getEvents.call(this);return Lt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){this._contentNode=this._container=he("div","leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,o=this._map,n=this._container,r=o.latLngToContainerPoint(o.getCenter()),s=o.layerPointToContainerPoint(t),a=this.options.direction,l=n.offsetWidth,c=n.offsetHeight,h=j(this.options.offset),u=this._getAnchor();"top"===a?(e=l/2,i=c):"bottom"===a?(e=l/2,i=0):"center"===a?(e=l/2,i=c/2):"right"===a?(e=0,i=c/2):"left"===a?(e=l,i=c/2):s.x<r.x?(a="right",e=0,i=c/2):(a="left",e=l+2*(h.x+u.x),i=c/2),t=t.subtract(j(e,i,!0)).add(h).add(u),ye(n,"leaflet-tooltip-right"),ye(n,"leaflet-tooltip-left"),ye(n,"leaflet-tooltip-top"),ye(n,"leaflet-tooltip-bottom"),ge(n,"leaflet-tooltip-"+a),Le(n,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&be(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return j(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),To=function(t,e){return new Ao(t,e)};ei.include({openTooltip:function(t,e,i){return t instanceof Ao||(t=new Ao(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Fi.include({bindTooltip:function(t,e){return t instanceof Ao?(d(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Ao(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),Lt&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(ge(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(ye(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){this._tooltip&&this._map&&this.openTooltip(t.layer||t.target,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,o=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),o=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(o)}});var So=Gi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var o=j(i.bgPos);e.style.backgroundPosition=-o.x+"px "+-o.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Io(t){return new So(t)}Gi.Default=Ki;var zo=Fi.extend({options:{tileSize:256,opacity:1,updateWhenIdle:vt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){d(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ue(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(de(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof I?t:new I(t,t)},_updateZIndex:function(){this._container&&null!=this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,o=-t(-1/0,1/0),n=0,r=i.length;n<r;n++)e=i[n].style.zIndex,i[n]!==this._container&&e&&(o=t(o,+e));isFinite(o)&&(this.options.zIndex=o+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){be(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var o in this._tiles){var n=this._tiles[o];if(n.current&&n.loaded){var r=Math.min(1,(t-n.loaded)/200);be(n.el,r),r<1?e=!0:(n.active?i=!0:this._onOpaqueTile(n),n.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(k(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=he("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ue(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var o=this._levels[t],n=this._map;return o||((o=this._levels[t]={}).el=he("div","leaflet-tile-container leaflet-zoom-animated",this._container),o.el.style.zIndex=e,o.origin=n.project(n.unproject(n.getPixelOrigin()),t).round(),o.zoom=t,this._setZoomTransform(o,n.getCenter(),n.getZoom()),c(o.el.offsetWidth),this._onCreateLevel(o)),this._level=o,o}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var o=e.coords;this._retainParent(o.x,o.y,o.z,o.z-5)||this._retainChildren(o.x,o.y,o.z,o.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ue(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,o){var n=Math.floor(t/2),r=Math.floor(e/2),s=i-1,a=new I(+n,+r);a.z=+s;var l=this._tileCoordsToKey(a),c=this._tiles[l];return c&&c.active?(c.retain=!0,!0):(c&&c.loaded&&(c.retain=!0),s>o&&this._retainParent(n,r,s,o))},_retainChildren:function(t,e,i,o){for(var n=2*t;n<2*t+2;n++)for(var r=2*e;r<2*e+2;r++){var s=new I(n,r);s.z=i+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<o&&this._retainChildren(n,r,i+1,o))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,o){var n=Math.round(e);n=void 0!==this.options.maxZoom&&n>this.options.maxZoom||void 0!==this.options.minZoom&&n<this.options.minZoom?void 0:this._clampZoom(n),o&&!(this.options.updateWhenZooming&&n!==this._tileZoom)||(this._tileZoom=n,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==n&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var o=this._map.getZoomScale(i,t.zoom),n=t.origin.multiplyBy(o).subtract(this._map._getNewPixelOrigin(e,i)).round();_t?Pe(t.el,n,o):Le(t.el,n)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),o=this._tileZoom,n=this._map.getPixelWorldBounds(this._tileZoom);n&&(this._globalTileRange=this._pxBoundsToTileRange(n)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],o).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],o).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],o).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],o).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),o=e.getZoomScale(i,this._tileZoom),n=e.project(t,this._tileZoom).floor(),r=e.getSize().divideBy(2*o);return new B(n.subtract(r),n.add(r))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var o=this._getTiledPixelBounds(t),n=this._pxBoundsToTileRange(o),r=n.getCenter(),s=[],a=this.options.keepBuffer,l=new B(n.getBottomLeft().subtract([a,-a]),n.getTopRight().add([a,-a]));if(!(isFinite(n.min.x)&&isFinite(n.min.y)&&isFinite(n.max.x)&&isFinite(n.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var c in this._tiles){var h=this._tiles[c].coords;h.z===this._tileZoom&&l.contains(new I(h.x,h.y))||(this._tiles[c].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var u=n.min.y;u<=n.max.y;u++)for(var p=n.min.x;p<=n.max.x;p++){var d=new I(p,u);if(d.z=this._tileZoom,this._isValidTile(d)){var f=this._tiles[this._tileCoordsToKey(d)];f?f.current=!0:s.push(d)}}if(s.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)}),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(p=0;p<s.length;p++)this._addTile(s[p],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var o=this._tileCoordsToBounds(t);return R(this.options.bounds).overlaps(o)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),o=t.scaleBy(i),n=o.add(i);return[e.unproject(o,t.z),e.unproject(n,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new N(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new I(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ue(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ge(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=c,t.onmousemove=c,et&&this.options.opacity<1&&be(t,this.options.opacity),nt&&!rt&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),o=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),n(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&C(n(this._tileReady,this,t,null,r)),Le(r,i),this._tiles[o]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var o=this._tileCoordsToKey(t);(i=this._tiles[o])&&(i.loaded=+new Date,this._map._fadeAnimated?(be(i.el,0),k(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(ge(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?C(this._pruneTiles,this):setTimeout(n(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new I(this._wrapX?l(t.x,this._wrapX):t.x,this._wrapY?l(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new B(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function jo(t){return new zo(t)}var Bo=zo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=d(this,e)).detectRetina&&kt&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),nt||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return ze(i,"load",n(this._tileOnLoad,this,e,i)),ze(i,"error",n(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:kt?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var o=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=o),e["-y"]=o}return g(this._url,i(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(n(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var o=this.options.errorTileUrl;o&&e.getAttribute("src")!==o&&(e.src=o),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom;return this.options.zoomReverse&&(t=this.options.maxZoom-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=c,e.onerror=c,e.complete||(e.src=v,ue(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",v),zo.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==v))return zo.prototype._tileReady.call(this,t,e,i)}});function Zo(t,e){return new Bo(t,e)}var No=Bo.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var o=i({},this.defaultWmsParams);for(var n in e)n in this.options||(o[n]=e[n]);var r=(e=d(this,e)).detectRetina&&kt?2:1,s=this.getTileSize();o.width=s.x*r,o.height=s.y*r,this.wmsParams=o},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version),this.wmsParams[this._wmsVersion>=1.3?"crs":"srs"]=this._crs.code,Bo.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,o=Z(i.project(e[0]),i.project(e[1])),n=o.min,r=o.max,s=(this._wmsVersion>=1.3&&this._crs===Di?[n.y,n.x,r.y,r.x]:[n.x,n.y,r.x,r.y]).join(","),a=Bo.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});function Ro(t,e){return new No(t,e)}Bo.WMS=No,Zo.wms=Ro;var Do=Fi.extend({options:{padding:.1,tolerance:0},initialize:function(t){d(this,t),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ge(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),o=Oe(this._container),n=this._map.getSize().multiplyBy(.5+this.options.padding),r=this._map.project(this._center,e),s=this._map.project(t,e).subtract(r),a=n.multiplyBy(-i).add(o).add(n).subtract(s);_t?Pe(this._container,a,i):Le(this._container,a)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new B(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),qo=Do.extend({getEvents:function(){var t=Do.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Do.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");ze(t,"mousemove",this._onMouseMove,this),ze(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ze(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){k(this._redrawRequest),delete this._ctx,ue(this._container),Be(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Do.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),o=kt?2:1;Le(e,t.min),e.width=o*i.x,e.height=o*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",kt&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Do.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[s(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,o=e.prev;i?i.prev=o:this._drawLast=o,o?o.next=i:this._drawFirst=i,delete t._order,delete this._layers[s(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,o=t.options.dashArray.split(/[, ]+/),n=[];for(i=0;i<o.length;i++){if(e=Number(o[i]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||C(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new B,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var o=this._drawFirst;o;o=o.next)t=o.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,o,n,r,s=t._parts,a=s.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(o=0,n=s[i].length;o<n;o++)l[o?"lineTo":"moveTo"]((r=s[i][o]).x,r.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,o=Math.max(Math.round(t._radius),1),n=(Math.max(Math.round(t._radiusY),1)||o)/o;1!==n&&(i.save(),i.scale(1,n)),i.beginPath(),i.arc(e.x,e.y/n,o,0,2*Math.PI,!1),1!==n&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,o=this._map.mouseEventToLayerPoint(t),n=this._drawFirst;n;n=n.next)(e=n.layer).options.interactive&&e._containsPoint(o)&&("click"!==t.type&&"preclick"===t.type||!this._map._draggableMoved(e))&&(i=e);i&&(Ye(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ye(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,o,r=this._drawFirst;r;r=r.next)(i=r.layer).options.interactive&&i._containsPoint(e)&&(o=i);o!==this._hoveredLayer&&(this._handleMouseOut(t),o&&(ge(this._container,"leaflet-interactive"),this._fireEvent([o],t,"mouseover"),this._hoveredLayer=o)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(n(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;i&&(i.prev=o,o?o.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;o&&(o.next=i,i?i.prev=o:o&&(this._drawLast=o),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Fo(t){return Mt?new qo(t):null}var Uo=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),Wo={_initContainer:function(){this._container=he("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Do.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Uo("shape");ge(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Uo("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ue(e),t.removeInteractiveTarget(e),delete this._layers[s(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,o=t.options,n=t._container;n.stroked=!!o.stroke,n.filled=!!o.fill,o.stroke?(e||(e=t._stroke=Uo("stroke")),n.appendChild(e),e.weight=o.weight+"px",e.color=o.color,e.opacity=o.opacity,e.dashStyle=o.dashArray?y(o.dashArray)?o.dashArray.join(" "):o.dashArray.replace(/( *, *)/g," "):"",e.endcap=o.lineCap.replace("butt","flat"),e.joinstyle=o.lineJoin):e&&(n.removeChild(e),t._stroke=null),o.fill?(i||(i=t._fill=Uo("fill")),n.appendChild(i),i.color=o.fillColor||o.color,i.opacity=o.fillOpacity):i&&(n.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),o=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+o+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){de(t._container)},_bringToBack:function(t){fe(t._container)}},Ho=Tt?Uo:Q,Vo=Do.extend({getEvents:function(){var t=Do.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=Ho("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ho("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ue(this._container),Be(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){Do.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Le(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Ho("path");t.options.className&&ge(e,t.options.className),t.options.interactive&&ge(e,"leaflet-interactive"),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ue(t._path),t.removeInteractiveTarget(t._path),delete this._layers[s(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,$(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),o="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",n=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+2*i+",0 "+o+2*-i+",0 ";this._setPath(t,n)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){de(t._path)},_bringToBack:function(t){fe(t._path)}});function Go(t){return At||Tt?new Vo(t):null}Tt&&Vo.include(Wo),ei.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Fo(t)||Go(t)}});var Jo=so.extend({initialize:function(t,e){so.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=R(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Ko(t,e){return new Jo(t,e)}Vo.create=Ho,Vo.pointsToPath=$,lo.geometryToLayer=co,lo.coordsToLatLng=uo,lo.coordsToLatLngs=po,lo.latLngToCoords=fo,lo.latLngsToCoords=mo,lo.getFeature=go,lo.asFeature=yo,ei.mergeOptions({boxZoom:!0});var Yo=di.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){ze(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Be(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ue(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),te(),ke(),this._startPoint=this._map.mouseEventToContainerPoint(t),ze(document,{contextmenu:He,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=he("div","leaflet-zoom-box",this._container),ge(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new B(this._point,this._startPoint),i=e.getSize();Le(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ue(this._box),ye(this._container,"leaflet-crosshair")),ee(),Ee(),Be(document,{contextmenu:He,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(n(this._resetState,this),0);var e=new N(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ei.addInitHook("addHandler","boxZoom",Yo),ei.mergeOptions({doubleClickZoom:!0});var Qo=di.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),o=e.options.zoomDelta,n=t.originalEvent.shiftKey?i-o:i+o;"center"===e.options.doubleClickZoom?e.setZoom(n):e.setZoomAround(t.containerPoint,n)}});ei.addInitHook("addHandler","doubleClickZoom",Qo),ei.mergeOptions({dragging:!0,inertia:!rt,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var $o=di.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new vi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}ge(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ye(this._map._container,"leaflet-grab"),ye(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=R(this._map.options.maxBounds);this._offsetLimit=Z(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,o=this._draggable._newPos.x,n=(o-e+i)%t+e-i,r=(o+e+i)%t-e-i,s=Math.abs(n+i)<Math.abs(r+i)?n:r;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(t){var e=this._map,i=e.options,o=!i.inertia||this._times.length<2;if(e.fire("dragend",t),o)e.fire("moveend");else{this._prunePositions(+new Date);var n=this._lastPos.subtract(this._positions[0]),r=i.easeLinearity,s=n.multiplyBy(r/((this._lastTime-this._times[0])/1e3)),a=s.distanceTo([0,0]),l=Math.min(i.inertiaMaxSpeed,a),c=s.multiplyBy(l/a),h=l/(i.inertiaDeceleration*r),u=c.multiplyBy(-h/2).round();u.x||u.y?(u=e._limitOffset(u,e.options.maxBounds),C(function(){e.panBy(u,{duration:h,easeLinearity:r,noMoveStart:!0,animate:!0})})):e.fire("moveend")}}});ei.addInitHook("addHandler","dragging",$o),ei.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Xo=di.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),ze(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Be(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,o=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(o,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,o=this._panKeys={},n=this.keyCodes;for(e=0,i=n.left.length;e<i;e++)o[n.left[e]]=[-1*t,0];for(e=0,i=n.right.length;e<i;e++)o[n.right[e]]=[t,0];for(e=0,i=n.down.length;e<i;e++)o[n.down[e]]=[0,t];for(e=0,i=n.up.length;e<i;e++)o[n.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,o=this._zoomKeys={},n=this.keyCodes;for(e=0,i=n.zoomIn.length;e<i;e++)o[n.zoomIn[e]]=t;for(e=0,i=n.zoomOut.length;e<i;e++)o[n.zoomOut[e]]=-t},_addHooks:function(){ze(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Be(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,o=this._map;if(i in this._panKeys)o._panAnim&&o._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=j(e).multiplyBy(3)),o.panBy(e),o.options.maxBounds&&o.panInsideBounds(o.options.maxBounds));else if(i in this._zoomKeys)o.setZoom(o.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!o._popup||!o._popup.options.closeOnEscapeKey)return;o.closePopup()}He(t)}}});ei.addInitHook("addHandler","keyboard",Xo),ei.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var tn=di.extend({addHooks:function(){ze(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Be(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Je(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var o=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(n(this._performZoom,this),o),He(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var o=4*Math.log(2/(1+Math.exp(-Math.abs(this._delta/(4*this._map.options.wheelPxPerZoomLevel)))))/Math.LN2,n=i?Math.ceil(o/i)*i:o,r=t._limitZoom(e+(this._delta>0?n:-n))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});ei.addInitHook("addHandler","scrollWheelZoom",tn),ei.mergeOptions({tap:!0,tapTolerance:15});var en=di.extend({addHooks:function(){ze(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Be(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(We(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new I(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&ge(i,"leaflet-active"),this._holdTimeout=setTimeout(n(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))},this),1e3),this._simulateEvent("mousedown",e),ze(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Be(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&ye(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new I(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});!Lt||Pt&&!ut||ei.addInitHook("addHandler","tap",en),ei.mergeOptions({touchZoom:Lt&&!rt,bounceAtZoomLimits:!0});var on=di.extend({addHooks:function(){ge(this._map._container,"leaflet-touch-zoom"),ze(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ye(this._map._container,"leaflet-touch-zoom"),Be(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(o)._divideBy(2))),this._startDist=i.distanceTo(o),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),ze(document,"touchmove",this._onTouchMove,this),ze(document,"touchend",this._onTouchEnd,this),We(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]),r=i.distanceTo(o)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&r<1||this._zoom>e.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var s=i._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===s.x&&0===s.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),k(this._animRequest);var a=n(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=C(a,this,!0),We(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,k(this._animRequest),Be(document,"touchmove",this._onTouchMove,this),Be(document,"touchend",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});ei.addInitHook("addHandler","touchZoom",on),ei.BoxZoom=Yo,ei.DoubleClickZoom=Qo,ei.Drag=$o,ei.Keyboard=Xo,ei.ScrollWheelZoom=tn,ei.Tap=en,ei.TouchZoom=on,t.version=e,t.Control=oi,t.control=ni,t.Browser=It,t.Evented=S,t.Mixin=mi,t.Util=E,t.Class=M,t.Handler=di,t.extend=i,t.bind=n,t.stamp=s,t.setOptions=d,t.DomEvent=Xe,t.DomUtil=Ie,t.PosAnimation=ti,t.Draggable=vi,t.LineUtil=Ii,t.PolyUtil=ji,t.Point=I,t.point=j,t.Bounds=B,t.bounds=Z,t.Transformation=G,t.transformation=J,t.Projection=Ni,t.LatLng=D,t.latLng=q,t.LatLngBounds=N,t.latLngBounds=R,t.CRS=U,t.GeoJSON=lo,t.geoJSON=vo,t.geoJson=bo,t.Layer=Fi,t.LayerGroup=Ui,t.layerGroup=Wi,t.FeatureGroup=Hi,t.featureGroup=Vi,t.ImageOverlay=wo,t.imageOverlay=xo,t.VideoOverlay=Po,t.videoOverlay=Lo,t.SVGOverlay=Oo,t.svgOverlay=Co,t.DivOverlay=ko,t.Popup=Eo,t.popup=Mo,t.Tooltip=Ao,t.tooltip=To,t.Icon=Gi,t.icon=Ji,t.DivIcon=So,t.divIcon=Io,t.Marker=Qi,t.marker=$i,t.TileLayer=Bo,t.tileLayer=Zo,t.GridLayer=zo,t.gridLayer=jo,t.SVG=Vo,t.svg=Go,t.Renderer=Do,t.Canvas=qo,t.canvas=Fo,t.Path=Xi,t.CircleMarker=to,t.circleMarker=eo,t.Circle=io,t.circle=oo,t.Polyline=no,t.polyline=ro,t.Polygon=so,t.polygon=ao,t.Rectangle=Jo,t.rectangle=Ko,t.Map=ei,t.map=ii;var nn=window.L;t.noConflict=function(){return window.L=nn,this},window.L=t}(x.exports)),x.exports),O=Object.defineProperty,C=Object.defineProperties,k=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,T=(t,e,i)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;function S(t,e={},i){const o=l(e),n=P.Control.extend({onAdd(e){const n=["leaflet-control",o.bar?"leaflet-bar":"",o.addClass].filter(Boolean).join(" "),r=function(t,e={},i){const o=_(e);c(o,e);const n=t.onAdd(i);return n&&o.appendChild(n),o}(t,(s=((t,e)=>{for(var i in e||(e={}))M.call(e,i)&&T(t,i,e[i]);if(E)for(var i of E(e))A.call(e,i)&&T(t,i,e[i]);return t})({},o),C(s,k({addClass:n}))),null!=i?i:e);var s;return o.margin||(r.style.margin="0px"),r},onRemove(e){t.onRemove(null!=i?i:e)}}),r=new n;return c(r,o),r}function I(t,e){const i=function(t){const e=document.createElement("div"),i=new Set;let o=!1;t.getStatus?o=t.getStatus():t.status&&(o=t.status);const n=t.title||"",r=t.html;function s(t){i.forEach(e=>e(o,t))}function a(){n&&(e.title="string"==typeof n?n:o?n.on:n.off,e.setAttribute("aria-label",e.title))}function l(){r&&(e.innerHTML="","string"==typeof r||r instanceof HTMLElement?v(e,r):v(e,o?r.on:r.off))}function c(t,i){t.split(" ").filter(Boolean).forEach(t=>{i?e.classList.add(t):e.classList.remove(t)})}function h(){t.addClassOn&&c(t.addClassOn,o),t.addClassOff&&c(t.addClassOff,!o)}a(),l(),t.addClass&&c(t.addClass,!0),h();const u=t=>{void 0!==t&&(o=t),l(),a(),h()},p=e=>{if(void 0===e&&o&&d.disableOnSecondClick)return;const i=o;if(o=void 0!==e?e:!o,t.onClick){let e;try{e=t.onClick(o)}catch(n){throw o=i,u(),n}Promise.resolve(e).then(()=>{u(),i!==o&&s(d)}).catch(()=>{o=i,u()})}else u(),i!==o&&s(d)},d=b({html:e,onClick:p});return d.onClick=p,d.changeStatus=u,d.getStatus=()=>o,d.switch=t.switch,void 0!==t.disableOnSecondClick&&(d.disableOnSecondClick=t.disableOnSecondClick),d.onStatusChange=t=>(i.add(t),()=>i.delete(t)),d}(t),o=S(i,{bar:!0,margin:t.margin},e);return o.onClick=i.onClick,o.changeStatus=i.changeStatus,o.getStatus=i.getStatus,o.switch=i.switch,Object.defineProperty(o,"disableOnSecondClick",{configurable:!0,get:()=>i.disableOnSecondClick,set:t=>{i.disableOnSecondClick=t}}),o.onStatusChange=i.onStatusChange,o}var z,j=Object.defineProperty,B=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,N=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable,q=(t,e,i)=>e in t?j(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,F=(t,e,i)=>q(t,"symbol"!=typeof e?e+"":e,i);class U{constructor(t,e={}){F(this,"map"),F(this,"controlContainer"),F(this,"targets",new WeakMap),F(this,"ids",new WeakMap),this.map=t,this.controlContainer=this.createControlContainer(e),this.controlContainer.addTo(t.getContainer())}addControl(t,e,i={}){t.options.position=("string"==typeof e?e:"top-left").replace("-",""),this.map.addControl(t);const o=t.getContainer();return o&&(this.controlContainer.append(o,e,i.order,t),this.targets.set(t,o),i.id&&(this.controlContainer.registerIDContainer(i.id,o,t),this.ids.set(t,i.id))),t}removeControl(t){this.map.removeControl(t);const e=this.ids.get(t);e&&(this.controlContainer.unregisterIDContainer(e),this.ids.delete(t));const i=this.targets.get(t);i&&(this.controlContainer.removeTarget(i),this.targets.delete(t))}append(t,e,i=0){this.controlContainer.append(t,e,i)}registerIDContainer(t,e,i){this.controlContainer.registerIDContainer(t,e,i)}unregisterIDContainer(t){this.controlContainer.unregisterIDContainer(t)}detach(){this.controlContainer.detach()}getContainer(){return this.controlContainer.getContainer()}getControlContainer(){return this.controlContainer}createControlContainer(t){const e=this.map,i=e._controlCorners||{},o=(t,e)=>i[t]||this.map.getContainer().querySelector(e)||void 0;return new f((n=((t,e)=>{for(var i in e||(e={}))R.call(e,i)&&q(t,i,e[i]);if(N)for(var i of N(e))D.call(e,i)&&q(t,i,e[i]);return t})({},t),r={map:this.map,container:e._controlContainer,positionContainers:{"top-left":o("topleft",".leaflet-top.leaflet-left"),"top-right":o("topright",".leaflet-top.leaflet-right"),"bottom-left":o("bottomleft",".leaflet-bottom.leaflet-left"),"bottom-right":o("bottomright",".leaflet-bottom.leaflet-right")}},B(n,Z(r))));var n,r}}function W(){}function H(){H.init.call(this)}function V(t){return void 0===t._maxListeners?H.defaultMaxListeners:t._maxListeners}function G(t,e,i,o){var n,r,s,a;if("function"!=typeof i)throw new TypeError('"listener" argument must be a function');if((r=t._events)?(r.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),r=t._events),s=r[e]):(r=t._events=new W,t._eventsCount=0),s){if("function"==typeof s?s=r[e]=o?[i,s]:[s,i]:o?s.unshift(i):s.push(i),!s.warned&&(n=V(t))&&n>0&&s.length>n){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,a=l,"function"==typeof console.warn?console.warn(a):console.log(a)}}else s=r[e]=i,++t._eventsCount;return t}function J(t,e,i){var o=!1;function n(){t.removeListener(e,n),o||(o=!0,i.apply(t,arguments))}return n.listener=i,n}function K(t){var e=this._events;if(e){var i=e[t];if("function"==typeof i)return 1;if(i)return i.length}return 0}function Y(t,e){for(var i=new Array(e);e--;)i[e]=t[e];return i}W.prototype=Object.create(null),H.EventEmitter=H,H.usingDomains=!1,H.prototype.domain=void 0,H.prototype._events=void 0,H.prototype._maxListeners=void 0,H.defaultMaxListeners=10,H.init=function(){this.domain=null,H.usingDomains&&(!z.active||this instanceof z.Domain||(this.domain=z.active)),this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new W,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},H.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},H.prototype.getMaxListeners=function(){return V(this)},H.prototype.emit=function(t){var e,i,o,n,r,s,a,l="error"===t;if(s=this._events)l=l&&null==s.error;else if(!l)return!1;if(a=this.domain,l){if(e=arguments[1],!a){if(e instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=a,e.domainThrown=!1,a.emit("error",e),!1}if(!(i=s[t]))return!1;var h="function"==typeof i;switch(o=arguments.length){case 1:!function(t,e,i){if(e)t.call(i);else for(var o=t.length,n=Y(t,o),r=0;r<o;++r)n[r].call(i)}(i,h,this);break;case 2:!function(t,e,i,o){if(e)t.call(i,o);else for(var n=t.length,r=Y(t,n),s=0;s<n;++s)r[s].call(i,o)}(i,h,this,arguments[1]);break;case 3:!function(t,e,i,o,n){if(e)t.call(i,o,n);else for(var r=t.length,s=Y(t,r),a=0;a<r;++a)s[a].call(i,o,n)}(i,h,this,arguments[1],arguments[2]);break;case 4:!function(t,e,i,o,n,r){if(e)t.call(i,o,n,r);else for(var s=t.length,a=Y(t,s),l=0;l<s;++l)a[l].call(i,o,n,r)}(i,h,this,arguments[1],arguments[2],arguments[3]);break;default:for(n=new Array(o-1),r=1;r<o;r++)n[r-1]=arguments[r];!function(t,e,i,o){if(e)t.apply(i,o);else for(var n=t.length,r=Y(t,n),s=0;s<n;++s)r[s].apply(i,o)}(i,h,this,n)}return!0},H.prototype.on=H.prototype.addListener=function(t,e){return G(this,t,e,!1)},H.prototype.prependListener=function(t,e){return G(this,t,e,!0)},H.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,J(this,t,e)),this},H.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,J(this,t,e)),this},H.prototype.removeListener=function(t,e){var i,o,n,r,s;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(o=this._events))return this;if(!(i=o[t]))return this;if(i===e||i.listener&&i.listener===e)0===--this._eventsCount?this._events=new W:(delete o[t],o.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(n=-1,r=i.length;r-- >0;)if(i[r]===e||i[r].listener&&i[r].listener===e){s=i[r].listener,n=r;break}if(n<0)return this;if(1===i.length){if(i[0]=void 0,0===--this._eventsCount)return this._events=new W,this;delete o[t]}else!function(t,e){for(var i=e,o=i+1,n=t.length;o<n;i+=1,o+=1)t[i]=t[o];t.pop()}(i,n);o.removeListener&&this.emit("removeListener",t,s||e)}return this},H.prototype.off=function(t,e){return this.removeListener(t,e)},H.prototype.removeAllListeners=function(t){var e,i;if(!(i=this._events))return this;if(!i.removeListener)return 0===arguments.length?(this._events=new W,this._eventsCount=0):i[t]&&(0===--this._eventsCount?this._events=new W:delete i[t]),this;if(0===arguments.length){for(var o,n=Object.keys(i),r=0;r<n.length;++r)"removeListener"!==(o=n[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=new W,this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(e)do{this.removeListener(t,e[e.length-1])}while(e[0]);return this},H.prototype.listeners=function(t){var e,i=this._events;return i&&(e=i[t])?"function"==typeof e?[e.listener||e]:function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(e):[]},H.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):K.call(t,e)},H.prototype.listenerCount=K,H.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function Q(t,e,i={}){const o=function(t,e=[]){for(;null!==t;t=Object.getPrototypeOf(t)){const i=Object.getOwnPropertyNames(t);for(let t=0;t<i.length;t++)-1==e.indexOf(i[t])&&e.push(i[t])}return e}(t.prototype);const n=void 0===i.replace||i.replace;e.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(i=>{const r=-1!==o.indexOf(i);if(!n&&!r||n){const o=Object.getOwnPropertyDescriptor(e.prototype,i);o&&Object.defineProperty(t.prototype,i,o)}})})}function $(t,e=10){let i;function o(...n){o.clear(),i=setTimeout(()=>{i=null,t.apply(this,n)},e)}return o.clear=function(){i&&(clearTimeout(i),i=null)},o}function X(t,e,i=!1){let o=t;const n=e,r=Array.isArray(n);let s=r&&[]||{};return r&&Array.isArray(n)?i?(o=o||[],s=s.concat(o),n.forEach((t,e)=>{void 0===s[e]?s[e]=t:"object"==typeof t?s[e]=X(o[e],t,i):-1===o.indexOf(t)&&s.push(t)})):s=n:(o&&"object"==typeof o&&Object.keys(o).forEach(function(t){s[t]=o[t]}),Object.keys(n).forEach(function(t){s[t]="object"==typeof n[t]&&n[t]&&"object"==typeof o[t]&&"object"==typeof n[t]?X(o[t],n[t],i):n[t]})),s}function tt(t){return null!=t}function et(t){return"string"==typeof t?!!t:tt(t)}function it(t){if(!t.lngLat&&t.latLng){t.lngLat=[t.latLng.lng,t.latLng.lat]}return t}function ot(t,e){e=e>85.06?85.06:e<-85.06?-85.06:e;const i=20037508.34*t/180;let o=Math.log(Math.tan((90+e)*Math.PI/360))/(Math.PI/180);return o=20037508.34*o/180,[i,o]}function nt(t){return{type:"Polygon",coordinates:[rt(t)]}}function rt(t){const e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}const st=Math.PI/180,at=180/Math.PI;function lt(t,e,i=10,o=6){const n=i/6371*at,r=n/Math.cos(e*st),s=[];for(let a=0;a<o+1;a++){const i=Math.PI*(a/(o/2)),l=t+r*Math.cos(i),c=e+n*Math.sin(i);s.push([l,c])}return s}function ct(t,e,i,o){if(t instanceof Array)return e instanceof Array&&e.sort().join("")===t.sort().join("");if(t instanceof Date)return e instanceof Date&&""+t==""+e;if(t instanceof Function){if(!(e instanceof Function))return!1}else if(t instanceof Object)return e instanceof Object&&(t===i?e===o:ht(t,e));return t===e}function ht(t,e){const i=Object.keys(t).sort(),o=Object.keys(e).sort();if(i.length!==o.length)return!1;if(i.join("")!==o.join(""))return!1;for(let n=0;n<i.length;n++){if(!ct(t[i[n]],e[o[n]],t,e))return!1}return!0}function ut(t){const e={};return Object.keys(t).forEach(i=>{t[i]instanceof Array||t[i]!==Object(t[i])?void 0!==t[i]&&(e[i]=t[i]):e[i]=ut(t[i])}),e}function pt(t){return"[object Object]"===Object.prototype.toString.call(t)}function dt(t){return t.replace(/([^:]\/)\/+/g,"$1")}function ft(t,e){const i=new URL(t),o=new URLSearchParams(i.search);Object.entries(e).forEach(([t,e])=>{void 0===e?o.delete(t):o.set(t,e)}),o.set("timestamp",String((new Date).getTime()));const n=[...o.entries()].map(([t,e])=>`${t}=${e}`).join("&");return`${i.origin}${i.pathname}?${n}`}function mt(t){const e=t.getNorthEast(),i=t.getSouthWest();return[i.lng,i.lat,e.lng,e.lat]}function gt(t){const e={};for(let o=0;o<t.length;o++)e[t[o]]=1+(e[t[o]]||0);let i="";for(const o in e){e[o]>(i?e[i]:0)&&(i=o)}return i}const yt={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon",GeometryCollection:"polygon"},_t={stroke:!1,opacity:1},vt={};for(const L in yt){const t=yt[L],e=vt[t]||[];e.push(L),vt[t]=e}function bt(t,e){return-1!==(vt[e]||[]).indexOf(t)}function wt(t){const e=new P.GeoJSON;return(Array.isArray(t)?t:[t]).forEach(t=>e.addData(t)),e.getBounds()}function xt(t){return{getBounds:()=>function(t){return mt(wt(t))}(t),getCenter:()=>function(t){const{lat:e,lng:i}=wt(t).getCenter();return[i,e]}(t)}}var Pt=Object.defineProperty,Lt=(t,e,i)=>((t,e,i)=>e in t?Pt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Ot{constructor(t,e){if(Lt(this,"map",t),Lt(this,"options",e),Lt(this,"layer"),Lt(this,"pane","order-0"),void 0!==e.order){const i="order-"+e.order;let o=t.getPane(i);o||(o=t.createPane(i)),o.style.zIndex=String(Math.round(100*e.order)),this.pane=i}}addLayer(t){Object.assign(this.options,t)}}function Ct(t){const e=t.containerPoint,i=t.latlng,{lat:o,lng:n}=i;return{latLng:i,lngLat:[n,o],pixel:{left:e.x,top:e.y},source:t}}var kt=Object.defineProperty,Et=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,Tt=(t,e,i)=>e in t?kt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;function St({layer:t,source:e}){const i=e.target.feature;return((t,e)=>{for(var i in e||(e={}))Mt.call(e,i)&&Tt(t,i,e[i]);if(Et)for(var i of Et(e))At.call(e,i)&&Tt(t,i,e[i]);return t})({layer:t,feature:i,event:Ct(e),source:e},xt(i))}var It=Object.defineProperty,zt=Object.getOwnPropertySymbols,jt=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,Zt=(t,e,i)=>e in t?It(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Nt=(t,e)=>{for(var i in e||(e={}))jt.call(e,i)&&Zt(t,i,e[i]);if(zt)for(var i of zt(e))Bt.call(e,i)&&Zt(t,i,e[i]);return t},Rt=(t,e,i)=>Zt(t,"symbol"!=typeof e?e+"":e,i);class Dt{constructor(t){Rt(this,"layer"),Rt(this,"_onclick"),Rt(this,"_ondblclick"),Rt(this,"_mouseout"),Rt(this,"_mouseover"),this.layer=t}handleMouseEvents(t){const{onClick:e,onDoubleClick:i,onLayerClick:o,onMouseOut:n,onMouseOver:r}=this.layer.options,s=e||o;s&&(this._onclick=e=>{const i=!!this.layer._getSelected(t);s(Nt({selected:i},this._createMouseEvent(e)))},t.on("click",this._onclick,this)),i&&(this._ondblclick=e=>{P.DomEvent.stopPropagation(e);const o=!!this.layer._getSelected(t);i(Nt({selected:o},this._createMouseEvent(e)))},t.on("dblclick",this._ondblclick,this)),n&&(this._mouseout=t=>{n(this._createMouseEvent(t))},t.on("mouseout",this._mouseout,this)),r&&(this._mouseover=t=>{r(this._createMouseEvent(t))},t.on("mouseover",this._mouseover,this))}stopMouseEvents(t){this._mouseover&&t.off("mouseover",this._mouseover,this),this._mouseout&&t.off("mouseout",this._mouseout,this),this._onclick&&t.off("click",this._onclick,this)}_createMouseEvent(t){return St({layer:this.layer,source:t})}}function qt(t){return(e,i)=>{const o=e.map(t=>t());return t(o,i)}}const Ft={"!":qt(function([t]){return!t}),"!=":qt(function([t,e]){return t!==e}),"<":qt(function([t,e]){return t<e}),"<=":qt(function([t,e]){return t<=e}),"==":qt(function([t,e]){return t===e}),">":qt(function([t,e]){return t>e}),">=":qt(function([t,e]){return t>=e}),coalesce:t=>{for(let e=0;e<t.length;e++){const i=t[e]();if(null!=i)return i}return null},all:t=>{for(let e=0;e<t.length;e++){if(!t[e]())return!1}return!0},any:t=>{for(let e=0;e<t.length;e++){if(t[e]())return!0}return!1},case:t=>{if(t.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');if(t.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(let e=0;e<t.length-1;e+=2){const i=t[e](),o=t[e+1]();if(i)return o}return(0,t[t.length-1])()},match:t=>{const[e,...i]=t,o=e(),n=i.splice(-1,i.length%2)[0];for(let r=0;r<i.length-1;r+=2){if(i[r]()===o)return i[r+1]()}return n()}},Ut={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Wt(t){if("string"==typeof(i=t)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(i))return Ht(t);if("string"==typeof(e=t)&&e in Ut)return function(t){return Ht(Ut[t])}(t);if(function(t){return"string"==typeof t&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(t)}(t))return function(t){const e=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;let i;if(i=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10)];if(i=t.match(e))return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10),parseFloat(i[4])];throw new Error(`The '${t}' Is not valid rgb`)}(t);if(function(t){if("object"==typeof t&&null!==t)return"r"in t&&"g"in t&&"b"in t&&(!("a"in t)||"number"==typeof t.a&&t.a>=0&&t.a<=1);return!1}(t))return function({r:t,g:e,b:i,a:o}){return[t,e,i,...void 0!==o?[o]:[]]}(t);var e,i;throw new Error(`The '${t}' cannot be converted to color`)}function Ht(t){let e;if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)];if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)/255];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)/255];throw new Error(`The '${t}' Is not valid hex`)}function Vt(t,e,i,o,n){if("number"==typeof i&&"number"==typeof n)return i+(t-e)/(o-e)*(n-i);try{const r=Wt(i),s=Wt(n);return function(t){return`rgb(${t.join(",")})`}(r.map((i,n)=>Math.ceil(Vt(t,e,i,o,s[n]))))}catch(r){console.log(r)}throw new Error("Unsupported output type for linear interpolation.")}const Gt={step:t=>{const[e,i,...o]=t,n=e();if("number"!=typeof n)return i();for(let r=0;r<o.length-2;r+=2){const t=o[r](),e=o[r+1](),i=o[r+2]();if(n>=t&&n<i)return e}return n>=o[o.length-2]()?o[o.length-1]():i()},interpolate:([t,e,...i])=>{if(i.length<2)throw new Error("At least two stops are required");if(i.length<2||i.length%2!=0)throw new Error("Invalid stops provided.");const o=e();if("number"!=typeof o)throw new Error("Input must be a number.");const n=t();for(let r=0;r<i.length-2;r+=2){const t=i[r](),e=i[r+1](),s=i[r+2](),a=i[r+3]();if(o>=t&&o<=s&&"linear"===n[0])return Vt(o,t,e,s,a)}throw new Error("Invalid interpolation type.")}};const Jt={get:qt(function([t,e],i){const o=e||i;return o&&"object"==typeof o&&t in o?o[t]:null}),length:qt(([t])=>{if("string"==typeof t||Array.isArray(t))return t.length}),at:qt(function([t,e]){return e[t]}),has:qt(function([t,e],i){const o=e||i;return!(!o||"object"!=typeof o||!(t in o))}),in:qt(function([t,e]){if("string"==typeof e)return e.includes(String(t));if(Array.isArray(e))return e.includes(t);throw new Error(`Invalid input type for 'in'. Expected string or array, got ${typeof e}.`)}),"index-of":qt(function([t,e,i]){if("string"==typeof e)return e.indexOf(String(t),i);if(Array.isArray(e))return e.indexOf(t,i);throw new Error(`Invalid input type for 'index-of'. Expected string or array, got ${typeof e}.`)}),slice:qt(function(t){const[e,i,o]=t;if("string"==typeof e)return e.slice(i,o);if(Array.isArray(e))return e.slice(i,o);throw new Error(`Invalid input type for 'slice'. Expected string or array, got ${typeof e}.`)})},Kt={"+":qt(t=>t.reduce((t,e)=>t+e,0)),"-":qt(t=>t.reduce((t,e)=>t-e)),"*":qt(t=>t.reduce((t,e)=>t*e,1)),"/":qt(t=>t.reduce((t,e)=>t/e)),"%":qt(t=>t[0]%t[1]),"^":qt(t=>Math.pow(t[0],t[1])),abs:qt(t=>Math.abs(t[0])),acos:qt(t=>Math.acos(t[0])),asin:qt(t=>Math.asin(t[0])),atan:qt(t=>Math.atan(t[0])),ceil:qt(t=>Math.ceil(t[0])),cos:qt(t=>Math.cos(t[0])),e:()=>Math.E,floor:qt(t=>Math.floor(t[0])),ln:qt(t=>Math.log(t[0])),ln2:()=>Math.LN2,log10:qt(t=>Math.log10(t[0])),log2:qt(t=>Math.log2(t[0])),max:qt(t=>Math.max(...t)),min:qt(t=>Math.min(...t)),pi:()=>Math.PI,round:qt(t=>Math.round(t[0])),sin:qt(t=>Math.sin(t[0])),sqrt:qt(t=>Math.sqrt(t[0])),tan:qt(t=>Math.tan(t[0]))},Yt={concat:qt(t=>t.reduce((t,e)=>String(t)+String(e),"")),downcase:qt(t=>String(t[0]).toLowerCase()),upcase:qt(t=>String(t[0]).toUpperCase())},Qt=(t,e,i)=>{try{const o=t(e,i);if(void 0!==o)return o}catch(o){}};function $t(t){return(e,i)=>{for(const o of e){const e=Qt(t,o,i);if(void 0!==e)return e}throw new Error("Received a mismatched type")}}const Xt={array:qt(t=>{const[e,i,o]=t;let n,r,s;if("string"==typeof e&&["string","number","boolean"].includes(e)?(n=e,"number"==typeof i?(r=i,s=o):s=i):Array.isArray(e)&&(s=e),!Array.isArray(s))throw new Error("Expected an array");if(n&&!s.every(t=>typeof t===n))throw new Error(`Expected all items in array to be of type ${n}`);if(r&&s.length!==r)throw new Error(`Expected array of length ${r}`);return s}),boolean:qt($t(t=>"boolean"==typeof t?t:void 0)),literal:qt(([t])=>t),number:qt($t(t=>"number"==typeof t?t:void 0)),object:qt($t(t=>null===t||"object"!=typeof t||Array.isArray(t)?void 0:t)),string:qt($t(t=>"string"==typeof t?t:void 0)),"to-boolean":qt($t(Boolean)),"to-number":qt($t(Number)),"to-string":qt($t(String)),typeof:qt(([t])=>function(t){if(null===t)return"null";switch(typeof t){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":if(Array.isArray(t)){let e="value";return t.every(t=>"number"==typeof t)?e="number":t.every(t=>"string"==typeof t)?e="string":t.every(t=>"boolean"==typeof t)&&(e="boolean"),`array<${e}, ${t.length}>`}return"object";default:return"undefined"}}(t))};var te=Object.defineProperty,ee=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable,ne=(t,e,i)=>e in t?te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,re=(t,e)=>{for(var i in e||(e={}))ie.call(e,i)&&ne(t,i,e[i]);if(ee)for(var i of ee(e))oe.call(e,i)&&ne(t,i,e[i]);return t};function se(t){if(Array.isArray(t)){const[e,...i]=t;return"string"==typeof e&&"literal"!==e&&e in ae&&i.length>0}return!1}const ae=re(re(re(re(re(re({},Kt),Xt),Yt),Jt),Ft),Gt);function le(t,e={}){const[i,...o]=t,n=ae[i];if(n)return n(o.map(t=>()=>se(t)?le(t,e):t),e);throw new Error(`Expression "${i}" is not supported.`)}var ce=Object.defineProperty,he=Object.getOwnPropertySymbols,ue=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,de=(t,e,i)=>e in t?ce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,fe=(t,e)=>{for(var i in e||(e={}))ue.call(e,i)&&de(t,i,e[i]);if(he)for(var i of he(e))pe.call(e,i)&&de(t,i,e[i]);return t};function me(t){return e=>{const i=e.properties;return!!i&&le(t,i)}}const ge=["iconSize","iconAnchor"];var ye=Object.defineProperty,_e=Object.getOwnPropertySymbols,ve=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,we=(t,e,i)=>e in t?ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;function xe(t,e,i){if((e=String(e))===(t=String(t)))return!0;if(i&&e.toUpperCase()===t.toUpperCase())return!0;const o=`^${n=e,n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}$`.replace(/%/g,".*").replace("_",".");var n;return null!==new RegExp(o,i?"i":"").exec(t)}const Pe={gt:(t,e)=>t>e,lt:(t,e)=>t<e,ge:(t,e)=>t>=e,le:(t,e)=>t<=e,eq:(t,e)=>t===e,ne:(t,e)=>t!==e,in:(t,e)=>-1!==e.indexOf(t),notin:(t,e)=>-1===e.indexOf(t),like:(t,e)=>xe(t,e),ilike:(t,e)=>xe(t,e,!0)};function Le(t,e){const i=((t,e)=>{for(var i in e||(e={}))ve.call(e,i)&&we(t,i,e[i]);if(_e)for(var i of _e(e))be.call(e,i)&&we(t,i,e[i]);return t})({},t.properties);return!!i&&(i.$id=t.id,Oe(i,e))}function Oe(t,e){const i="string"==typeof e[0]?e[0]:"all",o=e=>{if(3===(i=e).length&&"string"==typeof i[0]&&"string"==typeof i[1]){const[i,o,n]=e,r=Pe[o];if(r){if(("like"===o||"ilike"===o)&&"string"==typeof i){let e="";const o=i.replace(/^%?(\w+)%?$/,(o,r)=>(e=t[r],i.replace(r,n)));return r(e,o)}return r(t[i],n)}return!1}return Oe(t,e);var i},n=e.filter(t=>Array.isArray(t));return"any"===i?n.some(o):n.every(o)}function Ce(t){return"[object Object]"===Object.prototype.toString.call(t)}function ke(t){return"function"==typeof t}var Ee=Object.defineProperty,Me=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,Te=Object.prototype.propertyIsEnumerable,Se=(t,e,i)=>e in t?Ee(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ie=(t,e)=>{for(var i in e||(e={}))Ae.call(e,i)&&Se(t,i,e[i]);if(Me)for(var i of Me(e))Te.call(e,i)&&Se(t,i,e[i]);return t};function ze(t){let e={};const i=[];for(const o of t)o&&(Array.isArray(o)?i.push(o):e=o);return t=>{const o=i.find(e=>Le(t,e[0]));return o?Ie(Ie({},e),o[1]):e}}function je({paint:t,defaultPaint:e}){const i=function(t){let e=!1;const i={};for(const o in t)if(-1===ge.indexOf(o)){const n=o,r=t[n];se(r)&&(e=!0,i[n]=me(r))}if(e)return e=>{const o={};for(const t in i)o[t]=i[t](e);return fe(fe({},t),o)}}(t);if(i){const o=t=>Ze({paint:i(t),defaultPaint:e});return o.paint=Be({paint:t,defaultPaint:e}),o}return Be({paint:t,defaultPaint:e})}function Be({paint:t,defaultPaint:e}){var i;let o=Ie({},e);return o=Ie(Ie({},o),t),o.fill=null==(i=o.fill)||i,o.stroke=void 0!==o.stroke?o.stroke:!o.fill||!(!o.strokeColor&&!o.strokeOpacity),o}function Ze({paint:t,defaultPaint:e,getPaintFunctions:i}){if(!t)throw new Error("paint is empty");let o=Ie({},e);if(ke(t)){const o=o=>{const n=Ze({paint:t(o),defaultPaint:e,getPaintFunctions:i});return n.type=t.type,n};return o.type=t.type,o}if(function(t){return!!Array.isArray(t)}(t))return o=>Ze({paint:ze(t)(o),defaultPaint:e,getPaintFunctions:i});if("get-paint"===t.type){const n=function(t,e){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&e){const i=e[t.from];if(i)return i(t.options)}}(t,i);n&&(o=Ze({paint:n,defaultPaint:e,getPaintFunctions:i}))}else{if("icon"===t.type)return t;o=je({paint:t,defaultPaint:e})}return ke(o)||("color"in o&&(o.strokeColor||(o.strokeColor=o.color),o.fillColor||(o.fillColor=o.color)),"opacity"in o&&(void 0===o.strokeOpacity&&(o.strokeOpacity=o.opacity),void 0===o.fillOpacity&&(o.fillOpacity=o.opacity))),o}var Ne=Object.defineProperty,Re=Object.defineProperties,De=Object.getOwnPropertyDescriptors,qe=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,We=(t,e,i)=>e in t?Ne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,He=(t,e)=>{for(var i in e||(e={}))Fe.call(e,i)&&We(t,i,e[i]);if(qe)for(var i of qe(e))Ue.call(e,i)&&We(t,i,e[i]);return t};class Ve{constructor(t){var e;We(this,"layer"+"",e),this.layer=t}setPaintEachLayer(t){this.layer._layers.forEach(e=>{this.setPaint(e,t)})}setPaint(t,e){let i;const{layer:o,feature:n}=t;if(o&&n&&(ke(e)?i=e(n):Ce(e)&&(i=e),i))if("point"===this.layer.type&&"icon"===i.type){const t=o,e=this._createDivIcon(i);setTimeout(()=>{t.setIcon(e)},10)}else"setStyle"in o&&o.setStyle(this.preparePaint(i))}preparePaint(t){if("get-paint"!==t.type){const e="line"===this.layer.type?[["color","strokeColor"],["opacity","strokeOpacity"],["weight","weight"]]:[["color","strokeColor"],["opacity","strokeOpacity"],["stroke","stroke"],["fillColor","fillColor"],["fillOpacity","fillOpacity"],["fill","fill"],["weight","weight"]],i={};"radius"in t&&"number"==typeof t.radius&&(i.radius=t.radius);for(const[o,n]of e){const e=this.layer.options.opacity;let r=t[n];tt(e)&&-1!==n.toLowerCase().indexOf("opacity")&&(r=Number(r)*e),void 0!==r&&Object.defineProperty(i,o,{enumerable:!0,value:r})}return i}return _t}_createDivIcon(t){const e=t,{html:i,rotate:o,className:n}=e,r=((t,e)=>{var i={};for(var o in t)Fe.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&qe)for(var o of qe(t))e.indexOf(o)<0&&Ue.call(t,o)&&(i[o]=t[o]);return i})(e,["html","rotate","className"]),s=document.createElement("div");n&&(s.className=n),o&&(s.style.transform=`rotateZ(${o}deg)`),i&&(s.innerHTML=i);var a;return new P.DivIcon((a=He({className:""},r),Re(a,De({html:s}))))}createPaintToLayer(t){if(t&&t.type)if("icon"===t.type){if(t.className||t.html)return(e,i)=>{const o=this._createDivIcon(t);return new P.Marker(i,{icon:o})}}else if("pin"===t.type)return(t,e)=>new P.Marker(e);return(e,i)=>new P.CircleMarker(i,this.preparePaint(He(He({},_t),t)))}createPaintOptions(t){const e={},i=this.preparePaint(t);return t&&(e.style=()=>i),"point"===this.layer.type?e.pointToLayer=this.createPaintToLayer(t):"line"===this.layer.type&&(i.stroke=!0),e}}var Ge=Object.defineProperty,Je=Object.defineProperties,Ke=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,Xe=(t,e,i)=>e in t?Ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ti=(t,e)=>{for(var i in e||(e={}))Qe.call(e,i)&&Xe(t,i,e[i]);if(Ye)for(var i of Ye(e))$e.call(e,i)&&Xe(t,i,e[i]);return t},ei=(t,e)=>Je(t,Ke(e)),ii=(t,e,i)=>Xe(t,"symbol"!=typeof e?e+"":e,i);const oi={};var ni=Object.defineProperty,ri=Object.getOwnPropertySymbols,si=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable,li=(t,e,i)=>e in t?ni(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ci=(t,e)=>{for(var i in e||(e={}))si.call(e,i)&&li(t,i,e[i]);if(ri)for(var i of ri(e))ai.call(e,i)&&li(t,i,e[i]);return t};function hi(t){return!!t&&Object.keys(t).length>0}function ui(t){if(!t)return;const e=ci({},t);return function(t){return!(!t||!(hi(t.headers)||void 0!==t.credentials||void 0!==t.cache&&"default"!==t.cache))}(e)?e:void 0}function pi(t){const e=null==t?void 0:t.request,i=ci(ci({},(null==t?void 0:t.headers)||{}),(null==e?void 0:e.headers)||{}),o={};return hi(i)&&(o.headers=i),(null==t?void 0:t.withCredentials)&&(o.credentials="include"),void 0!==(null==e?void 0:e.credentials)&&(o.credentials=e.credentials),void 0!==(null==e?void 0:e.cache)&&(o.cache=e.cache),ui(o)}function di(t){const e={};for(let o=0;o<t.length;o++)e[t[o]]=1+(e[t[o]]||0);let i;for(const o in e){e[o]>((void 0!==i?e[i]:0)||0)&&(i=o)}return i}const fi={polygon:"path",line:"path",point:"circle"},mi={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon"};function gi(t){if(t.data){const e=mi[function(t){let e;e="FeatureCollection"===t.type?di(t.features.map(t=>t.geometry.type)):"GeometryCollection"===t.type?di(t.geometries.map(t=>t.type)):"Feature"===t.type?t.geometry.type:t.type;return e}(t.data)],i=t.paint;i&&Ce(i)&&(i.type=i.type?i.type:"polygon"===e||"line"===e?"path":"html"in i||"className"in i?"icon":fi[e]),t.type=t.type||e}return t}var yi=Object.defineProperty,_i=(t,e,i)=>((t,e,i)=>e in t?yi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class vi{constructor(){_i(this,"backspace",8),_i(this,"tab",9),_i(this,"enter",13),_i(this,"shift",16),_i(this,"ctrl",17),_i(this,"alt",18),_i(this,"pause/break",19),_i(this,"caps_lock",20),_i(this,"escape",27),_i(this,"page_up",33),_i(this,"page_down",34),_i(this,"end",35),_i(this,"home",36),_i(this,"left_arrow",37),_i(this,"up_arrow",38),_i(this,"right_arrow",39),_i(this,"down_arrow",40),_i(this,"insert",45),_i(this,"delete",46),_i(this,"left_window_key",91),_i(this,"right_window_key",92),_i(this,"select_key",93),_i(this,"numpad_0",96),_i(this,"numpad_1",97),_i(this,"numpad_2",98),_i(this,"numpad_3",99),_i(this,"numpad_4",100),_i(this,"numpad_5",101),_i(this,"numpad_6",102),_i(this,"numpad_7",103),_i(this,"numpad_8",104),_i(this,"numpad_9",105),_i(this,"multiply",106),_i(this,"add",107),_i(this,"subtract",109),_i(this,"decimal_point",110),_i(this,"divide",111),_i(this,"f1",112),_i(this,"f2",113),_i(this,"f3",114),_i(this,"f4",115),_i(this,"f5",116),_i(this,"f6",117),_i(this,"f7",118),_i(this,"f8",119),_i(this,"f9",120),_i(this,"f10",121),_i(this,"f11",122),_i(this,"f12",123),_i(this,"num_lock",144),_i(this,"scroll_lock",145),_i(this,"semi-colon",186),_i(this,"equal_sign",187),_i(this,",",188),_i(this,"-",189),_i(this,".",190),_i(this,"/",191),_i(this,"`",192),_i(this,"[",219),_i(this,"\\",220),_i(this,"]",221),_i(this,"'",222)}}var bi=Object.defineProperty,wi=(t,e,i)=>((t,e,i)=>e in t?bi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);var xi=Object.defineProperty,Pi=(t,e,i)=>((t,e,i)=>e in t?xi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Li{constructor(t,e){Pi(this,"webMap",t),Pi(this,"name"),Pi(this,"event"),Pi(this,"value"),e&&(e.value&&this.setValue(e.value),e.name&&(this.name=e.name),e.event&&(this.event="string"==typeof e.event?[e.event]:e.event))}getValue(){return this.value}setValue(t){this.value=t}}var Oi=Object.defineProperty,Ci=(t,e,i)=>((t,e,i)=>e in t?Oi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class ki extends Li{constructor(){super(...arguments),Ci(this,"name","bounds"),Ci(this,"event",["moveend"])}getValue(){return this.webMap.getBounds()}setValue(t){this.webMap.setView({bounds:t})}toString(){const t=this.getValue();if(t)return t.slice(0,4).map(t=>t.toFixed(5)).join("_")}parse(t){return t.split("_").map(Number)}}var Ei=Object.defineProperty,Mi=(t,e,i)=>((t,e,i)=>e in t?Ei(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Ai extends Li{constructor(){super(...arguments),Mi(this,"name","center"),Mi(this,"event",["moveend"])}getValue(){return this.webMap.getCenter()}setValue(t){this.webMap.setCenter(t)}toString(){const t=this.getValue();if(t){const e=t.map(t=>t.toFixed(5));return e[0]+"_"+e[1]}return""}parse(t){return t.split("_").map(Number)}}var Ti=Object.defineProperty,Si=(t,e,i)=>((t,e,i)=>e in t?Ti(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Ii extends Li{constructor(){super(...arguments),Si(this,"name","zoom"),Si(this,"event",["zoomend"])}getValue(){const t=this.webMap.getZoom();return void 0!==t?Math.round(t):void 0}setValue(t){this.webMap.setZoom(t)}toString(){return String(this.getValue())}parse(t){return Number(t)}}var zi=Object.defineProperty,ji=(t,e,i)=>((t,e,i)=>e in t?zi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Bi=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});let Zi=0;const Ni={minZoom:0,maxZoom:22,paint:{color:"#0000ff",opacity:.4,strokeOpacity:1,stroke:!0,radius:8,weight:1},selectedPaint:{color:"#00008b",opacity:.4,strokeOpacity:1,stroke:!0,radius:12,weight:1},create:!0},Ri=class t{constructor(e){ji(this,"options",Ni),ji(this,"emitter",new H),ji(this,"keys",t.keys),ji(this,"mapAdapter"),ji(this,"runtimeParams",[]),ji(this,"getPaintFunctions",t.getPaintFunctions),ji(this,"mapStateItems",[Ai,Ii,ki]),ji(this,"id",Zi++),ji(this,"mapState",[]),ji(this,"_initMapState",{}),ji(this,"_starterKits"),ji(this,"_extent"),ji(this,"_eventsStatus",{}),ji(this,"_coordFromMapClickAbort"),ji(this,"_mapEvents",{}),this.mapAdapter=e.mapAdapter,this._starterKits=e.starterKits||[],e&&(this.options=X(Ni||{},e)),this.options.runtimeParams&&(this.runtimeParams=this.options.runtimeParams),this._addEventsListeners(),this.options.tileJson&&this._setTileJsonOptions(this.options.tileJson),this.options.create&&this.create()}getId(){return this.id}create(){return Bi(this,null,function*(){return this.getEventStatus("create")||(yield this._setInitMapState(this.mapStateItems),yield this._setupMap(),this._emitStatusEvent("create",this)),this})}setRuntimeParams(t){this.runtimeParams.push(t)}destroy(){this._removeEventListeners(),function(t){for(const e in t)delete t[e]}(this._emitStatusEvent),this.mapAdapter.destroy&&this.mapAdapter.destroy()}mapStateWithFunc(t){const e={};return this.mapState.forEach(i=>{e[i.name]=t(i)}),e}getStateAsString(){return this.mapStateWithFunc(t=>t.toString())}getState(){return this.mapStateWithFunc(t=>t.getValue())}getRuntimeParams(){const t={};return this.mapState.forEach(e=>{for(const i of this.runtimeParams){const o=i.get(e.name);if(void 0!==o){t[e.name]=e.parse(o);break}}}),t}getContainer(){if(this.mapAdapter.getContainer)return this.mapAdapter.getContainer();if(this.options.target){if(this.options.target instanceof HTMLElement)return this.options.target;if("string"==typeof this.options.target){const t=document.getElementById(this.options.target);if(t)return t}}}setCursor(t){this.onLoad().then(()=>{this.mapAdapter.setCursor&&this.mapAdapter.setCursor(t)})}getCursor(){if(this.mapAdapter.getCursor)return this.mapAdapter.getCursor();const t=this.getContainer();return t?t.style.cursor:void 0}setCenter(t){return this.mapAdapter.setCenter(t),this}getCenter(){return this.mapAdapter.getCenter()}getBounds(){if(this.mapAdapter.getBounds)return this.mapAdapter.getBounds()}getBoundsPolygon(){const t=this.getBounds();if(t){return{type:"Feature",properties:{},geometry:nt(t)}}}setZoom(t){return this.mapAdapter.setZoom(t),this}getZoom(){const t=this.mapAdapter.getZoom();if("number"==typeof t)return t}zoomIn(){if(this.mapAdapter.zoomIn)this.mapAdapter.zoomIn();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t+1)}}}zoomOut(){if(this.mapAdapter.zoomOut)this.mapAdapter.zoomOut();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t-1)}}}setView(t,e){if(Array.isArray(t)){const i=t;this.mapAdapter.setView&&i&&tt(e)?this.mapAdapter.setView(i,e):(i&&this.mapAdapter.setCenter(i),tt(e)&&this.mapAdapter.setZoom(e))}else{this.mapAdapter.setView&&this.mapAdapter.setView(t)}}fitBounds(t,e){return function(t){const[e,i,o,n]=t,r=e<o&&i<n;if(!r){console.log("Error: The extent coordinates are not in the correct order."),console.log(`Received extent: [${e}, ${i}, ${o}, ${n}]`);const t=[Math.min(e,o),Math.min(i,n),Math.max(e,o),Math.max(n,i)];console.log(`Expected order: [${t.join(", ")}]`)}const s=e>=-180&&o<=180,a=i>=-90&&n<=90;s&&a||console.log("Warning: The coordinates may not be within valid geographic ranges.")}(t),t.every(t=>tt(t))&&(t[1]<-85.06&&(t[1]=-85.06),t[3]>85.06&&(t[3]=85.06),this.mapAdapter.fitBounds(t,e)),this}getEventStatus(t){const e=this._eventsStatus[t];return null!=e&&e}onLoad(t="create"){return new Promise(e=>{this.getEventStatus(t)?e(this):this.emitter.once(t,()=>{e(this)})})}onMapLoad(t){return new Promise(e=>{var i;const o=()=>{const i=this.mapAdapter;t&&t(i),i&&e(i)},n=null==(i=this.mapAdapter.isLoaded)||i;this.mapAdapter.map&&n?o():this.mapAdapter.emitter.once("create",()=>{o()})})}getLayerAdapters(){return this.mapAdapter.layerAdapters}getLayerAdapter(t){return this.mapAdapter.layerAdapters[t]}locate(t,e){if(this.mapAdapter&&this.mapAdapter.locate)return this.mapAdapter.locate(t,e);return{stop:()=>({})}}stopGetCoordFromMapClick(){this._coordFromMapClickAbort&&(this._coordFromMapClickAbort(),this._coordFromMapClickAbort=void 0)}getCoordFromMapClick(){return this._coordFromMapClickAbort?this.getCoordFromMapClick():new Promise((t,e)=>{const i=this.getCursor()||"grab";this._removeEventListeners({include:["click"]}),this.setCursor("crosshair");const o=()=>{this.setCursor(i),this._addEventsListeners({include:["click"]}),this.mapAdapter.emitter.off("click",n),this._coordFromMapClickAbort=void 0},n=e=>{o(),it(e),t(e.lngLat)};this.mapAdapter.emitter.once("click",n),this._coordFromMapClickAbort=o})}_emitStatusEvent(t,e){const i=t;this._eventsStatus[i]=!0,this.emitter.emit(i,e)}_addLayerProviders(){return Bi(this,null,function*(){})}_onLoadSync(){return Bi(this,null,function*(){})}_setupMap(){return Bi(this,null,function*(){if(!this.mapAdapter)throw new Error("WebMap `mapAdapter` option is not set");return yield this.mapAdapter.create(this.options),this._zoomToInitialExtent(),yield this._addLayerProviders(),yield this._onLoadSync(),this._emitStatusEvent("build-map",this.mapAdapter),this})}_setTileJsonOptions(t){t.center&&(this.options.center=t.center),t.bounds&&(this.options.bounds=t.bounds),tt(t.maxzoom)&&(this.options.zoom=t.maxzoom),tt(t.minzoom)&&(this.options.zoom=t.minzoom),tt(t.maxzoom)&&tt(t.minzoom)&&(this.options.zoom=(t.maxzoom+t.minzoom)/2)}_zoomToInitialExtent(){const{center:t,zoom:e,bounds:i}=this.options;this._extent?this.fitBounds(this._extent):t&&e?this.setView(t,e):i&&(this.fitBounds(i),void 0!==e&&this.setZoom(e))}_setInitMapState(t){for(const e of t){const t=new e(this);this.mapState.push(t);for(const e of this.runtimeParams){const i=e.get(t.name);if(void 0!==i){const e=t.parse(i);this._initMapState[t.name]=e,Object.defineProperty(this.options,t.name,{value:e,configurable:!0,enumerable:!0});break}}}}_addEventsListeners(t){let e=["preclick","click","zoomstart","zoom","zoomend","movestart","move","moveend","mousemove","mouseout","mouseover"];t&&t.include&&(e=e.filter(e=>t.include.includes(e))),e.forEach(t=>{this._mapEvents[t]=e=>{if(this.runtimeParams.length){this.mapState.filter(e=>e.event.includes(t)).forEach(t=>{const e=t.toString();this.runtimeParams.forEach(i=>{i.set(t.name,e)})})}this._eventsStatus&&this.emitter.emit(t,e)};const e=this._mapEvents[t];e&&this.mapAdapter.emitter.on(t,e)})}_removeEventListeners(t){let e=Object.entries(this._mapEvents);t&&t.include&&(e=e.filter(e=>t.include.includes(e[0]))),e.forEach(([t,e])=>{e&&this.mapAdapter.emitter.removeListener(t,e)})}};ji(Ri,"keys",new class{constructor(){wi(this,"keyCodeAlias",new vi),wi(this,"keys",{}),wi(this,"_windowOnFocus"),wi(this,"_keysPressed"),wi(this,"_keysReleased"),this._windowOnFocus=this.windowOnFocus.bind(this),this._keysPressed=this.keysPressed.bind(this),this._keysReleased=this.keysReleased.bind(this),this.addKeyboardEventsListener()}pressed(t){const e=this.keyCodeAlias[t];return!!e&&this.keys[e]}addKeyboardEventsListener(){"undefined"!=typeof window&&(window.addEventListener("focus",this._windowOnFocus,!1),window.addEventListener("keydown",this._keysPressed,!1),window.addEventListener("keyup",this._keysReleased,!1))}removeKeyboardEventsListener(){"undefined"!=typeof window&&(window.removeEventListener("focus",this._windowOnFocus,!1),window.removeEventListener("keydown",this._keysPressed,!1),window.removeEventListener("keyup",this._keysReleased,!1))}keysPressed(t){t.stopPropagation(),this.keys[t.keyCode]||(this.keys[t.keyCode]=!0)}keysReleased(t){t.stopPropagation(),this.keys[t.keyCode]=!1}windowOnFocus(){this.keys={}}}),ji(Ri,"getPaintFunctions");let Di=Ri;var qi=Object.defineProperty,Fi=Object.defineProperties,Ui=Object.getOwnPropertyDescriptors,Wi=Object.getOwnPropertySymbols,Hi=Object.prototype.hasOwnProperty,Vi=Object.prototype.propertyIsEnumerable,Gi=(t,e,i)=>e in t?qi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ji=(t,e)=>{for(var i in e||(e={}))Hi.call(e,i)&&Gi(t,i,e[i]);if(Wi)for(var i of Wi(e))Vi.call(e,i)&&Gi(t,i,e[i]);return t},Ki=(t,e)=>Fi(t,Ui(e)),Yi=(t,e,i)=>Gi(t,"symbol"!=typeof e?e+"":e,i),Qi=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});class $i extends Di{constructor(t){super(t),Yi(this,"_layersIdCounter",1),Yi(this,"_layersOrderCounter",1),Yi(this,"_baselayers",[]),Yi(this,"_layers",{}),Yi(this,"_selectedLayers",[]);const e=this.options.tileJson;e&&this.emitter.once("build-map",()=>this.addTileJsonLayer(e))}fitLayer(t,e){return Qi(this,null,function*(){const i=this.getLayer(t),o=i&&(i.getBounds||i.getExtent);if(o){const t=yield o.call(i);t&&this.fitBounds(t,e)}})}isBaseLayer(t){const e=this.getLayer(t);if(e&&e.id)return-1!==this._baselayers.indexOf(e.id)}getBaseLayers(){const t=[];return this._baselayers.forEach(e=>{const i=this._layers[e];i&&t.push(i)}),t}getBaseLayersIds(){return this._baselayers}getLayer(t){return"string"==typeof t?this._layers[t]:t}getLayerId(t){const e=this.getLayer(t);if(e){if(e.id)return null==e?void 0:e.id;if(e&&e.options)return e.options.id}throw new Error("No id for layer")}getLayers(){return Object.keys(this._layers)}allLayers(){return this._layers}orderedLayers(){return Object.values(this._layers).sort((t,e)=>t.order&&e.order?t.order-e.order:0)}findLayer(t){for(const e in this._layers){const i=this._layers[e];if(t(i))return i}}isLayerVisible(t){const e=this.getLayer(t);return!(!e||void 0===e.options.visibility)&&e.options.visibility}addBaseLayer(t,e){return Qi(this,null,function*(){return yield this.addLayer(t,Ki(Ji({},e),{baselayer:!0}),void 0)})}addLayer(t){return Qi(this,arguments,function*(t,e={},i){var o,n;const r=this._layersIdCounter++,s=tt(i)?i:void 0!==e.order?e.order:this.reserveOrder();let a;"string"==typeof t?a=this.getLayerAdapter(t):"function"==typeof t?a=t:"then"in t&&(a=yield t);const l=e;this._updateGeoJsonOptions(l);const c=null==(o=(e=Ji({id:String(r),order:s},e)).visibility)||o;if(e.visibility=!1,e.baselayer&&(e.order=0),this.options.onBeforeAddLayer){const t=this.options.onBeforeAddLayer({options:e,adapter:a});t&&(t.options&&(e=t.options),t.adapter&&(a=t.adapter))}if(e=Ki(Ji({},e),{request:this._getLayerRequestOptions(e)}),void 0!==a){const t=new a(this.mapAdapter.map,e);let i;t.options=Ji(Ji({},e),t.options),t.options.baselayer&&(e.baselayer=!0,e.order=0,t.options.order=0),t.options.id&&(i=String(t.options.id),this._layers[i]=t),this._emitLayerEvent("layer:preadd",i||"",t),yield this.onMapLoad(),t.map=this.mapAdapter.map;const o=yield t.addLayer(t.options);if(t.layer=o,t.id=t.options.id||String(r),t.options.id=t.id,e.baselayer&&(t.options.order=0),t.order=null!=(n=t.options.order)?n:s,i&&delete this._layers[i],i=String(t.id),this._layers[i])throw Error(`layer with id '${i}' already exist`);i&&(this._layers[i]=t,l.filter&&this.filterLayer(t,l.filter),e.baselayer&&this._baselayers.push(i),c&&(yield this.showLayer(i)));const h=e.opacity;null!=h&&h<=1&&this.setLayerOpacity(t,h);const u=o&&(t.getBounds||t.getExtent);if(e.fit&&u){const e=yield u.call(t);e&&(yield this.fitBounds(e))}return e.onAdded&&e.onAdded(t),this._emitLayerEvent("layer:add",i,t),t}return Promise.reject("No adapter")})}addLayerFromAsyncAdapter(t,e,i){return Qi(this,null,function*(){const o=i||void 0!==e.order?e.order:this.reserveOrder(),n=t(),r=yield n;return r?this.addLayer(r,e,o):Promise.reject("No adapter")})}removeLayers(t){for(const e in this._layers){let i=!0;t&&(i=t(e,this._layers[e])),i&&(this.removeLayer(e),delete this._layers[e])}}getLegend(t){return Qi(this,null,function*(){const e=[];for(const i of this.orderedLayers())i.getLegend&&e.push(i.getLegend(t));return(yield Promise.all(e)).flat()})}reserveOrder(){return this._layersOrderCounter++}removeOverlays(){this.removeLayers((t,e)=>!(e&&e.options&&e.options.baselayer))}removeLayer(t){const e=this.getLayer(t),i=e&&this.getLayerId(e);if(e&&i){if(this.emitter.emit("layer:preremove",e),e.beforeRemove&&e.beforeRemove(),e.removeLayer?e.removeLayer():this.mapAdapter.removeLayer(e.layer),e.options&&e.options.baselayer){const t=this._baselayers.indexOf(i);t&&this._baselayers.splice(t,1)}delete this._layers[i],this.emitter.emit("layer:remove",e)}}addGeoJsonLayer(t={},e){return(t=t||{}).multiselect=void 0!==t.multiselect&&t.multiselect,t.unselectOnSecondClick=void 0===t.unselectOnSecondClick||t.unselectOnSecondClick,e||(t=gi(t)),t.paint=t.paint||{},this.addLayer(e||"GEOJSON",t)}addFeatureLayer(t={}){return this.addGeoJsonLayer(t)}addTileLayer(t,e={}){return this.addLayer("TILE",Ki(Ji({},e),{url:t}))}addImageLayer(t,e){let i;return"string"==typeof t?i=t:(i=t.url,e=t),this.addLayer("IMAGE",Ki(Ji({},e),{url:i}))}showLayer(t,e={}){return this.toggleLayer(t,!0,e)}hideLayer(t,e={}){return this.toggleLayer(t,!1,e)}toggleLayer(t,e,i={}){const o=this.getLayer(t),n=void 0!==e?e:!(o&&o.options.visibility),r=void 0!==i.silent&&i.silent,s=t=>Qi(this,null,function*(){const e=String(t.id),i=n?"layer:show":"layer:hide";if(r||(this._emitLayerEvent(n?"layer:preshow":"layer:prehide",e,t),this._emitLayerEvent("layer:pretoggle",e,t)),n&&this.mapAdapter){const e=t.options.baselayer?0:t.options.order;if(t.options.baselayer&&this._baselayers.length){const e=this._baselayers.filter(e=>e!==t.id&&this.isLayerVisible(e));for(const t of e)yield this.hideLayer(t)}t.showLayer?yield t.showLayer.call(t,t.layer):void 0!==t.layer&&(yield this.mapAdapter.showLayer(t.layer)),void 0!==e&&this.mapAdapter.setLayerOrder(t.layer,e,this._layers)}else t.hideLayer?yield t.hideLayer.call(t,t.layer):void 0!==t.layer&&(yield this.mapAdapter.hideLayer(t.layer));t.options.visibility=n,r||(this._emitLayerEvent(i,e,t),this._emitLayerEvent("layer:toggle",e,t))});return o?this.onMapLoad().then(()=>s(o)):Promise.resolve()}updateLayer(t,e){const i=this.getLayer(t);if(i){if(i.updateLayer)return Promise.resolve(i.updateLayer(e));if(this.isLayerVisible(i))return this.hideLayer(i,{silent:!0}).then(()=>this.showLayer(i,{silent:!0}))}return Promise.resolve()}setLayerOpacity(t,e){const i=this.getLayer(t);i&&(i.setOpacity?i.setOpacity(e):this.mapAdapter.setLayerOpacity&&this.mapAdapter.setLayerOpacity(i.layer,e))}isLayerLabelVisible(t){var e;const i=this.getLayer(t);return i.isLabelVisible?i.isLabelVisible():null==(e=i.options.labelVisibility)||e}showLayerLabel(t){this.toggleLayerLabel(t,!0)}hideLayerLabel(t){this.toggleLayerLabel(t,!1)}toggleLayerLabel(t,e){const i=this.getLayer(t);return e=null!=e?e:!this.isLayerLabelVisible(t),i&&(e?i.showLabel&&(i.options.labelVisibility=!0,i.showLabel()):i.hideLabel&&(i.options.labelVisibility=!1,i.hideLabel()),i.id&&this._emitLayerEvent("layer:label:toggle",i.id,i)),e}selectLayer(t,e){const i=this.getLayer(t);if(i){i&&i.select&&i.select(e);const t=this.getLayerId(i);t&&this._selectedLayers.push(t)}}unSelectLayer(t,e){const i=this.getLayer(t);if(i){const t=i&&i;t.unselect&&t.unselect(e);const o=this.getLayerId(i);if(o){const t=this._selectedLayers.indexOf(o);-1!==t&&this._selectedLayers.splice(t,1)}}}unSelectLayers(){const t=Object.values(this.allLayers());let e;for(e of t)e.unselect&&e.unselect()}filterLayer(t,e){const i=this.getLayer(t);return i.filter?i.filter(e):[]}propertiesFilter(t,e,i){const o=this.getLayer(t);if(o){const t=o;if(t.propertiesFilter)return t.propertiesFilter(e,i);t.filter&&this.filterLayer(t,t=>!t.feature||!t.feature.properties||Oe(t.feature.properties,e))}return Promise.resolve()}removeLayerFilter(t){const e=this.getLayer(t);e.removeFilter?e.removeFilter():e.filter&&e.filter(()=>!0)}setLayerData(t,e){const i=this.getLayer(t);if(i){if(i.setData)return i.setData(e);if(i.clearLayer&&i.addData)return i.clearLayer(),i.addData(e)}return Promise.resolve()}addLayerData(t,e){const i=this.getLayer(t);i.addData&&i.addData(e)}clearLayerData(t,e){const i=this.getLayer(t);i&&i.clearLayer&&i.clearLayer(e)}setLayerPaint(t,e){const i=this.getLayer(t);e&&i&&i.setPaint&&i.setPaint(e)}setLayerSelectedPaint(t,e){const i=this.getLayer(t);e&&i&&i.setSelectedPaint&&i.setSelectedPaint(e)}updateLayerPaint(t,e){const i=this.getLayer(t);e&&i&&i.updatePaint&&i.updatePaint(e)}updateLayerSelectedPaint(t,e){const i=this.getLayer(t);e&&i&&i.updateSelectedPaint&&i.updateSelectedPaint(e)}getAttributions(t){const e=[];for(const i in this._layers){const o=this._layers[i];let n=!(void 0===t.onlyVisible||t.onlyVisible)||o.options.visibility;if(n&&t.onlyBaselayer&&(n=this._baselayers.includes(i)),n){const t=o.options&&o.options.attribution;t&&e.push(t)}}return e}getActiveBaseLayer(){const t=this.getBaseLayers().find(t=>this.isLayerVisible(t));if(t)return this.getLayer(t)}addTileJsonLayer(t){return this.addLayer("TILE",{url:t.tiles[0],maxZoom:t.maxzoom,minZoom:t.minzoom,subdomains:t.scheme,attribution:t.attribution,request:t.request})}_getLayerRequestOptions(t){var e,i,o,n;const r=ui(this.options.layerRequest),s=pi(t),a=Ji(Ji({},(null==r?void 0:r.headers)||{}),(null==s?void 0:s.headers)||{}),l=!1===t.withCredentials&&void 0===(null==(e=t.request)?void 0:e.credentials)&&void 0!==(null==r?void 0:r.credentials)?"same-origin":null!=(i=null==s?void 0:s.credentials)?i:null==r?void 0:r.credentials,c=void 0!==(null==(o=t.request)?void 0:o.cache)?t.request.cache:null!=(n=null==s?void 0:s.cache)?n:null==r?void 0:r.cache;return ui(Ji(Ji(Ji(Ji(Ji({},r),s),Object.keys(a).length?{headers:a}:{}),void 0!==l?{credentials:l}:{}),void 0!==c?{cache:c}:{}))}_emitLayerEvent(t,e,i){const o=String(t);if(tt(e)&&o.startsWith("layer:")){const t=o.replace("layer:","layer-"+e+":");this.emitter.emit(t,i)}this.emitter.emit(t,i)}_onLayerClick(t){return Qi(this,null,function*(){return this._emitLayerEvent("layer:click",t.layer.id||"",t),Promise.resolve(t)})}_onLayerDoubleClick(t){return Qi(this,null,function*(){return this._emitLayerEvent("layer:dblclick",t.layer.id||"",t),Promise.resolve(t)})}_onLayerSelect(t){return Qi(this,null,function*(){return this._emitLayerEvent("layer:select",t.layer.id||"",t),Promise.resolve(t)})}_updateGeoJsonOptions(t){const{onSelect:e,onLayerSelect:i,onClick:o,onDoubleClick:n,onLayerClick:r,onMouseOut:s,onMouseOver:a}=t,l=o||r,c=n||r;t.onClick=t=>(l&&l(t),this._onLayerClick(t)),t.onDoubleClick=t=>(c&&c(t),this._onLayerDoubleClick(t)),t.onMouseOut=t=>{const e=t.layer.id;s&&s(t),tt(e)&&this._emitLayerEvent("layer:mouseout",e,t)},t.onMouseOver=t=>{const e=t.layer.id;a&&a(t),tt(e)&&this._emitLayerEvent("layer:mouseover",e,t)};const h=e||i;t.onSelect=t=>(h&&h(t),this._onLayerSelect(t)),t.nativePaint||(this.options.paint&&(t.paint=Ze({paint:t.paint||{},defaultPaint:this.options.paint,getPaintFunctions:this.getPaintFunctions})),t.selectedPaint&&this.options.selectedPaint&&(t.selectedPaint=Ze({paint:t.selectedPaint,defaultPaint:this.options.selectedPaint,getPaintFunctions:this.getPaintFunctions})))}}var Xi=Object.defineProperty,to=Object.getOwnPropertySymbols,eo=Object.prototype.hasOwnProperty,io=Object.prototype.propertyIsEnumerable,oo=(t,e,i)=>((t,e,i)=>e in t?Xi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),no=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});const ro=class t extends $i{constructor(){super(...arguments),oo(this,"_loadControlQueue",{"top-right":[],"bottom-right":[],"top-left":[],"bottom-left":[],inside:[]}),oo(this,"_isControlLoading",{"top-right":!1,"bottom-right":!1,"top-left":!1,"bottom-left":!1,inside:!1})}addControl(t,e,i){return no(this,null,function*(){let o;const{addOptions:n,createOptions:r}=this._splitControlOptions(i);if(e=null!=e?e:"top-left",o="string"==typeof t?this.getControl(t,r):t,o)return new Promise(t=>{this._setControlQueue(this._getControlQueueKey(e),()=>no(this,null,function*(){const i=yield o,r=this.mapAdapter.addControl(i,e,n);t(r)}))})})}createControl(t,e){return no(this,null,function*(){if(yield this.onLoad("build-map"),this.mapAdapter.createControl)return this.mapAdapter.createControl(t,e)})}createButtonControl(t){return no(this,null,function*(){if(yield this.onLoad("build-map"),this.mapAdapter.createButtonControl)return this.mapAdapter.createButtonControl(t)})}createToggleControl(t){return no(this,null,function*(){return yield this.onLoad("build-map"),this.mapAdapter.createToggleControl?this.mapAdapter.createToggleControl(t):this.mapAdapter.createButtonControl?function(t,e){const i=document.createElement("div"),o=new Set;let n=!1;e.getStatus?n=e.getStatus():e.status&&(n=e.status);const r=e.title||"",s=e.html;function a(){r&&(i.title="string"==typeof r?r:n?r.on:r.off,i.setAttribute("aria-label",i.title))}function l(t){t instanceof HTMLElement?(i.innerHTML="",i.appendChild(t)):"string"==typeof t&&(i.innerHTML=t)}function c(){s&&("string"==typeof s||s instanceof HTMLElement?l(s):l(n?s.on:s.off),i.setAttribute("aria-label",i.title))}function h(t,e){t.split(" ").forEach(t=>{e?i.classList.add(t):i.classList.remove(t)})}function u(){e.addClassOn&&h(e.addClassOn,n),e.addClassOff&&h(e.addClassOff,!n)}function p(t){o.forEach(e=>e(n,t))}a(),c(),e.addClass&&h(e.addClass,!0),u();const d=t=>{void 0!==t&&(n=t),c(),a(),u()},f=t=>{if(void 0===t&&n&&m.disableOnSecondClick)return;const i=n;if(n=void 0!==t?t:!n,e.onClick){let t;try{t=e.onClick(n)}catch(o){throw n=i,d(),o}Promise.resolve(t).then(()=>{d(),i!==n&&p(m)}).catch(()=>{n=i,d()})}else d(),i!==n&&p(m)},m=t({html:i,onClick:f});return m.onClick=f,m.changeStatus=d,m.getStatus=()=>n,m.switch=e.switch,void 0!==e.disableOnSecondClick&&(m.disableOnSecondClick=e.disableOnSecondClick),m.onStatusChange=t=>(o.add(t),()=>o.delete(t)),m}(this.mapAdapter.createButtonControl,t):void 0})}removeControl(t){"remove"in t?t.remove():this.mapAdapter.removeControl&&Promise.resolve(t).then(t=>{this.mapAdapter.removeControl(t)})}getControl(e,i){const o=this.mapAdapter.controlAdapters[e];if(o)return new o(i);{const o=t.controls[e];if(o)return o(this,i)}}getControlContainer(){if(this.mapAdapter.getControlContainer)return this.mapAdapter.getControlContainer()}_getControlQueueKey(t){return"string"==typeof t?t:"inside"}_setControlQueue(t,e){this._loadControlQueue[t].push(e),this._isControlLoading[t]||this._applyControls(t)}_applyControls(t){return no(this,null,function*(){if(this._loadControlQueue[t].length){this._isControlLoading[t]=!0;const e=this._loadControlQueue[t][0];yield e(),this._loadControlQueue[t].splice(0,1),this._applyControls(t)}else this._isControlLoading[t]=!1})}_splitControlOptions(t){if(!t)return{};const e=t,{id:i,order:o}=e,n=((t,e)=>{var i={};for(var o in t)eo.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&to)for(var o of to(t))e.indexOf(o)<0&&io.call(t,o)&&(i[o]=t[o]);return i})(e,["id","order"]);return{addOptions:this._getAddControlOptions(i,o),createOptions:n}}_getAddControlOptions(t,e){return void 0!==t||void 0!==e?{id:t,order:e}:void 0}};oo(ro,"controls",{CONTROL:(t,e)=>t.createControl(e.control,e.options),BUTTON:(t,e)=>t.createButtonControl(e),TOGGLE:(t,e)=>t.createToggleControl(e)});let so=ro;var ao=Object.defineProperty,lo=Object.defineProperties,co=Object.getOwnPropertyDescriptors,ho=Object.getOwnPropertySymbols,uo=Object.prototype.hasOwnProperty,po=Object.prototype.propertyIsEnumerable,fo=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),mo=(t,e,i)=>e in t?ao(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,go=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}),yo=(t,e,i)=>(e=t[fo("asyncIterator")])?e.call(t):(t=t[fo("iterator")](),e={},(i=(i,o)=>(o=t[i])&&(e[i]=e=>new Promise((i,n,r)=>(e=o.call(t,e),r=e.done,Promise.resolve(e.value).then(t=>i({value:t,done:r}),n)))))("next"),i("return"),e);class _o extends so{constructor(t){super(t),this._addControls(),oi[this.id]=this}static get(t){return function(t){return oi[t]}(t)}_addLayerProviders(){return go(this,null,function*(){try{for(var t,e,i,o=yo(this._starterKits);t=!(e=yield o.next()).done;t=!1){const t=e.value;if(t.getLayerAdapters){const e=yield t.getLayerAdapters.call(t);if(e)try{for(var n,r,s,a=yo(e);n=!(r=yield a.next()).done;n=!1){const t=r.value,e=yield t.createAdapter(this);e&&(this.mapAdapter.layerAdapters[t.name]=e)}}catch(r){s=[r]}finally{try{n&&(r=a.return)&&(yield r.call(a))}finally{if(s)throw s[0]}}}}}catch(e){i=[e]}finally{try{t&&(e=o.return)&&(yield e.call(o))}finally{if(i)throw i[0]}}})}_onLoadSync(){return go(this,null,function*(){try{for(var t,e,i,o=yo(this._starterKits);t=!(e=yield o.next()).done;t=!1){const t=e.value;if(t.onLoadSync)try{yield t.onLoadSync.call(t,this)}catch(n){console.error(n)}}}catch(e){i=[e]}finally{try{t&&(e=o.return)&&(yield e.call(o))}finally{if(i)throw i[0]}}})}_addControls(){this.options.controls&&this.options.controls.forEach(t=>{let e=t,i={};"string"==typeof t&&this.options.controlsOptions&&this.options.controlsOptions[t]&&(i=this.options.controlsOptions[t],void 0!==i.control&&(e=i.control));const o=i,{id:n,order:r,position:s}=o,a=((t,e)=>{var i={};for(var o in t)uo.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&ho)for(var o of ho(t))e.indexOf(o)<0&&po.call(t,o)&&(i[o]=t[o]);return i})(o,["id","order","position"]);var l;this.addControl(e,s||"top-left",(l=((t,e)=>{for(var i in e||(e={}))uo.call(e,i)&&mo(t,i,e[i]);if(ho)for(var i of ho(e))po.call(e,i)&&mo(t,i,e[i]);return t})({},a),lo(l,co({id:n,order:r}))))}),this._emitStatusEvent("controls:create")}}function vo({src:t,headers:e,withCredentials:i,request:o}){const n=pi({headers:e,request:o,withCredentials:i}),r=(null==n?void 0:n.headers)||{},s=new AbortController;return[fetch(t,{cache:null==n?void 0:n.cache,credentials:null==n?void 0:n.credentials,headers:r,signal:s.signal}).then(t=>{if(!t.ok)throw new Error(t.statusText);return t.blob()}).then(t=>(window.URL||window.webkitURL).createObjectURL(t)).catch(t=>{if("AbortError"===t.name)return"";throw t}),()=>{s.abort()}]}var bo=Object.defineProperty,wo=(t,e,i)=>((t,e,i)=>e in t?bo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);const xo=new class{constructor({concurrency:t=1,delay:e=0}={}){wo(this,"queue",[]),wo(this,"concurrency"),wo(this,"activeCount",0),wo(this,"timeoutId"),wo(this,"delay"),wo(this,"toAbort",[]),this.concurrency=t,this.delay=e}add(t,e){this.queue.push({promise:t,abort:e}),this.debouncedNext()}abort(){for(const t of this.toAbort)t();this.toAbort=[],this.queue=[],this._clearTimeout()}debouncedNext(){this._clearTimeout(),this.timeoutId=setTimeout(()=>this._next(),this.delay)}_clearTimeout(){this.timeoutId&&clearTimeout(this.timeoutId)}_next(){for(;this.activeCount<this.concurrency&&this.queue.length>0;){const{promise:t,abort:e}=this.queue.shift();this.activeCount++;let i,o=e;const n=t();Array.isArray(n)?(i=n[0],o=n[1]):i=n,o&&this.toAbort.push(o),i.finally(()=>{this.activeCount--,o&&(this.toAbort=this.toAbort.filter(t=>t!==o)),this.debouncedNext()})}}}({concurrency:6,delay:200});var Po=Object.defineProperty,Lo=(t,e,i)=>((t,e,i)=>e in t?Po(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class Oo extends P.ImageOverlay{constructor(t,e,i){super(t,e,i),Lo(this,"_aborter")}cancelLoad(){this._aborter&&(this._aborter(),this._aborter=void 0)}_initImage(){super._initImage();const{headers:t,request:e,withCredentials:i}=this.options,o=this._image,n=o.src;o.src="",xo.add(()=>{const[r,s]=vo({src:n,headers:t,request:e,withCredentials:i});return r.then(t=>{o.src=t}),this._aborter=s,r})}}var Co=Object.defineProperty,ko=(t,e,i)=>((t,e,i)=>e in t?Co(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Eo extends P.Layer{constructor(t,e){super(e),ko(this,"defaultWmsParams",{request:"GetMap"}),ko(this,"options",{crs:null,uppercase:!1,attribution:"",opacity:1,isBack:!1,minZoom:0,maxZoom:void 0,pane:"tilePane",headers:null,withCredentials:!1,viewPortBuffer:0,setViewDelay:100}),ko(this,"wmsParams"),ko(this,"_url"),ko(this,"_currentUrl"),ko(this,"_currentOverlay"),ko(this,"_loadedOverlay"),this._url=t;const i={},o={};let n;for(n in e){n in this.options&&(o[n]=e[n])}if(e.params)for(const r in e.params){const t=e.params[r];pt(t)||Array.isArray(t)||"function"==typeof t||(i[r]=t)}P.Util.setOptions(this,o),this.wmsParams=P.Util.extend({},this.defaultWmsParams,i)}setParams(t){P.Util.extend(this.wmsParams,t),this.update()}getAttribution(){return this.options.attribution||""}onAdd(){return this.update(),this}onRemove(t){return this._currentOverlay&&(this._currentOverlay.cancelLoad(),t.removeLayer(this._currentOverlay),delete this._currentOverlay),this._currentUrl&&delete this._currentUrl,this}getEvents(){return{moveend:$(this.update,this.options.setViewDelay)}}update(){if(!this._map)return;this.updateWmsParams();const t=this.getImageUrl();if(this._currentUrl===t)return;this._currentUrl=t;const e=this.options.viewPortBuffer||0,i=this._map.getBounds().pad(e);this._loadedOverlay&&(this._loadedOverlay.cancelLoad(),this._loadedOverlay.off("load"),this._loadedOverlay=void 0);const o=new Oo(t,i,{opacity:0,pane:this.options.pane,headers:this.options.headers,request:this.options.request,withCredentials:this.options.withCredentials});o.addTo(this._map),this._loadedOverlay=o,o.once("load",()=>{this._map&&(o._url===this._currentUrl?(this._currentOverlay&&this._map.removeLayer(this._currentOverlay),this._loadedOverlay=void 0,this._currentOverlay=o,o.setOpacity(void 0!==this.options.opacity?this.options.opacity:1),!0===this.options.isBack&&o.bringToBack(),!1===this.options.isBack&&o.bringToFront(),void 0!==this.options.zIndex&&o.setZIndex(this.options.zIndex)):this._map.removeLayer(o))},this);const{minZoom:n,maxZoom:r}=this.options;(n&&this._map.getZoom()<n||r&&this._map.getZoom()>r)&&this._map.removeLayer(o)}setOpacity(t){this.options.opacity=t,this._currentOverlay&&this._currentOverlay.setOpacity(t)}bringToBack(){this.options.isBack=!0,this._currentOverlay&&this._currentOverlay.bringToBack()}bringToFront(){this.options.isBack=!1,this._currentOverlay&&this._currentOverlay.bringToFront()}setZIndex(t){this.options.zIndex=t,this._currentOverlay&&this._currentOverlay.setZIndex(t)}updateWmsParams(t){t||(t=this._map);const e=this.options.viewPortBuffer||0,i=t.getBounds().pad(e),o=t.getSize();if(0!==this.options.viewPortBuffer){const t=e+1;o.x=Math.ceil(o.x*t),o.y=Math.ceil(o.y*t)}const n=this.options.crs||t.options.crs;if(n){const t=n.project(i.getNorthWest()),e=n.project(i.getSouthEast()),r={width:o.x,height:o.y};r.bbox=[t.x,e.y,e.x,t.y],P.Util.extend(this.wmsParams,r)}}getImageUrl(){const t=P.Util.getParamString(this.wmsParams,this._url,this.options.uppercase||!1);return this._url+t}}var Mo=Object.defineProperty,Ao=Object.defineProperties,To=Object.getOwnPropertyDescriptors,So=Object.getOwnPropertySymbols,Io=Object.prototype.hasOwnProperty,zo=Object.prototype.propertyIsEnumerable,jo=(t,e,i)=>e in t?Mo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Bo=(t,e)=>{for(var i in e||(e={}))Io.call(e,i)&&jo(t,i,e[i]);if(So)for(var i of So(e))zo.call(e,i)&&jo(t,i,e[i]);return t},Zo=(t,e)=>Ao(t,To(e)),No=(t,e,i)=>jo(t,"symbol"!=typeof e?e+"":e,i);class Ro extends Ot{constructor(){super(...arguments),No(this,"layer")}addLayer(t){var e;const i=t&&t.url;if(i){const o=t.updateWmsParams,n=pi(t);if(this.layer=new Eo(i,Zo(Bo(Bo(Bo({pane:this.pane,setViewDelay:t.setViewDelay},Zo(Bo({transparent:!0},t),{opacity:null!=(e=t.opacity)?e:void 0})),t.params),t.nativeOptions),{request:n})),o){const t=this.layer.updateWmsParams;this.layer.updateWmsParams=function(e){t.call(this,e),this.wmsParams=o(this.wmsParams)}}return this.layer}}updateLayer(t){if(this.layer){P.Util.extend(this.layer.wmsParams,(null==t?void 0:t.params)||{}),this.layer.update()}}}function Do(t){return class extends t{constructor(...t){super(...t),this.options.setViewDelay&&(this._update=$((...t)=>{P.GridLayer.prototype._update.call(this,...t)},this.options.setViewDelay))}createTile(t,e){const i=this.getTileUrl(t),o=document.createElement("img"),[n,r]=vo({src:i,withCredentials:this.options.withCredentials,headers:this.options.headers,request:this.options.request});return n.then(t=>{o.src=t,e(null,o)}),o.abort=r,(this.options.crossOrigin||""===this.options.crossOrigin)&&(o.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),o.alt="",o.setAttribute("role","presentation"),o}_abortLoading(){const t=this._tiles,e=this._tileZoom;for(const i in t)if(t[i].coords.z!==e){const e=t[i].el;e.onload=P.Util.falseFn,e.onerror=P.Util.falseFn,e.complete||(e.abort&&e.abort(),e.src=P.Util.emptyImageUrl,P.DomUtil.remove(e),delete t[i])}}}}No(Ro,"queue",xo);const qo=Do(class extends P.TileLayer{constructor(t,e){super(t,e),Object.assign(this.options,e)}});var Fo=Object.defineProperty,Uo=Object.defineProperties,Wo=Object.getOwnPropertyDescriptors,Ho=Object.getOwnPropertySymbols,Vo=Object.prototype.hasOwnProperty,Go=Object.prototype.propertyIsEnumerable,Jo=(t,e,i)=>e in t?Fo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ko=(t,e)=>{for(var i in e||(e={}))Vo.call(e,i)&&Jo(t,i,e[i]);if(Ho)for(var i of Ho(e))Go.call(e,i)&&Jo(t,i,e[i]);return t};class Yo extends Ot{addLayer(t){if(this.options=Object.assign(this.options,t),t){const i=t,{url:o}=i,n=((t,e)=>{var i={};for(var o in t)Vo.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&Ho)for(var o of Ho(t))e.indexOf(o)<0&&Go.call(t,o)&&(i[o]=t[o]);return i})(i,["url"]);if(o){const t=Ko({pane:this.pane,attribution:n.attribution,minZoom:n.minZoom,maxZoom:n.maxZoom},n.nativeOptions);let i;n.subdomains&&(t.subdomains=n.subdomains);const r=pi(n);return i=r?new qo(o,(e=Ko({},t),Uo(e,Wo({request:r,setViewDelay:n.setViewDelay})))):new P.TileLayer(o,t),i}}var e}updateLayer(t){if(this.layer){(null==t?void 0:t.params)&&this.layer.setUrl(ft(this.layer._url,t.params)),this.layer.redraw()}}}var Qo=Object.defineProperty,$o=Object.defineProperties,Xo=Object.getOwnPropertyDescriptors,tn=Object.getOwnPropertySymbols,en=Object.prototype.hasOwnProperty,on=Object.prototype.propertyIsEnumerable,nn=(t,e,i)=>e in t?Qo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;const rn=Do(class extends P.TileLayer.WMS{constructor(t,e){super(t,e)}});var sn=Object.defineProperty,an=Object.defineProperties,ln=Object.getOwnPropertyDescriptors,cn=Object.getOwnPropertySymbols,hn=Object.prototype.hasOwnProperty,un=Object.prototype.propertyIsEnumerable,pn=(t,e,i)=>e in t?sn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,dn=(t,e)=>{for(var i in e||(e={}))hn.call(e,i)&&pn(t,i,e[i]);if(cn)for(var i of cn(e))un.call(e,i)&&pn(t,i,e[i]);return t};function fn(t){return[[t[3],t[0]],[t[1],t[2]]]}var mn=Object.defineProperty,gn=Object.getOwnPropertySymbols,yn=Object.prototype.hasOwnProperty,_n=Object.prototype.propertyIsEnumerable,vn=(t,e,i)=>e in t?mn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,bn=(t,e)=>{for(var i in e||(e={}))yn.call(e,i)&&vn(t,i,e[i]);if(gn)for(var i of gn(e))_n.call(e,i)&&vn(t,i,e[i]);return t},wn=(t,e,i)=>vn(t,"symbol"!=typeof e?e+"":e,i);const xn=class t{constructor(){wn(this,"options",{target:"map"}),wn(this,"layerAdapters",t.layerAdapters),wn(this,"controlAdapters",t.controlAdapters),wn(this,"emitter",new H),wn(this,"map"),wn(this,"_resizeObserver"),wn(this,"_controlContainer"),wn(this,"_unselectCb",[]),wn(this,"_universalEvents",["move","zoom","zoomend","zoomstart","moveend","movestart"]),wn(this,"_positionEvents",["mousemove","mouseout","mouseover"])}create(t){if(this.options=bn({},t),this.options.target){const{zoom:t,center:e,maxZoom:i,minZoom:o,maxBounds:n,mapAdapterOptions:r}=this.options;this.map=this.options.map||new P.Map(this.options.target,bn({attributionControl:!1,zoomControl:!1,maxBounds:n?fn(n):void 0,zoomSnap:0,maxZoom:i,minZoom:o,center:e&&[e[1],e[0]],zoom:t},r)),this._updateMinZoomForBounds(o),this._watchSizeChangeToUpdateMinZoom();const s=this.map.createPane("order-0");this._controlContainer=new U(this.map),this.map._addUnselectCb=t=>{this._addUnselectCb(t)},s.style.zIndex=String(0),this.emitter.emit("create",this),this._addMapListeners()}}destroy(){this.map&&this.map.remove(),this._controlContainer&&(this._controlContainer.detach(),this._controlContainer=void 0),this._stopWatchSizeChangeToUpdateMinZoom()}getContainer(){return this.map&&this.map.getContainer()}getControlContainer(){if(this._controlContainer)return this._controlContainer.getContainer();const t=this.map&&this.map._controlContainer;if(t)return t;throw new Error("Leaflet Map is not initialized yet")}setCursor(t){this.map&&(this.map.getContainer().style.cursor=t)}setView(t,e){const i=this.map;if(i)if(Array.isArray(t)){const i=t,[o,n]=i;this.map&&("number"==typeof e?this.map.setView([n,o],e,{animate:!1}):this.setCenter([o,n]))}else{const{zoom:e,center:o,maxBounds:n,bounds:r,minZoom:s,maxZoom:a}=t;if(o&&void 0!==e?this.setView(o,e):(void 0!==e&&this.setZoom(e),o&&this.setCenter(o)),r&&this.fitBounds(r),void 0!==n)if(n){const t=fn(n);i.setMaxBounds(t),this._updateMinZoomForBounds()}else i.setMaxBounds(null),this._updateMinZoomForBounds();void 0!==a&&i.setMaxZoom(a),void 0!==s&&this._updateMinZoomForBounds(s)}}setCenter(t){const[e,i]=t;this.map&&this.map.panTo([i,e])}getCenter(){const t=this.map;if(t){const e=t.getBounds().getCenter();return[e.lng,e.lat]}}setZoom(t){this.map&&this.map.setZoom(t)}getZoom(){var t;return null!=(t=this.map&&this.map.getZoom())?t:void 0}getBounds(){if(!this.map)return;const t=this.map.getBounds(),e=t.getSouthWest(),i=t.getNorthEast();return[e.lng,e.lat,i.lng,i.lat]}fitBounds(t,e={}){if(this.map){const{maxZoom:i,offset:o,padding:n}=e,r={};i&&(r.maxZoom=i),n&&(r.padding=[n,n]),o&&(r.padding=o),this.map.fitBounds(fn(t),r)}}getLayerAdapter(e){return t.layerAdapters[e]}createControl(t,e){return S(t,e,this)}createButtonControl(t){return function(t,e){return S(b(t),{bar:!0,margin:t.margin},e)}(t,this)}createToggleControl(t){return I(t,this)}addControl(t,e,i){if(this._controlContainer)return this._controlContainer.addControl(t,e,i)}removeControl(t){this._controlContainer&&this._controlContainer.removeControl(t)}removeLayer(t){t&&t.remove&&t.remove()}showLayer(t){this.map&&t.addTo(this.map)}hideLayer(t){t.remove()}setLayerOpacity(t,e){"setOpacity"in t&&t.setOpacity(e)}setLayerOrder(t,e,i){}onMapClick(t){const e=Ct(t);this.emitter.emit("preclick",e),this.emitter.emit("click",e)}locate(t,e){const i=this.map;if(i&&(i.locate(t),e)){const{locationfound:t,locationerror:o}=e,n=e=>{t({lngLat:[e.latlng.lng,e.latlng.lat]})};void 0!==t&&i.on("locationfound",n,this),o&&i.on("locationerror",o,this);return{stop:()=>{void 0!==t&&i.off("locationfound",n),o&&i.off("locationerror",o)}}}return{stop:()=>{}}}_addUnselectCb(t){for(const e of this._unselectCb)e();this._unselectCb.length=0,this._unselectCb.push(t)}_watchSizeChangeToUpdateMinZoom(){this._stopWatchSizeChangeToUpdateMinZoom();const t=this.getContainer();t&&this.map&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(()=>{this._updateMinZoomForBounds()}),this._resizeObserver.observe(t))}_stopWatchSizeChangeToUpdateMinZoom(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0)}_addMapListeners(){const t=this.map;if(t){t.on("click",t=>{this.onMapClick(t)});for(const e of this._universalEvents)t.on(e,()=>this.emitter.emit(e,this),t);t.on("movestart",()=>{Ro.queue.abort()}),t.on("zoomstart",()=>{Ro.queue.abort()});for(const e of this._positionEvents)t.on(e,t=>this.emitter.emit(e,Ct(t)),t)}}_updateMinZoomForBounds(t){var e;const i=this.map;if(i){t=null!=t?t:i.getMinZoom();const o=P.latLngBounds(P.latLng(-90,-18e3),P.latLng(90,18e3)),n=null!=(e=i.options.maxBounds)?e:o;if(void 0!==n){i.setMinZoom(0);const e=i.getBoundsZoom(n,!0),o=t<e?e:t;i.options.minZoom=o,i.setMinZoom(o),i.getZoom()<o&&i.setZoom(o)}}}};wn(xn,"layerAdapters",{GEOJSON:class extends Ot{constructor(t,e){super(t,e),ii(this,"layer"),ii(this,"selected",!1),ii(this,"type"),ii(this,"_layers",[]),ii(this,"_events"),ii(this,"paint"),ii(this,"selectedPaint"),ii(this,"_selectedLayers",[]),ii(this,"_filteredLayers",[]),ii(this,"_filterFun"),ii(this,"_openedPopup",[]),ii(this,"_paint"),ii(this,"$updateTooltip",$(()=>{this.updateTooltip()},300)),ii(this,"$unselect",()=>{this.unselect()}),this._events=new Dt(this),this._paint=new Ve(this)}addLayer(t){return Object.assign(this.options,t),this.paint=t.paint,this.layer=new P.FeatureGroup([],ei(ti({},t.nativeOptions),{pane:this.pane})),this.selectedPaint=t.selectedPaint,t.paint=this.paint,t.data&&this.addData(t.data),this._addMapListener(),this.layer}beforeRemove(){this._removeMapListener()}select(t){if(this.unselect(),t){const e=this._layers.filter(t);for(const t of e)this._selectLayer(t,"api")}else this.selected||(this.selected=!0,this.selectedPaint&&this._paint.setPaintEachLayer(this.selectedPaint))}unselect(t){if(t){this._layers.filter(t).forEach(t=>{this._unSelectLayer(t)})}else if(this.selected){for(const t of this._openedPopup)this._removePopup(t[0]);this.paint&&this._paint.setPaintEachLayer(this.paint),this._selectedLayers.length=0,this.selected=!1}}getSelected(){return this._selectedLayers.map(t=>ti({target:this,feature:t.feature,layer:t},xt(t.feature)))}getFiltered(){return this._filteredLayers}filter(t){this._filterFun=t;const e=this.layer,i=e&&e._map;if(e&&i){e.remove();const o=[];this._layers.forEach(({feature:i,layer:n})=>{if(n){!t||t(ti({target:this,feature:i,layer:n},xt(i)))?(e.addLayer(n),o.push(ti({target:this,feature:i,layer:n},xt(i)))):e.removeLayer(n)}}),this._filteredLayers=o,e.addTo(i)}return this._filteredLayers}cleanFilter(){this.filter()}getLayers(){return this._layers.map(({layer:t,feature:e})=>ti({feature:e,layer:t,visible:t&&!!t._map,target:this},xt(e)))}clearLayer(t){this.unselect();const e=this.layer;if(e)if(t)for(let i=this._layers.length;i--;){const o=this._layers[i];if(o){const{feature:n,layer:r}=o;if(n&&r){t(n)&&(e.removeLayer(r),this._layers.splice(i,1))}}}else e.clearLayers(),this._layers=[]}setData(t){this.clearLayer(),this.addData(t)}addData(t){const e=this.options;let i;if(e){if(t){let o;if(e.type)o=e.type;else{const e=function(t){let e;e="FeatureCollection"===t.type?gt(t.features.map(t=>t.geometry.type)):"GeometryCollection"===t.type?gt(t.geometries.map(t=>t.type)):"Feature"===t.type?t.geometry.type:t.type;return e}(t);o=yt[e]}if(this.type&&this.type!==o)return void console.warn("no other data type than layer can be added");this.type=o,t=function(t,e){if("FeatureCollection"===t.type)t.features=t.features.filter(t=>bt(t.geometry.type,e));else if("Feature"===t.type){if(!bt(t.geometry.type,e))return!1}else"GeometryCollection"===t.type&&(t.geometries=t.geometries.filter(t=>bt(t.type,e)));return t}(t,o),t&&(i=this._getGeoJsonOptions(e,o))}new P.GeoJSON(t||void 0,i)}}openPopup(t,e){if(t){this._layers.filter(t).forEach(t=>{this._openPopup(t,e,"api")})}}closePopup(t){(t?this._openedPopup.filter(e=>t(e[2])):this._openedPopup).forEach(t=>{this._removePopup(t[0])})}updateTooltip(t){t?this._updateTooltip(t):this.getLayers().forEach(t=>this._updateTooltip({feature:t.feature,layer:t.layer}))}getExtent(){return this.getBounds()}getBounds(){if(this.layer){const t=this.layer.getBounds();if(t.isValid())return mt(t)}}setOpacity(t){this.options.opacity=t,this.setPaint(this.paint),this.setSelectedPaint(this.selectedPaint)}setPaint(t){if(t){this.paint=t;for(const e of this._layers)this._paint.setPaint(e,t)}}setSelectedPaint(t){if(t){this.selectedPaint=t;for(const e of this._selectedLayers)this._paint.setPaint(e,t)}}updatePaint(t){this.paint=ti(ti({},this.paint),t);for(const e of this._layers)this._paint.setPaint(e,this.paint)}updateSelectedPaint(t){this.selectedPaint=ti(ti({},this.selectedPaint),t);for(const e of this._selectedLayers)this._paint.setPaint(e,this.selectedPaint)}_getSelected(t){return this._selectedLayers.find(e=>e.layer===t)}_updateTooltip(t){const{feature:e,layer:i}=t,{label:o,labelField:n,labelOnHover:r}=this.options;if(i){let s;if(i.unbindTooltip(),e.properties&&n?s=e.properties[n]:o&&(s=o(ti(ti({target:this},t),xt(e)))),s){const t=!r;i.bindTooltip(String(s),{permanent:t,sticky:!1})}}}_openPopup(t){return e=this,i=arguments,o=function*(t,e={},i,o){var n,r;const{feature:s,layer:a}=t,{minWidth:l,autoPan:c,maxWidth:h,closeButton:u}=ti({minWidth:300},e),p=null!=u?u:!this.options.selectOnHover;let d;const f=[],m=t=>{f.push(t)},g=()=>{d&&this._removePopup(d)};let y;if(y=e.createPopupContent?yield e.createPopupContent(ti({layer:a,feature:s,target:this,type:i,close:g,onClose:m},xt(s))):e.popupContent,y&&a){const e={minWidth:l,autoPan:c,closeButton:p,closeOnClick:!1,autoClose:!1};if(tt(h)&&(e.maxWidth=h),d=a.bindPopup(y,e),null==(r=null==(n=this.options.popupOptions)?void 0:n.unselectOnClose)||r){const t=a.getPopup();t&&t.once("remove",()=>{g()},this)}this._openedPopup.push([d,f,t]),d.openPopup(o)}},new Promise((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())});var e,i,o}_removePopup(t){var e,i;if(this.map){t.closePopup().unbindPopup();const o=this._openedPopup.findIndex(e=>e[0]===t);if(-1!==o){const t=null==(i=null==(e=this.options.popupOptions)?void 0:e.unselectOnClose)||i,[,n,r]=this._openedPopup[o];for(const e of n)e(r);n.length=0,t&&this._unSelectLayer(r),this._openedPopup.splice(o,1)}}}_getGeoJsonOptions(t,e){const i=t.paint;let o={};return"function"==typeof i?"point"===e?o.pointToLayer=(t,e)=>{const o=i(t);return this._paint.createPaintToLayer(o)(t,e)}:o={style:t=>this._paint.preparePaint(t?ti(ti({},_t),i(t)):ei(ti({},_t),{type:"path"}))}:o=this._paint.createPaintOptions(i),o.onEachFeature=(t,e)=>{this._onEachFeature(t,e)},o}_onEachFeature(t,e){const i=this.layer;if(i){const o=ti({target:this,feature:t,layer:e},xt(t));e.options.pane=this.pane,this._layers.push(o);let n=!0;if(this._filterFun&&(n=this._filterFun(o)),n){const{popup:n,popupOptions:r,selectable:s,interactive:a,selectOnHover:l}=this.options;e.options.interactive=!tt(a)||a,i.addLayer(e),s&&(l?(e.on("mouseover",()=>{this._selectLayer(o,"hover")}),e.on("mouseout",()=>{this._unSelectLayer(o)})):e.on("click",t=>this._selectOnLayerClick(t),this)),this._events.handleMouseEvents(e),setTimeout(()=>{n&&this._openPopup(ti({target:this,layer:e,feature:t},xt(t)),r,"api"),this._updateTooltip({layer:e,feature:t})})}}}_selectOnLayerClick(t){P.DomEvent.stopPropagation(t);const e=t.target,i=e.feature,o=ti({target:this,layer:e,feature:i},xt(i)),n=this._getSelected(e);n?this.options&&this.options.unselectOnSecondClick&&this._unSelectLayer(n):this._selectLayer(o,"click",t.latlng)}_selectLayer(t,e,i){const{multiselect:o}=this.options;o||(this.map._addUnselectCb(()=>{this._unSelectLayer(t)}),this._selectedLayers.forEach(t=>this._unSelectLayer(t))),this._selectedLayers.push(t),this.selected=!0;const{selectedPaint:n,popupOnSelect:r,popupOptions:s}=this.options;if(n&&t.layer&&this._paint.setPaint(t,n),r&&this._openPopup(t,s,e,i),this.options.onSelect){const i=t.feature?[t.feature]:[];this.options.onSelect(ti({type:e,layer:this,features:i},xt(i)))}}_unSelectLayer(t){const e=this._selectedLayers.indexOf(t);-1!==e&&(this._selectedLayers.splice(e,1),this.options&&(this.options.paint&&this._paint.setPaint(t,this.options.paint),this.options.popupOnSelect&&t.layer&&this._removePopup(t.layer))),this.selected=this._selectedLayers.length>0}_addMapClickListener(){const t=this.map;if(t){const{unselectOnClick:e}=this.options;(null==e||e)&&t.on("click",this.$unselect)}}_removeMapClickListener(){this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip),this.map.off("click",this.$unselect)}_addMapListener(){const t=this.map;if(t){const{label:e,labelField:i,labelOnHover:o}=this.options;this._addMapClickListener(),!i&&!e||o||(t.on("zoomend",this.$updateTooltip),t.on("moveend",this.$updateTooltip))}}_removeMapListener(){this._removeMapClickListener(),this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip)}},IMAGE:Ro,TILE:Yo,WMS:class extends Ot{addLayer(t){var e;Object.assign(this.options,t);const i=t,{url:o}=i,n=((t,e)=>{var i={};for(var o in t)hn.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&cn)for(var o of cn(t))e.indexOf(o)<0&&un.call(t,o)&&(i[o]=t[o]);return i})(i,["url"]);if(o){const i=dn(dn({pane:this.pane,attribution:n.attribution,minZoom:n.minZoom,maxZoom:n.maxZoom,layers:t.layers,format:t.format,version:t.version,transparent:null==(e=t.transparent)||e},t.params),t.nativeOptions);let s;const a=pi(n);return s=a?new rn(o,(r=dn({},i),an(r,ln({request:a})))):new P.TileLayer.WMS(o,i),s}var r}},OSM:class extends Yo{addLayer(t){return super.addLayer((e=((t,e)=>{for(var i in e||(e={}))en.call(e,i)&&nn(t,i,e[i]);if(tn)for(var i of tn(e))on.call(e,i)&&nn(t,i,e[i]);return t})({name:"OpenStreetMap",attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'},t),$o(e,Xo({url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}))));var e}}}),wn(xn,"controlAdapters",{ZOOM:P.Control.Zoom,ATTRIBUTION:class extends P.Control.Attribution{constructor(t){super(t);const e=t&&t.customAttribution;if(e){let t=[];Array.isArray(e)?t=e:e&&(t=[e]),t.forEach(t=>this.addAttribution(t))}}}}),wn(xn,"Map",P.Map);let Pn=xn;const Ln={brill:'<path d="m6 0-5 6 5 6 5-6z"/>',circle:'<circle cx="6" cy="6" r="6"/>',rect:'<rect width="12" height="12"/>',marker:'<path d="m6 0c-1.85 0-4 1.19-4 4.22 0 2.05 3.08 6.59 4 7.78 0.821-1.19 4-5.62 4-7.78 0-3.03-2.15-4.22-4-4.22z"/>',cross:'<path d="M 2.4,12 6,8.4 9.6,12 12,9.6 8.4,6 12,2.4 9.6,0 6,3.6 2.4,0 0,2.4 3.6,6 0,9.6 Z"/>',star:'<path d="m6 0.25 1.71 4.18 4.29-1.04e-4 -3.43 3.14 0.857 4.18-3.43-3.14-3.43 3.14 0.857-4.18-3.43-3.14 4.29-0.209z"/>',triangle:'<path d="m12 11.7h-12l6-11.2z"/>',plus:'<path d="m7.5 12v-4.5h4.5v-3h-4.5v-4.5h-3v4.5h-4.5v3h4.5v4.5z"/>',minus:'<path d="m12 7.5v-3h-12v3z"/>',asterisk:'<path d="m7.59 12v-3.27l2.83 1.64 1.58-2.74-2.85-1.64 2.83-1.64-1.56-2.74-2.83 1.64v-3.24h-3.17v3.24l-2.85-1.64-1.57 2.74 2.84 1.64-2.84 1.64 1.57 2.74 2.85-1.64v3.27z"/>'};const On=/\{ *([\w_-]+) *\}/g;function Cn(t,e){return t.replace(On,(t,i)=>{let o=e[i];if(void 0===o)throw new Error("No value provided for letiable "+t);return"function"==typeof o&&(o=o(e)),o})}var kn=Object.defineProperty,En=Object.getOwnPropertySymbols,Mn=Object.prototype.hasOwnProperty,An=Object.prototype.propertyIsEnumerable,Tn=(t,e,i)=>e in t?kn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;function Sn(t){return e=this,i=null,o=function*(){const{params:e,name:i,connector:o,requestOptions:n}=t,r=yield o.connect();let s=r&&r[i];if(s){s=[...s];let t=s.shift();if(s.length){const i={};for(let t=0;t<s.length;t++){const o=s[t];if(i[t]=`{${o}}`,void 0===e[o])throw new Error(`\`${o}\` URL API argument is not specified`)}t&&(t=Cn(t,i))}if(e){const i=[],o=e.paramList;Array.isArray(o)&&o.forEach(([t,e])=>{i.push(`${t}=${e}`)});for(const t in e)-1===s.indexOf(t)&&i.push(`${t}=${e[t]}`);i.length&&(t=`${t}?${i.join("&")}`)}if(t)return o.makeQuery(t,e,((t,e)=>{for(var i in e||(e={}))Mn.call(e,i)&&Tn(t,i,e[i]);if(En)for(var i of En(e))An.call(e,i)&&Tn(t,i,e[i]);return t})({cacheName:i},n));throw new Error("Request URL is not set")}},new Promise((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())});var e,i,o}var In=Object.defineProperty,zn=(t,e,i)=>((t,e,i)=>e in t?In(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);const jn=class t{constructor(e={}){var i;zn(this,"cache",[]);const o=null!=(i=e.namespace)?i:"default";return t.instance[o]?t.instance[o]:(t.instance[o]=this,this)}clean(){this.cache.length=0}all(){return this.cache}addFull(t,e,i,o){return"object"==typeof i&&"valueToSet"in i&&(i.onlyFull=!0),this.add(t,e,i,!0,o)}add(t,e,i,o,n){let r,s;"object"==typeof i&&"valueToSet"in i?(r=i,o=r.onlyFull,n=r.expirationTime,s=r.props):s=i;const a=this._find(t,s);if(a)return a.value;{let i;i=e instanceof Function?e():e;const r=s&&JSON.parse(JSON.stringify(ut(s)));n=n?Date.now()+n:void 0;const a={key:t,value:i,props:r,expirationTime:n};return o&&!et(i)?i:(this.cache.push(a),i instanceof Promise?(i.catch(()=>{this.delete(t,s)}),o&&i.then(e=>(et(e)||this.delete(t,s),e)),i):i)}}match(t,e){const i=this._find(t,e);if(!(i&&i.expirationTime&&Date.now()>i.expirationTime))return null==i?void 0:i.value;this.delete(i)}matchAll(t,e){const i=Date.now();return this.cache.forEach(t=>{t.expirationTime&&i>t.expirationTime&&this.delete(t)}),t?this.cache.filter(i=>this._filter(i,t,e)).map(t=>t.value):this.cache.map(t=>t.value)}delete(t,e){const i="string"==typeof t?this.cache.filter(i=>this._filter(i,t,e)):[t];for(const o of i){const t=this.cache.indexOf(o);-1!==t&&this.cache.splice(t,1)}}_find(t,e){return this.cache.find(i=>this._filter(i,t,e))}_filter(t,e,i){if(t.key!==e)return!1;if(!i)return!0;return ht(t.props||{},ut(i))}};zn(jn,"instance",{});let Bn=jn;var Zn="4.0.0-rc.0";class Nn extends Error{constructor(t="AbortError"){super(t),this.name="AbortError"}}var Rn=Object.defineProperty,Dn=(t,e,i)=>((t,e,i)=>e in t?Rn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class qn extends Error{constructor(t){super(),Dn(this,"name","NgwError"),Dn(this,"title"),Dn(this,"message"),Dn(this,"detail"),Dn(this,"exception"),Dn(this,"status_code"),Dn(this,"data"),Dn(this,"guru_meditation"),Object.assign(this,t),Object.setPrototypeOf(this,qn.prototype)}}var Fn=Object.defineProperty,Un=(t,e,i)=>((t,e,i)=>e in t?Fn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Wn extends qn{constructor(t){super(t),Un(this,"name","InsufficientPermissionsError"),Un(this,"exception","nextgisweb.core.exception.InsufficientPermissions"),Object.setPrototypeOf(this,Wn.prototype)}}var Hn=Object.defineProperty,Vn=(t,e,i)=>((t,e,i)=>e in t?Hn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);let Gn=class t extends qn{constructor(e){super(e),Vn(this,"message","There is no response from the server or problem connecting to server."),Vn(this,"title","Network error"),Vn(this,"detail","Check network connectivity and try again later."),Object.setPrototypeOf(this,t.prototype)}};var Jn=Object.defineProperty,Kn=(t,e,i)=>((t,e,i)=>e in t?Jn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class Yn extends Error{constructor(t){super(),Kn(this,"name","NetworkError"),Object.setPrototypeOf(this,Yn.prototype),this.message=`Unable to request ${t}.\n Possibly invalid NGW URL entered or CORS not configured to get request from ${location.origin}`}}var Qn=Object.defineProperty,$n=(t,e,i)=>((t,e,i)=>e in t?Qn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Xn extends qn{constructor(t){super(t),$n(this,"name","ResourceNotFoundError"),$n(this,"exception","nextgisweb.resource.exception.ResourceNotFound"),Object.setPrototypeOf(this,Xn.prototype)}}var tr=Object.freeze({__proto__:null,AbortError:Nn,InsufficientPermissionsError:Wn,NetworkError:Yn,NetworksResponseError:Gn,NgwError:qn,ResourceNotFoundError:Xn,extractError:function(t){if(pt(t))return t.name&&t.message&&t.title?{title:t.title,message:t.message,detail:t.detail||null,data:t.data&&t.data.data?t.data.data:null}:!t.exception||void 0!==t.status&&0!==t.status&&void 0!==t.data?{title:"string"==typeof t.title?t.title:"Unexpected error",message:"string"==typeof t.message?t.message:"Something went wrong."}:new Gn({title:t.title,status_code:t.status_code,exception:t.exception})},isError:function(t){return!!pt(t)&&(t.status_code&&t.exception&&t.title)}}),er=Object.defineProperty,ir=(t,e,i)=>((t,e,i)=>e in t?er(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class or extends Error{constructor(t){super(t||"Something went wrong."),ir(this,"title"),this.name="BaseAPIError",this.title="Unknown API error",Error.captureStackTrace&&Error.captureStackTrace(this,or)}}class nr extends or{constructor(t){super(t||"There is no response from the server or problem connecting to server."),ir(this,"detail"),this.title="Network error",this.detail="Check network connectivity and try again later."}}class rr extends or{constructor(t){super(t||"Something went wrong."),this.title="Unexpected server response"}}class sr extends or{constructor(t){super(t.message),ir(this,"detail"),ir(this,"data"),this.title=t.title||this.title,this.detail=t.detail||null,this.data=t}}class ar extends Error{constructor(t,e={}){super(t||"Unexpected error while processing long-running request."),ir(this,"title"),ir(this,"data"),this.name="LunkwillError",this.title="Long-running request error",this.data=e,Error.captureStackTrace&&Error.captureStackTrace(this,ar)}}class lr extends ar{constructor(t){super("Long-running request was cancelled.",t)}}class cr extends ar{constructor(t){super(void 0,t)}}var hr=Object.defineProperty,ur=Object.getOwnPropertySymbols,pr=Object.prototype.hasOwnProperty,dr=Object.prototype.propertyIsEnumerable,fr=(t,e,i)=>e in t?hr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,mr=(t,e)=>{for(var i in e||(e={}))pr.call(e,i)&&fr(t,i,e[i]);if(ur)for(var i of ur(e))dr.call(e,i)&&fr(t,i,e[i]);return t},gr=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});function yr(t){return gr(this,null,function*(){const e=yield function(t){return gr(this,null,function*(){try{return t.json()}catch(e){throw new Error}})}(t);let i=e.delay_ms;const o=void 0!==e.retry_ms?e.retry_ms:2e3,n=`/api/lunkwill/${e.id}/summary`,r=`/api/lunkwill/${e.id}/response`,s=t=>new Promise(e=>setTimeout(e,t));let a=!1,l=!1;for(;!l;){let t,e;yield s(a?o:i),a=!1;try{t=yield fetch(n,{credentials:"same-origin"}),e=yield t.json()}catch(c){a=!0;continue}switch(e.status){case void 0:throw new ar(void 0,e);case"ready":l=!0;break;case"cancelled":throw new lr(e);case"failed":throw new cr(e);case"spooled":case"processing":case"buffering":i=e.delay_ms;break;default:throw new ar(void 0,e)}}return r})}const _r=new RegExp(["application/pdf","image/png","image/jpeg","image/tiff","text/csv"].join("|"));function vr(t,e){let i="";return void 0!==e&&(i="?"+function(t){const e=[];for(const[i,o]of Object.entries(t))if("string"==typeof o||"number"==typeof o||"boolean"==typeof o)e.push(`${i}=${encodeURIComponent(o)}`);else if(Array.isArray(o))e.push(`${i}=${o.map(encodeURIComponent).join(",")}`);else for(const[t,n]of Object.entries(o)){const o=`${i}[${encodeURIComponent(t)}]`;if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)e.push(`${o}=${encodeURIComponent(n)}`);else if(Array.isArray(n)){const t=n.map(encodeURIComponent);e.push(`${o}=${t.join(",")}`)}}return e.join("&")}(e)),t+i}function br(t,e,i){return gr(this,null,function*(){var o,n;const r=mr(mr({},{method:"GET",credentials:"same-origin",headers:{}}),e),{withCredentials:s,responseType:a,cacheProps:l,cacheName:c,lunkwill:h,cache:u,query:p,json:d}=r,f=((t,e)=>{var i={};for(var o in t)pr.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&ur)for(var o of ur(t))e.indexOf(o)<0&&dr.call(t,o)&&(i[o]=t[o]);return i})(r,["withCredentials","responseType","cacheProps","cacheName","lunkwill","cache","query","json"]);f.method=null==(o=f.method)?void 0:o.toUpperCase(),s&&(f.credentials="include");let m=!1;void 0!==h&&(h.toHeaders(f.headers||{}),m=!0);const g=!!f.lunkwillReturnUrl;if(delete f.lunkwillReturnUrl,void 0!==d){f.body=JSON.stringify(d);const t=f.headers||{};t["Content-Type"]="application/json",f.headers=t}const y=vr(t,p),_=()=>gr(null,null,function*(){let t;try{t=yield fetch(y,f)}catch(n){if(f.signal&&f.signal.aborted)throw n;throw new nr}if(m&&function(t){const e=t.headers.get("content-type");return null!=e&&e.includes("application/vnd.lunkwill.request-summary+json")}(t)){const e=yield yr(t);if(g)return e;t=yield function(t){return gr(this,null,function*(){try{return yield window.fetch(t,{credentials:"same-origin"})}catch(n){throw new nr}})}(e)}const e=t.headers.get("content-type"),i=e&&(e.includes("application/json")||e.includes("application/vnd.lunkwill.request-summary+json"));let o;try{const n=e&&_r.test(e);if("blob"===a||n)o=yield t.blob();else{if(!i)throw new rr;o=yield t.json()}}catch(n){if("AbortError"===n.name||n instanceof rr)throw n;throw new rr}if(400<=t.status&&t.status<=599)throw new sr(o);return o});if(i)if("GET"===(null==(n=f.method)?void 0:n.toUpperCase())){if(!1!==u){const t=l||mr({},ut({withCredentials:s,responseType:a}));return i.add(c||y,_,{props:t,expirationTime:u?void 0:500})}}else{["api/feature_layer/identify"].every(e=>!t.includes(e))&&i.clean()}return _()})}var wr=Object.defineProperty,xr=Object.defineProperties,Pr=Object.getOwnPropertyDescriptors,Lr=Object.getOwnPropertySymbols,Or=Object.prototype.hasOwnProperty,Cr=Object.prototype.propertyIsEnumerable,kr=(t,e,i)=>e in t?wr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Er=(t,e)=>{for(var i in e||(e={}))Or.call(e,i)&&kr(t,i,e[i]);if(Lr)for(var i of Lr(e))Cr.call(e,i)&&kr(t,i,e[i]);return t},Mr=(t,e)=>{var i={};for(var o in t)Or.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&Lr)for(var o of Lr(t))e.indexOf(o)<0&&Cr.call(t,o)&&(i[o]=t[o]);return i};function Ar(t,e,i,...o){const[n,...r]=i[t],s=o[0];let a;if(void 0===s)a=[];else if("object"==typeof s&&null!==s){if(o.length>1)throw new Error("Too many arguments for route(name, object)!");a=[];for(const[t,e]of Object.entries(s))a[r.indexOf(t)]=String(e)}else a=o.map(t=>String(t));return dt(e+n.replace(/\{(\w+)\}/g,function(t,e){const i=parseInt(e),o=a[i];if(void 0===o){throw new Error(`Undefined parameter ${i} in "${n}".`)}return String(o)}))}function Tr(t,e,...i){const o={url:o=>{return n=null,r=null,s=function*(){var n;const r=yield e.connect();return vr(Ar(t,null!=(n=e.options.baseUrl)?n:"",r,...i),null==o?void 0:o.query)},new Promise((t,e)=>{var i=t=>{try{a(s.next(t))}catch(i){e(i)}},o=t=>{try{a(s.throw(t))}catch(i){e(i)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,o);a((s=s.apply(n,r)).next())});var n,r,s}},n=["get","post","put","delete","patch"];for(const r of n){const n=o=>{var n;const s=o||{},{headers:a}=s,l=Mr(s,["headers"]);if(null==(n=null==o?void 0:o.signal)?void 0:n.aborted)throw new Nn;return e.connect().then(o=>{var n;const s=Ar(t,null!=(n=e.options.baseUrl)?n:"",o,...i),c=ut(Er(Er({},e.getAuthorizationHeaders()),null!=a?a:{}));return br(s,(h=Er({headers:c},l),xr(h,Pr({method:r}))),e.cache);var h})};o[r]=n}return o}function Sr(t){return"[object Object]"===Object.prototype.toString.call(t)}let Ir;Ir=(t,e,i={},o,n)=>{i.method=i.method||"GET";const r=new XMLHttpRequest;r.open(i.method||"GET",t,!0),"blob"===i.responseType&&(r.responseType=i.responseType);const s=()=>{try{return JSON.parse(r.responseText)}catch(t){return r.responseText}};r.onload=()=>{-1!==[401,403,404,422,500].indexOf(r.status)&&o(new qn(s())),((t=!1)=>{const n=t?o:e;"blob"===i.responseType?n(r.response):r.responseText?n(s()):o({message:""})})()},r.onerror=e=>{o(0===r.status?new Yn(t):e)},r.upload.onprogress=function(t){if(t.lengthComputable){i.onProgress&&i.onProgress(t.loaded/t.total*100,t)}};const a=i.headers;if(a)for(const c in a){const t=a[c];"string"==typeof t&&r.setRequestHeader(c,t)}let l;if(void 0!==i.withCredentials&&(r.withCredentials=i.withCredentials),i.file){if(l=new FormData,l.append("file",i.file),i.data)for(const c in i.data)l.append(c,l[c])}else l=i.data?"string"==typeof i.data?i.data:JSON.stringify(i.data):null;n&&n(()=>{r.abort()}),r.send(l)};const zr=[];function jr(t){zr.push(t)}var Br=Object.defineProperty,Zr=Object.defineProperties,Nr=Object.getOwnPropertyDescriptors,Rr=Object.getOwnPropertySymbols,Dr=Object.prototype.hasOwnProperty,qr=Object.prototype.propertyIsEnumerable,Fr=(t,e,i)=>e in t?Br(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ur=(t,e)=>{for(var i in e||(e={}))Dr.call(e,i)&&Fr(t,i,e[i]);if(Rr)for(var i of Rr(e))qr.call(e,i)&&Fr(t,i,e[i]);return t},Wr=(t,e,i)=>Fr(t,"symbol"!=typeof e?e+"":e,i),Hr=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});let Vr=0,Gr=0;class Jr{constructor(t){Wr(this,"options",t),Wr(this,"id",Vr++),Wr(this,"emitter",new H),Wr(this,"user"),Wr(this,"cache"),Wr(this,"withCredentials"),Wr(this,"routeCache"),Wr(this,"client",`NextGIS-NGW-Connector/${Zn}`),Wr(this,"routeStr","/api/component/pyramid/route"),Wr(this,"activeRequests",{}),Wr(this,"requestTransform");const e=function(t){return zr.find(e=>{if(e.options.baseUrl===t.baseUrl){if(!t.auth)return!0;if(e.options.auth)return ht(e.options.auth,t.auth)}})}(t);if(this.cache=new Bn({namespace:t.cacheId}),this.routeCache=new Bn({namespace:"routecache"}),e)return e;{const{route:t,requestTransform:e,withCredentials:i}=this.options;t&&(this.routeStr=t),e&&(this.requestTransform=e),void 0!==i&&(this.withCredentials=i),jr(this)}}clearCache(){this.cache.clean()}setRequestTransform(t){this.requestTransform=t}setNgw(t){this.logout(),this.options.baseUrl=t,jr(this)}connect(){return Hr(this,arguments,function*({signal:t}={}){const e=this.options.auth;if(e){const{login:t,password:i}=e;t&&i&&(yield this._login({login:t,password:i}))}const i=`${this.routeStr}?client=${this.client}`;return this.routeCache.add(this.options.baseUrl||String(this.id),()=>this.makeQuery(i,null,{signal:t,cache:!1}))})}login(t,e){return this.logout(),jr(this),this._login(t,e)}logout(){this.abort(),function(t){const e=zr.indexOf(t);-1!==e&&zr.splice(e,1)}(this),this.options.auth=void 0,this.user=void 0,this.routeCache.clean(),this.clearCache(),this.emitter.emit("logout")}getUserInfo(t,e){return Hr(this,null,function*(){if(this.user&&this.user.id)return this.user;t&&(this.options.auth=t);const i=Ur({headers:this.getAuthorizationHeaders(t),cache:!0},e);return this.makeQuery("/api/component/auth/current_user",{},i)})}getAuthorizationHeaders(t){const e=this.makeClientId(t);return e?{Authorization:`Basic ${e}`}:{}}makeClientId(t){if(t=t||this.options.auth){const{login:e,password:i}=t;return window.btoa(`${e}:${i}`)}}abort(){for(const t of Object.values(this.activeRequests))t.abort();this.activeRequests={}}getActiveApiRequests(){return Ur({},this.activeRequests)}route(t,...e){return Tr(t,this,...e)}makeQuery(t,e){return Hr(this,arguments,function*(t,e,i={}){var o;if(!(t=(this.options.baseUrl?this.options.baseUrl:"")+t))throw new Error("Empty `url` not allowed");if(e){const i=e,o=((t,e)=>{var i={};for(var o in t)Dr.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&Rr)for(var o of Rr(t))e.indexOf(o)<0&&qr.call(t,o)&&(i[o]=t[o]);return i})(i,["paramList"]);t=Cn(t,o)}t=encodeURI(dt(t)),i=Ur({withCredentials:this.withCredentials},i);const{cache:n,signal:r,method:s="GET",headers:a,cacheName:l,cacheProps:c,responseType:h,withCredentials:u}=i,p=new AbortController,d=p.signal;if(r){if(r.aborted)throw new Nn;r.addEventListener("abort",()=>{p.abort()})}i.signal=d;const f=()=>Hr(this,null,function*(){const e=Gr++;this.activeRequests[e]=p;try{return this._loadData(t,i)}finally{this._cleanActiveRequest(e)}});if("GET"===s&&!1!==n){const i=c||(m=Ur({},ut({headers:a,withCredentials:u,responseType:h,baseUrl:this.options.baseUrl,userId:null==(o=this.user)?void 0:o.id})),Zr(m,Nr({params:e})));return this.cache.add(l||t,f,{props:i,expirationTime:n?void 0:500})}var m;return f()})}_loadData(t,e){return e.responseType=e.responseType||"json",new Promise((i,o)=>{var n;if(this.user&&((e=e||{}).headers=Ur(Ur({},this.getAuthorizationHeaders()),e.headers)),this.requestTransform){const[i,o]=this.requestTransform(t,e);t=i,e=o}let r;Ir(t,i,e,o,t=>{r=t}),null==(n=e.signal)||n.addEventListener("abort",()=>{void 0!==r&&r(),o(new Nn)})}).catch(t=>{if("AbortError"!==t.name){const e=this._handleHttpError(t);if(e)throw e}throw t})}_login(t,e){return Hr(this,null,function*(){try{const i=yield this.getUserInfo(t,e);return this.user=i,this.emitter.emit("login",i),i}catch(i){throw this.emitter.emit("login:error",i),i}})}_cleanActiveRequest(t){delete this.activeRequests[t]}_handleHttpError(t){if(t&&t instanceof qn){if("nextgisweb.resource.exception.ResourceNotFound"===t.exception)throw new Xn(t);if("nextgisweb.core.exception.InsufficientPermissions"===t.exception)throw new Wn(t)}return t}}Wr(Jr,"errors",tr);const Kr=["description"];function Yr(t,e=""){e=e?e+"__":"";const i={};for(const[o,n]of Object.entries(t))if(-1===Kr.indexOf(o))if(Sr(n))if("owner_user"===o){const t=Yr(n,o);Object.assign(i,t)}else"parent"===o&&"id"in n&&(i.parent_id=n.id);else tt(n)&&(i[e+o]=n);return i}var Qr=Object.defineProperty,$r=Object.defineProperties,Xr=Object.getOwnPropertyDescriptors,ts=Object.getOwnPropertySymbols,es=Object.prototype.hasOwnProperty,is=Object.prototype.propertyIsEnumerable,os=(t,e,i)=>e in t?Qr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ns=(t,e)=>{for(var i in e||(e={}))es.call(e,i)&&os(t,i,e[i]);if(ts)for(var i of ts(e))is.call(e,i)&&os(t,i,e[i]);return t},rs=(t,e)=>$r(t,Xr(e)),ss=(t,e,i)=>os(t,"symbol"!=typeof e?e+"":e,i),as=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});class ls{constructor({connector:t,cacheId:e}){ss(this,"cache"),ss(this,"connector"),this.connector=t,this.cache=new Bn({namespace:e})}getOne(t,e){const i=ns({},e);return"string"==typeof t||"number"==typeof t||Sr(t),"string"==typeof t?this._fetchResourceBy({keyname:t},i):"number"==typeof t?this._fetchResourceById(t,i):Sr(t)?this._fetchResourceBy(t,i):Promise.resolve(void 0)}getOneOrFail(t,e){return this.getOne(t,e).then(t=>{if(t)return t;throw new Xn})}getId(t,e){return"number"==typeof t?Promise.resolve(t):"string"==typeof t||Sr(t)?this.getOne(t,e).then(t=>{if(t)return t.resource.id}):Promise.resolve(void 0)}getIdOrFail(t,e){return this.getId(t,e).then(t=>{if(void 0===t)throw new Error;return t})}getMany(t,e){return this._resourceCacheFilter(t).then(i=>{if(!i.length){const i={};return t.keyname?i.keyname=t.keyname:Object.assign(i,Yr(t)),this.connector.route("resource.search").get(rs(ns({},e),{query:ns({serialization:"full"},i)})).then(t=>{const i=Array.isArray(t)?t:t.items;if(null==e?void 0:e.cache)for(const e of i)this.cache.add("resource.item",Promise.resolve(e),{id:e.resource.id});return i})}return i})}getParent(t,e){return this.getOne(t,e).then(t=>{var i,o;return(null==(o=null==(i=null==t?void 0:t.resource)?void 0:i.parent)?void 0:o.id)?this.getOne(t.resource.parent.id,e):Promise.resolve(void 0)})}getChildrenOf(t,e){return this.getIdOrFail(t).then(t=>this._getChildrenOf(t,e))}update(t,e){return this.getId(t).then(t=>{if(void 0!==t)return this.connector.put("resource.item",{data:e},{id:t})})}delete(t){return this.getId(t).then(t=>{if(void 0!==t)return this.connector.delete("resource.item",null,{id:t}).then(()=>{this._cleanResourceItemCache(t)})})}_getChildrenOf(t,e){return as(this,arguments,function*(t,e,i=[]){let o;o="string"==typeof t?yield this.getId(t,e):"object"==typeof t?t.id:t;const n=yield this.connector.route("resource.collection").get(rs(ns({},e),{query:{parent:o}})),r=[];for(const s of n)(null==e?void 0:e.cache)&&this.cache.add("resource.item",Promise.resolve(s),{id:s.resource.id}),i.push(s),(null==e?void 0:e.recursive)&&s.resource.children&&r.push(this._getChildrenOf(s.resource.id,e,i));return r.length?Promise.all(r).then(()=>i):i})}_cleanResourceItemCache(t){return as(this,null,function*(){var e;const i=this.cache.all(),o=[];for(const n of i){const i=null==(e=n.props)?void 0:e.id;if(["resource.item","resource"].includes(n.key)&&void 0!==i)if("number"==typeof i)i===t&&o.push(n);else{(yield this.getId(i))===t&&o.push(n)}}for(const t of o)this.cache.delete(t)})}_fetchResourceById(t,e){return this.connector.route("resource.item",{id:t}).get(e)}_fetchResourceBy(t,e){return this.getMany(t,e).then(t=>t[0])}_resourceCacheFilter(t){return Promise.all(this.cache.matchAll("resource.item")).then(e=>(e.filter(e=>{if(e)return t.keyname&&e.resource.keyname?t.keyname===e.resource.keyname:tt(t.id)&&tt(e.resource.id)?t.id===e.resource.id:ht(t,e.resource)}),[]))}}var cs=Object.defineProperty,hs=(t,e,i)=>((t,e,i)=>e in t?cs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class us extends Jr{constructor(t){super(t),hs(this,"resources"),this.resources=new ls({connector:this,cacheId:t.cacheId})}static create(t){return new this(t)}clearCache(){super.clearCache(),this.resources.cache.clean()}apiRequest(t,e={},i={}){var o;return Sn({name:t,params:ut(e=null!=(o=i.params)?o:e),requestOptions:i,connector:this})}post(t,e,i){return(e=e||{}).method="POST",this.apiRequest(t,i,e)}get(t,e,i){return(e=e||{}).method="GET",this.apiRequest(t,i,e)}patch(t,e,i){return(e=e||{}).method="PATCH",this.apiRequest(t,i,e)}put(t,e,i){return(e=e||{}).method="PUT",this.apiRequest(t,i,e)}delete(t,e,i){return(e=e||{}).method="DELETE",this.apiRequest(t,i,e)}getResource(t,e){return this.resources.getOne(t,e)}getResourceOrFail(t,e){return this.resources.getOneOrFail(t,e)}getResourceBy(t){return this.resources.getOne(t)}getResourceByKeyname(t){return this.resources.getOne(t)}getResourceById(t){return this.resources.getOne(t)}getResourceId(t,e){return this.resources.getId(t,e)}getResourceIdOrFail(t,e){return this.resources.getIdOrFail(t,e)}getResourcesBy(t,e){return this.resources.getMany(t,e)}getResourceParent(t,e){return this.resources.getParent(t,e)}getResourceChildren(t,e){return this.resources.getChildrenOf(t,e)}updateResource(t,e){return this.resources.update(t,e)}deleteResource(t){return this.resources.delete(t)}}var ps=Object.defineProperty,ds=Object.defineProperties,fs=Object.getOwnPropertyDescriptors,ms=Object.getOwnPropertySymbols,gs=Object.prototype.hasOwnProperty,ys=Object.prototype.propertyIsEnumerable,_s=(t,e,i)=>e in t?ps(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,vs=(t,e)=>{for(var i in e||(e={}))gs.call(e,i)&&_s(t,i,e[i]);if(ms)for(var i of ms(e))ys.call(e,i)&&_s(t,i,e[i]);return t},bs=(t,e)=>ds(t,fs(e));function ws(t){const e=t.extent_bottom,i=t.extent_left,o=t.extent_top,n=t.extent_right;if(e&&i&&o&&n){const t=[i,e,n,o];return t[3]>82&&(t[3]=82),t[1]<-82&&(t[1]=-82),t}}function xs({resourceId:t,connector:e,cache:i=!0,signal:o}){return e.route("layer.extent",{id:Number(t)}).get({cache:i,signal:o}).then(t=>{if(t){const{maxLat:e,maxLon:i,minLat:o,minLon:n}=t.extent;return[n,o,i,e]}})}function Ps(t){return t.connector.getResource(t.resourceId,{signal:t.signal,cache:t.cache}).then(e=>{if(e)return Ls(e,t.connector,t)})}function Ls(t,e,i){if(t.webmap)return Promise.resolve(ws(t.webmap));{const o=t.resource;return o.cls&&o.parent&&-1!==o.cls.indexOf("style")?e.getResource(o.parent.id,i).then(t=>{if(t)return xs(bs(vs({},i),{resourceId:t.resource.id,connector:e}))}):xs(bs(vs({},i),{resourceId:o.id,connector:e}))}}var Os=Object.defineProperty,Cs=(t,e,i)=>((t,e,i)=>e in t?Os(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),ks=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});class Es{constructor(){Cs(this,"item"),Cs(this,"connector"),Cs(this,"_extent")}getExtent(){return ks(this,null,function*(){return this.getBounds()})}getBounds(t){return ks(this,null,function*(){return this._extent?this._extent:this.item?(this._extent=yield Ls(this.item,this.connector,t),this._extent):void 0})}}function Ms(t,e){return i=this,o=null,n=function*(){const i=t.resource,o=i;let{keyname:n,resourceId:r}=t;if(i&&("string"==typeof i?n=i:r="number"==typeof i?i:o.resource&&void 0!==o.resource&&"resource"in o?i.resource.id:yield Ms(i,e)),!r&&n){const t=yield e.getResource(n);t&&(r=t.resource.id)}return r},new Promise((t,e)=>{var r=t=>{try{a(n.next(t))}catch(i){e(i)}},s=t=>{try{a(n.throw(t))}catch(i){e(i)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((n=n.apply(i,o)).next())});var i,o,n}var As=Object.defineProperty,Ts=Object.getOwnPropertySymbols,Ss=Object.prototype.hasOwnProperty,Is=Object.prototype.propertyIsEnumerable,zs=(t,e,i)=>e in t?As(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,js=(t,e,i)=>zs(t,"symbol"!=typeof e?e+"":e,i),Bs=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});function Zs(t){return Bs(this,arguments,function*({webMap:t,adapterOptions:e={},onLayerAdded:i,createAdapter:o}){return class{constructor(){js(this,"options",{}),js(this,"layer",[]),js(this,"_removed",!1),js(this,"_creatingInProgress",!1)}addLayer(){return this.layer}removeLayer(){this._removed=!0;for(const e of this.layer)t.removeLayer(e)}destroyed(){return this._removed}showLayer(){return Bs(this,null,function*(){if(this.options.visibility=!0,this.layer.length)for(const e of this.layer)yield t.showLayer(e);else yield this.loadLayer()})}hideLayer(){return Bs(this,null,function*(){if(this.options.visibility=!1,this.layer)for(const e of this.layer)yield t.hideLayer(e)})}loadLayer(){return Bs(this,null,function*(){if(!this.layer.length&&!this._creatingInProgress){this._creatingInProgress=!0;const n=yield o(this);if(n){const o=new n(t.mapAdapter.map,((t,e)=>{for(var i in e||(e={}))Ss.call(e,i)&&zs(t,i,e[i]);if(Ts)for(var i of Ts(e))Is.call(e,i)&&zs(t,i,e[i]);return t})({},e)),r=yield o.addLayer({order:this.options.order,headers:this.options.headers,baselayer:this.options.baselayer});i&&i(o),Object.assign(o.options,e),o.layer=r,this._removed&&t.removeLayer(o),this.layer.push(o),this.options.visibility&&(yield t.showLayer(o)),this._creatingInProgress=!1}}return this.layer})}}})}function Ns(t){return e=this,i=arguments,o=function*({webMap:t,connector:e,item:i,adapterOptions:o={},idPrefix:n="first-show-adapter"}){return Zs({webMap:t,adapterOptions:o,onLayerAdded:t=>{t.options.baselayer=!1,t.id=n+"-"+i.resource_id},createAdapter:()=>Nh({resource:i.resource_id,adapterOptions:{name:i.display_name,opacity:i.opacity}},t,e)})},new Promise((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())});var e,i,o}var Rs=Object.defineProperty,Ds=Object.getOwnPropertySymbols,qs=Object.prototype.hasOwnProperty,Fs=Object.prototype.propertyIsEnumerable,Us=(t,e,i)=>e in t?Rs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ws=(t,e)=>{for(var i in e||(e={}))qs.call(e,i)&&Us(t,i,e[i]);if(Ds)for(var i of Ds(e))Fs.call(e,i)&&Us(t,i,e[i]);return t};const Hs={srs:4326,geom_format:"geojson",dt_format:"iso"};function Vs(t){return{geometry:t.geom,id:t.id,type:"Feature",properties:t.fields}}function Gs(t,e){const{extensions:i,geom:o,fields:n,srs:r,ilike:s,like:a}=e;t.extensions=i||[],n&&(t.fields=n),void 0!==o&&(t.geom=o,o||(delete t.srs,delete t.geom_format)),tt(s)?t.ilike=s:tt(a)&&(t.like=a),tt(r)&&(t.srs=r)}function Js(t){return`POLYGON((${t.map(([t,e])=>{const[i,o]=ot(t,e).map(t=>Math.round(1*(t+Number.EPSILON))/1);return i+" "+o}).join(", ")}))`}function Ks(t){const e=Ws({},Hs),{limit:i,query:o,cache:n,signal:r,offset:s,orderBy:a,paramList:l,connector:c,geomFormat:h,intersects:u,resourceId:p}=t;if("number"==typeof i&&i!==Number.POSITIVE_INFINITY&&(e.limit=i),s&&(e.offset=s),h&&(e.geom_format=h),Gs(e,t),a&&(e.order_by=a.join(",")),Array.isArray(u)){const t=function(t){return Array.isArray(t)&&4===t.length&&t.every(t=>"number"==typeof t)}(u)?rt(u):u;e.intersects=Js(t)}else"string"==typeof u&&(e.intersects=u);return l&&Object.assign(e,function(t){return t.reduce((t,[e,i])=>(t[e]=i,t),{})}(l)),c.route("feature_layer.feature.collection",{id:Number(p)}).get({query:Ws(Ws({},e),o),cache:n,signal:r})}function Ys(t){let e;for(e in t){const i=t[e];if(pt(i)){const o=i;if(tt(o.year)&&tt(o.month)&&tt(o.day)){const i=[o.year,o.month-1,o.day];"hour"in o&&[o.hour,o.minute,o.second].forEach(t=>{i.push(t)}),t[e]=new Date(...i).toISOString()}}else"id"===e&&"string"==typeof i&&(t[e]=i.split(",").map(Number))}return t}function Qs(t){return Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]}function $s(t){return Array.isArray(t)&&!Qs(t)}function Xs(t){return"id"===t?["fid"]:["get",t]}function ta(t){const[e,i,o]=t,n=String(e),r=Xs(n);switch(i){case"eq":return null===o?["is_null",r]:["==",r,o];case"ne":return null===o?["!is_null",r]:["!=",r,o];case"gt":if("number"!=typeof o&&"string"!=typeof o)throw new Error(`Operator "gt" requires number or string for "${n}"`);return[">",r,o];case"lt":if("number"!=typeof o&&"string"!=typeof o)throw new Error(`Operator "lt" requires number or string for "${n}"`);return["<",r,o];case"ge":if("number"!=typeof o&&"string"!=typeof o)throw new Error(`Operator "ge" requires number or string for "${n}"`);return[">=",r,o];case"le":if("number"!=typeof o&&"string"!=typeof o)throw new Error(`Operator "le" requires number or string for "${n}"`);return["<=",r,o];case"in":if(!Array.isArray(o)||!o.every(t=>"string"==typeof t||"number"==typeof t))throw new Error(`Operator "in" requires (string | number)[] for "${n}"`);if(!o.length)throw new Error(`Operator "in" requires non-empty array for "${n}"`);return["in",r,...o];case"notin":if(!Array.isArray(o)||!o.every(t=>"string"==typeof t||"number"==typeof t))throw new Error(`Operator "notin" requires (string | number)[] for "${n}"`);if(!o.length)throw new Error(`Operator "notin" requires non-empty array for "${n}"`);return["!in",r,...o];case"ilike":{if("string"!=typeof o)throw new Error(`Operator "ilike" requires string for "${n}"`);const t=function(t){const e=t.startsWith("%"),i=t.endsWith("%");return{field:t.slice(e?1:0,i?-1:void 0),leadingWildcard:e,trailingWildcard:i}}(n),e=`${t.leadingWildcard?"%":""}${o}${t.trailingWildcard?"%":""}`;return["ilike",Xs(t.field),e]}case"like":throw new Error(`Operator "${i}" is not supported by server FilterExpression`);default:throw new Error(`Unsupported operator: ${i}`)}}function ea(t){let e="all";const i=[];for(const o of t)if("all"!==o&&"any"!==o)if(Qs(o))i.push(ta(o));else{if(!$s(o))throw new Error("Invalid PropertiesFilter node");i.push(ea(o))}else e=o;return[e,...i]}function ia(t){return(null==t?void 0:t.length)?ea(t):[]}function oa(t){if(null==t?void 0:t.length)return JSON.stringify(ia(t))}var na=Object.defineProperty,ra=Object.defineProperties,sa=Object.getOwnPropertyDescriptors,aa=Object.getOwnPropertySymbols,la=Object.prototype.hasOwnProperty,ca=Object.prototype.propertyIsEnumerable,ha=(t,e,i)=>e in t?na(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ua=(t,e)=>{for(var i in e||(e={}))la.call(e,i)&&ha(t,i,e[i]);if(aa)for(var i of aa(e))ca.call(e,i)&&ha(t,i,e[i]);return t},pa=(t,e)=>ra(t,sa(e)),da=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});function fa(t){return da(this,null,function*(){var e;const i=t.filters;if(i){let o=yield Ks(pa(ua({},t),{query:pa(ua({},t.query),{filter:oa(i)})}));return null!=(e=t.clientFilterValidate)&&e&&(o=o.filter(t=>Oe(Ys(pa(ua({},t.fields),{id:t.id})),i))),o}return Ks(t)})}function ma({options:t,webMap:e,baseUrl:i}){var o;let n,r=t.adapter||"IMAGE";const s=e&&e.getLayerAdapters(),a=t.resource,l=t.tileNoData?t.tileNoData:200;if("number"==typeof a){if("IMAGE"===r){if(!s||s.IMAGE)return function({resourceId:t,baseUrl:e,nd:i,headers:o}){const n=e+"/api/component/render/image",r={resource:t};return i&&(r.nd=i),{url:n,resourceId:t,headers:o,params:r,updateWmsParams:e=>(i&&(e.nd=i),lc(e,t))}}({resourceId:a,headers:t.headers,nd:l,baseUrl:i});r="TILE"}if("WMS"===r){n=`${i}/api/resource/${a}/wms`;const e=t.adapterOptions;return{url:n,format:"image/png",version:"1.1.1",layers:e&&e.layers,headers:t.headers}}if("MVT"===r)return n=i+"/api/component/feature_layer/mvt?x={x}&y={y}&z={z}&resource="+a+"&simplification="+(null!=(o=t.simplification)?o:6),{url:n,sourceLayer:"ngw:"+a,featureIdName:"$id"};if("TERRAIN"===r)return n=i+`/api/resource/${a}/terrain_provider`,{url:n,adapter:r};if("MODEL_3D"===r)return n=i+`/api/component/model_3d/${a}/data.glb`,{url:n};if("TILE"===r)return n=i+"/api/component/render/tile?z={z}&x={x}&y={y}&resource="+a+"&nd="+l,{url:n,adapter:r}}else{if(void 0!==a)throw new Error("Option `resource` must be number, not "+typeof a);console.log("Option `resource` not set")}}var ga=Object.defineProperty,ya=Object.defineProperties,_a=Object.getOwnPropertyDescriptors,va=Object.getOwnPropertySymbols,ba=Object.prototype.hasOwnProperty,wa=Object.prototype.propertyIsEnumerable,xa=(t,e,i)=>e in t?ga(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Pa=(t,e)=>{for(var i in e||(e={}))ba.call(e,i)&&xa(t,i,e[i]);if(va)for(var i of va(e))wa.call(e,i)&&xa(t,i,e[i]);return t},La=(t,e)=>ya(t,_a(e)),Oa=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});function Ca(t){return Oa(this,null,function*(){const e=Pa({},Hs);Gs(e,t);const i=yield t.connector.route("feature_layer.feature.item",{id:Number(t.resourceId),fid:t.featureId}).get(La(Pa({},t),{query:e}));return La(Pa({},i),{toGeojson:()=>Oa(null,null,function*(){if(i.geom)return Vs(i);{const e=(yield Ca(La(Pa({},t),{geom:!0,fields:null,extensions:null}))).geom;return Vs(La(Pa({},i),{geom:e}))}})})})}var ka=Object.defineProperty,Ea=Object.getOwnPropertySymbols,Ma=Object.prototype.hasOwnProperty,Aa=Object.prototype.propertyIsEnumerable,Ta=(t,e,i)=>e in t?ka(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Sa=(t,e,i)=>Ta(t,"symbol"!=typeof e?e+"":e,i);class Ia{constructor(t){Sa(this,"options",t),Sa(this,"name"),Sa(this,"resourceId"),Sa(this,"item"),Sa(this,"_extent"),this.resourceId=t.resourceId;const e=t.item;this.item=e,this.name=t.labelField&&e.fields?e.fields[t.labelField]:String(e.id)}extent(t){return this._extent?Promise.resolve(this._extent):this.options.connector.route("feature_layer.feature.item_extent",{id:this.resourceId,fid:this.item.id}).get(t).then(t=>{if(t.extent){const{minLat:e,minLon:i,maxLat:o,maxLon:n}=t.extent,r=[i,e,n,o];return this._extent=r,r}})}geoJson(t){return this.item.geom?Promise.resolve(Vs(this.item)):Ca(((t,e)=>{for(var i in e||(e={}))Ma.call(e,i)&&Ta(t,i,e[i]);if(Ea)for(var i of Ea(e))Aa.call(e,i)&&Ta(t,i,e[i]);return t})({resourceId:this.resourceId,featureId:this.item.id,connector:this.options.connector,geom:!0,fields:null,extensions:null},t)).then(t=>(this.item.geom=t.geom,Vs(this.item)))}}var za=Object.defineProperty,ja=(t,e,i)=>((t,e,i)=>e in t?za(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Ba{constructor(t,e,i){ja(this,"options"),ja(this,"emitter",new H),ja(this,"name"),ja(this,"item"),ja(this,"_blocked",!1),ja(this,"_container"),ja(this,"__value"),ja(this,"_removeEventsListener"),this.item=e,this.options=Object.assign({},i),this.name=t,this._value=this.getProperty()}set _value(t){this.__value=t}get _value(){return this.__value}getProperty(){return"function"==typeof this.options.getProperty?this.options.getProperty.call(this,this.item):this.options.value}getParents(){return this.item.tree.getParents()||[]}getParent(){return this.item.tree.getParent()}getChildren(){return this.item.tree.getChildren()}isGroup(){return this.item.tree.getDescendants().length}isBlocked(){if(void 0!==this._blocked)return this._blocked;const t=this.item.tree.getParents();return this._blocked=this._calculateBlockedStatus(t),this._blocked}set(t,e){this._value=this._prepareValue(t),this.update(this._value,e),this._fireChangeEvent(this._value,e)}get(){return this.getValue()}update(t,e){this._callOnSet(t,e)}getContainer(){return this._container}destroy(){if(this._container){const t=this._container.parentNode;t&&t.removeChild(this._container)}this._removeEventsListener&&this._removeEventsListener()}getValue(){return void 0!==this._value?this._value:this.getProperty()}_prepareValue(t){return t}_callOnSet(t,e){this.options.onSet&&this.options.onSet.call(this,t,e,this.item)}_fireChangeEvent(t,e){if(this.emitter){t=void 0!==t?t:this.getValue(),this.emitter.emit("change",{value:t,options:e});this.item.tree.getParents().forEach(i=>{const o=i.properties&&i.properties.property(this.name);o&&o.emitter.emit("change-tree",{value:t,options:e,item:this.item})})}}_calculateBlockedStatus(t){return t.some(t=>{var e;const i=null==(e=t.properties)?void 0:e.property(this.name);return!!i&&!i.get()})}}var Za=Object.defineProperty,Na=Object.getOwnPropertySymbols,Ra=Object.prototype.hasOwnProperty,Da=Object.prototype.propertyIsEnumerable,qa=(t,e,i)=>e in t?Za(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Fa=(t,e)=>{for(var i in e||(e={}))Ra.call(e,i)&&qa(t,i,e[i]);if(Na)for(var i of Na(e))Da.call(e,i)&&qa(t,i,e[i]);return t};const Ua=class t extends Ba{constructor(e,i,o){super(e,i,Fa(Fa({},t.options),o)),this.set(this.get())}update(t,e){if(t){if(e&&e.bubble||this.options.bubble){this.unBlock(e);const i=this.getParent(),o=i&&i.properties&&i.properties.property(this.name);o&&o.set(t,Object.assign({},e,{bubble:!0,propagation:!1}))}this.isBlocked()||this._turnOn(e)}else this._turnOff(e);(e&&e.propagation||this.options.propagation)&&this._propagation(t,e)}getHierarchyValue(){return this.get()&&this.getParents().every(t=>{const e=t.properties&&t.properties.get(this.name);return e&&e.get()})}block(t){this._blocked=!0,this._block(t)}unBlock(t){this._blocked=!1;this.getValue()&&this._unBlock(t)}blockChild(t){this.item.tree.getDescendants().forEach(e=>this._blockChild(e,t))}unblockChild(t){this.item.tree.getChildren().forEach(e=>this._unBlockChild(e,t))}_prepareValue(t){return t}_turnOff(t){this.options.turnOff&&this.options.turnOff.call(this,t),this._callOnSet(!1,t),this.options.hierarchy&&this.isGroup()&&this.blockChild(t)}_turnOn(t){this.options.turnOn&&this.options.turnOn.call(this,t),this._callOnSet(!0,t),this.options.hierarchy&&this.isGroup()&&this.unblockChild(t)}_block(t){this._turnOff(t)}_unBlock(t){this._turnOn(t)}_blockChild(t,e){const i=t.properties&&t.properties.property(this.name);i&&i.block&&i.block(Fa({silent:!0},e||{}))}_unBlockChild(t,e){const i=t.properties&&t.properties.property(this.name);i&&i.unBlock&&i.unBlock(Fa({silent:!0},e||{}))}_propagation(t,e){if(this.isGroup()){const i=this.item.tree.getChildren();for(let o=0;o<i.length;o++){const n=i[o],r=n.properties&&n.properties.property(this.name);r&&r.set(t,Fa(Fa({},e),{propagation:!0,bubble:!1}))}}}};qa(Ua,"options"+"",{hierarchy:!0,bubble:!1,propagation:!1,label:"Toggle"});let Wa=Ua;var Ha=Object.defineProperty,Va=Object.getOwnPropertySymbols,Ga=Object.prototype.hasOwnProperty,Ja=Object.prototype.propertyIsEnumerable,Ka=(t,e,i)=>e in t?Ha(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ya=(t,e,i)=>Ka(t,"symbol"!=typeof e?e+"":e,i);const Qa=class t{constructor(t,e){Ya(this,"item",t),Ya(this,"options",{}),Ya(this,"_properties",{}),Ya(this,"_propertiesList",[]),e&&e.forEach(this._setPropertyHandler.bind(this))}add(t){this._setPropertyHandler(t)}update(){this.list().forEach(t=>t.update())}get(t){const e=this.property(t);return e?e.get():void 0}set(t,e,i){const o=this.property(t);o&&o.getValue()!==e&&o.set(e,i)}property(t){return this._properties[t]}list(){return this._propertiesList.map(t=>this._properties[t])}destroy(){for(const t in this._properties){const e=this.property(t);e&&e.destroy&&e.destroy()}this._properties={},this._propertiesList=[]}_setPropertyHandler(t){const e=this._getHandler(t);if(e&&t.name){const i=((t,e)=>{for(var i in e||(e={}))Ga.call(e,i)&&Ka(t,i,e[i]);if(Va)for(var i of Va(e))Ja.call(e,i)&&Ka(t,i,e[i]);return t})({},t);this._properties[t.name]=new e(t.name,this.item,i),this._propertiesList.push(t.name)}}_getHandler(e){const i=e.handler;return!i&&e.type?"boolean"===e.type?t.handlers.CheckProperty:t.handlers.BaseProperty:i}};Ya(Qa,"handlers",{CheckProperty:Wa});let $a=Qa;function Xa(t,e,i,o){return!!il(t,e,i,ol)}function tl(t,e,i,o){return il(t,e,i,nl)}function el(t,e="children"){let i=[];const o=("function"==typeof e?e:t=>t[e])(t);return o&&(Array.isArray(o)?i=o:i.push(o)),o?i:void 0}function il(t,e=t=>!!t,i="children",o,n){return o(t,"function"==typeof e?e:t=>Oe(t,e),i)}function ol(t,e=t=>!!t,i,o=[]){let n=[];if(Array.isArray(t))n=t;else{if(e(t))return t;const o=el(t,i);o&&(n=o)}for(let r=0;r<n.length;r++)if(n[r]){const t=ol(n[r],e,i,o);if(t)return t}}function nl(t,e=t=>!!t,i,o=[]){let n=[];if(Array.isArray(t))n=t;else{e(t)&&o.push(t);const r=el(t,i);r&&(n=r)}for(let r=0;r<n.length;r++)n[r]&&nl(n[r],e,i,o);return o}function rl(t,e=t=>!!t,i,o=[]){let n=[];if(Array.isArray(t))n=t;else{if(!e(t))return!1;const o=el(t,i);o&&(n=o)}for(let r=0;r<n.length;r++)if(n[r]){if(!rl(n[r],e,i,o))return!1}return!0}var sl=Object.defineProperty,al=(t,e,i)=>((t,e,i)=>e in t?sl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class ll{constructor(t){al(this,"item"),al(this,"_children",[]),al(this,"_parent"),this.item=t}setParent(t){this._parent=t}addChild(t){this._children.push(t)}getParent(){return this._parent}getParents(t){const e=this.getParent();return e?tl(e,t,t=>t.tree.getParent()):[]}getRoot(){let t=this.getParent(),e=t;for(;t;)t=t.tree.getParent(),t&&(e=t);return e}find(t){return il(this._children,t,t=>t.tree.getChildren(),ol)}every(t){return!!il(this._children,t,t=>t.tree.getChildren(),rl)}some(t){return Xa(this._children,t,t=>t.tree.getChildren())}all(t){return this.getDescendants(t)}getDescendants(t){return tl(this._children,t,t=>t.tree.getChildren())}getChildren(){return[...this._children]}}var cl=Object.defineProperty,hl=Object.getOwnPropertySymbols,ul=Object.prototype.hasOwnProperty,pl=Object.prototype.propertyIsEnumerable,dl=(t,e,i)=>e in t?cl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,fl=(t,e,i)=>dl(t,"symbol"!=typeof e?e+"":e,i);let ml=0;class gl{constructor(t){fl(this,"options",{}),fl(this,"properties"),fl(this,"tree"),fl(this,"id",ml),ml+=1,this.options=((t,e)=>{for(var i in e||(e={}))ul.call(e,i)&&dl(t,i,e[i]);if(hl)for(var i of hl(e))pl.call(e,i)&&dl(t,i,e[i]);return t})({},t),this.tree=new ll(this)}initProperties(){this.properties=new $a(this,this.options.properties)}}function yl(t,e){return{[`symbols[${t}]`]:e.join(",")||void 0}}var _l=Object.defineProperty,vl=Object.defineProperties,bl=Object.getOwnPropertyDescriptors,wl=Object.getOwnPropertySymbols,xl=Object.prototype.hasOwnProperty,Pl=Object.prototype.propertyIsEnumerable,Ll=(t,e,i)=>e in t?_l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ol=(t,e)=>{for(var i in e||(e={}))xl.call(e,i)&&Ll(t,i,e[i]);if(wl)for(var i of wl(e))Pl.call(e,i)&&Ll(t,i,e[i]);return t},Cl=(t,e,i)=>Ll(t,"symbol"!=typeof e?e+"":e,i);class kl{constructor({legendSymbols:t,resourceId:e,connector:i,layerId:o,legend:n,webMap:r,layer:s,onSymbolRenderChange:a}){Cl(this,"layerId"),Cl(this,"layer"),Cl(this,"resourceId"),Cl(this,"legendSymbols","expand"),Cl(this,"legend"),Cl(this,"layerVisibility",!0),Cl(this,"onSymbolRenderChange"),Cl(this,"webMap"),Cl(this,"connector"),t&&(this.legendSymbols=t),this.connector=i,this.layer=s,this.layerId=o,n&&(this.legend=this.createLegend(n)),this.resourceId=e,this.webMap=r,this.onSymbolRenderChange=a}attachLayer(t){this.layerId=String(t.id),this.layer=t}create(){return t=this,e=arguments,i=function*(t={}){if(this.connector){const e=yield this.connector.route("render.legend_symbols",{id:this.resourceId}).get(Ol({},t));return this.legend=e,this.createLegend(e)}},new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});var t,e,i}createLegend(t){return t.map(t=>{return e=Ol({},t),vl(e,bl({name:t.display_name,symbol:t.icon}));var e})}setSymbolRender(t,e){if(this.legend){const i=this.legend.find(e=>e.index===t);if(i){if(i.render!==e){i.render=e;const t=this.legend.filter(t=>t.render).map(t=>t.index);this.setLegendSymbol(t),this.onSymbolRenderChange&&this.onSymbolRenderChange(t)}}}}setLegendSymbol(t){const e=this._consolidateIntervals(t);e.length||this._hideLayer(),this.layer.updateLayer&&this.layer.updateLayer({params:Ol({},yl(this.resourceId,e))}),e.length&&this._showLayer()}_hideLayer(){this.layer.options.id&&this.webMap.mapAdapter.hideLayer(this.layer.layer)}_showLayer(){this.layer.options.id&&this.layerVisibility&&this.webMap.showLayer(this.layer.options.id,{silent:!0})}_consolidateIntervals(t){const e=t.slice().sort((t,e)=>t-e),i=[];let o=e[0],n=o;for(let r=1;r<=e.length;r++)e[r]===n+1?n=e[r]:(i.push(o===n?`${o}`:`${o}-${n}`),o=e[r],n=o);return i}}var El=Object.defineProperty,Ml=Object.defineProperties,Al=Object.getOwnPropertyDescriptors,Tl=Object.getOwnPropertySymbols,Sl=Object.prototype.hasOwnProperty,Il=Object.prototype.propertyIsEnumerable,zl=(t,e,i)=>e in t?El(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,jl=(t,e)=>{for(var i in e||(e={}))Sl.call(e,i)&&zl(t,i,e[i]);if(Tl)for(var i of Tl(e))Il.call(e,i)&&zl(t,i,e[i]);return t},Bl=(t,e)=>Ml(t,Al(e)),Zl=(t,e,i)=>zl(t,"symbol"!=typeof e?e+"":e,i),Nl=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});const Rl=class t extends gl{constructor({webMap:e,item:i,options:o,connector:n,parent:r,noInit:s}){if(super(jl(jl({},t.options),o)),Zl(this,"item"),Zl(this,"webMap"),Zl(this,"connector"),Zl(this,"layer"),Zl(this,"legend"),Zl(this,"emitter",new H),Zl(this,"_rootDescendantsCount",0),this.webMap=e,n&&(this.connector=n),r&&this.tree.setParent(r),this.item=i,"root"===this.item.item_type)this._rootDescendantsCount=this._sumUp(this.item.children);else{const t=this.tree.getRoot();t&&(this._rootDescendantsCount=t._rootDescendantsCount)}this.initProperties(),s||this._init(i)}static create(e,i,o,n,r){return Nl(this,null,function*(){const s=new t({webMap:e,item:i,options:o,connector:n,parent:r,noInit:!0});return yield s._init(i),s})}initItem(t){return"group"===t.item_type||"root"===t.item_type?this.initGroupItem(t):this.initLayerItem(t)}bringToFront(){}fit(){}getLayer(){return this.layer}getLegend(t){return Nl(this,null,function*(){var e,i;const o=null==(e=this.layer)?void 0:e.id;if(void 0!==o){if(this.connector&&"resourceId"in this.item){const e=Number(this.item.resourceId);if("layer"===this.item.item_type&&this.layer){const n=new kl({connector:this.connector,layerId:o,layer:this.layer,resourceId:e,webMap:this.webMap,legendSymbols:null!=(i=this.item.legend_symbols)?i:void 0,onSymbolRenderChange:t=>{this.webMap.emitter.emit("event-symbol-render:change",{layerId:o,resourceId:e,indexes:t})}});return yield n.create(t),[n]}return[]}}return[]})}getItemOptions(t){const e="layer"===t.item_type&&t.layer_transparency,i="number"==typeof e?(100-e)/100:void 0,o=Bl(jl({visibility:!1,name:t.display_name},this.options),{params:{resource:"resourceId"in this.item?this.item.resourceId:void 0,item:this.item}});if(delete o.id,this.options.order){const e=String(this.options.drawOrderEnabled&&"draw_order_position"in t&&null!=t.draw_order_position?this._rootDescendantsCount-t.draw_order_position:this.id).padStart(4,"0");o.order=Number((0|this.options.order)+"."+e)}if(this.options.popupOptions&&(o.popupOptions=this.options.popupOptions),"layer"===t.item_type){const{maxZoom:e,minZoom:i}=this._getZoomRange(t);Object.assign(o,Bl(jl({updateWmsParams:t.updateWmsParams},o),{url:t.url,maxZoom:e,minZoom:i,minScale:t.layer_min_scale_denom,maxScale:t.layer_max_scale_denom,interactive:t.layer_identifiable}))}return void 0!==i&&(o.opacity=i),o}getChildren(t){return[...t.children].reverse()}_mapScaleToZoomLevel(t){return function(t,e=0){const i=e,o=function(){if(void 0===hc){const t=document.createElement("div");t.style.cssText="position: absolute; left: -100%; top: -100%; width: 100cm;",document.body.appendChild(t);const e=t.offsetWidth;document.body.removeChild(t),hc=e}return hc}()*function(t){return 12756274*Math.PI*Math.cos(t*Math.PI/180)}(i)/t;return function(t){return Math.log(t/256)/Math.LN2}(o)}(t)}initGroupItem(t){if(t.children&&t.children.length){const e=this.getChildren(t);for(const t of e){const e=new this.constructor({webMap:this.webMap,item:t,options:this.options,connector:this.connector,parent:this});this.tree.addChild(e)}}return"group"!==this.item.item_type||t.group_enabled||this.properties.property("visibility").set(!1),Promise.resolve()}initLayerItem(e){const i=this.getItemOptions(e),o=t=>{e._layer=t,this.layer=t;this.properties.get("visibility")&&this.properties.set("visibility",!0),null!=i.opacity&&this.webMap.setLayerOpacity(t,i.opacity)};let n;if("layer"===e.item_type)n=e.adapter||e.layer_adapter.toUpperCase();else if(t.GetAdapterFromLayerType[e.item_type]){n=(0,t.GetAdapterFromLayerType[e.item_type])(e,i,this.webMap,this.connector)}return n?this.webMap.addLayer(n,i).then(t=>{this.webMap.emitter.on(`layer-${t.id}:toggle`,e=>{const i=this.properties.get("visibility"),o=this.webMap.isLayerVisible(t);i!==o&&this.properties.set("visibility",o)}),o(t)}):e._layer?Promise.resolve(o(e._layer)):Promise.reject("No layer added")}_getZoomRange(t){const e=this.options.minZoom,i=this.options.maxZoom,o=t.layer_min_scale_denom?this._mapScaleToZoomLevel(t.layer_min_scale_denom):void 0,n=t.layer_max_scale_denom?this._mapScaleToZoomLevel(t.layer_max_scale_denom):void 0,r=[e,o].filter(Boolean),s=[i,n].filter(Boolean);return{minZoom:r.length?Math.max(...r):void 0,maxZoom:s.length?Math.min(...s):void 0}}_init(t){this.initItem(t).then(()=>{this.emitter.emit("init")})}_sumUp(t,e=0){for(const i of t)"layer"===i.item_type?(e+=1,i.draw_order_position=i.draw_order_position||e):"group"===i.item_type&&(e=this._sumUp(i.children,e));return e}};Zl(Rl,"GetAdapterFromLayerType",{}),Zl(Rl,"options",{properties:[{type:"boolean",name:"visibility",getProperty(t){if(t){if("group"===t.item.item_type)return t.item.group_enabled;if("root"===t.item.item_type)return Xa(t.item,t=>"layer_enabled"in t&&t.layer_enabled,t=>t.children);if("layer"===t.item.item_type)return t.item.layer_enabled}return!1},onSet(t,e,i){"group"===(null==i?void 0:i.item.item_type)?i.item.group_enabled=t:"layer"===(null==i?void 0:i.item.item_type)&&(i.layer&&(t?i.webMap.showLayer(i.layer,e):i.webMap.hideLayer(i.layer,e)),i.item.layer_enabled=t)}},{name:"opacity",handler:class extends Ba{getProperty(){const t=this.item.layer;return t&&t&&t.options&&null!=t.options.opacity?t.options.opacity:1}update(t,e){if(e=e||{},this.isGroup()){this._value=this._prepareValue(t,e);const i=this.getChildren();for(const o of i){const i=o.properties.property(this.name);i&&(e.propagation?i.set(t,e):i.update(i.get(),e))}}const i=this.item.layer;if(i){const e=this.getParents().reduce((t,e)=>{const i=e.properties.property(this.name);return t*(i?i.getValue():1)},1);this.item.webMap.setLayerOpacity(i,this._prepareValue(t*e))}}_prepareValue(t,e){return e&&e.propagation&&this.isGroup()?1:Number(t)}}}]});let Dl=Rl;var ql=Object.defineProperty,Fl=Object.defineProperties,Ul=Object.getOwnPropertyDescriptors,Wl=Object.getOwnPropertySymbols,Hl=Object.prototype.hasOwnProperty,Vl=Object.prototype.propertyIsEnumerable,Gl=(t,e,i)=>e in t?ql(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Jl=(t,e)=>{for(var i in e||(e={}))Hl.call(e,i)&&Gl(t,i,e[i]);if(Wl)for(var i of Wl(e))Vl.call(e,i)&&Gl(t,i,e[i]);return t},Kl=(t,e,i)=>Gl(t,"symbol"!=typeof e?e+"":e,i),Yl=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});class Ql{constructor(t,e){Kl(this,"map",t),Kl(this,"options",e),Kl(this,"layer"),Kl(this,"NgwWebmapItem",Dl),Kl(this,"pixelRadius",10),Kl(this,"resourceId"),Kl(this,"webmapClassName","webmap"),Kl(this,"emitter",new H),Kl(this,"_extent"),Kl(this,"webmapResource"),Kl(this,"_webmapBaselayersIds",[]),Kl(this,"_lastActiveBaselayer");const i=e.resourceId;if(Array.isArray(i)?(this.resourceId=i[0],this.options.id=i[1]):this.resourceId=i,!this.resourceId)throw new Error("NGW `resourceId` is not defined")}addLayer(t){return Yl(this,null,function*(){var e;this.options=Jl(Jl({},this.options),t),this.layer=yield this._getWebMapLayerItem();const i=null==(e=this.webmapResource)?void 0:e.constraining_extent;return this.options.useExtentConstrained&&this._extent&&i&&this.options.webMap.setView({maxBounds:this._extent}),this.layer})}removeLayer(){const t=this.options.webMap.mapAdapter;if(this.getDependLayers().forEach(e=>{"layer"in e&&t.removeLayer(e.layer.layer)}),this._webmapBaselayersIds.length){for(const t of this._webmapBaselayersIds)this.options.webMap.removeLayer(t);this._lastActiveBaselayer&&this.options.webMap.showLayer(this._lastActiveBaselayer)}this.options.useExtentConstrained&&this._extent&&this.options.webMap.setView({maxBounds:null}),delete this.layer,delete this.webmapResource}showLayer(){return Yl(this,null,function*(){if(this.layer&&this.layer.properties)return this.layer.properties.property("visibility").set(!0)})}hideLayer(){return Yl(this,null,function*(){if(this.layer&&this.layer.properties)return this.layer.properties.property("visibility").set(!1)})}setOpacity(t){return Yl(this,null,function*(){if(this.layer&&this.layer.properties)return this.layer.properties.property("opacity").set(t)})}getExtent(){return this.getBounds()}getBounds(){const t=this.webmapResource;if(t)return ws(t)}getDependLayers(){return this.layer&&this.layer.tree.getDescendants()||[]}getBookmarksResourceId(){const t=this.webmapResource;if(t&&t.bookmark_resource)return t.bookmark_resource.id}fetchBookmarks(t){const e=this.getBookmarksResourceId(),i=this.options.connector;if(e)return i.getResourceOrFail(e,t).then(o=>{var n;const r=null==(n=o.feature_layer)?void 0:n.fields.find(t=>t.label_field),s=r&&r.keyname;return fa(Jl({connector:i,resourceId:e,geom:!1,fields:s?[s]:void 0},t)).then(t=>{const o=[];for(const n of t){const t=new Ia({item:n,resourceId:e,labelField:s,connector:i});o.push(t)}return o})});throw new Error("Webmap was not loaded correctly, it is impossible to extract bookmarks")}getLegend(t){return Yl(this,null,function*(){const e=[];let i=this.getDependLayers();i=i.sort((t,e)=>e.id-t.id);for(const o of i){const i=yield o.getLegend(t);e.push(...i)}return e})}getIdentificationIds(t){return Yl(this,null,function*(){const t=[];let e=this.getDependLayers();return e=e.sort((t,e)=>e.id-t.id),e.forEach(e=>{const i=e.item,o="style_parent_id"in i?i.style_parent_id:void 0;if(null!=o&&"layer"===i.item_type&&i.layer_identifiable){const i=e.properties.property("visibility");i.get()&&!i.isBlocked()&&t.push(o)}}),t})}_getWebMapLayerItem(){return Yl(this,null,function*(){if(!this.resourceId)return;const t=yield this.getWebMapConfig(this.resourceId);return t&&t.root_item?new Promise(e=>{var i;const o=this.options.connector,n=(null==o?void 0:o.options.auth)?o.getAuthorizationHeaders():void 0,r=o.withCredentials,s=(a=Jl({},this.options),l={withCredentials:r,headers:n,drawOrderEnabled:null!=(i=t.draw_order_enabled)&&i},Fl(a,Ul(l)));var a,l;const c=new this.NgwWebmapItem({webMap:this.options.webMap,item:t.root_item,options:s,connector:o});c.emitter.on("init",()=>{e(c)})}):void 0})}getWebMapConfig(t){return Yl(this,null,function*(){var e;const i=yield this.options.connector.getResource(t);if(i){const t=i[this.webmapClassName];if(this.webmapResource=t,this._setupBaselayers(i),t)return this._extent=null!=(e=t.initial_extent)?e:void 0,this._updateItemsParams(t.root_item,this.options.webMap,i),t}})}_setupBaselayers(t){var e;const i=this.options.webMap;if(null==(e=this.options.useBasemap)||e)if(t.basemap_webmap&&t.basemap_webmap.basemaps.length){const e=i.getActiveBaseLayer();this._lastActiveBaselayer=e?e.id:void 0,this._setBasemaps(t.basemap_webmap)}else this.options.defaultBasemap&&i.addBaseLayer("OSM",{id:"webmap-default-baselayer",name:"OpenStreetMap"})}_setBasemaps(t){const e=this.options.webMap;let i=!1;for(const o of t.basemaps)Ns({webMap:e,connector:this.options.connector,item:o,adapterOptions:{crossOrigin:this.options.crossOrigin}}).then(t=>{const n=!i&&o.enabled;return o.enabled&&(i=!0),e.addBaseLayer(t,{id:"webmap-baselayer"+o.resource_id,name:o.display_name,opacity:o.opacity,visibility:n}).then(t=>{t.id&&this._webmapBaselayersIds.push(t.id)})})}_updateItemsParams(t,e,i){var o;if(t)if("group"===t.item_type||"root"===t.item_type){if("children"in t&&t.children){const o=t.children.map(t=>this._updateItemsParams(t,e,i));t.children=o}"root"===t.item_type&&(t.display_name=i.resource.display_name)}else if("layer"===t.item_type){const i=t,o=dt(this.options.connector.options.baseUrl+"/api/component/render/image"),n=i.layer_style_id;i.url=o,i.resourceId=n,i.updateWmsParams=t=>lc(t,n);const r=ma({options:{adapter:i.layer_adapter.toUpperCase(),resource:n},webMap:e,baseUrl:this.options.connector.options.baseUrl||""});t=Jl(Jl({},i),r)}return"function"==typeof(null==(o=this.options.nativeOptions)?void 0:o.beforeItemCreated)&&(t=this.options.nativeOptions.beforeItemCreated(t)),t}}var $l=Object.defineProperty,Xl=Object.defineProperties,tc=Object.getOwnPropertyDescriptors,ec=Object.getOwnPropertySymbols,ic=Object.prototype.hasOwnProperty,oc=Object.prototype.propertyIsEnumerable,nc=(t,e,i)=>e in t?$l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,rc=(t,e)=>{for(var i in e||(e={}))ic.call(e,i)&&nc(t,i,e[i]);if(ec)for(var i of ec(e))oc.call(e,i)&&nc(t,i,e[i]);return t},sc=(t,e)=>Xl(t,tc(e)),ac=(t,e)=>{var i={};for(var o in t)ic.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&ec)for(var o of ec(t))e.indexOf(o)<0&&oc.call(t,o)&&(i[o]=t[o]);return i};function lc(t,e){const i=t,{bbox:o,width:n,height:r,nd:s}=i,a=ac(i,["bbox","width","height","nd"]);return sc(rc({},a),{resource:Array.isArray(e)?e.join(","):e,extent:o,size:n+","+r,timestamp:Date.now(),nd:null!=s?s:200})}const cc={POINT:"point",LINESTRING:"line",POLYGON:"polygon",MULTIPOINT:"point",MULTILINESTRING:"line",MULTIPOLYGON:"polygon",POINTZ:"point",LINESTRINGZ:"line",POLYGONZ:"polygon",MULTIPOINTZ:"point",MULTILINESTRINGZ:"line",MULTIPOLYGONZ:"polygon"};let hc;function uc(t){if(!t)return;const e=t.match(/^(?:SRID=(\d+);)?POLYGON\s*\(\((.+)\)\)\s*$/i);if(!e||e[1]&&"4326"!==e[1])return;const i=e[2].split(",").map(t=>t.trim().split(/\s+/).map(Number)).filter(t=>t.length>=2&&Number.isFinite(t[0])&&Number.isFinite(t[1]));if(!i.length)return;const o=i.map(t=>t[0]),n=i.map(t=>t[1]);return[Math.min(...o),Math.min(...n),Math.max(...o),Math.max(...n)]}function pc(t){return t.replace(/^(http|ftp):\/\//,"https://")}function dc(t){const e=function(t){return t?Object.fromEntries(new URLSearchParams(t).entries()):{}}(t.params),i=Object.entries(e).find(([t])=>"version"===t.toLowerCase());return{type:"wms",service:t,url:pc(t.url),layers:t.layers,format:t.format||"image/png",version:(null==i?void 0:i[1])||"1.3.0",params:e,name:t.name,attribution:t.copyright_text||void 0,extent:uc(t.extent)}}var fc=Object.defineProperty,mc=(t,e,i)=>((t,e,i)=>e in t?fc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i),gc=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});const yc=class t{constructor(){mc(this,"url"),this.url=t.url.replace(/\/$/,"").trim()}getService(t){return gc(this,arguments,function*(t,e={}){const i=yield this._getJson(`${this.url}/api/v1/geoservices/${t}`,e);if("tms"!==i.type&&"wms"!==i.type)throw new Error("Unsupported QMS service type.");return i})}getLayer(t){return gc(this,arguments,function*(t,e={}){const i=yield this.getService(t,e);return"tms"===i.type?function(t){var e,i;const[o,n]=function(t){const e=[];return[t=t.replace(/{switch:(.*?)}/,(t,i)=>("string"==typeof i&&i.split(",").forEach(t=>e.push(t)),"{s}")),e]}(pc(t.origin_url||t.url));return{type:"tms",service:t,url:o,subdomains:n,scheme:t.y_origin_top?"xyz":"tms",name:t.name,attribution:t.copyright_text||void 0,extent:uc(t.extent),minZoom:null!=(e=t.z_min)?e:void 0,maxZoom:null!=(i=t.z_max)?i:void 0}}(i):dc(i)})}searchServices(t,e){return gc(this,arguments,function*(t,{limit:e=10,offset:i,signal:o,type:n}){const r=new URLSearchParams({search:t,limit:String(e),type:n});void 0!==i&&r.set("offset",String(i));return(yield this._getJson(`${this.url}/api/v1/geoservices/?${r}`,{signal:o})).results})}_getJson(t,e){return gc(this,arguments,function*(t,{signal:e}){const i=yield fetch(t,{signal:e});if(!i.ok)throw new Error(`QMS request failed with status ${i.status}: ${t}`);return i.json()})}};mc(yc,"url","https://qms.nextgis.com");let _c=yc;u('.nextgis-qms-control{--nextgis-qms-control-width:300px;--nextgis-qms-control-max-height:380px;--nextgis-qms-control-background:#fff;--nextgis-qms-control-color:#252a31;--nextgis-qms-control-muted-color:#69717d;--nextgis-qms-control-accent:#0c65af;--nextgis-qms-control-border-color:#d8dde3;--nextgis-qms-control-hover-background:#f3f5f7;--nextgis-qms-control-border-radius:6px;--nextgis-qms-control-shadow:0 2px 10px rgba(0,0,0,.18);--nextgis-qms-control-gap:8px;width:-moz-max-content;width:max-content;color:var(--nextgis-qms-control-color);font:13px/1.4 -apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.nextgis-qms-control.ol-control{top:var(--nextgis-qms-control-top,.5em);left:var(--nextgis-qms-control-left,3em);padding:0;background:transparent}.nextgis-qms-control [hidden],.nextgis-qms-control[hidden]{display:none}.nextgis-qms-control button,.nextgis-qms-control input{box-sizing:border-box;font:inherit}.nextgis-qms-control button{margin:0}.nextgis-qms-control .nextgis-qms-control__toggle{display:grid;width:32px;height:32px;padding:0;color:var(--nextgis-qms-control-color);line-height:1;cursor:pointer;background-color:var(--nextgis-qms-control-background);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2264%22%20height%3D%2264%22%20fill%3D%22none%22%20viewBox%3D%220%200%2064%2064%22%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20fill%3D%22%23176fc1%22%20rx%3D%227.291%22%20style%3D%22stroke-width%3A.202532%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M52%2015.95H33.792a4%204%200%200%201-2.764-1.109l-1.868-1.784a4%204%200%200%200-2.764-1.108H10a2%202%200%200%200-2%202v6h48c0-2.208-1.792-4-4-4M21.244%2034.261a3.1%203.1%200%200%200-1.116-.876q-.665-.31-1.492-.308-.846-.001-1.5.316a3.2%203.2%200%200%200-1.104.884q-.457.571-.692%201.364a6%206%200%200%200-.244%201.768q0%20.983.24%201.768.241.786.692%201.356c.3.376.668.672%201.104.876q.654.307%201.5.308.827.002%201.492-.308a3.04%203.04%200%200%200%201.12-.876q.451-.57.692-1.356.24-.788.24-1.768a6.2%206.2%200%200%200-.24-1.78%204.1%204.1%200%200%200-.692-1.368%22%20style%3D%22stroke-width%3A.202532%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M8%2023.95v26a2%202%200%200%200%202%202h44a2%202%200%200%200%202-2v-26zm16.928%2015.99c-.232.748-.552%201.408-.972%201.972a5.6%205.6%200%200%201-1.492%201.404%206.1%206.1%200%200%201-1.904.808q.095.384.424.624c.216.16.496.292.824.396.336.1.72.176%201.164.232q.664.077%201.436.136l-.616%202.196q-1.5-.055-2.568-.296-1.069-.239-1.808-.664c-.496-.284-.884-.624-1.176-1.036a4.8%204.8%200%200%201-.664-1.424%206.9%206.9%200%200%201-2.216-.664%205.6%205.6%200%200%201-1.768-1.376q-.75-.869-1.176-2.08-.415-1.224-.416-2.76c0-1.14.18-2.148.54-3.012s.844-1.596%201.452-2.184a5.9%205.9%200%200%201%202.116-1.324%207.3%207.3%200%200%201%202.532-.444c.912%200%201.768.144%202.576.444a5.9%205.9%200%200%201%202.116%201.324q.906.888%201.428%202.184.516%201.296.516%203.012%200%201.404-.348%202.532m13.54%204.14a302%20302%200%200%200-.152-4.232c-.06-1.524-.16-3.064-.284-4.616-.236.54-.492%201.132-.776%201.788q-.426.982-.84%201.964-.414.983-.804%201.876-.38.896-.652%201.528h-2.1c-.176-.424-.4-.932-.656-1.532q-.383-.896-.796-1.876c-.276-.656-.56-1.308-.84-1.964-.284-.652-.544-1.248-.772-1.784a107%20107%200%200%200-.292%204.616q-.091%202.286-.152%204.236h-2.924q.072-1.579.18-3.368.107-1.793.232-3.568c.084-1.188.176-2.328.288-3.424q.166-1.648.356-2.972h2.876q.347.634.796%201.568a98%2098%200%200%201%201.92%204.244l.904%202.136c.284-.664.584-1.38.904-2.136q.48-1.133.972-2.224.493-1.091.944-2.02c.304-.62.576-1.144.804-1.568h2.728a61%2061%200%200%201%20.356%202.972q.161%201.643.292%203.424.122%201.778.232%203.568.107%201.79.184%203.364zm12.224-.756q-1.306%201.032-3.944%201.032-.888-.001-1.596-.104a10%2010%200%200%201-1.26-.26%208%208%200%200%201-.944-.328%207%207%200%200%201-.664-.324l.848-2.388c.396.216.888.416%201.472.588s1.296.26%202.144.26q.635-.001%201.048-.104c.276-.072.496-.164.664-.288a.94.94%200%200%200%20.344-.436q.096-.247.096-.56.001-.653-.616-1.084t-2.116-.936a16%2016%200%200%201-1.308-.528%204.8%204.8%200%200%201-1.176-.752%203.6%203.6%200%200%201-.844-1.096q-.326-.643-.328-1.568%200-.925.348-1.664c.232-.496.556-.916.984-1.26a4.5%204.5%200%200%201%201.536-.796q.906-.276%202.04-.276%201.35%200%202.328.288c.652.192%201.196.404%201.616.636L50.5%2033.74a8%208%200%200%200-1.24-.508c-.456-.144-1.004-.22-1.644-.22q-1.08.001-1.548.296-.468.284-.468.904.001.365.176.616.174.25.492.452.318.203.732.364.413.162.916.336a21%2021%200%200%201%201.808.76c.516.248.94.54%201.28.876s.596.724.76%201.176c.152.448.236.996.236%201.636%200%201.244-.436%202.212-1.308%202.896%22%20style%3D%22stroke-width%3A.202532%22%2F%3E%3C%2Fsvg%3E");background-repeat:no-repeat;background-position:50%;background-size:24px 24px;border:1px solid var(--nextgis-qms-control-border-color);border-radius:var(--nextgis-qms-control-border-radius);box-shadow:var(--nextgis-qms-control-shadow);place-items:center}.nextgis-qms-control .nextgis-qms-control__toggle[hidden]{display:none}.nextgis-qms-control .nextgis-qms-control__about-close:hover,.nextgis-qms-control .nextgis-qms-control__about:hover,.nextgis-qms-control .nextgis-qms-control__close:hover,.nextgis-qms-control .nextgis-qms-control__service:hover,.nextgis-qms-control .nextgis-qms-control__toggle:hover,.nextgis-qms-control__group>summary:hover{background-color:var(--nextgis-qms-control-hover-background)}.nextgis-qms-control button:focus-visible,.nextgis-qms-control input:focus-visible,.nextgis-qms-control__group>summary:focus-visible{outline:2px solid var(--nextgis-qms-control-accent);outline-offset:-2px}.nextgis-qms-control__panel{box-sizing:border-box;width:min(var(--nextgis-qms-control-width),calc(100vw - 20px));padding:var(--nextgis-qms-control-gap);overflow:hidden;background:var(--nextgis-qms-control-background);border:1px solid var(--nextgis-qms-control-border-color);border-radius:var(--nextgis-qms-control-border-radius);box-shadow:var(--nextgis-qms-control-shadow)}.nextgis-qms-control__header{display:flex;min-height:28px;align-items:center;justify-content:space-between;margin-bottom:var(--nextgis-qms-control-gap)}.nextgis-qms-control__title{padding-left:2px;font-size:14px;font-weight:600}.nextgis-qms-control .nextgis-qms-control__close{display:grid;position:relative;width:28px;height:28px;padding:0;color:var(--nextgis-qms-control-muted-color);font-size:0;line-height:0;cursor:pointer;background:transparent;border:0;border-radius:4px;box-shadow:none;place-items:center}.nextgis-qms-control__input{width:100%;height:34px;padding:0 10px;color:inherit;background:var(--nextgis-qms-control-background);border:1px solid var(--nextgis-qms-control-border-color);border-radius:4px}.nextgis-qms-control__input:focus{border-color:var(--nextgis-qms-control-accent)}.nextgis-qms-control__catalog,.nextgis-qms-control__results{max-height:var(--nextgis-qms-control-max-height);margin-top:var(--nextgis-qms-control-gap);overflow-x:hidden;overflow-y:auto;border-top:1px solid var(--nextgis-qms-control-border-color)}.nextgis-qms-control__results{padding:6px 0;color:var(--nextgis-qms-control-muted-color)}.nextgis-qms-control__results>.nextgis-qms-control__service{color:var(--nextgis-qms-control-color)}.nextgis-qms-control__group{border-bottom:1px solid var(--nextgis-qms-control-border-color)}.nextgis-qms-control__group>summary{display:flex;min-height:36px;padding:0 8px;align-items:center;font-weight:600;cursor:pointer;list-style:none}.nextgis-qms-control__group>summary::-webkit-details-marker{display:none}.nextgis-qms-control__group>summary:after{flex:none;margin-left:auto;color:var(--nextgis-qms-control-muted-color);content:"›";font-size:18px;transition:transform .12s ease}.nextgis-qms-control__group[open]>summary:after{transform:rotate(90deg)}.nextgis-qms-control__group-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nextgis-qms-control .nextgis-qms-control__service{display:block;width:100%;min-height:34px;padding:7px 10px;overflow:hidden;color:inherit;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;background:transparent;border:0;border-radius:0;box-shadow:none}.nextgis-qms-control__group>.nextgis-qms-control__service{padding-left:22px;color:var(--nextgis-qms-control-muted-color)}.nextgis-qms-control__group>.nextgis-qms-control__service:hover{color:var(--nextgis-qms-control-color)}.nextgis-qms-control__footer{display:flex;padding-top:var(--nextgis-qms-control-gap);justify-content:center}.nextgis-qms-control .nextgis-qms-control__about{display:inline-block;width:auto;height:auto;padding:2px 6px;color:var(--nextgis-qms-control-accent);line-height:inherit;cursor:pointer;background:transparent;border:0;box-shadow:none}.nextgis-qms-control__about-dialog{box-sizing:border-box;width:min(420px,calc(100vw - 32px));padding:24px;color:var(--nextgis-qms-control-color);font:inherit;text-align:left;background:var(--nextgis-qms-control-background);border:1px solid var(--nextgis-qms-control-border-color);border-radius:var(--nextgis-qms-control-border-radius);box-shadow:var(--nextgis-qms-control-shadow)}.nextgis-qms-control__about-dialog::backdrop{background:rgba(0,0,0,.4)}.nextgis-qms-control__about-title{display:block;padding-right:24px;font-size:16px}.nextgis-qms-control__about-dialog p{margin:12px 0}.nextgis-qms-control__about-links{display:grid;gap:6px}.nextgis-qms-control__about-links a{color:var(--nextgis-qms-control-accent)}.nextgis-qms-control .nextgis-qms-control__about-close{position:relative;float:right;width:28px;height:28px;padding:0;color:var(--nextgis-qms-control-muted-color);font-size:0;line-height:0;cursor:pointer;background:transparent;border:0;border-radius:4px;box-shadow:none}.nextgis-qms-control__about-close:after,.nextgis-qms-control__about-close:before,.nextgis-qms-control__close:after,.nextgis-qms-control__close:before{position:absolute;top:50%;left:50%;width:12px;height:1px;background:currentcolor;content:""}.nextgis-qms-control__about-close:before,.nextgis-qms-control__close:before{transform:translate(-50%,-50%) rotate(45deg)}.nextgis-qms-control__about-close:after,.nextgis-qms-control__close:after{transform:translate(-50%,-50%) rotate(-45deg)}.nextgis-qms-control.maplibregl-ctrl .nextgis-qms-control__toggle:not(:disabled):hover{background-color:var(--nextgis-qms-control-hover-background)}.nextgis-qms-control button.nextgis-qms-control__about:not(:focus-visible){outline:0}.nextgis-qms-control__about-developed-by{color:var(--nextgis-qms-control-muted-color)}');var vc=Object.defineProperty,bc=Object.defineProperties,wc=Object.getOwnPropertyDescriptors,xc=Object.getOwnPropertySymbols,Pc=Object.prototype.hasOwnProperty,Lc=Object.prototype.propertyIsEnumerable,Oc=(t,e,i)=>e in t?vc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Cc=(t,e)=>{for(var i in e||(e={}))Pc.call(e,i)&&Oc(t,i,e[i]);if(xc)for(var i of xc(e))Lc.call(e,i)&&Oc(t,i,e[i]);return t},kc=(t,e,i)=>Oc(t,"symbol"!=typeof e?e+"":e,i);const Ec={tms:"TILE",wms:"WMS"};function Mc(t,e={}){let i;if("webMap"in t){const o=t,{webMap:n}=o,r=((t,e)=>{var i={};for(var o in t)Pc.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&xc)for(var o of xc(t))e.indexOf(o)<0&&Lc.call(t,o)&&(i[o]=t[o]);return i})(o,["webMap"]);i=n,e=r}else i=t;const o=new _c;class n{constructor(t,i){kc(this,"qms"),kc(this,"options"),kc(this,"map"),this.map=t;const o=Cc(Cc({},e),i);this.options=o,this.options.baselayer=!0,o.qms&&(this.qms=o.qms)}addLayer(t){return e=this,r=null,s=function*(){var e,r,s;const a=null!=(e=t.signal)?e:this.options.signal,l=null!=(s=t.qmsId)?s:null==(r=this.qms)?void 0:r.id;var c,h,u;if("number"==typeof l)try{const e=yield o.getLayer(l,{signal:a});this.qms=e.service;const r=Ec[e.type],s=i.mapAdapter.layerAdapters[r];if(s)return h=n,u=s,["showLayer","hideLayer"].forEach(t=>{const e=Object.getOwnPropertyDescriptor(u.prototype,t);e&&Object.defineProperty(h.prototype,t,e)}),c=Cc(Cc(Cc({},"TILE"===r?{order:0,maxZoom:i.options.maxZoom,minZoom:i.options.minZoom}:{}),this.options),function(t){return"tms"===t.type?{url:"tms"===t.scheme?t.url.replace("{y}","{-y}"):t.url,subdomains:t.subdomains,maxZoom:t.maxZoom,minZoom:t.minZoom,name:t.name,attribution:t.attribution}:{url:t.url,layers:t.layers,format:t.format,version:t.version,params:t.params,name:t.name,attribution:t.attribution}}(e)),t=bc(c,wc({signal:a})),this.options=t,new s(this.map,t).addLayer(t)}catch(p){if(null==a?void 0:a.aborted)throw p;console.error(p)}},new Promise((t,i)=>{var o=t=>{try{a(s.next(t))}catch(e){i(e)}},n=t=>{try{a(s.throw(t))}catch(e){i(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(o,n);a((s=s.apply(e,r)).next())});var e,r,s}}return n}var Ac=Object.defineProperty;class Tc{getLayerAdapters(){return Promise.resolve([{name:"QMS",createAdapter:t=>Promise.resolve(this._createAdapter(t))}])}_createAdapter(t){return Mc({webMap:t})}}((t,e,i)=>{((t,e,i)=>{e in t?Ac(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i})(t,e+"",i)})(Tc,"utils",{createQmsAdapter:Mc});var Sc=Object.defineProperty,Ic=Object.defineProperties,zc=Object.getOwnPropertyDescriptors,jc=Object.getOwnPropertySymbols,Bc=Object.getPrototypeOf,Zc=Object.prototype.hasOwnProperty,Nc=Object.prototype.propertyIsEnumerable,Rc=Reflect.get,Dc=(t,e,i)=>e in t?Sc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,qc=(t,e)=>{for(var i in e||(e={}))Zc.call(e,i)&&Dc(t,i,e[i]);if(jc)for(var i of jc(e))Nc.call(e,i)&&Dc(t,i,e[i]);return t},Fc=(t,e)=>Ic(t,zc(e)),Uc=(t,e,i)=>Rc(Bc(t),i,e),Wc=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});var Hc=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});function Vc(t){return function(t){return Hc(this,null,function*(){const e=yield fa(t),i=[];return e.forEach(t=>{i.push(Vs(t))}),i})}(t).then(t=>({type:"FeatureCollection",features:t}))}const Gc=["fields","intersects","limit","orderBy","strategy"];function Jc(t){const e={};return Gc.forEach(i=>{const o=t[i];void 0!==o&&(e[i]=o)}),e}var Kc=Object.defineProperty,Yc=Object.defineProperties,Qc=Object.getOwnPropertyDescriptors,$c=Object.getOwnPropertySymbols,Xc=Object.getPrototypeOf,th=Object.prototype.hasOwnProperty,eh=Object.prototype.propertyIsEnumerable,ih=Reflect.get,oh=(t,e,i)=>e in t?Kc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,nh=(t,e)=>{for(var i in e||(e={}))th.call(e,i)&&oh(t,i,e[i]);if($c)for(var i of $c(e))eh.call(e,i)&&oh(t,i,e[i]);return t},rh=(t,e)=>Yc(t,Qc(e)),sh=(t,e,i)=>oh(t,"symbol"!=typeof e?e+"":e,i),ah=(t,e,i)=>ih(Xc(t),i,e),lh=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});function ch(t){return lh(this,null,function*(){var e,i;const{item:o,webMap:n,Adapter:r,connector:s,layerOptions:a,addLayerOptionsPriority:l}=t,c=null==l||l,h=a,u=r||a.Adapter||n.mapAdapter.layerAdapters.GEOJSON,p=[];let d,f,m=!1;const g=yield Ms(h,s);(null==(i=null==(e=h.adapterOptions)?void 0:e.popupOptions)?void 0:i.fromProperties)&&(h.adapterOptions.popupOptions.createPopupContent=({feature:t})=>t&&function(t,e){{const i=document.createElement("div");if(e&&e.feature_layer)e.feature_layer.fields.forEach(e=>{if(e.grid_visibility){const o=t.properties&&t.properties[e.keyname];if(o){const t=document.createElement("div");i.appendChild(t),t.innerHTML=`<span>${e.display_name}</span>: ${o}<span></span>`}}});else if(t.properties)for(const e in t.properties){const o=document.createElement("div");i.appendChild(o),o.innerHTML=`<span>${e}</span>: ${t.properties[e]}<span></span>`}return i}}(t,o));const y=(t,e)=>lh(null,null,function*(){v(),f=new AbortController;const i=f.signal;return(null==e?void 0:e.signal)&&e.signal.addEventListener("abort",f.abort),(e=e||{}).signal=i,d={filters:t,options:e},Vc(nh({resourceId:g,filters:t,connector:s,cache:!0},e))});let _=!1;const v=()=>{f&&(f.abort(),f=void 0)};class b extends u{constructor(){super(...arguments),sh(this,"emitter",new H),sh(this,"__onMapMove"),sh(this,"__onMapMoveStart"),sh(this,"__enableMapMoveListener"),sh(this,"__disableMapMoveListener")}addLayer(t){return lh(this,null,function*(){let e=!t.data;const i=void 0===t.waitFullLoad||t.waitFullLoad;void 0!==h.id&&(t.id=h.id),o&&o.vector_layer&&(t.type=cc[o.vector_layer.geometry_type]),h.adapterOptions&&(t=c?nh(nh({},h.adapterOptions),t):nh(nh({},t),h.adapterOptions)),t.data&&0===Object.keys(t.data).length&&(t.data=void 0,e=!1);const n=t.strategy||void 0;this.options.strategy=n;const r=ah(b.prototype,this,"addLayer").call(this,t);let s;return d={filters:t.propertiesFilter,options:Jc(t)},e&&(s=this.updateLayer()),i&&s&&(yield s),n&&n.startsWith("BBOX")&&!m&&this._addBboxEventListener(),r})}getExtent(){return this.getBounds()}getBounds(){return lh(this,null,function*(){const t=this.getLayers&&this.getLayers().length,e=this.options.strategy;return(null==e?void 0:e.startsWith("BBOX"))||t?Ps({connector:s,resourceId:o.resource.id}):ah(b.prototype,this,"getBounds")?ah(b.prototype,this,"getBounds").call(this):void 0})}beforeRemove(){_=!0,this._removeMoveEventListener(),this._removeBboxEventListener(),this.__disableMapMoveListener=void 0,this.__enableMapMoveListener=void 0,this.__onMapMove=void 0,this.__onMapMoveStart=void 0,v()}getCount(){return function({connector:t,resourceId:e,cache:i=!0,signal:o}){return t.route("feature_layer.feature.count",{id:e}).get({cache:i,signal:o}).then(t=>t.total_count)}({connector:s,resourceId:g,cache:!0})}updateLayer(t){return lh(this,null,function*(){var e;const i=t||d||{};if(null==(e=this.options.strategy)?void 0:e.startsWith("BBOX")){yield n.onLoad("create"),i.options=i.options||{},i.options.intersects=n.getBounds();const{minZoom:t,maxZoom:e}=this.options,o=n.getZoom();if(void 0!==o){if(void 0!==t&&o<t)return;if(void 0!==e&&o>e)return;if(m)return}}if(!_){try{this.emitter.emit("preupdate",i),n._emitLayerEvent("layer:preupdate",h.id||"",i);const t=yield y(i.filters,rh(nh({},i.options),{srs:this.options.srs}));let e=t;const o=yield this.getCount();if("BBOX+"===this.options.strategy){e={type:"FeatureCollection",features:[]};for(const i of t.features)-1===p.indexOf(String(i.id))&&(p.push(String(i.id)),e.features.push(i));m=void 0!==o&&p.length>=o,yield n.addLayerData(this,e)}else m=void 0!==o&&t.features.length>=o,yield n.setLayerData(this,t);this.emitter.emit("updated",t),n._emitLayerEvent("layer:updated",h.id||"",{data:t,newData:e,isFull:m})}catch(o){if(o instanceof Error&&"AbortError"!==o.name)throw o}ah(b.prototype,this,"updateLayer")&&ah(b.prototype,this,"updateLayer").call(this)}})}propertiesFilter(t,e){return lh(this,null,function*(){if(v(),this.filter&&m)this.filter(e=>{const i=e.feature&&e.feature.properties&&Ys(nh({},e.feature.properties));return!i||Oe(i,t)});else if(this.setData){this.clearLayer&&this.clearLayer();const i=yield y(t,rh(nh({},e),{srs:this.options.srs}));this.setData(i)}})}removeFilter(){d=void 0,this.propertiesFilter([]),this.filter&&this.filter(()=>!0)}_addBboxEventListener(){this.__enableMapMoveListener=t=>{t===this&&(this._removeMoveEventListener(),this.updateLayer(),this._addMoveEventListener())},this.__disableMapMoveListener=t=>{t===this&&this._removeMoveEventListener()},n.emitter.on("layer:show",this.__enableMapMoveListener),n.emitter.on("layer:hide",this.__disableMapMoveListener),this.__enableMapMoveListener(this)}_removeBboxEventListener(){this.__enableMapMoveListener&&n.emitter.on("layer:show",this.__enableMapMoveListener),this.__disableMapMoveListener&&n.emitter.on("layer:hide",this.__disableMapMoveListener)}_addMoveEventListener(){this.__onMapMove=$(()=>this.updateLayer()),this.__onMapMoveStart=v,n.emitter.on("movestart",this.__onMapMoveStart),n.emitter.on("moveend",this.__onMapMove)}_removeMoveEventListener(){this.__onMapMove&&n.emitter.removeListener("moveend",this.__onMapMove),this.__onMapMoveStart&&n.emitter.removeListener("movestart",this.__onMapMoveStart)}}return b})}var hh=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});function uh(t,e){const i=oa(e);return void 0===i?{}:{[`filter[${t}]`]:i}}var ph=Object.defineProperty,dh=Object.defineProperties,fh=Object.getOwnPropertyDescriptors,mh=Object.getOwnPropertySymbols,gh=Object.prototype.hasOwnProperty,yh=Object.prototype.propertyIsEnumerable,_h=(t,e,i)=>e in t?ph(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,vh=(t,e)=>{for(var i in e||(e={}))gh.call(e,i)&&_h(t,i,e[i]);if(mh)for(var i of mh(e))yh.call(e,i)&&_h(t,i,e[i]);return t},bh=(t,e)=>dh(t,fh(e)),wh=(t,e)=>{var i={};for(var o in t)gh.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&mh)for(var o of mh(t))e.indexOf(o)<0&&yh.call(t,o)&&(i[o]=t[o]);return i},xh=(t,e,i)=>_h(t,"symbol"!=typeof e?e+"":e,i),Ph=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});function Lh(t){return Ph(this,arguments,function*({layerOptions:t,connector:e,webMap:i,item:o}){const n=o.resource.cls;let r=t.adapter||n&&{wmsserver_service:"WMS",tmsclient_layer:"IMAGE"}[n]||"IMAGE";if(void 0!==r&&(t.adapter=r),"IMAGE"===r){const t=i.getLayerAdapters();!t||t.IMAGE||(r="TILE")}const s=i.mapAdapter.layerAdapters[r];if(s){const n=yield Ms(t,e);return class extends s{constructor(s,a){super(s,a),xh(this,"map",s),xh(this,"item",o),xh(this,"resourceId",n),xh(this,"blocked",!1),xh(this,"layerVisibility");const l=ma({options:t,webMap:i,baseUrl:e.options.baseUrl||""});if(l){const e=t.adapterOptions||{},{propertiesFilter:i}=e,o=wh(e,["propertiesFilter"]),s=uh(n,i),a=bh(vh(vh({},l),o),{params:vh({resource:n},s),url:"TILE"===r&&l.url?ft(l.url,vh({resource:String(n)},s)):l.url,layers:l.layers||String(n),resourceId:n});t.adapterOptions&&tt(t.adapterOptions.setViewDelay)&&(a.setViewDelay=t.adapterOptions.setViewDelay),this.options=vh(vh({},this.options),a)}}addLayer(t){return super.addLayer(vh(vh({},this.options),t))}propertiesFilter(t){return Ph(this,null,function*(){var e;const i=this.options,o=vh(vh({},i.params||{}),uh(this.resourceId,t));i.params=o,null==(e=this.updateLayer)||e.call(this,{params:o})})}getIdentificationIds(){return Ph(this,null,function*(){if(this.item){if("MVT"===r)return[this.item.resource.id];if(this.item.resource.parent){const t=this.item.resource.parent.id;if(tt(t))return[t]}}return[]})}getLegend(t){return Ph(this,null,function*(){const o=this.options.id;if(void 0!==o){const r=yield e.route("render.legend_symbols",{id:n}).get(vh({cache:!0},t));return[new kl({layerId:o,layer:this,resourceId:n,webMap:i,legend:r})]}return[]})}}}throw new Error(r+" not supported yet. Only TILE")})}var Oh=Object.defineProperty,Ch=Object.defineProperties,kh=Object.getOwnPropertyDescriptors,Eh=Object.getOwnPropertySymbols,Mh=Object.prototype.hasOwnProperty,Ah=Object.prototype.propertyIsEnumerable,Th=(t,e,i)=>e in t?Oh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Sh=(t,e)=>{for(var i in e||(e={}))Mh.call(e,i)&&Th(t,i,e[i]);if(Eh)for(var i of Eh(e))Ah.call(e,i)&&Th(t,i,e[i]);return t},Ih=(t,e)=>Ch(t,kh(e)),zh=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});const jh={},Bh=["mapserver_style","qgis_vector_style","qgis_raster_style","wmsserver_service","raster_style","basemap_layer","vector_layer","raster_layer","postgis_layer","webmap","tmsclient_layer"];function Zh(t){return zh(this,arguments,function*({layerOptions:t,webMap:e,connector:i,item:o}){const n=o.resource.id,r=yield i.getResourceChildren(n),s=r&&r[0];if(s)return Nh(Ih(Sh({},t),{resource:s.resource.id}),e,i)})}function Nh(t,e,i){return zh(this,null,function*(){let o,n;const r=t.adapter,s=yield Ms(t,i);if(s){const a=t.resource;if(n=a&&a.resource&&void 0!==a.resource.id?a:yield i.getResource(s),!n)throw"Resource item is not found";{const a=n.resource.cls,l={layerOptions:Ih(Sh({},t),{resource:s}),connector:i,webMap:e,item:n};if(-1!==Bh.indexOf(a))if("webmap"===a)o=function(t){return hh(this,arguments,function*({layerOptions:t,webMap:e,connector:i}){const o=yield Ms(t,i);return class extends Ql{constructor(t){super(t,{url:"",webMap:e,resourceId:o,connector:i})}}})}(l);else if("vector_layer"===a||"postgis_layer"===a){const e=l.layerOptions.adapterOptions||{};if(e.type=e.type||n.vector_layer&&cc[n.vector_layer.geometry_type],l.layerOptions.adapterOptions=e,t.adapterOptions=l,void 0!==r&&"GEOJSON"!==r){if("MVT"!==r)return Zh(l);o=Lh(l)}else o=ch(l)}else{if("raster_layer"===a)return Zh(l);if("basemap_layer"===a)o=function(t){return Wc(this,arguments,function*({webMap:t,item:e}){if(e.basemap_layer){const i=e.basemap_layer.qms,o=e.basemap_layer.url;if(i){const e=JSON.parse(i);return Promise.resolve(Tc.utils.createQmsAdapter(t,{qms:e,baselayer:!0}))}if(o){const e=t.mapAdapter.layerAdapters.TILE;if(e){class t extends e{addLayer(e){return Wc(this,null,function*(){if(o)return Uc(t.prototype,this,"addLayer").call(this,Fc(qc({},e),{url:o}))})}}return t}}}})}(l);else if("GEOJSON"===r&&n.resource.parent){const e=yield i.getResource(n.resource.parent.id);if(e){const i=Ih(Sh({},t),{resource:n.resource.parent.id});o=ch(Ih(Sh({},l),{item:e,layerOptions:i}))}}else o=Lh(l)}else{if(!jh[a])throw`Resource class '${a}' not yet supported.`;{const t=jh[a];let e;e=r&&"function"!=typeof e?t[r]:t,e&&(o=e(l))}}}}if(o)return o.then(t=>{if(t){const e=t;return n&&(e.prototype.item=n,e.prototype.resourceId=n.resource.id,e.prototype.connector=i),Q(e,[Es],{replace:!1}),e}})})}var Rh=Object.defineProperty,Dh=Object.getOwnPropertySymbols,qh=Object.prototype.hasOwnProperty,Fh=Object.prototype.propertyIsEnumerable,Uh=(t,e,i)=>e in t?Rh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Wh=(t,e)=>{for(var i in e||(e={}))qh.call(e,i)&&Uh(t,i,e[i]);if(Dh)for(var i of Dh(e))Fh.call(e,i)&&Uh(t,i,e[i]);return t},Hh=(t,e,i)=>Uh(t,"symbol"!=typeof e?e+"":e,i);class Vh{constructor(t){if(Hh(this,"options",t),Hh(this,"url"),Hh(this,"connector"),Hh(this,"webMap"),this.options.connector)this.url=this.options.connector.options.baseUrl||"",this.connector=this.options.connector;else{if(!this.options.baseUrl)throw new Error("url is not defined");this.url=this.options.baseUrl,this.connector=new us({baseUrl:this.url,auth:this.options.auth})}}static addClassAdapters(t,e){jh[t]=e}onLoadSync(t){return e=this,i=null,o=function*(){if(this.options.resourceId&&this.url){const e=[this.options.resourceId];if(e.length)for(const i of e){const e={resourceId:i,connector:this.connector,webMap:t};return yield t.addLayer(Ql,Wh({visibility:!0,fit:!0,pixelRadius:this.options.pixelRadius},e))}}},new Promise((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())});var e,i,o}getLayerAdapters(){return Promise.resolve([this._getLayerAdapter()])}_getLayerAdapter(){return{name:"WEBMAP",createAdapter:t=>Promise.resolve(this._createAdapter(t))}}_createAdapter(t){return e={webMap:t,connector:this.connector,baseUrl:this.url},class extends Ql{constructor(t,i){super(t,i=rc(rc({},e),i))}};var e}}var Gh=Object.defineProperty,Jh=Object.getOwnPropertySymbols,Kh=Object.prototype.hasOwnProperty,Yh=Object.prototype.propertyIsEnumerable,Qh=(t,e,i)=>e in t?Gh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,$h=(t,e)=>{for(var i in e||(e={}))Kh.call(e,i)&&Qh(t,i,e[i]);if(Jh)for(var i of Jh(e))Yh.call(e,i)&&Qh(t,i,e[i]);return t},Xh=(t,e,i)=>Qh(t,"symbol"!=typeof e?e+"":e,i),tu=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});class eu{constructor(t){Xh(this,"id"),Xh(this,"label"),Xh(this,"layerId"),Xh(this,"parent"),Xh(this,"fields"),Xh(this,"geom"),Xh(this,"extensions"),Xh(this,"connector"),Xh(this,"_item"),Xh(this,"_geojson"),Xh(this,"_resource"),Xh(this,"_extent");const e=t.feature;this.id=e.id,this.geom=e.geom,this.label=e.label,this.parent=e.parent,this.fields=e.fields,this.layerId=e.layerId,this.connector=t.connector}identify(t={}){return this._item?Promise.resolve(this._item):Ca($h({connector:this.connector,featureId:this.id,resourceId:this.layerId,fields:null,extensions:["attachment","description"]},t)).then(t=>(this._item=t,this.geom=t.geom,this.extensions=t.extensions,t))}resource(t){return tu(this,null,function*(){return(yield this.composite(t)).feature_layer})}composite(t){return tu(this,null,function*(){if(this._resource&&this._resource.feature_layer)return this._resource;const e=yield this.connector.getResource(this.layerId,t);if(!e)throw new Error("Resource does not exist");if(!e.feature_layer)throw new Error("Resource is not a vector layer");return this._resource=e,e})}getBounds(t){return this._extent?Promise.resolve(this._extent):function({resourceId:t,featureId:e,connector:i,cache:o=!0,signal:n}){return i.route("feature_layer.feature.item_extent",{id:Number(t),fid:e}).get({cache:o,signal:n}).then(t=>{if(t&&t.extent){const{maxLat:e,maxLon:i,minLat:o,minLon:n}=t.extent;return[n,o,i,e]}})}($h({connector:this.connector,featureId:this.id,resourceId:this.layerId},t))}geojson(t={}){return this._geojson?Promise.resolve(this._geojson):this.identify(t).then(t=>t.toGeojson().then(t=>(this._geojson=t,t)))}}function iu(t){return e=this,i=null,o=function*(){return Vs(yield Ca(t))},new Promise((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())});var e,i,o}function ou(t,e){return i=this,o=null,n=function*(){var i,o;const n=yield t.route("pyramid.settings").get({query:{component:"pyramid"}}),r=n&&"company_logo"in n?n.company_logo:void 0;if(r&&r.enabled){const n=document.createElement("a");n.style.position="absolute",n.style.bottom="0",n.style.right="0",n.style.padding=null!=(i=null==e?void 0:e.padding)?i:"10px",n.className="ngw-map-logo",e&&e.cssClass&&(n.className+=" "+e.cssClass);const s=new Image;s.style.maxHeight="100px",s.style.maxWidth="100px",s.src="";const a=null==(o=(yield t.route("pyramid.csettings").get({query:{pyramid:["header_logo"]}})).pyramid)?void 0:o.header_logo;if(!a)return;{const[t,e]=a,i=atob(e),o=new Array(i.length);for(let s=0;s<i.length;s++)o[s]=i.charCodeAt(s);const n=new Uint8Array(o),r=new Blob([n],{type:t}),l=(window.URL||window.webkitURL).createObjectURL(r);s.src=l}return null!==r.link&&""!==r.link.trim()&&(n.href=r.link,n.target="_blank",-1!==r.link.search(/:\/\/nextgis/)&&(s.alt="Get your own Web GIS at nextgis.com")),n.appendChild(s),n}},new Promise((t,e)=>{var r=t=>{try{a(n.next(t))}catch(i){e(i)}},s=t=>{try{a(n.throw(t))}catch(i){e(i)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((n=n.apply(i,o)).next())});var i,o,n}var nu=Object.defineProperty,ru=Object.defineProperties,su=Object.getOwnPropertyDescriptors,au=Object.getOwnPropertySymbols,lu=Object.prototype.hasOwnProperty,cu=Object.prototype.propertyIsEnumerable,hu=(t,e,i)=>e in t?nu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,uu=(t,e)=>{for(var i in e||(e={}))lu.call(e,i)&&hu(t,i,e[i]);if(au)for(var i of au(e))cu.call(e,i)&&hu(t,i,e[i]);return t},pu=(t,e)=>ru(t,su(e));function du(t,e=!1){const i=[],o=[];for(const r in t){const t=Number(r);isNaN(t)||i.push(t)}const n=t.resources;n&&i.sort((t,e)=>n.indexOf(t)-n.indexOf(e));for(let r=0;r<i.length;r++){const n=i[r],s=t[n];if("features"in s){const t=fu(s.features,Number(n),e);if(t.length&&(o.push(...t),!e))break}}return o}function fu(t,e,i){const o=[];for(const n of t){if(o.push({featureId:n.id,resourceId:e,feature:n}),!i)break}return o}function mu(t){const{geom:e,signal:i,cache:o,layers:n}=t,r="string"==typeof e?e:function(t){const e=function(t){var e;if(Array.isArray(t))return t;if("Feature"===t.type)return null==(e=t.geometry)?void 0:e.coordinates[0];if("Polygon"===t.type)return t.coordinates[0];return null}(t);if(!e)return null;return`POLYGON((${e.map(([t,e])=>{const[i,o]=ot(t,e);return`${i} ${o}`}).join(",")}))`}(e);if(!r)throw new Error("Not valid geometry format to make intersection");const s={geom:r,srs:3857,layers:n};return t.connector.route("feature_layer.identify").post({json:s,signal:i,cache:o})}var gu=Object.defineProperty,yu=Object.defineProperties,_u=Object.getOwnPropertyDescriptors,vu=Object.getOwnPropertySymbols,bu=Object.prototype.hasOwnProperty,wu=Object.prototype.propertyIsEnumerable,xu=(t,e,i)=>e in t?gu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Pu=(t,e)=>{for(var i in e||(e={}))bu.call(e,i)&&xu(t,i,e[i]);if(vu)for(var i of vu(e))wu.call(e,i)&&xu(t,i,e[i]);return t},Lu=(t,e)=>yu(t,_u(e));function Ou(t,e,i,o){if("number"==typeof e||"string"==typeof e)e=Number(e),t.push(Lu(Pu({},i),{resource:e}));else if(Array.isArray(e)){const[n,r]=e;t.push(Pu(Lu(Pu({},i),{resource:n,id:r}),o))}else"object"==typeof e&&t.push(Pu(Pu(Pu({},i),e),o))}var Cu=Object.defineProperty,ku=Object.defineProperties,Eu=Object.getOwnPropertyDescriptors,Mu=Object.getOwnPropertySymbols,Au=Object.prototype.hasOwnProperty,Tu=Object.prototype.propertyIsEnumerable,Su=(t,e,i)=>e in t?Cu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;const Iu={target:"map",baseUrl:"",whitlabel:!1,controls:["ZOOM","ATTRIBUTION"],controlsOptions:{ZOOM:{position:"top-left"},ATTRIBUTION:{position:"bottom-right",customAttribution:['<a href="https://nextgis.com" target="_blank">©NextGIS</a>']}},pixelRadius:10};function zu(t){const e=[new Tc];var i;return t.starterKits&&t.starterKits.forEach(t=>{e.push(t)}),t.connector?t.connector&&(t.baseUrl=t.connector.options.baseUrl):t.connector=new us({baseUrl:t.baseUrl||"",auth:t.auth,withCredentials:t.withCredentials}),(t=X(Iu,t)).center||t.bounds||(t.bounds=[-179,-90,180,90]),t.connector&&e.push(new Vh({connector:t.connector,auth:t.auth})),i=((t,e)=>{for(var i in e||(e={}))Au.call(e,i)&&Su(t,i,e[i]);if(Mu)for(var i of Mu(e))Tu.call(e,i)&&Su(t,i,e[i]);return t})({},t),t=ku(i,Eu({starterKits:e,create:!1}))}var ju=Object.defineProperty,Bu=Object.defineProperties,Zu=Object.getOwnPropertyDescriptors,Nu=Object.getOwnPropertySymbols,Ru=Object.getPrototypeOf,Du=Object.prototype.hasOwnProperty,qu=Object.prototype.propertyIsEnumerable,Fu=Reflect.get,Uu=(t,e,i)=>e in t?ju(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Wu=(t,e)=>{for(var i in e||(e={}))Du.call(e,i)&&Uu(t,i,e[i]);if(Nu)for(var i of Nu(e))qu.call(e,i)&&Uu(t,i,e[i]);return t},Hu=(t,e)=>Bu(t,Zu(e)),Vu=(t,e,i)=>Uu(t,"symbol"!=typeof e?e+"":e,i),Gu=(t,e,i)=>Fu(Ru(t),i,e),Ju=(t,e,i)=>new Promise((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())});const Ku=class t extends _o{constructor(t){super(zu(t)),Vu(this,"emitter",new H),Vu(this,"connector"),Vu(this,"_ngwLayers",{}),Vu(this,"$$selectFromNgwRaster"),Vu(this,"$$selectFromNgwVector"),Vu(this,"_promises",{select:[],identify:[]}),t.connector&&(this.connector=t.connector),this._createWebMap().then(()=>{const t=this.getContainer();t&&t.classList.add("ngw-map-container"),this.options.whitlabel&&this._whiteLabel()})}addControl(e,i,o){return Ju(this,null,function*(){return yield this.onLoad("controls:create"),Gu(t.prototype,this,"addControl").call(this,e,i,o)})}addNgwLayer(t){return Ju(this,null,function*(){yield this.onMapLoad();const{keyname:e,resourceId:i,filters:o}=t;(e||void 0!==i)&&console.warn(`DEPRECATED WARN: ${"set `resource` options instead of `keyname` or `resourceId`"}`);const n=t.resource;if(!e&&!i&&!n)throw new Error("resource, resourceId or keyname is required parameter to add NGW layer");if(tt(this.options.baseUrl))try{t.adapterOptions=t.adapterOptions||{},tt(this.options.setViewDelay)&&(tt(t.adapterOptions.setViewDelay)||(t.adapterOptions.setViewDelay=this.options.setViewDelay)),tt(o)&&(t.adapterOptions.propertiesFilter=o);const e=function(t,e,i){const o=i.getAuthorizationHeaders();return o&&(t.headers=o),void 0!==i.withCredentials&&(t.withCredentials=i.withCredentials),Nh(t,e,i)}(t,this,this.connector),i=Wu(Wu({visibility:!0},t),t.adapterOptions),n=yield this.addLayer(e,i),r=n&&this.getLayerId(n);if(n&&r&&(this._ngwLayers[r]={layer:n,resourceId:n.resourceId},n.options.name=n.options.name||n.item&&n.item.resource.display_name,n.options.baselayer)){if(this.getActiveBaseLayer())return n}return n}catch(r){const t=pt(n)&&"id"in n?n.id:e||i||n;console.error(`Can't add NGW layer ${t}.`,r)}})}fit(){const{center:t,zoom:e,bounds:i}=this.options;t?(this.setCenter(t),e&&this.setZoom(e)):i&&this.fitBounds(i)}fetchNgwLayerItem(t){return Ca(Wu({connector:this.connector},t))}fetchNgwLayerItems(t){return fa(Wu({connector:this.connector},t))}fetchNgwLayerFeature(t){return iu(Wu({connector:this.connector},t))}fetchNgwLayerFeatures(t){return Vc(Wu({connector:this.connector},t))}fetchIdentifyItem(t,e){const i=new AbortController,o=i.signal;(null==e?void 0:e.signal)&&e.signal.addEventListener("abort",i.abort),(e=e||{}).signal=o;const n=function(t){const{connector:e,identify:i}=t,o=du(i);return o&&o.length?Ca(uu(uu({connector:e},t.requestOptions),o[0])):Promise.resolve(void 0)}({identify:t,connector:this.connector,requestOptions:e});return this._addPromise("identify",n,i),n}fetchIdentifyGeoJson(t,{signal:e}={}){const i=new AbortController;if(e){if(e.aborted)return Promise.reject(new us.errors.AbortError);e.addEventListener("abort",()=>{i.abort("AbortError")})}const o=function(t){const{connector:e,identify:i,requestOptions:o}=t;for(const r in i){const t=Number(r);if(!isNaN(t)){const t=i[r];if("features"in t){const e=t.features.find(t=>t.geom);if(e&&e.geom){const t=e.geom;return Promise.resolve(Vs(pu(uu({},e),{geom:t})))}}}}const n=du(i);return n&&n.length?iu(uu(pu(uu({},o),{connector:e}),n[0])):Promise.resolve(void 0)}({identify:t,connector:this.connector,requestOptions:{signal:i.signal}});return o&&"then"in o?(this._addPromise("identify",o,i),o):Promise.resolve(o)}getIdentifyGeoJson(t,e=!1){return this.fetchIdentifyGeoJson(t,{multiple:e})}getNgwLayers(){return Ju(this,null,function*(){return yield this.onLoad(),this._ngwLayers})}getNgwLayerByResourceId(t){return Ju(this,null,function*(){for(const e in this._ngwLayers){const i=this._ngwLayers[e];if(i.resourceId===t)return i&&i.layer;if(i.layer.getIdentificationIds){const e=yield i.layer.getIdentificationIds();if(e&&e.some(e=>e===t))return i.layer}if(i.layer.getDependLayers){const e=i.layer.getDependLayers().find(e=>e.item&&"style_parent_id"in e.item&&void 0!==e.item.style_parent_id&&e.item.style_parent_id===t);if(e)return e.layer}}})}fitLayer(e,i){return Ju(this,null,function*(){let o;o="string"==typeof e||"number"==typeof e?String(o):e.id;const n=o&&this._ngwLayers[o];if(n)if(n.layer.getBounds){const t=yield n.layer.getBounds();t&&this.fitBounds(t,i)}else{let t;if(n.layer.item)t=n.layer.item;else{const e=n.resourceId;t=yield this.connector.getResource(e)}t&&this.fitResource(t.resource.id)}else Gu(t.prototype,this,"fitLayer").call(this,"number"==typeof e?String(e):e,i)})}fitResource(t,e){return Ju(this,null,function*(){const i=yield this.connector.resources.getIdOrFail(t),o=yield Ps({resourceId:i,connector:this.connector});o&&this.fitBounds(o,e)})}zoomToLayer(t){return Ju(this,null,function*(){return this.fitLayer(t)})}onLoad(t="ngw-map:create"){return super.onLoad(t)}removeLayer(t){const e=this.getLayer(t);if(e){const t=this.getLayerId(e);t&&delete this._ngwLayers[t],super.removeLayer(e)}}enableSelection(){this.$$selectFromNgwRaster||(this.$$selectFromNgwRaster=t=>{this._getSelectListenersCount()&&this.selectFromNgwRaster(t)},this.$$selectFromNgwVector=t=>{this._getSelectListenersCount()&&this._selectFromNgwVector(t)},this.emitter.on("click",this.$$selectFromNgwRaster),this.emitter.on("layer:click",this.$$selectFromNgwVector))}disableSelection(){this.$$selectFromNgwRaster&&(this.emitter.removeListener("click",this.$$selectFromNgwRaster),this.$$selectFromNgwRaster=void 0),this.$$selectFromNgwVector&&(this.emitter.removeListener("layer:click",this.$$selectFromNgwVector),this.$$selectFromNgwVector=void 0)}getNgwLayerItem(t){return this.fetchNgwLayerItem(t)}getNgwLayerItems(t){return this.fetchNgwLayerItems(t)}getNgwLayerFeature(t){return this.fetchNgwLayerFeature(t)}getNgwLayerFeatures(t){return this.fetchNgwLayerFeatures(t)}cancelPromise(...t){this.cancelPromises(...t)}cancelPromises(...t){t.length||(t=Object.keys(this._promises)),t.forEach(t=>{const e=this._promises[t];e&&(e.forEach(t=>t[1].abort()),this._promises[t]=[])})}selectFromNgwRaster(t){return Ju(this,null,function*(){var e;this._emitStatusEvent("ngw:preselect");const i=[],o=Object.values(this._ngwLayers);o.sort((t,e)=>t.layer.order&&e.layer.order?e.layer.order-t.layer.order:1);for(const t of o){const o=t.layer,n="function"==typeof o.getIdentificationIds&&o.getIdentificationIds,r=null==(e=o.options.interactive)||e;if(n&&o.options.selectable&&r&&this.isLayerVisible(o)){const t=n.call(o);i.push(t)}}const n=Promise.all(i),r=yield n,s=[];for(const t of r)t&&s.push(...t);if(!s.length)return void this._emitStatusEvent("ngw:select",null);const a=this.options.pixelRadius||10,l=this.getCenter();let c=this.getZoom();if(c=void 0!==c?c:20,!l||!c)return void this._emitStatusEvent("ngw:select",null);const h=function(t,e,i){return(i=null!=i?i:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,e+8))*5e-4}(l,c,a);let u;if(this.options.highlightIdentification){const e=this.options.highlightIdentification,i="number"==typeof e?e:1e3,[o,n]=t.lngLat;u={type:"Polygon",coordinates:[lt(o,n,h)]};const r=yield this.addGeoJsonLayer({data:{type:"Feature",geometry:u}});i!==1/0&&setTimeout(()=>{this.removeLayer(r)},i)}const p=new AbortController,d=function(t,e){it(t);const[i,o]=t.lngLat,{geom:n,radius:r}=e,s=null!=n?n:lt(i,o,r);return mu(pu(uu({},e),{geom:s}))}(t,{layers:s,connector:this.connector,radius:h,geom:u,signal:p.signal}).then(e=>{const i=Hu(Wu({},e),{resources:s,sourceType:"raster",event:t}),o=this._prepareToIdentify(i);return this._emitStatusEvent("ngw:select",o),o});return this._addPromise("select",d,p),d})}_addPromise(t,e,i){const o=this._promises[t];if(o&&-1===o.findIndex(t=>t[0]===e)){const t=()=>{const t=o.findIndex(t=>t[0]===e);-1!==t&&o.splice(t,1)};e.then(t,t),o.push([e,i])}}_isFitFromResource(){const t=this._initMapState;return!t.zoom||!t.center}_createWebMap(){return Ju(this,null,function*(){yield this.create(),this.options.qmsId&&this._addQmsBaseLayer(),this.options.osm&&this._addOsmBaseLayer();const t=[],e=this._isFitFromResource();if(this.options.webmapId&&Ou(t,this.options.webmapId,{fit:e}),this.options.resources&&Array.isArray(this.options.resources))for(const o of this.options.resources){const i={};e||(i.fit=!1),Ou(t,o,{},i)}for(const o of t)try{yield this.addNgwLayer(o)}catch(i){console.warn(i)}this._emitStatusEvent("ngw-map:create",this),this.enableSelection()})}_addOsmBaseLayer(){this.addBaseLayer("OSM")}_addQmsBaseLayer(){let t,e;Array.isArray(this.options.qmsId)?(t=this.options.qmsId[0],e=this.options.qmsId[1]):t=Number(this.options.qmsId);const i={qmsId:t};e&&(i.id=e),this.addBaseLayer("QMS",i)}_selectFromNgwVector(t){const e=t.layer;if(!(e.options.selectable&&this.isLayerVisible(e)))return;const i=e.item&&e.item.resource.id,o=t.feature;if(void 0!==i&&o){const t=o.id;if(t){const e={featureCount:1,features:[{id:Number(t),fields:o.properties||{},label:`#${i}`,layerId:Number(i),parent:"",geom:o.geometry}]},n={featureCount:1,[i]:e};return this._emitStatusEvent("ngw:select",this._prepareToIdentify(Hu(Wu({},n),{resources:[i],sourceType:"vector"}))),n}}}_prepareToIdentify(t){return Hu(Wu({},t),{getIdentifyItems:()=>du(t,!0).map(t=>new eu({feature:t.feature,connector:this.connector}))})}_getSelectListenersCount(){return this.emitter.listenerCount("ngw:select")}_whiteLabel(){return Ju(this,null,function*(){const t=this.getContainer();if(t){const e=yield ou(this.connector,this.options.companyLogoOptions);e&&t.appendChild(e)}})}};Vu(Ku,"getIcon",function(t={}){var e,i,o,n,r,s;const a=null!=(e=t.shape)?e:"circle",l=null!=(i=t.color)?i:"blue",c=null!=(o=t.strokeColor)?o:"white",h=null!=(n=t.size)?n:12,u=null!=(r=t.rotate)?r:0,p=null!=(s=t.anchor)?s:[h/2,h/2],d=void 0!==t.stroke?Number(t.stroke):.8,f=t.p||Ln[a]||"circle",m="string"==typeof f?f:f(t),g=function(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}(t.svg||function({width:t,height:e,stroke:i=0,content:o}){const n=i/2;return`<svg\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n width="${t}"\n height="${e}"\n viewBox="-${n} -${n} ${12+i} ${12+i}"\n >${o}</svg>`}({width:h,height:h,stroke:d,content:m}));return g.setAttribute("width",String(h)),g.setAttribute("height",String(h)),g.setAttribute("fill",l),d&&(g.setAttribute("stroke",c),g.setAttribute("stroke-width",String(d))),{type:"icon",iconSize:[h,h],iconAnchor:p,html:(new XMLSerializer).serializeToString(g),rotate:u,svg:g}});let Yu=Ku;u('.leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-overlay-pane svg,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-width:none!important;max-height:none!important}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-bottom,.leaflet-top{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-tile{will-change:opacity}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}.leaflet-zoom-anim .leaflet-zoom-animated{will-change:transform;transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline:0}.leaflet-container a{color:#0078a8}.leaflet-container a.leaflet-active{outline:2px solid orange}.leaflet-zoom-box{border:2px dotted #38f;background:hsla(0,0%,100%,.5)}.leaflet-container{font:12px/1.5 Helvetica Neue,Arial,Helvetica,sans-serif}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,.65);border-radius:4px}.leaflet-bar a,.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(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=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:hsla(0,0%,100%,.7);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;font-size:11px;white-space:nowrap;overflow:hidden;box-sizing:border-box;background:#fff;background:hsla(0,0%,100%,.5)}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 19px;line-height:1.4}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px rgba(0,0,0,.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;padding:4px 4px 0 0;border:none;text-align:center;width:18px;height:14px;font:16px/14px Tahoma,Verdana,sans-serif;color:#c3c3c3;text-decoration:none;font-weight:700;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678)}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,.4)}.leaflet-tooltip.leaflet-clickable{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}');u(".ngw-map-container.leaflet-container{background:#fff}.leaflet-pane .leaflet-popup-pane{z-index:9999999999}");var Qu=Object.defineProperty,$u=Object.defineProperties,Xu=Object.getOwnPropertyDescriptors,tp=Object.getOwnPropertySymbols,ep=Object.prototype.hasOwnProperty,ip=Object.prototype.propertyIsEnumerable,op=(t,e,i)=>e in t?Qu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;delete P.Icon.Default.prototype._getIconUrl,P.Icon.Default.mergeOptions({iconRetinaUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",iconUrl:"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=",shadowUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC"});class np extends Yu{constructor(t){var e,i;e=((t,e)=>{for(var i in e||(e={}))ep.call(e,i)&&op(t,i,e[i]);if(tp)for(var i of tp(e))ip.call(e,i)&&op(t,i,e[i]);return t})({},t),i={mapAdapter:new Pn},super(t=$u(e,Xu(i)))}static create(t){return e=this,i=null,o=function*(){return new np(t).onLoad()},new Promise((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())});var e,i,o}}return window&&!window.NgwMap&&(window.NgwMap=np),np}();
5
+ */var P=(w||(w=1,function(t){var e="1.7.1";function i(t){var e,i,o,r;for(i=1,o=arguments.length;i<o;i++)for(e in r=arguments[i])t[e]=r[e];return t}var o=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function r(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var o=i.call(arguments,2);return function(){return t.apply(e,o.length?o.concat(i.call(arguments)):arguments)}}var n=0;function s(t){return t._leaflet_id=t._leaflet_id||++n,t._leaflet_id}function a(t,e,i){var o,r,n,s;return s=function(){o=!1,r&&(n.apply(i,r),r=!1)},n=function(){o?r=arguments:(t.apply(i,arguments),setTimeout(s,e),o=!0)},n}function l(t,e,i){var o=e[1],r=e[0],n=o-r;return t===o&&i?t:((t-r)%n+n)%n+r}function c(){return!1}function h(t,e){var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function u(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return u(t).split(/\s+/)}function d(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?o(t.options):{}),e)t.options[i]=e[i];return t.options}function f(t,e,i){var o=[];for(var r in t)o.push(encodeURIComponent(i?r.toUpperCase():r)+"="+encodeURIComponent(t[r]));return(e&&-1!==e.indexOf("?")?"&":"?")+o.join("&")}var m=/\{ *([\w_-]+) *\}/g;function g(t,e){return t.replace(m,function(t,i){var o=e[i];if(void 0===o)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o})}var y=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function _(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var b="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function v(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function x(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var P=window.requestAnimationFrame||v("RequestAnimationFrame")||x,O=window.cancelAnimationFrame||v("CancelAnimationFrame")||v("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function C(t,e,i){if(!i||P!==x)return P.call(window,r(t,e));t.call(e)}function k(t){t&&O.call(window,t)}var E={extend:i,create:o,bind:r,lastId:n,stamp:s,throttle:a,wrapNum:l,falseFn:c,formatNum:h,trim:u,splitWords:p,setOptions:d,getParamString:f,template:g,isArray:y,indexOf:_,emptyImageUrl:b,requestFn:P,cancelFn:O,requestAnimFrame:C,cancelAnimFrame:k};function M(){}function A(t){if("undefined"!=typeof L&&L&&L.Mixin){t=y(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}M.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},r=e.__super__=this.prototype,n=o(r);for(var s in n.constructor=e,e.prototype=n,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(e[s]=this[s]);return t.statics&&(i(e,t.statics),delete t.statics),t.includes&&(A(t.includes),i.apply(null,[n].concat(t.includes)),delete t.includes),n.options&&(t.options=i(o(n.options),t.options)),i(n,t),n._initHooks=[],n.callInitHooks=function(){if(!this._initHooksCalled){r.callInitHooks&&r.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=n._initHooks.length;t<e;t++)n._initHooks[t].call(this)}},e},M.include=function(t){return i(this.prototype,t),this},M.mergeOptions=function(t){return i(this.prototype.options,t),this},M.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var S={on:function(t,e,i){if("object"==typeof t)for(var o in t)this._on(o,t[o],e);else for(var r=0,n=(t=p(t)).length;r<n;r++)this._on(t[r],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var o in t)this._off(o,t[o],e);else for(var r=0,n=(t=p(t)).length;r<n;r++)this._off(t[r],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var o=this._events[t];o||(this._events[t]=o=[]),i===this&&(i=void 0);for(var r={fn:e,ctx:i},n=o,s=0,a=n.length;s<a;s++)if(n[s].fn===e&&n[s].ctx===i)return;n.push(r)},_off:function(t,e,i){var o,r,n;if(this._events&&(o=this._events[t]))if(e){if(i===this&&(i=void 0),o)for(r=0,n=o.length;r<n;r++){var s=o[r];if(s.ctx===i&&s.fn===e)return s.fn=c,this._firingCount&&(this._events[t]=o=o.slice()),void o.splice(r,1)}}else{for(r=0,n=o.length;r<n;r++)o[r].fn=c;delete this._events[t]}},fire:function(t,e,o){if(!this.listens(t,o))return this;var r=i({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var n=this._events[t];if(n){this._firingCount=this._firingCount+1||1;for(var s=0,a=n.length;s<a;s++){var l=n[s];l.fn.call(l.ctx||this,r)}this._firingCount--}}return o&&this._propagateEvent(r),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var o in this._eventParents)if(this._eventParents[o].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var o in t)this.once(o,t[o],e);return this}var n=r(function(){this.off(t,e,i).off(t,n,i)},this);return this.on(t,e,i).on(t,n,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[s(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[s(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,i({layer:t.target,propagatedFrom:t.target},t),!0)}};S.addEventListener=S.on,S.removeEventListener=S.clearAllEventListeners=S.off,S.addOneTimeEventListener=S.once,S.fireEvent=S.fire,S.hasEventListeners=S.listens;var T=M.extend(S);function I(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var z=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function j(t,e,i){return t instanceof I?t:y(t)?new I(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new I(t.x,t.y):new I(t,e,i)}function B(t,e){if(t)for(var i=e?[t,e]:t,o=0,r=i.length;o<r;o++)this.extend(i[o])}function Z(t,e){return!t||t instanceof B?t:new B(t,e)}function D(t,e){if(t)for(var i=e?[t,e]:t,o=0,r=i.length;o<r;o++)this.extend(i[o])}function N(t,e){return t instanceof D?t:new D(t,e)}function R(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function q(t,e,i){return t instanceof R?t:y(t)&&"object"!=typeof t[0]?3===t.length?new R(t[0],t[1],t[2]):2===t.length?new R(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new R(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new R(t,e,i)}I.prototype={clone:function(){return new I(this.x,this.y)},add:function(t){return this.clone()._add(j(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(j(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new I(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new I(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=z(this.x),this.y=z(this.y),this},distanceTo:function(t){var e=(t=j(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=j(t)).x===this.x&&t.y===this.y},contains:function(t){return t=j(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+h(this.x)+", "+h(this.y)+")"}},B.prototype={extend:function(t){return t=j(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new I((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new I(this.min.x,this.max.y)},getTopRight:function(){return new I(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof I?j(t):Z(t))instanceof B?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=Z(t);var e=this.min,i=this.max,o=t.min,r=t.max;return r.x>=e.x&&o.x<=i.x&&r.y>=e.y&&o.y<=i.y},overlaps:function(t){t=Z(t);var e=this.min,i=this.max,o=t.min,r=t.max;return r.x>e.x&&o.x<i.x&&r.y>e.y&&o.y<i.y},isValid:function(){return!(!this.min||!this.max)}},D.prototype={extend:function(t){var e,i,o=this._southWest,r=this._northEast;if(t instanceof R)e=t,i=t;else{if(!(t instanceof D))return t?this.extend(q(t)||N(t)):this;if(i=t._northEast,!(e=t._southWest)||!i)return this}return o||r?(o.lat=Math.min(e.lat,o.lat),o.lng=Math.min(e.lng,o.lng),r.lat=Math.max(i.lat,r.lat),r.lng=Math.max(i.lng,r.lng)):(this._southWest=new R(e.lat,e.lng),this._northEast=new R(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,r=Math.abs(e.lng-i.lng)*t;return new D(new R(e.lat-o,e.lng-r),new R(i.lat+o,i.lng+r))},getCenter:function(){return new R((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 R(this.getNorth(),this.getWest())},getSouthEast:function(){return new R(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof R||"lat"in t?q(t):N(t);var e,i,o=this._southWest,r=this._northEast;return t instanceof D?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=r.lat&&e.lng>=o.lng&&i.lng<=r.lng},intersects:function(t){t=N(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),r=t.getNorthEast();return r.lat>=e.lat&&o.lat<=i.lat&&r.lng>=e.lng&&o.lng<=i.lng},overlaps:function(t){t=N(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),r=t.getNorthEast();return r.lat>e.lat&&o.lat<i.lat&&r.lng>e.lng&&o.lng<i.lng},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=N(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},R.prototype={equals:function(t,e){return!!t&&(t=q(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+h(this.lat,t)+", "+h(this.lng,t)+")"},distanceTo:function(t){return W.distance(this,q(t))},wrap:function(){return W.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return N([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new R(this.lat,this.lng,this.alt)}};var F,U={latLngToPoint:function(t,e){var i=this.projection.project(t),o=this.scale(e);return this.transformation._transform(i,o)},pointToLatLng:function(t,e){var i=this.scale(e),o=this.transformation.untransform(t,i);return this.projection.unproject(o)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new B(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?l(t.lng,this.wrapLng,!0):t.lng;return new R(this.wrapLat?l(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),o=e.lat-i.lat,r=e.lng-i.lng;if(0===o&&0===r)return t;var n=t.getSouthWest(),s=t.getNorthEast();return new D(new R(n.lat-o,n.lng-r),new R(s.lat-o,s.lng-r))}},W=i({},U,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,o=t.lat*i,r=e.lat*i,n=Math.sin((e.lat-t.lat)*i/2),s=Math.sin((e.lng-t.lng)*i/2),a=n*n+Math.cos(o)*Math.cos(r)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),H=6378137,V={R:H,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),r=Math.sin(o*e);return new I(this.R*t.lng*e,this.R*Math.log((1+r)/(1-r))/2)},unproject:function(t){var e=180/Math.PI;return new R((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(F=H*Math.PI,new B([-F,-F],[F,F]))};function G(t,e,i,o){if(y(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=o}function J(t,e,i,o){return new G(t,e,i,o)}G.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return t.x=(e=e||1)*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return new I((t.x/(e=e||1)-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=i({},W,{code:"EPSG:3857",projection:V,transformation:function(){var t=.5/(Math.PI*V.R);return J(t,.5,-t,.5)}()}),Y=i({},K,{code:"EPSG:900913"});function $(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Q(t,e){var i,o,r,n,s,a,l="";for(i=0,r=t.length;i<r;i++){for(o=0,n=(s=t[i]).length;o<n;o++)l+=(o?"L":"M")+(a=s[o]).x+" "+a.y;l+=e?At?"z":"x":""}return l||"M0 0"}var X=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),ot=Tt("webkit"),rt=Tt("android"),nt=Tt("android 2")||Tt("android 3"),st=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=rt&&Tt("Google")&&st<537&&!("AudioNode"in window),lt=!!window.opera,ct=!it&&Tt("chrome"),ht=Tt("gecko")&&!ot&&!lt&&!tt,ut=!ct&&Tt("safari"),pt=Tt("phantom"),dt="OTransition"in X,ft=0===navigator.platform.indexOf("Win"),mt=tt&&"transition"in X,gt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!nt,yt="MozPerspective"in X,_t=!window.L_DISABLE_3D&&(mt||gt||yt)&&!dt&&!pt,bt="undefined"!=typeof orientation||Tt("mobile"),vt=bt&&ot,wt=bt&&gt,xt=!window.PointerEvent&&window.MSPointerEvent,Pt=!(!window.PointerEvent&&!xt),Lt=!window.L_NO_TOUCH&&(Pt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Ot=bt&&lt,Ct=bt&&ht,kt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Et=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",c,e),window.removeEventListener("testPassiveEventSupport",c,e)}catch(i){}return t}(),Mt=!!document.createElement("canvas").getContext,At=!(!document.createElementNS||!$("svg").createSVGRect),St=!At&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(i){return!1}}();function Tt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var It={ie:tt,ielt9:et,edge:it,webkit:ot,android:rt,android23:nt,androidStock:at,opera:lt,chrome:ct,gecko:ht,safari:ut,phantom:pt,opera12:dt,win:ft,ie3d:mt,webkit3d:gt,gecko3d:yt,any3d:_t,mobile:bt,mobileWebkit:vt,mobileWebkit3d:wt,msPointer:xt,pointer:Pt,touch:Lt,mobileOpera:Ot,mobileGecko:Ct,retina:kt,passiveEvents:Et,canvas:Mt,svg:At,vml:St},zt=xt?"MSPointerDown":"pointerdown",jt=xt?"MSPointerMove":"pointermove",Bt=xt?"MSPointerUp":"pointerup",Zt=xt?"MSPointerCancel":"pointercancel",Dt={},Nt=!1;function Rt(t,e,i,o){return"touchstart"===e?Ft(t,i,o):"touchmove"===e?Gt(t,i,o):"touchend"===e&&Jt(t,i,o),this}function qt(t,e,i){var o=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(zt,o,!1):"touchmove"===e?t.removeEventListener(jt,o,!1):"touchend"===e&&(t.removeEventListener(Bt,o,!1),t.removeEventListener(Zt,o,!1)),this}function Ft(t,e,i){var o=r(function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&We(t),Vt(t,e)});t["_leaflet_touchstart"+i]=o,t.addEventListener(zt,o,!1),Nt||(document.addEventListener(zt,Ut,!0),document.addEventListener(jt,Wt,!0),document.addEventListener(Bt,Ht,!0),document.addEventListener(Zt,Ht,!0),Nt=!0)}function Ut(t){Dt[t.pointerId]=t}function Wt(t){Dt[t.pointerId]&&(Dt[t.pointerId]=t)}function Ht(t){delete Dt[t.pointerId]}function Vt(t,e){for(var i in t.touches=[],Dt)t.touches.push(Dt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var o=function(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||Vt(t,e)};t["_leaflet_touchmove"+i]=o,t.addEventListener(jt,o,!1)}function Jt(t,e,i){var o=function(t){Vt(t,e)};t["_leaflet_touchend"+i]=o,t.addEventListener(Bt,o,!1),t.addEventListener(Zt,o,!1)}var Kt=xt?"MSPointerDown":Pt?"pointerdown":"touchstart",Yt=xt?"MSPointerUp":Pt?"pointerup":"touchend",$t="_leaflet_";function Qt(t,e,i){var o,r,n=!1,s=250;function a(t){if(Pt){if(!t.isPrimary)return;if("mouse"===t.pointerType)return}else if(t.touches.length>1)return;var e=Date.now(),i=e-(o||e);r=t.touches?t.touches[0]:t,n=i>0&&i<=s,o=e}function l(t){if(n&&!r.cancelBubble){if(Pt){if("mouse"===t.pointerType)return;var i,s,a={};for(s in r)a[s]=(i=r[s])&&i.bind?i.bind(r):i;r=a}r.type="dblclick",r.button=0,e(r),o=null}}return t[$t+Kt+i]=a,t[$t+Yt+i]=l,t[$t+"dblclick"+i]=e,t.addEventListener(Kt,a,!!Et&&{passive:!1}),t.addEventListener(Yt,l,!!Et&&{passive:!1}),t.addEventListener("dblclick",e,!1),this}function Xt(t,e){var i=t[$t+Yt+e],o=t[$t+"dblclick"+e];return t.removeEventListener(Kt,t[$t+Kt+e],!!Et&&{passive:!1}),t.removeEventListener(Yt,i,!!Et&&{passive:!1}),t.removeEventListener("dblclick",o,!1),this}var te,ee,ie,oe,re,ne=xe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),se=xe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ae="webkitTransition"===se||"OTransition"===se?se+"End":"transitionend";function le(t){return"string"==typeof t?document.getElementById(t):t}function ce(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var o=document.defaultView.getComputedStyle(t,null);i=o?o[e]:null}return"auto"===i?null:i}function he(t,e,i){var o=document.createElement(t);return o.className=e||"",i&&i.appendChild(o),o}function ue(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function de(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function me(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=be(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function ge(t,e){if(void 0!==t.classList)for(var i=p(e),o=0,r=i.length;o<r;o++)t.classList.add(i[o]);else if(!me(t,e)){var n=be(t);_e(t,(n?n+" ":"")+e)}}function ye(t,e){void 0!==t.classList?t.classList.remove(e):_e(t,u((" "+be(t)+" ").replace(" "+e+" "," ")))}function _e(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function be(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function ve(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,o="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(o)}catch(r){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+o+"(opacity="+e+")"}function xe(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Pe(t,e,i){var o=e||new I(0,0);t.style[ne]=(mt?"translate("+o.x+"px,"+o.y+"px)":"translate3d("+o.x+"px,"+o.y+"px,0)")+(i?" scale("+i+")":"")}function Le(t,e){t._leaflet_pos=e,_t?Pe(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Oe(t){return t._leaflet_pos||new I(0,0)}if("onselectstart"in document)te=function(){ze(window,"selectstart",We)},ee=function(){Be(window,"selectstart",We)};else{var Ce=xe(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);te=function(){if(Ce){var t=document.documentElement.style;ie=t[Ce],t[Ce]="none"}},ee=function(){Ce&&(document.documentElement.style[Ce]=ie,ie=void 0)}}function ke(){ze(window,"dragstart",We)}function Ee(){Be(window,"dragstart",We)}function Me(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Ae(),oe=t,re=t.style.outline,t.style.outline="none",ze(window,"keydown",Ae))}function Ae(){oe&&(oe.style.outline=re,oe=void 0,re=void 0,Be(window,"keydown",Ae))}function Se(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Te(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Ie={TRANSFORM:ne,TRANSITION:se,TRANSITION_END:ae,get:le,getStyle:ce,create:he,remove:ue,empty:pe,toFront:de,toBack:fe,hasClass:me,addClass:ge,removeClass:ye,setClass:_e,getClass:be,setOpacity:ve,testProp:xe,setTransform:Pe,setPosition:Le,getPosition:Oe,disableTextSelection:te,enableTextSelection:ee,disableImageDrag:ke,enableImageDrag:Ee,preventOutline:Me,restoreOutline:Ae,getSizedParentNode:Se,getScale:Te};function ze(t,e,i,o){if("object"==typeof e)for(var r in e)Ne(t,r,e[r],i);else for(var n=0,s=(e=p(e)).length;n<s;n++)Ne(t,e[n],i,o);return this}var je="_leaflet_events";function Be(t,e,i,o){if("object"==typeof e)for(var r in e)Re(t,r,e[r],i);else if(e)for(var n=0,s=(e=p(e)).length;n<s;n++)Re(t,e[n],i,o);else{for(var a in t[je])Re(t,a,t[je][a]);delete t[je]}return this}function Ze(){if(Pt)return!(it||ut)}var De={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ne(t,e,i,o){var r=e+s(i)+(o?"_"+s(o):"");if(t[je]&&t[je][r])return this;var n=function(e){return i.call(o||t,e||window.event)},a=n;Pt&&0===e.indexOf("touch")?Rt(t,e,n,r):Lt&&"dblclick"===e&&!Ze()?Qt(t,n,r):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(De[e]||e,n,!!Et&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?t.addEventListener(De[e],n=function(e){e=e||window.event,Qe(t,e)&&a(e)},!1):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,n),t[je]=t[je]||{},t[je][r]=n}function Re(t,e,i,o){var r=e+s(i)+(o?"_"+s(o):""),n=t[je]&&t[je][r];if(!n)return this;Pt&&0===e.indexOf("touch")?qt(t,e,r):Lt&&"dblclick"===e&&!Ze()?Xt(t,r):"removeEventListener"in t?t.removeEventListener(De[e]||e,n,!1):"detachEvent"in t&&t.detachEvent("on"+e,n),t[je][r]=null}function qe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,$e(t),this}function Fe(t){return Ne(t,"wheel",qe),this}function Ue(t){return ze(t,"mousedown touchstart dblclick",qe),Ne(t,"click",Ye),this}function We(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function He(t){return We(t),qe(t),this}function Ve(t,e){if(!e)return new I(t.clientX,t.clientY);var i=Te(e),o=i.boundingClientRect;return new I((t.clientX-o.left)/i.x-e.clientLeft,(t.clientY-o.top)/i.y-e.clientTop)}var Ge=ft&&ct?2*window.devicePixelRatio:ht?window.devicePixelRatio:1;function Je(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Ge:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ke={};function Ye(t){Ke[t.type]=!0}function $e(t){var e=Ke[t.type];return Ke[t.type]=!1,e}function Qe(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(o){return!1}return i!==t}var Xe={on:ze,off:Be,stopPropagation:qe,disableScrollPropagation:Fe,disableClickPropagation:Ue,preventDefault:We,stop:He,getMousePosition:Ve,getWheelDelta:Je,fakeStop:Ye,skipped:$e,isExternalTarget:Qe,addListener:ze,removeListener:Be},ti=T.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(o||.5,.2),this._startPos=Oe(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=C(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Le(this._el,i),this.fire("step")},_complete:function(){k(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ei=T.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=d(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=r(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(q(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=se&&_t&&!Ot&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ze(this._proxy,ae,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,o){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(q(t),e,this.options.maxBounds),o=o||{},this._stop(),this._loaded&&!o.reset&&!0!==o&&(void 0!==o.animate&&(o.zoom=i({animate:o.animate},o.zoom),o.pan=i({animate:o.animate,duration:o.duration},o.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,o.zoom):this._tryAnimatedPan(t,o.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t=t||(_t?this.options.zoomDelta:1)),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t=t||(_t?this.options.zoomDelta:1)),e)},setZoomAround:function(t,e,i){var o=this.getZoomScale(e),r=this.getSize().divideBy(2),n=(t instanceof I?t:this.latLngToContainerPoint(t)).subtract(r).multiplyBy(1-1/o),s=this.containerPointToLatLng(r.add(n));return this.setView(s,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():N(t);var i=j(e.paddingTopLeft||e.padding||[0,0]),o=j(e.paddingBottomRight||e.padding||[0,0]),r=this.getBoundsZoom(t,!1,i.add(o));if((r="number"==typeof e.maxZoom?Math.min(e.maxZoom,r):r)===1/0)return{center:t.getCenter(),zoom:r};var n=o.subtract(i).divideBy(2),s=this.project(t.getSouthWest(),r),a=this.project(t.getNorthEast(),r);return{center:this.unproject(s.add(a).divideBy(2).add(n),r),zoom:r}},fitBounds:function(t,e){if(!(t=N(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=j(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ti,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){ge(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!_t)return this.setView(t,e,i);this._stop();var o=this.project(this.getCenter()),r=this.project(t),n=this.getSize(),s=this._zoom;t=q(t),e=void 0===e?s:e;var a=Math.max(n.x,n.y),l=a*this.getZoomScale(s,e),c=r.distanceTo(o)||1,h=1.42,u=h*h;function p(t){var e=(l*l-a*a+(t?-1:1)*u*u*c*c)/(2*(t?l:a)*u*c),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function d(t){return(Math.exp(t)-Math.exp(-t))/2}function f(t){return(Math.exp(t)+Math.exp(-t))/2}function m(t){return d(t)/f(t)}var g=p(0);function y(t){return a*(f(g)/f(g+h*t))}function _(t){return a*(f(g)*m(g+h*t)-d(g))/u}function b(t){return 1-Math.pow(1-t,1.5)}var v=Date.now(),w=(p(1)-g)/h,x=i.duration?1e3*i.duration:1e3*w*.8;function P(){var i=(Date.now()-v)/x,n=b(i)*w;i<=1?(this._flyToFrame=C(P,this),this._move(this.unproject(o.add(r.subtract(o).multiplyBy(_(n)/c)),s),this.getScaleZoom(a/y(n),s),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),P.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=N(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),o=this._limitCenter(i,this._zoom,N(t));return i.equals(o)||this.panTo(o,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=j((e=e||{}).paddingTopLeft||e.padding||[0,0]),o=j(e.paddingBottomRight||e.padding||[0,0]),r=this.getCenter(),n=this.project(r),s=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),c=Z([a.min.add(i),a.max.subtract(o)]);if(!c.contains(s)){this._enforcingBounds=!0;var h=n.subtract(s),u=j(s.x+h.x,s.y+h.y);(s.x<c.min.x||s.x>c.max.x)&&(u.x=n.x-h.x,h.x>0?u.x+=l.x-i.x:u.x-=l.x-o.x),(s.y<c.min.y||s.y>c.max.y)&&(u.y=n.y-h.y,h.y>0?u.y+=l.y-i.y:u.y-=l.y-o.y),this.panTo(this.unproject(u),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),n=e.divideBy(2).round(),s=o.divideBy(2).round(),a=n.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=r(this._handleGeolocationResponse,this),o=r(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,o,t):navigator.geolocation.getCurrentPosition(e,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new R(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),o=this._locateOptions;if(o.setView){var r=this.getBoundsZoom(i);this.setView(e,o.maxZoom?Math.min(r,o.maxZoom):r)}var n={latlng:e,bounds:i,timestamp:t.timestamp};for(var s in t.coords)"number"==typeof t.coords[s]&&(n[s]=t.coords[s]);this.fire("locationfound",n)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.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(e){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ue(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(k(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ue(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=he("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new D(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=N(t),i=j(i||[0,0]);var o=this.getZoom()||0,r=this.getMinZoom(),n=this.getMaxZoom(),s=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),c=Z(this.project(a,o),this.project(s,o)).getSize(),h=_t?this.options.zoomSnap:1,u=l.x/c.x,p=l.y/c.y,d=e?Math.max(u,p):Math.min(u,p);return o=this.getScaleZoom(d,o),h&&(o=Math.round(o/(h/100))*(h/100),o=e?Math.ceil(o/h)*h:Math.floor(o/h)*h),Math.max(r,Math.min(n,o))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new I(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new B(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,o=i.zoom(t*i.scale(e=void 0===e?this._zoom:e));return isNaN(o)?1/0:o},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(q(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(j(t),e)},layerPointToLatLng:function(t){var e=j(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(q(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(q(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(N(t))},distance:function(t,e){return this.options.crs.distance(q(t),q(e))},containerPointToLayerPoint:function(t){return j(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return j(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(j(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(q(t)))},mouseEventToContainerPoint:function(t){return Ve(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=le(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");ze(e,"scroll",this._onScroll,this),this._containerId=s(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&_t,ge(t,"leaflet-container"+(Lt?" leaflet-touch":"")+(kt?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(ut?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=ce(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Le(this._mapPane,new I(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ge(t.markerPane,"leaflet-zoom-hide"),ge(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Le(this._mapPane,new I(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,!1)._move(t,e)._moveEnd(o),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return k(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Le(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[s(this._container)]=this;var e=t?Be:ze;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),_t&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){k(this._resizeRequest),this._resizeRequest=C(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,o=[],r="mouseout"===e||"mouseover"===e,n=t.target||t.srcElement,a=!1;n;){if((i=this._targets[s(n)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(r&&!Qe(n,t))break;if(o.push(i),r)break}if(n===this._container)break;n=n.parentNode}return o.length||a||r||!Qe(n,t)||(o=[this]),o},_handleDOMEvent:function(t){if(this._loaded&&!$e(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Me(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,o){if("click"===t.type){var r=i({},t);r.type="preclick",this._fireDOMEvent(r,r.type,o)}if(!t._stopped&&(o=(o||[]).concat(this._findEventTargets(t,e))).length){var n=o[0];"contextmenu"===e&&n.listens(e,!0)&&We(t);var s={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=n.getLatLng&&(!n._radius||n._radius<=10);s.containerPoint=a?this.latLngToContainerPoint(n.getLatLng()):this.mouseEventToContainerPoint(t),s.layerPoint=this.containerPointToLayerPoint(s.containerPoint),s.latlng=a?n.getLatLng():this.layerPointToLatLng(s.layerPoint)}for(var l=0;l<o.length;l++)if(o[l].fire(e,s,!0),s.originalEvent._stopped||!1===o[l].options.bubblingMouseEvents&&-1!==_(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Oe(this._mapPane)||new I(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(o)},_latLngBoundsToNewLayerBounds:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return Z([this.project(t.getSouthWest(),e)._subtract(o),this.project(t.getNorthWest(),e)._subtract(o),this.project(t.getSouthEast(),e)._subtract(o),this.project(t.getNorthEast(),e)._subtract(o)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var o=this.project(t,e),r=this.getSize().divideBy(2),n=new B(o.subtract(r),o.add(r)),s=this._getBoundsOffset(n,i,e);return s.round().equals([0,0])?t:this.unproject(o.add(s),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),o=new B(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(o,e))},_getBoundsOffset:function(t,e,i){var o=Z(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),r=o.min.subtract(t.min),n=o.max.subtract(t.max);return new I(this._rebound(r.x,-n.x),this._rebound(r.y,-n.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),o=_t?this.options.zoomSnap:1;return o&&(t=Math.round(t/o)*o),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ye(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=he("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=ne,i=this._proxy.style[e];Pe(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ue(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Pe(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var o=this.getZoomScale(e),r=this._getCenterOffset(t)._divideBy(1-1/o);return!(!0!==i.animate&&!this.getSize().contains(r)||(C(function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)},this),0))},_animateZoom:function(t,e,i,o){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ge(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:o}),setTimeout(r(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ye(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),C(function(){this._moveEnd(!0)},this))}});function ii(t,e){return new ei(t,e)}var oi=M.extend({options:{position:"topright"},initialize:function(t){d(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),o=t._controlCorners[i];return ge(e,"leaflet-control"),-1!==i.indexOf("bottom")?o.insertBefore(e,o.firstChild):o.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ue(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ri=function(t){return new oi(t)};ei.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=he("div",e+"control-container",this._container);function o(o,r){t[o+r]=he("div",e+o+" "+e+r,i)}o("top","left"),o("top","right"),o("bottom","left"),o("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ue(this._controlCorners[t]);ue(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ni=oi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,o){return i<o?-1:o<i?1:0}},initialize:function(t,e,i){for(var o in d(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[o],o);for(o in e)this._addLayer(e[o],o,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return oi.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(s(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){ge(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(ge(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ye(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ye(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=he("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),Ue(e),Fe(e);var o=this._section=he("section",t+"-list");i&&(this._map.on("click",this.collapse,this),rt||ze(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var r=this._layersLink=he("a",t+"-toggle",e);r.href="#",r.title="Layers",Lt?(ze(r,"click",He),ze(r,"click",this.expand,this)):ze(r,"focus",this.expand,this),i||this.expand(),this._baseLayersList=he("div",t+"-base",o),this._separator=he("div",t+"-separator",o),this._overlaysList=he("div",t+"-overlays",o),e.appendChild(o)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&s(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(r(function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,o,r=0;for(i=0;i<this._layers.length;i++)this._addItem(o=this._layers[i]),e=e||o.overlay,t=t||!o.overlay,r+=o.overlay?0:1;return this.options.hideSingleBase&&(this._baseLayersList.style.display=(t=t&&r>1)?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(s(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",o=document.createElement("div");return o.innerHTML=i,o.firstChild},_addItem:function(t){var e,i=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=o):e=this._createRadioElement("leaflet-base-layers_"+s(this),o),this._layerControlInputs.push(e),e.layerId=s(t.layer),ze(e,"click",this._onInputClick,this);var r=document.createElement("span");r.innerHTML=" "+t.name;var n=document.createElement("div");return i.appendChild(n),n.appendChild(e),n.appendChild(r),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,o=[],r=[];this._handlingClick=!0;for(var n=i.length-1;n>=0;n--)e=this._getLayer((t=i[n]).layerId).layer,t.checked?o.push(e):t.checked||r.push(e);for(n=0;n<r.length;n++)this._map.hasLayer(r[n])&&this._map.removeLayer(r[n]);for(n=0;n<o.length;n++)this._map.hasLayer(o[n])||this._map.addLayer(o[n]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,o=this._map.getZoom(),r=i.length-1;r>=0;r--)e=this._getLayer((t=i[r]).layerId).layer,t.disabled=void 0!==e.options.minZoom&&o<e.options.minZoom||void 0!==e.options.maxZoom&&o>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),si=function(t,e,i){return new ni(t,e,i)},ai=oi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=he("div",e+" leaflet-bar"),o=this.options;return this._zoomInButton=this._createButton(o.zoomInText,o.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(o.zoomOutText,o.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,o,r){var n=he("a",i,o);return n.innerHTML=t,n.href="#",n.title=e,n.setAttribute("role","button"),n.setAttribute("aria-label",e),Ue(n),ze(n,"click",He),ze(n,"click",r,this),ze(n,"click",this._refocusOnMap,this),n},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ye(this._zoomInButton,e),ye(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&ge(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&ge(this._zoomInButton,e)}});ei.mergeOptions({zoomControl:!0}),ei.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new ai,this.addControl(this.zoomControl))});var li=function(t){return new ai(t)},ci=oi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=he("div",e),o=this.options;return this._addScales(o,e+"-line",i),t.on(o.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=he("div",e,i)),t.imperial&&(this._iScale=he("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,o,r=3.2808399*t;r>5280?(i=this._getRoundNum(e=r/5280),this._updateScale(this._iScale,i+" mi",i/e)):(o=this._getRoundNum(r),this._updateScale(this._iScale,o+" ft",o/r))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),hi=function(t){return new ci(t)},ui=oi.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){d(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=he("div","leaflet-control-attribution"),Ue(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});ei.mergeOptions({attributionControl:!0}),ei.addInitHook(function(){this.options.attributionControl&&(new ui).addTo(this)});var pi=function(t){return new ui(t)};oi.Layers=ni,oi.Zoom=ai,oi.Scale=ci,oi.Attribution=ui,ri.layers=si,ri.zoom=li,ri.scale=hi,ri.attribution=pi;var di=M.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});di.addTo=function(t,e){return t.addHandler(e,this),this};var fi,mi={Events:S},gi=Lt?"touchstart mousedown":"mousedown",yi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},_i={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},bi=T.extend({options:{clickTolerance:3},initialize:function(t,e,i,o){d(this,o),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(ze(this._dragStartTarget,gi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(bi._dragging===this&&this.finishDrag(),Be(this._dragStartTarget,gi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!me(this._element,"leaflet-zoom-anim")&&!(bi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(bi._dragging=this,this._preventOutline&&Me(this._element),ke(),te(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Se(this._element);this._startPoint=new I(e.clientX,e.clientY),this._parentScale=Te(i),ze(document,_i[t.type],this._onMove,this),ze(document,yi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new I(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,We(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Oe(this._element).subtract(i),ge(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ge(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,k(this._animRequest),this._lastEvent=t,this._animRequest=C(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Le(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in ye(document.body,"leaflet-dragging"),this._lastTarget&&(ye(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),_i)Be(document,_i[t],this._onMove,this),Be(document,yi[t],this._onUp,this);Ee(),ee(),this._moved&&this._moving&&(k(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,bi._dragging=!1}});function vi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Pi(t=Oi(t,i),i)}function wi(t,e,i){return Math.sqrt(Ai(t,e,i,!0))}function xi(t,e,i){return Ai(t,e,i)}function Pi(t,e){var i=t.length,o=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);o[0]=o[i-1]=1,Li(t,o,e,0,i-1);var r,n=[];for(r=0;r<i;r++)o[r]&&n.push(t[r]);return n}function Li(t,e,i,o,r){var n,s,a,l=0;for(s=o+1;s<=r-1;s++)(a=Ai(t[s],t[o],t[r],!0))>l&&(n=s,l=a);l>i&&(e[n]=1,Li(t,e,i,o,n),Li(t,e,i,n,r))}function Oi(t,e){for(var i=[t[0]],o=1,r=0,n=t.length;o<n;o++)Mi(t[o],t[r])>e&&(i.push(t[o]),r=o);return r<n-1&&i.push(t[n-1]),i}function Ci(t,e,i,o,r){var n,s,a,l=o?fi:Ei(t,i),c=Ei(e,i);for(fi=c;;){if(!(l|c))return[t,e];if(l&c)return!1;a=Ei(s=ki(t,e,n=l||c,i,r),i),n===l?(t=s,l=a):(e=s,c=a)}}function ki(t,e,i,o,r){var n,s,a=e.x-t.x,l=e.y-t.y,c=o.min,h=o.max;return 8&i?(n=t.x+a*(h.y-t.y)/l,s=h.y):4&i?(n=t.x+a*(c.y-t.y)/l,s=c.y):2&i?(n=h.x,s=t.y+l*(h.x-t.x)/a):1&i&&(n=c.x,s=t.y+l*(c.x-t.x)/a),new I(n,s,r)}function Ei(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Mi(t,e){var i=e.x-t.x,o=e.y-t.y;return i*i+o*o}function Ai(t,e,i,o){var r,n=e.x,s=e.y,a=i.x-n,l=i.y-s,c=a*a+l*l;return c>0&&((r=((t.x-n)*a+(t.y-s)*l)/c)>1?(n=i.x,s=i.y):r>0&&(n+=a*r,s+=l*r)),a=t.x-n,l=t.y-s,o?a*a+l*l:new I(n,s)}function Si(t){return!y(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Ti(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Si(t)}var Ii={simplify:vi,pointToSegmentDistance:wi,closestPointOnSegment:xi,clipSegment:Ci,_getEdgeIntersection:ki,_getBitCode:Ei,_sqClosestPointOnSegment:Ai,isFlat:Si,_flat:Ti};function zi(t,e,i){var o,r,n,s,a,l,c,h,u,p=[1,4,2,8];for(r=0,c=t.length;r<c;r++)t[r]._code=Ei(t[r],e);for(s=0;s<4;s++){for(h=p[s],o=[],r=0,n=(c=t.length)-1;r<c;n=r++)l=t[n],(a=t[r])._code&h?l._code&h||((u=ki(l,a,h,e,i))._code=Ei(u,e),o.push(u)):(l._code&h&&((u=ki(l,a,h,e,i))._code=Ei(u,e),o.push(u)),o.push(a));t=o}return t}var ji={clipPolygon:zi},Bi={project:function(t){return new I(t.lng,t.lat)},unproject:function(t){return new R(t.y,t.x)},bounds:new B([-180,-90],[180,90])},Zi={R:6378137,R_MINOR:6356752.314245179,bounds:new B([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,o=t.lat*e,r=this.R_MINOR/i,n=Math.sqrt(1-r*r),s=n*Math.sin(o),a=Math.tan(Math.PI/4-o/2)/Math.pow((1-s)/(1+s),n/2);return o=-i*Math.log(Math.max(a,1e-10)),new I(t.lng*e*i,o)},unproject:function(t){for(var e,i=180/Math.PI,o=this.R,r=this.R_MINOR/o,n=Math.sqrt(1-r*r),s=Math.exp(-t.y/o),a=Math.PI/2-2*Math.atan(s),l=0,c=.1;l<15&&Math.abs(c)>1e-7;l++)e=n*Math.sin(a),e=Math.pow((1-e)/(1+e),n/2),a+=c=Math.PI/2-2*Math.atan(s*e)-a;return new R(a*i,t.x*i/o)}},Di={LonLat:Bi,Mercator:Zi,SphericalMercator:V},Ni=i({},W,{code:"EPSG:3395",projection:Zi,transformation:function(){var t=.5/(Math.PI*Zi.R);return J(t,.5,-t,.5)}()}),Ri=i({},W,{code:"EPSG:4326",projection:Bi,transformation:J(1/180,1,-1/180,.5)}),qi=i({},U,{projection:Bi,transformation:J(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,o=e.lat-t.lat;return Math.sqrt(i*i+o*o)},infinite:!0});U.Earth=W,U.EPSG3395=Ni,U.EPSG3857=K,U.EPSG900913=Y,U.EPSG4326=Ri,U.Simple=qi;var Fi=T.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[s(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[s(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",function(){e.off(i,this)},this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ei.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=s(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=s(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&s(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?y(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[s(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=s(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var o in this._zoomBoundLayers){var r=this._zoomBoundLayers[o].options;t=void 0===r.minZoom?t:Math.min(t,r.minZoom),e=void 0===r.maxZoom?e:Math.max(e,r.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Ui=Fi.extend({initialize:function(t,e){var i,o;if(d(this,e),this._layers={},t)for(i=0,o=t.length;i<o;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,o=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,o);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return s(t)}}),Wi=function(t,e){return new Ui(t,e)},Hi=Ui.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Ui.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Ui.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new D;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Vi=function(t,e){return new Hi(t,e)},Gi=M.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){d(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var o=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(o,t),o},_setIconStyles:function(t,e){var i=this.options,o=i[e+"Size"];"number"==typeof o&&(o=[o,o]);var r=j(o),n=j("shadow"===e&&i.shadowAnchor||i.iconAnchor||r&&r.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),n&&(t.style.marginLeft=-n.x+"px",t.style.marginTop=-n.y+"px"),r&&(t.style.width=r.x+"px",t.style.height=r.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return kt&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Ji(t){return new Gi(t)}var Ki=Gi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Ki.imagePath||(Ki.imagePath=this._detectIconPath()),(this.options.imagePath||Ki.imagePath)+Gi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=he("div","leaflet-default-icon-path",document.body),e=ce(t,"background-image")||ce(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Yi=di.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new bi(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ge(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ye(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,o=this._marker.options.autoPanSpeed,r=this._marker.options.autoPanPadding,n=Oe(e._icon),s=i.getPixelBounds(),a=i.getPixelOrigin(),l=Z(s.min._subtract(a).add(r),s.max._subtract(a).subtract(r));if(!l.contains(n)){var c=j((Math.max(l.max.x,n.x)-l.max.x)/(s.max.x-l.max.x)-(Math.min(l.min.x,n.x)-l.min.x)/(s.min.x-l.min.x),(Math.max(l.max.y,n.y)-l.max.y)/(s.max.y-l.max.y)-(Math.min(l.min.y,n.y)-l.min.y)/(s.min.y-l.min.y)).multiplyBy(o);i.panBy(c,{animate:!1}),this._draggable._newPos._add(c),this._draggable._startPos._add(c),Le(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=C(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(k(this._panRequest),this._panRequest=C(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,o=Oe(e._icon),r=e._map.layerPointToLatLng(o);i&&Le(i,o),e._latlng=r,t.latlng=r,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){k(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),$i=Fi.extend({options:{icon:new Ki,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){d(this,e),this._latlng=q(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=q(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),o=!1;i!==this._icon&&(this._icon&&this._removeIcon(),o=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),ge(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var r=t.icon.createShadow(this._shadow),n=!1;r!==this._shadow&&(this._removeShadow(),n=!0),r&&(ge(r,e),r.alt=""),this._shadow=r,t.opacity<1&&this._updateOpacity(),o&&this.getPane().appendChild(this._icon),this._initInteraction(),r&&n&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ue(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ue(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Le(this._icon,t),this._shadow&&Le(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(ge(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Yi)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Yi(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&ve(this._icon,t),this._shadow&&ve(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Qi(t,e){return new $i(t,e)}var Xi=Fi.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return d(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),to=Xi.extend({options:{fill:!0,radius:10},initialize:function(t,e){d(this,e),this._latlng=q(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=q(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return Xi.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),o=[t+i,e+i];this._pxBounds=new B(this._point.subtract(o),this._point.add(o))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function eo(t,e){return new to(t,e)}var io=to.extend({initialize:function(t,e,o){if("number"==typeof e&&(e=i({},o,{radius:e})),d(this,e),this._latlng=q(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new D(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:Xi.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,o=i.options.crs;if(o.distance===W.distance){var r=Math.PI/180,n=this._mRadius/W.R/r,s=i.project([e+n,t]),a=i.project([e-n,t]),l=s.add(a).divideBy(2),c=i.unproject(l).lat,h=Math.acos((Math.cos(n*r)-Math.sin(e*r)*Math.sin(c*r))/(Math.cos(e*r)*Math.cos(c*r)))/r;(isNaN(h)||0===h)&&(h=n/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(h)?0:l.x-i.project([c,t-h]).x,this._radiusY=l.y-s.y}else{var u=o.unproject(o.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(u).x}this._updateBounds()}});function oo(t,e,i){return new io(t,e,i)}var ro=Xi.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){d(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,o=1/0,r=null,n=Ai,s=0,a=this._parts.length;s<a;s++)for(var l=this._parts[s],c=1,h=l.length;c<h;c++){var u=n(t,e=l[c-1],i=l[c],!0);u<o&&(o=u,r=n(t,e,i))}return r&&(r.distance=Math.sqrt(o)),r},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,r,n,s,a=this._rings[0],l=a.length;if(!l)return null;for(t=0,e=0;t<l-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,o=0;t<l-1;t++)if((o+=i=(r=a[t]).distanceTo(n=a[t+1]))>e)return this._map.layerPointToLatLng([n.x-(s=(o-e)/i)*(n.x-r.x),n.y-s*(n.y-r.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=q(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new D,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Si(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Si(t),o=0,r=t.length;o<r;o++)i?(e[o]=q(t[o]),this._bounds.extend(e[o])):e[o]=this._convertLatLngs(t[o]);return e},_project:function(){var t=new B;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new I(t,t);this._pxBounds=new B([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var o,r,n=t.length;if(t[0]instanceof R){for(r=[],o=0;o<n;o++)r[o]=this._map.latLngToLayerPoint(t[o]),i.extend(r[o]);e.push(r)}else for(o=0;o<n;o++)this._projectLatlngs(t[o],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,o,r,n,s,a,l=this._parts;for(e=0,o=0,r=this._rings.length;e<r;e++)for(i=0,n=(a=this._rings[e]).length;i<n-1;i++)(s=Ci(a[i],a[i+1],t,i,!0))&&(l[o]=l[o]||[],l[o].push(s[0]),s[1]===a[i+1]&&i!==n-2||(l[o].push(s[1]),o++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,o=t.length;i<o;i++)t[i]=vi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,o,r,n,s,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,n=this._parts.length;i<n;i++)for(o=0,r=(s=(a=this._parts[i]).length)-1;o<s;r=o++)if((e||0!==o)&&wi(t,a[r],a[o])<=l)return!0;return!1}});function no(t,e){return new ro(t,e)}ro._flat=Ti;var so=ro.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,r,n,s,a,l=this._rings[0],c=l.length;if(!c)return null;for(n=s=a=0,t=0,e=c-1;t<c;e=t++)s+=((i=l[t]).x+(o=l[e]).x)*(r=i.y*o.x-o.y*i.x),a+=(i.y+o.y)*r,n+=3*r;return this._map.layerPointToLatLng(0===n?l[0]:[s/n,a/n])},_convertLatLngs:function(t){var e=ro.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof R&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){ro.prototype._setLatLngs.call(this,t),Si(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Si(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new I(e,e);if(t=new B(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var o,r=0,n=this._rings.length;r<n;r++)(o=zi(this._rings[r],t,!0)).length&&this._parts.push(o)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,o,r,n,s,a,l,c=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(r=0,a=this._parts.length;r<a;r++)for(n=0,s=(l=(e=this._parts[r]).length)-1;n<l;s=n++)(i=e[n]).y>t.y!=(o=e[s]).y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(c=!c);return c||ro.prototype._containsPoint.call(this,t,!0)}});function ao(t,e){return new so(t,e)}var lo=Hi.extend({initialize:function(t,e){d(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o,r=y(t)?t:t.features;if(r){for(e=0,i=r.length;e<i;e++)((o=r[e]).geometries||o.geometry||o.features||o.coordinates)&&this.addData(o);return this}var n=this.options;if(n.filter&&!n.filter(t))return this;var s=co(t,n);return s?(s.feature=yo(t),s.defaultOptions=s.options,this.resetStyle(s),n.onEachFeature&&n.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=i({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function co(t,e){var i,o,r,n,s="Feature"===t.type?t.geometry:t,a=s?s.coordinates:null,l=[],c=e&&e.pointToLayer,h=e&&e.coordsToLatLng||uo;if(!a&&!s)return null;switch(s.type){case"Point":return ho(c,t,i=h(a),e);case"MultiPoint":for(r=0,n=a.length;r<n;r++)i=h(a[r]),l.push(ho(c,t,i,e));return new Hi(l);case"LineString":case"MultiLineString":return o=po(a,"LineString"===s.type?0:1,h),new ro(o,e);case"Polygon":case"MultiPolygon":return o=po(a,"Polygon"===s.type?1:2,h),new so(o,e);case"GeometryCollection":for(r=0,n=s.geometries.length;r<n;r++){var u=co({geometry:s.geometries[r],type:"Feature",properties:t.properties},e);u&&l.push(u)}return new Hi(l);default:throw new Error("Invalid GeoJSON object.")}}function ho(t,e,i,o){return t?t(e,i):new $i(i,o&&o.markersInheritOptions&&o)}function uo(t){return new R(t[1],t[0],t[2])}function po(t,e,i){for(var o,r=[],n=0,s=t.length;n<s;n++)o=e?po(t[n],e-1,i):(i||uo)(t[n]),r.push(o);return r}function fo(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[h(t.lng,e),h(t.lat,e),h(t.alt,e)]:[h(t.lng,e),h(t.lat,e)]}function mo(t,e,i,o){for(var r=[],n=0,s=t.length;n<s;n++)r.push(e?mo(t[n],e-1,i,o):fo(t[n],o));return!e&&i&&r.push(r[0]),r}function go(t,e){return t.feature?i({},t.feature,{geometry:e}):yo(e)}function yo(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var _o={toGeoJSON:function(t){return go(this,{type:"Point",coordinates:fo(this.getLatLng(),t)})}};function bo(t,e){return new lo(t,e)}$i.include(_o),io.include(_o),to.include(_o),ro.include({toGeoJSON:function(t){var e=!Si(this._latlngs);return go(this,{type:(e?"Multi":"")+"LineString",coordinates:mo(this._latlngs,e?1:0,!1,t)})}}),so.include({toGeoJSON:function(t){var e=!Si(this._latlngs),i=e&&!Si(this._latlngs[0]),o=mo(this._latlngs,i?2:e?1:0,!0,t);return e||(o=[o]),go(this,{type:(i?"Multi":"")+"Polygon",coordinates:o})}}),Ui.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(i){e.push(i.toGeoJSON(t).geometry.coordinates)}),go(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,o=[];return this.eachLayer(function(e){if(e.toGeoJSON){var r=e.toGeoJSON(t);if(i)o.push(r.geometry);else{var n=yo(r);"FeatureCollection"===n.type?o.push.apply(o,n.features):o.push(n)}}}),i?go(this,{geometries:o,type:"GeometryCollection"}):{type:"FeatureCollection",features:o}}});var vo=bo,wo=Fi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=N(e),d(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ge(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ue(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&de(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=N(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:he("img");ge(e,"leaflet-image-layer"),this._zoomAnimated&&ge(e,"leaflet-zoom-animated"),this.options.className&&ge(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onload=r(this.fire,this,"load"),e.onerror=r(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Pe(this._image,i,e)},_reset:function(){var t=this._image,e=new B(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Le(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){ve(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&null!=this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),xo=function(t,e,i){return new wo(t,e,i)},Po=wo.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:he("video");if(ge(e,"leaflet-image-layer"),this._zoomAnimated&&ge(e,"leaflet-zoom-animated"),this.options.className&&ge(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onloadeddata=r(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),o=[],n=0;n<i.length;n++)o.push(i[n].src);this._url=i.length>0?o:[e.src]}else{y(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted;for(var s=0;s<this._url.length;s++){var a=he("source");a.src=this._url[s],e.appendChild(a)}}}});function Lo(t,e,i){return new Po(t,e,i)}var Oo=wo.extend({_initImage:function(){var t=this._image=this._url;ge(t,"leaflet-image-layer"),this._zoomAnimated&&ge(t,"leaflet-zoom-animated"),this.options.className&&ge(t,this.options.className),t.onselectstart=c,t.onmousemove=c}});function Co(t,e,i){return new Oo(t,e,i)}var ko=Fi.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){d(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&ve(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&ve(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(ve(this._container,0),this._removeTimeout=setTimeout(r(ue,void 0,this._container),200)):ue(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=q(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&de(this._container),this},bringToBack:function(){return this._map&&fe(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Fi||(i=e,e=t),e instanceof Hi)for(var o in t._layers){e=t._layers[o];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=j(this.options.offset),i=this._getAnchor();this._zoomAnimated?Le(this._container,t.add(i)):e=e.add(t).add(i);var o=this._containerBottom=-e.y,r=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=o+"px",this._container.style.left=r+"px"}},_getAnchor:function(){return[0,0]}}),Eo=ko.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){ko.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Xi||this._source.on("preclick",qe))},onRemove:function(t){ko.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Xi||this._source.off("preclick",qe))},getEvents:function(){var t=ko.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=he("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=he("div",t+"-content-wrapper",e);if(this._contentNode=he("div",t+"-content",i),Ue(e),Fe(this._contentNode),ze(e,"contextmenu",qe),this._tipContainer=he("div",t+"-tip-container",e),this._tip=he("div",t+"-tip",this._tipContainer),this.options.closeButton){var o=this._closeButton=he("a",t+"-close-button",e);o.href="#close",o.innerHTML="&#215;",ze(o,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var o=this.options.maxHeight,r="leaflet-popup-scrolled";o&&t.offsetHeight>o?(e.height=o+"px",ge(t,r)):ye(t,r),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Le(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(ce(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,o=this._containerWidth,r=new I(this._containerLeft,-i-this._containerBottom);r._add(Oe(this._container));var n=t.layerPointToContainerPoint(r),s=j(this.options.autoPanPadding),a=j(this.options.autoPanPaddingTopLeft||s),l=j(this.options.autoPanPaddingBottomRight||s),c=t.getSize(),h=0,u=0;n.x+o+l.x>c.x&&(h=n.x+o-c.x+l.x),n.x-h-a.x<0&&(h=n.x-a.x),n.y+i+l.y>c.y&&(u=n.y+i-c.y+l.y),n.y-u-a.y<0&&(u=n.y-a.y),(h||u)&&t.fire("autopanstart").panBy([h,u])}},_onCloseButtonClick:function(t){this._close(),He(t)},_getAnchor:function(){return j(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Mo=function(t,e){return new Eo(t,e)};ei.mergeOptions({closePopupOnClick:!0}),ei.include({openPopup:function(t,e,i){return t instanceof Eo||(t=new Eo(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Fi.include({bindPopup:function(t,e){return t instanceof Eo?(d(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new Eo(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(He(t),e instanceof Xi?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Ao=ko.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){ko.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){ko.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=ko.prototype.getEvents.call(this);return Lt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){this._contentNode=this._container=he("div","leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,o=this._map,r=this._container,n=o.latLngToContainerPoint(o.getCenter()),s=o.layerPointToContainerPoint(t),a=this.options.direction,l=r.offsetWidth,c=r.offsetHeight,h=j(this.options.offset),u=this._getAnchor();"top"===a?(e=l/2,i=c):"bottom"===a?(e=l/2,i=0):"center"===a?(e=l/2,i=c/2):"right"===a?(e=0,i=c/2):"left"===a?(e=l,i=c/2):s.x<n.x?(a="right",e=0,i=c/2):(a="left",e=l+2*(h.x+u.x),i=c/2),t=t.subtract(j(e,i,!0)).add(h).add(u),ye(r,"leaflet-tooltip-right"),ye(r,"leaflet-tooltip-left"),ye(r,"leaflet-tooltip-top"),ye(r,"leaflet-tooltip-bottom"),ge(r,"leaflet-tooltip-"+a),Le(r,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&ve(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return j(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),So=function(t,e){return new Ao(t,e)};ei.include({openTooltip:function(t,e,i){return t instanceof Ao||(t=new Ao(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Fi.include({bindTooltip:function(t,e){return t instanceof Ao?(d(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Ao(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),Lt&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(ge(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(ye(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){this._tooltip&&this._map&&this.openTooltip(t.layer||t.target,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,o=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),o=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(o)}});var To=Gi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var o=j(i.bgPos);e.style.backgroundPosition=-o.x+"px "+-o.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Io(t){return new To(t)}Gi.Default=Ki;var zo=Fi.extend({options:{tileSize:256,opacity:1,updateWhenIdle:bt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){d(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ue(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(de(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof I?t:new I(t,t)},_updateZIndex:function(){this._container&&null!=this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,o=-t(-1/0,1/0),r=0,n=i.length;r<n;r++)e=i[r].style.zIndex,i[r]!==this._container&&e&&(o=t(o,+e));isFinite(o)&&(this.options.zIndex=o+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){ve(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var o in this._tiles){var r=this._tiles[o];if(r.current&&r.loaded){var n=Math.min(1,(t-r.loaded)/200);ve(r.el,n),n<1?e=!0:(r.active?i=!0:this._onOpaqueTile(r),r.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(k(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=he("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ue(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var o=this._levels[t],r=this._map;return o||((o=this._levels[t]={}).el=he("div","leaflet-tile-container leaflet-zoom-animated",this._container),o.el.style.zIndex=e,o.origin=r.project(r.unproject(r.getPixelOrigin()),t).round(),o.zoom=t,this._setZoomTransform(o,r.getCenter(),r.getZoom()),c(o.el.offsetWidth),this._onCreateLevel(o)),this._level=o,o}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var o=e.coords;this._retainParent(o.x,o.y,o.z,o.z-5)||this._retainChildren(o.x,o.y,o.z,o.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ue(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,o){var r=Math.floor(t/2),n=Math.floor(e/2),s=i-1,a=new I(+r,+n);a.z=+s;var l=this._tileCoordsToKey(a),c=this._tiles[l];return c&&c.active?(c.retain=!0,!0):(c&&c.loaded&&(c.retain=!0),s>o&&this._retainParent(r,n,s,o))},_retainChildren:function(t,e,i,o){for(var r=2*t;r<2*t+2;r++)for(var n=2*e;n<2*e+2;n++){var s=new I(r,n);s.z=i+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<o&&this._retainChildren(r,n,i+1,o))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,o){var r=Math.round(e);r=void 0!==this.options.maxZoom&&r>this.options.maxZoom||void 0!==this.options.minZoom&&r<this.options.minZoom?void 0:this._clampZoom(r),o&&!(this.options.updateWhenZooming&&r!==this._tileZoom)||(this._tileZoom=r,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==r&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var o=this._map.getZoomScale(i,t.zoom),r=t.origin.multiplyBy(o).subtract(this._map._getNewPixelOrigin(e,i)).round();_t?Pe(t.el,r,o):Le(t.el,r)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),o=this._tileZoom,r=this._map.getPixelWorldBounds(this._tileZoom);r&&(this._globalTileRange=this._pxBoundsToTileRange(r)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],o).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],o).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],o).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],o).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),o=e.getZoomScale(i,this._tileZoom),r=e.project(t,this._tileZoom).floor(),n=e.getSize().divideBy(2*o);return new B(r.subtract(n),r.add(n))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var o=this._getTiledPixelBounds(t),r=this._pxBoundsToTileRange(o),n=r.getCenter(),s=[],a=this.options.keepBuffer,l=new B(r.getBottomLeft().subtract([a,-a]),r.getTopRight().add([a,-a]));if(!(isFinite(r.min.x)&&isFinite(r.min.y)&&isFinite(r.max.x)&&isFinite(r.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var c in this._tiles){var h=this._tiles[c].coords;h.z===this._tileZoom&&l.contains(new I(h.x,h.y))||(this._tiles[c].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var u=r.min.y;u<=r.max.y;u++)for(var p=r.min.x;p<=r.max.x;p++){var d=new I(p,u);if(d.z=this._tileZoom,this._isValidTile(d)){var f=this._tiles[this._tileCoordsToKey(d)];f?f.current=!0:s.push(d)}}if(s.sort(function(t,e){return t.distanceTo(n)-e.distanceTo(n)}),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(p=0;p<s.length;p++)this._addTile(s[p],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var o=this._tileCoordsToBounds(t);return N(this.options.bounds).overlaps(o)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),o=t.scaleBy(i),r=o.add(i);return[e.unproject(o,t.z),e.unproject(r,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new D(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new I(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ue(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ge(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=c,t.onmousemove=c,et&&this.options.opacity<1&&ve(t,this.options.opacity),rt&&!nt&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),o=this._tileCoordsToKey(t),n=this.createTile(this._wrapCoords(t),r(this._tileReady,this,t));this._initTile(n),this.createTile.length<2&&C(r(this._tileReady,this,t,null,n)),Le(n,i),this._tiles[o]={el:n,coords:t,current:!0},e.appendChild(n),this.fire("tileloadstart",{tile:n,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var o=this._tileCoordsToKey(t);(i=this._tiles[o])&&(i.loaded=+new Date,this._map._fadeAnimated?(ve(i.el,0),k(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(ge(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?C(this._pruneTiles,this):setTimeout(r(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new I(this._wrapX?l(t.x,this._wrapX):t.x,this._wrapY?l(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new B(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function jo(t){return new zo(t)}var Bo=zo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=d(this,e)).detectRetina&&kt&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),rt||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return ze(i,"load",r(this._tileOnLoad,this,e,i)),ze(i,"error",r(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:kt?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var o=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=o),e["-y"]=o}return g(this._url,i(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(r(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var o=this.options.errorTileUrl;o&&e.getAttribute("src")!==o&&(e.src=o),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom;return this.options.zoomReverse&&(t=this.options.maxZoom-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=c,e.onerror=c,e.complete||(e.src=b,ue(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",b),zo.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==b))return zo.prototype._tileReady.call(this,t,e,i)}});function Zo(t,e){return new Bo(t,e)}var Do=Bo.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var o=i({},this.defaultWmsParams);for(var r in e)r in this.options||(o[r]=e[r]);var n=(e=d(this,e)).detectRetina&&kt?2:1,s=this.getTileSize();o.width=s.x*n,o.height=s.y*n,this.wmsParams=o},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version),this.wmsParams[this._wmsVersion>=1.3?"crs":"srs"]=this._crs.code,Bo.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,o=Z(i.project(e[0]),i.project(e[1])),r=o.min,n=o.max,s=(this._wmsVersion>=1.3&&this._crs===Ri?[r.y,r.x,n.y,n.x]:[r.x,r.y,n.x,n.y]).join(","),a=Bo.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});function No(t,e){return new Do(t,e)}Bo.WMS=Do,Zo.wms=No;var Ro=Fi.extend({options:{padding:.1,tolerance:0},initialize:function(t){d(this,t),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ge(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),o=Oe(this._container),r=this._map.getSize().multiplyBy(.5+this.options.padding),n=this._map.project(this._center,e),s=this._map.project(t,e).subtract(n),a=r.multiplyBy(-i).add(o).add(r).subtract(s);_t?Pe(this._container,a,i):Le(this._container,a)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new B(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),qo=Ro.extend({getEvents:function(){var t=Ro.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Ro.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");ze(t,"mousemove",this._onMouseMove,this),ze(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ze(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){k(this._redrawRequest),delete this._ctx,ue(this._container),Be(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Ro.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),o=kt?2:1;Le(e,t.min),e.width=o*i.x,e.height=o*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",kt&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Ro.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[s(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,o=e.prev;i?i.prev=o:this._drawLast=o,o?o.next=i:this._drawFirst=i,delete t._order,delete this._layers[s(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,o=t.options.dashArray.split(/[, ]+/),r=[];for(i=0;i<o.length;i++){if(e=Number(o[i]),isNaN(e))return;r.push(e)}t.options._dashArray=r}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||C(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new B,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var o=this._drawFirst;o;o=o.next)t=o.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,o,r,n,s=t._parts,a=s.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(o=0,r=s[i].length;o<r;o++)l[o?"lineTo":"moveTo"]((n=s[i][o]).x,n.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,o=Math.max(Math.round(t._radius),1),r=(Math.max(Math.round(t._radiusY),1)||o)/o;1!==r&&(i.save(),i.scale(1,r)),i.beginPath(),i.arc(e.x,e.y/r,o,0,2*Math.PI,!1),1!==r&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,o=this._map.mouseEventToLayerPoint(t),r=this._drawFirst;r;r=r.next)(e=r.layer).options.interactive&&e._containsPoint(o)&&("click"!==t.type&&"preclick"===t.type||!this._map._draggableMoved(e))&&(i=e);i&&(Ye(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ye(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,o,n=this._drawFirst;n;n=n.next)(i=n.layer).options.interactive&&i._containsPoint(e)&&(o=i);o!==this._hoveredLayer&&(this._handleMouseOut(t),o&&(ge(this._container,"leaflet-interactive"),this._fireEvent([o],t,"mouseover"),this._hoveredLayer=o)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(r(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;i&&(i.prev=o,o?o.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;o&&(o.next=i,i?i.prev=o:o&&(this._drawLast=o),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Fo(t){return Mt?new qo(t):null}var Uo=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),Wo={_initContainer:function(){this._container=he("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Ro.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Uo("shape");ge(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Uo("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ue(e),t.removeInteractiveTarget(e),delete this._layers[s(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,o=t.options,r=t._container;r.stroked=!!o.stroke,r.filled=!!o.fill,o.stroke?(e||(e=t._stroke=Uo("stroke")),r.appendChild(e),e.weight=o.weight+"px",e.color=o.color,e.opacity=o.opacity,e.dashStyle=o.dashArray?y(o.dashArray)?o.dashArray.join(" "):o.dashArray.replace(/( *, *)/g," "):"",e.endcap=o.lineCap.replace("butt","flat"),e.joinstyle=o.lineJoin):e&&(r.removeChild(e),t._stroke=null),o.fill?(i||(i=t._fill=Uo("fill")),r.appendChild(i),i.color=o.fillColor||o.color,i.opacity=o.fillOpacity):i&&(r.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),o=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+o+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){de(t._container)},_bringToBack:function(t){fe(t._container)}},Ho=St?Uo:$,Vo=Ro.extend({getEvents:function(){var t=Ro.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=Ho("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ho("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ue(this._container),Be(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){Ro.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Le(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Ho("path");t.options.className&&ge(e,t.options.className),t.options.interactive&&ge(e,"leaflet-interactive"),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ue(t._path),t.removeInteractiveTarget(t._path),delete this._layers[s(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,Q(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),o="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",r=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+2*i+",0 "+o+2*-i+",0 ";this._setPath(t,r)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){de(t._path)},_bringToBack:function(t){fe(t._path)}});function Go(t){return At||St?new Vo(t):null}St&&Vo.include(Wo),ei.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Fo(t)||Go(t)}});var Jo=so.extend({initialize:function(t,e){so.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=N(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Ko(t,e){return new Jo(t,e)}Vo.create=Ho,Vo.pointsToPath=Q,lo.geometryToLayer=co,lo.coordsToLatLng=uo,lo.coordsToLatLngs=po,lo.latLngToCoords=fo,lo.latLngsToCoords=mo,lo.getFeature=go,lo.asFeature=yo,ei.mergeOptions({boxZoom:!0});var Yo=di.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){ze(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Be(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ue(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),te(),ke(),this._startPoint=this._map.mouseEventToContainerPoint(t),ze(document,{contextmenu:He,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=he("div","leaflet-zoom-box",this._container),ge(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new B(this._point,this._startPoint),i=e.getSize();Le(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ue(this._box),ye(this._container,"leaflet-crosshair")),ee(),Ee(),Be(document,{contextmenu:He,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(r(this._resetState,this),0);var e=new D(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ei.addInitHook("addHandler","boxZoom",Yo),ei.mergeOptions({doubleClickZoom:!0});var $o=di.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),o=e.options.zoomDelta,r=t.originalEvent.shiftKey?i-o:i+o;"center"===e.options.doubleClickZoom?e.setZoom(r):e.setZoomAround(t.containerPoint,r)}});ei.addInitHook("addHandler","doubleClickZoom",$o),ei.mergeOptions({dragging:!0,inertia:!nt,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Qo=di.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new bi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}ge(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ye(this._map._container,"leaflet-grab"),ye(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=N(this._map.options.maxBounds);this._offsetLimit=Z(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,o=this._draggable._newPos.x,r=(o-e+i)%t+e-i,n=(o+e+i)%t-e-i,s=Math.abs(r+i)<Math.abs(n+i)?r:n;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(t){var e=this._map,i=e.options,o=!i.inertia||this._times.length<2;if(e.fire("dragend",t),o)e.fire("moveend");else{this._prunePositions(+new Date);var r=this._lastPos.subtract(this._positions[0]),n=i.easeLinearity,s=r.multiplyBy(n/((this._lastTime-this._times[0])/1e3)),a=s.distanceTo([0,0]),l=Math.min(i.inertiaMaxSpeed,a),c=s.multiplyBy(l/a),h=l/(i.inertiaDeceleration*n),u=c.multiplyBy(-h/2).round();u.x||u.y?(u=e._limitOffset(u,e.options.maxBounds),C(function(){e.panBy(u,{duration:h,easeLinearity:n,noMoveStart:!0,animate:!0})})):e.fire("moveend")}}});ei.addInitHook("addHandler","dragging",Qo),ei.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Xo=di.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),ze(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Be(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,o=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(o,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,o=this._panKeys={},r=this.keyCodes;for(e=0,i=r.left.length;e<i;e++)o[r.left[e]]=[-1*t,0];for(e=0,i=r.right.length;e<i;e++)o[r.right[e]]=[t,0];for(e=0,i=r.down.length;e<i;e++)o[r.down[e]]=[0,t];for(e=0,i=r.up.length;e<i;e++)o[r.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,o=this._zoomKeys={},r=this.keyCodes;for(e=0,i=r.zoomIn.length;e<i;e++)o[r.zoomIn[e]]=t;for(e=0,i=r.zoomOut.length;e<i;e++)o[r.zoomOut[e]]=-t},_addHooks:function(){ze(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Be(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,o=this._map;if(i in this._panKeys)o._panAnim&&o._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=j(e).multiplyBy(3)),o.panBy(e),o.options.maxBounds&&o.panInsideBounds(o.options.maxBounds));else if(i in this._zoomKeys)o.setZoom(o.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!o._popup||!o._popup.options.closeOnEscapeKey)return;o.closePopup()}He(t)}}});ei.addInitHook("addHandler","keyboard",Xo),ei.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var tr=di.extend({addHooks:function(){ze(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Be(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Je(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var o=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(r(this._performZoom,this),o),He(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var o=4*Math.log(2/(1+Math.exp(-Math.abs(this._delta/(4*this._map.options.wheelPxPerZoomLevel)))))/Math.LN2,r=i?Math.ceil(o/i)*i:o,n=t._limitZoom(e+(this._delta>0?r:-r))-e;this._delta=0,this._startTime=null,n&&("center"===t.options.scrollWheelZoom?t.setZoom(e+n):t.setZoomAround(this._lastMousePos,e+n))}});ei.addInitHook("addHandler","scrollWheelZoom",tr),ei.mergeOptions({tap:!0,tapTolerance:15});var er=di.extend({addHooks:function(){ze(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Be(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(We(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new I(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&ge(i,"leaflet-active"),this._holdTimeout=setTimeout(r(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))},this),1e3),this._simulateEvent("mousedown",e),ze(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Be(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&ye(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new I(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});!Lt||Pt&&!ut||ei.addInitHook("addHandler","tap",er),ei.mergeOptions({touchZoom:Lt&&!nt,bounceAtZoomLimits:!0});var ir=di.extend({addHooks:function(){ge(this._map._container,"leaflet-touch-zoom"),ze(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ye(this._map._container,"leaflet-touch-zoom"),Be(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(o)._divideBy(2))),this._startDist=i.distanceTo(o),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),ze(document,"touchmove",this._onTouchMove,this),ze(document,"touchend",this._onTouchEnd,this),We(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]),n=i.distanceTo(o)/this._startDist;if(this._zoom=e.getScaleZoom(n,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&n<1||this._zoom>e.getMaxZoom()&&n>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===n)return}else{var s=i._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===n&&0===s.x&&0===s.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),k(this._animRequest);var a=r(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=C(a,this,!0),We(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,k(this._animRequest),Be(document,"touchmove",this._onTouchMove,this),Be(document,"touchend",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});ei.addInitHook("addHandler","touchZoom",ir),ei.BoxZoom=Yo,ei.DoubleClickZoom=$o,ei.Drag=Qo,ei.Keyboard=Xo,ei.ScrollWheelZoom=tr,ei.Tap=er,ei.TouchZoom=ir,t.version=e,t.Control=oi,t.control=ri,t.Browser=It,t.Evented=T,t.Mixin=mi,t.Util=E,t.Class=M,t.Handler=di,t.extend=i,t.bind=r,t.stamp=s,t.setOptions=d,t.DomEvent=Xe,t.DomUtil=Ie,t.PosAnimation=ti,t.Draggable=bi,t.LineUtil=Ii,t.PolyUtil=ji,t.Point=I,t.point=j,t.Bounds=B,t.bounds=Z,t.Transformation=G,t.transformation=J,t.Projection=Di,t.LatLng=R,t.latLng=q,t.LatLngBounds=D,t.latLngBounds=N,t.CRS=U,t.GeoJSON=lo,t.geoJSON=bo,t.geoJson=vo,t.Layer=Fi,t.LayerGroup=Ui,t.layerGroup=Wi,t.FeatureGroup=Hi,t.featureGroup=Vi,t.ImageOverlay=wo,t.imageOverlay=xo,t.VideoOverlay=Po,t.videoOverlay=Lo,t.SVGOverlay=Oo,t.svgOverlay=Co,t.DivOverlay=ko,t.Popup=Eo,t.popup=Mo,t.Tooltip=Ao,t.tooltip=So,t.Icon=Gi,t.icon=Ji,t.DivIcon=To,t.divIcon=Io,t.Marker=$i,t.marker=Qi,t.TileLayer=Bo,t.tileLayer=Zo,t.GridLayer=zo,t.gridLayer=jo,t.SVG=Vo,t.svg=Go,t.Renderer=Ro,t.Canvas=qo,t.canvas=Fo,t.Path=Xi,t.CircleMarker=to,t.circleMarker=eo,t.Circle=io,t.circle=oo,t.Polyline=ro,t.polyline=no,t.Polygon=so,t.polygon=ao,t.Rectangle=Jo,t.rectangle=Ko,t.Map=ei,t.map=ii;var or=window.L;t.noConflict=function(){return window.L=or,this},window.L=t}(x.exports)),x.exports),O=Object.defineProperty,C=Object.defineProperties,k=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,S=(t,e,i)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;function T(t,e={},i){const o=l(e),r=P.Control.extend({onAdd(e){const r=["leaflet-control",o.bar?"leaflet-bar":"",o.addClass].filter(Boolean).join(" "),n=function(t,e={},i){const o=_(e);c(o,e);const r=t.onAdd(i);return r&&o.appendChild(r),o}(t,(s=((t,e)=>{for(var i in e||(e={}))M.call(e,i)&&S(t,i,e[i]);if(E)for(var i of E(e))A.call(e,i)&&S(t,i,e[i]);return t})({},o),C(s,k({addClass:r}))),null!=i?i:e);var s;return o.margin||(n.style.margin="0px"),n},onRemove(e){t.onRemove(null!=i?i:e)}}),n=new r;return c(n,o),n}function I(t,e){const i=function(t){const e=document.createElement("div"),i=new Set;let o=!1;t.getStatus?o=t.getStatus():t.status&&(o=t.status);const r=t.title||"",n=t.html;function s(t){i.forEach(e=>e(o,t))}function a(){r&&(e.title="string"==typeof r?r:o?r.on:r.off,e.setAttribute("aria-label",e.title))}function l(){n&&(e.innerHTML="","string"==typeof n||n instanceof HTMLElement?b(e,n):b(e,o?n.on:n.off))}function c(t,i){t.split(" ").filter(Boolean).forEach(t=>{i?e.classList.add(t):e.classList.remove(t)})}function h(){t.addClassOn&&c(t.addClassOn,o),t.addClassOff&&c(t.addClassOff,!o)}a(),l(),t.addClass&&c(t.addClass,!0),h();const u=t=>{void 0!==t&&(o=t),l(),a(),h()},p=e=>{if(void 0===e&&o&&d.disableOnSecondClick)return;const i=o;if(o=void 0!==e?e:!o,t.onClick){let e;try{e=t.onClick(o)}catch(r){throw o=i,u(),r}Promise.resolve(e).then(()=>{u(),i!==o&&s(d)}).catch(()=>{o=i,u()})}else u(),i!==o&&s(d)},d=v({html:e,onClick:p});return d.onClick=p,d.changeStatus=u,d.getStatus=()=>o,d.switch=t.switch,void 0!==t.disableOnSecondClick&&(d.disableOnSecondClick=t.disableOnSecondClick),d.onStatusChange=t=>(i.add(t),()=>i.delete(t)),d}(t),o=T(i,{bar:!0,margin:t.margin},e);return o.onClick=i.onClick,o.changeStatus=i.changeStatus,o.getStatus=i.getStatus,o.switch=i.switch,Object.defineProperty(o,"disableOnSecondClick",{configurable:!0,get:()=>i.disableOnSecondClick,set:t=>{i.disableOnSecondClick=t}}),o.onStatusChange=i.onStatusChange,o}u(".leaflet-bar.webmap-ctrl-group:not(:empty){box-shadow:0 0 2px rgba(0,0,0,.1)}");var z,j=Object.defineProperty,B=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,q=(t,e,i)=>e in t?j(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,F=(t,e,i)=>q(t,"symbol"!=typeof e?e+"":e,i);class U{constructor(t,e={}){F(this,"map"),F(this,"controlContainer"),F(this,"targets",new WeakMap),F(this,"ids",new WeakMap),this.map=t,this.controlContainer=this.createControlContainer(e),this.controlContainer.addTo(t.getContainer())}addControl(t,e,i={}){t.options.position=("string"==typeof e?e:"top-left").replace("-",""),this.map.addControl(t);const o=t.getContainer();return o&&(this.controlContainer.append(o,e,i.order,t),this.targets.set(t,o),i.id&&(this.controlContainer.registerIDContainer(i.id,o,t),this.ids.set(t,i.id))),t}removeControl(t){this.map.removeControl(t);const e=this.ids.get(t);e&&(this.controlContainer.unregisterIDContainer(e),this.ids.delete(t));const i=this.targets.get(t);i&&(this.controlContainer.removeTarget(i),this.targets.delete(t))}append(t,e,i=0){this.controlContainer.append(t,e,i)}registerIDContainer(t,e,i){this.controlContainer.registerIDContainer(t,e,i)}unregisterIDContainer(t){this.controlContainer.unregisterIDContainer(t)}detach(){this.controlContainer.detach()}getContainer(){return this.controlContainer.getContainer()}getControlContainer(){return this.controlContainer}createControlContainer(t){const e=this.map,i=e._controlCorners||{},o=(t,e)=>i[t]||this.map.getContainer().querySelector(e)||void 0;return new f((r=((t,e)=>{for(var i in e||(e={}))N.call(e,i)&&q(t,i,e[i]);if(D)for(var i of D(e))R.call(e,i)&&q(t,i,e[i]);return t})({},t),n={map:this.map,container:e._controlContainer,positionContainers:{"top-left":o("topleft",".leaflet-top.leaflet-left"),"top-right":o("topright",".leaflet-top.leaflet-right"),"bottom-left":o("bottomleft",".leaflet-bottom.leaflet-left"),"bottom-right":o("bottomright",".leaflet-bottom.leaflet-right")}},B(r,Z(n))));var r,n}}function W(){}function H(){H.init.call(this)}function V(t){return void 0===t._maxListeners?H.defaultMaxListeners:t._maxListeners}function G(t,e,i,o){var r,n,s,a;if("function"!=typeof i)throw new TypeError('"listener" argument must be a function');if((n=t._events)?(n.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),n=t._events),s=n[e]):(n=t._events=new W,t._eventsCount=0),s){if("function"==typeof s?s=n[e]=o?[i,s]:[s,i]:o?s.unshift(i):s.push(i),!s.warned&&(r=V(t))&&r>0&&s.length>r){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,a=l,"function"==typeof console.warn?console.warn(a):console.log(a)}}else s=n[e]=i,++t._eventsCount;return t}function J(t,e,i){var o=!1;function r(){t.removeListener(e,r),o||(o=!0,i.apply(t,arguments))}return r.listener=i,r}function K(t){var e=this._events;if(e){var i=e[t];if("function"==typeof i)return 1;if(i)return i.length}return 0}function Y(t,e){for(var i=new Array(e);e--;)i[e]=t[e];return i}W.prototype=Object.create(null),H.EventEmitter=H,H.usingDomains=!1,H.prototype.domain=void 0,H.prototype._events=void 0,H.prototype._maxListeners=void 0,H.defaultMaxListeners=10,H.init=function(){this.domain=null,H.usingDomains&&(!z.active||this instanceof z.Domain||(this.domain=z.active)),this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new W,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},H.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},H.prototype.getMaxListeners=function(){return V(this)},H.prototype.emit=function(t){var e,i,o,r,n,s,a,l="error"===t;if(s=this._events)l=l&&null==s.error;else if(!l)return!1;if(a=this.domain,l){if(e=arguments[1],!a){if(e instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=a,e.domainThrown=!1,a.emit("error",e),!1}if(!(i=s[t]))return!1;var h="function"==typeof i;switch(o=arguments.length){case 1:!function(t,e,i){if(e)t.call(i);else for(var o=t.length,r=Y(t,o),n=0;n<o;++n)r[n].call(i)}(i,h,this);break;case 2:!function(t,e,i,o){if(e)t.call(i,o);else for(var r=t.length,n=Y(t,r),s=0;s<r;++s)n[s].call(i,o)}(i,h,this,arguments[1]);break;case 3:!function(t,e,i,o,r){if(e)t.call(i,o,r);else for(var n=t.length,s=Y(t,n),a=0;a<n;++a)s[a].call(i,o,r)}(i,h,this,arguments[1],arguments[2]);break;case 4:!function(t,e,i,o,r,n){if(e)t.call(i,o,r,n);else for(var s=t.length,a=Y(t,s),l=0;l<s;++l)a[l].call(i,o,r,n)}(i,h,this,arguments[1],arguments[2],arguments[3]);break;default:for(r=new Array(o-1),n=1;n<o;n++)r[n-1]=arguments[n];!function(t,e,i,o){if(e)t.apply(i,o);else for(var r=t.length,n=Y(t,r),s=0;s<r;++s)n[s].apply(i,o)}(i,h,this,r)}return!0},H.prototype.on=H.prototype.addListener=function(t,e){return G(this,t,e,!1)},H.prototype.prependListener=function(t,e){return G(this,t,e,!0)},H.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,J(this,t,e)),this},H.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,J(this,t,e)),this},H.prototype.removeListener=function(t,e){var i,o,r,n,s;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(o=this._events))return this;if(!(i=o[t]))return this;if(i===e||i.listener&&i.listener===e)0===--this._eventsCount?this._events=new W:(delete o[t],o.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(r=-1,n=i.length;n-- >0;)if(i[n]===e||i[n].listener&&i[n].listener===e){s=i[n].listener,r=n;break}if(r<0)return this;if(1===i.length){if(i[0]=void 0,0===--this._eventsCount)return this._events=new W,this;delete o[t]}else!function(t,e){for(var i=e,o=i+1,r=t.length;o<r;i+=1,o+=1)t[i]=t[o];t.pop()}(i,r);o.removeListener&&this.emit("removeListener",t,s||e)}return this},H.prototype.off=function(t,e){return this.removeListener(t,e)},H.prototype.removeAllListeners=function(t){var e,i;if(!(i=this._events))return this;if(!i.removeListener)return 0===arguments.length?(this._events=new W,this._eventsCount=0):i[t]&&(0===--this._eventsCount?this._events=new W:delete i[t]),this;if(0===arguments.length){for(var o,r=Object.keys(i),n=0;n<r.length;++n)"removeListener"!==(o=r[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=new W,this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(e)do{this.removeListener(t,e[e.length-1])}while(e[0]);return this},H.prototype.listeners=function(t){var e,i=this._events;return i&&(e=i[t])?"function"==typeof e?[e.listener||e]:function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(e):[]},H.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):K.call(t,e)},H.prototype.listenerCount=K,H.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function $(t,e,i={}){const o=function(t,e=[]){for(;null!==t;t=Object.getPrototypeOf(t)){const i=Object.getOwnPropertyNames(t);for(let t=0;t<i.length;t++)-1==e.indexOf(i[t])&&e.push(i[t])}return e}(t.prototype);const r=void 0===i.replace||i.replace;e.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(i=>{const n=-1!==o.indexOf(i);if(!r&&!n||r){const o=Object.getOwnPropertyDescriptor(e.prototype,i);o&&Object.defineProperty(t.prototype,i,o)}})})}function Q(t,e=10){let i;function o(...r){o.clear(),i=setTimeout(()=>{i=null,t.apply(this,r)},e)}return o.clear=function(){i&&(clearTimeout(i),i=null)},o}function X(t,e,i=!1){let o=t;const r=e,n=Array.isArray(r);let s=n&&[]||{};return n&&Array.isArray(r)?i?(o=o||[],s=s.concat(o),r.forEach((t,e)=>{void 0===s[e]?s[e]=t:"object"==typeof t?s[e]=X(o[e],t,i):-1===o.indexOf(t)&&s.push(t)})):s=r:(o&&"object"==typeof o&&Object.keys(o).forEach(function(t){s[t]=o[t]}),Object.keys(r).forEach(function(t){s[t]="object"==typeof r[t]&&r[t]&&"object"==typeof o[t]&&"object"==typeof r[t]?X(o[t],r[t],i):r[t]})),s}function tt(t){return null!=t}function et(t){return"string"==typeof t?!!t:tt(t)}function it(t){if(!t.lngLat&&t.latLng){t.lngLat=[t.latLng.lng,t.latLng.lat]}return t}function ot(t,e){e=e>85.06?85.06:e<-85.06?-85.06:e;const i=20037508.34*t/180;let o=Math.log(Math.tan((90+e)*Math.PI/360))/(Math.PI/180);return o=20037508.34*o/180,[i,o]}function rt(t){return{type:"Polygon",coordinates:[nt(t)]}}function nt(t){const e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}const st=Math.PI/180,at=180/Math.PI;function lt(t,e,i=10,o=6){const r=i/6371*at,n=r/Math.cos(e*st),s=[];for(let a=0;a<o+1;a++){const i=Math.PI*(a/(o/2)),l=t+n*Math.cos(i),c=e+r*Math.sin(i);s.push([l,c])}return s}function ct(t,e,i,o){if(t instanceof Array)return e instanceof Array&&e.sort().join("")===t.sort().join("");if(t instanceof Date)return e instanceof Date&&""+t==""+e;if(t instanceof Function){if(!(e instanceof Function))return!1}else if(t instanceof Object)return e instanceof Object&&(t===i?e===o:ht(t,e));return t===e}function ht(t,e){const i=Object.keys(t).sort(),o=Object.keys(e).sort();if(i.length!==o.length)return!1;if(i.join("")!==o.join(""))return!1;for(let r=0;r<i.length;r++){if(!ct(t[i[r]],e[o[r]],t,e))return!1}return!0}function ut(t){const e={};return Object.keys(t).forEach(i=>{t[i]instanceof Array||t[i]!==Object(t[i])?void 0!==t[i]&&(e[i]=t[i]):e[i]=ut(t[i])}),e}function pt(t){return"[object Object]"===Object.prototype.toString.call(t)}function dt(t){return t.replace(/([^:]\/)\/+/g,"$1")}function ft(t,e){const i=new URL(t),o=new URLSearchParams(i.search);Object.entries(e).forEach(([t,e])=>{void 0===e?o.delete(t):o.set(t,e)}),o.set("timestamp",String((new Date).getTime()));const r=[...o.entries()].map(([t,e])=>`${t}=${e}`).join("&");return`${i.origin}${i.pathname}?${r}`}function mt(t){const e=t.getNorthEast(),i=t.getSouthWest();return[i.lng,i.lat,e.lng,e.lat]}function gt(t){const e={};for(let o=0;o<t.length;o++)e[t[o]]=1+(e[t[o]]||0);let i="";for(const o in e){e[o]>(i?e[i]:0)&&(i=o)}return i}const yt={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon",GeometryCollection:"polygon"},_t={stroke:!1,opacity:1},bt={};for(const L in yt){const t=yt[L],e=bt[t]||[];e.push(L),bt[t]=e}function vt(t,e){return-1!==(bt[e]||[]).indexOf(t)}function wt(t){const e=new P.GeoJSON;return(Array.isArray(t)?t:[t]).forEach(t=>e.addData(t)),e.getBounds()}function xt(t){return{getBounds:()=>function(t){return mt(wt(t))}(t),getCenter:()=>function(t){const{lat:e,lng:i}=wt(t).getCenter();return[i,e]}(t)}}var Pt=Object.defineProperty,Lt=(t,e,i)=>((t,e,i)=>e in t?Pt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Ot{constructor(t,e){if(Lt(this,"map",t),Lt(this,"options",e),Lt(this,"layer"),Lt(this,"pane","order-0"),void 0!==e.order){const i="order-"+e.order;let o=t.getPane(i);o||(o=t.createPane(i)),o.style.zIndex=String(Math.round(100*e.order)),this.pane=i}}addLayer(t){Object.assign(this.options,t)}}function Ct(t){const e=t.containerPoint,i=t.latlng,{lat:o,lng:r}=i;return{latLng:i,lngLat:[r,o],pixel:{left:e.x,top:e.y},source:t}}var kt=Object.defineProperty,Et=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,St=(t,e,i)=>e in t?kt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;function Tt({layer:t,source:e}){const i=e.target.feature;return((t,e)=>{for(var i in e||(e={}))Mt.call(e,i)&&St(t,i,e[i]);if(Et)for(var i of Et(e))At.call(e,i)&&St(t,i,e[i]);return t})({layer:t,feature:i,event:Ct(e),source:e},xt(i))}var It=Object.defineProperty,zt=Object.getOwnPropertySymbols,jt=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,Zt=(t,e,i)=>e in t?It(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Dt=(t,e)=>{for(var i in e||(e={}))jt.call(e,i)&&Zt(t,i,e[i]);if(zt)for(var i of zt(e))Bt.call(e,i)&&Zt(t,i,e[i]);return t},Nt=(t,e,i)=>Zt(t,"symbol"!=typeof e?e+"":e,i);class Rt{constructor(t){Nt(this,"layer"),Nt(this,"_onclick"),Nt(this,"_ondblclick"),Nt(this,"_mouseout"),Nt(this,"_mouseover"),this.layer=t}handleMouseEvents(t){const{onClick:e,onDoubleClick:i,onLayerClick:o,onMouseOut:r,onMouseOver:n}=this.layer.options,s=e||o;s&&(this._onclick=e=>{const i=!!this.layer._getSelected(t);s(Dt({selected:i},this._createMouseEvent(e)))},t.on("click",this._onclick,this)),i&&(this._ondblclick=e=>{P.DomEvent.stopPropagation(e);const o=!!this.layer._getSelected(t);i(Dt({selected:o},this._createMouseEvent(e)))},t.on("dblclick",this._ondblclick,this)),r&&(this._mouseout=t=>{r(this._createMouseEvent(t))},t.on("mouseout",this._mouseout,this)),n&&(this._mouseover=t=>{n(this._createMouseEvent(t))},t.on("mouseover",this._mouseover,this))}stopMouseEvents(t){this._mouseover&&t.off("mouseover",this._mouseover,this),this._mouseout&&t.off("mouseout",this._mouseout,this),this._onclick&&t.off("click",this._onclick,this)}_createMouseEvent(t){return Tt({layer:this.layer,source:t})}}function qt(t){return(e,i)=>{const o=e.map(t=>t());return t(o,i)}}const Ft={"!":qt(function([t]){return!t}),"!=":qt(function([t,e]){return t!==e}),"<":qt(function([t,e]){return t<e}),"<=":qt(function([t,e]){return t<=e}),"==":qt(function([t,e]){return t===e}),">":qt(function([t,e]){return t>e}),">=":qt(function([t,e]){return t>=e}),coalesce:t=>{for(let e=0;e<t.length;e++){const i=t[e]();if(null!=i)return i}return null},all:t=>{for(let e=0;e<t.length;e++){if(!t[e]())return!1}return!0},any:t=>{for(let e=0;e<t.length;e++){if(t[e]())return!0}return!1},case:t=>{if(t.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');if(t.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(let e=0;e<t.length-1;e+=2){const i=t[e](),o=t[e+1]();if(i)return o}return(0,t[t.length-1])()},match:t=>{const[e,...i]=t,o=e(),r=i.splice(-1,i.length%2)[0];for(let n=0;n<i.length-1;n+=2){if(i[n]()===o)return i[n+1]()}return r()}},Ut={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Wt(t){if("string"==typeof(i=t)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(i))return Ht(t);if("string"==typeof(e=t)&&e in Ut)return function(t){return Ht(Ut[t])}(t);if(function(t){return"string"==typeof t&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(t)}(t))return function(t){const e=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;let i;if(i=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10)];if(i=t.match(e))return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10),parseFloat(i[4])];throw new Error(`The '${t}' Is not valid rgb`)}(t);if(function(t){if("object"==typeof t&&null!==t)return"r"in t&&"g"in t&&"b"in t&&(!("a"in t)||"number"==typeof t.a&&t.a>=0&&t.a<=1);return!1}(t))return function({r:t,g:e,b:i,a:o}){return[t,e,i,...void 0!==o?[o]:[]]}(t);var e,i;throw new Error(`The '${t}' cannot be converted to color`)}function Ht(t){let e;if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)];if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)/255];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)/255];throw new Error(`The '${t}' Is not valid hex`)}function Vt(t,e,i,o,r){if("number"==typeof i&&"number"==typeof r)return i+(t-e)/(o-e)*(r-i);try{const n=Wt(i),s=Wt(r);return function(t){return`rgb(${t.join(",")})`}(n.map((i,r)=>Math.ceil(Vt(t,e,i,o,s[r]))))}catch(n){console.log(n)}throw new Error("Unsupported output type for linear interpolation.")}const Gt={step:t=>{const[e,i,...o]=t,r=e();if("number"!=typeof r)return i();for(let n=0;n<o.length-2;n+=2){const t=o[n](),e=o[n+1](),i=o[n+2]();if(r>=t&&r<i)return e}return r>=o[o.length-2]()?o[o.length-1]():i()},interpolate:([t,e,...i])=>{if(i.length<2)throw new Error("At least two stops are required");if(i.length<2||i.length%2!=0)throw new Error("Invalid stops provided.");const o=e();if("number"!=typeof o)throw new Error("Input must be a number.");const r=t();for(let n=0;n<i.length-2;n+=2){const t=i[n](),e=i[n+1](),s=i[n+2](),a=i[n+3]();if(o>=t&&o<=s&&"linear"===r[0])return Vt(o,t,e,s,a)}throw new Error("Invalid interpolation type.")}};const Jt={get:qt(function([t,e],i){const o=e||i;return o&&"object"==typeof o&&t in o?o[t]:null}),length:qt(([t])=>{if("string"==typeof t||Array.isArray(t))return t.length}),at:qt(function([t,e]){return e[t]}),has:qt(function([t,e],i){const o=e||i;return!(!o||"object"!=typeof o||!(t in o))}),in:qt(function([t,e]){if("string"==typeof e)return e.includes(String(t));if(Array.isArray(e))return e.includes(t);throw new Error(`Invalid input type for 'in'. Expected string or array, got ${typeof e}.`)}),"index-of":qt(function([t,e,i]){if("string"==typeof e)return e.indexOf(String(t),i);if(Array.isArray(e))return e.indexOf(t,i);throw new Error(`Invalid input type for 'index-of'. Expected string or array, got ${typeof e}.`)}),slice:qt(function(t){const[e,i,o]=t;if("string"==typeof e)return e.slice(i,o);if(Array.isArray(e))return e.slice(i,o);throw new Error(`Invalid input type for 'slice'. Expected string or array, got ${typeof e}.`)})},Kt={"+":qt(t=>t.reduce((t,e)=>t+e,0)),"-":qt(t=>t.reduce((t,e)=>t-e)),"*":qt(t=>t.reduce((t,e)=>t*e,1)),"/":qt(t=>t.reduce((t,e)=>t/e)),"%":qt(t=>t[0]%t[1]),"^":qt(t=>Math.pow(t[0],t[1])),abs:qt(t=>Math.abs(t[0])),acos:qt(t=>Math.acos(t[0])),asin:qt(t=>Math.asin(t[0])),atan:qt(t=>Math.atan(t[0])),ceil:qt(t=>Math.ceil(t[0])),cos:qt(t=>Math.cos(t[0])),e:()=>Math.E,floor:qt(t=>Math.floor(t[0])),ln:qt(t=>Math.log(t[0])),ln2:()=>Math.LN2,log10:qt(t=>Math.log10(t[0])),log2:qt(t=>Math.log2(t[0])),max:qt(t=>Math.max(...t)),min:qt(t=>Math.min(...t)),pi:()=>Math.PI,round:qt(t=>Math.round(t[0])),sin:qt(t=>Math.sin(t[0])),sqrt:qt(t=>Math.sqrt(t[0])),tan:qt(t=>Math.tan(t[0]))},Yt={concat:qt(t=>t.reduce((t,e)=>String(t)+String(e),"")),downcase:qt(t=>String(t[0]).toLowerCase()),upcase:qt(t=>String(t[0]).toUpperCase())},$t=(t,e,i)=>{try{const o=t(e,i);if(void 0!==o)return o}catch(o){}};function Qt(t){return(e,i)=>{for(const o of e){const e=$t(t,o,i);if(void 0!==e)return e}throw new Error("Received a mismatched type")}}const Xt={array:qt(t=>{const[e,i,o]=t;let r,n,s;if("string"==typeof e&&["string","number","boolean"].includes(e)?(r=e,"number"==typeof i?(n=i,s=o):s=i):Array.isArray(e)&&(s=e),!Array.isArray(s))throw new Error("Expected an array");if(r&&!s.every(t=>typeof t===r))throw new Error(`Expected all items in array to be of type ${r}`);if(n&&s.length!==n)throw new Error(`Expected array of length ${n}`);return s}),boolean:qt(Qt(t=>"boolean"==typeof t?t:void 0)),literal:qt(([t])=>t),number:qt(Qt(t=>"number"==typeof t?t:void 0)),object:qt(Qt(t=>null===t||"object"!=typeof t||Array.isArray(t)?void 0:t)),string:qt(Qt(t=>"string"==typeof t?t:void 0)),"to-boolean":qt(Qt(Boolean)),"to-number":qt(Qt(Number)),"to-string":qt(Qt(String)),typeof:qt(([t])=>function(t){if(null===t)return"null";switch(typeof t){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":if(Array.isArray(t)){let e="value";return t.every(t=>"number"==typeof t)?e="number":t.every(t=>"string"==typeof t)?e="string":t.every(t=>"boolean"==typeof t)&&(e="boolean"),`array<${e}, ${t.length}>`}return"object";default:return"undefined"}}(t))};var te=Object.defineProperty,ee=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable,re=(t,e,i)=>e in t?te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ne=(t,e)=>{for(var i in e||(e={}))ie.call(e,i)&&re(t,i,e[i]);if(ee)for(var i of ee(e))oe.call(e,i)&&re(t,i,e[i]);return t};function se(t){if(Array.isArray(t)){const[e,...i]=t;return"string"==typeof e&&"literal"!==e&&e in ae&&i.length>0}return!1}const ae=ne(ne(ne(ne(ne(ne({},Kt),Xt),Yt),Jt),Ft),Gt);function le(t,e={}){const[i,...o]=t,r=ae[i];if(r)return r(o.map(t=>()=>se(t)?le(t,e):t),e);throw new Error(`Expression "${i}" is not supported.`)}var ce=Object.defineProperty,he=Object.getOwnPropertySymbols,ue=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,de=(t,e,i)=>e in t?ce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,fe=(t,e)=>{for(var i in e||(e={}))ue.call(e,i)&&de(t,i,e[i]);if(he)for(var i of he(e))pe.call(e,i)&&de(t,i,e[i]);return t};function me(t){return e=>{const i=e.properties;return!!i&&le(t,i)}}const ge=["iconSize","iconAnchor"];var ye=Object.defineProperty,_e=Object.getOwnPropertySymbols,be=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable,we=(t,e,i)=>e in t?ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;function xe(t,e,i){if((e=String(e))===(t=String(t)))return!0;if(i&&e.toUpperCase()===t.toUpperCase())return!0;const o=`^${r=e,r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}$`.replace(/%/g,".*").replace("_",".");var r;return null!==new RegExp(o,i?"i":"").exec(t)}const Pe={gt:(t,e)=>t>e,lt:(t,e)=>t<e,ge:(t,e)=>t>=e,le:(t,e)=>t<=e,eq:(t,e)=>t===e,ne:(t,e)=>t!==e,in:(t,e)=>-1!==e.indexOf(t),notin:(t,e)=>-1===e.indexOf(t),like:(t,e)=>xe(t,e),ilike:(t,e)=>xe(t,e,!0)};function Le(t,e){const i=((t,e)=>{for(var i in e||(e={}))be.call(e,i)&&we(t,i,e[i]);if(_e)for(var i of _e(e))ve.call(e,i)&&we(t,i,e[i]);return t})({},t.properties);return!!i&&(i.$id=t.id,Oe(i,e))}function Oe(t,e){const i="string"==typeof e[0]?e[0]:"all",o=e=>{if(3===(i=e).length&&"string"==typeof i[0]&&"string"==typeof i[1]){const[i,o,r]=e,n=Pe[o];if(n){if(("like"===o||"ilike"===o)&&"string"==typeof i){let e="";const o=i.replace(/^%?(\w+)%?$/,(o,n)=>(e=t[n],i.replace(n,r)));return n(e,o)}return n(t[i],r)}return!1}return Oe(t,e);var i},r=e.filter(t=>Array.isArray(t));return"any"===i?r.some(o):r.every(o)}function Ce(t){return"[object Object]"===Object.prototype.toString.call(t)}function ke(t){return"function"==typeof t}var Ee=Object.defineProperty,Me=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable,Te=(t,e,i)=>e in t?Ee(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ie=(t,e)=>{for(var i in e||(e={}))Ae.call(e,i)&&Te(t,i,e[i]);if(Me)for(var i of Me(e))Se.call(e,i)&&Te(t,i,e[i]);return t};function ze(t){let e={};const i=[];for(const o of t)o&&(Array.isArray(o)?i.push(o):e=o);return t=>{const o=i.find(e=>Le(t,e[0]));return o?Ie(Ie({},e),o[1]):e}}function je({paint:t,defaultPaint:e}){const i=function(t){let e=!1;const i={};for(const o in t)if(-1===ge.indexOf(o)){const r=o,n=t[r];se(n)&&(e=!0,i[r]=me(n))}if(e)return e=>{const o={};for(const t in i)o[t]=i[t](e);return fe(fe({},t),o)}}(t);if(i){const o=t=>Ze({paint:i(t),defaultPaint:e});return o.paint=Be({paint:t,defaultPaint:e}),o}return Be({paint:t,defaultPaint:e})}function Be({paint:t,defaultPaint:e}){var i;let o=Ie({},e);return o=Ie(Ie({},o),t),o.fill=null==(i=o.fill)||i,o.stroke=void 0!==o.stroke?o.stroke:!o.fill||!(!o.strokeColor&&!o.strokeOpacity),o}function Ze({paint:t,defaultPaint:e,getPaintFunctions:i}){if(!t)throw new Error("paint is empty");let o=Ie({},e);if(ke(t)){const o=o=>{const r=Ze({paint:t(o),defaultPaint:e,getPaintFunctions:i});return r.type=t.type,r};return o.type=t.type,o}if(function(t){return!!Array.isArray(t)}(t))return o=>Ze({paint:ze(t)(o),defaultPaint:e,getPaintFunctions:i});if("get-paint"===t.type){const r=function(t,e){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&e){const i=e[t.from];if(i)return i(t.options)}}(t,i);r&&(o=Ze({paint:r,defaultPaint:e,getPaintFunctions:i}))}else{if("icon"===t.type)return t;o=je({paint:t,defaultPaint:e})}return ke(o)||("color"in o&&(o.strokeColor||(o.strokeColor=o.color),o.fillColor||(o.fillColor=o.color)),"opacity"in o&&(void 0===o.strokeOpacity&&(o.strokeOpacity=o.opacity),void 0===o.fillOpacity&&(o.fillOpacity=o.opacity))),o}var De=Object.defineProperty,Ne=Object.defineProperties,Re=Object.getOwnPropertyDescriptors,qe=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,We=(t,e,i)=>e in t?De(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,He=(t,e)=>{for(var i in e||(e={}))Fe.call(e,i)&&We(t,i,e[i]);if(qe)for(var i of qe(e))Ue.call(e,i)&&We(t,i,e[i]);return t};class Ve{constructor(t){var e;We(this,"layer"+"",e),this.layer=t}setPaintEachLayer(t){this.layer._layers.forEach(e=>{this.setPaint(e,t)})}setPaint(t,e){let i;const{layer:o,feature:r}=t;if(o&&r&&(ke(e)?i=e(r):Ce(e)&&(i=e),i))if("point"===this.layer.type&&"icon"===i.type){const t=o,e=this._createDivIcon(i);setTimeout(()=>{t.setIcon(e)},10)}else"setStyle"in o&&o.setStyle(this.preparePaint(i))}preparePaint(t){if("get-paint"!==t.type){const e="line"===this.layer.type?[["color","strokeColor"],["opacity","strokeOpacity"],["weight","weight"]]:[["color","strokeColor"],["opacity","strokeOpacity"],["stroke","stroke"],["fillColor","fillColor"],["fillOpacity","fillOpacity"],["fill","fill"],["weight","weight"]],i={};"radius"in t&&"number"==typeof t.radius&&(i.radius=t.radius);for(const[o,r]of e){const e=this.layer.options.opacity;let n=t[r];tt(e)&&-1!==r.toLowerCase().indexOf("opacity")&&(n=Number(n)*e),void 0!==n&&Object.defineProperty(i,o,{enumerable:!0,value:n})}return i}return _t}_createDivIcon(t){const e=t,{html:i,rotate:o,className:r}=e,n=((t,e)=>{var i={};for(var o in t)Fe.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&qe)for(var o of qe(t))e.indexOf(o)<0&&Ue.call(t,o)&&(i[o]=t[o]);return i})(e,["html","rotate","className"]),s=document.createElement("div");r&&(s.className=r),o&&(s.style.transform=`rotateZ(${o}deg)`),i&&(s.innerHTML=i);var a;return new P.DivIcon((a=He({className:""},n),Ne(a,Re({html:s}))))}createPaintToLayer(t){if(t&&t.type)if("icon"===t.type){if(t.className||t.html)return(e,i)=>{const o=this._createDivIcon(t);return new P.Marker(i,{icon:o})}}else if("pin"===t.type)return(t,e)=>new P.Marker(e);return(e,i)=>new P.CircleMarker(i,this.preparePaint(He(He({},_t),t)))}createPaintOptions(t){const e={},i=this.preparePaint(t);return t&&(e.style=()=>i),"point"===this.layer.type?e.pointToLayer=this.createPaintToLayer(t):"line"===this.layer.type&&(i.stroke=!0),e}}var Ge=Object.defineProperty,Je=Object.defineProperties,Ke=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertySymbols,$e=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,Xe=(t,e,i)=>e in t?Ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ti=(t,e)=>{for(var i in e||(e={}))$e.call(e,i)&&Xe(t,i,e[i]);if(Ye)for(var i of Ye(e))Qe.call(e,i)&&Xe(t,i,e[i]);return t},ei=(t,e)=>Je(t,Ke(e)),ii=(t,e,i)=>Xe(t,"symbol"!=typeof e?e+"":e,i);const oi={};var ri=Object.defineProperty,ni=Object.getOwnPropertySymbols,si=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable,li=(t,e,i)=>e in t?ri(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ci=(t,e)=>{for(var i in e||(e={}))si.call(e,i)&&li(t,i,e[i]);if(ni)for(var i of ni(e))ai.call(e,i)&&li(t,i,e[i]);return t};function hi(t){return!!t&&Object.keys(t).length>0}function ui(t){if(!t)return;const e=ci({},t);return function(t){return!(!t||!(hi(t.headers)||void 0!==t.credentials||void 0!==t.cache&&"default"!==t.cache))}(e)?e:void 0}function pi(t){const e=null==t?void 0:t.request,i=ci(ci({},(null==t?void 0:t.headers)||{}),(null==e?void 0:e.headers)||{}),o={};return hi(i)&&(o.headers=i),(null==t?void 0:t.withCredentials)&&(o.credentials="include"),void 0!==(null==e?void 0:e.credentials)&&(o.credentials=e.credentials),void 0!==(null==e?void 0:e.cache)&&(o.cache=e.cache),ui(o)}function di(t){const e={};for(let o=0;o<t.length;o++)e[t[o]]=1+(e[t[o]]||0);let i;for(const o in e){e[o]>((void 0!==i?e[i]:0)||0)&&(i=o)}return i}const fi={polygon:"path",line:"path",point:"circle"},mi={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon"};function gi(t){if(t.data){const e=mi[function(t){let e;e="FeatureCollection"===t.type?di(t.features.map(t=>t.geometry.type)):"GeometryCollection"===t.type?di(t.geometries.map(t=>t.type)):"Feature"===t.type?t.geometry.type:t.type;return e}(t.data)],i=t.paint;i&&Ce(i)&&(i.type=i.type?i.type:"polygon"===e||"line"===e?"path":"html"in i||"className"in i?"icon":fi[e]),t.type=t.type||e}return t}var yi=Object.defineProperty,_i=(t,e,i)=>((t,e,i)=>e in t?yi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class bi{constructor(){_i(this,"backspace",8),_i(this,"tab",9),_i(this,"enter",13),_i(this,"shift",16),_i(this,"ctrl",17),_i(this,"alt",18),_i(this,"pause/break",19),_i(this,"caps_lock",20),_i(this,"escape",27),_i(this,"page_up",33),_i(this,"page_down",34),_i(this,"end",35),_i(this,"home",36),_i(this,"left_arrow",37),_i(this,"up_arrow",38),_i(this,"right_arrow",39),_i(this,"down_arrow",40),_i(this,"insert",45),_i(this,"delete",46),_i(this,"left_window_key",91),_i(this,"right_window_key",92),_i(this,"select_key",93),_i(this,"numpad_0",96),_i(this,"numpad_1",97),_i(this,"numpad_2",98),_i(this,"numpad_3",99),_i(this,"numpad_4",100),_i(this,"numpad_5",101),_i(this,"numpad_6",102),_i(this,"numpad_7",103),_i(this,"numpad_8",104),_i(this,"numpad_9",105),_i(this,"multiply",106),_i(this,"add",107),_i(this,"subtract",109),_i(this,"decimal_point",110),_i(this,"divide",111),_i(this,"f1",112),_i(this,"f2",113),_i(this,"f3",114),_i(this,"f4",115),_i(this,"f5",116),_i(this,"f6",117),_i(this,"f7",118),_i(this,"f8",119),_i(this,"f9",120),_i(this,"f10",121),_i(this,"f11",122),_i(this,"f12",123),_i(this,"num_lock",144),_i(this,"scroll_lock",145),_i(this,"semi-colon",186),_i(this,"equal_sign",187),_i(this,",",188),_i(this,"-",189),_i(this,".",190),_i(this,"/",191),_i(this,"`",192),_i(this,"[",219),_i(this,"\\",220),_i(this,"]",221),_i(this,"'",222)}}var vi=Object.defineProperty,wi=(t,e,i)=>((t,e,i)=>e in t?vi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);var xi=Object.defineProperty,Pi=(t,e,i)=>((t,e,i)=>e in t?xi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Li{constructor(t,e){Pi(this,"webMap",t),Pi(this,"name"),Pi(this,"event"),Pi(this,"value"),e&&(e.value&&this.setValue(e.value),e.name&&(this.name=e.name),e.event&&(this.event="string"==typeof e.event?[e.event]:e.event))}getValue(){return this.value}setValue(t){this.value=t}}var Oi=Object.defineProperty,Ci=(t,e,i)=>((t,e,i)=>e in t?Oi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class ki extends Li{constructor(){super(...arguments),Ci(this,"name","bounds"),Ci(this,"event",["moveend"])}getValue(){return this.webMap.getBounds()}setValue(t){this.webMap.setView({bounds:t})}toString(){const t=this.getValue();if(t)return t.slice(0,4).map(t=>t.toFixed(5)).join("_")}parse(t){return t.split("_").map(Number)}}var Ei=Object.defineProperty,Mi=(t,e,i)=>((t,e,i)=>e in t?Ei(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Ai extends Li{constructor(){super(...arguments),Mi(this,"name","center"),Mi(this,"event",["moveend"])}getValue(){return this.webMap.getCenter()}setValue(t){this.webMap.setCenter(t)}toString(){const t=this.getValue();if(t){const e=t.map(t=>t.toFixed(5));return e[0]+"_"+e[1]}return""}parse(t){return t.split("_").map(Number)}}var Si=Object.defineProperty,Ti=(t,e,i)=>((t,e,i)=>e in t?Si(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Ii extends Li{constructor(){super(...arguments),Ti(this,"name","zoom"),Ti(this,"event",["zoomend"])}getValue(){const t=this.webMap.getZoom();return void 0!==t?Math.round(t):void 0}setValue(t){this.webMap.setZoom(t)}toString(){return String(this.getValue())}parse(t){return Number(t)}}var zi=Object.defineProperty,ji=(t,e,i)=>((t,e,i)=>e in t?zi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Bi=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});let Zi=0;const Di={minZoom:0,maxZoom:22,paint:{color:"#0000ff",opacity:.4,strokeOpacity:1,stroke:!0,radius:8,weight:1},selectedPaint:{color:"#00008b",opacity:.4,strokeOpacity:1,stroke:!0,radius:12,weight:1},create:!0},Ni=class t{constructor(e){ji(this,"options",Di),ji(this,"emitter",new H),ji(this,"keys",t.keys),ji(this,"mapAdapter"),ji(this,"runtimeParams",[]),ji(this,"getPaintFunctions",t.getPaintFunctions),ji(this,"mapStateItems",[Ai,Ii,ki]),ji(this,"id",Zi++),ji(this,"mapState",[]),ji(this,"_initMapState",{}),ji(this,"_starterKits"),ji(this,"_extent"),ji(this,"_eventsStatus",{}),ji(this,"_coordFromMapClickAbort"),ji(this,"_mapEvents",{}),this.mapAdapter=e.mapAdapter,this._starterKits=e.starterKits||[],e&&(this.options=X(Di||{},e)),this.options.runtimeParams&&(this.runtimeParams=this.options.runtimeParams),this._addEventsListeners(),this.options.tileJson&&this._setTileJsonOptions(this.options.tileJson),this.options.create&&this.create()}getId(){return this.id}create(){return Bi(this,null,function*(){return this.getEventStatus("create")||(yield this._setInitMapState(this.mapStateItems),yield this._setupMap(),this._emitStatusEvent("create",this)),this})}setRuntimeParams(t){this.runtimeParams.push(t)}destroy(){this._removeEventListeners(),function(t){for(const e in t)delete t[e]}(this._emitStatusEvent),this.mapAdapter.destroy&&this.mapAdapter.destroy()}mapStateWithFunc(t){const e={};return this.mapState.forEach(i=>{e[i.name]=t(i)}),e}getStateAsString(){return this.mapStateWithFunc(t=>t.toString())}getState(){return this.mapStateWithFunc(t=>t.getValue())}getRuntimeParams(){const t={};return this.mapState.forEach(e=>{for(const i of this.runtimeParams){const o=i.get(e.name);if(void 0!==o){t[e.name]=e.parse(o);break}}}),t}getContainer(){if(this.mapAdapter.getContainer)return this.mapAdapter.getContainer();if(this.options.target){if(this.options.target instanceof HTMLElement)return this.options.target;if("string"==typeof this.options.target){const t=document.getElementById(this.options.target);if(t)return t}}}setCursor(t){this.onLoad().then(()=>{this.mapAdapter.setCursor&&this.mapAdapter.setCursor(t)})}getCursor(){if(this.mapAdapter.getCursor)return this.mapAdapter.getCursor();const t=this.getContainer();return t?t.style.cursor:void 0}setCenter(t){return this.mapAdapter.setCenter(t),this}getCenter(){return this.mapAdapter.getCenter()}getBounds(){if(this.mapAdapter.getBounds)return this.mapAdapter.getBounds()}getBoundsPolygon(){const t=this.getBounds();if(t){return{type:"Feature",properties:{},geometry:rt(t)}}}setZoom(t){return this.mapAdapter.setZoom(t),this}getZoom(){const t=this.mapAdapter.getZoom();if("number"==typeof t)return t}zoomIn(){if(this.mapAdapter.zoomIn)this.mapAdapter.zoomIn();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t+1)}}}zoomOut(){if(this.mapAdapter.zoomOut)this.mapAdapter.zoomOut();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t-1)}}}setView(t,e){if(Array.isArray(t)){const i=t;this.mapAdapter.setView&&i&&tt(e)?this.mapAdapter.setView(i,e):(i&&this.mapAdapter.setCenter(i),tt(e)&&this.mapAdapter.setZoom(e))}else{this.mapAdapter.setView&&this.mapAdapter.setView(t)}}fitBounds(t,e){return function(t){const[e,i,o,r]=t,n=e<o&&i<r;if(!n){console.log("Error: The extent coordinates are not in the correct order."),console.log(`Received extent: [${e}, ${i}, ${o}, ${r}]`);const t=[Math.min(e,o),Math.min(i,r),Math.max(e,o),Math.max(r,i)];console.log(`Expected order: [${t.join(", ")}]`)}const s=e>=-180&&o<=180,a=i>=-90&&r<=90;s&&a||console.log("Warning: The coordinates may not be within valid geographic ranges.")}(t),t.every(t=>tt(t))&&(t[1]<-85.06&&(t[1]=-85.06),t[3]>85.06&&(t[3]=85.06),this.mapAdapter.fitBounds(t,e)),this}getEventStatus(t){const e=this._eventsStatus[t];return null!=e&&e}onLoad(t="create"){return new Promise(e=>{this.getEventStatus(t)?e(this):this.emitter.once(t,()=>{e(this)})})}onMapLoad(t){return new Promise(e=>{var i;const o=()=>{const i=this.mapAdapter;t&&t(i),i&&e(i)},r=null==(i=this.mapAdapter.isLoaded)||i;this.mapAdapter.map&&r?o():this.mapAdapter.emitter.once("create",()=>{o()})})}getLayerAdapters(){return this.mapAdapter.layerAdapters}getLayerAdapter(t){return this.mapAdapter.layerAdapters[t]}locate(t,e){if(this.mapAdapter&&this.mapAdapter.locate)return this.mapAdapter.locate(t,e);return{stop:()=>({})}}stopGetCoordFromMapClick(){this._coordFromMapClickAbort&&(this._coordFromMapClickAbort(),this._coordFromMapClickAbort=void 0)}getCoordFromMapClick(){return this._coordFromMapClickAbort?this.getCoordFromMapClick():new Promise((t,e)=>{const i=this.getCursor()||"grab";this._removeEventListeners({include:["click"]}),this.setCursor("crosshair");const o=()=>{this.setCursor(i),this._addEventsListeners({include:["click"]}),this.mapAdapter.emitter.off("click",r),this._coordFromMapClickAbort=void 0},r=e=>{o(),it(e),t(e.lngLat)};this.mapAdapter.emitter.once("click",r),this._coordFromMapClickAbort=o})}_emitStatusEvent(t,e){const i=t;this._eventsStatus[i]=!0,this.emitter.emit(i,e)}_addLayerProviders(){return Bi(this,null,function*(){})}_onLoadSync(){return Bi(this,null,function*(){})}_setupMap(){return Bi(this,null,function*(){if(!this.mapAdapter)throw new Error("WebMap `mapAdapter` option is not set");return yield this.mapAdapter.create(this.options),this._zoomToInitialExtent(),yield this._addLayerProviders(),yield this._onLoadSync(),this._emitStatusEvent("build-map",this.mapAdapter),this})}_setTileJsonOptions(t){t.center&&(this.options.center=t.center),t.bounds&&(this.options.bounds=t.bounds),tt(t.maxzoom)&&(this.options.zoom=t.maxzoom),tt(t.minzoom)&&(this.options.zoom=t.minzoom),tt(t.maxzoom)&&tt(t.minzoom)&&(this.options.zoom=(t.maxzoom+t.minzoom)/2)}_zoomToInitialExtent(){const{center:t,zoom:e,bounds:i}=this.options;this._extent?this.fitBounds(this._extent):t&&e?this.setView(t,e):i&&(this.fitBounds(i),void 0!==e&&this.setZoom(e))}_setInitMapState(t){for(const e of t){const t=new e(this);this.mapState.push(t);for(const e of this.runtimeParams){const i=e.get(t.name);if(void 0!==i){const e=t.parse(i);this._initMapState[t.name]=e,Object.defineProperty(this.options,t.name,{value:e,configurable:!0,enumerable:!0});break}}}}_addEventsListeners(t){let e=["preclick","click","zoomstart","zoom","zoomend","movestart","move","moveend","mousemove","mouseout","mouseover"];t&&t.include&&(e=e.filter(e=>t.include.includes(e))),e.forEach(t=>{this._mapEvents[t]=e=>{if(this.runtimeParams.length){this.mapState.filter(e=>e.event.includes(t)).forEach(t=>{const e=t.toString();this.runtimeParams.forEach(i=>{i.set(t.name,e)})})}this._eventsStatus&&this.emitter.emit(t,e)};const e=this._mapEvents[t];e&&this.mapAdapter.emitter.on(t,e)})}_removeEventListeners(t){let e=Object.entries(this._mapEvents);t&&t.include&&(e=e.filter(e=>t.include.includes(e[0]))),e.forEach(([t,e])=>{e&&this.mapAdapter.emitter.removeListener(t,e)})}};ji(Ni,"keys",new class{constructor(){wi(this,"keyCodeAlias",new bi),wi(this,"keys",{}),wi(this,"_windowOnFocus"),wi(this,"_keysPressed"),wi(this,"_keysReleased"),this._windowOnFocus=this.windowOnFocus.bind(this),this._keysPressed=this.keysPressed.bind(this),this._keysReleased=this.keysReleased.bind(this),this.addKeyboardEventsListener()}pressed(t){const e=this.keyCodeAlias[t];return!!e&&this.keys[e]}addKeyboardEventsListener(){"undefined"!=typeof window&&(window.addEventListener("focus",this._windowOnFocus,!1),window.addEventListener("keydown",this._keysPressed,!1),window.addEventListener("keyup",this._keysReleased,!1))}removeKeyboardEventsListener(){"undefined"!=typeof window&&(window.removeEventListener("focus",this._windowOnFocus,!1),window.removeEventListener("keydown",this._keysPressed,!1),window.removeEventListener("keyup",this._keysReleased,!1))}keysPressed(t){t.stopPropagation(),this.keys[t.keyCode]||(this.keys[t.keyCode]=!0)}keysReleased(t){t.stopPropagation(),this.keys[t.keyCode]=!1}windowOnFocus(){this.keys={}}}),ji(Ni,"getPaintFunctions");let Ri=Ni;var qi=Object.defineProperty,Fi=Object.defineProperties,Ui=Object.getOwnPropertyDescriptors,Wi=Object.getOwnPropertySymbols,Hi=Object.prototype.hasOwnProperty,Vi=Object.prototype.propertyIsEnumerable,Gi=(t,e,i)=>e in t?qi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ji=(t,e)=>{for(var i in e||(e={}))Hi.call(e,i)&&Gi(t,i,e[i]);if(Wi)for(var i of Wi(e))Vi.call(e,i)&&Gi(t,i,e[i]);return t},Ki=(t,e)=>Fi(t,Ui(e)),Yi=(t,e,i)=>Gi(t,"symbol"!=typeof e?e+"":e,i),$i=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});class Qi extends Ri{constructor(t){super(t),Yi(this,"_layersIdCounter",1),Yi(this,"_layersOrderCounter",1),Yi(this,"_baselayers",[]),Yi(this,"_layers",{}),Yi(this,"_selectedLayers",[]);const e=this.options.tileJson;e&&this.emitter.once("build-map",()=>this.addTileJsonLayer(e))}fitLayer(t,e){return $i(this,null,function*(){const i=this.getLayer(t),o=i&&(i.getBounds||i.getExtent);if(o){const t=yield o.call(i);t&&this.fitBounds(t,e)}})}isBaseLayer(t){const e=this.getLayer(t);if(e&&e.id)return-1!==this._baselayers.indexOf(e.id)}getBaseLayers(){const t=[];return this._baselayers.forEach(e=>{const i=this._layers[e];i&&t.push(i)}),t}getBaseLayersIds(){return this._baselayers}getLayer(t){return"string"==typeof t?this._layers[t]:t}getLayerId(t){const e=this.getLayer(t);if(e){if(e.id)return null==e?void 0:e.id;if(e&&e.options)return e.options.id}throw new Error("No id for layer")}getLayers(){return Object.keys(this._layers)}allLayers(){return this._layers}orderedLayers(){return Object.values(this._layers).sort((t,e)=>t.order&&e.order?t.order-e.order:0)}findLayer(t){for(const e in this._layers){const i=this._layers[e];if(t(i))return i}}isLayerVisible(t){const e=this.getLayer(t);return!(!e||void 0===e.options.visibility)&&e.options.visibility}addBaseLayer(t,e){return $i(this,null,function*(){return yield this.addLayer(t,Ki(Ji({},e),{baselayer:!0}),void 0)})}addLayer(t){return $i(this,arguments,function*(t,e={},i){var o,r;const n=this._layersIdCounter++,s=tt(i)?i:void 0!==e.order?e.order:this.reserveOrder();let a;"string"==typeof t?a=this.getLayerAdapter(t):"function"==typeof t?a=t:"then"in t&&(a=yield t);const l=e;this._updateGeoJsonOptions(l);const c=null==(o=(e=Ji({id:String(n),order:s},e)).visibility)||o;if(e.visibility=!1,e.baselayer&&(e.order=0),this.options.onBeforeAddLayer){const t=this.options.onBeforeAddLayer({options:e,adapter:a});t&&(t.options&&(e=t.options),t.adapter&&(a=t.adapter))}if(e=Ki(Ji({},e),{request:this._getLayerRequestOptions(e)}),void 0!==a){const t=new a(this.mapAdapter.map,e);let i;t.options=Ji(Ji({},e),t.options),t.options.baselayer&&(e.baselayer=!0,e.order=0,t.options.order=0),t.options.id&&(i=String(t.options.id),this._layers[i]=t),this._emitLayerEvent("layer:preadd",i||"",t),yield this.onMapLoad(),t.map=this.mapAdapter.map;const o=yield t.addLayer(t.options);if(t.layer=o,t.id=t.options.id||String(n),t.options.id=t.id,e.baselayer&&(t.options.order=0),t.order=null!=(r=t.options.order)?r:s,i&&delete this._layers[i],i=String(t.id),this._layers[i])throw Error(`layer with id '${i}' already exist`);i&&(this._layers[i]=t,l.filter&&this.filterLayer(t,l.filter),e.baselayer&&this._baselayers.push(i),c&&(yield this.showLayer(i)));const h=e.opacity;null!=h&&h<=1&&this.setLayerOpacity(t,h);const u=o&&(t.getBounds||t.getExtent);if(e.fit&&u){const e=yield u.call(t);e&&(yield this.fitBounds(e))}return e.onAdded&&e.onAdded(t),this._emitLayerEvent("layer:add",i,t),t}return Promise.reject("No adapter")})}addLayerFromAsyncAdapter(t,e,i){return $i(this,null,function*(){const o=i||void 0!==e.order?e.order:this.reserveOrder(),r=t(),n=yield r;return n?this.addLayer(n,e,o):Promise.reject("No adapter")})}removeLayers(t){for(const e in this._layers){let i=!0;t&&(i=t(e,this._layers[e])),i&&(this.removeLayer(e),delete this._layers[e])}}getLegend(t){return $i(this,null,function*(){const e=[];for(const i of this.orderedLayers())i.getLegend&&e.push(i.getLegend(t));return(yield Promise.all(e)).flat()})}reserveOrder(){return this._layersOrderCounter++}removeOverlays(){this.removeLayers((t,e)=>!(e&&e.options&&e.options.baselayer))}removeLayer(t){const e=this.getLayer(t),i=e&&this.getLayerId(e);if(e&&i){if(this.emitter.emit("layer:preremove",e),e.beforeRemove&&e.beforeRemove(),e.removeLayer?e.removeLayer():this.mapAdapter.removeLayer(e.layer),e.options&&e.options.baselayer){const t=this._baselayers.indexOf(i);t&&this._baselayers.splice(t,1)}delete this._layers[i],this.emitter.emit("layer:remove",e)}}addGeoJsonLayer(t={},e){return(t=t||{}).multiselect=void 0!==t.multiselect&&t.multiselect,t.unselectOnSecondClick=void 0===t.unselectOnSecondClick||t.unselectOnSecondClick,e||(t=gi(t)),t.paint=t.paint||{},this.addLayer(e||"GEOJSON",t)}addFeatureLayer(t={}){return this.addGeoJsonLayer(t)}addTileLayer(t,e={}){return this.addLayer("TILE",Ki(Ji({},e),{url:t}))}addImageLayer(t,e){let i;return"string"==typeof t?i=t:(i=t.url,e=t),this.addLayer("IMAGE",Ki(Ji({},e),{url:i}))}showLayer(t,e={}){return this.toggleLayer(t,!0,e)}hideLayer(t,e={}){return this.toggleLayer(t,!1,e)}toggleLayer(t,e,i={}){const o=this.getLayer(t),r=void 0!==e?e:!(o&&o.options.visibility),n=void 0!==i.silent&&i.silent,s=t=>$i(this,null,function*(){const e=String(t.id),i=r?"layer:show":"layer:hide";if(n||(this._emitLayerEvent(r?"layer:preshow":"layer:prehide",e,t),this._emitLayerEvent("layer:pretoggle",e,t)),r&&this.mapAdapter){const e=t.options.baselayer?0:t.options.order;if(t.options.baselayer&&this._baselayers.length){const e=this._baselayers.filter(e=>e!==t.id&&this.isLayerVisible(e));for(const t of e)yield this.hideLayer(t)}t.showLayer?yield t.showLayer.call(t,t.layer):void 0!==t.layer&&(yield this.mapAdapter.showLayer(t.layer)),void 0!==e&&this.mapAdapter.setLayerOrder(t.layer,e,this._layers)}else t.hideLayer?yield t.hideLayer.call(t,t.layer):void 0!==t.layer&&(yield this.mapAdapter.hideLayer(t.layer));t.options.visibility=r,n||(this._emitLayerEvent(i,e,t),this._emitLayerEvent("layer:toggle",e,t))});return o?this.onMapLoad().then(()=>s(o)):Promise.resolve()}updateLayer(t,e){const i=this.getLayer(t);if(i){if(i.updateLayer)return Promise.resolve(i.updateLayer(e));if(this.isLayerVisible(i))return this.hideLayer(i,{silent:!0}).then(()=>this.showLayer(i,{silent:!0}))}return Promise.resolve()}setLayerOpacity(t,e){const i=this.getLayer(t);i&&(i.setOpacity?i.setOpacity(e):this.mapAdapter.setLayerOpacity&&this.mapAdapter.setLayerOpacity(i.layer,e))}isLayerLabelVisible(t){var e;const i=this.getLayer(t);return i.isLabelVisible?i.isLabelVisible():null==(e=i.options.labelVisibility)||e}showLayerLabel(t){this.toggleLayerLabel(t,!0)}hideLayerLabel(t){this.toggleLayerLabel(t,!1)}toggleLayerLabel(t,e){const i=this.getLayer(t);return e=null!=e?e:!this.isLayerLabelVisible(t),i&&(e?i.showLabel&&(i.options.labelVisibility=!0,i.showLabel()):i.hideLabel&&(i.options.labelVisibility=!1,i.hideLabel()),i.id&&this._emitLayerEvent("layer:label:toggle",i.id,i)),e}selectLayer(t,e){const i=this.getLayer(t);if(i){i&&i.select&&i.select(e);const t=this.getLayerId(i);t&&this._selectedLayers.push(t)}}unSelectLayer(t,e){const i=this.getLayer(t);if(i){const t=i&&i;t.unselect&&t.unselect(e);const o=this.getLayerId(i);if(o){const t=this._selectedLayers.indexOf(o);-1!==t&&this._selectedLayers.splice(t,1)}}}unSelectLayers(){const t=Object.values(this.allLayers());let e;for(e of t)e.unselect&&e.unselect()}filterLayer(t,e){const i=this.getLayer(t);return i.filter?i.filter(e):[]}propertiesFilter(t,e,i){const o=this.getLayer(t);if(o){const t=o;if(t.propertiesFilter)return t.propertiesFilter(e,i);t.filter&&this.filterLayer(t,t=>!e||(!t.feature||!t.feature.properties||Oe(t.feature.properties,e)))}return Promise.resolve()}removeLayerFilter(t){const e=this.getLayer(t);e.removeFilter?e.removeFilter():e.filter&&e.filter(()=>!0)}setLayerData(t,e){const i=this.getLayer(t);if(i){if(i.setData)return i.setData(e);if(i.clearLayer&&i.addData)return i.clearLayer(),i.addData(e)}return Promise.resolve()}addLayerData(t,e){const i=this.getLayer(t);i.addData&&i.addData(e)}clearLayerData(t,e){const i=this.getLayer(t);i&&i.clearLayer&&i.clearLayer(e)}setLayerPaint(t,e){const i=this.getLayer(t);e&&i&&i.setPaint&&i.setPaint(e)}setLayerSelectedPaint(t,e){const i=this.getLayer(t);e&&i&&i.setSelectedPaint&&i.setSelectedPaint(e)}updateLayerPaint(t,e){const i=this.getLayer(t);e&&i&&i.updatePaint&&i.updatePaint(e)}updateLayerSelectedPaint(t,e){const i=this.getLayer(t);e&&i&&i.updateSelectedPaint&&i.updateSelectedPaint(e)}getAttributions(t){const e=[];for(const i in this._layers){const o=this._layers[i];let r=!(void 0===t.onlyVisible||t.onlyVisible)||o.options.visibility;if(r&&t.onlyBaselayer&&(r=this._baselayers.includes(i)),r){const t=o.options&&o.options.attribution;t&&e.push(t)}}return e}getActiveBaseLayer(){const t=this.getBaseLayers().find(t=>this.isLayerVisible(t));if(t)return this.getLayer(t)}addTileJsonLayer(t){return this.addLayer("TILE",{url:t.tiles[0],maxZoom:t.maxzoom,minZoom:t.minzoom,subdomains:t.scheme,attribution:t.attribution,request:t.request})}_getLayerRequestOptions(t){var e,i,o,r;const n=ui(this.options.layerRequest),s=pi(t),a=Ji(Ji({},(null==n?void 0:n.headers)||{}),(null==s?void 0:s.headers)||{}),l=!1===t.withCredentials&&void 0===(null==(e=t.request)?void 0:e.credentials)&&void 0!==(null==n?void 0:n.credentials)?"same-origin":null!=(i=null==s?void 0:s.credentials)?i:null==n?void 0:n.credentials,c=void 0!==(null==(o=t.request)?void 0:o.cache)?t.request.cache:null!=(r=null==s?void 0:s.cache)?r:null==n?void 0:n.cache;return ui(Ji(Ji(Ji(Ji(Ji({},n),s),Object.keys(a).length?{headers:a}:{}),void 0!==l?{credentials:l}:{}),void 0!==c?{cache:c}:{}))}_emitLayerEvent(t,e,i){const o=String(t);if(tt(e)&&o.startsWith("layer:")){const t=o.replace("layer:","layer-"+e+":");this.emitter.emit(t,i)}this.emitter.emit(t,i)}_onLayerClick(t){return $i(this,null,function*(){return this._emitLayerEvent("layer:click",t.layer.id||"",t),Promise.resolve(t)})}_onLayerDoubleClick(t){return $i(this,null,function*(){return this._emitLayerEvent("layer:dblclick",t.layer.id||"",t),Promise.resolve(t)})}_onLayerSelect(t){return $i(this,null,function*(){return this._emitLayerEvent("layer:select",t.layer.id||"",t),Promise.resolve(t)})}_updateGeoJsonOptions(t){const{onSelect:e,onLayerSelect:i,onClick:o,onDoubleClick:r,onLayerClick:n,onMouseOut:s,onMouseOver:a}=t,l=o||n,c=r||n;t.onClick=t=>(l&&l(t),this._onLayerClick(t)),t.onDoubleClick=t=>(c&&c(t),this._onLayerDoubleClick(t)),t.onMouseOut=t=>{const e=t.layer.id;s&&s(t),tt(e)&&this._emitLayerEvent("layer:mouseout",e,t)},t.onMouseOver=t=>{const e=t.layer.id;a&&a(t),tt(e)&&this._emitLayerEvent("layer:mouseover",e,t)};const h=e||i;t.onSelect=t=>(h&&h(t),this._onLayerSelect(t)),t.nativePaint||(this.options.paint&&(t.paint=Ze({paint:t.paint||{},defaultPaint:this.options.paint,getPaintFunctions:this.getPaintFunctions})),t.selectedPaint&&this.options.selectedPaint&&(t.selectedPaint=Ze({paint:t.selectedPaint,defaultPaint:this.options.selectedPaint,getPaintFunctions:this.getPaintFunctions})))}}var Xi=Object.defineProperty,to=Object.getOwnPropertySymbols,eo=Object.prototype.hasOwnProperty,io=Object.prototype.propertyIsEnumerable,oo=(t,e,i)=>((t,e,i)=>e in t?Xi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),ro=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});const no=class t extends Qi{constructor(){super(...arguments),oo(this,"_loadControlQueue",{"top-right":[],"bottom-right":[],"top-left":[],"bottom-left":[],inside:[]}),oo(this,"_isControlLoading",{"top-right":!1,"bottom-right":!1,"top-left":!1,"bottom-left":!1,inside:!1})}addControl(t,e,i){return ro(this,null,function*(){let o;const{addOptions:r,createOptions:n}=this._splitControlOptions(i);if(e=null!=e?e:"top-left",o="string"==typeof t?this.getControl(t,n):t,o)return new Promise(t=>{this._setControlQueue(this._getControlQueueKey(e),()=>ro(this,null,function*(){const i=yield o,n=this.mapAdapter.addControl(i,e,r);t(n)}))})})}createControl(t,e){return ro(this,null,function*(){if(yield this.onLoad("build-map"),this.mapAdapter.createControl)return this.mapAdapter.createControl(t,e)})}createButtonControl(t){return ro(this,null,function*(){if(yield this.onLoad("build-map"),this.mapAdapter.createButtonControl)return this.mapAdapter.createButtonControl(t)})}createToggleControl(t){return ro(this,null,function*(){return yield this.onLoad("build-map"),this.mapAdapter.createToggleControl?this.mapAdapter.createToggleControl(t):this.mapAdapter.createButtonControl?function(t,e){const i=document.createElement("div"),o=new Set;let r=!1;e.getStatus?r=e.getStatus():e.status&&(r=e.status);const n=e.title||"",s=e.html;function a(){n&&(i.title="string"==typeof n?n:r?n.on:n.off,i.setAttribute("aria-label",i.title))}function l(t){t instanceof HTMLElement?(i.innerHTML="",i.appendChild(t)):"string"==typeof t&&(i.innerHTML=t)}function c(){s&&("string"==typeof s||s instanceof HTMLElement?l(s):l(r?s.on:s.off),i.setAttribute("aria-label",i.title))}function h(t,e){t.split(" ").forEach(t=>{e?i.classList.add(t):i.classList.remove(t)})}function u(){e.addClassOn&&h(e.addClassOn,r),e.addClassOff&&h(e.addClassOff,!r)}function p(t){o.forEach(e=>e(r,t))}a(),c(),e.addClass&&h(e.addClass,!0),u();const d=t=>{void 0!==t&&(r=t),c(),a(),u()},f=t=>{if(void 0===t&&r&&m.disableOnSecondClick)return;const i=r;if(r=void 0!==t?t:!r,e.onClick){let t;try{t=e.onClick(r)}catch(o){throw r=i,d(),o}Promise.resolve(t).then(()=>{d(),i!==r&&p(m)}).catch(()=>{r=i,d()})}else d(),i!==r&&p(m)},m=t({html:i,onClick:f});return m.onClick=f,m.changeStatus=d,m.getStatus=()=>r,m.switch=e.switch,void 0!==e.disableOnSecondClick&&(m.disableOnSecondClick=e.disableOnSecondClick),m.onStatusChange=t=>(o.add(t),()=>o.delete(t)),m}(this.mapAdapter.createButtonControl,t):void 0})}removeControl(t){"remove"in t?t.remove():this.mapAdapter.removeControl&&Promise.resolve(t).then(t=>{this.mapAdapter.removeControl(t)})}getControl(e,i){const o=this.mapAdapter.controlAdapters[e];if(o)return new o(i);{const o=t.controls[e];if(o)return o(this,i)}}getControlContainer(){if(this.mapAdapter.getControlContainer)return this.mapAdapter.getControlContainer()}_getControlQueueKey(t){return"string"==typeof t?t:"inside"}_setControlQueue(t,e){this._loadControlQueue[t].push(e),this._isControlLoading[t]||this._applyControls(t)}_applyControls(t){return ro(this,null,function*(){if(this._loadControlQueue[t].length){this._isControlLoading[t]=!0;const e=this._loadControlQueue[t][0];yield e(),this._loadControlQueue[t].splice(0,1),this._applyControls(t)}else this._isControlLoading[t]=!1})}_splitControlOptions(t){if(!t)return{};const e=t,{id:i,order:o}=e,r=((t,e)=>{var i={};for(var o in t)eo.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&to)for(var o of to(t))e.indexOf(o)<0&&io.call(t,o)&&(i[o]=t[o]);return i})(e,["id","order"]);return{addOptions:this._getAddControlOptions(i,o),createOptions:r}}_getAddControlOptions(t,e){return void 0!==t||void 0!==e?{id:t,order:e}:void 0}};oo(no,"controls",{CONTROL:(t,e)=>t.createControl(e.control,e.options),BUTTON:(t,e)=>t.createButtonControl(e),TOGGLE:(t,e)=>t.createToggleControl(e)});let so=no;var ao=Object.defineProperty,lo=Object.defineProperties,co=Object.getOwnPropertyDescriptors,ho=Object.getOwnPropertySymbols,uo=Object.prototype.hasOwnProperty,po=Object.prototype.propertyIsEnumerable,fo=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),mo=(t,e,i)=>e in t?ao(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,go=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())}),yo=(t,e,i)=>(e=t[fo("asyncIterator")])?e.call(t):(t=t[fo("iterator")](),e={},(i=(i,o)=>(o=t[i])&&(e[i]=e=>new Promise((i,r,n)=>(e=o.call(t,e),n=e.done,Promise.resolve(e.value).then(t=>i({value:t,done:n}),r)))))("next"),i("return"),e);class _o extends so{constructor(t){super(t),this._addControls(),oi[this.id]=this}static get(t){return function(t){return oi[t]}(t)}_addLayerProviders(){return go(this,null,function*(){try{for(var t,e,i,o=yo(this._starterKits);t=!(e=yield o.next()).done;t=!1){const t=e.value;if(t.getLayerAdapters){const e=yield t.getLayerAdapters.call(t);if(e)try{for(var r,n,s,a=yo(e);r=!(n=yield a.next()).done;r=!1){const t=n.value,e=yield t.createAdapter(this);e&&(this.mapAdapter.layerAdapters[t.name]=e)}}catch(n){s=[n]}finally{try{r&&(n=a.return)&&(yield n.call(a))}finally{if(s)throw s[0]}}}}}catch(e){i=[e]}finally{try{t&&(e=o.return)&&(yield e.call(o))}finally{if(i)throw i[0]}}})}_onLoadSync(){return go(this,null,function*(){try{for(var t,e,i,o=yo(this._starterKits);t=!(e=yield o.next()).done;t=!1){const t=e.value;if(t.onLoadSync)try{yield t.onLoadSync.call(t,this)}catch(r){console.error(r)}}}catch(e){i=[e]}finally{try{t&&(e=o.return)&&(yield e.call(o))}finally{if(i)throw i[0]}}})}_addControls(){this.options.controls&&this.options.controls.forEach(t=>{let e=t,i={};"string"==typeof t&&this.options.controlsOptions&&this.options.controlsOptions[t]&&(i=this.options.controlsOptions[t],void 0!==i.control&&(e=i.control));const o=i,{id:r,order:n,position:s}=o,a=((t,e)=>{var i={};for(var o in t)uo.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&ho)for(var o of ho(t))e.indexOf(o)<0&&po.call(t,o)&&(i[o]=t[o]);return i})(o,["id","order","position"]);var l;this.addControl(e,s||"top-left",(l=((t,e)=>{for(var i in e||(e={}))uo.call(e,i)&&mo(t,i,e[i]);if(ho)for(var i of ho(e))po.call(e,i)&&mo(t,i,e[i]);return t})({},a),lo(l,co({id:r,order:n}))))}),this._emitStatusEvent("controls:create")}}function bo({src:t,headers:e,withCredentials:i,request:o}){const r=pi({headers:e,request:o,withCredentials:i}),n=(null==r?void 0:r.headers)||{},s=new AbortController;return[fetch(t,{cache:null==r?void 0:r.cache,credentials:null==r?void 0:r.credentials,headers:n,signal:s.signal}).then(t=>{if(!t.ok)throw new Error(t.statusText);return t.blob()}).then(t=>(window.URL||window.webkitURL).createObjectURL(t)).catch(t=>{if("AbortError"===t.name)return"";throw t}),()=>{s.abort()}]}var vo=Object.defineProperty,wo=(t,e,i)=>((t,e,i)=>e in t?vo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);const xo=new class{constructor({concurrency:t=1,delay:e=0}={}){wo(this,"queue",[]),wo(this,"concurrency"),wo(this,"activeCount",0),wo(this,"timeoutId"),wo(this,"delay"),wo(this,"toAbort",[]),this.concurrency=t,this.delay=e}add(t,e){this.queue.push({promise:t,abort:e}),this.debouncedNext()}abort(){for(const t of this.toAbort)t();this.toAbort=[],this.queue=[],this._clearTimeout()}debouncedNext(){this._clearTimeout(),this.timeoutId=setTimeout(()=>this._next(),this.delay)}_clearTimeout(){this.timeoutId&&clearTimeout(this.timeoutId)}_next(){for(;this.activeCount<this.concurrency&&this.queue.length>0;){const{promise:t,abort:e}=this.queue.shift();this.activeCount++;let i,o=e;const r=t();Array.isArray(r)?(i=r[0],o=r[1]):i=r,o&&this.toAbort.push(o),i.finally(()=>{this.activeCount--,o&&(this.toAbort=this.toAbort.filter(t=>t!==o)),this.debouncedNext()})}}}({concurrency:6,delay:200});var Po=Object.defineProperty,Lo=(t,e,i)=>((t,e,i)=>e in t?Po(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class Oo extends P.ImageOverlay{constructor(t,e,i){super(t,e,i),Lo(this,"_aborter")}cancelLoad(){this._aborter&&(this._aborter(),this._aborter=void 0)}_initImage(){super._initImage();const{headers:t,request:e,withCredentials:i}=this.options,o=this._image,r=o.src;o.src="",xo.add(()=>{const[n,s]=bo({src:r,headers:t,request:e,withCredentials:i});return n.then(t=>{o.src=t}),this._aborter=s,n})}}var Co=Object.defineProperty,ko=(t,e,i)=>((t,e,i)=>e in t?Co(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Eo extends P.Layer{constructor(t,e){super(e),ko(this,"defaultWmsParams",{request:"GetMap"}),ko(this,"options",{crs:null,uppercase:!1,attribution:"",opacity:1,isBack:!1,minZoom:0,maxZoom:void 0,pane:"tilePane",headers:null,withCredentials:!1,viewPortBuffer:0,setViewDelay:100}),ko(this,"wmsParams"),ko(this,"_url"),ko(this,"_currentUrl"),ko(this,"_currentOverlay"),ko(this,"_loadedOverlay"),this._url=t;const i={},o={};let r;for(r in e){r in this.options&&(o[r]=e[r])}if(e.params)for(const n in e.params){const t=e.params[n];pt(t)||Array.isArray(t)||"function"==typeof t||(i[n]=t)}P.Util.setOptions(this,o),this.wmsParams=P.Util.extend({},this.defaultWmsParams,i)}setParams(t){P.Util.extend(this.wmsParams,t),this.update()}getAttribution(){return this.options.attribution||""}onAdd(){return this.update(),this}onRemove(t){return this._currentOverlay&&(this._currentOverlay.cancelLoad(),t.removeLayer(this._currentOverlay),delete this._currentOverlay),this._currentUrl&&delete this._currentUrl,this}getEvents(){return{moveend:Q(this.update,this.options.setViewDelay)}}update(){if(!this._map)return;this.updateWmsParams();const t=this.getImageUrl();if(this._currentUrl===t)return;this._currentUrl=t;const e=this.options.viewPortBuffer||0,i=this._map.getBounds().pad(e);this._loadedOverlay&&(this._loadedOverlay.cancelLoad(),this._loadedOverlay.off("load"),this._loadedOverlay=void 0);const o=new Oo(t,i,{opacity:0,pane:this.options.pane,headers:this.options.headers,request:this.options.request,withCredentials:this.options.withCredentials});o.addTo(this._map),this._loadedOverlay=o,o.once("load",()=>{this._map&&(o._url===this._currentUrl?(this._currentOverlay&&this._map.removeLayer(this._currentOverlay),this._loadedOverlay=void 0,this._currentOverlay=o,o.setOpacity(void 0!==this.options.opacity?this.options.opacity:1),!0===this.options.isBack&&o.bringToBack(),!1===this.options.isBack&&o.bringToFront(),void 0!==this.options.zIndex&&o.setZIndex(this.options.zIndex)):this._map.removeLayer(o))},this);const{minZoom:r,maxZoom:n}=this.options;(r&&this._map.getZoom()<r||n&&this._map.getZoom()>n)&&this._map.removeLayer(o)}setOpacity(t){this.options.opacity=t,this._currentOverlay&&this._currentOverlay.setOpacity(t)}bringToBack(){this.options.isBack=!0,this._currentOverlay&&this._currentOverlay.bringToBack()}bringToFront(){this.options.isBack=!1,this._currentOverlay&&this._currentOverlay.bringToFront()}setZIndex(t){this.options.zIndex=t,this._currentOverlay&&this._currentOverlay.setZIndex(t)}updateWmsParams(t){t||(t=this._map);const e=this.options.viewPortBuffer||0,i=t.getBounds().pad(e),o=t.getSize();if(0!==this.options.viewPortBuffer){const t=e+1;o.x=Math.ceil(o.x*t),o.y=Math.ceil(o.y*t)}const r=this.options.crs||t.options.crs;if(r){const t=r.project(i.getNorthWest()),e=r.project(i.getSouthEast()),n={width:o.x,height:o.y};n.bbox=[t.x,e.y,e.x,t.y],P.Util.extend(this.wmsParams,n)}}getImageUrl(){const t=P.Util.getParamString(this.wmsParams,this._url,this.options.uppercase||!1);return this._url+t}}var Mo=Object.defineProperty,Ao=Object.defineProperties,So=Object.getOwnPropertyDescriptors,To=Object.getOwnPropertySymbols,Io=Object.prototype.hasOwnProperty,zo=Object.prototype.propertyIsEnumerable,jo=(t,e,i)=>e in t?Mo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Bo=(t,e)=>{for(var i in e||(e={}))Io.call(e,i)&&jo(t,i,e[i]);if(To)for(var i of To(e))zo.call(e,i)&&jo(t,i,e[i]);return t},Zo=(t,e)=>Ao(t,So(e)),Do=(t,e,i)=>jo(t,"symbol"!=typeof e?e+"":e,i);class No extends Ot{constructor(){super(...arguments),Do(this,"layer")}addLayer(t){var e;const i=t&&t.url;if(i){const o=t.updateWmsParams,r=pi(t);if(this.layer=new Eo(i,Zo(Bo(Bo(Bo({pane:this.pane,setViewDelay:t.setViewDelay},Zo(Bo({transparent:!0},t),{opacity:null!=(e=t.opacity)?e:void 0})),t.params),t.nativeOptions),{request:r})),o){const t=this.layer.updateWmsParams;this.layer.updateWmsParams=function(e){t.call(this,e),this.wmsParams=o(this.wmsParams)}}return this.layer}}updateLayer(t){if(this.layer){P.Util.extend(this.layer.wmsParams,(null==t?void 0:t.params)||{}),this.layer.update()}}}function Ro(t){return class extends t{constructor(...t){super(...t),this.options.setViewDelay&&(this._update=Q((...t)=>{P.GridLayer.prototype._update.call(this,...t)},this.options.setViewDelay))}createTile(t,e){const i=this.getTileUrl(t),o=document.createElement("img"),[r,n]=bo({src:i,withCredentials:this.options.withCredentials,headers:this.options.headers,request:this.options.request});return r.then(t=>{o.src=t,e(null,o)}),o.abort=n,(this.options.crossOrigin||""===this.options.crossOrigin)&&(o.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),o.alt="",o.setAttribute("role","presentation"),o}_abortLoading(){const t=this._tiles,e=this._tileZoom;for(const i in t)if(t[i].coords.z!==e){const e=t[i].el;e.onload=P.Util.falseFn,e.onerror=P.Util.falseFn,e.complete||(e.abort&&e.abort(),e.src=P.Util.emptyImageUrl,P.DomUtil.remove(e),delete t[i])}}}}Do(No,"queue",xo);const qo=Ro(class extends P.TileLayer{constructor(t,e){super(t,e),Object.assign(this.options,e)}});var Fo=Object.defineProperty,Uo=Object.defineProperties,Wo=Object.getOwnPropertyDescriptors,Ho=Object.getOwnPropertySymbols,Vo=Object.prototype.hasOwnProperty,Go=Object.prototype.propertyIsEnumerable,Jo=(t,e,i)=>e in t?Fo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ko=(t,e)=>{for(var i in e||(e={}))Vo.call(e,i)&&Jo(t,i,e[i]);if(Ho)for(var i of Ho(e))Go.call(e,i)&&Jo(t,i,e[i]);return t};class Yo extends Ot{addLayer(t){if(this.options=Object.assign(this.options,t),t){const i=t,{url:o}=i,r=((t,e)=>{var i={};for(var o in t)Vo.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&Ho)for(var o of Ho(t))e.indexOf(o)<0&&Go.call(t,o)&&(i[o]=t[o]);return i})(i,["url"]);if(o){const t=Ko({pane:this.pane,attribution:r.attribution,minZoom:r.minZoom,maxZoom:r.maxZoom},r.nativeOptions);let i;r.subdomains&&(t.subdomains=r.subdomains);const n=pi(r);return i=n?new qo(o,(e=Ko({},t),Uo(e,Wo({request:n,setViewDelay:r.setViewDelay})))):new P.TileLayer(o,t),i}}var e}updateLayer(t){if(this.layer){(null==t?void 0:t.params)&&this.layer.setUrl(ft(this.layer._url,t.params)),this.layer.redraw()}}}var $o=Object.defineProperty,Qo=Object.defineProperties,Xo=Object.getOwnPropertyDescriptors,tr=Object.getOwnPropertySymbols,er=Object.prototype.hasOwnProperty,ir=Object.prototype.propertyIsEnumerable,or=(t,e,i)=>e in t?$o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;const rr=Ro(class extends P.TileLayer.WMS{constructor(t,e){super(t,e)}});var nr=Object.defineProperty,sr=Object.defineProperties,ar=Object.getOwnPropertyDescriptors,lr=Object.getOwnPropertySymbols,cr=Object.prototype.hasOwnProperty,hr=Object.prototype.propertyIsEnumerable,ur=(t,e,i)=>e in t?nr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,pr=(t,e)=>{for(var i in e||(e={}))cr.call(e,i)&&ur(t,i,e[i]);if(lr)for(var i of lr(e))hr.call(e,i)&&ur(t,i,e[i]);return t};function dr(t){return[[t[3],t[0]],[t[1],t[2]]]}var fr=Object.defineProperty,mr=Object.getOwnPropertySymbols,gr=Object.prototype.hasOwnProperty,yr=Object.prototype.propertyIsEnumerable,_r=(t,e,i)=>e in t?fr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,br=(t,e)=>{for(var i in e||(e={}))gr.call(e,i)&&_r(t,i,e[i]);if(mr)for(var i of mr(e))yr.call(e,i)&&_r(t,i,e[i]);return t},vr=(t,e,i)=>_r(t,"symbol"!=typeof e?e+"":e,i);const wr=class t{constructor(){vr(this,"options",{target:"map"}),vr(this,"layerAdapters",t.layerAdapters),vr(this,"controlAdapters",t.controlAdapters),vr(this,"emitter",new H),vr(this,"map"),vr(this,"_resizeObserver"),vr(this,"_controlContainer"),vr(this,"_unselectCb",[]),vr(this,"_universalEvents",["move","zoom","zoomend","zoomstart","moveend","movestart"]),vr(this,"_positionEvents",["mousemove","mouseout","mouseover"])}create(t){if(this.options=br({},t),this.options.target){const{zoom:t,center:e,maxZoom:i,minZoom:o,maxBounds:r,mapAdapterOptions:n}=this.options;this.map=this.options.map||new P.Map(this.options.target,br({attributionControl:!1,zoomControl:!1,maxBounds:r?dr(r):void 0,zoomSnap:0,maxZoom:i,minZoom:o,center:e&&[e[1],e[0]],zoom:t},n)),this._updateMinZoomForBounds(o),this._watchSizeChangeToUpdateMinZoom();const s=this.map.createPane("order-0");this._controlContainer=new U(this.map),this.map._addUnselectCb=t=>{this._addUnselectCb(t)},s.style.zIndex=String(0),this.emitter.emit("create",this),this._addMapListeners()}}destroy(){this.map&&this.map.remove(),this._controlContainer&&(this._controlContainer.detach(),this._controlContainer=void 0),this._stopWatchSizeChangeToUpdateMinZoom()}getContainer(){return this.map&&this.map.getContainer()}getControlContainer(){if(this._controlContainer)return this._controlContainer.getContainer();const t=this.map&&this.map._controlContainer;if(t)return t;throw new Error("Leaflet Map is not initialized yet")}setCursor(t){this.map&&(this.map.getContainer().style.cursor=t)}setView(t,e){const i=this.map;if(i)if(Array.isArray(t)){const i=t,[o,r]=i;this.map&&("number"==typeof e?this.map.setView([r,o],e,{animate:!1}):this.setCenter([o,r]))}else{const{zoom:e,center:o,maxBounds:r,bounds:n,minZoom:s,maxZoom:a}=t;if(o&&void 0!==e?this.setView(o,e):(void 0!==e&&this.setZoom(e),o&&this.setCenter(o)),n&&this.fitBounds(n),void 0!==r)if(r){const t=dr(r);i.setMaxBounds(t),this._updateMinZoomForBounds()}else i.setMaxBounds(null),this._updateMinZoomForBounds();void 0!==a&&i.setMaxZoom(a),void 0!==s&&this._updateMinZoomForBounds(s)}}setCenter(t){const[e,i]=t;this.map&&this.map.panTo([i,e])}getCenter(){const t=this.map;if(t){const e=t.getBounds().getCenter();return[e.lng,e.lat]}}setZoom(t){this.map&&this.map.setZoom(t)}getZoom(){var t;return null!=(t=this.map&&this.map.getZoom())?t:void 0}getBounds(){if(!this.map)return;const t=this.map.getBounds(),e=t.getSouthWest(),i=t.getNorthEast();return[e.lng,e.lat,i.lng,i.lat]}fitBounds(t,e={}){if(this.map){const{maxZoom:i,offset:o,padding:r}=e,n={};i&&(n.maxZoom=i),r&&(n.padding=[r,r]),o&&(n.padding=o),this.map.fitBounds(dr(t),n)}}getLayerAdapter(e){return t.layerAdapters[e]}createControl(t,e){return T(t,e,this)}createButtonControl(t){return function(t,e){return T(v(t),{bar:!0,margin:t.margin},e)}(t,this)}createToggleControl(t){return I(t,this)}addControl(t,e,i){if(this._controlContainer)return this._controlContainer.addControl(t,e,i)}removeControl(t){this._controlContainer&&this._controlContainer.removeControl(t)}removeLayer(t){t&&t.remove&&t.remove()}showLayer(t){this.map&&t.addTo(this.map)}hideLayer(t){t.remove()}setLayerOpacity(t,e){"setOpacity"in t&&t.setOpacity(e)}setLayerOrder(t,e,i){}onMapClick(t){const e=Ct(t);this.emitter.emit("preclick",e),this.emitter.emit("click",e)}locate(t,e){const i=this.map;if(i&&(i.locate(t),e)){const{locationfound:t,locationerror:o}=e,r=e=>{t({lngLat:[e.latlng.lng,e.latlng.lat]})};void 0!==t&&i.on("locationfound",r,this),o&&i.on("locationerror",o,this);return{stop:()=>{void 0!==t&&i.off("locationfound",r),o&&i.off("locationerror",o)}}}return{stop:()=>{}}}_addUnselectCb(t){for(const e of this._unselectCb)e();this._unselectCb.length=0,this._unselectCb.push(t)}_watchSizeChangeToUpdateMinZoom(){this._stopWatchSizeChangeToUpdateMinZoom();const t=this.getContainer();t&&this.map&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(()=>{this._updateMinZoomForBounds()}),this._resizeObserver.observe(t))}_stopWatchSizeChangeToUpdateMinZoom(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0)}_addMapListeners(){const t=this.map;if(t){t.on("click",t=>{this.onMapClick(t)});for(const e of this._universalEvents)t.on(e,()=>this.emitter.emit(e,this),t);t.on("movestart",()=>{No.queue.abort()}),t.on("zoomstart",()=>{No.queue.abort()});for(const e of this._positionEvents)t.on(e,t=>this.emitter.emit(e,Ct(t)),t)}}_updateMinZoomForBounds(t){var e;const i=this.map;if(i){t=null!=t?t:i.getMinZoom();const o=P.latLngBounds(P.latLng(-90,-18e3),P.latLng(90,18e3)),r=null!=(e=i.options.maxBounds)?e:o;if(void 0!==r){i.setMinZoom(0);const e=i.getBoundsZoom(r,!0),o=t<e?e:t;i.options.minZoom=o,i.setMinZoom(o),i.getZoom()<o&&i.setZoom(o)}}}};vr(wr,"layerAdapters",{GEOJSON:class extends Ot{constructor(t,e){super(t,e),ii(this,"layer"),ii(this,"selected",!1),ii(this,"type"),ii(this,"_layers",[]),ii(this,"_events"),ii(this,"paint"),ii(this,"selectedPaint"),ii(this,"_selectedLayers",[]),ii(this,"_filteredLayers",[]),ii(this,"_filterFun"),ii(this,"_openedPopup",[]),ii(this,"_paint"),ii(this,"$updateTooltip",Q(()=>{this.updateTooltip()},300)),ii(this,"$unselect",()=>{this.unselect()}),this._events=new Rt(this),this._paint=new Ve(this)}addLayer(t){return Object.assign(this.options,t),this.paint=t.paint,this.layer=new P.FeatureGroup([],ei(ti({},t.nativeOptions),{pane:this.pane})),this.selectedPaint=t.selectedPaint,t.paint=this.paint,t.data&&this.addData(t.data),this._addMapListener(),this.layer}beforeRemove(){this._removeMapListener()}select(t){if(this.unselect(),t){const e=this._layers.filter(t);for(const t of e)this._selectLayer(t,"api")}else this.selected||(this.selected=!0,this.selectedPaint&&this._paint.setPaintEachLayer(this.selectedPaint))}unselect(t){if(t){this._layers.filter(t).forEach(t=>{this._unSelectLayer(t)})}else if(this.selected){for(const t of this._openedPopup)this._removePopup(t[0]);this.paint&&this._paint.setPaintEachLayer(this.paint),this._selectedLayers.length=0,this.selected=!1}}getSelected(){return this._selectedLayers.map(t=>ti({target:this,feature:t.feature,layer:t},xt(t.feature)))}getFiltered(){return this._filteredLayers}filter(t){this._filterFun=t;const e=this.layer,i=e&&e._map;if(e&&i){e.remove();const o=[];this._layers.forEach(({feature:i,layer:r})=>{if(r){!t||t(ti({target:this,feature:i,layer:r},xt(i)))?(e.addLayer(r),o.push(ti({target:this,feature:i,layer:r},xt(i)))):e.removeLayer(r)}}),this._filteredLayers=o,e.addTo(i)}return this._filteredLayers}cleanFilter(){this.filter()}getLayers(){return this._layers.map(({layer:t,feature:e})=>ti({feature:e,layer:t,visible:t&&!!t._map,target:this},xt(e)))}clearLayer(t){this.unselect();const e=this.layer;if(e)if(t)for(let i=this._layers.length;i--;){const o=this._layers[i];if(o){const{feature:r,layer:n}=o;if(r&&n){t(r)&&(e.removeLayer(n),this._layers.splice(i,1))}}}else e.clearLayers(),this._layers=[]}setData(t){this.clearLayer(),this.addData(t)}addData(t){const e=this.options;let i;if(e){if(t){let o;if(e.type)o=e.type;else{const e=function(t){let e;e="FeatureCollection"===t.type?gt(t.features.map(t=>t.geometry.type)):"GeometryCollection"===t.type?gt(t.geometries.map(t=>t.type)):"Feature"===t.type?t.geometry.type:t.type;return e}(t);o=yt[e]}if(this.type&&this.type!==o)return void console.warn("no other data type than layer can be added");this.type=o,t=function(t,e){if("FeatureCollection"===t.type)t.features=t.features.filter(t=>vt(t.geometry.type,e));else if("Feature"===t.type){if(!vt(t.geometry.type,e))return!1}else"GeometryCollection"===t.type&&(t.geometries=t.geometries.filter(t=>vt(t.type,e)));return t}(t,o),t&&(i=this._getGeoJsonOptions(e,o))}new P.GeoJSON(t||void 0,i)}}openPopup(t,e){if(t){this._layers.filter(t).forEach(t=>{this._openPopup(t,e,"api")})}}closePopup(t){(t?this._openedPopup.filter(e=>t(e[2])):this._openedPopup).forEach(t=>{this._removePopup(t[0])})}updateTooltip(t){t?this._updateTooltip(t):this.getLayers().forEach(t=>this._updateTooltip({feature:t.feature,layer:t.layer}))}getExtent(){return this.getBounds()}getBounds(){if(this.layer){const t=this.layer.getBounds();if(t.isValid())return mt(t)}}setOpacity(t){this.options.opacity=t,this.setPaint(this.paint),this.setSelectedPaint(this.selectedPaint)}setPaint(t){if(t){this.paint=t;for(const e of this._layers)this._paint.setPaint(e,t)}}setSelectedPaint(t){if(t){this.selectedPaint=t;for(const e of this._selectedLayers)this._paint.setPaint(e,t)}}updatePaint(t){this.paint=ti(ti({},this.paint),t);for(const e of this._layers)this._paint.setPaint(e,this.paint)}updateSelectedPaint(t){this.selectedPaint=ti(ti({},this.selectedPaint),t);for(const e of this._selectedLayers)this._paint.setPaint(e,this.selectedPaint)}_getSelected(t){return this._selectedLayers.find(e=>e.layer===t)}_updateTooltip(t){const{feature:e,layer:i}=t,{label:o,labelField:r,labelOnHover:n}=this.options;if(i){let s;if(i.unbindTooltip(),e.properties&&r?s=e.properties[r]:o&&(s=o(ti(ti({target:this},t),xt(e)))),s){const t=!n;i.bindTooltip(String(s),{permanent:t,sticky:!1})}}}_openPopup(t){return e=this,i=arguments,o=function*(t,e={},i,o){var r,n;const{feature:s,layer:a}=t,{minWidth:l,autoPan:c,maxWidth:h,closeButton:u}=ti({minWidth:300},e),p=null!=u?u:!this.options.selectOnHover;let d;const f=[],m=t=>{f.push(t)},g=()=>{d&&this._removePopup(d)};let y;if(y=e.createPopupContent?yield e.createPopupContent(ti({layer:a,feature:s,target:this,type:i,close:g,onClose:m},xt(s))):e.popupContent,y&&a){const e={minWidth:l,autoPan:c,closeButton:p,closeOnClick:!1,autoClose:!1};if(tt(h)&&(e.maxWidth=h),d=a.bindPopup(y,e),null==(n=null==(r=this.options.popupOptions)?void 0:r.unselectOnClose)||n){const t=a.getPopup();t&&t.once("remove",()=>{g()},this)}this._openedPopup.push([d,f,t]),d.openPopup(o)}},new Promise((t,r)=>{var n=t=>{try{a(o.next(t))}catch(e){r(e)}},s=t=>{try{a(o.throw(t))}catch(e){r(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(n,s);a((o=o.apply(e,i)).next())});var e,i,o}_removePopup(t){var e,i;if(this.map){t.closePopup().unbindPopup();const o=this._openedPopup.findIndex(e=>e[0]===t);if(-1!==o){const t=null==(i=null==(e=this.options.popupOptions)?void 0:e.unselectOnClose)||i,[,r,n]=this._openedPopup[o];for(const e of r)e(n);r.length=0,t&&this._unSelectLayer(n),this._openedPopup.splice(o,1)}}}_getGeoJsonOptions(t,e){const i=t.paint;let o={};return"function"==typeof i?"point"===e?o.pointToLayer=(t,e)=>{const o=i(t);return this._paint.createPaintToLayer(o)(t,e)}:o={style:t=>this._paint.preparePaint(t?ti(ti({},_t),i(t)):ei(ti({},_t),{type:"path"}))}:o=this._paint.createPaintOptions(i),o.onEachFeature=(t,e)=>{this._onEachFeature(t,e)},o}_onEachFeature(t,e){const i=this.layer;if(i){const o=ti({target:this,feature:t,layer:e},xt(t));e.options.pane=this.pane,this._layers.push(o);let r=!0;if(this._filterFun&&(r=this._filterFun(o)),r){const{popup:r,popupOptions:n,selectable:s,interactive:a,selectOnHover:l}=this.options;e.options.interactive=!tt(a)||a,i.addLayer(e),s&&(l?(e.on("mouseover",()=>{this._selectLayer(o,"hover")}),e.on("mouseout",()=>{this._unSelectLayer(o)})):e.on("click",t=>this._selectOnLayerClick(t),this)),this._events.handleMouseEvents(e),setTimeout(()=>{r&&this._openPopup(ti({target:this,layer:e,feature:t},xt(t)),n,"api"),this._updateTooltip({layer:e,feature:t})})}}}_selectOnLayerClick(t){P.DomEvent.stopPropagation(t);const e=t.target,i=e.feature,o=ti({target:this,layer:e,feature:i},xt(i)),r=this._getSelected(e);r?this.options&&this.options.unselectOnSecondClick&&this._unSelectLayer(r):this._selectLayer(o,"click",t.latlng)}_selectLayer(t,e,i){const{multiselect:o}=this.options;o||(this.map._addUnselectCb(()=>{this._unSelectLayer(t)}),this._selectedLayers.forEach(t=>this._unSelectLayer(t))),this._selectedLayers.push(t),this.selected=!0;const{selectedPaint:r,popupOnSelect:n,popupOptions:s}=this.options;if(r&&t.layer&&this._paint.setPaint(t,r),n&&this._openPopup(t,s,e,i),this.options.onSelect){const i=t.feature?[t.feature]:[];this.options.onSelect(ti({type:e,layer:this,features:i},xt(i)))}}_unSelectLayer(t){const e=this._selectedLayers.indexOf(t);-1!==e&&(this._selectedLayers.splice(e,1),this.options&&(this.options.paint&&this._paint.setPaint(t,this.options.paint),this.options.popupOnSelect&&t.layer&&this._removePopup(t.layer))),this.selected=this._selectedLayers.length>0}_addMapClickListener(){const t=this.map;if(t){const{unselectOnClick:e}=this.options;(null==e||e)&&t.on("click",this.$unselect)}}_removeMapClickListener(){this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip),this.map.off("click",this.$unselect)}_addMapListener(){const t=this.map;if(t){const{label:e,labelField:i,labelOnHover:o}=this.options;this._addMapClickListener(),!i&&!e||o||(t.on("zoomend",this.$updateTooltip),t.on("moveend",this.$updateTooltip))}}_removeMapListener(){this._removeMapClickListener(),this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip)}},IMAGE:No,TILE:Yo,WMS:class extends Ot{addLayer(t){var e;Object.assign(this.options,t);const i=t,{url:o}=i,r=((t,e)=>{var i={};for(var o in t)cr.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&lr)for(var o of lr(t))e.indexOf(o)<0&&hr.call(t,o)&&(i[o]=t[o]);return i})(i,["url"]);if(o){const i=pr(pr({pane:this.pane,attribution:r.attribution,minZoom:r.minZoom,maxZoom:r.maxZoom,layers:t.layers,format:t.format,version:t.version,transparent:null==(e=t.transparent)||e},t.params),t.nativeOptions);let s;const a=pi(r);return s=a?new rr(o,(n=pr({},i),sr(n,ar({request:a})))):new P.TileLayer.WMS(o,i),s}var n}},OSM:class extends Yo{addLayer(t){return super.addLayer((e=((t,e)=>{for(var i in e||(e={}))er.call(e,i)&&or(t,i,e[i]);if(tr)for(var i of tr(e))ir.call(e,i)&&or(t,i,e[i]);return t})({name:"OpenStreetMap",attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'},t),Qo(e,Xo({url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}))));var e}}}),vr(wr,"controlAdapters",{ZOOM:P.Control.Zoom,ATTRIBUTION:class extends P.Control.Attribution{constructor(t){super(t);const e=t&&t.customAttribution;if(e){let t=[];Array.isArray(e)?t=e:e&&(t=[e]),t.forEach(t=>this.addAttribution(t))}}}}),vr(wr,"Map",P.Map);let xr=wr;const Pr={brill:'<path d="m6 0-5 6 5 6 5-6z"/>',circle:'<circle cx="6" cy="6" r="6"/>',rect:'<rect width="12" height="12"/>',marker:'<path d="m6 0c-1.85 0-4 1.19-4 4.22 0 2.05 3.08 6.59 4 7.78 0.821-1.19 4-5.62 4-7.78 0-3.03-2.15-4.22-4-4.22z"/>',cross:'<path d="M 2.4,12 6,8.4 9.6,12 12,9.6 8.4,6 12,2.4 9.6,0 6,3.6 2.4,0 0,2.4 3.6,6 0,9.6 Z"/>',star:'<path d="m6 0.25 1.71 4.18 4.29-1.04e-4 -3.43 3.14 0.857 4.18-3.43-3.14-3.43 3.14 0.857-4.18-3.43-3.14 4.29-0.209z"/>',triangle:'<path d="m12 11.7h-12l6-11.2z"/>',plus:'<path d="m7.5 12v-4.5h4.5v-3h-4.5v-4.5h-3v4.5h-4.5v3h4.5v4.5z"/>',minus:'<path d="m12 7.5v-3h-12v3z"/>',asterisk:'<path d="m7.59 12v-3.27l2.83 1.64 1.58-2.74-2.85-1.64 2.83-1.64-1.56-2.74-2.83 1.64v-3.24h-3.17v3.24l-2.85-1.64-1.57 2.74 2.84 1.64-2.84 1.64 1.57 2.74 2.85-1.64v3.27z"/>'};const Lr=/\{ *([\w_-]+) *\}/g;function Or(t,e){return t.replace(Lr,(t,i)=>{let o=e[i];if(void 0===o)throw new Error("No value provided for letiable "+t);return"function"==typeof o&&(o=o(e)),o})}var Cr=Object.defineProperty,kr=Object.getOwnPropertySymbols,Er=Object.prototype.hasOwnProperty,Mr=Object.prototype.propertyIsEnumerable,Ar=(t,e,i)=>e in t?Cr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;function Sr(t){return e=this,i=null,o=function*(){const{params:e,name:i,connector:o,requestOptions:r}=t,n=yield o.connect();let s=n&&n[i];if(s){s=[...s];let t=s.shift();if(s.length){const i={};for(let t=0;t<s.length;t++){const o=s[t];if(i[t]=`{${o}}`,void 0===e[o])throw new Error(`\`${o}\` URL API argument is not specified`)}t&&(t=Or(t,i))}if(e){const i=[],o=e.paramList;Array.isArray(o)&&o.forEach(([t,e])=>{i.push(`${t}=${e}`)});for(const t in e)-1===s.indexOf(t)&&i.push(`${t}=${e[t]}`);i.length&&(t=`${t}?${i.join("&")}`)}if(t)return o.makeQuery(t,e,((t,e)=>{for(var i in e||(e={}))Er.call(e,i)&&Ar(t,i,e[i]);if(kr)for(var i of kr(e))Mr.call(e,i)&&Ar(t,i,e[i]);return t})({cacheName:i},r));throw new Error("Request URL is not set")}},new Promise((t,r)=>{var n=t=>{try{a(o.next(t))}catch(e){r(e)}},s=t=>{try{a(o.throw(t))}catch(e){r(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(n,s);a((o=o.apply(e,i)).next())});var e,i,o}var Tr=Object.defineProperty,Ir=(t,e,i)=>((t,e,i)=>e in t?Tr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);const zr=class t{constructor(e={}){var i;Ir(this,"cache",[]);const o=null!=(i=e.namespace)?i:"default";return t.instance[o]?t.instance[o]:(t.instance[o]=this,this)}clean(){this.cache.length=0}all(){return this.cache}addFull(t,e,i,o){return"object"==typeof i&&"valueToSet"in i&&(i.onlyFull=!0),this.add(t,e,i,!0,o)}add(t,e,i,o,r){let n,s;"object"==typeof i&&"valueToSet"in i?(n=i,o=n.onlyFull,r=n.expirationTime,s=n.props):s=i;const a=this._find(t,s);if(a)return a.value;{let i;i=e instanceof Function?e():e;const n=s&&JSON.parse(JSON.stringify(ut(s)));r=r?Date.now()+r:void 0;const a={key:t,value:i,props:n,expirationTime:r};return o&&!et(i)?i:(this.cache.push(a),i instanceof Promise?(i.catch(()=>{this.delete(t,s)}),o&&i.then(e=>(et(e)||this.delete(t,s),e)),i):i)}}match(t,e){const i=this._find(t,e);if(!(i&&i.expirationTime&&Date.now()>i.expirationTime))return null==i?void 0:i.value;this.delete(i)}matchAll(t,e){const i=Date.now();return this.cache.forEach(t=>{t.expirationTime&&i>t.expirationTime&&this.delete(t)}),t?this.cache.filter(i=>this._filter(i,t,e)).map(t=>t.value):this.cache.map(t=>t.value)}delete(t,e){const i="string"==typeof t?this.cache.filter(i=>this._filter(i,t,e)):[t];for(const o of i){const t=this.cache.indexOf(o);-1!==t&&this.cache.splice(t,1)}}_find(t,e){return this.cache.find(i=>this._filter(i,t,e))}_filter(t,e,i){if(t.key!==e)return!1;if(!i)return!0;return ht(t.props||{},ut(i))}};Ir(zr,"instance",{});let jr=zr;var Br="4.0.0-rc.1";class Zr extends Error{constructor(t="AbortError"){super(t),this.name="AbortError"}}var Dr=Object.defineProperty,Nr=(t,e,i)=>((t,e,i)=>e in t?Dr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Rr extends Error{constructor(t){super(),Nr(this,"name","NgwError"),Nr(this,"title"),Nr(this,"message"),Nr(this,"detail"),Nr(this,"exception"),Nr(this,"status_code"),Nr(this,"data"),Nr(this,"guru_meditation"),Object.assign(this,t),Object.setPrototypeOf(this,Rr.prototype)}}var qr=Object.defineProperty,Fr=(t,e,i)=>((t,e,i)=>e in t?qr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Ur extends Rr{constructor(t){super(t),Fr(this,"name","InsufficientPermissionsError"),Fr(this,"exception","nextgisweb.core.exception.InsufficientPermissions"),Object.setPrototypeOf(this,Ur.prototype)}}var Wr=Object.defineProperty,Hr=(t,e,i)=>((t,e,i)=>e in t?Wr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);let Vr=class t extends Rr{constructor(e){super(e),Hr(this,"message","There is no response from the server or problem connecting to server."),Hr(this,"title","Network error"),Hr(this,"detail","Check network connectivity and try again later."),Object.setPrototypeOf(this,t.prototype)}};var Gr=Object.defineProperty,Jr=(t,e,i)=>((t,e,i)=>e in t?Gr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class Kr extends Error{constructor(t){super(),Jr(this,"name","NetworkError"),Object.setPrototypeOf(this,Kr.prototype),this.message=`Unable to request ${t}.\n Possibly invalid NGW URL entered or CORS not configured to get request from ${location.origin}`}}var Yr=Object.defineProperty,$r=(t,e,i)=>((t,e,i)=>e in t?Yr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Qr extends Rr{constructor(t){super(t),$r(this,"name","ResourceNotFoundError"),$r(this,"exception","nextgisweb.resource.exception.ResourceNotFound"),Object.setPrototypeOf(this,Qr.prototype)}}var Xr=Object.freeze({__proto__:null,AbortError:Zr,InsufficientPermissionsError:Ur,NetworkError:Kr,NetworksResponseError:Vr,NgwError:Rr,ResourceNotFoundError:Qr,extractError:function(t){if(pt(t))return t.name&&t.message&&t.title?{title:t.title,message:t.message,detail:t.detail||null,data:t.data&&t.data.data?t.data.data:null}:!t.exception||void 0!==t.status&&0!==t.status&&void 0!==t.data?{title:"string"==typeof t.title?t.title:"Unexpected error",message:"string"==typeof t.message?t.message:"Something went wrong."}:new Vr({title:t.title,status_code:t.status_code,exception:t.exception})},isError:function(t){return!!pt(t)&&(t.status_code&&t.exception&&t.title)}}),tn=Object.defineProperty,en=(t,e,i)=>((t,e,i)=>e in t?tn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class on extends Error{constructor(t){super(t||"Something went wrong."),en(this,"title"),this.name="BaseAPIError",this.title="Unknown API error",Error.captureStackTrace&&Error.captureStackTrace(this,on)}}class rn extends on{constructor(t){super(t||"There is no response from the server or problem connecting to server."),en(this,"detail"),this.title="Network error",this.detail="Check network connectivity and try again later."}}class nn extends on{constructor(t){super(t||"Something went wrong."),this.title="Unexpected server response"}}class sn extends on{constructor(t){super(t.message),en(this,"detail"),en(this,"data"),this.title=t.title||this.title,this.detail=t.detail||null,this.data=t}}class an extends Error{constructor(t,e={}){super(t||"Unexpected error while processing long-running request."),en(this,"title"),en(this,"data"),this.name="LunkwillError",this.title="Long-running request error",this.data=e,Error.captureStackTrace&&Error.captureStackTrace(this,an)}}class ln extends an{constructor(t){super("Long-running request was cancelled.",t)}}class cn extends an{constructor(t){super(void 0,t)}}var hn=Object.defineProperty,un=Object.getOwnPropertySymbols,pn=Object.prototype.hasOwnProperty,dn=Object.prototype.propertyIsEnumerable,fn=(t,e,i)=>e in t?hn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,mn=(t,e)=>{for(var i in e||(e={}))pn.call(e,i)&&fn(t,i,e[i]);if(un)for(var i of un(e))dn.call(e,i)&&fn(t,i,e[i]);return t},gn=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});function yn(t){return gn(this,null,function*(){const e=yield function(t){return gn(this,null,function*(){try{return t.json()}catch(e){throw new Error}})}(t);let i=e.delay_ms;const o=void 0!==e.retry_ms?e.retry_ms:2e3,r=`/api/lunkwill/${e.id}/summary`,n=`/api/lunkwill/${e.id}/response`,s=t=>new Promise(e=>setTimeout(e,t));let a=!1,l=!1;for(;!l;){let t,e;yield s(a?o:i),a=!1;try{t=yield fetch(r,{credentials:"same-origin"}),e=yield t.json()}catch(c){a=!0;continue}switch(e.status){case void 0:throw new an(void 0,e);case"ready":l=!0;break;case"cancelled":throw new ln(e);case"failed":throw new cn(e);case"spooled":case"processing":case"buffering":i=e.delay_ms;break;default:throw new an(void 0,e)}}return n})}const _n=new RegExp(["application/pdf","image/png","image/jpeg","image/tiff","text/csv"].join("|"));function bn(t,e){let i="";return void 0!==e&&(i="?"+function(t){const e=[];for(const[i,o]of Object.entries(t))if("string"==typeof o||"number"==typeof o||"boolean"==typeof o)e.push(`${i}=${encodeURIComponent(o)}`);else if(Array.isArray(o))e.push(`${i}=${o.map(encodeURIComponent).join(",")}`);else for(const[t,r]of Object.entries(o)){const o=`${i}[${encodeURIComponent(t)}]`;if("string"==typeof r||"number"==typeof r||"boolean"==typeof r)e.push(`${o}=${encodeURIComponent(r)}`);else if(Array.isArray(r)){const t=r.map(encodeURIComponent);e.push(`${o}=${t.join(",")}`)}}return e.join("&")}(e)),t+i}function vn(t,e,i){return gn(this,null,function*(){var o,r;const n=mn(mn({},{method:"GET",credentials:"same-origin",headers:{}}),e),{withCredentials:s,responseType:a,cacheProps:l,cacheName:c,lunkwill:h,cache:u,query:p,json:d}=n,f=((t,e)=>{var i={};for(var o in t)pn.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&un)for(var o of un(t))e.indexOf(o)<0&&dn.call(t,o)&&(i[o]=t[o]);return i})(n,["withCredentials","responseType","cacheProps","cacheName","lunkwill","cache","query","json"]);f.method=null==(o=f.method)?void 0:o.toUpperCase(),s&&(f.credentials="include");let m=!1;void 0!==h&&(h.toHeaders(f.headers||{}),m=!0);const g=!!f.lunkwillReturnUrl;if(delete f.lunkwillReturnUrl,void 0!==d){f.body=JSON.stringify(d);const t=f.headers||{};t["Content-Type"]="application/json",f.headers=t}const y=bn(t,p),_=()=>gn(null,null,function*(){let t;try{t=yield fetch(y,f)}catch(r){if(f.signal&&f.signal.aborted)throw r;throw new rn}if(m&&function(t){const e=t.headers.get("content-type");return null!=e&&e.includes("application/vnd.lunkwill.request-summary+json")}(t)){const e=yield yn(t);if(g)return e;t=yield function(t){return gn(this,null,function*(){try{return yield window.fetch(t,{credentials:"same-origin"})}catch(r){throw new rn}})}(e)}const e=t.headers.get("content-type"),i=e&&(e.includes("application/json")||e.includes("application/vnd.lunkwill.request-summary+json"));let o;try{const r=e&&_n.test(e);if("blob"===a||r)o=yield t.blob();else{if(!i)throw new nn;o=yield t.json()}}catch(r){if("AbortError"===r.name||r instanceof nn)throw r;throw new nn}if(400<=t.status&&t.status<=599)throw new sn(o);return o});if(i)if("GET"===(null==(r=f.method)?void 0:r.toUpperCase())){if(!1!==u){const t=l||mn({},ut({withCredentials:s,responseType:a}));return i.add(c||y,_,{props:t,expirationTime:u?void 0:500})}}else{["api/feature_layer/identify"].every(e=>!t.includes(e))&&i.clean()}return _()})}var wn=Object.defineProperty,xn=Object.defineProperties,Pn=Object.getOwnPropertyDescriptors,Ln=Object.getOwnPropertySymbols,On=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable,kn=(t,e,i)=>e in t?wn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,En=(t,e)=>{for(var i in e||(e={}))On.call(e,i)&&kn(t,i,e[i]);if(Ln)for(var i of Ln(e))Cn.call(e,i)&&kn(t,i,e[i]);return t},Mn=(t,e)=>{var i={};for(var o in t)On.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&Ln)for(var o of Ln(t))e.indexOf(o)<0&&Cn.call(t,o)&&(i[o]=t[o]);return i};function An(t,e,i,...o){const[r,...n]=i[t],s=o[0];let a;if(void 0===s)a=[];else if("object"==typeof s&&null!==s){if(o.length>1)throw new Error("Too many arguments for route(name, object)!");a=[];for(const[t,e]of Object.entries(s))a[n.indexOf(t)]=String(e)}else a=o.map(t=>String(t));return dt(e+r.replace(/\{(\w+)\}/g,function(t,e){const i=parseInt(e),o=a[i];if(void 0===o){throw new Error(`Undefined parameter ${i} in "${r}".`)}return String(o)}))}function Sn(t,e,...i){const o={url:o=>{return r=null,n=null,s=function*(){var r;const n=yield e.connect();return bn(An(t,null!=(r=e.options.baseUrl)?r:"",n,...i),null==o?void 0:o.query)},new Promise((t,e)=>{var i=t=>{try{a(s.next(t))}catch(i){e(i)}},o=t=>{try{a(s.throw(t))}catch(i){e(i)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,o);a((s=s.apply(r,n)).next())});var r,n,s}},r=["get","post","put","delete","patch"];for(const n of r){const r=o=>{var r;const s=o||{},{headers:a}=s,l=Mn(s,["headers"]);if(null==(r=null==o?void 0:o.signal)?void 0:r.aborted)throw new Zr;return e.connect().then(o=>{var r;const s=An(t,null!=(r=e.options.baseUrl)?r:"",o,...i),c=ut(En(En({},e.getAuthorizationHeaders()),null!=a?a:{}));return vn(s,(h=En({headers:c},l),xn(h,Pn({method:n}))),e.cache);var h})};o[n]=r}return o}function Tn(t){return"[object Object]"===Object.prototype.toString.call(t)}let In;In=(t,e,i={},o,r)=>{i.method=i.method||"GET";const n=new XMLHttpRequest;n.open(i.method||"GET",t,!0),"blob"===i.responseType&&(n.responseType=i.responseType);const s=()=>{try{return JSON.parse(n.responseText)}catch(t){return n.responseText}};n.onload=()=>{-1!==[401,403,404,422,500].indexOf(n.status)&&o(new Rr(s())),((t=!1)=>{const r=t?o:e;"blob"===i.responseType?r(n.response):n.responseText?r(s()):o({message:""})})()},n.onerror=e=>{o(0===n.status?new Kr(t):e)},n.upload.onprogress=function(t){if(t.lengthComputable){i.onProgress&&i.onProgress(t.loaded/t.total*100,t)}};const a=i.headers;if(a)for(const c in a){const t=a[c];"string"==typeof t&&n.setRequestHeader(c,t)}let l;if(void 0!==i.withCredentials&&(n.withCredentials=i.withCredentials),i.file){if(l=new FormData,l.append("file",i.file),i.data)for(const c in i.data)l.append(c,l[c])}else l=i.data?"string"==typeof i.data?i.data:JSON.stringify(i.data):null;r&&r(()=>{n.abort()}),n.send(l)};const zn=[];function jn(t){zn.push(t)}var Bn=Object.defineProperty,Zn=Object.defineProperties,Dn=Object.getOwnPropertyDescriptors,Nn=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,qn=Object.prototype.propertyIsEnumerable,Fn=(t,e,i)=>e in t?Bn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Un=(t,e)=>{for(var i in e||(e={}))Rn.call(e,i)&&Fn(t,i,e[i]);if(Nn)for(var i of Nn(e))qn.call(e,i)&&Fn(t,i,e[i]);return t},Wn=(t,e,i)=>Fn(t,"symbol"!=typeof e?e+"":e,i),Hn=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});let Vn=0,Gn=0;class Jn{constructor(t){Wn(this,"options",t),Wn(this,"id",Vn++),Wn(this,"emitter",new H),Wn(this,"user"),Wn(this,"cache"),Wn(this,"withCredentials"),Wn(this,"routeCache"),Wn(this,"client",`NextGIS-NGW-Connector/${Br}`),Wn(this,"routeStr","/api/component/pyramid/route"),Wn(this,"activeRequests",{}),Wn(this,"requestTransform");const e=function(t){return zn.find(e=>{if(e.options.baseUrl===t.baseUrl){if(!t.auth)return!0;if(e.options.auth)return ht(e.options.auth,t.auth)}})}(t);if(this.cache=new jr({namespace:t.cacheId}),this.routeCache=new jr({namespace:"routecache"}),e)return e;{const{route:t,requestTransform:e,withCredentials:i}=this.options;t&&(this.routeStr=t),e&&(this.requestTransform=e),void 0!==i&&(this.withCredentials=i),jn(this)}}clearCache(){this.cache.clean()}setRequestTransform(t){this.requestTransform=t}setNgw(t){this.logout(),this.options.baseUrl=t,jn(this)}connect(){return Hn(this,arguments,function*({signal:t}={}){const e=this.options.auth;if(e){const{login:t,password:i}=e;t&&i&&(yield this._login({login:t,password:i}))}const i=`${this.routeStr}?client=${this.client}`;return this.routeCache.add(this.options.baseUrl||String(this.id),()=>this.makeQuery(i,null,{signal:t,cache:!1}))})}login(t,e){return this.logout(),jn(this),this._login(t,e)}logout(){this.abort(),function(t){const e=zn.indexOf(t);-1!==e&&zn.splice(e,1)}(this),this.options.auth=void 0,this.user=void 0,this.routeCache.clean(),this.clearCache(),this.emitter.emit("logout")}getUserInfo(t,e){return Hn(this,null,function*(){if(this.user&&this.user.id)return this.user;t&&(this.options.auth=t);const i=Un({headers:this.getAuthorizationHeaders(t),cache:!0},e);return this.makeQuery("/api/component/auth/current_user",{},i)})}getAuthorizationHeaders(t){const e=this.makeClientId(t);return e?{Authorization:`Basic ${e}`}:{}}makeClientId(t){if(t=t||this.options.auth){const{login:e,password:i}=t;return window.btoa(`${e}:${i}`)}}abort(){for(const t of Object.values(this.activeRequests))t.abort();this.activeRequests={}}getActiveApiRequests(){return Un({},this.activeRequests)}route(t,...e){return Sn(t,this,...e)}makeQuery(t,e){return Hn(this,arguments,function*(t,e,i={}){var o;if(!(t=(this.options.baseUrl?this.options.baseUrl:"")+t))throw new Error("Empty `url` not allowed");if(e){const i=e,o=((t,e)=>{var i={};for(var o in t)Rn.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&Nn)for(var o of Nn(t))e.indexOf(o)<0&&qn.call(t,o)&&(i[o]=t[o]);return i})(i,["paramList"]);t=Or(t,o)}t=encodeURI(dt(t)),i=Un({withCredentials:this.withCredentials},i);const{cache:r,signal:n,method:s="GET",headers:a,cacheName:l,cacheProps:c,responseType:h,withCredentials:u}=i,p=new AbortController,d=p.signal;if(n){if(n.aborted)throw new Zr;n.addEventListener("abort",()=>{p.abort()})}i.signal=d;const f=()=>Hn(this,null,function*(){const e=Gn++;this.activeRequests[e]=p;try{return this._loadData(t,i)}finally{this._cleanActiveRequest(e)}});if("GET"===s&&!1!==r){const i=c||(m=Un({},ut({headers:a,withCredentials:u,responseType:h,baseUrl:this.options.baseUrl,userId:null==(o=this.user)?void 0:o.id})),Zn(m,Dn({params:e})));return this.cache.add(l||t,f,{props:i,expirationTime:r?void 0:500})}var m;return f()})}_loadData(t,e){return e.responseType=e.responseType||"json",new Promise((i,o)=>{var r;if(this.user&&((e=e||{}).headers=Un(Un({},this.getAuthorizationHeaders()),e.headers)),this.requestTransform){const[i,o]=this.requestTransform(t,e);t=i,e=o}let n;In(t,i,e,o,t=>{n=t}),null==(r=e.signal)||r.addEventListener("abort",()=>{void 0!==n&&n(),o(new Zr)})}).catch(t=>{if("AbortError"!==t.name){const e=this._handleHttpError(t);if(e)throw e}throw t})}_login(t,e){return Hn(this,null,function*(){try{const i=yield this.getUserInfo(t,e);return this.user=i,this.emitter.emit("login",i),i}catch(i){throw this.emitter.emit("login:error",i),i}})}_cleanActiveRequest(t){delete this.activeRequests[t]}_handleHttpError(t){if(t&&t instanceof Rr){if("nextgisweb.resource.exception.ResourceNotFound"===t.exception)throw new Qr(t);if("nextgisweb.core.exception.InsufficientPermissions"===t.exception)throw new Ur(t)}return t}}Wn(Jn,"errors",Xr);const Kn=["description"];function Yn(t,e=""){e=e?e+"__":"";const i={};for(const[o,r]of Object.entries(t))if(-1===Kn.indexOf(o))if(Tn(r))if("owner_user"===o){const t=Yn(r,o);Object.assign(i,t)}else"parent"===o&&"id"in r&&(i.parent_id=r.id);else tt(r)&&(i[e+o]=r);return i}var $n=Object.defineProperty,Qn=Object.defineProperties,Xn=Object.getOwnPropertyDescriptors,ts=Object.getOwnPropertySymbols,es=Object.prototype.hasOwnProperty,is=Object.prototype.propertyIsEnumerable,os=(t,e,i)=>e in t?$n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,rs=(t,e)=>{for(var i in e||(e={}))es.call(e,i)&&os(t,i,e[i]);if(ts)for(var i of ts(e))is.call(e,i)&&os(t,i,e[i]);return t},ns=(t,e)=>Qn(t,Xn(e)),ss=(t,e,i)=>os(t,"symbol"!=typeof e?e+"":e,i),as=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});class ls{constructor({connector:t,cacheId:e}){ss(this,"cache"),ss(this,"connector"),this.connector=t,this.cache=new jr({namespace:e})}getOne(t,e){const i=rs({},e);return"string"==typeof t||"number"==typeof t||Tn(t),"string"==typeof t?this._fetchResourceBy({keyname:t},i):"number"==typeof t?this._fetchResourceById(t,i):Tn(t)?this._fetchResourceBy(t,i):Promise.resolve(void 0)}getOneOrFail(t,e){return this.getOne(t,e).then(t=>{if(t)return t;throw new Qr})}getId(t,e){return"number"==typeof t?Promise.resolve(t):"string"==typeof t||Tn(t)?this.getOne(t,e).then(t=>{if(t)return t.resource.id}):Promise.resolve(void 0)}getIdOrFail(t,e){return this.getId(t,e).then(t=>{if(void 0===t)throw new Error;return t})}getMany(t,e){return this._resourceCacheFilter(t).then(i=>{if(!i.length){const i={};return t.keyname?i.keyname=t.keyname:Object.assign(i,Yn(t)),this.connector.route("resource.search").get(ns(rs({},e),{query:rs({serialization:"full"},i)})).then(t=>{const i=Array.isArray(t)?t:t.items;if(null==e?void 0:e.cache)for(const e of i)this.cache.add("resource.item",Promise.resolve(e),{id:e.resource.id});return i})}return i})}getParent(t,e){return this.getOne(t,e).then(t=>{var i,o;return(null==(o=null==(i=null==t?void 0:t.resource)?void 0:i.parent)?void 0:o.id)?this.getOne(t.resource.parent.id,e):Promise.resolve(void 0)})}getChildrenOf(t,e){return this.getIdOrFail(t).then(t=>this._getChildrenOf(t,e))}update(t,e){return this.getId(t).then(t=>{if(void 0!==t)return this.connector.put("resource.item",{data:e},{id:t})})}delete(t){return this.getId(t).then(t=>{if(void 0!==t)return this.connector.delete("resource.item",null,{id:t}).then(()=>{this._cleanResourceItemCache(t)})})}_getChildrenOf(t,e){return as(this,arguments,function*(t,e,i=[]){let o;o="string"==typeof t?yield this.getId(t,e):"object"==typeof t?t.id:t;const r=yield this.connector.route("resource.collection").get(ns(rs({},e),{query:{parent:o}})),n=[];for(const s of r)(null==e?void 0:e.cache)&&this.cache.add("resource.item",Promise.resolve(s),{id:s.resource.id}),i.push(s),(null==e?void 0:e.recursive)&&s.resource.children&&n.push(this._getChildrenOf(s.resource.id,e,i));return n.length?Promise.all(n).then(()=>i):i})}_cleanResourceItemCache(t){return as(this,null,function*(){var e;const i=this.cache.all(),o=[];for(const r of i){const i=null==(e=r.props)?void 0:e.id;if(["resource.item","resource"].includes(r.key)&&void 0!==i)if("number"==typeof i)i===t&&o.push(r);else{(yield this.getId(i))===t&&o.push(r)}}for(const t of o)this.cache.delete(t)})}_fetchResourceById(t,e){return this.connector.route("resource.item",{id:t}).get(e)}_fetchResourceBy(t,e){return this.getMany(t,e).then(t=>t[0])}_resourceCacheFilter(t){return Promise.all(this.cache.matchAll("resource.item")).then(e=>(e.filter(e=>{if(e)return t.keyname&&e.resource.keyname?t.keyname===e.resource.keyname:tt(t.id)&&tt(e.resource.id)?t.id===e.resource.id:ht(t,e.resource)}),[]))}}var cs=Object.defineProperty,hs=(t,e,i)=>((t,e,i)=>e in t?cs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class us extends Jn{constructor(t){super(t),hs(this,"resources"),this.resources=new ls({connector:this,cacheId:t.cacheId})}static create(t){return new this(t)}clearCache(){super.clearCache(),this.resources.cache.clean()}apiRequest(t,e={},i={}){var o;return Sr({name:t,params:ut(e=null!=(o=i.params)?o:e),requestOptions:i,connector:this})}post(t,e,i){return(e=e||{}).method="POST",this.apiRequest(t,i,e)}get(t,e,i){return(e=e||{}).method="GET",this.apiRequest(t,i,e)}patch(t,e,i){return(e=e||{}).method="PATCH",this.apiRequest(t,i,e)}put(t,e,i){return(e=e||{}).method="PUT",this.apiRequest(t,i,e)}delete(t,e,i){return(e=e||{}).method="DELETE",this.apiRequest(t,i,e)}getResource(t,e){return this.resources.getOne(t,e)}getResourceOrFail(t,e){return this.resources.getOneOrFail(t,e)}getResourceBy(t){return this.resources.getOne(t)}getResourceByKeyname(t){return this.resources.getOne(t)}getResourceById(t){return this.resources.getOne(t)}getResourceId(t,e){return this.resources.getId(t,e)}getResourceIdOrFail(t,e){return this.resources.getIdOrFail(t,e)}getResourcesBy(t,e){return this.resources.getMany(t,e)}getResourceParent(t,e){return this.resources.getParent(t,e)}getResourceChildren(t,e){return this.resources.getChildrenOf(t,e)}updateResource(t,e){return this.resources.update(t,e)}deleteResource(t){return this.resources.delete(t)}}var ps=Object.defineProperty,ds=Object.defineProperties,fs=Object.getOwnPropertyDescriptors,ms=Object.getOwnPropertySymbols,gs=Object.prototype.hasOwnProperty,ys=Object.prototype.propertyIsEnumerable,_s=(t,e,i)=>e in t?ps(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,bs=(t,e)=>{for(var i in e||(e={}))gs.call(e,i)&&_s(t,i,e[i]);if(ms)for(var i of ms(e))ys.call(e,i)&&_s(t,i,e[i]);return t},vs=(t,e)=>ds(t,fs(e));function ws(t){const e=t.extent_bottom,i=t.extent_left,o=t.extent_top,r=t.extent_right;if(e&&i&&o&&r){const t=[i,e,r,o];return t[3]>82&&(t[3]=82),t[1]<-82&&(t[1]=-82),t}}function xs({resourceId:t,connector:e,cache:i=!0,signal:o}){return e.route("layer.extent",{id:Number(t)}).get({cache:i,signal:o}).then(t=>{if(t){const{maxLat:e,maxLon:i,minLat:o,minLon:r}=t.extent;return[r,o,i,e]}})}function Ps(t){return t.connector.getResource(t.resourceId,{signal:t.signal,cache:t.cache}).then(e=>{if(e)return Ls(e,t.connector,t)})}function Ls(t,e,i){if(t.webmap)return Promise.resolve(ws(t.webmap));{const o=t.resource;return o.cls&&o.parent&&-1!==o.cls.indexOf("style")?e.getResource(o.parent.id,i).then(t=>{if(t)return xs(vs(bs({},i),{resourceId:t.resource.id,connector:e}))}):xs(vs(bs({},i),{resourceId:o.id,connector:e}))}}var Os=Object.defineProperty,Cs=(t,e,i)=>((t,e,i)=>e in t?Os(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),ks=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});class Es{constructor(){Cs(this,"item"),Cs(this,"connector"),Cs(this,"_extent")}getExtent(){return ks(this,null,function*(){return this.getBounds()})}getBounds(t){return ks(this,null,function*(){return this._extent?this._extent:this.item?(this._extent=yield Ls(this.item,this.connector,t),this._extent):void 0})}}function Ms(t,e){return i=this,o=null,r=function*(){const i=t.resource,o=i;let{keyname:r,resourceId:n}=t;if(i&&("string"==typeof i?r=i:n="number"==typeof i?i:o.resource&&void 0!==o.resource&&"resource"in o?i.resource.id:yield Ms(i,e)),!n&&r){const t=yield e.getResource(r);t&&(n=t.resource.id)}return n},new Promise((t,e)=>{var n=t=>{try{a(r.next(t))}catch(i){e(i)}},s=t=>{try{a(r.throw(t))}catch(i){e(i)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(n,s);a((r=r.apply(i,o)).next())});var i,o,r}var As=Object.defineProperty,Ss=Object.getOwnPropertySymbols,Ts=Object.prototype.hasOwnProperty,Is=Object.prototype.propertyIsEnumerable,zs=(t,e,i)=>e in t?As(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,js=(t,e,i)=>zs(t,"symbol"!=typeof e?e+"":e,i),Bs=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});function Zs(t){return Bs(this,arguments,function*({webMap:t,adapterOptions:e={},onLayerAdded:i,createAdapter:o}){return class{constructor(){js(this,"options",{}),js(this,"layer",[]),js(this,"_removed",!1),js(this,"_creatingInProgress",!1)}addLayer(){return this.layer}removeLayer(){this._removed=!0;for(const e of this.layer)t.removeLayer(e)}destroyed(){return this._removed}showLayer(){return Bs(this,null,function*(){if(this.options.visibility=!0,this.layer.length)for(const e of this.layer)yield t.showLayer(e);else yield this.loadLayer()})}hideLayer(){return Bs(this,null,function*(){if(this.options.visibility=!1,this.layer)for(const e of this.layer)yield t.hideLayer(e)})}loadLayer(){return Bs(this,null,function*(){if(!this.layer.length&&!this._creatingInProgress){this._creatingInProgress=!0;const r=yield o(this);if(r){const o=new r(t.mapAdapter.map,((t,e)=>{for(var i in e||(e={}))Ts.call(e,i)&&zs(t,i,e[i]);if(Ss)for(var i of Ss(e))Is.call(e,i)&&zs(t,i,e[i]);return t})({},e)),n=yield o.addLayer({order:this.options.order,headers:this.options.headers,baselayer:this.options.baselayer});i&&i(o),Object.assign(o.options,e),o.layer=n,this._removed&&t.removeLayer(o),this.layer.push(o),this.options.visibility&&(yield t.showLayer(o)),this._creatingInProgress=!1}}return this.layer})}}})}function Ds(t){return e=this,i=arguments,o=function*({webMap:t,connector:e,item:i,adapterOptions:o={},idPrefix:r="first-show-adapter"}){return Zs({webMap:t,adapterOptions:o,onLayerAdded:t=>{t.options.baselayer=!1,t.id=r+"-"+i.resource_id},createAdapter:()=>qh({resource:i.resource_id,adapterOptions:{name:i.display_name,opacity:i.opacity}},t,e)})},new Promise((t,r)=>{var n=t=>{try{a(o.next(t))}catch(e){r(e)}},s=t=>{try{a(o.throw(t))}catch(e){r(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(n,s);a((o=o.apply(e,i)).next())});var e,i,o}var Ns=Object.defineProperty,Rs=Object.getOwnPropertySymbols,qs=Object.prototype.hasOwnProperty,Fs=Object.prototype.propertyIsEnumerable,Us=(t,e,i)=>e in t?Ns(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ws=(t,e)=>{for(var i in e||(e={}))qs.call(e,i)&&Us(t,i,e[i]);if(Rs)for(var i of Rs(e))Fs.call(e,i)&&Us(t,i,e[i]);return t};const Hs={srs:4326,geom_format:"geojson",dt_format:"iso"};function Vs(t){return{geometry:t.geom,id:t.id,type:"Feature",properties:t.fields}}function Gs(t,e){const{extensions:i,geom:o,fields:r,srs:n,ilike:s,like:a}=e;t.extensions=i||[],r&&(t.fields=r),void 0!==o&&(t.geom=o,o||(delete t.srs,delete t.geom_format)),tt(s)?t.ilike=s:tt(a)&&(t.like=a),tt(n)&&(t.srs=n)}function Js(t){return`POLYGON((${t.map(([t,e])=>{const[i,o]=ot(t,e).map(t=>Math.round(1*(t+Number.EPSILON))/1);return i+" "+o}).join(", ")}))`}function Ks(t){const e=Ws({},Hs),{limit:i,query:o,cache:r,signal:n,offset:s,orderBy:a,paramList:l,connector:c,geomFormat:h,intersects:u,resourceId:p}=t;if("number"==typeof i&&i!==Number.POSITIVE_INFINITY&&(e.limit=i),s&&(e.offset=s),h&&(e.geom_format=h),Gs(e,t),a&&(e.order_by=a.join(",")),Array.isArray(u)){const t=function(t){return Array.isArray(t)&&4===t.length&&t.every(t=>"number"==typeof t)}(u)?nt(u):u;e.intersects=Js(t)}else"string"==typeof u&&(e.intersects=u);return l&&Object.assign(e,function(t){return t.reduce((t,[e,i])=>(t[e]=i,t),{})}(l)),c.route("feature_layer.feature.collection",{id:Number(p)}).get({query:Ws(Ws({},e),o),cache:r,signal:n})}function Ys(t){let e;for(e in t){const i=t[e];if(pt(i)){const o=i;if(tt(o.year)&&tt(o.month)&&tt(o.day)){const i=[o.year,o.month-1,o.day];"hour"in o&&[o.hour,o.minute,o.second].forEach(t=>{i.push(t)}),t[e]=new Date(...i).toISOString()}}else"id"===e&&"string"==typeof i&&(t[e]=i.split(",").map(Number))}return t}function $s(t){return Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]}function Qs(t){return Array.isArray(t)&&!$s(t)}function Xs(t){return"id"===t?["fid"]:["get",t]}function ta(t){const[e,i,o]=t,r=String(e),n=Xs(r);switch(i){case"eq":return null===o?["is_null",n]:["==",n,o];case"ne":return null===o?["!is_null",n]:["!=",n,o];case"gt":if("number"!=typeof o&&"string"!=typeof o)throw new Error(`Operator "gt" requires number or string for "${r}"`);return[">",n,o];case"lt":if("number"!=typeof o&&"string"!=typeof o)throw new Error(`Operator "lt" requires number or string for "${r}"`);return["<",n,o];case"ge":if("number"!=typeof o&&"string"!=typeof o)throw new Error(`Operator "ge" requires number or string for "${r}"`);return[">=",n,o];case"le":if("number"!=typeof o&&"string"!=typeof o)throw new Error(`Operator "le" requires number or string for "${r}"`);return["<=",n,o];case"in":if(!Array.isArray(o)||!o.every(t=>"string"==typeof t||"number"==typeof t))throw new Error(`Operator "in" requires (string | number)[] for "${r}"`);if(!o.length)throw new Error(`Operator "in" requires non-empty array for "${r}"`);return["in",n,...o];case"notin":if(!Array.isArray(o)||!o.every(t=>"string"==typeof t||"number"==typeof t))throw new Error(`Operator "notin" requires (string | number)[] for "${r}"`);if(!o.length)throw new Error(`Operator "notin" requires non-empty array for "${r}"`);return["!in",n,...o];case"ilike":{if("string"!=typeof o)throw new Error(`Operator "ilike" requires string for "${r}"`);const t=function(t){const e=t.startsWith("%"),i=t.endsWith("%");return{field:t.slice(e?1:0,i?-1:void 0),leadingWildcard:e,trailingWildcard:i}}(r),e=`${t.leadingWildcard?"%":""}${o}${t.trailingWildcard?"%":""}`;return["ilike",Xs(t.field),e]}case"like":throw new Error(`Operator "${i}" is not supported by server FilterExpression`);default:throw new Error(`Unsupported operator: ${i}`)}}function ea(t){let e="all";const i=[];for(const o of t)if("all"!==o&&"any"!==o)if($s(o))i.push(ta(o));else{if(!Qs(o))throw new Error("Invalid PropertiesFilter node");i.push(ea(o))}else e=o;return[e,...i]}function ia(t){return(null==t?void 0:t.length)?ea(t):[]}function oa(t){if(null==t?void 0:t.length)return JSON.stringify(ia(t))}var ra=Object.defineProperty,na=Object.defineProperties,sa=Object.getOwnPropertyDescriptors,aa=Object.getOwnPropertySymbols,la=Object.prototype.hasOwnProperty,ca=Object.prototype.propertyIsEnumerable,ha=(t,e,i)=>e in t?ra(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ua=(t,e)=>{for(var i in e||(e={}))la.call(e,i)&&ha(t,i,e[i]);if(aa)for(var i of aa(e))ca.call(e,i)&&ha(t,i,e[i]);return t},pa=(t,e)=>na(t,sa(e)),da=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});function fa(t){return da(this,null,function*(){var e;const i=t.filters;if(i){let o=yield Ks(pa(ua({},t),{query:pa(ua({},t.query),{filter:oa(i)})}));return null!=(e=t.clientFilterValidate)&&e&&(o=o.filter(t=>Oe(Ys(pa(ua({},t.fields),{id:t.id})),i))),o}return Ks(t)})}function ma({options:t,webMap:e,baseUrl:i}){var o;let r,n=t.adapter||"IMAGE";const s=e&&e.getLayerAdapters(),a=t.resource,l=t.tileNoData?t.tileNoData:200;if("number"==typeof a){if("IMAGE"===n){if(!s||s.IMAGE)return function({resourceId:t,baseUrl:e,nd:i,headers:o}){const r=e+"/api/component/render/image",n={resource:t};return i&&(n.nd=i),{url:r,resourceId:t,headers:o,params:n,updateWmsParams:e=>(i&&(e.nd=i),lc(e,t))}}({resourceId:a,headers:t.headers,nd:l,baseUrl:i});n="TILE"}if("WMS"===n){r=`${i}/api/resource/${a}/wms`;const e=t.adapterOptions;return{url:r,format:"image/png",version:"1.1.1",layers:e&&e.layers,headers:t.headers}}if("MVT"===n)return r=i+"/api/component/feature_layer/mvt?x={x}&y={y}&z={z}&resource="+a+"&simplification="+(null!=(o=t.simplification)?o:6),{url:r,sourceLayer:"ngw:"+a,featureIdName:"$id"};if("TERRAIN"===n)return r=i+`/api/resource/${a}/terrain_provider`,{url:r,adapter:n};if("MODEL_3D"===n)return r=i+`/api/component/model_3d/${a}/data.glb`,{url:r};if("TILE"===n)return r=i+"/api/component/render/tile?z={z}&x={x}&y={y}&resource="+a+"&nd="+l,{url:r,adapter:n}}else{if(void 0!==a)throw new Error("Option `resource` must be number, not "+typeof a);console.log("Option `resource` not set")}}var ga=Object.defineProperty,ya=Object.defineProperties,_a=Object.getOwnPropertyDescriptors,ba=Object.getOwnPropertySymbols,va=Object.prototype.hasOwnProperty,wa=Object.prototype.propertyIsEnumerable,xa=(t,e,i)=>e in t?ga(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Pa=(t,e)=>{for(var i in e||(e={}))va.call(e,i)&&xa(t,i,e[i]);if(ba)for(var i of ba(e))wa.call(e,i)&&xa(t,i,e[i]);return t},La=(t,e)=>ya(t,_a(e)),Oa=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});function Ca(t){return Oa(this,null,function*(){const e=Pa({},Hs);Gs(e,t);const i=yield t.connector.route("feature_layer.feature.item",{id:Number(t.resourceId),fid:t.featureId}).get(La(Pa({},t),{query:e}));return La(Pa({},i),{toGeojson:()=>Oa(null,null,function*(){if(i.geom)return Vs(i);{const e=(yield Ca(La(Pa({},t),{geom:!0,fields:null,extensions:null}))).geom;return Vs(La(Pa({},i),{geom:e}))}})})})}var ka=Object.defineProperty,Ea=Object.getOwnPropertySymbols,Ma=Object.prototype.hasOwnProperty,Aa=Object.prototype.propertyIsEnumerable,Sa=(t,e,i)=>e in t?ka(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ta=(t,e,i)=>Sa(t,"symbol"!=typeof e?e+"":e,i);class Ia{constructor(t){Ta(this,"options",t),Ta(this,"name"),Ta(this,"resourceId"),Ta(this,"item"),Ta(this,"_extent"),this.resourceId=t.resourceId;const e=t.item;this.item=e,this.name=t.labelField&&e.fields?e.fields[t.labelField]:String(e.id)}extent(t){return this._extent?Promise.resolve(this._extent):this.options.connector.route("feature_layer.feature.item_extent",{id:this.resourceId,fid:this.item.id}).get(t).then(t=>{if(t.extent){const{minLat:e,minLon:i,maxLat:o,maxLon:r}=t.extent,n=[i,e,r,o];return this._extent=n,n}})}geoJson(t){return this.item.geom?Promise.resolve(Vs(this.item)):Ca(((t,e)=>{for(var i in e||(e={}))Ma.call(e,i)&&Sa(t,i,e[i]);if(Ea)for(var i of Ea(e))Aa.call(e,i)&&Sa(t,i,e[i]);return t})({resourceId:this.resourceId,featureId:this.item.id,connector:this.options.connector,geom:!0,fields:null,extensions:null},t)).then(t=>(this.item.geom=t.geom,Vs(this.item)))}}var za=Object.defineProperty,ja=(t,e,i)=>((t,e,i)=>e in t?za(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Ba{constructor(t,e,i){ja(this,"options"),ja(this,"emitter",new H),ja(this,"name"),ja(this,"item"),ja(this,"_blocked",!1),ja(this,"_container"),ja(this,"__value"),ja(this,"_removeEventsListener"),this.item=e,this.options=Object.assign({},i),this.name=t,this._value=this.getProperty()}set _value(t){this.__value=t}get _value(){return this.__value}getProperty(){return"function"==typeof this.options.getProperty?this.options.getProperty.call(this,this.item):this.options.value}getParents(){return this.item.tree.getParents()||[]}getParent(){return this.item.tree.getParent()}getChildren(){return this.item.tree.getChildren()}isGroup(){return this.item.tree.getDescendants().length}isBlocked(){if(void 0!==this._blocked)return this._blocked;const t=this.item.tree.getParents();return this._blocked=this._calculateBlockedStatus(t),this._blocked}set(t,e){this._value=this._prepareValue(t),this.update(this._value,e),this._fireChangeEvent(this._value,e)}get(){return this.getValue()}update(t,e){this._callOnSet(t,e)}getContainer(){return this._container}destroy(){if(this._container){const t=this._container.parentNode;t&&t.removeChild(this._container)}this._removeEventsListener&&this._removeEventsListener()}getValue(){return void 0!==this._value?this._value:this.getProperty()}_prepareValue(t){return t}_callOnSet(t,e){this.options.onSet&&this.options.onSet.call(this,t,e,this.item)}_fireChangeEvent(t,e){if(this.emitter){t=void 0!==t?t:this.getValue(),this.emitter.emit("change",{value:t,options:e});this.item.tree.getParents().forEach(i=>{const o=i.properties&&i.properties.property(this.name);o&&o.emitter.emit("change-tree",{value:t,options:e,item:this.item})})}}_calculateBlockedStatus(t){return t.some(t=>{var e;const i=null==(e=t.properties)?void 0:e.property(this.name);return!!i&&!i.get()})}}var Za=Object.defineProperty,Da=Object.getOwnPropertySymbols,Na=Object.prototype.hasOwnProperty,Ra=Object.prototype.propertyIsEnumerable,qa=(t,e,i)=>e in t?Za(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Fa=(t,e)=>{for(var i in e||(e={}))Na.call(e,i)&&qa(t,i,e[i]);if(Da)for(var i of Da(e))Ra.call(e,i)&&qa(t,i,e[i]);return t};const Ua=class t extends Ba{constructor(e,i,o){super(e,i,Fa(Fa({},t.options),o)),this.set(this.get())}update(t,e){if(t){if(e&&e.bubble||this.options.bubble){this.unBlock(e);const i=this.getParent(),o=i&&i.properties&&i.properties.property(this.name);o&&o.set(t,Object.assign({},e,{bubble:!0,propagation:!1}))}this.isBlocked()||this._turnOn(e)}else this._turnOff(e);(e&&e.propagation||this.options.propagation)&&this._propagation(t,e)}getHierarchyValue(){return this.get()&&this.getParents().every(t=>{const e=t.properties&&t.properties.get(this.name);return e&&e.get()})}block(t){this._blocked=!0,this._block(t)}unBlock(t){this._blocked=!1;this.getValue()&&this._unBlock(t)}blockChild(t){this.item.tree.getDescendants().forEach(e=>this._blockChild(e,t))}unblockChild(t){this.item.tree.getChildren().forEach(e=>this._unBlockChild(e,t))}_prepareValue(t){return t}_turnOff(t){this.options.turnOff&&this.options.turnOff.call(this,t),this._callOnSet(!1,t),this.options.hierarchy&&this.isGroup()&&this.blockChild(t)}_turnOn(t){this.options.turnOn&&this.options.turnOn.call(this,t),this._callOnSet(!0,t),this.options.hierarchy&&this.isGroup()&&this.unblockChild(t)}_block(t){this._turnOff(t)}_unBlock(t){this._turnOn(t)}_blockChild(t,e){const i=t.properties&&t.properties.property(this.name);i&&i.block&&i.block(Fa({silent:!0},e||{}))}_unBlockChild(t,e){const i=t.properties&&t.properties.property(this.name);i&&i.unBlock&&i.unBlock(Fa({silent:!0},e||{}))}_propagation(t,e){if(this.isGroup()){const i=this.item.tree.getChildren();for(let o=0;o<i.length;o++){const r=i[o],n=r.properties&&r.properties.property(this.name);n&&n.set(t,Fa(Fa({},e),{propagation:!0,bubble:!1}))}}}};qa(Ua,"options"+"",{hierarchy:!0,bubble:!1,propagation:!1,label:"Toggle"});let Wa=Ua;var Ha=Object.defineProperty,Va=Object.getOwnPropertySymbols,Ga=Object.prototype.hasOwnProperty,Ja=Object.prototype.propertyIsEnumerable,Ka=(t,e,i)=>e in t?Ha(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ya=(t,e,i)=>Ka(t,"symbol"!=typeof e?e+"":e,i);const $a=class t{constructor(t,e){Ya(this,"item",t),Ya(this,"options",{}),Ya(this,"_properties",{}),Ya(this,"_propertiesList",[]),e&&e.forEach(this._setPropertyHandler.bind(this))}add(t){this._setPropertyHandler(t)}update(){this.list().forEach(t=>t.update())}get(t){const e=this.property(t);return e?e.get():void 0}set(t,e,i){const o=this.property(t);o&&o.getValue()!==e&&o.set(e,i)}property(t){return this._properties[t]}list(){return this._propertiesList.map(t=>this._properties[t])}destroy(){for(const t in this._properties){const e=this.property(t);e&&e.destroy&&e.destroy()}this._properties={},this._propertiesList=[]}_setPropertyHandler(t){const e=this._getHandler(t);if(e&&t.name){const i=((t,e)=>{for(var i in e||(e={}))Ga.call(e,i)&&Ka(t,i,e[i]);if(Va)for(var i of Va(e))Ja.call(e,i)&&Ka(t,i,e[i]);return t})({},t);this._properties[t.name]=new e(t.name,this.item,i),this._propertiesList.push(t.name)}}_getHandler(e){const i=e.handler;return!i&&e.type?"boolean"===e.type?t.handlers.CheckProperty:t.handlers.BaseProperty:i}};Ya($a,"handlers",{CheckProperty:Wa});let Qa=$a;function Xa(t,e,i,o){return!!il(t,e,i,ol)}function tl(t,e,i,o){return il(t,e,i,rl)}function el(t,e="children"){let i=[];const o=("function"==typeof e?e:t=>t[e])(t);return o&&(Array.isArray(o)?i=o:i.push(o)),o?i:void 0}function il(t,e=t=>!!t,i="children",o,r){return o(t,"function"==typeof e?e:t=>Oe(t,e),i)}function ol(t,e=t=>!!t,i,o=[]){let r=[];if(Array.isArray(t))r=t;else{if(e(t))return t;const o=el(t,i);o&&(r=o)}for(let n=0;n<r.length;n++)if(r[n]){const t=ol(r[n],e,i,o);if(t)return t}}function rl(t,e=t=>!!t,i,o=[]){let r=[];if(Array.isArray(t))r=t;else{e(t)&&o.push(t);const n=el(t,i);n&&(r=n)}for(let n=0;n<r.length;n++)r[n]&&rl(r[n],e,i,o);return o}function nl(t,e=t=>!!t,i,o=[]){let r=[];if(Array.isArray(t))r=t;else{if(!e(t))return!1;const o=el(t,i);o&&(r=o)}for(let n=0;n<r.length;n++)if(r[n]){if(!nl(r[n],e,i,o))return!1}return!0}var sl=Object.defineProperty,al=(t,e,i)=>((t,e,i)=>e in t?sl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class ll{constructor(t){al(this,"item"),al(this,"_children",[]),al(this,"_parent"),this.item=t}setParent(t){this._parent=t}addChild(t){this._children.push(t)}getParent(){return this._parent}getParents(t){const e=this.getParent();return e?tl(e,t,t=>t.tree.getParent()):[]}getRoot(){let t=this.getParent(),e=t;for(;t;)t=t.tree.getParent(),t&&(e=t);return e}find(t){return il(this._children,t,t=>t.tree.getChildren(),ol)}every(t){return!!il(this._children,t,t=>t.tree.getChildren(),nl)}some(t){return Xa(this._children,t,t=>t.tree.getChildren())}all(t){return this.getDescendants(t)}getDescendants(t){return tl(this._children,t,t=>t.tree.getChildren())}getChildren(){return[...this._children]}}var cl=Object.defineProperty,hl=Object.getOwnPropertySymbols,ul=Object.prototype.hasOwnProperty,pl=Object.prototype.propertyIsEnumerable,dl=(t,e,i)=>e in t?cl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,fl=(t,e,i)=>dl(t,"symbol"!=typeof e?e+"":e,i);let ml=0;class gl{constructor(t){fl(this,"options",{}),fl(this,"properties"),fl(this,"tree"),fl(this,"id",ml),ml+=1,this.options=((t,e)=>{for(var i in e||(e={}))ul.call(e,i)&&dl(t,i,e[i]);if(hl)for(var i of hl(e))pl.call(e,i)&&dl(t,i,e[i]);return t})({},t),this.tree=new ll(this)}initProperties(){this.properties=new Qa(this,this.options.properties)}}function yl(t,e){return{[`symbols[${t}]`]:e.join(",")||void 0}}var _l=Object.defineProperty,bl=Object.defineProperties,vl=Object.getOwnPropertyDescriptors,wl=Object.getOwnPropertySymbols,xl=Object.prototype.hasOwnProperty,Pl=Object.prototype.propertyIsEnumerable,Ll=(t,e,i)=>e in t?_l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ol=(t,e)=>{for(var i in e||(e={}))xl.call(e,i)&&Ll(t,i,e[i]);if(wl)for(var i of wl(e))Pl.call(e,i)&&Ll(t,i,e[i]);return t},Cl=(t,e,i)=>Ll(t,"symbol"!=typeof e?e+"":e,i);class kl{constructor({legendSymbols:t,resourceId:e,connector:i,layerId:o,legend:r,webMap:n,layer:s,onSymbolRenderChange:a}){Cl(this,"layerId"),Cl(this,"layer"),Cl(this,"resourceId"),Cl(this,"legendSymbols","expand"),Cl(this,"legend"),Cl(this,"layerVisibility",!0),Cl(this,"onSymbolRenderChange"),Cl(this,"webMap"),Cl(this,"connector"),t&&(this.legendSymbols=t),this.connector=i,this.layer=s,this.layerId=o,r&&(this.legend=this.createLegend(r)),this.resourceId=e,this.webMap=n,this.onSymbolRenderChange=a}attachLayer(t){this.layerId=String(t.id),this.layer=t}create(){return t=this,e=arguments,i=function*(t={}){if(this.connector){const e=yield this.connector.route("render.legend_symbols",{id:this.resourceId}).get(Ol({},t));return this.legend=e,this.createLegend(e)}},new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});var t,e,i}createLegend(t){return t.map(t=>{return e=Ol({},t),bl(e,vl({name:t.display_name,symbol:t.icon}));var e})}setSymbolRender(t,e){if(this.legend){const i=this.legend.find(e=>e.index===t);if(i){if(i.render!==e){i.render=e;const t=this.legend.filter(t=>t.render).map(t=>t.index);this.setLegendSymbol(t),this.onSymbolRenderChange&&this.onSymbolRenderChange(t)}}}}setLegendSymbol(t){const e=this._consolidateIntervals(t);e.length||this._hideLayer(),this.layer.updateLayer&&this.layer.updateLayer({params:Ol({},yl(this.resourceId,e))}),e.length&&this._showLayer()}_hideLayer(){this.layer.options.id&&this.webMap.mapAdapter.hideLayer(this.layer.layer)}_showLayer(){this.layer.options.id&&this.layerVisibility&&this.webMap.showLayer(this.layer.options.id,{silent:!0})}_consolidateIntervals(t){const e=t.slice().sort((t,e)=>t-e),i=[];let o=e[0],r=o;for(let n=1;n<=e.length;n++)e[n]===r+1?r=e[n]:(i.push(o===r?`${o}`:`${o}-${r}`),o=e[n],r=o);return i}}var El=Object.defineProperty,Ml=Object.defineProperties,Al=Object.getOwnPropertyDescriptors,Sl=Object.getOwnPropertySymbols,Tl=Object.prototype.hasOwnProperty,Il=Object.prototype.propertyIsEnumerable,zl=(t,e,i)=>e in t?El(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,jl=(t,e)=>{for(var i in e||(e={}))Tl.call(e,i)&&zl(t,i,e[i]);if(Sl)for(var i of Sl(e))Il.call(e,i)&&zl(t,i,e[i]);return t},Bl=(t,e)=>Ml(t,Al(e)),Zl=(t,e,i)=>zl(t,"symbol"!=typeof e?e+"":e,i),Dl=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});const Nl=class t extends gl{constructor({webMap:e,item:i,options:o,connector:r,parent:n,noInit:s}){if(super(jl(jl({},t.options),o)),Zl(this,"item"),Zl(this,"webMap"),Zl(this,"connector"),Zl(this,"layer"),Zl(this,"legend"),Zl(this,"emitter",new H),Zl(this,"_rootDescendantsCount",0),this.webMap=e,r&&(this.connector=r),n&&this.tree.setParent(n),this.item=i,"root"===this.item.item_type)this._rootDescendantsCount=this._sumUp(this.item.children);else{const t=this.tree.getRoot();t&&(this._rootDescendantsCount=t._rootDescendantsCount)}this.initProperties(),s||this._init(i)}static create(e,i,o,r,n){return Dl(this,null,function*(){const s=new t({webMap:e,item:i,options:o,connector:r,parent:n,noInit:!0});return yield s._init(i),s})}initItem(t){return"group"===t.item_type||"root"===t.item_type?this.initGroupItem(t):this.initLayerItem(t)}bringToFront(){}fit(){}getLayer(){return this.layer}getLegend(t){return Dl(this,null,function*(){var e,i;const o=null==(e=this.layer)?void 0:e.id;if(void 0!==o){if(this.connector&&"resourceId"in this.item){const e=Number(this.item.resourceId);if("layer"===this.item.item_type&&this.layer){const r=new kl({connector:this.connector,layerId:o,layer:this.layer,resourceId:e,webMap:this.webMap,legendSymbols:null!=(i=this.item.legend_symbols)?i:void 0,onSymbolRenderChange:t=>{this.webMap.emitter.emit("event-symbol-render:change",{layerId:o,resourceId:e,indexes:t})}});return yield r.create(t),[r]}return[]}}return[]})}getItemOptions(t){const e="layer"===t.item_type&&t.layer_transparency,i="number"==typeof e?(100-e)/100:void 0,o=Bl(jl({visibility:!1,name:t.display_name},this.options),{params:{resource:"resourceId"in this.item?this.item.resourceId:void 0,item:this.item}});if(delete o.id,this.options.order){const e=String(this.options.drawOrderEnabled&&"draw_order_position"in t&&null!=t.draw_order_position?this._rootDescendantsCount-t.draw_order_position:this.id).padStart(4,"0");o.order=Number((0|this.options.order)+"."+e)}if(this.options.popupOptions&&(o.popupOptions=this.options.popupOptions),"layer"===t.item_type){const{maxZoom:e,minZoom:i}=this._getZoomRange(t);Object.assign(o,Bl(jl({updateWmsParams:t.updateWmsParams},o),{url:t.url,maxZoom:e,minZoom:i,minScale:t.layer_min_scale_denom,maxScale:t.layer_max_scale_denom,interactive:t.layer_identifiable}))}return void 0!==i&&(o.opacity=i),o}getChildren(t){return[...t.children].reverse()}_mapScaleToZoomLevel(t){return function(t,e=0){const i=e,o=function(){if(void 0===hc){const t=document.createElement("div");t.style.cssText="position: absolute; left: -100%; top: -100%; width: 100cm;",document.body.appendChild(t);const e=t.offsetWidth;document.body.removeChild(t),hc=e}return hc}()*function(t){return 12756274*Math.PI*Math.cos(t*Math.PI/180)}(i)/t;return function(t){return Math.log(t/256)/Math.LN2}(o)}(t)}initGroupItem(t){if(t.children&&t.children.length){const e=this.getChildren(t);for(const t of e){const e=new this.constructor({webMap:this.webMap,item:t,options:this.options,connector:this.connector,parent:this});this.tree.addChild(e)}}return"group"!==this.item.item_type||t.group_enabled||this.properties.property("visibility").set(!1),Promise.resolve()}initLayerItem(e){const i=this.getItemOptions(e),o=t=>{e._layer=t,this.layer=t;this.properties.get("visibility")&&this.properties.set("visibility",!0),null!=i.opacity&&this.webMap.setLayerOpacity(t,i.opacity)};let r;if("layer"===e.item_type)r=e.adapter||e.layer_adapter.toUpperCase();else if(t.GetAdapterFromLayerType[e.item_type]){r=(0,t.GetAdapterFromLayerType[e.item_type])(e,i,this.webMap,this.connector)}return r?this.webMap.addLayer(r,i).then(t=>{this.webMap.emitter.on(`layer-${t.id}:toggle`,e=>{const i=this.properties.get("visibility"),o=this.webMap.isLayerVisible(t);i!==o&&this.properties.set("visibility",o)}),o(t)}):e._layer?Promise.resolve(o(e._layer)):Promise.reject("No layer added")}_getZoomRange(t){const e=this.options.minZoom,i=this.options.maxZoom,o=t.layer_min_scale_denom?this._mapScaleToZoomLevel(t.layer_min_scale_denom):void 0,r=t.layer_max_scale_denom?this._mapScaleToZoomLevel(t.layer_max_scale_denom):void 0,n=[e,o].filter(Boolean),s=[i,r].filter(Boolean);return{minZoom:n.length?Math.max(...n):void 0,maxZoom:s.length?Math.min(...s):void 0}}_init(t){this.initItem(t).then(()=>{this.emitter.emit("init")})}_sumUp(t,e=0){for(const i of t)"layer"===i.item_type?(e+=1,i.draw_order_position=i.draw_order_position||e):"group"===i.item_type&&(e=this._sumUp(i.children,e));return e}};Zl(Nl,"GetAdapterFromLayerType",{}),Zl(Nl,"options",{properties:[{type:"boolean",name:"visibility",getProperty(t){if(t){if("group"===t.item.item_type)return t.item.group_enabled;if("root"===t.item.item_type)return Xa(t.item,t=>"layer_enabled"in t&&t.layer_enabled,t=>t.children);if("layer"===t.item.item_type)return t.item.layer_enabled}return!1},onSet(t,e,i){"group"===(null==i?void 0:i.item.item_type)?i.item.group_enabled=t:"layer"===(null==i?void 0:i.item.item_type)&&(i.layer&&(t?i.webMap.showLayer(i.layer,e):i.webMap.hideLayer(i.layer,e)),i.item.layer_enabled=t)}},{name:"opacity",handler:class extends Ba{getProperty(){const t=this.item.layer;return t&&t&&t.options&&null!=t.options.opacity?t.options.opacity:1}update(t,e){if(e=e||{},this.isGroup()){this._value=this._prepareValue(t,e);const i=this.getChildren();for(const o of i){const i=o.properties.property(this.name);i&&(e.propagation?i.set(t,e):i.update(i.get(),e))}}const i=this.item.layer;if(i){const e=this.getParents().reduce((t,e)=>{const i=e.properties.property(this.name);return t*(i?i.getValue():1)},1);this.item.webMap.setLayerOpacity(i,this._prepareValue(t*e))}}_prepareValue(t,e){return e&&e.propagation&&this.isGroup()?1:Number(t)}}}]});let Rl=Nl;var ql=Object.defineProperty,Fl=Object.defineProperties,Ul=Object.getOwnPropertyDescriptors,Wl=Object.getOwnPropertySymbols,Hl=Object.prototype.hasOwnProperty,Vl=Object.prototype.propertyIsEnumerable,Gl=(t,e,i)=>e in t?ql(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Jl=(t,e)=>{for(var i in e||(e={}))Hl.call(e,i)&&Gl(t,i,e[i]);if(Wl)for(var i of Wl(e))Vl.call(e,i)&&Gl(t,i,e[i]);return t},Kl=(t,e,i)=>Gl(t,"symbol"!=typeof e?e+"":e,i),Yl=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});class $l{constructor(t,e){Kl(this,"map",t),Kl(this,"options",e),Kl(this,"layer"),Kl(this,"NgwWebmapItem",Rl),Kl(this,"pixelRadius",10),Kl(this,"resourceId"),Kl(this,"webmapClassName","webmap"),Kl(this,"emitter",new H),Kl(this,"_extent"),Kl(this,"webmapResource"),Kl(this,"_webmapBaselayersIds",[]),Kl(this,"_lastActiveBaselayer");const i=e.resourceId;if(Array.isArray(i)?(this.resourceId=i[0],this.options.id=i[1]):this.resourceId=i,!this.resourceId)throw new Error("NGW `resourceId` is not defined")}addLayer(t){return Yl(this,null,function*(){var e;this.options=Jl(Jl({},this.options),t),this.layer=yield this._getWebMapLayerItem();const i=null==(e=this.webmapResource)?void 0:e.constraining_extent;return this.options.useExtentConstrained&&this._extent&&i&&this.options.webMap.setView({maxBounds:this._extent}),this.layer})}removeLayer(){const t=this.options.webMap.mapAdapter;if(this.getDependLayers().forEach(e=>{"layer"in e&&t.removeLayer(e.layer.layer)}),this._webmapBaselayersIds.length){for(const t of this._webmapBaselayersIds)this.options.webMap.removeLayer(t);this._lastActiveBaselayer&&this.options.webMap.showLayer(this._lastActiveBaselayer)}this.options.useExtentConstrained&&this._extent&&this.options.webMap.setView({maxBounds:null}),delete this.layer,delete this.webmapResource}showLayer(){return Yl(this,null,function*(){if(this.layer&&this.layer.properties)return this.layer.properties.property("visibility").set(!0)})}hideLayer(){return Yl(this,null,function*(){if(this.layer&&this.layer.properties)return this.layer.properties.property("visibility").set(!1)})}setOpacity(t){return Yl(this,null,function*(){if(this.layer&&this.layer.properties)return this.layer.properties.property("opacity").set(t)})}getExtent(){return this.getBounds()}getBounds(){const t=this.webmapResource;if(t)return ws(t)}getDependLayers(){return this.layer&&this.layer.tree.getDescendants()||[]}getBookmarksResourceId(){const t=this.webmapResource;if(t&&t.bookmark_resource)return t.bookmark_resource.id}fetchBookmarks(t){const e=this.getBookmarksResourceId(),i=this.options.connector;if(e)return i.getResourceOrFail(e,t).then(o=>{var r;const n=null==(r=o.feature_layer)?void 0:r.fields.find(t=>t.label_field),s=n&&n.keyname;return fa(Jl({connector:i,resourceId:e,geom:!1,fields:s?[s]:void 0},t)).then(t=>{const o=[];for(const r of t){const t=new Ia({item:r,resourceId:e,labelField:s,connector:i});o.push(t)}return o})});throw new Error("Webmap was not loaded correctly, it is impossible to extract bookmarks")}getLegend(t){return Yl(this,null,function*(){const e=[];let i=this.getDependLayers();i=i.sort((t,e)=>e.id-t.id);for(const o of i){const i=yield o.getLegend(t);e.push(...i)}return e})}getIdentificationIds(t){return Yl(this,null,function*(){const t=[];let e=this.getDependLayers();return e=e.sort((t,e)=>e.id-t.id),e.forEach(e=>{const i=e.item,o="style_parent_id"in i?i.style_parent_id:void 0;if(null!=o&&"layer"===i.item_type&&i.layer_identifiable){const i=e.properties.property("visibility");i.get()&&!i.isBlocked()&&t.push(o)}}),t})}_getWebMapLayerItem(){return Yl(this,null,function*(){if(!this.resourceId)return;const t=yield this.getWebMapConfig(this.resourceId);return t&&t.root_item?new Promise(e=>{var i;const o=this.options.connector,r=(null==o?void 0:o.options.auth)?o.getAuthorizationHeaders():void 0,n=o.withCredentials,s=(a=Jl({},this.options),l={withCredentials:n,headers:r,drawOrderEnabled:null!=(i=t.draw_order_enabled)&&i},Fl(a,Ul(l)));var a,l;const c=new this.NgwWebmapItem({webMap:this.options.webMap,item:t.root_item,options:s,connector:o});c.emitter.on("init",()=>{e(c)})}):void 0})}getWebMapConfig(t){return Yl(this,null,function*(){var e;const i=yield this.options.connector.getResource(t);if(i){const t=i[this.webmapClassName];if(this.webmapResource=t,this._setupBaselayers(i),t)return this._extent=null!=(e=t.initial_extent)?e:void 0,this._updateItemsParams(t.root_item,this.options.webMap,i),t}})}_setupBaselayers(t){var e;const i=this.options.webMap;if(null==(e=this.options.useBasemap)||e)if(t.basemap_webmap&&t.basemap_webmap.basemaps.length){const e=i.getActiveBaseLayer();this._lastActiveBaselayer=e?e.id:void 0,this._setBasemaps(t.basemap_webmap)}else this.options.defaultBasemap&&i.addBaseLayer("OSM",{id:"webmap-default-baselayer",name:"OpenStreetMap"})}_setBasemaps(t){const e=this.options.webMap;let i=!1;for(const o of t.basemaps)Ds({webMap:e,connector:this.options.connector,item:o,adapterOptions:{crossOrigin:this.options.crossOrigin}}).then(t=>{const r=!i&&o.enabled;return o.enabled&&(i=!0),e.addBaseLayer(t,{id:"webmap-baselayer"+o.resource_id,name:o.display_name,opacity:o.opacity,visibility:r}).then(t=>{t.id&&this._webmapBaselayersIds.push(t.id)})})}_updateItemsParams(t,e,i){var o;if(t)if("group"===t.item_type||"root"===t.item_type){if("children"in t&&t.children){const o=t.children.map(t=>this._updateItemsParams(t,e,i));t.children=o}"root"===t.item_type&&(t.display_name=i.resource.display_name)}else if("layer"===t.item_type){const i=t,o=dt(this.options.connector.options.baseUrl+"/api/component/render/image"),r=i.layer_style_id;i.url=o,i.resourceId=r,i.updateWmsParams=t=>lc(t,r);const n=ma({options:{adapter:i.layer_adapter.toUpperCase(),resource:r},webMap:e,baseUrl:this.options.connector.options.baseUrl||""});t=Jl(Jl({},i),n)}return"function"==typeof(null==(o=this.options.nativeOptions)?void 0:o.beforeItemCreated)&&(t=this.options.nativeOptions.beforeItemCreated(t)),t}}var Ql=Object.defineProperty,Xl=Object.defineProperties,tc=Object.getOwnPropertyDescriptors,ec=Object.getOwnPropertySymbols,ic=Object.prototype.hasOwnProperty,oc=Object.prototype.propertyIsEnumerable,rc=(t,e,i)=>e in t?Ql(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,nc=(t,e)=>{for(var i in e||(e={}))ic.call(e,i)&&rc(t,i,e[i]);if(ec)for(var i of ec(e))oc.call(e,i)&&rc(t,i,e[i]);return t},sc=(t,e)=>Xl(t,tc(e)),ac=(t,e)=>{var i={};for(var o in t)ic.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&ec)for(var o of ec(t))e.indexOf(o)<0&&oc.call(t,o)&&(i[o]=t[o]);return i};function lc(t,e){const i=t,{bbox:o,width:r,height:n,nd:s}=i,a=ac(i,["bbox","width","height","nd"]);return sc(nc({},a),{resource:Array.isArray(e)?e.join(","):e,extent:o,size:r+","+n,timestamp:Date.now(),nd:null!=s?s:200})}const cc={POINT:"point",LINESTRING:"line",POLYGON:"polygon",MULTIPOINT:"point",MULTILINESTRING:"line",MULTIPOLYGON:"polygon",POINTZ:"point",LINESTRINGZ:"line",POLYGONZ:"polygon",MULTIPOINTZ:"point",MULTILINESTRINGZ:"line",MULTIPOLYGONZ:"polygon"};let hc;function uc(t){if(!t)return;const e=t.match(/^(?:SRID=(\d+);)?POLYGON\s*\(\((.+)\)\)\s*$/i);if(!e||e[1]&&"4326"!==e[1])return;const i=e[2].split(",").map(t=>t.trim().split(/\s+/).map(Number)).filter(t=>t.length>=2&&Number.isFinite(t[0])&&Number.isFinite(t[1]));if(!i.length)return;const o=i.map(t=>t[0]),r=i.map(t=>t[1]);return[Math.min(...o),Math.min(...r),Math.max(...o),Math.max(...r)]}function pc(t){return t.replace(/^(http|ftp):\/\//,"https://")}function dc(t){const e=function(t){return t?Object.fromEntries(new URLSearchParams(t).entries()):{}}(t.params),i=Object.entries(e).find(([t])=>"version"===t.toLowerCase());return{type:"wms",service:t,url:pc(t.url),layers:t.layers,format:t.format||"image/png",version:(null==i?void 0:i[1])||"1.3.0",params:e,name:t.name,attribution:t.copyright_text||void 0,extent:uc(t.extent)}}var fc=Object.defineProperty,mc=(t,e,i)=>((t,e,i)=>e in t?fc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i),gc=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});const yc=class t{constructor(){mc(this,"url"),this.url=t.url.replace(/\/$/,"").trim()}getService(t){return gc(this,arguments,function*(t,e={}){const i=yield this._getJson(`${this.url}/api/v1/geoservices/${t}`,e);if("tms"!==i.type&&"wms"!==i.type)throw new Error("Unsupported QMS service type.");return i})}getLayer(t){return gc(this,arguments,function*(t,e={}){const i=yield this.getService(t,e);return"tms"===i.type?function(t){var e,i;const[o,r]=function(t){const e=[];return[t=t.replace(/{switch:(.*?)}/,(t,i)=>("string"==typeof i&&i.split(",").forEach(t=>e.push(t)),"{s}")),e]}(pc(t.origin_url||t.url));return{type:"tms",service:t,url:o,subdomains:r,scheme:t.y_origin_top?"xyz":"tms",name:t.name,attribution:t.copyright_text||void 0,extent:uc(t.extent),minZoom:null!=(e=t.z_min)?e:void 0,maxZoom:null!=(i=t.z_max)?i:void 0}}(i):dc(i)})}searchServices(t,e){return gc(this,arguments,function*(t,{limit:e=10,offset:i,signal:o,type:r}){const n=new URLSearchParams({search:t,limit:String(e),type:r});void 0!==i&&n.set("offset",String(i));return(yield this._getJson(`${this.url}/api/v1/geoservices/?${n}`,{signal:o})).results})}_getJson(t,e){return gc(this,arguments,function*(t,{signal:e}){const i=yield fetch(t,{signal:e});if(!i.ok)throw new Error(`QMS request failed with status ${i.status}: ${t}`);return i.json()})}};mc(yc,"url","https://qms.nextgis.com");let _c=yc;u('.nextgis-qms-control{--nextgis-qms-control-width:300px;--nextgis-qms-control-max-height:380px;--nextgis-qms-control-background:#fff;--nextgis-qms-control-color:#252a31;--nextgis-qms-control-muted-color:#69717d;--nextgis-qms-control-accent:#0c65af;--nextgis-qms-control-border-color:#d8dde3;--nextgis-qms-control-hover-background:#f3f5f7;--nextgis-qms-control-border-radius:6px;--nextgis-qms-control-shadow:0 2px 10px rgba(0,0,0,.18);--nextgis-qms-control-gap:8px;width:-moz-max-content;width:max-content;color:var(--nextgis-qms-control-color);font:13px/1.4 -apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.nextgis-qms-control.ol-control{top:var(--nextgis-qms-control-top,.5em);left:var(--nextgis-qms-control-left,3em);padding:0;background:transparent}.nextgis-qms-control [hidden],.nextgis-qms-control[hidden]{display:none}.nextgis-qms-control button,.nextgis-qms-control input{box-sizing:border-box;font:inherit}.nextgis-qms-control button{margin:0}.nextgis-qms-control .nextgis-qms-control__toggle{display:grid;width:32px;height:32px;padding:0;color:var(--nextgis-qms-control-color);line-height:1;cursor:pointer;background-color:var(--nextgis-qms-control-background);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2264%22%20height%3D%2264%22%20fill%3D%22none%22%20viewBox%3D%220%200%2064%2064%22%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20fill%3D%22%23176fc1%22%20rx%3D%227.291%22%20style%3D%22stroke-width%3A.202532%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M52%2015.95H33.792a4%204%200%200%201-2.764-1.109l-1.868-1.784a4%204%200%200%200-2.764-1.108H10a2%202%200%200%200-2%202v6h48c0-2.208-1.792-4-4-4M21.244%2034.261a3.1%203.1%200%200%200-1.116-.876q-.665-.31-1.492-.308-.846-.001-1.5.316a3.2%203.2%200%200%200-1.104.884q-.457.571-.692%201.364a6%206%200%200%200-.244%201.768q0%20.983.24%201.768.241.786.692%201.356c.3.376.668.672%201.104.876q.654.307%201.5.308.827.002%201.492-.308a3.04%203.04%200%200%200%201.12-.876q.451-.57.692-1.356.24-.788.24-1.768a6.2%206.2%200%200%200-.24-1.78%204.1%204.1%200%200%200-.692-1.368%22%20style%3D%22stroke-width%3A.202532%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M8%2023.95v26a2%202%200%200%200%202%202h44a2%202%200%200%200%202-2v-26zm16.928%2015.99c-.232.748-.552%201.408-.972%201.972a5.6%205.6%200%200%201-1.492%201.404%206.1%206.1%200%200%201-1.904.808q.095.384.424.624c.216.16.496.292.824.396.336.1.72.176%201.164.232q.664.077%201.436.136l-.616%202.196q-1.5-.055-2.568-.296-1.069-.239-1.808-.664c-.496-.284-.884-.624-1.176-1.036a4.8%204.8%200%200%201-.664-1.424%206.9%206.9%200%200%201-2.216-.664%205.6%205.6%200%200%201-1.768-1.376q-.75-.869-1.176-2.08-.415-1.224-.416-2.76c0-1.14.18-2.148.54-3.012s.844-1.596%201.452-2.184a5.9%205.9%200%200%201%202.116-1.324%207.3%207.3%200%200%201%202.532-.444c.912%200%201.768.144%202.576.444a5.9%205.9%200%200%201%202.116%201.324q.906.888%201.428%202.184.516%201.296.516%203.012%200%201.404-.348%202.532m13.54%204.14a302%20302%200%200%200-.152-4.232c-.06-1.524-.16-3.064-.284-4.616-.236.54-.492%201.132-.776%201.788q-.426.982-.84%201.964-.414.983-.804%201.876-.38.896-.652%201.528h-2.1c-.176-.424-.4-.932-.656-1.532q-.383-.896-.796-1.876c-.276-.656-.56-1.308-.84-1.964-.284-.652-.544-1.248-.772-1.784a107%20107%200%200%200-.292%204.616q-.091%202.286-.152%204.236h-2.924q.072-1.579.18-3.368.107-1.793.232-3.568c.084-1.188.176-2.328.288-3.424q.166-1.648.356-2.972h2.876q.347.634.796%201.568a98%2098%200%200%201%201.92%204.244l.904%202.136c.284-.664.584-1.38.904-2.136q.48-1.133.972-2.224.493-1.091.944-2.02c.304-.62.576-1.144.804-1.568h2.728a61%2061%200%200%201%20.356%202.972q.161%201.643.292%203.424.122%201.778.232%203.568.107%201.79.184%203.364zm12.224-.756q-1.306%201.032-3.944%201.032-.888-.001-1.596-.104a10%2010%200%200%201-1.26-.26%208%208%200%200%201-.944-.328%207%207%200%200%201-.664-.324l.848-2.388c.396.216.888.416%201.472.588s1.296.26%202.144.26q.635-.001%201.048-.104c.276-.072.496-.164.664-.288a.94.94%200%200%200%20.344-.436q.096-.247.096-.56.001-.653-.616-1.084t-2.116-.936a16%2016%200%200%201-1.308-.528%204.8%204.8%200%200%201-1.176-.752%203.6%203.6%200%200%201-.844-1.096q-.326-.643-.328-1.568%200-.925.348-1.664c.232-.496.556-.916.984-1.26a4.5%204.5%200%200%201%201.536-.796q.906-.276%202.04-.276%201.35%200%202.328.288c.652.192%201.196.404%201.616.636L50.5%2033.74a8%208%200%200%200-1.24-.508c-.456-.144-1.004-.22-1.644-.22q-1.08.001-1.548.296-.468.284-.468.904.001.365.176.616.174.25.492.452.318.203.732.364.413.162.916.336a21%2021%200%200%201%201.808.76c.516.248.94.54%201.28.876s.596.724.76%201.176c.152.448.236.996.236%201.636%200%201.244-.436%202.212-1.308%202.896%22%20style%3D%22stroke-width%3A.202532%22%2F%3E%3C%2Fsvg%3E");background-repeat:no-repeat;background-position:50%;background-size:24px 24px;border:1px solid var(--nextgis-qms-control-border-color);border-radius:var(--nextgis-qms-control-border-radius);box-shadow:var(--nextgis-qms-control-shadow);place-items:center}.nextgis-qms-control .nextgis-qms-control__toggle[hidden]{display:none}.nextgis-qms-control .nextgis-qms-control__about-close:hover,.nextgis-qms-control .nextgis-qms-control__about:hover,.nextgis-qms-control .nextgis-qms-control__close:hover,.nextgis-qms-control .nextgis-qms-control__service:hover,.nextgis-qms-control .nextgis-qms-control__toggle:hover,.nextgis-qms-control__group>summary:hover{background-color:var(--nextgis-qms-control-hover-background)}.nextgis-qms-control button:focus-visible,.nextgis-qms-control input:focus-visible,.nextgis-qms-control__group>summary:focus-visible{outline:2px solid var(--nextgis-qms-control-accent);outline-offset:-2px}.nextgis-qms-control__panel{box-sizing:border-box;width:min(var(--nextgis-qms-control-width),calc(100vw - 20px));padding:var(--nextgis-qms-control-gap);overflow:hidden;background:var(--nextgis-qms-control-background);border:1px solid var(--nextgis-qms-control-border-color);border-radius:var(--nextgis-qms-control-border-radius);box-shadow:var(--nextgis-qms-control-shadow)}.nextgis-qms-control__header{display:flex;min-height:28px;align-items:center;justify-content:space-between;margin-bottom:var(--nextgis-qms-control-gap)}.nextgis-qms-control__title{padding-left:2px;font-size:14px;font-weight:600}.nextgis-qms-control .nextgis-qms-control__close{display:grid;position:relative;width:28px;height:28px;padding:0;color:var(--nextgis-qms-control-muted-color);font-size:0;line-height:0;cursor:pointer;background:transparent;border:0;border-radius:4px;box-shadow:none;place-items:center}.nextgis-qms-control__input{width:100%;height:34px;padding:0 10px;color:inherit;background:var(--nextgis-qms-control-background);border:1px solid var(--nextgis-qms-control-border-color);border-radius:4px}.nextgis-qms-control__input:focus{border-color:var(--nextgis-qms-control-accent)}.nextgis-qms-control__catalog,.nextgis-qms-control__results{max-height:var(--nextgis-qms-control-max-height);margin-top:var(--nextgis-qms-control-gap);overflow-x:hidden;overflow-y:auto;border-top:1px solid var(--nextgis-qms-control-border-color)}.nextgis-qms-control__results{padding:6px 0;color:var(--nextgis-qms-control-muted-color)}.nextgis-qms-control__results>.nextgis-qms-control__service{color:var(--nextgis-qms-control-color)}.nextgis-qms-control__group{border-bottom:1px solid var(--nextgis-qms-control-border-color)}.nextgis-qms-control__group>summary{display:flex;min-height:36px;padding:0 8px;align-items:center;font-weight:600;cursor:pointer;list-style:none}.nextgis-qms-control__group>summary::-webkit-details-marker{display:none}.nextgis-qms-control__group>summary:after{flex:none;margin-left:auto;color:var(--nextgis-qms-control-muted-color);content:"›";font-size:18px;transition:transform .12s ease}.nextgis-qms-control__group[open]>summary:after{transform:rotate(90deg)}.nextgis-qms-control__group-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nextgis-qms-control .nextgis-qms-control__service{display:block;width:100%;min-height:34px;padding:7px 10px;overflow:hidden;color:inherit;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;background:transparent;border:0;border-radius:0;box-shadow:none}.nextgis-qms-control__group>.nextgis-qms-control__service{padding-left:22px;color:var(--nextgis-qms-control-muted-color)}.nextgis-qms-control__group>.nextgis-qms-control__service:hover{color:var(--nextgis-qms-control-color)}.nextgis-qms-control__footer{display:flex;padding-top:var(--nextgis-qms-control-gap);justify-content:center}.nextgis-qms-control .nextgis-qms-control__about{display:inline-block;width:auto;height:auto;padding:2px 6px;color:var(--nextgis-qms-control-accent);line-height:inherit;cursor:pointer;background:transparent;border:0;box-shadow:none}.nextgis-qms-control__about-dialog{box-sizing:border-box;width:min(420px,calc(100vw - 32px));padding:24px;color:var(--nextgis-qms-control-color);font:inherit;text-align:left;background:var(--nextgis-qms-control-background);border:1px solid var(--nextgis-qms-control-border-color);border-radius:var(--nextgis-qms-control-border-radius);box-shadow:var(--nextgis-qms-control-shadow)}.nextgis-qms-control__about-dialog::backdrop{background:rgba(0,0,0,.4)}.nextgis-qms-control__about-title{display:block;padding-right:24px;font-size:16px}.nextgis-qms-control__about-dialog p{margin:12px 0}.nextgis-qms-control__about-links{display:grid;gap:6px}.nextgis-qms-control__about-links a{color:var(--nextgis-qms-control-accent)}.nextgis-qms-control .nextgis-qms-control__about-close{position:relative;float:right;width:28px;height:28px;padding:0;color:var(--nextgis-qms-control-muted-color);font-size:0;line-height:0;cursor:pointer;background:transparent;border:0;border-radius:4px;box-shadow:none}.nextgis-qms-control__about-close:after,.nextgis-qms-control__about-close:before,.nextgis-qms-control__close:after,.nextgis-qms-control__close:before{position:absolute;top:50%;left:50%;width:12px;height:1px;background:currentcolor;content:""}.nextgis-qms-control__about-close:before,.nextgis-qms-control__close:before{transform:translate(-50%,-50%) rotate(45deg)}.nextgis-qms-control__about-close:after,.nextgis-qms-control__close:after{transform:translate(-50%,-50%) rotate(-45deg)}.nextgis-qms-control.maplibregl-ctrl .nextgis-qms-control__toggle:not(:disabled):hover{background-color:var(--nextgis-qms-control-hover-background)}.nextgis-qms-control button.nextgis-qms-control__about:not(:focus-visible){outline:0}.nextgis-qms-control__about-developed-by{color:var(--nextgis-qms-control-muted-color)}');var bc=Object.defineProperty,vc=Object.defineProperties,wc=Object.getOwnPropertyDescriptors,xc=Object.getOwnPropertySymbols,Pc=Object.prototype.hasOwnProperty,Lc=Object.prototype.propertyIsEnumerable,Oc=(t,e,i)=>e in t?bc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Cc=(t,e)=>{for(var i in e||(e={}))Pc.call(e,i)&&Oc(t,i,e[i]);if(xc)for(var i of xc(e))Lc.call(e,i)&&Oc(t,i,e[i]);return t},kc=(t,e)=>vc(t,wc(e)),Ec=(t,e)=>{var i={};for(var o in t)Pc.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&xc)for(var o of xc(t))e.indexOf(o)<0&&Lc.call(t,o)&&(i[o]=t[o]);return i},Mc=(t,e,i)=>Oc(t,"symbol"!=typeof e?e+"":e,i),Ac=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});const Sc={tms:"TILE",wms:"WMS"};function Tc(t,e={}){let i;if("webMap"in t){const o=t,{webMap:r}=o,n=Ec(o,["webMap"]);i=r,e=n}else i=t;const o=new _c;class r{constructor(t,i){Mc(this,"qms"),Mc(this,"options"),Mc(this,"map"),this.map=t;const o=Cc(Cc({},e),i);this.options=o,this.options.baselayer=!0,o.qms&&(this.qms=o.qms)}addLayer(t){return Ac(this,null,function*(){var e,n,s;const a=null!=(e=t.signal)?e:this.options.signal,l=null!=(s=t.qmsId)?s:null==(n=this.qms)?void 0:n.id;var c,h;if("number"==typeof l)try{const e=yield o.getLayer(l,{signal:a});this.qms=e.service;const n=Sc[e.type],s=i.mapAdapter.layerAdapters[n];if(s){c=r,h=s,["showLayer","hideLayer"].forEach(t=>{const e=Object.getOwnPropertyDescriptor(h.prototype,t);e&&Object.defineProperty(c.prototype,t,e)}),t=kc(Cc(Cc(Cc({},"TILE"===n?{order:0,maxZoom:i.options.maxZoom,minZoom:i.options.minZoom}:{}),this.options),function(t){return"tms"===t.type?{url:"tms"===t.scheme?t.url.replace("{y}","{-y}"):t.url,subdomains:t.subdomains,maxZoom:t.maxZoom,minZoom:t.minZoom,name:t.name,attribution:t.attribution}:{url:t.url,layers:t.layers,format:t.format,version:t.version,params:t.params,name:t.name,attribution:t.attribution}}(e)),{signal:a}),this.options=t;return new s(this.map,t).addLayer(t)}}catch(u){if(null==a?void 0:a.aborted)throw u;console.error(u)}})}}return r}var Ic=Object.defineProperty;class zc{getLayerAdapters(){return Promise.resolve([{name:"QMS",createAdapter:t=>Promise.resolve(this._createAdapter(t))}])}_createAdapter(t){return Tc({webMap:t})}}((t,e,i)=>{((t,e,i)=>{e in t?Ic(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i})(t,e+"",i)})(zc,"utils",{createQmsAdapter:Tc});var jc=Object.defineProperty,Bc=Object.defineProperties,Zc=Object.getOwnPropertyDescriptors,Dc=Object.getOwnPropertySymbols,Nc=Object.getPrototypeOf,Rc=Object.prototype.hasOwnProperty,qc=Object.prototype.propertyIsEnumerable,Fc=Reflect.get,Uc=(t,e,i)=>e in t?jc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Wc=(t,e)=>{for(var i in e||(e={}))Rc.call(e,i)&&Uc(t,i,e[i]);if(Dc)for(var i of Dc(e))qc.call(e,i)&&Uc(t,i,e[i]);return t},Hc=(t,e)=>Bc(t,Zc(e)),Vc=(t,e,i)=>Fc(Nc(t),i,e),Gc=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});var Jc=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});function Kc(t){return function(t){return Jc(this,null,function*(){const e=yield fa(t),i=[];return e.forEach(t=>{i.push(Vs(t))}),i})}(t).then(t=>({type:"FeatureCollection",features:t}))}const Yc=["fields","intersects","limit","orderBy","strategy"];function $c(t){const e={};return Yc.forEach(i=>{const o=t[i];void 0!==o&&(e[i]=o)}),e}var Qc=Object.defineProperty,Xc=Object.defineProperties,th=Object.getOwnPropertyDescriptors,eh=Object.getOwnPropertySymbols,ih=Object.getPrototypeOf,oh=Object.prototype.hasOwnProperty,rh=Object.prototype.propertyIsEnumerable,nh=Reflect.get,sh=(t,e,i)=>e in t?Qc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ah=(t,e)=>{for(var i in e||(e={}))oh.call(e,i)&&sh(t,i,e[i]);if(eh)for(var i of eh(e))rh.call(e,i)&&sh(t,i,e[i]);return t},lh=(t,e)=>Xc(t,th(e)),ch=(t,e,i)=>sh(t,"symbol"!=typeof e?e+"":e,i),hh=(t,e,i)=>nh(ih(t),i,e),uh=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});function ph(t){return uh(this,null,function*(){var e,i;const{item:o,webMap:r,Adapter:n,connector:s,layerOptions:a,addLayerOptionsPriority:l}=t,c=null==l||l,h=a,u=n||a.Adapter||r.mapAdapter.layerAdapters.GEOJSON,p=[];let d,f,m=!1;const g=yield Ms(h,s);(null==(i=null==(e=h.adapterOptions)?void 0:e.popupOptions)?void 0:i.fromProperties)&&(h.adapterOptions.popupOptions.createPopupContent=({feature:t})=>t&&function(t,e){{const i=document.createElement("div");if(e&&e.feature_layer)e.feature_layer.fields.forEach(e=>{if(e.grid_visibility){const o=t.properties&&t.properties[e.keyname];if(o){const t=document.createElement("div");i.appendChild(t),t.innerHTML=`<span>${e.display_name}</span>: ${o}<span></span>`}}});else if(t.properties)for(const e in t.properties){const o=document.createElement("div");i.appendChild(o),o.innerHTML=`<span>${e}</span>: ${t.properties[e]}<span></span>`}return i}}(t,o));const y=(t,e)=>uh(null,null,function*(){b(),f=new AbortController;const i=f.signal;return(null==e?void 0:e.signal)&&e.signal.addEventListener("abort",f.abort),(e=e||{}).signal=i,d={filters:t,options:e},Kc(ah({resourceId:g,filters:t,connector:s,cache:!0},e))});let _=!1;const b=()=>{f&&(f.abort(),f=void 0)};class v extends u{constructor(){super(...arguments),ch(this,"emitter",new H),ch(this,"__onMapMove"),ch(this,"__onMapMoveStart"),ch(this,"__enableMapMoveListener"),ch(this,"__disableMapMoveListener")}addLayer(t){return uh(this,null,function*(){let e=!t.data;const i=void 0===t.waitFullLoad||t.waitFullLoad;void 0!==h.id&&(t.id=h.id),o&&o.vector_layer&&(t.type=cc[o.vector_layer.geometry_type]),h.adapterOptions&&(t=c?ah(ah({},h.adapterOptions),t):ah(ah({},t),h.adapterOptions)),t.data&&0===Object.keys(t.data).length&&(t.data=void 0,e=!1);const r=t.strategy||void 0;this.options.strategy=r;const n=hh(v.prototype,this,"addLayer").call(this,t);let s;return d={filters:t.propertiesFilter,options:$c(t)},e&&(s=this.updateLayer()),i&&s&&(yield s),r&&r.startsWith("BBOX")&&!m&&this._addBboxEventListener(),n})}getExtent(){return this.getBounds()}getBounds(){return uh(this,null,function*(){const t=this.getLayers&&this.getLayers().length,e=this.options.strategy;return(null==e?void 0:e.startsWith("BBOX"))||t?Ps({connector:s,resourceId:o.resource.id}):hh(v.prototype,this,"getBounds")?hh(v.prototype,this,"getBounds").call(this):void 0})}beforeRemove(){_=!0,this._removeMoveEventListener(),this._removeBboxEventListener(),this.__disableMapMoveListener=void 0,this.__enableMapMoveListener=void 0,this.__onMapMove=void 0,this.__onMapMoveStart=void 0,b()}getCount(){return function({connector:t,resourceId:e,cache:i=!0,signal:o}){return t.route("feature_layer.feature.count",{id:e}).get({cache:i,signal:o}).then(t=>t.total_count)}({connector:s,resourceId:g,cache:!0})}updateLayer(t){return uh(this,null,function*(){var e;const i=t||d||{};if(null==(e=this.options.strategy)?void 0:e.startsWith("BBOX")){yield r.onLoad("create"),i.options=i.options||{},i.options.intersects=r.getBounds();const{minZoom:t,maxZoom:e}=this.options,o=r.getZoom();if(void 0!==o){if(void 0!==t&&o<t)return;if(void 0!==e&&o>e)return;if(m)return}}if(!_){try{this.emitter.emit("preupdate",i),r._emitLayerEvent("layer:preupdate",h.id||"",i);const t=yield y(i.filters,lh(ah({},i.options),{srs:this.options.srs}));let e=t;const o=yield this.getCount();if("BBOX+"===this.options.strategy){e={type:"FeatureCollection",features:[]};for(const i of t.features)-1===p.indexOf(String(i.id))&&(p.push(String(i.id)),e.features.push(i));m=void 0!==o&&p.length>=o,yield r.addLayerData(this,e)}else m=void 0!==o&&t.features.length>=o,yield r.setLayerData(this,t);this.emitter.emit("updated",t),r._emitLayerEvent("layer:updated",h.id||"",{data:t,newData:e,isFull:m})}catch(o){if(o instanceof Error&&"AbortError"!==o.name)throw o}hh(v.prototype,this,"updateLayer")&&hh(v.prototype,this,"updateLayer").call(this)}})}propertiesFilter(t,e){return uh(this,null,function*(){if(b(),this.filter&&m)this.filter(e=>{if(!t)return!0;const i=e.feature&&e.feature.properties&&Ys(ah({},e.feature.properties));return!i||Oe(i,t)});else if(this.setData){this.clearLayer&&this.clearLayer();const i=yield y(null!=t?t:void 0,lh(ah({},e),{srs:this.options.srs}));this.setData(i)}})}removeFilter(){d=void 0,this.propertiesFilter([]),this.filter&&this.filter(()=>!0)}_addBboxEventListener(){this.__enableMapMoveListener=t=>{t===this&&(this._removeMoveEventListener(),this.updateLayer(),this._addMoveEventListener())},this.__disableMapMoveListener=t=>{t===this&&this._removeMoveEventListener()},r.emitter.on("layer:show",this.__enableMapMoveListener),r.emitter.on("layer:hide",this.__disableMapMoveListener),this.__enableMapMoveListener(this)}_removeBboxEventListener(){this.__enableMapMoveListener&&r.emitter.on("layer:show",this.__enableMapMoveListener),this.__disableMapMoveListener&&r.emitter.on("layer:hide",this.__disableMapMoveListener)}_addMoveEventListener(){this.__onMapMove=Q(()=>this.updateLayer()),this.__onMapMoveStart=b,r.emitter.on("movestart",this.__onMapMoveStart),r.emitter.on("moveend",this.__onMapMove)}_removeMoveEventListener(){this.__onMapMove&&r.emitter.removeListener("moveend",this.__onMapMove),this.__onMapMoveStart&&r.emitter.removeListener("movestart",this.__onMapMoveStart)}}return v})}var dh=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});function fh(t,e){const i=oa(e);return void 0===i?{}:{[`filter[${t}]`]:i}}var mh=Object.defineProperty,gh=Object.defineProperties,yh=Object.getOwnPropertyDescriptors,_h=Object.getOwnPropertySymbols,bh=Object.prototype.hasOwnProperty,vh=Object.prototype.propertyIsEnumerable,wh=(t,e,i)=>e in t?mh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,xh=(t,e)=>{for(var i in e||(e={}))bh.call(e,i)&&wh(t,i,e[i]);if(_h)for(var i of _h(e))vh.call(e,i)&&wh(t,i,e[i]);return t},Ph=(t,e)=>gh(t,yh(e)),Lh=(t,e)=>{var i={};for(var o in t)bh.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&_h)for(var o of _h(t))e.indexOf(o)<0&&vh.call(t,o)&&(i[o]=t[o]);return i},Oh=(t,e,i)=>wh(t,"symbol"!=typeof e?e+"":e,i),Ch=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});function kh(t){return Ch(this,arguments,function*({layerOptions:t,connector:e,webMap:i,item:o}){const r=o.resource.cls;let n=t.adapter||r&&{wmsserver_service:"WMS",tmsclient_layer:"IMAGE"}[r]||"IMAGE";if(void 0!==n&&(t.adapter=n),"IMAGE"===n){const t=i.getLayerAdapters();!t||t.IMAGE||(n="TILE")}const s=i.mapAdapter.layerAdapters[n];if(s){const r=yield Ms(t,e);return class extends s{constructor(s,a){super(s,a),Oh(this,"map",s),Oh(this,"item",o),Oh(this,"resourceId",r),Oh(this,"blocked",!1),Oh(this,"layerVisibility");const l=ma({options:t,webMap:i,baseUrl:e.options.baseUrl||""});if(l){const e=t.adapterOptions||{},{propertiesFilter:i}=e,o=Lh(e,["propertiesFilter"]),s=fh(r,i),a=Ph(xh(xh({},l),o),{params:xh({resource:r},s),url:"TILE"===n&&l.url?ft(l.url,xh({resource:String(r)},s)):l.url,layers:l.layers||String(r),resourceId:r});t.adapterOptions&&tt(t.adapterOptions.setViewDelay)&&(a.setViewDelay=t.adapterOptions.setViewDelay),this.options=xh(xh({},this.options),a)}}addLayer(t){return super.addLayer(xh(xh({},this.options),t))}propertiesFilter(t){return Ch(this,null,function*(){var e;const i=this.options,o=`filter[${this.resourceId}]`,r=xh(xh({},i.params||{}),fh(this.resourceId,null!=t?t:void 0));t||delete r[o],i.params=r,null==(e=this.updateLayer)||e.call(this,{params:r})})}getIdentificationIds(){return Ch(this,null,function*(){if(this.item){if("MVT"===n)return[this.item.resource.id];if(this.item.resource.parent){const t=this.item.resource.parent.id;if(tt(t))return[t]}}return[]})}getLegend(t){return Ch(this,null,function*(){const o=this.options.id;if(void 0!==o){const n=yield e.route("render.legend_symbols",{id:r}).get(xh({cache:!0},t));return[new kl({layerId:o,layer:this,resourceId:r,webMap:i,legend:n})]}return[]})}}}throw new Error(n+" not supported yet. Only TILE")})}var Eh=Object.defineProperty,Mh=Object.defineProperties,Ah=Object.getOwnPropertyDescriptors,Sh=Object.getOwnPropertySymbols,Th=Object.prototype.hasOwnProperty,Ih=Object.prototype.propertyIsEnumerable,zh=(t,e,i)=>e in t?Eh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,jh=(t,e)=>{for(var i in e||(e={}))Th.call(e,i)&&zh(t,i,e[i]);if(Sh)for(var i of Sh(e))Ih.call(e,i)&&zh(t,i,e[i]);return t},Bh=(t,e)=>Mh(t,Ah(e)),Zh=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});const Dh={},Nh=["mapserver_style","qgis_vector_style","qgis_raster_style","wmsserver_service","raster_style","basemap_layer","vector_layer","raster_layer","postgis_layer","webmap","tmsclient_layer"];function Rh(t){return Zh(this,arguments,function*({layerOptions:t,webMap:e,connector:i,item:o}){const r=o.resource.id,n=yield i.getResourceChildren(r),s=n&&n[0];if(s)return qh(Bh(jh({},t),{resource:s.resource.id}),e,i)})}function qh(t,e,i){return Zh(this,null,function*(){let o,r;const n=t.adapter,s=yield Ms(t,i);if(s){const a=t.resource;if(r=a&&a.resource&&void 0!==a.resource.id?a:yield i.getResource(s),!r)throw"Resource item is not found";{const a=r.resource.cls,l={layerOptions:Bh(jh({},t),{resource:s}),connector:i,webMap:e,item:r};if(-1!==Nh.indexOf(a))if("webmap"===a)o=function(t){return dh(this,arguments,function*({layerOptions:t,webMap:e,connector:i}){const o=yield Ms(t,i);return class extends $l{constructor(t){super(t,{url:"",webMap:e,resourceId:o,connector:i})}}})}(l);else if("vector_layer"===a||"postgis_layer"===a){const e=l.layerOptions.adapterOptions||{};if(e.type=e.type||r.vector_layer&&cc[r.vector_layer.geometry_type],l.layerOptions.adapterOptions=e,t.adapterOptions=l,void 0!==n&&"GEOJSON"!==n){if("MVT"!==n)return Rh(l);o=kh(l)}else o=ph(l)}else{if("raster_layer"===a)return Rh(l);if("basemap_layer"===a)o=function(t){return Gc(this,arguments,function*({webMap:t,item:e}){if(e.basemap_layer){const i=e.basemap_layer.qms,o=e.basemap_layer.url;if(i){const e=JSON.parse(i);return Promise.resolve(Tc(t,{qms:e,baselayer:!0}))}if(o){const e=t.mapAdapter.layerAdapters.TILE;if(e){class t extends e{addLayer(e){return Gc(this,null,function*(){if(o)return Vc(t.prototype,this,"addLayer").call(this,Hc(Wc({},e),{url:o}))})}}return t}}}})}(l);else if("GEOJSON"===n&&r.resource.parent){const e=yield i.getResource(r.resource.parent.id);if(e){const i=Bh(jh({},t),{resource:r.resource.parent.id});o=ph(Bh(jh({},l),{item:e,layerOptions:i}))}}else o=kh(l)}else{if(!Dh[a])throw`Resource class '${a}' not yet supported.`;{const t=Dh[a];let e;e=n&&"function"!=typeof e?t[n]:t,e&&(o=e(l))}}}}if(o)return o.then(t=>{if(t){const e=t;return r&&(e.prototype.item=r,e.prototype.resourceId=r.resource.id,e.prototype.connector=i),$(e,[Es],{replace:!1}),e}})})}var Fh=Object.defineProperty,Uh=Object.getOwnPropertySymbols,Wh=Object.prototype.hasOwnProperty,Hh=Object.prototype.propertyIsEnumerable,Vh=(t,e,i)=>e in t?Fh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Gh=(t,e)=>{for(var i in e||(e={}))Wh.call(e,i)&&Vh(t,i,e[i]);if(Uh)for(var i of Uh(e))Hh.call(e,i)&&Vh(t,i,e[i]);return t},Jh=(t,e,i)=>Vh(t,"symbol"!=typeof e?e+"":e,i);class Kh{constructor(t){if(Jh(this,"options",t),Jh(this,"url"),Jh(this,"connector"),Jh(this,"webMap"),this.options.connector)this.url=this.options.connector.options.baseUrl||"",this.connector=this.options.connector;else{if(!this.options.baseUrl)throw new Error("url is not defined");this.url=this.options.baseUrl,this.connector=new us({baseUrl:this.url,auth:this.options.auth})}}static addClassAdapters(t,e){Dh[t]=e}onLoadSync(t){return e=this,i=null,o=function*(){if(this.options.resourceId&&this.url){const e=[this.options.resourceId];if(e.length)for(const i of e){const e={resourceId:i,connector:this.connector,webMap:t};return yield t.addLayer($l,Gh({visibility:!0,fit:!0,pixelRadius:this.options.pixelRadius},e))}}},new Promise((t,r)=>{var n=t=>{try{a(o.next(t))}catch(e){r(e)}},s=t=>{try{a(o.throw(t))}catch(e){r(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(n,s);a((o=o.apply(e,i)).next())});var e,i,o}getLayerAdapters(){return Promise.resolve([this._getLayerAdapter()])}_getLayerAdapter(){return{name:"WEBMAP",createAdapter:t=>Promise.resolve(this._createAdapter(t))}}_createAdapter(t){return e={webMap:t,connector:this.connector,baseUrl:this.url},class extends $l{constructor(t,i){super(t,i=nc(nc({},e),i))}};var e}}var Yh=Object.defineProperty,$h=Object.getOwnPropertySymbols,Qh=Object.prototype.hasOwnProperty,Xh=Object.prototype.propertyIsEnumerable,tu=(t,e,i)=>e in t?Yh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,eu=(t,e)=>{for(var i in e||(e={}))Qh.call(e,i)&&tu(t,i,e[i]);if($h)for(var i of $h(e))Xh.call(e,i)&&tu(t,i,e[i]);return t},iu=(t,e,i)=>tu(t,"symbol"!=typeof e?e+"":e,i),ou=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});class ru{constructor(t){iu(this,"id"),iu(this,"label"),iu(this,"layerId"),iu(this,"parent"),iu(this,"fields"),iu(this,"geom"),iu(this,"extensions"),iu(this,"connector"),iu(this,"_item"),iu(this,"_geojson"),iu(this,"_resource"),iu(this,"_extent");const e=t.feature;this.id=e.id,this.geom=e.geom,this.label=e.label,this.parent=e.parent,this.fields=e.fields,this.layerId=e.layerId,this.connector=t.connector}identify(t={}){return this._item?Promise.resolve(this._item):Ca(eu({connector:this.connector,featureId:this.id,resourceId:this.layerId,fields:null,extensions:["attachment","description"]},t)).then(t=>(this._item=t,this.geom=t.geom,this.extensions=t.extensions,t))}resource(t){return ou(this,null,function*(){return(yield this.composite(t)).feature_layer})}composite(t){return ou(this,null,function*(){if(this._resource&&this._resource.feature_layer)return this._resource;const e=yield this.connector.getResource(this.layerId,t);if(!e)throw new Error("Resource does not exist");if(!e.feature_layer)throw new Error("Resource is not a vector layer");return this._resource=e,e})}getBounds(t){return this._extent?Promise.resolve(this._extent):function({resourceId:t,featureId:e,connector:i,cache:o=!0,signal:r}){return i.route("feature_layer.feature.item_extent",{id:Number(t),fid:e}).get({cache:o,signal:r}).then(t=>{if(t&&t.extent){const{maxLat:e,maxLon:i,minLat:o,minLon:r}=t.extent;return[r,o,i,e]}})}(eu({connector:this.connector,featureId:this.id,resourceId:this.layerId},t))}geojson(t={}){return this._geojson?Promise.resolve(this._geojson):this.identify(t).then(t=>t.toGeojson().then(t=>(this._geojson=t,t)))}}function nu(t){return e=this,i=null,o=function*(){return Vs(yield Ca(t))},new Promise((t,r)=>{var n=t=>{try{a(o.next(t))}catch(e){r(e)}},s=t=>{try{a(o.throw(t))}catch(e){r(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(n,s);a((o=o.apply(e,i)).next())});var e,i,o}function su(t,e){return i=this,o=null,r=function*(){var i,o;const r=yield t.route("pyramid.settings").get({query:{component:"pyramid"}}),n=r&&"company_logo"in r?r.company_logo:void 0;if(n&&n.enabled){const r=document.createElement("a");r.style.position="absolute",r.style.bottom="0",r.style.right="0",r.style.padding=null!=(i=null==e?void 0:e.padding)?i:"10px",r.className="ngw-map-logo",e&&e.cssClass&&(r.className+=" "+e.cssClass);const s=new Image;s.style.maxHeight="100px",s.style.maxWidth="100px",s.src="";const a=null==(o=(yield t.route("pyramid.csettings").get({query:{pyramid:["header_logo"]}})).pyramid)?void 0:o.header_logo;if(!a)return;{const[t,e]=a,i=atob(e),o=new Array(i.length);for(let s=0;s<i.length;s++)o[s]=i.charCodeAt(s);const r=new Uint8Array(o),n=new Blob([r],{type:t}),l=(window.URL||window.webkitURL).createObjectURL(n);s.src=l}return null!==n.link&&""!==n.link.trim()&&(r.href=n.link,r.target="_blank",-1!==n.link.search(/:\/\/nextgis/)&&(s.alt="Get your own Web GIS at nextgis.com")),r.appendChild(s),r}},new Promise((t,e)=>{var n=t=>{try{a(r.next(t))}catch(i){e(i)}},s=t=>{try{a(r.throw(t))}catch(i){e(i)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(n,s);a((r=r.apply(i,o)).next())});var i,o,r}var au=Object.defineProperty,lu=Object.defineProperties,cu=Object.getOwnPropertyDescriptors,hu=Object.getOwnPropertySymbols,uu=Object.prototype.hasOwnProperty,pu=Object.prototype.propertyIsEnumerable,du=(t,e,i)=>e in t?au(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,fu=(t,e)=>{for(var i in e||(e={}))uu.call(e,i)&&du(t,i,e[i]);if(hu)for(var i of hu(e))pu.call(e,i)&&du(t,i,e[i]);return t},mu=(t,e)=>lu(t,cu(e));function gu(t,e=!1){const i=[],o=[];for(const n in t){const t=Number(n);isNaN(t)||i.push(t)}const r=t.resources;r&&i.sort((t,e)=>r.indexOf(t)-r.indexOf(e));for(let n=0;n<i.length;n++){const r=i[n],s=t[r];if("features"in s){const t=yu(s.features,Number(r),e);if(t.length&&(o.push(...t),!e))break}}return o}function yu(t,e,i){const o=[];for(const r of t){if(o.push({featureId:r.id,resourceId:e,feature:r}),!i)break}return o}function _u(t){const{geom:e,signal:i,cache:o,layers:r}=t,n="string"==typeof e?e:function(t){const e=function(t){var e;if(Array.isArray(t))return t;if("Feature"===t.type)return null==(e=t.geometry)?void 0:e.coordinates[0];if("Polygon"===t.type)return t.coordinates[0];return null}(t);if(!e)return null;return`POLYGON((${e.map(([t,e])=>{const[i,o]=ot(t,e);return`${i} ${o}`}).join(",")}))`}(e);if(!n)throw new Error("Not valid geometry format to make intersection");const s={geom:n,srs:3857,layers:r};return t.connector.route("feature_layer.identify").post({json:s,signal:i,cache:o})}var bu=Object.defineProperty,vu=Object.defineProperties,wu=Object.getOwnPropertyDescriptors,xu=Object.getOwnPropertySymbols,Pu=Object.prototype.hasOwnProperty,Lu=Object.prototype.propertyIsEnumerable,Ou=(t,e,i)=>e in t?bu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Cu=(t,e)=>{for(var i in e||(e={}))Pu.call(e,i)&&Ou(t,i,e[i]);if(xu)for(var i of xu(e))Lu.call(e,i)&&Ou(t,i,e[i]);return t},ku=(t,e)=>vu(t,wu(e));function Eu(t,e,i,o){if("number"==typeof e||"string"==typeof e)e=Number(e),t.push(ku(Cu({},i),{resource:e}));else if(Array.isArray(e)){const[r,n]=e;t.push(Cu(ku(Cu({},i),{resource:r,id:n}),o))}else"object"==typeof e&&t.push(Cu(Cu(Cu({},i),e),o))}var Mu=Object.defineProperty,Au=Object.defineProperties,Su=Object.getOwnPropertyDescriptors,Tu=Object.getOwnPropertySymbols,Iu=Object.prototype.hasOwnProperty,zu=Object.prototype.propertyIsEnumerable,ju=(t,e,i)=>e in t?Mu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;const Bu={target:"map",baseUrl:"",whitlabel:!1,controls:["ZOOM","ATTRIBUTION"],controlsOptions:{ZOOM:{position:"top-left"},ATTRIBUTION:{position:"bottom-right",customAttribution:['<a href="https://nextgis.com" target="_blank">©NextGIS</a>']}},pixelRadius:10};function Zu(t){const e=[new zc];var i;return t.starterKits&&t.starterKits.forEach(t=>{e.push(t)}),t.connector?t.connector&&(t.baseUrl=t.connector.options.baseUrl):t.connector=new us({baseUrl:t.baseUrl||"",auth:t.auth,withCredentials:t.withCredentials}),(t=X(Bu,t)).center||t.bounds||(t.bounds=[-179,-90,180,90]),t.connector&&e.push(new Kh({connector:t.connector,auth:t.auth})),i=((t,e)=>{for(var i in e||(e={}))Iu.call(e,i)&&ju(t,i,e[i]);if(Tu)for(var i of Tu(e))zu.call(e,i)&&ju(t,i,e[i]);return t})({},t),t=Au(i,Su({starterKits:e,create:!1}))}var Du=Object.defineProperty,Nu=Object.defineProperties,Ru=Object.getOwnPropertyDescriptors,qu=Object.getOwnPropertySymbols,Fu=Object.getPrototypeOf,Uu=Object.prototype.hasOwnProperty,Wu=Object.prototype.propertyIsEnumerable,Hu=Reflect.get,Vu=(t,e,i)=>e in t?Du(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Gu=(t,e)=>{for(var i in e||(e={}))Uu.call(e,i)&&Vu(t,i,e[i]);if(qu)for(var i of qu(e))Wu.call(e,i)&&Vu(t,i,e[i]);return t},Ju=(t,e)=>Nu(t,Ru(e)),Ku=(t,e,i)=>Vu(t,"symbol"!=typeof e?e+"":e,i),Yu=(t,e,i)=>Hu(Fu(t),i,e),$u=(t,e,i)=>new Promise((o,r)=>{var n=t=>{try{a(i.next(t))}catch(e){r(e)}},s=t=>{try{a(i.throw(t))}catch(e){r(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())});const Qu=class t extends _o{constructor(t){super(Zu(t)),Ku(this,"emitter",new H),Ku(this,"connector"),Ku(this,"_ngwLayers",{}),Ku(this,"$$selectFromNgwRaster"),Ku(this,"$$selectFromNgwVector"),Ku(this,"_promises",{select:[],identify:[]}),t.connector&&(this.connector=t.connector),this._createWebMap().then(()=>{const t=this.getContainer();t&&t.classList.add("ngw-map-container"),this.options.whitlabel&&this._whiteLabel()})}addControl(e,i,o){return $u(this,null,function*(){return yield this.onLoad("controls:create"),Yu(t.prototype,this,"addControl").call(this,e,i,o)})}addNgwLayer(t){return $u(this,null,function*(){yield this.onMapLoad();const{keyname:e,resourceId:i,filters:o}=t;(e||void 0!==i)&&console.warn(`DEPRECATED WARN: ${"set `resource` options instead of `keyname` or `resourceId`"}`);const r=t.resource;if(!e&&!i&&!r)throw new Error("resource, resourceId or keyname is required parameter to add NGW layer");if(tt(this.options.baseUrl))try{t.adapterOptions=t.adapterOptions||{},tt(this.options.setViewDelay)&&(tt(t.adapterOptions.setViewDelay)||(t.adapterOptions.setViewDelay=this.options.setViewDelay)),tt(o)&&(t.adapterOptions.propertiesFilter=o);const e=function(t,e,i){const o=i.getAuthorizationHeaders();return o&&(t.headers=o),void 0!==i.withCredentials&&(t.withCredentials=i.withCredentials),qh(t,e,i)}(t,this,this.connector),i=Gu(Gu({visibility:!0},t),t.adapterOptions),r=yield this.addLayer(e,i),n=r&&this.getLayerId(r);if(r&&n&&(this._ngwLayers[n]={layer:r,resourceId:r.resourceId},r.options.name=r.options.name||r.item&&r.item.resource.display_name,r.options.baselayer)){if(this.getActiveBaseLayer())return r}return r}catch(n){const t=pt(r)&&"id"in r?r.id:e||i||r;console.error(`Can't add NGW layer ${t}.`,n)}})}fit(){const{center:t,zoom:e,bounds:i}=this.options;t?(this.setCenter(t),e&&this.setZoom(e)):i&&this.fitBounds(i)}fetchNgwLayerItem(t){return Ca(Gu({connector:this.connector},t))}fetchNgwLayerItems(t){return fa(Gu({connector:this.connector},t))}fetchNgwLayerFeature(t){return nu(Gu({connector:this.connector},t))}fetchNgwLayerFeatures(t){return Kc(Gu({connector:this.connector},t))}fetchIdentifyItem(t,e){const i=new AbortController,o=i.signal;(null==e?void 0:e.signal)&&e.signal.addEventListener("abort",i.abort),(e=e||{}).signal=o;const r=function(t){const{connector:e,identify:i}=t,o=gu(i);return o&&o.length?Ca(fu(fu({connector:e},t.requestOptions),o[0])):Promise.resolve(void 0)}({identify:t,connector:this.connector,requestOptions:e});return this._addPromise("identify",r,i),r}fetchIdentifyGeoJson(t,{signal:e}={}){const i=new AbortController;if(e){if(e.aborted)return Promise.reject(new us.errors.AbortError);e.addEventListener("abort",()=>{i.abort("AbortError")})}const o=function(t){const{connector:e,identify:i,requestOptions:o}=t;for(const n in i){const t=Number(n);if(!isNaN(t)){const t=i[n];if("features"in t){const e=t.features.find(t=>t.geom);if(e&&e.geom){const t=e.geom;return Promise.resolve(Vs(mu(fu({},e),{geom:t})))}}}}const r=gu(i);return r&&r.length?nu(fu(mu(fu({},o),{connector:e}),r[0])):Promise.resolve(void 0)}({identify:t,connector:this.connector,requestOptions:{signal:i.signal}});return o&&"then"in o?(this._addPromise("identify",o,i),o):Promise.resolve(o)}getIdentifyGeoJson(t,e=!1){return this.fetchIdentifyGeoJson(t,{multiple:e})}getNgwLayers(){return $u(this,null,function*(){return yield this.onLoad(),this._ngwLayers})}getNgwLayerByResourceId(t){return $u(this,null,function*(){for(const e in this._ngwLayers){const i=this._ngwLayers[e];if(i.resourceId===t)return i&&i.layer;if(i.layer.getIdentificationIds){const e=yield i.layer.getIdentificationIds();if(e&&e.some(e=>e===t))return i.layer}if(i.layer.getDependLayers){const e=i.layer.getDependLayers().find(e=>e.item&&"style_parent_id"in e.item&&void 0!==e.item.style_parent_id&&e.item.style_parent_id===t);if(e)return e.layer}}})}fitLayer(e,i){return $u(this,null,function*(){let o;o="string"==typeof e||"number"==typeof e?String(o):e.id;const r=o&&this._ngwLayers[o];if(r)if(r.layer.getBounds){const t=yield r.layer.getBounds();t&&this.fitBounds(t,i)}else{let t;if(r.layer.item)t=r.layer.item;else{const e=r.resourceId;t=yield this.connector.getResource(e)}t&&this.fitResource(t.resource.id)}else Yu(t.prototype,this,"fitLayer").call(this,"number"==typeof e?String(e):e,i)})}fitResource(t,e){return $u(this,null,function*(){const i=yield this.connector.resources.getIdOrFail(t),o=yield Ps({resourceId:i,connector:this.connector});o&&this.fitBounds(o,e)})}zoomToLayer(t){return $u(this,null,function*(){return this.fitLayer(t)})}onLoad(t="ngw-map:create"){return super.onLoad(t)}removeLayer(t){const e=this.getLayer(t);if(e){const t=this.getLayerId(e);t&&delete this._ngwLayers[t],super.removeLayer(e)}}enableSelection(){this.$$selectFromNgwRaster||(this.$$selectFromNgwRaster=t=>{this._getSelectListenersCount()&&this.selectFromNgwRaster(t)},this.$$selectFromNgwVector=t=>{this._getSelectListenersCount()&&this._selectFromNgwVector(t)},this.emitter.on("click",this.$$selectFromNgwRaster),this.emitter.on("layer:click",this.$$selectFromNgwVector))}disableSelection(){this.$$selectFromNgwRaster&&(this.emitter.removeListener("click",this.$$selectFromNgwRaster),this.$$selectFromNgwRaster=void 0),this.$$selectFromNgwVector&&(this.emitter.removeListener("layer:click",this.$$selectFromNgwVector),this.$$selectFromNgwVector=void 0)}getNgwLayerItem(t){return this.fetchNgwLayerItem(t)}getNgwLayerItems(t){return this.fetchNgwLayerItems(t)}getNgwLayerFeature(t){return this.fetchNgwLayerFeature(t)}getNgwLayerFeatures(t){return this.fetchNgwLayerFeatures(t)}cancelPromise(...t){this.cancelPromises(...t)}cancelPromises(...t){t.length||(t=Object.keys(this._promises)),t.forEach(t=>{const e=this._promises[t];e&&(e.forEach(t=>t[1].abort()),this._promises[t]=[])})}selectFromNgwRaster(t){return $u(this,null,function*(){var e;this._emitStatusEvent("ngw:preselect");const i=[],o=Object.values(this._ngwLayers);o.sort((t,e)=>t.layer.order&&e.layer.order?e.layer.order-t.layer.order:1);for(const t of o){const o=t.layer,r="function"==typeof o.getIdentificationIds&&o.getIdentificationIds,n=null==(e=o.options.interactive)||e;if(r&&o.options.selectable&&n&&this.isLayerVisible(o)){const t=r.call(o);i.push(t)}}const r=Promise.all(i),n=yield r,s=[];for(const t of n)t&&s.push(...t);if(!s.length)return void this._emitStatusEvent("ngw:select",null);const a=this.options.pixelRadius||10,l=this.getCenter();let c=this.getZoom();if(c=void 0!==c?c:20,!l||!c)return void this._emitStatusEvent("ngw:select",null);const h=function(t,e,i){return(i=null!=i?i:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,e+8))*5e-4}(l,c,a);let u;if(this.options.highlightIdentification){const e=this.options.highlightIdentification,i="number"==typeof e?e:1e3,[o,r]=t.lngLat;u={type:"Polygon",coordinates:[lt(o,r,h)]};const n=yield this.addGeoJsonLayer({data:{type:"Feature",geometry:u}});i!==1/0&&setTimeout(()=>{this.removeLayer(n)},i)}const p=new AbortController,d=function(t,e){it(t);const[i,o]=t.lngLat,{geom:r,radius:n}=e,s=null!=r?r:lt(i,o,n);return _u(mu(fu({},e),{geom:s}))}(t,{layers:s,connector:this.connector,radius:h,geom:u,signal:p.signal}).then(e=>{const i=Ju(Gu({},e),{resources:s,sourceType:"raster",event:t}),o=this._prepareToIdentify(i);return this._emitStatusEvent("ngw:select",o),o});return this._addPromise("select",d,p),d})}_addPromise(t,e,i){const o=this._promises[t];if(o&&-1===o.findIndex(t=>t[0]===e)){const t=()=>{const t=o.findIndex(t=>t[0]===e);-1!==t&&o.splice(t,1)};e.then(t,t),o.push([e,i])}}_isFitFromResource(){const t=this._initMapState;return!t.zoom||!t.center}_createWebMap(){return $u(this,null,function*(){yield this.create(),this.options.qmsId&&this._addQmsBaseLayer(),this.options.osm&&this._addOsmBaseLayer();const t=[],e=this._isFitFromResource();if(this.options.webmapId&&Eu(t,this.options.webmapId,{fit:e}),this.options.resources&&Array.isArray(this.options.resources))for(const o of this.options.resources){const i={};e||(i.fit=!1),Eu(t,o,{},i)}for(const o of t)try{yield this.addNgwLayer(o)}catch(i){console.warn(i)}this._emitStatusEvent("ngw-map:create",this),this.enableSelection()})}_addOsmBaseLayer(){this.addBaseLayer("OSM")}_addQmsBaseLayer(){let t,e;Array.isArray(this.options.qmsId)?(t=this.options.qmsId[0],e=this.options.qmsId[1]):t=Number(this.options.qmsId);const i={qmsId:t};e&&(i.id=e),this.addBaseLayer("QMS",i)}_selectFromNgwVector(t){const e=t.layer;if(!(e.options.selectable&&this.isLayerVisible(e)))return;const i=e.item&&e.item.resource.id,o=t.feature;if(void 0!==i&&o){const t=o.id;if(t){const e={featureCount:1,features:[{id:Number(t),fields:o.properties||{},label:`#${i}`,layerId:Number(i),parent:"",geom:o.geometry}]},r={featureCount:1,[i]:e};return this._emitStatusEvent("ngw:select",this._prepareToIdentify(Ju(Gu({},r),{resources:[i],sourceType:"vector"}))),r}}}_prepareToIdentify(t){return Ju(Gu({},t),{getIdentifyItems:()=>gu(t,!0).map(t=>new ru({feature:t.feature,connector:this.connector}))})}_getSelectListenersCount(){return this.emitter.listenerCount("ngw:select")}_whiteLabel(){return $u(this,null,function*(){const t=this.getContainer();if(t){const e=yield su(this.connector,this.options.companyLogoOptions);e&&t.appendChild(e)}})}};Ku(Qu,"getIcon",function(t={}){var e,i,o,r,n,s;const a=null!=(e=t.shape)?e:"circle",l=null!=(i=t.color)?i:"blue",c=null!=(o=t.strokeColor)?o:"white",h=null!=(r=t.size)?r:12,u=null!=(n=t.rotate)?n:0,p=null!=(s=t.anchor)?s:[h/2,h/2],d=void 0!==t.stroke?Number(t.stroke):.8,f=t.p||Pr[a]||"circle",m="string"==typeof f?f:f(t),g=function(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}(t.svg||function({width:t,height:e,stroke:i=0,content:o}){const r=i/2;return`<svg\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n width="${t}"\n height="${e}"\n viewBox="-${r} -${r} ${12+i} ${12+i}"\n >${o}</svg>`}({width:h,height:h,stroke:d,content:m}));return g.setAttribute("width",String(h)),g.setAttribute("height",String(h)),g.setAttribute("fill",l),d&&(g.setAttribute("stroke",c),g.setAttribute("stroke-width",String(d))),{type:"icon",iconSize:[h,h],iconAnchor:p,html:(new XMLSerializer).serializeToString(g),rotate:u,svg:g}});let Xu=Qu;u('.leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-overlay-pane svg,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-width:none!important;max-height:none!important}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-bottom,.leaflet-top{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-tile{will-change:opacity}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}.leaflet-zoom-anim .leaflet-zoom-animated{will-change:transform;transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline:0}.leaflet-container a{color:#0078a8}.leaflet-container a.leaflet-active{outline:2px solid orange}.leaflet-zoom-box{border:2px dotted #38f;background:hsla(0,0%,100%,.5)}.leaflet-container{font:12px/1.5 Helvetica Neue,Arial,Helvetica,sans-serif}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,.65);border-radius:4px}.leaflet-bar a,.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(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=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:hsla(0,0%,100%,.7);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;font-size:11px;white-space:nowrap;overflow:hidden;box-sizing:border-box;background:#fff;background:hsla(0,0%,100%,.5)}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 19px;line-height:1.4}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px rgba(0,0,0,.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;padding:4px 4px 0 0;border:none;text-align:center;width:18px;height:14px;font:16px/14px Tahoma,Verdana,sans-serif;color:#c3c3c3;text-decoration:none;font-weight:700;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678)}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,.4)}.leaflet-tooltip.leaflet-clickable{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}');u('.webmap-ctrl-bottom-left,.webmap-ctrl-bottom-right,.webmap-ctrl-left,.webmap-ctrl-right,.webmap-ctrl-top-left,.webmap-ctrl-top-right{position:absolute;pointer-events:none;z-index:9999}.webmap-ctrl-left,.webmap-ctrl-right{height:100%}.webmap-ctrl-left{padding-right:0}.webmap-ctrl-right{padding-left:0}.webmap-ctrl-top-left{top:0;left:0}.webmap-ctrl-top-right{top:0;right:0}.webmap-ctrl-bottom-left{bottom:0;left:0}.webmap-ctrl-bottom-right{right:0;bottom:0}.webmap-ctrl,.webmap-ctrl-wrapper{clear:both;pointer-events:auto;transform:translate(0)}.webmap-ctrl-top-left>.webmap-ctrl,.webmap-ctrl-top-left>.webmap-ctrl-wrapper{float:left}.webmap-ctrl-top-right>.webmap-ctrl,.webmap-ctrl-top-right>.webmap-ctrl-wrapper{float:right}.webmap-ctrl-bottom-left>.webmap-ctrl,.webmap-ctrl-bottom-left>.webmap-ctrl-wrapper{float:left}.webmap-ctrl-bottom-right>.webmap-ctrl,.webmap-ctrl-bottom-right>.webmap-ctrl-wrapper{float:right}.webmap-ctrl-top-left>.webmap-ctrl-margin{margin:10px 0 0 10px}.webmap-ctrl-top-right>.webmap-ctrl-margin{margin:10px 10px 0 0}.webmap-ctrl-bottom-left>.webmap-ctrl-margin{margin:0 0 10px 10px}.webmap-ctrl-bottom-right>.webmap-ctrl-margin{margin:0 10px 10px 0}.webmap-ctrl-group{border-radius:4px;background:#fff}.webmap-ctrl .webmap-ctrl-wrapper{clear:none;float:none;margin:0}.webmap-ctrl .webmap-ctrl-wrapper>.webmap-ctrl,.webmap-ctrl>.webmap-ctrl{clear:none;float:none;margin:0!important}.webmap-ctrl-horizontal,.webmap-ctrl-vertical{display:flex}.webmap-ctrl-vertical{flex-direction:column;align-items:var(--webmap-ctrl-align,flex-start)}.webmap-ctrl-horizontal{flex-direction:row;align-items:var(--webmap-ctrl-align,stretch)}.webmap-ctrl:not(.webmap-ctrl-group).webmap-ctrl-horizontal,.webmap-ctrl:not(.webmap-ctrl-group).webmap-ctrl-vertical{gap:var(--webmap-ctrl-gap,0)}.webmap-ctrl-gapless:not(.webmap-ctrl-group){border:2px solid rgba(0,0,0,.1);border-radius:4px;box-sizing:border-box;background:#fff;overflow:hidden}.webmap-ctrl-gapless:not(.webmap-ctrl-group):not(:empty){box-shadow:none}.webmap-ctrl-gapless>.webmap-ctrl-group,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.webmap-ctrl-group{border-radius:0;border:0!important;box-shadow:none!important}.webmap-ctrl-gapless>.leaflet-bar,.webmap-ctrl-gapless>.maplibregl-ctrl-group,.webmap-ctrl-gapless>.ol-control,.webmap-ctrl-gapless>.webmap-ctrl,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.leaflet-bar,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.maplibregl-ctrl-group,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.ol-control,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.webmap-ctrl{border:0!important;box-shadow:none!important}.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-group:first-child,.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-wrapper:first-child>.webmap-ctrl-group{border-radius:4px 0 0 4px}.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-group:last-child,.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-wrapper:last-child>.webmap-ctrl-group{border-radius:0 4px 4px 0}.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-group:first-child,.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-wrapper:first-child>.webmap-ctrl-group{border-radius:4px 4px 0 0}.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-group:last-child,.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-wrapper:last-child>.webmap-ctrl-group{border-radius:0 0 4px 4px}.webmap-ctrl-gapless>.webmap-ctrl-group:only-child,.webmap-ctrl-gapless>.webmap-ctrl-wrapper:only-child>.webmap-ctrl-group{border-radius:4px}.webmap-ctrl-horizontal>.webmap-ctrl-wrapper,.webmap-ctrl-vertical>.webmap-ctrl-wrapper{display:flex}.webmap-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.webmap-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}.webmap-ctrl-gapless:not(.webmap-ctrl-group){border-color:ButtonText}}.webmap-ctrl-gapless>.webmap-ctrl-group:not(:empty),.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.webmap-ctrl-group:not(:empty){border:0!important;box-shadow:none!important}.webmap-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.webmap-ctrl-button{line-height:inherit!important;font-weight:400!important}.webmap-ctrl-group button+button{border-top:1px solid #ddd}.webmap-ctrl-group.webmap-ctrl-horizontal>button+button{border-top:0;border-left:1px solid #ddd}.webmap-ctrl-gapless .webmap-ctrl-group button+button,.webmap-ctrl-group.webmap-ctrl-gapless button+button{border-top:0!important;border-left:0!important}.webmap-ctrl-gapless .webmap-ctrl-group button{border:0!important;border-radius:0!important;box-shadow:none!important}.webmap-ctrl button .webmap-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.webmap-ctrl-icon{background-color:transparent}.webmap-ctrl-group button+button{border-top:1px solid ButtonText}}.webmap-ctrl button::-moz-focus-inner{border:0;padding:0}.webmap-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.webmap-ctrl button:disabled{cursor:not-allowed}.webmap-ctrl button:disabled .webmap-ctrl-icon{opacity:.25}.webmap-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.webmap-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.webmap-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.webmap-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.webmap-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.webmap-ctrl-group button:focus:only-child{border-radius:inherit}.webmap-ctrl button.webmap-ctrl-zoom-out .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.webmap-ctrl button.webmap-ctrl-zoom-in .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}@media (-ms-high-contrast:active){.webmap-ctrl button.webmap-ctrl-zoom-out .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.webmap-ctrl button.webmap-ctrl-zoom-in .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}}@media (-ms-high-contrast:black-on-white){.webmap-ctrl button.webmap-ctrl-zoom-out .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.webmap-ctrl button.webmap-ctrl-zoom-in .webmap-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}}.leaflet-bar.webmap-ctrl-group:not(:empty){box-shadow:0 0 2px rgba(0,0,0,.1)}');u(".ngw-map-container.leaflet-container{background:#fff}.leaflet-pane .leaflet-popup-pane{z-index:9999999999}");var tp=Object.defineProperty,ep=Object.defineProperties,ip=Object.getOwnPropertyDescriptors,op=Object.getOwnPropertySymbols,rp=Object.prototype.hasOwnProperty,np=Object.prototype.propertyIsEnumerable,sp=(t,e,i)=>e in t?tp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;delete P.Icon.Default.prototype._getIconUrl,P.Icon.Default.mergeOptions({iconRetinaUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",iconUrl:"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=",shadowUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC"});class ap extends Xu{constructor(t){var e,i;e=((t,e)=>{for(var i in e||(e={}))rp.call(e,i)&&sp(t,i,e[i]);if(op)for(var i of op(e))np.call(e,i)&&sp(t,i,e[i]);return t})({},t),i={mapAdapter:new xr},super(t=ep(e,ip(i)))}static create(t){return e=this,i=null,o=function*(){return new ap(t).onLoad()},new Promise((t,r)=>{var n=t=>{try{a(o.next(t))}catch(e){r(e)}},s=t=>{try{a(o.throw(t))}catch(e){r(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(n,s);a((o=o.apply(e,i)).next())});var e,i,o}}return window&&!window.NgwMap&&(window.NgwMap=ap),ap}();
6
6
  //# sourceMappingURL=ngw-leaflet.global.prod.js.map