@edgepdf/viewer-react 0.3.6 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -13
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{useEffect as bt,useRef as te}from"react";var sa=`@import"https://fonts.googleapis.com/css2?family=Lato:wght@300;400;500;600;700&display=swap";.seamless-tiles
|
|
1
|
+
import{useEffect as bt,useRef as te}from"react";var sa=`@import"https://fonts.googleapis.com/css2?family=Lato:wght@300;400;500;600;700&display=swap";.leaflet-container{background:#fff!important}.seamless-tiles .leaflet-tile{border:none!important;outline:none!important;margin:0!important;padding:0!important}.leaflet-layer{border:none!important}.edgepdf-marker-tooltip{text-align:center;white-space:nowrap}.leaflet-tooltip-top.edgepdf-marker-tooltip:before,.leaflet-tooltip-bottom.edgepdf-marker-tooltip:before{left:50%!important;margin-left:-8px!important}.leaflet-tooltip-left.edgepdf-marker-tooltip:before,.leaflet-tooltip-right.edgepdf-marker-tooltip:before{top:50%!important;margin-top:-8px!important}.edgepdf-marker-popup-actions{display:flex;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid #e0e0e0}.edgepdf-marker-popup-edit,.edgepdf-marker-popup-delete{flex:1;padding:6px 12px;border:1px solid #ccc;border-radius:4px;background-color:#fff;color:#333;cursor:pointer;font-size:14px;transition:all .2s ease}.edgepdf-marker-popup-edit:hover{background-color:#f0f0f0;border-color:#999}.edgepdf-marker-popup-delete{color:#d32f2f;border-color:#d32f2f}.edgepdf-marker-popup-delete:hover{background-color:#ffebee;border-color:#b71c1c}.edgepdf-marker-edit-popup{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center;font-family:Lato,sans-serif}.edgepdf-marker-edit-popup-overlay{position:absolute;inset:0;background-color:#000000b3;cursor:pointer}.edgepdf-marker-edit-popup-content{position:relative;background-color:#1a1a1a;border-radius:8px;box-shadow:0 4px 20px #00000080;border:1px solid #333;width:90%;max-width:500px;max-height:90vh;overflow:auto;z-index:100001}.edgepdf-marker-edit-popup-header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid #333}.edgepdf-marker-edit-popup-header h3{margin:0;font-size:18px;font-weight:600;color:#fff}.edgepdf-marker-edit-popup-close{background:none;border:none;font-size:24px;line-height:1;color:#fff;cursor:pointer;padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:background-color .2s ease}.edgepdf-marker-edit-popup-close:hover{background-color:#333;color:orange}.edgepdf-marker-edit-popup-body{padding:20px}.edgepdf-marker-edit-field{margin-bottom:16px}.edgepdf-marker-edit-field:last-child{margin-bottom:0}.edgepdf-marker-edit-field label{display:block;margin-bottom:8px;font-size:14px;font-weight:500;color:#fff}.edgepdf-marker-edit-input{width:100%;padding:10px 12px;border:1px solid #444;border-radius:4px;font-size:14px;background-color:#2a2a2a;color:#fff;box-sizing:border-box;transition:border-color .2s ease}.edgepdf-marker-edit-input:focus{outline:none;border-color:orange;box-shadow:0 0 0 2px #ffa50033}.edgepdf-marker-edit-input::placeholder{color:#888}.edgepdf-marker-edit-popup-footer{display:flex;justify-content:flex-end;gap:12px;padding:16px 20px;border-top:1px solid #333}.edgepdf-marker-edit-button{padding:10px 20px;border:1px solid #444;border-radius:4px;background-color:#2a2a2a;color:#fff;cursor:pointer;font-size:14px;font-weight:500;transition:all .2s ease}.edgepdf-marker-edit-button-cancel:hover{background-color:#333;border-color:#555}.edgepdf-marker-edit-button-save{background-color:orange;color:#000;border-color:orange}.edgepdf-marker-edit-button-save:hover{background-color:gold;border-color:gold}.edgepdf-marker-delete-popup{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center;font-family:Lato,sans-serif}.edgepdf-marker-delete-popup-overlay{position:absolute;inset:0;background-color:#000000b3;cursor:pointer}.edgepdf-marker-delete-popup-content{position:relative;background-color:#1a1a1a;border-radius:8px;box-shadow:0 4px 20px #00000080;border:1px solid #333;width:90%;max-width:500px;max-height:90vh;overflow:auto;z-index:100001}.edgepdf-marker-delete-popup-header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid #333}.edgepdf-marker-delete-popup-header h3{margin:0;font-size:18px;font-weight:600;color:#fff}.edgepdf-marker-delete-popup-close{background:none;border:none;font-size:24px;line-height:1;color:#fff;cursor:pointer;padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:background-color .2s ease}.edgepdf-marker-delete-popup-close:hover{background-color:#333;color:orange}.edgepdf-marker-delete-popup-body{padding:20px}.edgepdf-marker-delete-popup-body p{margin:0;font-size:14px;color:#fff;line-height:1.5}.edgepdf-marker-delete-popup-body strong{font-weight:600;color:orange}.edgepdf-marker-delete-popup-footer{display:flex;justify-content:flex-end;gap:12px;padding:16px 20px;border-top:1px solid #333}.edgepdf-marker-delete-button{padding:10px 20px;border:1px solid #444;border-radius:4px;background-color:#2a2a2a;color:#fff;cursor:pointer;font-size:14px;font-weight:500;transition:all .2s ease}.edgepdf-marker-delete-button-cancel:hover{background-color:#333;border-color:#555}.edgepdf-marker-delete-button-confirm{background-color:orange;color:#000;border-color:orange}.edgepdf-marker-delete-button-confirm:hover{background-color:gold;border-color:gold}.edgepdf-marker-icon-overlay-container{background:transparent!important;border:none!important;box-shadow:none!important}.edgepdf-marker-icon-overlay{display:flex;flex-direction:column;gap:4px;position:relative;z-index:1000}.edgepdf-marker-icon-button{border:none;background:transparent;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:transform .2s ease,opacity .2s ease}.edgepdf-marker-icon-button:hover{transform:scale(1.1);opacity:.9}.edgepdf-marker-icon-button:active{transform:scale(.95)}
|
|
2
2
|
`;if(typeof document<"u"){let o=document.createElement("style");o.textContent=sa,document.head.appendChild(o)}var la=Object.create,Di=Object.defineProperty,ha=Object.getOwnPropertyDescriptor,ca=Object.getOwnPropertyNames,da=Object.getPrototypeOf,ua=Object.prototype.hasOwnProperty,pa=(o,r)=>()=>(r||o((r={exports:{}}).exports,r),r.exports),ma=(o,r)=>{for(var s in r)Di(o,s,{get:r[s],enumerable:!0})},Ai=(o,r,s,h)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of ca(r))!ua.call(o,c)&&c!==s&&Di(o,c,{get:()=>r[c],enumerable:!(h=ha(r,c))||h.enumerable});return o},fa=(o,r,s)=>(Ai(o,r,"default"),s&&Ai(s,r,"default")),hn=(o,r,s)=>(s=o!=null?la(da(o)):{},Ai(r||!o||!o.__esModule?Di(s,"default",{value:o,enumerable:!0}):s,o)),cn=pa((o,r)=>{"use strict";(function(s,h){typeof o=="object"&&typeof r<"u"?h(o):typeof define=="function"&&define.amd?define(["exports"],h):(s=typeof globalThis<"u"?globalThis:s||self,h(s.leaflet={}))})(o,function(s){"use strict";var h="1.9.4";function c(t){var e,i,n,a;for(i=1,n=arguments.length;i<n;i++){a=arguments[i];for(e in a)t[e]=a[e]}return t}var p=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function u(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var _=0;function v(t){return"_leaflet_id"in t||(t._leaflet_id=++_),t._leaflet_id}function x(t,e,i){var n,a,l,d;return d=function(){n=!1,a&&(l.apply(i,a),a=!1)},l=function(){n?a=arguments:(t.apply(i,arguments),setTimeout(d,e),n=!0)},l}function y(t,e,i){var n=e[1],a=e[0],l=n-a;return t===n&&i?t:((t-a)%l+l)%l+a}function g(){return!1}function k(t,e){if(e===!1)return t;var i=Math.pow(10,e===void 0?6:e);return Math.round(t*i)/i}function S(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function w(t){return S(t).split(/\s+/)}function M(t,e){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?p(t.options):{});for(var i in e)t.options[i]=e[i];return t.options}function z(t,e,i){var n=[];for(var a in t)n.push(encodeURIComponent(i?a.toUpperCase():a)+"="+encodeURIComponent(t[a]));return(!e||e.indexOf("?")===-1?"?":"&")+n.join("&")}var ot=/\{ *([\w_ -]+) *\}/g;function J(t,e){return t.replace(ot,function(i,n){var a=e[n];if(a===void 0)throw new Error("No value provided for variable "+i);return typeof a=="function"&&(a=a(e)),a})}var tt=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function q(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var ut="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function ft(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var Et=0;function st(t){var e=+new Date,i=Math.max(0,16-(e-Et));return Et=e+i,window.setTimeout(t,i)}var Zt=window.requestAnimationFrame||ft("RequestAnimationFrame")||st,ee=window.cancelAnimationFrame||ft("CancelAnimationFrame")||ft("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function lt(t,e,i){if(i&&Zt===st)t.call(e);else return Zt.call(window,u(t,e))}function E(t){t&&ee.call(window,t)}var D={__proto__:null,extend:c,create:p,bind:u,get lastId(){return _},stamp:v,throttle:x,wrapNum:y,falseFn:g,formatNum:k,trim:S,splitWords:w,setOptions:M,getParamString:z,template:J,isArray:tt,indexOf:q,emptyImageUrl:ut,requestFn:Zt,cancelFn:ee,requestAnimFrame:lt,cancelAnimFrame:E};function H(){}H.extend=function(t){var e=function(){M(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,n=p(i);n.constructor=e,e.prototype=n;for(var a in this)Object.prototype.hasOwnProperty.call(this,a)&&a!=="prototype"&&a!=="__super__"&&(e[a]=this[a]);return t.statics&&c(e,t.statics),t.includes&&(et(t.includes),c.apply(null,[n].concat(t.includes))),c(n,t),delete n.statics,delete n.includes,n.options&&(n.options=i.options?p(i.options):{},c(n.options,t.options)),n._initHooks=[],n.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var l=0,d=n._initHooks.length;l<d;l++)n._initHooks[l].call(this)}},e},H.include=function(t){var e=this.prototype.options;return c(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},H.mergeOptions=function(t){return c(this.prototype.options,t),this},H.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i=typeof t=="function"?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};function et(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=tt(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)}}var Y={on:function(t,e,i){if(typeof t=="object")for(var n in t)this._on(n,t[n],e);else{t=w(t);for(var a=0,l=t.length;a<l;a++)this._on(t[a],e,i)}return this},off:function(t,e,i){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var n in t)this._off(n,t[n],e);else{t=w(t);for(var a=arguments.length===1,l=0,d=t.length;l<d;l++)a?this._off(t[l]):this._off(t[l],e,i)}return this},_on:function(t,e,i,n){if(typeof e!="function"){console.warn("wrong listener type: "+typeof e);return}if(this._listens(t,e,i)===!1){i===this&&(i=void 0);var a={fn:e,ctx:i};n&&(a.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(a)}},_off:function(t,e,i){var n,a,l;if(this._events&&(n=this._events[t],!!n)){if(arguments.length===1){if(this._firingCount)for(a=0,l=n.length;a<l;a++)n[a].fn=g;delete this._events[t];return}if(typeof e!="function"){console.warn("wrong listener type: "+typeof e);return}var d=this._listens(t,e,i);if(d!==!1){var m=n[d];this._firingCount&&(m.fn=g,this._events[t]=n=n.slice()),n.splice(d,1)}}},fire:function(t,e,i){if(!this.listens(t,i))return this;var n=c({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var a=this._events[t];if(a){this._firingCount=this._firingCount+1||1;for(var l=0,d=a.length;l<d;l++){var m=a[l],f=m.fn;m.once&&this.off(t,f,m.ctx),f.call(m.ctx||this,n)}this._firingCount--}}return i&&this._propagateEvent(n),this},listens:function(t,e,i,n){typeof t!="string"&&console.warn('"string" type argument expected');var a=e;typeof e!="function"&&(n=!!e,a=void 0,i=void 0);var l=this._events&&this._events[t];if(l&&l.length&&this._listens(t,a,i)!==!1)return!0;if(n){for(var d in this._eventParents)if(this._eventParents[d].listens(t,e,i,n))return!0}return!1},_listens:function(t,e,i){if(!this._events)return!1;var n=this._events[t]||[];if(!e)return!!n.length;i===this&&(i=void 0);for(var a=0,l=n.length;a<l;a++)if(n[a].fn===e&&n[a].ctx===i)return a;return!1},once:function(t,e,i){if(typeof t=="object")for(var n in t)this._on(n,t[n],e,!0);else{t=w(t);for(var a=0,l=t.length;a<l;a++)this._on(t[a],e,i,!0)}return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[v(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[v(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,c({layer:t.target,propagatedFrom:t.target},t),!0)}};Y.addEventListener=Y.on,Y.removeEventListener=Y.clearAllEventListeners=Y.off,Y.addOneTimeEventListener=Y.once,Y.fireEvent=Y.fire,Y.hasEventListeners=Y.listens;var X=H.extend(Y);function Z(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var Ut=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};Z.prototype={clone:function(){return new Z(this.x,this.y)},add:function(t){return this.clone()._add(C(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(C(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 Z(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new Z(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=Ut(this.x),this.y=Ut(this.y),this},distanceTo:function(t){t=C(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=C(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=C(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+k(this.x)+", "+k(this.y)+")"}};function C(t,e,i){return t instanceof Z?t:tt(t)?new Z(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new Z(t.x,t.y):new Z(t,e,i)}function G(t,e){if(t)for(var i=e?[t,e]:t,n=0,a=i.length;n<a;n++)this.extend(i[n])}G.prototype={extend:function(t){var e,i;if(!t)return this;if(t instanceof Z||typeof t[0]=="number"||"x"in t)e=i=C(t);else if(t=nt(t),e=t.min,i=t.max,!e||!i)return this;return!this.min&&!this.max?(this.min=e.clone(),this.max=i.clone()):(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(i.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(i.y,this.max.y)),this},getCenter:function(t){return C((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return C(this.min.x,this.max.y)},getTopRight:function(){return C(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 typeof t[0]=="number"||t instanceof Z?t=C(t):t=nt(t),t instanceof G?(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=nt(t);var e=this.min,i=this.max,n=t.min,a=t.max,l=a.x>=e.x&&n.x<=i.x,d=a.y>=e.y&&n.y<=i.y;return l&&d},overlaps:function(t){t=nt(t);var e=this.min,i=this.max,n=t.min,a=t.max,l=a.x>e.x&&n.x<i.x,d=a.y>e.y&&n.y<i.y;return l&&d},isValid:function(){return!!(this.min&&this.max)},pad:function(t){var e=this.min,i=this.max,n=Math.abs(e.x-i.x)*t,a=Math.abs(e.y-i.y)*t;return nt(C(e.x-n,e.y-a),C(i.x+n,i.y+a))},equals:function(t){return t?(t=nt(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight())):!1}};function nt(t,e){return!t||t instanceof G?t:new G(t,e)}function W(t,e){if(t)for(var i=e?[t,e]:t,n=0,a=i.length;n<a;n++)this.extend(i[n])}W.prototype={extend:function(t){var e=this._southWest,i=this._northEast,n,a;if(t instanceof N)n=t,a=t;else if(t instanceof W){if(n=t._southWest,a=t._northEast,!n||!a)return this}else return t?this.extend(B(t)||F(t)):this;return!e&&!i?(this._southWest=new N(n.lat,n.lng),this._northEast=new N(a.lat,a.lng)):(e.lat=Math.min(n.lat,e.lat),e.lng=Math.min(n.lng,e.lng),i.lat=Math.max(a.lat,i.lat),i.lng=Math.max(a.lng,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,a=Math.abs(e.lng-i.lng)*t;return new W(new N(e.lat-n,e.lng-a),new N(i.lat+n,i.lng+a))},getCenter:function(){return new N((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new N(this.getNorth(),this.getWest())},getSouthEast:function(){return new N(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){typeof t[0]=="number"||t instanceof N||"lat"in t?t=B(t):t=F(t);var e=this._southWest,i=this._northEast,n,a;return t instanceof W?(n=t.getSouthWest(),a=t.getNorthEast()):n=a=t,n.lat>=e.lat&&a.lat<=i.lat&&n.lng>=e.lng&&a.lng<=i.lng},intersects:function(t){t=F(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),a=t.getNorthEast(),l=a.lat>=e.lat&&n.lat<=i.lat,d=a.lng>=e.lng&&n.lng<=i.lng;return l&&d},overlaps:function(t){t=F(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),a=t.getNorthEast(),l=a.lat>e.lat&&n.lat<i.lat,d=a.lng>e.lng&&n.lng<i.lng;return l&&d},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return t?(t=F(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function F(t,e){return t instanceof W?t:new W(t,e)}function N(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,i!==void 0&&(this.alt=+i)}N.prototype={equals:function(t,e){if(!t)return!1;t=B(t);var i=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return i<=(e===void 0?1e-9:e)},toString:function(t){return"LatLng("+k(this.lat,t)+", "+k(this.lng,t)+")"},distanceTo:function(t){return Lt.distance(this,B(t))},wrap:function(){return Lt.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return F([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new N(this.lat,this.lng,this.alt)}};function B(t,e,i){return t instanceof N?t:tt(t)&&typeof t[0]!="object"?t.length===3?new N(t[0],t[1],t[2]):t.length===2?new N(t[0],t[1]):null:t==null?t:typeof t=="object"&&"lat"in t?new N(t.lat,"lng"in t?t.lng:t.lon,t.alt):e===void 0?null:new N(t,e,i)}var gt={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t),n=this.transformation.transform(e.min,i),a=this.transformation.transform(e.max,i);return new G(n,a)},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?y(t.lng,this.wrapLng,!0):t.lng,i=this.wrapLat?y(t.lat,this.wrapLat,!0):t.lat,n=t.alt;return new N(i,e,n)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,a=e.lng-i.lng;if(n===0&&a===0)return t;var l=t.getSouthWest(),d=t.getNorthEast(),m=new N(l.lat-n,l.lng-a),f=new N(d.lat-n,d.lng-a);return new W(m,f)}},Lt=c({},gt,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,a=e.lat*i,l=Math.sin((e.lat-t.lat)*i/2),d=Math.sin((e.lng-t.lng)*i/2),m=l*l+Math.cos(n)*Math.cos(a)*d*d,f=2*Math.atan2(Math.sqrt(m),Math.sqrt(1-m));return this.R*f}}),fe=6378137,ge={R:fe,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),a=Math.sin(n*e);return new Z(this.R*t.lng*e,this.R*Math.log((1+a)/(1-a))/2)},unproject:function(t){var e=180/Math.PI;return new N((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=fe*Math.PI;return new G([-t,-t],[t,t])}()};function ie(t,e,i,n){if(tt(t)){this._a=t[0],this._b=t[1],this._c=t[2],this._d=t[3];return}this._a=t,this._b=e,this._c=i,this._d=n}ie.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new Z((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};function Wt(t,e,i,n){return new ie(t,e,i,n)}var oe=c({},Lt,{code:"EPSG:3857",projection:ge,transformation:function(){var t=.5/(Math.PI*ge.R);return Wt(t,.5,-t,.5)}()}),Rn=c({},oe,{code:"EPSG:900913"});function Gi(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Ki(t,e){var i="",n,a,l,d,m,f;for(n=0,l=t.length;n<l;n++){for(m=t[n],a=0,d=m.length;a<d;a++)f=m[a],i+=(a?"L":"M")+f.x+" "+f.y;i+=e?T.svg?"z":"x":""}return i||"M0 0"}var ei=document.documentElement.style,Se="ActiveXObject"in window,Dn=Se&&!document.addEventListener,Yi="msLaunchUri"in navigator&&!("documentMode"in document),ii=It("webkit"),$i=It("android"),Xi=It("android 2")||It("android 3"),Nn=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),jn=$i&&It("Google")&&Nn<537&&!("AudioNode"in window),oi=!!window.opera,Ji=!Yi&&It("chrome"),Qi=It("gecko")&&!ii&&!oi&&!Se,Hn=!Ji&&It("safari"),to=It("phantom"),eo="OTransition"in ei,Un=navigator.platform.indexOf("Win")===0,io=Se&&"transition"in ei,ni="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!Xi,oo="MozPerspective"in ei,Wn=!window.L_DISABLE_3D&&(io||ni||oo)&&!eo&&!to,_e=typeof orientation<"u"||It("mobile"),Vn=_e&&ii,Fn=_e&&ni,no=!window.PointerEvent&&window.MSPointerEvent,ro=!!(window.PointerEvent||no),ao="ontouchstart"in window||!!window.TouchEvent,qn=!window.L_NO_TOUCH&&(ao||ro),Gn=_e&&oi,Kn=_e&&Qi,Yn=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,$n=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",g,e),window.removeEventListener("testPassiveEventSupport",g,e)}catch{}return t}(),Xn=function(){return!!document.createElement("canvas").getContext}(),ri=!!(document.createElementNS&&Gi("svg").createSVGRect),Jn=!!ri&&function(){var t=document.createElement("div");return t.innerHTML="<svg/>",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Qn=!ri&&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&&typeof e.adj=="object"}catch{return!1}}(),tr=navigator.platform.indexOf("Mac")===0,er=navigator.platform.indexOf("Linux")===0;function It(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var T={ie:Se,ielt9:Dn,edge:Yi,webkit:ii,android:$i,android23:Xi,androidStock:jn,opera:oi,chrome:Ji,gecko:Qi,safari:Hn,phantom:to,opera12:eo,win:Un,ie3d:io,webkit3d:ni,gecko3d:oo,any3d:Wn,mobile:_e,mobileWebkit:Vn,mobileWebkit3d:Fn,msPointer:no,pointer:ro,touch:qn,touchNative:ao,mobileOpera:Gn,mobileGecko:Kn,retina:Yn,passiveEvents:$n,canvas:Xn,svg:ri,vml:Qn,inlineSvg:Jn,mac:tr,linux:er},so=T.msPointer?"MSPointerDown":"pointerdown",lo=T.msPointer?"MSPointerMove":"pointermove",ho=T.msPointer?"MSPointerUp":"pointerup",co=T.msPointer?"MSPointerCancel":"pointercancel",ai={touchstart:so,touchmove:lo,touchend:ho,touchcancel:co},uo={touchstart:sr,touchmove:Ae,touchend:Ae,touchcancel:Ae},ne={},po=!1;function ir(t,e,i){return e==="touchstart"&&ar(),uo[e]?(i=uo[e].bind(this,i),t.addEventListener(ai[e],i,!1),i):(console.warn("wrong event specified:",e),g)}function or(t,e,i){if(!ai[e]){console.warn("wrong event specified:",e);return}t.removeEventListener(ai[e],i,!1)}function nr(t){ne[t.pointerId]=t}function rr(t){ne[t.pointerId]&&(ne[t.pointerId]=t)}function mo(t){delete ne[t.pointerId]}function ar(){po||(document.addEventListener(so,nr,!0),document.addEventListener(lo,rr,!0),document.addEventListener(ho,mo,!0),document.addEventListener(co,mo,!0),po=!0)}function Ae(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){e.touches=[];for(var i in ne)e.touches.push(ne[i]);e.changedTouches=[e],t(e)}}function sr(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&dt(e),Ae(t,e)}function lr(t){var e={},i,n;for(n in t)i=t[n],e[n]=i&&i.bind?i.bind(t):i;return t=e,e.type="dblclick",e.detail=2,e.isTrusted=!1,e._simulated=!0,e}var hr=200;function cr(t,e){t.addEventListener("dblclick",e);var i=0,n;function a(l){if(l.detail!==1){n=l.detail;return}if(!(l.pointerType==="mouse"||l.sourceCapabilities&&!l.sourceCapabilities.firesTouchEvents)){var d=yo(l);if(!(d.some(function(f){return f instanceof HTMLLabelElement&&f.attributes.for})&&!d.some(function(f){return f instanceof HTMLInputElement||f instanceof HTMLSelectElement}))){var m=Date.now();m-i<=hr?(n++,n===2&&e(lr(l))):n=1,i=m}}}return t.addEventListener("click",a),{dblclick:e,simDblclick:a}}function dr(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var si=Re(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ve=Re(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),fo=ve==="webkitTransition"||ve==="OTransition"?ve+"End":"transitionend";function go(t){return typeof t=="string"?document.getElementById(t):t}function ye(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||i==="auto")&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return i==="auto"?null:i}function U(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function Q(t){var e=t.parentNode;e&&e.removeChild(t)}function Oe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function re(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ae(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function li(t,e){if(t.classList!==void 0)return t.classList.contains(e);var i=Be(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function O(t,e){if(t.classList!==void 0)for(var i=w(e),n=0,a=i.length;n<a;n++)t.classList.add(i[n]);else if(!li(t,e)){var l=Be(t);hi(t,(l?l+" ":"")+e)}}function it(t,e){t.classList!==void 0?t.classList.remove(e):hi(t,S((" "+Be(t)+" ").replace(" "+e+" "," ")))}function hi(t,e){t.className.baseVal===void 0?t.className=e:t.className.baseVal=e}function Be(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}function xt(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&ur(t,e)}function ur(t,e){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch{if(e===1)return}e=Math.round(e*100),i?(i.Enabled=e!==100,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}function Re(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Yt(t,e,i){var n=e||new Z(0,0);t.style[si]=(T.ie3d?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function rt(t,e){t._leaflet_pos=e,T.any3d?Yt(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function $t(t){return t._leaflet_pos||new Z(0,0)}var be,xe,ci;if("onselectstart"in document)be=function(){A(window,"selectstart",dt)},xe=function(){$(window,"selectstart",dt)};else{var we=Re(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);be=function(){if(we){var t=document.documentElement.style;ci=t[we],t[we]="none"}},xe=function(){we&&(document.documentElement.style[we]=ci,ci=void 0)}}function di(){A(window,"dragstart",dt)}function ui(){$(window,"dragstart",dt)}var De,pi;function mi(t){for(;t.tabIndex===-1;)t=t.parentNode;t.style&&(Ne(),De=t,pi=t.style.outlineStyle,t.style.outlineStyle="none",A(window,"keydown",Ne))}function Ne(){De&&(De.style.outlineStyle=pi,De=void 0,pi=void 0,$(window,"keydown",Ne))}function _o(t){do t=t.parentNode;while((!t.offsetWidth||!t.offsetHeight)&&t!==document.body);return t}function fi(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var pr={__proto__:null,TRANSFORM:si,TRANSITION:ve,TRANSITION_END:fo,get:go,getStyle:ye,create:U,remove:Q,empty:Oe,toFront:re,toBack:ae,hasClass:li,addClass:O,removeClass:it,setClass:hi,getClass:Be,setOpacity:xt,testProp:Re,setTransform:Yt,setPosition:rt,getPosition:$t,get disableTextSelection(){return be},get enableTextSelection(){return xe},disableImageDrag:di,enableImageDrag:ui,preventOutline:mi,restoreOutline:Ne,getSizedParentNode:_o,getScale:fi};function A(t,e,i,n){if(e&&typeof e=="object")for(var a in e)_i(t,a,e[a],i);else{e=w(e);for(var l=0,d=e.length;l<d;l++)_i(t,e[l],i,n)}return this}var St="_leaflet_events";function $(t,e,i,n){if(arguments.length===1)vo(t),delete t[St];else if(e&&typeof e=="object")for(var a in e)vi(t,a,e[a],i);else if(e=w(e),arguments.length===2)vo(t,function(m){return q(e,m)!==-1});else for(var l=0,d=e.length;l<d;l++)vi(t,e[l],i,n);return this}function vo(t,e){for(var i in t[St]){var n=i.split(/\d/)[0];(!e||e(n))&&vi(t,n,null,null,i)}}var gi={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function _i(t,e,i,n){var a=e+v(i)+(n?"_"+v(n):"");if(t[St]&&t[St][a])return this;var l=function(m){return i.call(n||t,m||window.event)},d=l;!T.touchNative&&T.pointer&&e.indexOf("touch")===0?l=ir(t,e,l):T.touch&&e==="dblclick"?l=cr(t,l):"addEventListener"in t?e==="touchstart"||e==="touchmove"||e==="wheel"||e==="mousewheel"?t.addEventListener(gi[e]||e,l,T.passiveEvents?{passive:!1}:!1):e==="mouseenter"||e==="mouseleave"?(l=function(m){m=m||window.event,bi(t,m)&&d(m)},t.addEventListener(gi[e],l,!1)):t.addEventListener(e,d,!1):t.attachEvent("on"+e,l),t[St]=t[St]||{},t[St][a]=l}function vi(t,e,i,n,a){a=a||e+v(i)+(n?"_"+v(n):"");var l=t[St]&&t[St][a];if(!l)return this;!T.touchNative&&T.pointer&&e.indexOf("touch")===0?or(t,e,l):T.touch&&e==="dblclick"?dr(t,l):"removeEventListener"in t?t.removeEventListener(gi[e]||e,l,!1):t.detachEvent("on"+e,l),t[St][a]=null}function Xt(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function yi(t){return _i(t,"wheel",Xt),this}function ke(t){return A(t,"mousedown touchstart dblclick contextmenu",Xt),t._leaflet_disable_click=!0,this}function dt(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Jt(t){return dt(t),Xt(t),this}function yo(t){if(t.composedPath)return t.composedPath();for(var e=[],i=t.target;i;)e.push(i),i=i.parentNode;return e}function bo(t,e){if(!e)return new Z(t.clientX,t.clientY);var i=fi(e),n=i.boundingClientRect;return new Z((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var mr=T.linux&&T.chrome?window.devicePixelRatio:T.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function xo(t){return T.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/mr:t.deltaY&&t.deltaMode===1?-t.deltaY*20:t.deltaY&&t.deltaMode===2?-t.deltaY*60:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?-t.detail*20:t.detail?t.detail/-32765*60:0}function bi(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch{return!1}return i!==t}var fr={__proto__:null,on:A,off:$,stopPropagation:Xt,disableScrollPropagation:yi,disableClickPropagation:ke,preventDefault:dt,stop:Jt,getPropagationPath:yo,getMousePosition:bo,getWheelDelta:xo,isExternalTarget:bi,addListener:A,removeListener:$},wo=X.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=$t(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=lt(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=this._duration*1e3;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(),rt(this._el,i),this.fire("step")},_complete:function(){E(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),j=X.extend({options:{crs:oe,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=M(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=u(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.zoom!==void 0&&(this._zoom=this._limitZoom(e.zoom)),e.center&&e.zoom!==void 0&&this.setView(B(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ve&&T.any3d&&!T.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),A(this._proxy,fo,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){if(e=e===void 0?this._zoom:this._limitZoom(e),t=this._limitCenter(B(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&i!==!0){i.animate!==void 0&&(i.zoom=c({animate:i.animate},i.zoom),i.pan=c({animate:i.animate,duration:i.duration},i.pan));var n=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan);if(n)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e,i.pan&&i.pan.noMoveStart),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(T.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(T.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),a=this.getSize().divideBy(2),l=t instanceof Z?t:this.latLngToContainerPoint(t),d=l.subtract(a).multiplyBy(1-1/n),m=this.containerPointToLatLng(a.add(d));return this.setView(m,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():F(t);var i=C(e.paddingTopLeft||e.padding||[0,0]),n=C(e.paddingBottomRight||e.padding||[0,0]),a=this.getBoundsZoom(t,!1,i.add(n));if(a=typeof e.maxZoom=="number"?Math.min(e.maxZoom,a):a,a===1/0)return{center:t.getCenter(),zoom:a};var l=n.subtract(i).divideBy(2),d=this.project(t.getSouthWest(),a),m=this.project(t.getNorthEast(),a),f=this.unproject(d.add(m).divideBy(2).add(l),a);return{center:f,zoom:a}},fitBounds:function(t,e){if(t=F(t),!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(t=C(t).round(),e=e||{},!t.x&&!t.y)return this.fire("moveend");if(e.animate!==!0&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new wo,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){O(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(i=i||{},i.animate===!1||!T.any3d)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),a=this.project(t),l=this.getSize(),d=this._zoom;t=B(t),e=e===void 0?d:e;var m=Math.max(l.x,l.y),f=m*this.getZoomScale(d,e),b=a.distanceTo(n)||1,P=1.42,I=P*P;function R(at){var Xe=at?-1:1,oa=at?f:m,na=f*f-m*m+Xe*I*I*b*b,ra=2*oa*I*b,Zi=na/ra,on=Math.sqrt(Zi*Zi+1)-Zi,aa=on<1e-9?-18:Math.log(on);return aa}function pt(at){return(Math.exp(at)-Math.exp(-at))/2}function ht(at){return(Math.exp(at)+Math.exp(-at))/2}function kt(at){return pt(at)/ht(at)}var mt=R(0);function ue(at){return m*(ht(mt)/ht(mt+P*at))}function Qr(at){return m*(ht(mt)*kt(mt+P*at)-pt(mt))/I}function ta(at){return 1-Math.pow(1-at,1.5)}var ea=Date.now(),tn=(R(1)-mt)/P,ia=i.duration?1e3*i.duration:1e3*tn*.8;function en(){var at=(Date.now()-ea)/ia,Xe=ta(at)*tn;at<=1?(this._flyToFrame=lt(en,this),this._move(this.unproject(n.add(a.subtract(n).multiplyBy(Qr(Xe)/b)),d),this.getScaleZoom(m/ue(Xe),d),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),en.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=F(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,F(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){e=e||{};var i=C(e.paddingTopLeft||e.padding||[0,0]),n=C(e.paddingBottomRight||e.padding||[0,0]),a=this.project(this.getCenter()),l=this.project(t),d=this.getPixelBounds(),m=nt([d.min.add(i),d.max.subtract(n)]),f=m.getSize();if(!m.contains(l)){this._enforcingBounds=!0;var b=l.subtract(m.getCenter()),P=m.extend(l).getSize().subtract(f);a.x+=b.x<0?-P.x:P.x,a.y+=b.y<0?-P.y:P.y,this.panTo(this.unproject(a),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=c({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),a=i.divideBy(2).round(),l=n.subtract(a);return!l.x&&!l.y?this:(t.animate&&t.pan?this.panBy(l):(t.pan&&this._rawPanBy(l),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(u(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=c({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=u(this._handleGeolocationResponse,this),i=u(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,i=t.message||(e===1?"permission denied":e===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=t.coords.latitude,i=t.coords.longitude,n=new N(e,i),a=n.toBounds(t.coords.accuracy*2),l=this._locateOptions;if(l.setView){var d=this.getBoundsZoom(a);this.setView(n,l.maxZoom?Math.min(d,l.maxZoom):d)}var m={latlng:n,bounds:a,timestamp:t.timestamp};for(var f in t.coords)typeof t.coords[f]=="number"&&(m[f]=t.coords[f]);this.fire("locationfound",m)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Q(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(E(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)Q(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),n=U("div",i,e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new W(e,i)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=F(t),i=C(i||[0,0]);var n=this.getZoom()||0,a=this.getMinZoom(),l=this.getMaxZoom(),d=t.getNorthWest(),m=t.getSouthEast(),f=this.getSize().subtract(i),b=nt(this.project(m,n),this.project(d,n)).getSize(),P=T.any3d?this.options.zoomSnap:1,I=f.x/b.x,R=f.y/b.y,pt=e?Math.max(I,R):Math.min(I,R);return n=this.getScaleZoom(pt,n),P&&(n=Math.round(n/(P/100))*(P/100),n=e?Math.ceil(n/P)*P:Math.floor(n/P)*P),Math.max(a,Math.min(l,n))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new Z(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 G(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===void 0?this.getZoom():t)},getPane:function(t){return typeof t=="string"?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=e===void 0?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=e===void 0?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.latLngToPoint(B(t),e)},unproject:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.pointToLatLng(C(t),e)},layerPointToLatLng:function(t){var e=C(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(B(t))._round();return e._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(B(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(F(t))},distance:function(t,e){return this.options.crs.distance(B(t),B(e))},containerPointToLayerPoint:function(t){return C(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return C(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(C(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(B(t)))},mouseEventToContainerPoint:function(t){return bo(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=go(t);if(e){if(e._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");A(e,"scroll",this._onScroll,this),this._containerId=v(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&T.any3d,O(t,"leaflet-container"+(T.touch?" leaflet-touch":"")+(T.retina?" leaflet-retina":"")+(T.ielt9?" leaflet-oldie":"")+(T.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=ye(t,"position");e!=="absolute"&&e!=="relative"&&e!=="fixed"&&e!=="sticky"&&(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),rt(this._mapPane,new Z(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(O(t.markerPane,"leaflet-zoom-hide"),O(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){rt(this._mapPane,new Z(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var a=this._zoom!==e;this._moveStart(a,i)._move(t,e)._moveEnd(a),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){e===void 0&&(e=this._zoom);var a=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((a||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return E(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){rt(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[v(this._container)]=this;var e=t?$:A;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.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){E(this._resizeRequest),this._resizeRequest=lt(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i=[],n,a=e==="mouseout"||e==="mouseover",l=t.target||t.srcElement,d=!1;l;){if(n=this._targets[v(l)],n&&(e==="click"||e==="preclick")&&this._draggableMoved(n)){d=!0;break}if(n&&n.listens(e,!0)&&(a&&!bi(l,t)||(i.push(n),a))||l===this._container)break;l=l.parentNode}return!i.length&&!d&&!a&&this.listens(e,!0)&&(i=[this]),i},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(e))){var i=t.type;i==="mousedown"&&mi(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if(t.type==="click"){var n=c({},t);n.type="preclick",this._fireDOMEvent(n,n.type,i)}var a=this._findEventTargets(t,e);if(i){for(var l=[],d=0;d<i.length;d++)i[d].listens(e,!0)&&l.push(i[d]);a=l.concat(a)}if(a.length){e==="contextmenu"&&dt(t);var m=a[0],f={originalEvent:t};if(t.type!=="keypress"&&t.type!=="keydown"&&t.type!=="keyup"){var b=m.getLatLng&&(!m._radius||m._radius<=10);f.containerPoint=b?this.latLngToContainerPoint(m.getLatLng()):this.mouseEventToContainerPoint(t),f.layerPoint=this.containerPointToLayerPoint(f.containerPoint),f.latlng=b?m.getLatLng():this.layerPointToLatLng(f.layerPoint)}for(d=0;d<a.length;d++)if(a[d].fire(e,f,!0),f.originalEvent._stopped||a[d].options.bubblingMouseEvents===!1&&q(this._mouseEvents,e)!==-1)return}},_draggableMoved:function(t){return t=t.dragging&&t.dragging.enabled()?t:this,t.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 $t(this._mapPane)||new Z(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){var i=t&&e!==void 0?this._getNewPixelOrigin(t,e):this.getPixelOrigin();return i.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return nt([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),a=this.getSize().divideBy(2),l=new G(n.subtract(a),n.add(a)),d=this._getBoundsOffset(l,i,e);return Math.abs(d.x)<=1&&Math.abs(d.y)<=1?t:this.unproject(n.add(d),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new G(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=nt(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),a=n.min.subtract(t.min),l=n.max.subtract(t.max),d=this._rebound(a.x,-l.x),m=this._rebound(a.y,-l.y);return new Z(d,m)},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=T.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){it(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return(e&&e.animate)!==!0&&!this.getSize().contains(i)?!1:(this.panBy(i,e),!0)},_createAnimProxy:function(){var t=this._proxy=U("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(e){var i=si,n=this._proxy.style[i];Yt(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Q(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Yt(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||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),a=this._getCenterOffset(t)._divideBy(1-1/n);return i.animate!==!0&&!this.getSize().contains(a)?!1:(lt(function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)},this),!0)},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,O(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(u(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&it(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function gr(t,e){return new j(t,e)}var Pt=H.extend({options:{position:"topright"},initialize:function(t){M(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return O(e,"leaflet-control"),i.indexOf("bottom")!==-1?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Q(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()}}),Me=function(t){return new Pt(t)};j.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=U("div",e+"control-container",this._container);function n(a,l){var d=e+a+" "+e+l;t[a+l]=U("div",d,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)Q(this._controlCorners[t]);Q(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ko=Pt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){M(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var n in t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return Pt.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(v(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){O(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?(O(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):it(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return it(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=U("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),ke(e),yi(e);var n=this._section=U("section",t+"-list");i&&(this._map.on("click",this.collapse,this),A(e,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var a=this._layersLink=U("a",t+"-toggle",e);a.href="#",a.title="Layers",a.setAttribute("role","button"),A(a,{keydown:function(l){l.keyCode===13&&this._expandSafely()},click:function(l){dt(l),this._expandSafely()}},this),i||this.expand(),this._baseLayersList=U("div",t+"-base",n),this._separator=U("div",t+"-separator",n),this._overlaysList=U("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&v(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(u(function(n,a){return this.options.sortFunction(n.layer,a.layer,n.name,a.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Oe(this._baseLayersList),Oe(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,a=0;for(i=0;i<this._layers.length;i++)n=this._layers[i],this._addItem(n),e=e||n.overlay,t=t||!n.overlay,a+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&a>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(v(t.target)),i=e.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e=document.createElement("label"),i=this._map.hasLayer(t.layer),n;t.overlay?(n=document.createElement("input"),n.type="checkbox",n.className="leaflet-control-layers-selector",n.defaultChecked=i):n=this._createRadioElement("leaflet-base-layers_"+v(this),i),this._layerControlInputs.push(n),n.layerId=v(t.layer),A(n,"click",this._onInputClick,this);var a=document.createElement("span");a.innerHTML=" "+t.name;var l=document.createElement("span");e.appendChild(l),l.appendChild(n),l.appendChild(a);var d=t.overlay?this._overlaysList:this._baseLayersList;return d.appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){if(!this._preventClick){var t=this._layerControlInputs,e,i,n=[],a=[];this._handlingClick=!0;for(var l=t.length-1;l>=0;l--)e=t[l],i=this._getLayer(e.layerId).layer,e.checked?n.push(i):e.checked||a.push(i);for(l=0;l<a.length;l++)this._map.hasLayer(a[l])&&this._map.removeLayer(a[l]);for(l=0;l<n.length;l++)this._map.hasLayer(n[l])||this._map.addLayer(n[l]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t=this._layerControlInputs,e,i,n=this._map.getZoom(),a=t.length-1;a>=0;a--)e=t[a],i=this._getLayer(e.layerId).layer,e.disabled=i.options.minZoom!==void 0&&n<i.options.minZoom||i.options.maxZoom!==void 0&&n>i.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,A(t,"click",dt),this.expand();var e=this;setTimeout(function(){$(t,"click",dt),e._preventClick=!1})}}),_r=function(t,e,i){return new ko(t,e,i)},xi=Pt.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=U("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,a){var l=U("a",i,n);return l.innerHTML=t,l.href="#",l.title=e,l.setAttribute("role","button"),l.setAttribute("aria-label",e),ke(l),A(l,"click",Jt),A(l,"click",a,this),A(l,"click",this._refocusOnMap,this),l},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";it(this._zoomInButton,e),it(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(O(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(O(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});j.mergeOptions({zoomControl:!0}),j.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new xi,this.addControl(this.zoomControl))});var vr=function(t){return new xi(t)},Mo=Pt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=U("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=U("div",e,i)),t.imperial&&(this._iScale=U("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e=t*3.2808399,i,n,a;e>5280?(i=e/5280,n=this._getRoundNum(i),this._updateScale(this._iScale,n+" mi",n/i)):(a=this._getRoundNum(e),this._updateScale(this._iScale,a+" ft",a/e))},_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 i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),yr=function(t){return new Mo(t)},br='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',wi=Pt.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(T.inlineSvg?br+" ":"")+"Leaflet</a>"},initialize:function(t){M(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=U("div","leaflet-control-attribution"),ke(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' <span aria-hidden="true">|</span> ')}}});j.mergeOptions({attributionControl:!0}),j.addInitHook(function(){this.options.attributionControl&&new wi().addTo(this)});var xr=function(t){return new wi(t)};Pt.Layers=ko,Pt.Zoom=xi,Pt.Scale=Mo,Pt.Attribution=wi,Me.layers=_r,Me.zoom=vr,Me.scale=yr,Me.attribution=xr;var At=H.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});At.addTo=function(t,e){return t.addHandler(e,this),this};var wr={Events:Y},Lo=T.touch?"touchstart mousedown":"mousedown",Vt=X.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){M(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(A(this._dragStartTarget,Lo,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Vt._dragging===this&&this.finishDrag(!0),$(this._dragStartTarget,Lo,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!li(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){Vt._dragging===this&&this.finishDrag();return}if(!(Vt._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(Vt._dragging=this,this._preventOutline&&mi(this._element),di(),be(),!this._moving)){this.fire("down");var e=t.touches?t.touches[0]:t,i=_o(this._element);this._startPoint=new Z(e.clientX,e.clientY),this._startPos=$t(this._element),this._parentScale=fi(i);var n=t.type==="mousedown";A(document,n?"mousemove":"touchmove",this._onMove,this),A(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var e=t.touches&&t.touches.length===1?t.touches[0]:t,i=new Z(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,dt(t),this._moved||(this.fire("dragstart"),this._moved=!0,O(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),O(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,this._lastEvent=t,this._updatePosition())}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),rt(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){it(document.body,"leaflet-dragging"),this._lastTarget&&(it(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),$(document,"mousemove touchmove",this._onMove,this),$(document,"mouseup touchend touchcancel",this._onUp,this),ui(),xe();var e=this._moved&&this._moving;this._moving=!1,Vt._dragging=!1,e&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function Po(t,e,i){var n,a=[1,4,2,8],l,d,m,f,b,P,I,R;for(l=0,P=t.length;l<P;l++)t[l]._code=Qt(t[l],e);for(m=0;m<4;m++){for(I=a[m],n=[],l=0,P=t.length,d=P-1;l<P;d=l++)f=t[l],b=t[d],f._code&I?b._code&I||(R=je(b,f,I,e,i),R._code=Qt(R,e),n.push(R)):(b._code&I&&(R=je(b,f,I,e,i),R._code=Qt(R,e),n.push(R)),n.push(f));t=n}return t}function To(t,e){var i,n,a,l,d,m,f,b,P;if(!t||t.length===0)throw new Error("latlngs not passed");wt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var I=B([0,0]),R=F(t),pt=R.getNorthWest().distanceTo(R.getSouthWest())*R.getNorthEast().distanceTo(R.getNorthWest());pt<1700&&(I=ki(t));var ht=t.length,kt=[];for(i=0;i<ht;i++){var mt=B(t[i]);kt.push(e.project(B([mt.lat-I.lat,mt.lng-I.lng])))}for(m=f=b=0,i=0,n=ht-1;i<ht;n=i++)a=kt[i],l=kt[n],d=a.y*l.x-l.y*a.x,f+=(a.x+l.x)*d,b+=(a.y+l.y)*d,m+=d*3;m===0?P=kt[0]:P=[f/m,b/m];var ue=e.unproject(C(P));return B([ue.lat+I.lat,ue.lng+I.lng])}function ki(t){for(var e=0,i=0,n=0,a=0;a<t.length;a++){var l=B(t[a]);e+=l.lat,i+=l.lng,n++}return B([e/n,i/n])}var kr={__proto__:null,clipPolygon:Po,polygonCenter:To,centroid:ki};function zo(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Pr(t,i),t=Lr(t,i),t}function Co(t,e,i){return Math.sqrt(Le(t,e,i,!0))}function Mr(t,e,i){return Le(t,e,i)}function Lr(t,e){var i=t.length,n=typeof Uint8Array<"u"?Uint8Array:Array,a=new n(i);a[0]=a[i-1]=1,Mi(t,a,e,0,i-1);var l,d=[];for(l=0;l<i;l++)a[l]&&d.push(t[l]);return d}function Mi(t,e,i,n,a){var l=0,d,m,f;for(m=n+1;m<=a-1;m++)f=Le(t[m],t[n],t[a],!0),f>l&&(d=m,l=f);l>i&&(e[d]=1,Mi(t,e,i,n,d),Mi(t,e,i,d,a))}function Pr(t,e){for(var i=[t[0]],n=1,a=0,l=t.length;n<l;n++)Tr(t[n],t[a])>e&&(i.push(t[n]),a=n);return a<l-1&&i.push(t[l-1]),i}var Eo;function Zo(t,e,i,n,a){var l=n?Eo:Qt(t,i),d=Qt(e,i),m,f,b;for(Eo=d;;){if(!(l|d))return[t,e];if(l&d)return!1;m=l||d,f=je(t,e,m,i,a),b=Qt(f,i),m===l?(t=f,l=b):(e=f,d=b)}}function je(t,e,i,n,a){var l=e.x-t.x,d=e.y-t.y,m=n.min,f=n.max,b,P;return i&8?(b=t.x+l*(f.y-t.y)/d,P=f.y):i&4?(b=t.x+l*(m.y-t.y)/d,P=m.y):i&2?(b=f.x,P=t.y+d*(f.x-t.x)/l):i&1&&(b=m.x,P=t.y+d*(m.x-t.x)/l),new Z(b,P,a)}function Qt(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 Tr(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Le(t,e,i,n){var a=e.x,l=e.y,d=i.x-a,m=i.y-l,f=d*d+m*m,b;return f>0&&(b=((t.x-a)*d+(t.y-l)*m)/f,b>1?(a=i.x,l=i.y):b>0&&(a+=d*b,l+=m*b)),d=t.x-a,m=t.y-l,n?d*d+m*m:new Z(a,l)}function wt(t){return!tt(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function Io(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),wt(t)}function So(t,e){var i,n,a,l,d,m,f,b;if(!t||t.length===0)throw new Error("latlngs not passed");wt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var P=B([0,0]),I=F(t),R=I.getNorthWest().distanceTo(I.getSouthWest())*I.getNorthEast().distanceTo(I.getNorthWest());R<1700&&(P=ki(t));var pt=t.length,ht=[];for(i=0;i<pt;i++){var kt=B(t[i]);ht.push(e.project(B([kt.lat-P.lat,kt.lng-P.lng])))}for(i=0,n=0;i<pt-1;i++)n+=ht[i].distanceTo(ht[i+1])/2;if(n===0)b=ht[0];else for(i=0,l=0;i<pt-1;i++)if(d=ht[i],m=ht[i+1],a=d.distanceTo(m),l+=a,l>n){f=(l-n)/a,b=[m.x-f*(m.x-d.x),m.y-f*(m.y-d.y)];break}var mt=e.unproject(C(b));return B([mt.lat+P.lat,mt.lng+P.lng])}var zr={__proto__:null,simplify:zo,pointToSegmentDistance:Co,closestPointOnSegment:Mr,clipSegment:Zo,_getEdgeIntersection:je,_getBitCode:Qt,_sqClosestPointOnSegment:Le,isFlat:wt,_flat:Io,polylineCenter:So},Li={project:function(t){return new Z(t.lng,t.lat)},unproject:function(t){return new N(t.y,t.x)},bounds:new G([-180,-90],[180,90])},Pi={R:6378137,R_MINOR:6356752314245179e-9,bounds:new G([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,a=this.R_MINOR/i,l=Math.sqrt(1-a*a),d=l*Math.sin(n),m=Math.tan(Math.PI/4-n/2)/Math.pow((1-d)/(1+d),l/2);return n=-i*Math.log(Math.max(m,1e-10)),new Z(t.lng*e*i,n)},unproject:function(t){for(var e=180/Math.PI,i=this.R,n=this.R_MINOR/i,a=Math.sqrt(1-n*n),l=Math.exp(-t.y/i),d=Math.PI/2-2*Math.atan(l),m=0,f=.1,b;m<15&&Math.abs(f)>1e-7;m++)b=a*Math.sin(d),b=Math.pow((1-b)/(1+b),a/2),f=Math.PI/2-2*Math.atan(l*b)-d,d+=f;return new N(d*e,t.x*e/i)}},Cr={__proto__:null,LonLat:Li,Mercator:Pi,SphericalMercator:ge},Er=c({},Lt,{code:"EPSG:3395",projection:Pi,transformation:function(){var t=.5/(Math.PI*Pi.R);return Wt(t,.5,-t,.5)}()}),Ao=c({},Lt,{code:"EPSG:4326",projection:Li,transformation:Wt(1/180,1,-1/180,.5)}),Zr=c({},gt,{projection:Li,transformation:Wt(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});gt.Earth=Lt,gt.EPSG3395=Er,gt.EPSG3857=oe,gt.EPSG900913=Rn,gt.EPSG4326=Ao,gt.Simple=Zr;var Tt=X.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[v(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[v(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",function(){e.off(i,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});j.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=v(t);return this._layers[e]?this:(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var e=v(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return v(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){t=t?tt(t)?t:[t]:[];for(var e=0,i=t.length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){(!isNaN(t.options.maxZoom)||!isNaN(t.options.minZoom))&&(this._zoomBoundLayers[v(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=v(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var n in this._zoomBoundLayers){var a=this._zoomBoundLayers[n].options;t=a.minZoom===void 0?t:Math.min(t,a.minZoom),e=a.maxZoom===void 0?e:Math.max(e,a.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var se=Tt.extend({initialize:function(t,e){M(this,e),this._layers={};var i,n;if(t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){var e=typeof t=="number"?t:this.getLayerId(t);return e in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e=Array.prototype.slice.call(arguments,1),i,n;for(i in this._layers)n=this._layers[i],n[t]&&n[t].apply(n,e);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 v(t)}}),Ir=function(t,e){return new se(t,e)},Bt=se.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),se.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),se.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 W;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Sr=function(t,e){return new Bt(t,e)},le=H.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){M(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(t==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,e&&e.tagName==="IMG"?e:null);return this._setIconStyles(n,t),(this.options.crossOrigin||this.options.crossOrigin==="")&&(n.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),n},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"];typeof n=="number"&&(n=[n,n]);var a=C(n),l=C(e==="shadow"&&i.shadowAnchor||i.iconAnchor||a&&a.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),l&&(t.style.marginLeft=-l.x+"px",t.style.marginTop=-l.y+"px"),a&&(t.style.width=a.x+"px",t.style.height=a.y+"px")},_createImg:function(t,e){return e=e||document.createElement("img"),e.src=t,e},_getIconUrl:function(t){return T.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Ar(t){return new le(t)}var Pe=le.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 typeof Pe.imagePath!="string"&&(Pe.imagePath=this._detectIconPath()),(this.options.imagePath||Pe.imagePath)+le.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){var e=function(i,n,a){var l=n.exec(i);return l&&l[a]};return t=e(t,/^url\((['"])?(.+)\1\)$/,2),t&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=U("div","leaflet-default-icon-path",document.body),e=ye(t,"background-image")||ye(t,"backgroundImage");if(document.body.removeChild(t),e=this._stripUrl(e),e)return e;var i=document.querySelector('link[href$="leaflet.css"]');return i?i.href.substring(0,i.href.length-11-1):""}}),Oo=At.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new Vt(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),O(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&&it(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,a=this._marker.options.autoPanPadding,l=$t(e._icon),d=i.getPixelBounds(),m=i.getPixelOrigin(),f=nt(d.min._subtract(m).add(a),d.max._subtract(m).subtract(a));if(!f.contains(l)){var b=C((Math.max(f.max.x,l.x)-f.max.x)/(d.max.x-f.max.x)-(Math.min(f.min.x,l.x)-f.min.x)/(d.min.x-f.min.x),(Math.max(f.max.y,l.y)-f.max.y)/(d.max.y-f.max.y)-(Math.min(f.min.y,l.y)-f.min.y)/(d.min.y-f.min.y)).multiplyBy(n);i.panBy(b,{animate:!1}),this._draggable._newPos._add(b),this._draggable._startPos._add(b),rt(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=lt(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&&(E(this._panRequest),this._panRequest=lt(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=$t(e._icon),a=e._map.layerPointToLatLng(n);i&&rt(i,n),e._latlng=a,t.latlng=a,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){E(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),He=Tt.extend({options:{icon:new Pe,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){M(this,e),this._latlng=B(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=B(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),i.tagName==="IMG"&&(i.alt=t.alt||"")),O(i,e),t.keyboard&&(i.tabIndex="0",i.setAttribute("role","button")),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&A(i,"focus",this._panOnFocus,this);var a=t.icon.createShadow(this._shadow),l=!1;a!==this._shadow&&(this._removeShadow(),l=!0),a&&(O(a,e),a.alt=""),this._shadow=a,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),a&&l&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&$(this._icon,"focus",this._panOnFocus,this),Q(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Q(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&rt(this._icon,t),this._shadow&&rt(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&&(O(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Oo)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Oo(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&&xt(this._icon,t),this._shadow&&xt(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t=this._map;if(t){var e=this.options.icon.options,i=e.iconSize?C(e.iconSize):C(0,0),n=e.iconAnchor?C(e.iconAnchor):C(0,0);t.panInside(this._latlng,{paddingTopLeft:n,paddingBottomRight:i.subtract(n)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Or(t,e){return new He(t,e)}var Ft=Tt.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 M(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Ue=Ft.extend({options:{fill:!0,radius:10},initialize:function(t,e){M(this,e),this._latlng=B(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=B(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 Ft.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),n=[t+i,e+i];this._pxBounds=new G(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function Br(t,e){return new Ue(t,e)}var Ti=Ue.extend({initialize:function(t,e,i){if(typeof e=="number"&&(e=c({},i,{radius:e})),M(this,e),this._latlng=B(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 W(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:Ft.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===Lt.distance){var a=Math.PI/180,l=this._mRadius/Lt.R/a,d=i.project([e+l,t]),m=i.project([e-l,t]),f=d.add(m).divideBy(2),b=i.unproject(f).lat,P=Math.acos((Math.cos(l*a)-Math.sin(e*a)*Math.sin(b*a))/(Math.cos(e*a)*Math.cos(b*a)))/a;(isNaN(P)||P===0)&&(P=l/Math.cos(Math.PI/180*e)),this._point=f.subtract(i.getPixelOrigin()),this._radius=isNaN(P)?0:f.x-i.project([b,t-P]).x,this._radiusY=f.y-d.y}else{var I=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(I).x}this._updateBounds()}});function Rr(t,e,i){return new Ti(t,e,i)}var Rt=Ft.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){M(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=1/0,i=null,n=Le,a,l,d=0,m=this._parts.length;d<m;d++)for(var f=this._parts[d],b=1,P=f.length;b<P;b++){a=f[b-1],l=f[b];var I=n(t,a,l,!0);I<e&&(e=I,i=n(t,a,l))}return i&&(i.distance=Math.sqrt(e)),i},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return So(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=B(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new W,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return wt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=wt(t),n=0,a=t.length;n<a;n++)i?(e[n]=B(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new G;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 Z(t,t);this._rawPxBounds&&(this._pxBounds=new G([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)]))},_projectLatlngs:function(t,e,i){var n=t[0]instanceof N,a=t.length,l,d;if(n){for(d=[],l=0;l<a;l++)d[l]=this._map.latLngToLayerPoint(t[l]),i.extend(d[l]);e.push(d)}else for(l=0;l<a;l++)this._projectLatlngs(t[l],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;return}var e=this._parts,i,n,a,l,d,m,f;for(i=0,a=0,l=this._rings.length;i<l;i++)for(f=this._rings[i],n=0,d=f.length;n<d-1;n++)m=Zo(f[n],f[n+1],t,n,!0),m&&(e[a]=e[a]||[],e[a].push(m[0]),(m[1]!==f[n+1]||n===d-2)&&(e[a].push(m[1]),a++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=zo(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,a,l,d,m,f=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,l=this._parts.length;i<l;i++)for(m=this._parts[i],n=0,d=m.length,a=d-1;n<d;a=n++)if(!(!e&&n===0)&&Co(t,m[a],m[n])<=f)return!0;return!1}});function Dr(t,e){return new Rt(t,e)}Rt._flat=Io;var he=Rt.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return To(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(t){var e=Rt.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof N&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){Rt.prototype._setLatLngs.call(this,t),wt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return wt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new Z(e,e);if(t=new G(t.min.subtract(i),t.max.add(i)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(var n=0,a=this._rings.length,l;n<a;n++)l=Po(this._rings[n],t,!0),l.length&&this._parts.push(l)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e=!1,i,n,a,l,d,m,f,b;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(l=0,f=this._parts.length;l<f;l++)for(i=this._parts[l],d=0,b=i.length,m=b-1;d<b;m=d++)n=i[d],a=i[m],n.y>t.y!=a.y>t.y&&t.x<(a.x-n.x)*(t.y-n.y)/(a.y-n.y)+n.x&&(e=!e);return e||Rt.prototype._containsPoint.call(this,t,!0)}});function Nr(t,e){return new he(t,e)}var Dt=Bt.extend({initialize:function(t,e){M(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e=tt(t)?t:t.features,i,n,a;if(e){for(i=0,n=e.length;i<n;i++)a=e[i],(a.geometries||a.geometry||a.features||a.coordinates)&&this.addData(a);return this}var l=this.options;if(l.filter&&!l.filter(t))return this;var d=We(t,l);return d?(d.feature=qe(t),d.defaultOptions=d.options,this.resetStyle(d),l.onEachFeature&&l.onEachFeature(t,d),this.addLayer(d)):this},resetStyle:function(t){return t===void 0?this.eachLayer(this.resetStyle,this):(t.options=c({},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&&(typeof e=="function"&&(e=e(t.feature)),t.setStyle(e))}});function We(t,e){var i=t.type==="Feature"?t.geometry:t,n=i?i.coordinates:null,a=[],l=e&&e.pointToLayer,d=e&&e.coordsToLatLng||zi,m,f,b,P;if(!n&&!i)return null;switch(i.type){case"Point":return m=d(n),Bo(l,t,m,e);case"MultiPoint":for(b=0,P=n.length;b<P;b++)m=d(n[b]),a.push(Bo(l,t,m,e));return new Bt(a);case"LineString":case"MultiLineString":return f=Ve(n,i.type==="LineString"?0:1,d),new Rt(f,e);case"Polygon":case"MultiPolygon":return f=Ve(n,i.type==="Polygon"?1:2,d),new he(f,e);case"GeometryCollection":for(b=0,P=i.geometries.length;b<P;b++){var I=We({geometry:i.geometries[b],type:"Feature",properties:t.properties},e);I&&a.push(I)}return new Bt(a);case"FeatureCollection":for(b=0,P=i.features.length;b<P;b++){var R=We(i.features[b],e);R&&a.push(R)}return new Bt(a);default:throw new Error("Invalid GeoJSON object.")}}function Bo(t,e,i,n){return t?t(e,i):new He(i,n&&n.markersInheritOptions&&n)}function zi(t){return new N(t[1],t[0],t[2])}function Ve(t,e,i){for(var n=[],a=0,l=t.length,d;a<l;a++)d=e?Ve(t[a],e-1,i):(i||zi)(t[a]),n.push(d);return n}function Ci(t,e){return t=B(t),t.alt!==void 0?[k(t.lng,e),k(t.lat,e),k(t.alt,e)]:[k(t.lng,e),k(t.lat,e)]}function Fe(t,e,i,n){for(var a=[],l=0,d=t.length;l<d;l++)a.push(e?Fe(t[l],wt(t[l])?0:e-1,i,n):Ci(t[l],n));return!e&&i&&a.length>0&&a.push(a[0].slice()),a}function ce(t,e){return t.feature?c({},t.feature,{geometry:e}):qe(e)}function qe(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var Ei={toGeoJSON:function(t){return ce(this,{type:"Point",coordinates:Ci(this.getLatLng(),t)})}};He.include(Ei),Ti.include(Ei),Ue.include(Ei),Rt.include({toGeoJSON:function(t){var e=!wt(this._latlngs),i=Fe(this._latlngs,e?1:0,!1,t);return ce(this,{type:(e?"Multi":"")+"LineString",coordinates:i})}}),he.include({toGeoJSON:function(t){var e=!wt(this._latlngs),i=e&&!wt(this._latlngs[0]),n=Fe(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),ce(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),se.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(i){e.push(i.toGeoJSON(t).geometry.coordinates)}),ce(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(e==="MultiPoint")return this.toMultiPoint(t);var i=e==="GeometryCollection",n=[];return this.eachLayer(function(a){if(a.toGeoJSON){var l=a.toGeoJSON(t);if(i)n.push(l.geometry);else{var d=qe(l);d.type==="FeatureCollection"?n.push.apply(n,d.features):n.push(d)}}}),i?ce(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});function Ro(t,e){return new Dt(t,e)}var jr=Ro,Ge=Tt.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=F(e),M(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(O(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Q(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&&re(this._image),this},bringToBack:function(){return this._map&&ae(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=F(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=this._url.tagName==="IMG",e=this._image=t?this._url:U("img");if(O(e,"leaflet-image-layer"),this._zoomAnimated&&O(e,"leaflet-zoom-animated"),this.options.className&&O(e,this.options.className),e.onselectstart=g,e.onmousemove=g,e.onload=u(this.fire,this,"load"),e.onerror=u(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(e.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=e.src;return}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;Yt(this._image,i,e)},_reset:function(){var t=this._image,e=new G(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();rt(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){xt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Hr=function(t,e,i){return new Ge(t,e,i)},Do=Ge.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=this._url.tagName==="VIDEO",e=this._image=t?this._url:U("video");if(O(e,"leaflet-image-layer"),this._zoomAnimated&&O(e,"leaflet-zoom-animated"),this.options.className&&O(e,this.options.className),e.onselectstart=g,e.onmousemove=g,e.onloadeddata=u(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],a=0;a<i.length;a++)n.push(i[a].src);this._url=i.length>0?n:[e.src];return}tt(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var l=0;l<this._url.length;l++){var d=U("source");d.src=this._url[l],e.appendChild(d)}}});function Ur(t,e,i){return new Do(t,e,i)}var No=Ge.extend({_initImage:function(){var t=this._image=this._url;O(t,"leaflet-image-layer"),this._zoomAnimated&&O(t,"leaflet-zoom-animated"),this.options.className&&O(t,this.options.className),t.onselectstart=g,t.onmousemove=g}});function Wr(t,e,i){return new No(t,e,i)}var Ot=Tt.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,e){t&&(t instanceof N||tt(t))?(this._latlng=B(t),M(this,e)):(M(this,t),this._source=e),this.options.content&&(this._content=this.options.content)},openOn:function(t){return t=arguments.length?t:this._source._map,t.hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&xt(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&xt(this._container,1),this.bringToFront(),this.options.interactive&&(O(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(xt(this._container,0),this._removeTimeout=setTimeout(u(Q,void 0,this._container),200)):Q(this._container),this.options.interactive&&(it(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=B(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&&re(this._container),this},bringToBack:function(){return this._map&&ae(this._container),this},_prepareOpen:function(t){var e=this._source;if(!e._map)return!1;if(e instanceof Bt){e=null;var i=this._source._layers;for(var n in i)if(i[n]._map){e=i[n];break}if(!e)return!1;this._source=e}if(!t)if(e.getCenter)t=e.getCenter();else if(e.getLatLng)t=e.getLatLng();else if(e.getBounds)t=e.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,e=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof e=="string")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=C(this.options.offset),i=this._getAnchor();this._zoomAnimated?rt(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,a=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=a+"px"}},_getAnchor:function(){return[0,0]}});j.include({_initOverlay:function(t,e,i,n){var a=e;return a instanceof t||(a=new t(n).setContent(e)),i&&a.setLatLng(i),a}}),Tt.include({_initOverlay:function(t,e,i,n){var a=i;return a instanceof t?(M(a,n),a._source=this):(a=e&&!n?e:new t(n,this),a.setContent(i)),a}});var Ke=Ot.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t=arguments.length?t:this._source._map,!t.hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,Ot.prototype.openOn.call(this,t)},onAdd:function(t){Ot.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Ft||this._source.on("preclick",Xt))},onRemove:function(t){Ot.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Ft||this._source.off("preclick",Xt))},getEvents:function(){var t=Ot.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",e=this._container=U("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=U("div",t+"-content-wrapper",e);if(this._contentNode=U("div",t+"-content",i),ke(e),yi(this._contentNode),A(e,"contextmenu",Xt),this._tipContainer=U("div",t+"-tip-container",e),this._tip=U("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=U("a",t+"-close-button",e);n.setAttribute("role","button"),n.setAttribute("aria-label","Close popup"),n.href="#close",n.innerHTML='<span aria-hidden="true">×</span>',A(n,"click",function(a){dt(a),this.close()},this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,a=this.options.maxHeight,l="leaflet-popup-scrolled";a&&n>a?(e.height=a+"px",O(t,l)):it(t,l),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();rt(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,e=parseInt(ye(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,a=new Z(this._containerLeft,-i-this._containerBottom);a._add($t(this._container));var l=t.layerPointToContainerPoint(a),d=C(this.options.autoPanPadding),m=C(this.options.autoPanPaddingTopLeft||d),f=C(this.options.autoPanPaddingBottomRight||d),b=t.getSize(),P=0,I=0;l.x+n+f.x>b.x&&(P=l.x+n-b.x+f.x),l.x-P-m.x<0&&(P=l.x-m.x),l.y+i+f.y>b.y&&(I=l.y+i-b.y+f.y),l.y-I-m.y<0&&(I=l.y-m.y),(P||I)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([P,I]))}},_getAnchor:function(){return C(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Vr=function(t,e){return new Ke(t,e)};j.mergeOptions({closePopupOnClick:!0}),j.include({openPopup:function(t,e,i){return this._initOverlay(Ke,t,e,i).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),Tt.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Ke,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Bt||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(!(!this._popup||!this._map)){Jt(t);var e=t.layer||t.target;if(this._popup._source===e&&!(e instanceof Ft)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=e,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){t.originalEvent.keyCode===13&&this._openPopup(t)}});var Ye=Ot.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Ot.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Ot.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Ot.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",e=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=U("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+v(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,a=this._container,l=n.latLngToContainerPoint(n.getCenter()),d=n.layerPointToContainerPoint(t),m=this.options.direction,f=a.offsetWidth,b=a.offsetHeight,P=C(this.options.offset),I=this._getAnchor();m==="top"?(e=f/2,i=b):m==="bottom"?(e=f/2,i=0):m==="center"?(e=f/2,i=b/2):m==="right"?(e=0,i=b/2):m==="left"?(e=f,i=b/2):d.x<l.x?(m="right",e=0,i=b/2):(m="left",e=f+(P.x+I.x)*2,i=b/2),t=t.subtract(C(e,i,!0)).add(P).add(I),it(a,"leaflet-tooltip-right"),it(a,"leaflet-tooltip-left"),it(a,"leaflet-tooltip-top"),it(a,"leaflet-tooltip-bottom"),O(a,"leaflet-tooltip-"+m),rt(a,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&xt(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return C(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Fr=function(t,e){return new Ye(t,e)};j.include({openTooltip:function(t,e,i){return this._initOverlay(Ye,t,e,i).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),Tt.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ye,this._tooltip,t,e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(!(!t&&this._tooltipHandlersAdded)){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,i.click=this._openTooltip,this._map?this._addFocusListeners():i.add=this._addFocusListeners),this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t){return this._tooltip&&(this instanceof Bt||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var e=typeof t.getElement=="function"&&t.getElement();e&&(A(e,"focus",function(){this._tooltip._source=t,this.openTooltip()},this),A(e,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){var e=typeof t.getElement=="function"&&t.getElement();e&&e.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var e=this;this._map.once("moveend",function(){e._openOnceFlag=!1,e._openTooltip(t)});return}this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)}},_moveTooltip:function(t){var e=t.latlng,i,n;this._tooltip.options.sticky&&t.originalEvent&&(i=this._map.mouseEventToContainerPoint(t.originalEvent),n=this._map.containerPointToLayerPoint(i),e=this._map.layerPointToLatLng(n)),this._tooltip.setLatLng(e)}});var jo=le.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&t.tagName==="DIV"?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(Oe(e),e.appendChild(i.html)):e.innerHTML=i.html!==!1?i.html:"",i.bgPos){var n=C(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function qr(t){return new jo(t)}le.Default=Pe;var Te=Tt.extend({options:{tileSize:256,opacity:1,updateWhenIdle:T.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){M(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),Q(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(re(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(ae(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var t=this._clampZoom(this._map.getZoom());t!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()}return this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=x(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 Z?t:new Z(t,t)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e=this.getPane().children,i=-t(-1/0,1/0),n=0,a=e.length,l;n<a;n++)l=e[n].style.zIndex,e[n]!==this._container&&l&&(i=t(i,+l));isFinite(i)&&(this.options.zIndex=i+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!T.ielt9){xt(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var a=this._tiles[n];if(!(!a.current||!a.loaded)){var l=Math.min(1,(t-a.loaded)/200);xt(a.el,l),l<1?e=!0:(a.active?i=!0:this._onOpaqueTile(a),a.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(E(this._fadeFrame),this._fadeFrame=lt(this._updateOpacity,this))}},_onOpaqueTile:g,_initContainer:function(){this._container||(this._container=U("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(t!==void 0){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)):(Q(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],a=this._map;return n||(n=this._levels[t]={},n.el=U("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=a.project(a.unproject(a.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,a.getCenter(),a.getZoom()),g(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:g,_onRemoveLevel:g,_onCreateLevel:g,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom){this._removeAllTiles();return}for(t in this._tiles)e=this._tiles[t],e.retain=e.current;for(t in this._tiles)if(e=this._tiles[t],e.current&&!e.active){var n=e.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)Q(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var a=Math.floor(t/2),l=Math.floor(e/2),d=i-1,m=new Z(+a,+l);m.z=+d;var f=this._tileCoordsToKey(m),b=this._tiles[f];return b&&b.active?(b.retain=!0,!0):(b&&b.loaded&&(b.retain=!0),d>n?this._retainParent(a,l,d,n):!1)},_retainChildren:function(t,e,i,n){for(var a=2*t;a<2*t+2;a++)for(var l=2*e;l<2*e+2;l++){var d=new Z(a,l);d.z=i+1;var m=this._tileCoordsToKey(d),f=this._tiles[m];if(f&&f.active){f.retain=!0;continue}else f&&f.loaded&&(f.retain=!0);i+1<n&&this._retainChildren(a,l,i+1,n)}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return e.minNativeZoom!==void 0&&t<e.minNativeZoom?e.minNativeZoom:e.maxNativeZoom!==void 0&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var a=Math.round(e);this.options.maxZoom!==void 0&&a>this.options.maxZoom||this.options.minZoom!==void 0&&a<this.options.minZoom?a=void 0:a=this._clampZoom(a);var l=this.options.updateWhenZooming&&a!==this._tileZoom;(!n||l)&&(this._tileZoom=a,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),a!==void 0&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),a=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();T.any3d?Yt(t.el,a,n):rt(t.el,a)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,a=this._map.getPixelWorldBounds(this._tileZoom);a&&(this._globalTileRange=this._pxBoundsToTileRange(a)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),n=e.getZoomScale(i,this._tileZoom),a=e.project(t,this._tileZoom).floor(),l=e.getSize().divideBy(n*2);return new G(a.subtract(l),a.add(l))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(t===void 0&&(t=e.getCenter()),this._tileZoom!==void 0){var n=this._getTiledPixelBounds(t),a=this._pxBoundsToTileRange(n),l=a.getCenter(),d=[],m=this.options.keepBuffer,f=new G(a.getBottomLeft().subtract([m,-m]),a.getTopRight().add([m,-m]));if(!(isFinite(a.min.x)&&isFinite(a.min.y)&&isFinite(a.max.x)&&isFinite(a.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var b in this._tiles){var P=this._tiles[b].coords;(P.z!==this._tileZoom||!f.contains(new Z(P.x,P.y)))&&(this._tiles[b].current=!1)}if(Math.abs(i-this._tileZoom)>1){this._setView(t,i);return}for(var I=a.min.y;I<=a.max.y;I++)for(var R=a.min.x;R<=a.max.x;R++){var pt=new Z(R,I);if(pt.z=this._tileZoom,!!this._isValidTile(pt)){var ht=this._tiles[this._tileCoordsToKey(pt)];ht?ht.current=!0:d.push(pt)}}if(d.sort(function(mt,ue){return mt.distanceTo(l)-ue.distanceTo(l)}),d.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var kt=document.createDocumentFragment();for(R=0;R<d.length;R++)this._addTile(d[R],kt);this._level.el.appendChild(kt)}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return F(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),a=n.add(i),l=e.unproject(n,t.z),d=e.unproject(a,t.z);return[l,d]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new W(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 Z(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(Q(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){O(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=g,t.onmousemove=g,T.ielt9&&this.options.opacity<1&&xt(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),a=this.createTile(this._wrapCoords(t),u(this._tileReady,this,t));this._initTile(a),this.createTile.length<2&<(u(this._tileReady,this,t,null,a)),rt(a,i),this._tiles[n]={el:a,coords:t,current:!0},e.appendChild(a),this.fire("tileloadstart",{tile:a,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);i=this._tiles[n],i&&(i.loaded=+new Date,this._map._fadeAnimated?(xt(i.el,0),E(this._fadeFrame),this._fadeFrame=lt(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(O(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),T.ielt9||!this._map._fadeAnimated?lt(this._pruneTiles,this):setTimeout(u(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new Z(this._wrapX?y(t.x,this._wrapX):t.x,this._wrapY?y(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new G(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 Gr(t){return new Te(t)}var de=Te.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,e=M(this,e),e.detectRetina&&T.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),typeof e.subdomains=="string"&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&e===void 0&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return A(i,"load",u(this._tileOnLoad,this,e,i)),A(i,"error",u(this._tileOnError,this,e,i)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(i.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:T.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return J(this._url,c(e,this.options))},_tileOnLoad:function(t,e){T.ielt9?setTimeout(u(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom,i=this.options.zoomReverse,n=this.options.zoomOffset;return i&&(t=e-t),t+n},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(e=this._tiles[t].el,e.onload=g,e.onerror=g,!e.complete)){e.src=ut;var i=this._tiles[t].coords;Q(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",ut),Te.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(!(!this._map||i&&i.getAttribute("src")===ut))return Te.prototype._tileReady.call(this,t,e,i)}});function Ho(t,e){return new de(t,e)}var Uo=de.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 i=c({},this.defaultWmsParams);for(var n in e)n in this.options||(i[n]=e[n]);e=M(this,e);var a=e.detectRetina&&T.retina?2:1,l=this.getTileSize();i.width=l.x*a,i.height=l.y*a,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,de.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=nt(i.project(e[0]),i.project(e[1])),a=n.min,l=n.max,d=(this._wmsVersion>=1.3&&this._crs===Ao?[a.y,a.x,l.y,l.x]:[a.x,a.y,l.x,l.y]).join(","),m=de.prototype.getTileUrl.call(this,t);return m+z(this.wmsParams,m,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+d},setParams:function(t,e){return c(this.wmsParams,t),e||this.redraw(),this}});function Kr(t,e){return new Uo(t,e)}de.WMS=Uo,Ho.wms=Kr;var Nt=Tt.extend({options:{padding:.1},initialize:function(t){M(this,t),v(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),O(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),a=this._map.project(this._center,e),l=n.multiplyBy(-i).add(a).subtract(this._map._getNewPixelOrigin(t,e));T.any3d?Yt(this._container,l,i):rt(this._container,l)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in 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 G(i,i.add(e.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Wo=Nt.extend({options:{tolerance:0},getEvents:function(){var t=Nt.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Nt.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");A(t,"mousemove",this._onMouseMove,this),A(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),A(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){E(this._redrawRequest),delete this._ctx,Q(this._container),$(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var e in this._layers)t=this._layers[e],t._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Nt.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=T.retina?2:1;rt(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",T.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Nt.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[v(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[v(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(typeof t.options.dashArray=="string"){var e=t.options.dashArray.split(/[, ]+/),i=[],n,a;for(a=0;a<e.length;a++){if(n=Number(e[a]),isNaN(n))return;i.push(n)}t.options._dashArray=i}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||lt(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new G,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,a,l,d=t._parts,m=d.length,f=this._ctx;if(m){for(f.beginPath(),i=0;i<m;i++){for(n=0,a=d[i].length;n<a;n++)l=d[i][n],f[n?"lineTo":"moveTo"](l.x,l.y);e&&f.closePath()}this._fillStroke(f,t)}}},_updateCircle:function(t){if(!(!this._drawing||t._empty())){var e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),a=(Math.max(Math.round(t._radiusY),1)||n)/n;a!==1&&(i.save(),i.scale(1,a)),i.beginPath(),i.arc(e.x,e.y/a,n,0,Math.PI*2,!1),a!==1&&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&&i.weight!==0&&(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=this._map.mouseEventToLayerPoint(t),i,n,a=this._drawFirst;a;a=a.next)i=a.layer,i.options.interactive&&i._containsPoint(e)&&(!(t.type==="click"||t.type==="preclick")||!this._map._draggableMoved(i))&&(n=i);this._fireEvent(n?[n]:!1,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&&(it(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,n,a=this._drawFirst;a;a=a.next)i=a.layer,i.options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(O(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,t),this._mouseHoverThrottled=!0,setTimeout(u(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;if(i)i.prev=n;else return;n?n.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t)}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;if(n)n.next=i;else return;i?i.prev=n:n&&(this._drawLast=n),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t)}}});function Vo(t){return T.canvas?new Wo(t):null}var ze=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Yr={_initContainer:function(){this._container=U("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Nt.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=ze("shape");O(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=ze("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[v(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;Q(e),t.removeInteractiveTarget(e),delete this._layers[v(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,a=t._container;a.stroked=!!n.stroke,a.filled=!!n.fill,n.stroke?(e||(e=t._stroke=ze("stroke")),a.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=tt(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(a.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=ze("fill")),a.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(a.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,"+65535*360)},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){re(t._container)},_bringToBack:function(t){ae(t._container)}},$e=T.vml?ze:Gi,Ce=Nt.extend({_initContainer:function(){this._container=$e("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=$e("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Q(this._container),$(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Nt.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)),rt(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=$e("path");t.options.className&&O(e,t.options.className),t.options.interactive&&O(e,"leaflet-interactive"),this._updateStyle(t),this._layers[v(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){Q(t._path),t.removeInteractiveTarget(t._path),delete this._layers[v(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,Ki(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n=Math.max(Math.round(t._radiusY),1)||i,a="a"+i+","+n+" 0 1,0 ",l=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+a+i*2+",0 "+a+-i*2+",0 ";this._setPath(t,l)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){re(t._path)},_bringToBack:function(t){ae(t._path)}});T.vml&&Ce.include(Yr);function Fo(t){return T.svg||T.vml?new Ce(t):null}j.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(t==="overlayPane"||t===void 0)return!1;var e=this._paneRenderers[t];return e===void 0&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Vo(t)||Fo(t)}});var qo=he.extend({initialize:function(t,e){he.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=F(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function $r(t,e){return new qo(t,e)}Ce.create=$e,Ce.pointsToPath=Ki,Dt.geometryToLayer=We,Dt.coordsToLatLng=zi,Dt.coordsToLatLngs=Ve,Dt.latLngToCoords=Ci,Dt.latLngsToCoords=Fe,Dt.getFeature=ce,Dt.asFeature=qe,j.mergeOptions({boxZoom:!0});var Go=At.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(){A(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){$(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Q(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||t.which!==1&&t.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),be(),di(),this._startPoint=this._map.mouseEventToContainerPoint(t),A(document,{contextmenu:Jt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=U("div","leaflet-zoom-box",this._container),O(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new G(this._point,this._startPoint),i=e.getSize();rt(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(Q(this._box),it(this._container,"leaflet-crosshair")),xe(),ui(),$(document,{contextmenu:Jt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if(!(t.which!==1&&t.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(u(this._resetState,this),0);var e=new W(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){t.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});j.addInitHook("addHandler","boxZoom",Go),j.mergeOptions({doubleClickZoom:!0});var Ko=At.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,a=t.originalEvent.shiftKey?i-n:i+n;e.options.doubleClickZoom==="center"?e.setZoom(a):e.setZoomAround(t.containerPoint,a)}});j.addInitHook("addHandler","doubleClickZoom",Ko),j.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Yo=At.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Vt(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))}O(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){it(this._map._container,"leaflet-grab"),it(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=F(this._map.options.maxBounds);this._offsetLimit=nt(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,a=(n-e+i)%t+e-i,l=(n+e+i)%t-e-i,d=Math.abs(a+i)<Math.abs(l+i)?a:l;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=d},_onDragEnd:function(t){var e=this._map,i=e.options,n=!i.inertia||t.noInertia||this._times.length<2;if(e.fire("dragend",t),n)e.fire("moveend");else{this._prunePositions(+new Date);var a=this._lastPos.subtract(this._positions[0]),l=(this._lastTime-this._times[0])/1e3,d=i.easeLinearity,m=a.multiplyBy(d/l),f=m.distanceTo([0,0]),b=Math.min(i.inertiaMaxSpeed,f),P=m.multiplyBy(b/f),I=b/(i.inertiaDeceleration*d),R=P.multiplyBy(-I/2).round();!R.x&&!R.y?e.fire("moveend"):(R=e._limitOffset(R,e.options.maxBounds),lt(function(){e.panBy(R,{duration:I,easeLinearity:d,noMoveStart:!0,animate:!0})}))}}});j.addInitHook("addHandler","dragging",Yo),j.mergeOptions({keyboard:!0,keyboardPanDelta:80});var $o=At.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"),A(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(),$(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,n=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(n,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e=this._panKeys={},i=this.keyCodes,n,a;for(n=0,a=i.left.length;n<a;n++)e[i.left[n]]=[-1*t,0];for(n=0,a=i.right.length;n<a;n++)e[i.right[n]]=[t,0];for(n=0,a=i.down.length;n<a;n++)e[i.down[n]]=[0,t];for(n=0,a=i.up.length;n<a;n++)e[i.up[n]]=[0,-1*t]},_setZoomDelta:function(t){var e=this._zoomKeys={},i=this.keyCodes,n,a;for(n=0,a=i.zoomIn.length;n<a;n++)e[i.zoomIn[n]]=t;for(n=0,a=i.zoomOut.length;n<a;n++)e[i.zoomOut[n]]=-t},_addHooks:function(){A(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){$(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=t.keyCode,i=this._map,n;if(e in this._panKeys){if(!i._panAnim||!i._panAnim._inProgress)if(n=this._panKeys[e],t.shiftKey&&(n=C(n).multiplyBy(3)),i.options.maxBounds&&(n=i._limitOffset(C(n),i.options.maxBounds)),i.options.worldCopyJump){var a=i.wrapLatLng(i.unproject(i.project(i.getCenter()).add(n)));i.panTo(a)}else i.panBy(n)}else if(e in this._zoomKeys)i.setZoom(i.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[e]);else if(e===27&&i._popup&&i._popup.options.closeOnEscapeKey)i.closePopup();else return;Jt(t)}}});j.addInitHook("addHandler","keyboard",$o),j.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Xo=At.extend({addHooks:function(){A(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){$(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=xo(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var n=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(u(this._performZoom,this),n),Jt(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var n=this._delta/(this._map.options.wheelPxPerZoomLevel*4),a=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,l=i?Math.ceil(a/i)*i:a,d=t._limitZoom(e+(this._delta>0?l:-l))-e;this._delta=0,this._startTime=null,d&&(t.options.scrollWheelZoom==="center"?t.setZoom(e+d):t.setZoomAround(this._lastMousePos,e+d))}});j.addInitHook("addHandler","scrollWheelZoom",Xo);var Xr=600;j.mergeOptions({tapHold:T.touchNative&&T.safari&&T.mobile,tapTolerance:15});var Jo=At.extend({addHooks:function(){A(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){$(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),t.touches.length===1){var e=t.touches[0];this._startPos=this._newPos=new Z(e.clientX,e.clientY),this._holdTimeout=setTimeout(u(function(){this._cancel(),this._isTapValid()&&(A(document,"touchend",dt),A(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),Xr),A(document,"touchend touchcancel contextmenu",this._cancel,this),A(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){$(document,"touchend",dt),$(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),$(document,"touchend touchcancel contextmenu",this._cancel,this),$(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new Z(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});j.addInitHook("addHandler","tapHold",Jo),j.mergeOptions({touchZoom:T.touch,bounceAtZoomLimits:!0});var Qo=At.extend({addHooks:function(){O(this._map._container,"leaflet-touch-zoom"),A(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){it(this._map._container,"leaflet-touch-zoom"),$(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(!(!t.touches||t.touches.length!==2||e._animatingZoom||this._zooming)){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),e.options.touchZoom!=="center"&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),A(document,"touchmove",this._onTouchMove,this),A(document,"touchend touchcancel",this._onTouchEnd,this),dt(t)}},_onTouchMove:function(t){if(!(!t.touches||t.touches.length!==2||!this._zooming)){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),a=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(a,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&a<1||this._zoom>e.getMaxZoom()&&a>1)&&(this._zoom=e._limitZoom(this._zoom)),e.options.touchZoom==="center"){if(this._center=this._startLatLng,a===1)return}else{var l=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(a===1&&l.x===0&&l.y===0)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(l),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),E(this._animRequest);var d=u(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=lt(d,this,!0),dt(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,E(this._animRequest),$(document,"touchmove",this._onTouchMove,this),$(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});j.addInitHook("addHandler","touchZoom",Qo),j.BoxZoom=Go,j.DoubleClickZoom=Ko,j.Drag=Yo,j.Keyboard=$o,j.ScrollWheelZoom=Xo,j.TapHold=Jo,j.TouchZoom=Qo,s.Bounds=G,s.Browser=T,s.CRS=gt,s.Canvas=Wo,s.Circle=Ti,s.CircleMarker=Ue,s.Class=H,s.Control=Pt,s.DivIcon=jo,s.DivOverlay=Ot,s.DomEvent=fr,s.DomUtil=pr,s.Draggable=Vt,s.Evented=X,s.FeatureGroup=Bt,s.GeoJSON=Dt,s.GridLayer=Te,s.Handler=At,s.Icon=le,s.ImageOverlay=Ge,s.LatLng=N,s.LatLngBounds=W,s.Layer=Tt,s.LayerGroup=se,s.LineUtil=zr,s.Map=j,s.Marker=He,s.Mixin=wr,s.Path=Ft,s.Point=Z,s.PolyUtil=kr,s.Polygon=he,s.Polyline=Rt,s.Popup=Ke,s.PosAnimation=wo,s.Projection=Cr,s.Rectangle=qo,s.Renderer=Nt,s.SVG=Ce,s.SVGOverlay=No,s.TileLayer=de,s.Tooltip=Ye,s.Transformation=ie,s.Util=D,s.VideoOverlay=Do,s.bind=u,s.bounds=nt,s.canvas=Vo,s.circle=Rr,s.circleMarker=Br,s.control=Me,s.divIcon=qr,s.extend=c,s.featureGroup=Sr,s.geoJSON=Ro,s.geoJson=jr,s.gridLayer=Gr,s.icon=Ar,s.imageOverlay=Hr,s.latLng=B,s.latLngBounds=F,s.layerGroup=Ir,s.map=gr,s.marker=Or,s.point=C,s.polygon=Nr,s.polyline=Dr,s.popup=Vr,s.rectangle=$r,s.setOptions=M,s.stamp=v,s.svg=Fo,s.svgOverlay=Wr,s.tileLayer=Ho,s.tooltip=Fr,s.transformation=Wt,s.version=h,s.videoOverlay=Ur;var Jr=window.L;s.noConflict=function(){return window.L=Jr,this},window.L=s})}),dn={};ma(dn,{L:()=>_a,default:()=>vt});var ga=`.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.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-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;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;-moz-box-sizing:border-box;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-top,.leaflet-bottom{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-popup{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.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-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{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,.leaflet-bar a:focus{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 #0006;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;font-size:13px;font-size:1.08333em}.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:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.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;white-space:nowrap;-moz-box-sizing:border-box;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.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-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{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 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.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=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.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;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right: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}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}
|
|
3
|
-
`;if(typeof document<"u"){let o=document.createElement("style");o.textContent=ga,document.head.appendChild(o)}var un=hn(cn(),1);fa(dn,hn(cn(),1));var _a=un,vt=un,yt=Uint8Array,me=Uint16Array,va=Int32Array,pn=new yt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mn=new yt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ya=new yt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fn=function(o,r){for(var s=new me(31),h=0;h<31;++h)s[h]=r+=1<<o[h-1];for(var c=new va(s[30]),h=1;h<30;++h)for(var p=s[h];p<s[h+1];++p)c[p]=p-s[h]<<5|h;return{b:s,r:c}},gn=fn(pn,2),_n=gn.b,ba=gn.r;_n[28]=258,ba[258]=28;var vn=fn(mn,0),xa=vn.b,Ts=vn.r,Oi=new me(32768);for(V=0;V<32768;++V)jt=(V&43690)>>1|(V&21845)<<1,jt=(jt&52428)>>2|(jt&13107)<<2,jt=(jt&61680)>>4|(jt&3855)<<4,Oi[V]=((jt&65280)>>8|(jt&255)<<8)>>1;var jt,V,Ee=function(o,r,s){for(var h=o.length,c=0,p=new me(r);c<h;++c)o[c]&&++p[o[c]-1];var u=new me(r);for(c=1;c<r;++c)u[c]=u[c-1]+p[c-1]<<1;var _;if(s){_=new me(1<<r);var v=15-r;for(c=0;c<h;++c)if(o[c])for(var x=c<<4|o[c],y=r-o[c],g=u[o[c]-1]++<<y,k=g|(1<<y)-1;g<=k;++g)_[Oi[g]>>v]=x}else for(_=new me(h),c=0;c<h;++c)o[c]&&(_[c]=Oi[u[o[c]-1]++]>>15-o[c]);return _},Ze=new yt(288);for(V=0;V<144;++V)Ze[V]=8;var V;for(V=144;V<256;++V)Ze[V]=9;var V;for(V=256;V<280;++V)Ze[V]=7;var V;for(V=280;V<288;++V)Ze[V]=8;var V,yn=new yt(32);for(V=0;V<32;++V)yn[V]=5;var V,wa=Ee(Ze,9,1),ka=Ee(yn,5,1),Ii=function(o){for(var r=o[0],s=1;s<o.length;++s)o[s]>r&&(r=o[s]);return r},zt=function(o,r,s){var h=r/8|0;return(o[h]|o[h+1]<<8)>>(r&7)&s},Si=function(o,r){var s=r/8|0;return(o[s]|o[s+1]<<8|o[s+2]<<16)>>(r&7)},Ma=function(o){return(o+7)/8|0},La=function(o,r,s){return(r==null||r<0)&&(r=0),(s==null||s>o.length)&&(s=o.length),new yt(o.subarray(r,s))},Pa=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],_t=function(o,r,s){var h=new Error(r||Pa[o]);if(h.code=o,Error.captureStackTrace&&Error.captureStackTrace(h,_t),!s)throw h;return h},Ni=function(o,r,s,h){var c=o.length,p=h?h.length:0;if(!c||r.f&&!r.l)return s||new yt(0);var u=!s,_=u||r.i!=2,v=r.i;u&&(s=new yt(c*3));var x=function(ie){var Wt=s.length;if(ie>Wt){var oe=new yt(Math.max(Wt*2,ie));oe.set(s),s=oe}},y=r.f||0,g=r.p||0,k=r.b||0,S=r.l,w=r.d,M=r.m,z=r.n,ot=c*8;do{if(!S){y=zt(o,g,1);var J=zt(o,g+1,3);if(g+=3,J)if(J==1)S=wa,w=ka,M=9,z=5;else if(J==2){var tt=zt(o,g,31)+257,q=zt(o,g+10,15)+4,ut=tt+zt(o,g+5,31)+1;g+=14;for(var ft=new yt(ut),Et=new yt(19),st=0;st<q;++st)Et[ya[st]]=zt(o,g+st*3,7);g+=q*3;for(var Zt=Ii(Et),ee=(1<<Zt)-1,lt=Ee(Et,Zt,1),st=0;st<ut;){var E=lt[zt(o,g,ee)];g+=E&15;var D=E>>4;if(D<16)ft[st++]=D;else{var H=0,et=0;for(D==16?(et=3+zt(o,g,3),g+=2,H=ft[st-1]):D==17?(et=3+zt(o,g,7),g+=3):D==18&&(et=11+zt(o,g,127),g+=7);et--;)ft[st++]=H}}var Y=ft.subarray(0,tt),X=ft.subarray(tt);M=Ii(Y),z=Ii(X),S=Ee(Y,M,1),w=Ee(X,z,1)}else _t(1);else{var D=Ma(g)+4,Z=o[D-4]|o[D-3]<<8,Ut=D+Z;if(Ut>c){v&&_t(0);break}_&&x(k+Z),s.set(o.subarray(D,Ut),k),r.b=k+=Z,r.p=g=Ut*8,r.f=y;continue}if(g>ot){v&&_t(0);break}}_&&x(k+131072);for(var C=(1<<M)-1,G=(1<<z)-1,nt=g;;nt=g){var H=S[Si(o,g)&C],W=H>>4;if(g+=H&15,g>ot){v&&_t(0);break}if(H||_t(2),W<256)s[k++]=W;else if(W==256){nt=g,S=null;break}else{var F=W-254;if(W>264){var st=W-257,N=pn[st];F=zt(o,g,(1<<N)-1)+_n[st],g+=N}var B=w[Si(o,g)&G],gt=B>>4;B||_t(3),g+=B&15;var X=xa[gt];if(gt>3){var N=mn[gt];X+=Si(o,g)&(1<<N)-1,g+=N}if(g>ot){v&&_t(0);break}_&&x(k+131072);var Lt=k+F;if(k<X){var fe=p-X,ge=Math.min(X,Lt);for(fe+k<0&&_t(3);k<ge;++k)s[k]=h[fe+k]}for(;k<Lt;++k)s[k]=s[k-X]}}r.l=S,r.p=nt,r.b=k,r.f=y,S&&(y=1,r.m=M,r.d=w,r.n=z)}while(!y);return k!=s.length&&u?La(s,0,k):s.subarray(0,k)},Ta=new yt(0),za=function(o){(o[0]!=31||o[1]!=139||o[2]!=8)&&_t(6,"invalid gzip data");var r=o[3],s=10;r&4&&(s+=(o[10]|o[11]<<8)+2);for(var h=(r>>3&1)+(r>>4&1);h>0;h-=!o[s++]);return s+(r&2)},Ca=function(o){var r=o.length;return(o[r-4]|o[r-3]<<8|o[r-2]<<16|o[r-1]<<24)>>>0},Ea=function(o,r){return((o[0]&15)!=8||o[0]>>4>7||(o[0]<<8|o[1])%31)&&_t(6,"invalid zlib data"),(o[1]>>5&1)==+!r&&_t(6,"invalid zlib data: "+(o[1]&32?"need":"unexpected")+" dictionary"),(o[1]>>3&4)+2};function Za(o,r){return Ni(o,{i:2},r&&r.out,r&&r.dictionary)}function Ia(o,r){var s=za(o);return s+8>o.length&&_t(6,"invalid gzip data"),Ni(o.subarray(s,-8),{i:2},r&&r.out||new yt(Ca(o)),r&&r.dictionary)}function Sa(o,r){return Ni(o.subarray(Ea(o,r&&r.dictionary),-4),{i:2},r&&r.out,r&&r.dictionary)}function Aa(o,r){return o[0]==31&&o[1]==139&&o[2]==8?Ia(o,r):(o[0]&15)!=8||o[0]>>4>7||(o[0]<<8|o[1])%31?Za(o,r):Sa(o,r)}var Oa=typeof TextDecoder<"u"&&new TextDecoder,Ba=0;try{Oa.decode(Ta,{stream:!0}),Ba=1}catch{}var Ra=Object.defineProperty,Da=Math.pow,K=(o,r)=>Ra(o,"name",{value:r,configurable:!0}),ct=(o,r,s)=>new Promise((h,c)=>{var p=v=>{try{_(s.next(v))}catch(x){c(x)}},u=v=>{try{_(s.throw(v))}catch(x){c(x)}},_=v=>v.done?h(v.value):Promise.resolve(v.value).then(p,u);_((s=s.apply(o,r)).next())}),Na=K((o,r)=>{let s=!1,h="",c=L.GridLayer.extend({createTile:K((p,u)=>{let _=document.createElement("img"),v=new AbortController,x=v.signal;return _.cancel=()=>{v.abort()},s||(o.getHeader().then(y=>{y.tileType===1?console.error("Error: archive contains MVT vector tiles, but leafletRasterLayer is for displaying raster tiles. See https://github.com/protomaps/PMTiles/tree/main/js for details."):y.tileType===2?h="image/png":y.tileType===3?h="image/jpeg":y.tileType===4?h="image/webp":y.tileType===5&&(h="image/avif")}),s=!0),o.getZxy(p.z,p.x,p.y,x).then(y=>{if(y){let g=new Blob([y.data],{type:h}),k=window.URL.createObjectURL(g);_.src=k}else _.style.display="none";_.cancel=void 0,u(void 0,_)}).catch(y=>{if(y.name!=="AbortError")throw y}),_},"createTile"),_removeTile:K(function(p){let u=this._tiles[p];u&&(u.el.cancel&&u.el.cancel(),u.el.width=0,u.el.height=0,u.el.deleted=!0,L.DomUtil.remove(u.el),delete this._tiles[p],this.fire("tileunload",{tile:u.el,coords:this._keyToTileCoords(p)}))},"_removeTile")});return new c(r)},"leafletRasterLayer"),ja=K(o=>(r,s)=>{if(s instanceof AbortController)return o(r,s);let h=new AbortController;return o(r,h).then(c=>s(void 0,c.data,c.cacheControl||"",c.expires||""),c=>s(c)).catch(c=>s(c)),{cancel:K(()=>h.abort(),"cancel")}},"v3compat"),Ha=class{constructor(o){this.tilev4=K((r,s)=>ct(this,null,function*(){if(r.type==="json"){let k=r.url.substr(10),S=this.tiles.get(k);if(S||(S=new Ri(k),this.tiles.set(k,S)),this.metadata){let M=yield S.getTileJson(r.url);return s.signal.throwIfAborted(),{data:M}}let w=yield S.getHeader();return s.signal.throwIfAborted(),(w.minLon>=w.maxLon||w.minLat>=w.maxLat)&&console.error(`Bounds of PMTiles archive ${w.minLon},${w.minLat},${w.maxLon},${w.maxLat} are not valid.`),{data:{tiles:[`${r.url}/{z}/{x}/{y}`],minzoom:w.minZoom,maxzoom:w.maxZoom,bounds:[w.minLon,w.minLat,w.maxLon,w.maxLat]}}}let h=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),c=r.url.match(h);if(!c)throw new Error("Invalid PMTiles protocol URL");let p=c[1],u=this.tiles.get(p);u||(u=new Ri(p),this.tiles.set(p,u));let _=c[2],v=c[3],x=c[4],y=yield u.getHeader(),g=yield u?.getZxy(+_,+v,+x,s.signal);if(s.signal.throwIfAborted(),g)return{data:new Uint8Array(g.data),cacheControl:g.cacheControl,expires:g.expires};if(y.tileType===1){if(this.errorOnMissingTile)throw new Error("Tile not found.");return{data:new Uint8Array}}return{data:null}}),"tilev4"),this.tile=ja(this.tilev4),this.tiles=new Map,this.metadata=o?.metadata||!1,this.errorOnMissingTile=o?.errorOnMissingTile||!1}add(o){this.tiles.set(o.source.getKey(),o)}get(o){return this.tiles.get(o)}};K(Ha,"Protocol");function bn(o,r){return(r>>>0)*4294967296+(o>>>0)}K(bn,"toNum");function xn(o,r){let s=r.buf,h=s[r.pos++],c=(h&112)>>4;if(h<128||(h=s[r.pos++],c|=(h&127)<<3,h<128)||(h=s[r.pos++],c|=(h&127)<<10,h<128)||(h=s[r.pos++],c|=(h&127)<<17,h<128)||(h=s[r.pos++],c|=(h&127)<<24,h<128)||(h=s[r.pos++],c|=(h&1)<<31,h<128))return bn(o,c);throw new Error("Expected varint not more than 10 bytes")}K(xn,"readVarintRemainder");function pe(o){let r=o.buf,s=r[o.pos++],h=s&127;return s<128||(s=r[o.pos++],h|=(s&127)<<7,s<128)||(s=r[o.pos++],h|=(s&127)<<14,s<128)||(s=r[o.pos++],h|=(s&127)<<21,s<128)?h:(s=r[o.pos],h|=(s&15)<<28,xn(h,o))}K(pe,"readVarint");function ji(o,r,s,h,c){return c===0?h!==0?[o-1-s,o-1-r]:[s,r]:[r,s]}K(ji,"rotate");function wn(o,r,s){if(o>26)throw new Error("Tile zoom level exceeds max safe number limit (26)");if(r>=1<<o||s>=1<<o)throw new Error("tile x/y outside zoom level bounds");let h=((1<<o)*(1<<o)-1)/3,c=o-1,[p,u]=[r,s];for(let _=1<<c;_>0;_>>=1){let v=p&_,x=u&_;h+=(3*v^x)*(1<<c),[p,u]=ji(_,p,u,v,x),c--}return h}K(wn,"zxyToTileId");function kn(o){let r=3*o+1;return r<4294967296?31-Math.clz32(r):63-Math.clz32(r/4294967296)}K(kn,"tileIdToZ");function Ua(o){let r=kn(o)>>1;if(r>26)throw new Error("Tile zoom level exceeds max safe number limit (26)");let s=((1<<r)*(1<<r)-1)/3,h=o-s,c=0,p=0,u=1<<r;for(let _=1;_<u;_<<=1){let v=_&h/2,x=_&(h^v);[c,p]=ji(_,c,p,v,x),h=h/2,c+=v,p+=x}return[r,c,p]}K(Ua,"tileIdToZxy");var Wa=(o=>(o[o.Unknown=0]="Unknown",o[o.None=1]="None",o[o.Gzip=2]="Gzip",o[o.Brotli=3]="Brotli",o[o.Zstd=4]="Zstd",o))(Wa||{});function Je(o,r){return ct(this,null,function*(){if(r===1||r===0)return o;if(r===2){if(typeof globalThis.DecompressionStream>"u")return Aa(new Uint8Array(o));let s=new Response(o).body;if(!s)throw new Error("Failed to read response stream");let h=s.pipeThrough(new globalThis.DecompressionStream("gzip"));return new Response(h).arrayBuffer()}throw new Error("Compression method not supported")})}K(Je,"defaultDecompress");var Va=(o=>(o[o.Unknown=0]="Unknown",o[o.Mvt=1]="Mvt",o[o.Png=2]="Png",o[o.Jpeg=3]="Jpeg",o[o.Webp=4]="Webp",o[o.Avif=5]="Avif",o[o.Mlt=6]="Mlt",o))(Va||{});function Mn(o){return o===1?".mvt":o===2?".png":o===3?".jpg":o===4?".webp":o===5?".avif":o===6?".mlt":""}K(Mn,"tileTypeExt");var Fa=127;function Ln(o,r){let s=0,h=o.length-1;for(;s<=h;){let c=h+s>>1,p=r-o[c].tileId;if(p>0)s=c+1;else if(p<0)h=c-1;else return o[c]}return h>=0&&(o[h].runLength===0||r-o[h].tileId<o[h].runLength)?o[h]:null}K(Ln,"findTile");var qa=class{constructor(o){this.file=o}getKey(){return this.file.name}getBytes(o,r){return ct(this,null,function*(){return{data:yield this.file.slice(o,o+r).arrayBuffer()}})}};K(qa,"FileSource");var Pn=class{constructor(o,r=new Headers){var s,h;this.url=o,this.customHeaders=r,this.mustReload=!1;let c="";"navigator"in globalThis&&(c=(h=(s=globalThis.navigator)==null?void 0:s.userAgent)!=null?h:"");let p=c.indexOf("Windows")>-1,u=/Chrome|Chromium|Edg|OPR|Brave/.test(c);this.chromeWindowsNoCache=!1,p&&u&&(this.chromeWindowsNoCache=!0)}getKey(){return this.url}setHeaders(o){this.customHeaders=o}getBytes(o,r,s,h){return ct(this,null,function*(){let c,p;s?p=s:(c=new AbortController,p=c.signal);let u=new Headers(this.customHeaders);u.set("range",`bytes=${o}-${o+r-1}`);let _;this.mustReload?_="reload":this.chromeWindowsNoCache&&(_="no-store");let v=yield fetch(this.url,{signal:p,cache:_,headers:u});if(o===0&&v.status===416){let g=v.headers.get("Content-Range");if(!g||!g.startsWith("bytes */"))throw new Error("Missing content-length on 416 response");let k=+g.substr(8);v=yield fetch(this.url,{signal:p,cache:"reload",headers:{range:`bytes=0-${k-1}`}})}let x=v.headers.get("Etag");if(x!=null&&x.startsWith("W/")&&(x=null),v.status===416||h&&x&&x!==h)throw this.mustReload=!0,new Bi(`Server returned non-matching ETag ${h} after one retry. Check browser extensions and servers for issues that may affect correct ETag headers.`);if(v.status>=300)throw new Error(`Bad response code: ${v.status}`);let y=v.headers.get("Content-Length");if(v.status===200&&(!y||+y>r))throw c&&c.abort(),new Error("Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.");return{data:yield v.arrayBuffer(),etag:x||void 0,cacheControl:v.headers.get("Cache-Control")||void 0,expires:v.headers.get("Expires")||void 0}})}};K(Pn,"FetchSource");var Ga=Pn;function Mt(o,r){let s=o.getUint32(r+4,!0),h=o.getUint32(r+0,!0);return s*Da(2,32)+h}K(Mt,"getUint64");function Tn(o,r){let s=new DataView(o),h=s.getUint8(7);if(h>3)throw new Error(`Archive is spec version ${h} but this library supports up to spec version 3`);return{specVersion:h,rootDirectoryOffset:Mt(s,8),rootDirectoryLength:Mt(s,16),jsonMetadataOffset:Mt(s,24),jsonMetadataLength:Mt(s,32),leafDirectoryOffset:Mt(s,40),leafDirectoryLength:Mt(s,48),tileDataOffset:Mt(s,56),tileDataLength:Mt(s,64),numAddressedTiles:Mt(s,72),numTileEntries:Mt(s,80),numTileContents:Mt(s,88),clustered:s.getUint8(96)===1,internalCompression:s.getUint8(97),tileCompression:s.getUint8(98),tileType:s.getUint8(99),minZoom:s.getUint8(100),maxZoom:s.getUint8(101),minLon:s.getInt32(102,!0)/1e7,minLat:s.getInt32(106,!0)/1e7,maxLon:s.getInt32(110,!0)/1e7,maxLat:s.getInt32(114,!0)/1e7,centerZoom:s.getUint8(118),centerLon:s.getInt32(119,!0)/1e7,centerLat:s.getInt32(123,!0)/1e7,etag:r}}K(Tn,"bytesToHeader");function Hi(o){let r={buf:new Uint8Array(o),pos:0},s=pe(r),h=[],c=0;for(let p=0;p<s;p++){let u=pe(r);h.push({tileId:c+u,offset:0,length:0,runLength:1}),c+=u}for(let p=0;p<s;p++)h[p].runLength=pe(r);for(let p=0;p<s;p++)h[p].length=pe(r);for(let p=0;p<s;p++){let u=pe(r);u===0&&p>0?h[p].offset=h[p-1].offset+h[p-1].length:h[p].offset=u-1}return h}K(Hi,"deserializeIndex");var zn=class extends Error{};K(zn,"EtagMismatch");var Bi=zn;function Ui(o,r){return ct(this,null,function*(){let s=yield o.getBytes(0,16384);if(new DataView(s.data).getUint16(0,!0)!==19792)throw new Error("Wrong magic number for PMTiles archive");let h=s.data.slice(0,Fa),c=Tn(h,s.etag),p=s.data.slice(c.rootDirectoryOffset,c.rootDirectoryOffset+c.rootDirectoryLength),u=`${o.getKey()}|${c.etag||""}|${c.rootDirectoryOffset}|${c.rootDirectoryLength}`,_=Hi(yield r(p,c.internalCompression));return[c,[u,_.length,_]]})}K(Ui,"getHeaderAndRoot");function Wi(o,r,s,h,c){return ct(this,null,function*(){let p=yield o.getBytes(s,h,void 0,c.etag),u=yield r(p.data,c.internalCompression),_=Hi(u);if(_.length===0)throw new Error("Empty directory is invalid");return _})}K(Wi,"getDirectory");var Ka=class{constructor(o=100,r=!0,s=Je){this.cache=new Map,this.maxCacheEntries=o,this.counter=1,this.decompress=s}getHeader(o){return ct(this,null,function*(){let r=o.getKey(),s=this.cache.get(r);if(s)return s.lastUsed=this.counter++,s.data;let h=yield Ui(o,this.decompress);return h[1]&&this.cache.set(h[1][0],{lastUsed:this.counter++,data:h[1][2]}),this.cache.set(r,{lastUsed:this.counter++,data:h[0]}),this.prune(),h[0]})}getDirectory(o,r,s,h){return ct(this,null,function*(){let c=`${o.getKey()}|${h.etag||""}|${r}|${s}`,p=this.cache.get(c);if(p)return p.lastUsed=this.counter++,p.data;let u=yield Wi(o,this.decompress,r,s,h);return this.cache.set(c,{lastUsed:this.counter++,data:u}),this.prune(),u})}prune(){if(this.cache.size>this.maxCacheEntries){let o=1/0,r;this.cache.forEach((s,h)=>{s.lastUsed<o&&(o=s.lastUsed,r=h)}),r&&this.cache.delete(r)}}invalidate(o){return ct(this,null,function*(){this.cache.delete(o.getKey())})}};K(Ka,"ResolvedValueCache");var Cn=class{constructor(o=100,r=!0,s=Je){this.cache=new Map,this.invalidations=new Map,this.maxCacheEntries=o,this.counter=1,this.decompress=s}getHeader(o){return ct(this,null,function*(){let r=o.getKey(),s=this.cache.get(r);if(s)return s.lastUsed=this.counter++,yield s.data;let h=new Promise((c,p)=>{Ui(o,this.decompress).then(u=>{u[1]&&this.cache.set(u[1][0],{lastUsed:this.counter++,data:Promise.resolve(u[1][2])}),c(u[0]),this.prune()}).catch(u=>{p(u)})});return this.cache.set(r,{lastUsed:this.counter++,data:h}),h})}getDirectory(o,r,s,h){return ct(this,null,function*(){let c=`${o.getKey()}|${h.etag||""}|${r}|${s}`,p=this.cache.get(c);if(p)return p.lastUsed=this.counter++,yield p.data;let u=new Promise((_,v)=>{Wi(o,this.decompress,r,s,h).then(x=>{_(x),this.prune()}).catch(x=>{v(x)})});return this.cache.set(c,{lastUsed:this.counter++,data:u}),u})}prune(){if(this.cache.size>=this.maxCacheEntries){let o=1/0,r;this.cache.forEach((s,h)=>{s.lastUsed<o&&(o=s.lastUsed,r=h)}),r&&this.cache.delete(r)}}invalidate(o){return ct(this,null,function*(){let r=o.getKey();if(this.invalidations.get(r))return yield this.invalidations.get(r);this.cache.delete(o.getKey());let s=new Promise((h,c)=>{this.getHeader(o).then(p=>{h(),this.invalidations.delete(r)}).catch(p=>{c(p)})});this.invalidations.set(r,s)})}};K(Cn,"SharedPromiseCache");var Ya=Cn,En=class{constructor(o,r,s){typeof o=="string"?this.source=new Ga(o):this.source=o,s?this.decompress=s:this.decompress=Je,r?this.cache=r:this.cache=new Ya}getHeader(){return ct(this,null,function*(){return yield this.cache.getHeader(this.source)})}getZxyAttempt(o,r,s,h){return ct(this,null,function*(){let c=wn(o,r,s),p=yield this.cache.getHeader(this.source);if(o<p.minZoom||o>p.maxZoom)return;let u=p.rootDirectoryOffset,_=p.rootDirectoryLength;for(let v=0;v<=3;v++){let x=yield this.cache.getDirectory(this.source,u,_,p),y=Ln(x,c);if(y){if(y.runLength>0){let g=yield this.source.getBytes(p.tileDataOffset+y.offset,y.length,h,p.etag);return{data:yield this.decompress(g.data,p.tileCompression),cacheControl:g.cacheControl,expires:g.expires}}u=p.leafDirectoryOffset+y.offset,_=y.length}else return}throw new Error("Maximum directory depth exceeded")})}getZxy(o,r,s,h){return ct(this,null,function*(){try{return yield this.getZxyAttempt(o,r,s,h)}catch(c){if(c instanceof Bi)return this.cache.invalidate(this.source),yield this.getZxyAttempt(o,r,s,h);throw c}})}getMetadataAttempt(){return ct(this,null,function*(){let o=yield this.cache.getHeader(this.source),r=yield this.source.getBytes(o.jsonMetadataOffset,o.jsonMetadataLength,void 0,o.etag),s=yield this.decompress(r.data,o.internalCompression),h=new TextDecoder("utf-8");return JSON.parse(h.decode(s))})}getMetadata(){return ct(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(o){if(o instanceof Bi)return this.cache.invalidate(this.source),yield this.getMetadataAttempt();throw o}})}getTileJson(o){return ct(this,null,function*(){let r=yield this.getHeader(),s=yield this.getMetadata(),h=Mn(r.tileType);return{tilejson:"3.0.0",scheme:"xyz",tiles:[`${o}/{z}/{x}/{y}${h}`],vector_layers:s.vector_layers,attribution:s.attribution,description:s.description,name:s.name,version:s.version,bounds:[r.minLon,r.minLat,r.maxLon,r.maxLat],center:[r.centerLon,r.centerLat,r.centerZoom],minzoom:r.minZoom,maxzoom:r.maxZoom}})}};K(En,"PMTiles");var Ri=En,Qe={TEMP:"temp",DRAFTS:"drafts",ORIGINALS:"originals",PROCESSED:"processed"},$a=4,qt={WIDTH:30,HEIGHT:40,ANCHOR_X:16,ANCHOR_Y:36};function nn(o,r,s){if(o<=0||r<=0||s<0)return 0;let h=o*Math.pow(2,s);return Math.ceil(h/r)}function Xa(o,r,s,h){return{tileX:nn(o,s,h),tileY:nn(r,s,h)}}function rn(o){return`${Qe.PROCESSED}/${o}/preview/preview.webp`}function an(o){return`${Qe.PROCESSED}/${o}/preview/thumbnail.webp`}function sn(o){return`${Qe.PROCESSED}/${o}/annotated/preview/preview.webp`}function ln(o){return`${Qe.PROCESSED}/${o}/annotated/preview/thumbnail.webp`}function Ja(o,r,s,h){return o.replace("{z}",String(r)).replace("{x}",String(s)).replace("{y}",String(h))}function Qa(o,r){return[[0,0],[r,o]]}function Zn(o){return o.includes("{z}")&&o.includes("{x}")&&o.includes("{y}")}function ts(o){return o.endsWith(".pmtiles")}var es=class{config;tileLayer=null;constructor(o){if(!o)throw new Error("Tile configuration is required");if(!o.imageInfo)throw new Error("Image info is required");if(!o.tileUrl&&!o.pmtilesUrl)throw new Error("Either tileUrl or pmtilesUrl is required");if(o.tileUrl&&!Zn(o.tileUrl))throw new Error("Tile URL template must contain {z}, {x}, and {y} placeholders");if(o.pmtilesUrl&&!ts(o.pmtilesUrl))throw new Error("PMTiles URL must end with .pmtiles");this.config=o}createTileLayer(o){if(this.tileLayer)return console.warn("Tile layer already created. Use removeTileLayer() first."),this.tileLayer;try{let{imageInfo:r,keepBuffer:s,updateInterval:h}=this.config,c=this.calculateTileBounds(),p={minZoom:r.minZoom,maxZoom:r.maxZoom,maxNativeZoom:r.maxZoom,tileSize:r.tileSize,bounds:c,noWrap:!0,keepBuffer:s??4,updateWhenIdle:!1,updateWhenZooming:!0,updateInterval:h??50,opacity:1,className:"seamless-tiles"};if(this.config.pmtilesUrl){let u=new Ri(this.config.pmtilesUrl);if(r.minZoom===0){let _=u.getZxy.bind(u);u.getZxy=(v,x,y,g)=>_(v+1,x,y,g)}this.tileLayer=Na(u,p)}else{let u=this.config.tileUrl;if(!u)throw new Error("Tile URL is required in XYZ mode");this.tileLayer=vt.tileLayer(u,p)}return o&&this.setupEventListeners(o),console.log("TileLayerManager: Tile layer created successfully",{bounds:c,tileSize:r.tileSize,zoomRange:[r.minZoom,r.maxZoom]}),this.tileLayer}catch(r){let s=r instanceof Error?r.message:"Unknown error";throw new Error(`Failed to create tile layer: ${s}`)}}calculateTileBounds(){let{width:o,height:r}=this.config.imageInfo;return Qa(o,r)}calculateGridSize(o){let{width:r,height:s,tileSize:h}=this.config.imageInfo;return Xa(r,s,h,o)}getTileUrl(o,r,s){if(!this.config.tileUrl)throw new Error("getTileUrl is only supported in XYZ mode");return Ja(this.config.tileUrl,o,r,s)}getTileLayer(){return this.tileLayer}removeTileLayer(o){this.tileLayer&&(o&&o.removeLayer(this.tileLayer),this.tileLayer=null,console.log("TileLayerManager: Tile layer removed"))}setupEventListeners(o){this.tileLayer&&(this.tileLayer.on("tileloadstart",r=>{console.debug("Tile loading started",{url:r.tile.src})}),this.tileLayer.on("tileload",()=>{console.debug("Tile loaded successfully")}),this.tileLayer.on("tileerror",r=>{console.warn("Tile loading error",{url:r.tile.src,error:r.error})}))}getImageInfo(){return this.config.imageInfo}getConfig(){return this.config}},is=class{imageInfo;constructor(o){if(!o)throw new Error("Image info is required");if(o.width<=0||o.height<=0)throw new Error("Image width and height must be greater than 0");if(o.tileSize<=0)throw new Error("Tile size must be greater than 0");this.imageInfo=o}calculateImagePosition(){let o=this.imageInfo.tileSize||256,r=(this.imageInfo.minZoom||0)===0?o*2:o,s=r,h=r,c=this.imageInfo.width/this.imageInfo.height,p=s/h,u,_,v,x;return c>p?(u=s,_=s/c,v=0,x=(h-_)/2):(u=h*c,_=h,v=(s-u)/2,x=0),{imageRenderWidth:u,imageRenderHeight:_,imageOffsetX:v,imageOffsetY:x,canvasWidth:s,canvasHeight:h}}leafletToImage(o){this.validateLeafletCoords(o);let{imageRenderWidth:r,imageRenderHeight:s,imageOffsetX:h,imageOffsetY:c}=this.calculateImagePosition(),p=o[1],u=o[0],_=(p-h)/r,v=(u-c)/s,x=_*this.imageInfo.width,y=v*this.imageInfo.height,g=_>=0&&_<=1&&v>=0&&v<=1;return{x,y,withinBounds:g}}imageToLeaflet(o){this.validateImageCoords(o);let{imageRenderWidth:r,imageRenderHeight:s,imageOffsetX:h,imageOffsetY:c}=this.calculateImagePosition(),p=o.x/this.imageInfo.width,u=o.y/this.imageInfo.height,_=p*r+h;return[u*s+c,_]}getImageCenter(){let{imageRenderWidth:o,imageRenderHeight:r,imageOffsetX:s,imageOffsetY:h}=this.calculateImagePosition(),c=s+o/2,p=h+r/2;return{x:c,y:p}}calculateMapBounds(){let o=this.imageInfo.tileSize||256,r=(this.imageInfo.minZoom||0)===0?o*2:o;return vt.latLngBounds([0,0],[r,r])}validateLeafletCoords(o){if(!Array.isArray(o)||o.length!==2)throw new Error("Leaflet coordinates must be an array of 2 numbers [y, x]");let[r,s]=o;if(typeof r!="number"||typeof s!="number")throw new Error("Leaflet coordinates must be numbers");if(isNaN(r)||isNaN(s)||!isFinite(r)||!isFinite(s))throw new Error("Leaflet coordinates must be finite numbers")}validateImageCoords(o){if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Image coordinates must be an object with x and y properties");let{x:r,y:s}=o;if(typeof r!="number"||typeof s!="number")throw new Error("Image coordinates x and y must be numbers");if(isNaN(r)||isNaN(s)||!isFinite(r)||!isFinite(s))throw new Error("Image coordinates must be finite numbers");if(r<0||r>this.imageInfo.width)throw new Error(`Image x coordinate (${r}) is out of bounds [0, ${this.imageInfo.width}]`);if(s<0||s>this.imageInfo.height)throw new Error(`Image y coordinate (${s}) is out of bounds [0, ${this.imageInfo.height}]`)}createCustomCRS(){return vt.extend({},vt.CRS.Simple,{transformation:new vt.Transformation(1,0,1,0)})}getAspectRatio(){return this.imageInfo.width/this.imageInfo.height}getBounds(){return{minX:0,maxX:this.imageInfo.width,minY:0,maxY:this.imageInfo.height}}getImageInfo(){return{...this.imageInfo}}isWithinBounds(o){try{return this.validateImageCoords(o),!0}catch{return!1}}clampToBounds(o){return{x:Math.max(0,Math.min(this.imageInfo.width,o.x)),y:Math.max(0,Math.min(this.imageInfo.height,o.y))}}calculateCenterOffset(o,r,s){if(this.validateImageCoords(o),r<=0||s<=0)throw new Error("Container width and height must be greater than 0");return{x:o.x-r/2,y:o.y-s/2}}},os=class{map;imageInfo;config;zoomState;zoomChangeListeners=new Set;constructor(o){if(!o.map)throw new Error("Leaflet map instance is required");if(!o.imageInfo)throw new Error("Image info is required");if(o.imageInfo.width<=0||o.imageInfo.height<=0)throw new Error("Image width and height must be greater than 0");this.map=o.map,this.imageInfo=o.imageInfo;let r=this.calculateMaxZoomFromDimensions(),s=o.config?.minZoom??o.imageInfo.minZoom??0,h=o.config?.maxZoom??o.imageInfo.maxZoom??r;if(s<0)throw new Error("Minimum zoom must be >= 0");if(h<s)throw new Error("Maximum zoom must be >= minimum zoom");this.config={minZoom:s,maxZoom:h,initialZoom:o.config?.initialZoom,zoomSnap:o.config?.zoomSnap??1,zoomDelta:o.config?.zoomDelta??1};let c=this.map.getZoom();this.zoomState={currentZoom:this.constrainZoom(c),minZoom:this.config.minZoom,maxZoom:this.config.maxZoom},this.setupZoomListeners()}calculateMaxZoomFromDimensions(){let{width:o,height:r,tileSize:s=256}=this.imageInfo,h=Math.max(o,r),c=Math.floor(Math.log2(h/s)),p=Math.floor(Math.log2(16383/s))-1,u=Math.min(c,p,$a);return Math.max(0,u)}calculateOptimalInitialZoom(){if(typeof window>"u")return this.config.minZoom;let o=window.innerWidth,r;return o<=768?r=this.config.minZoom:r=Math.min(this.config.minZoom+1,this.config.maxZoom),this.constrainZoom(r)}constrainZoom(o){return Math.max(this.config.minZoom,Math.min(this.config.maxZoom,Math.round(o)))}isValidZoom(o){return Number.isInteger(o)&&o>=this.config.minZoom&&o<=this.config.maxZoom}zoomIn(o){let r=this.map.getZoom(),s=this.config.zoomDelta??1,h=this.constrainZoom(r+s);return h===r?!1:(this.setZoom(h,o),!0)}zoomOut(o){let r=this.map.getZoom(),s=this.config.zoomDelta??1,h=this.constrainZoom(r-s);return h===r?!1:(this.setZoom(h,o),!0)}setZoom(o,r){if(!Number.isFinite(o))throw new Error(`Invalid zoom level: ${o}. Must be a finite number between ${this.config.minZoom} and ${this.config.maxZoom}`);let s=this.constrainZoom(o),h=r?.animate!==!1;this.map.setZoom(s,{animate:h})}getZoomState(){return{...this.zoomState}}getZoom(){return this.map.getZoom()}getMinZoom(){return this.config.minZoom}getMaxZoom(){return this.config.maxZoom}canZoomIn(){return this.map.getZoom()<this.config.maxZoom}canZoomOut(){return this.map.getZoom()>this.config.minZoom}onZoomChange(o){return this.zoomChangeListeners.add(o),()=>{this.zoomChangeListeners.delete(o)}}removeAllListeners(){this.zoomChangeListeners.clear()}setupZoomListeners(){let o=()=>{let r=this.map.getZoom(),s=this.constrainZoom(r);if(r!==s){this.map.setView(this.map.getCenter(),s,{animate:!1});return}this.zoomState={currentZoom:s,minZoom:this.config.minZoom,maxZoom:this.config.maxZoom},this.zoomChangeListeners.forEach(h=>{h(this.zoomState)})};this.map.on("zoomend",o),this.map.on("zoom",o),o()}dispose(){this.removeAllListeners()}},Gt=null;function ns(o){Gt&&Gt.parentElement&&(Gt.parentElement.removeChild(Gt),Gt=null);let{marker:r,onSave:s,onCancel:h}=o,c=z=>z?z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):"",p=document.createElement("div");p.className="edgepdf-marker-edit-popup",p.innerHTML=`
|
|
3
|
+
`;if(typeof document<"u"){let o=document.createElement("style");o.textContent=ga,document.head.appendChild(o)}var un=hn(cn(),1);fa(dn,hn(cn(),1));var _a=un,vt=un,yt=Uint8Array,me=Uint16Array,va=Int32Array,pn=new yt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mn=new yt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ya=new yt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fn=function(o,r){for(var s=new me(31),h=0;h<31;++h)s[h]=r+=1<<o[h-1];for(var c=new va(s[30]),h=1;h<30;++h)for(var p=s[h];p<s[h+1];++p)c[p]=p-s[h]<<5|h;return{b:s,r:c}},gn=fn(pn,2),_n=gn.b,ba=gn.r;_n[28]=258,ba[258]=28;var vn=fn(mn,0),xa=vn.b,Ts=vn.r,Oi=new me(32768);for(V=0;V<32768;++V)jt=(V&43690)>>1|(V&21845)<<1,jt=(jt&52428)>>2|(jt&13107)<<2,jt=(jt&61680)>>4|(jt&3855)<<4,Oi[V]=((jt&65280)>>8|(jt&255)<<8)>>1;var jt,V,Ee=function(o,r,s){for(var h=o.length,c=0,p=new me(r);c<h;++c)o[c]&&++p[o[c]-1];var u=new me(r);for(c=1;c<r;++c)u[c]=u[c-1]+p[c-1]<<1;var _;if(s){_=new me(1<<r);var v=15-r;for(c=0;c<h;++c)if(o[c])for(var x=c<<4|o[c],y=r-o[c],g=u[o[c]-1]++<<y,k=g|(1<<y)-1;g<=k;++g)_[Oi[g]>>v]=x}else for(_=new me(h),c=0;c<h;++c)o[c]&&(_[c]=Oi[u[o[c]-1]++]>>15-o[c]);return _},Ze=new yt(288);for(V=0;V<144;++V)Ze[V]=8;var V;for(V=144;V<256;++V)Ze[V]=9;var V;for(V=256;V<280;++V)Ze[V]=7;var V;for(V=280;V<288;++V)Ze[V]=8;var V,yn=new yt(32);for(V=0;V<32;++V)yn[V]=5;var V,wa=Ee(Ze,9,1),ka=Ee(yn,5,1),Ii=function(o){for(var r=o[0],s=1;s<o.length;++s)o[s]>r&&(r=o[s]);return r},zt=function(o,r,s){var h=r/8|0;return(o[h]|o[h+1]<<8)>>(r&7)&s},Si=function(o,r){var s=r/8|0;return(o[s]|o[s+1]<<8|o[s+2]<<16)>>(r&7)},Ma=function(o){return(o+7)/8|0},La=function(o,r,s){return(r==null||r<0)&&(r=0),(s==null||s>o.length)&&(s=o.length),new yt(o.subarray(r,s))},Pa=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],_t=function(o,r,s){var h=new Error(r||Pa[o]);if(h.code=o,Error.captureStackTrace&&Error.captureStackTrace(h,_t),!s)throw h;return h},Ni=function(o,r,s,h){var c=o.length,p=h?h.length:0;if(!c||r.f&&!r.l)return s||new yt(0);var u=!s,_=u||r.i!=2,v=r.i;u&&(s=new yt(c*3));var x=function(ie){var Wt=s.length;if(ie>Wt){var oe=new yt(Math.max(Wt*2,ie));oe.set(s),s=oe}},y=r.f||0,g=r.p||0,k=r.b||0,S=r.l,w=r.d,M=r.m,z=r.n,ot=c*8;do{if(!S){y=zt(o,g,1);var J=zt(o,g+1,3);if(g+=3,J)if(J==1)S=wa,w=ka,M=9,z=5;else if(J==2){var tt=zt(o,g,31)+257,q=zt(o,g+10,15)+4,ut=tt+zt(o,g+5,31)+1;g+=14;for(var ft=new yt(ut),Et=new yt(19),st=0;st<q;++st)Et[ya[st]]=zt(o,g+st*3,7);g+=q*3;for(var Zt=Ii(Et),ee=(1<<Zt)-1,lt=Ee(Et,Zt,1),st=0;st<ut;){var E=lt[zt(o,g,ee)];g+=E&15;var D=E>>4;if(D<16)ft[st++]=D;else{var H=0,et=0;for(D==16?(et=3+zt(o,g,3),g+=2,H=ft[st-1]):D==17?(et=3+zt(o,g,7),g+=3):D==18&&(et=11+zt(o,g,127),g+=7);et--;)ft[st++]=H}}var Y=ft.subarray(0,tt),X=ft.subarray(tt);M=Ii(Y),z=Ii(X),S=Ee(Y,M,1),w=Ee(X,z,1)}else _t(1);else{var D=Ma(g)+4,Z=o[D-4]|o[D-3]<<8,Ut=D+Z;if(Ut>c){v&&_t(0);break}_&&x(k+Z),s.set(o.subarray(D,Ut),k),r.b=k+=Z,r.p=g=Ut*8,r.f=y;continue}if(g>ot){v&&_t(0);break}}_&&x(k+131072);for(var C=(1<<M)-1,G=(1<<z)-1,nt=g;;nt=g){var H=S[Si(o,g)&C],W=H>>4;if(g+=H&15,g>ot){v&&_t(0);break}if(H||_t(2),W<256)s[k++]=W;else if(W==256){nt=g,S=null;break}else{var F=W-254;if(W>264){var st=W-257,N=pn[st];F=zt(o,g,(1<<N)-1)+_n[st],g+=N}var B=w[Si(o,g)&G],gt=B>>4;B||_t(3),g+=B&15;var X=xa[gt];if(gt>3){var N=mn[gt];X+=Si(o,g)&(1<<N)-1,g+=N}if(g>ot){v&&_t(0);break}_&&x(k+131072);var Lt=k+F;if(k<X){var fe=p-X,ge=Math.min(X,Lt);for(fe+k<0&&_t(3);k<ge;++k)s[k]=h[fe+k]}for(;k<Lt;++k)s[k]=s[k-X]}}r.l=S,r.p=nt,r.b=k,r.f=y,S&&(y=1,r.m=M,r.d=w,r.n=z)}while(!y);return k!=s.length&&u?La(s,0,k):s.subarray(0,k)},Ta=new yt(0),za=function(o){(o[0]!=31||o[1]!=139||o[2]!=8)&&_t(6,"invalid gzip data");var r=o[3],s=10;r&4&&(s+=(o[10]|o[11]<<8)+2);for(var h=(r>>3&1)+(r>>4&1);h>0;h-=!o[s++]);return s+(r&2)},Ca=function(o){var r=o.length;return(o[r-4]|o[r-3]<<8|o[r-2]<<16|o[r-1]<<24)>>>0},Ea=function(o,r){return((o[0]&15)!=8||o[0]>>4>7||(o[0]<<8|o[1])%31)&&_t(6,"invalid zlib data"),(o[1]>>5&1)==+!r&&_t(6,"invalid zlib data: "+(o[1]&32?"need":"unexpected")+" dictionary"),(o[1]>>3&4)+2};function Za(o,r){return Ni(o,{i:2},r&&r.out,r&&r.dictionary)}function Ia(o,r){var s=za(o);return s+8>o.length&&_t(6,"invalid gzip data"),Ni(o.subarray(s,-8),{i:2},r&&r.out||new yt(Ca(o)),r&&r.dictionary)}function Sa(o,r){return Ni(o.subarray(Ea(o,r&&r.dictionary),-4),{i:2},r&&r.out,r&&r.dictionary)}function Aa(o,r){return o[0]==31&&o[1]==139&&o[2]==8?Ia(o,r):(o[0]&15)!=8||o[0]>>4>7||(o[0]<<8|o[1])%31?Za(o,r):Sa(o,r)}var Oa=typeof TextDecoder<"u"&&new TextDecoder,Ba=0;try{Oa.decode(Ta,{stream:!0}),Ba=1}catch{}var Ra=Object.defineProperty,Da=Math.pow,K=(o,r)=>Ra(o,"name",{value:r,configurable:!0}),ct=(o,r,s)=>new Promise((h,c)=>{var p=v=>{try{_(s.next(v))}catch(x){c(x)}},u=v=>{try{_(s.throw(v))}catch(x){c(x)}},_=v=>v.done?h(v.value):Promise.resolve(v.value).then(p,u);_((s=s.apply(o,r)).next())}),Na=K((o,r)=>{let s=!1,h="",c=L.GridLayer.extend({createTile:K((p,u)=>{let _=document.createElement("img"),v=new AbortController,x=v.signal;return _.cancel=()=>{v.abort()},s||(o.getHeader().then(y=>{y.tileType===1?console.error("Error: archive contains MVT vector tiles, but leafletRasterLayer is for displaying raster tiles. See https://github.com/protomaps/PMTiles/tree/main/js for details."):y.tileType===2?h="image/png":y.tileType===3?h="image/jpeg":y.tileType===4?h="image/webp":y.tileType===5&&(h="image/avif")}),s=!0),o.getZxy(p.z,p.x,p.y,x).then(y=>{if(y){let g=new Blob([y.data],{type:h}),k=window.URL.createObjectURL(g);_.src=k}else _.style.display="none";_.cancel=void 0,u(void 0,_)}).catch(y=>{if(y.name!=="AbortError")throw y}),_},"createTile"),_removeTile:K(function(p){let u=this._tiles[p];u&&(u.el.cancel&&u.el.cancel(),u.el.width=0,u.el.height=0,u.el.deleted=!0,L.DomUtil.remove(u.el),delete this._tiles[p],this.fire("tileunload",{tile:u.el,coords:this._keyToTileCoords(p)}))},"_removeTile")});return new c(r)},"leafletRasterLayer"),ja=K(o=>(r,s)=>{if(s instanceof AbortController)return o(r,s);let h=new AbortController;return o(r,h).then(c=>s(void 0,c.data,c.cacheControl||"",c.expires||""),c=>s(c)).catch(c=>s(c)),{cancel:K(()=>h.abort(),"cancel")}},"v3compat"),Ha=class{constructor(o){this.tilev4=K((r,s)=>ct(this,null,function*(){if(r.type==="json"){let k=r.url.substr(10),S=this.tiles.get(k);if(S||(S=new Ri(k),this.tiles.set(k,S)),this.metadata){let M=yield S.getTileJson(r.url);return s.signal.throwIfAborted(),{data:M}}let w=yield S.getHeader();return s.signal.throwIfAborted(),(w.minLon>=w.maxLon||w.minLat>=w.maxLat)&&console.error(`Bounds of PMTiles archive ${w.minLon},${w.minLat},${w.maxLon},${w.maxLat} are not valid.`),{data:{tiles:[`${r.url}/{z}/{x}/{y}`],minzoom:w.minZoom,maxzoom:w.maxZoom,bounds:[w.minLon,w.minLat,w.maxLon,w.maxLat]}}}let h=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),c=r.url.match(h);if(!c)throw new Error("Invalid PMTiles protocol URL");let p=c[1],u=this.tiles.get(p);u||(u=new Ri(p),this.tiles.set(p,u));let _=c[2],v=c[3],x=c[4],y=yield u.getHeader(),g=yield u?.getZxy(+_,+v,+x,s.signal);if(s.signal.throwIfAborted(),g)return{data:new Uint8Array(g.data),cacheControl:g.cacheControl,expires:g.expires};if(y.tileType===1){if(this.errorOnMissingTile)throw new Error("Tile not found.");return{data:new Uint8Array}}return{data:null}}),"tilev4"),this.tile=ja(this.tilev4),this.tiles=new Map,this.metadata=o?.metadata||!1,this.errorOnMissingTile=o?.errorOnMissingTile||!1}add(o){this.tiles.set(o.source.getKey(),o)}get(o){return this.tiles.get(o)}};K(Ha,"Protocol");function bn(o,r){return(r>>>0)*4294967296+(o>>>0)}K(bn,"toNum");function xn(o,r){let s=r.buf,h=s[r.pos++],c=(h&112)>>4;if(h<128||(h=s[r.pos++],c|=(h&127)<<3,h<128)||(h=s[r.pos++],c|=(h&127)<<10,h<128)||(h=s[r.pos++],c|=(h&127)<<17,h<128)||(h=s[r.pos++],c|=(h&127)<<24,h<128)||(h=s[r.pos++],c|=(h&1)<<31,h<128))return bn(o,c);throw new Error("Expected varint not more than 10 bytes")}K(xn,"readVarintRemainder");function pe(o){let r=o.buf,s=r[o.pos++],h=s&127;return s<128||(s=r[o.pos++],h|=(s&127)<<7,s<128)||(s=r[o.pos++],h|=(s&127)<<14,s<128)||(s=r[o.pos++],h|=(s&127)<<21,s<128)?h:(s=r[o.pos],h|=(s&15)<<28,xn(h,o))}K(pe,"readVarint");function ji(o,r,s,h,c){return c===0?h!==0?[o-1-s,o-1-r]:[s,r]:[r,s]}K(ji,"rotate");function wn(o,r,s){if(o>26)throw new Error("Tile zoom level exceeds max safe number limit (26)");if(r>=1<<o||s>=1<<o)throw new Error("tile x/y outside zoom level bounds");let h=((1<<o)*(1<<o)-1)/3,c=o-1,[p,u]=[r,s];for(let _=1<<c;_>0;_>>=1){let v=p&_,x=u&_;h+=(3*v^x)*(1<<c),[p,u]=ji(_,p,u,v,x),c--}return h}K(wn,"zxyToTileId");function kn(o){let r=3*o+1;return r<4294967296?31-Math.clz32(r):63-Math.clz32(r/4294967296)}K(kn,"tileIdToZ");function Ua(o){let r=kn(o)>>1;if(r>26)throw new Error("Tile zoom level exceeds max safe number limit (26)");let s=((1<<r)*(1<<r)-1)/3,h=o-s,c=0,p=0,u=1<<r;for(let _=1;_<u;_<<=1){let v=_&h/2,x=_&(h^v);[c,p]=ji(_,c,p,v,x),h=h/2,c+=v,p+=x}return[r,c,p]}K(Ua,"tileIdToZxy");var Wa=(o=>(o[o.Unknown=0]="Unknown",o[o.None=1]="None",o[o.Gzip=2]="Gzip",o[o.Brotli=3]="Brotli",o[o.Zstd=4]="Zstd",o))(Wa||{});function Je(o,r){return ct(this,null,function*(){if(r===1||r===0)return o;if(r===2){if(typeof globalThis.DecompressionStream>"u")return Aa(new Uint8Array(o));let s=new Response(o).body;if(!s)throw new Error("Failed to read response stream");let h=s.pipeThrough(new globalThis.DecompressionStream("gzip"));return new Response(h).arrayBuffer()}throw new Error("Compression method not supported")})}K(Je,"defaultDecompress");var Va=(o=>(o[o.Unknown=0]="Unknown",o[o.Mvt=1]="Mvt",o[o.Png=2]="Png",o[o.Jpeg=3]="Jpeg",o[o.Webp=4]="Webp",o[o.Avif=5]="Avif",o[o.Mlt=6]="Mlt",o))(Va||{});function Mn(o){return o===1?".mvt":o===2?".png":o===3?".jpg":o===4?".webp":o===5?".avif":o===6?".mlt":""}K(Mn,"tileTypeExt");var Fa=127;function Ln(o,r){let s=0,h=o.length-1;for(;s<=h;){let c=h+s>>1,p=r-o[c].tileId;if(p>0)s=c+1;else if(p<0)h=c-1;else return o[c]}return h>=0&&(o[h].runLength===0||r-o[h].tileId<o[h].runLength)?o[h]:null}K(Ln,"findTile");var qa=class{constructor(o){this.file=o}getKey(){return this.file.name}getBytes(o,r){return ct(this,null,function*(){return{data:yield this.file.slice(o,o+r).arrayBuffer()}})}};K(qa,"FileSource");var Pn=class{constructor(o,r=new Headers){var s,h;this.url=o,this.customHeaders=r,this.mustReload=!1;let c="";"navigator"in globalThis&&(c=(h=(s=globalThis.navigator)==null?void 0:s.userAgent)!=null?h:"");let p=c.indexOf("Windows")>-1,u=/Chrome|Chromium|Edg|OPR|Brave/.test(c);this.chromeWindowsNoCache=!1,p&&u&&(this.chromeWindowsNoCache=!0)}getKey(){return this.url}setHeaders(o){this.customHeaders=o}getBytes(o,r,s,h){return ct(this,null,function*(){let c,p;s?p=s:(c=new AbortController,p=c.signal);let u=new Headers(this.customHeaders);u.set("range",`bytes=${o}-${o+r-1}`);let _;this.mustReload?_="reload":this.chromeWindowsNoCache&&(_="no-store");let v=yield fetch(this.url,{signal:p,cache:_,headers:u});if(o===0&&v.status===416){let g=v.headers.get("Content-Range");if(!g||!g.startsWith("bytes */"))throw new Error("Missing content-length on 416 response");let k=+g.substr(8);v=yield fetch(this.url,{signal:p,cache:"reload",headers:{range:`bytes=0-${k-1}`}})}let x=v.headers.get("Etag");if(x!=null&&x.startsWith("W/")&&(x=null),v.status===416||h&&x&&x!==h)throw this.mustReload=!0,new Bi(`Server returned non-matching ETag ${h} after one retry. Check browser extensions and servers for issues that may affect correct ETag headers.`);if(v.status>=300)throw new Error(`Bad response code: ${v.status}`);let y=v.headers.get("Content-Length");if(v.status===200&&(!y||+y>r))throw c&&c.abort(),new Error("Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.");return{data:yield v.arrayBuffer(),etag:x||void 0,cacheControl:v.headers.get("Cache-Control")||void 0,expires:v.headers.get("Expires")||void 0}})}};K(Pn,"FetchSource");var Ga=Pn;function Mt(o,r){let s=o.getUint32(r+4,!0),h=o.getUint32(r+0,!0);return s*Da(2,32)+h}K(Mt,"getUint64");function Tn(o,r){let s=new DataView(o),h=s.getUint8(7);if(h>3)throw new Error(`Archive is spec version ${h} but this library supports up to spec version 3`);return{specVersion:h,rootDirectoryOffset:Mt(s,8),rootDirectoryLength:Mt(s,16),jsonMetadataOffset:Mt(s,24),jsonMetadataLength:Mt(s,32),leafDirectoryOffset:Mt(s,40),leafDirectoryLength:Mt(s,48),tileDataOffset:Mt(s,56),tileDataLength:Mt(s,64),numAddressedTiles:Mt(s,72),numTileEntries:Mt(s,80),numTileContents:Mt(s,88),clustered:s.getUint8(96)===1,internalCompression:s.getUint8(97),tileCompression:s.getUint8(98),tileType:s.getUint8(99),minZoom:s.getUint8(100),maxZoom:s.getUint8(101),minLon:s.getInt32(102,!0)/1e7,minLat:s.getInt32(106,!0)/1e7,maxLon:s.getInt32(110,!0)/1e7,maxLat:s.getInt32(114,!0)/1e7,centerZoom:s.getUint8(118),centerLon:s.getInt32(119,!0)/1e7,centerLat:s.getInt32(123,!0)/1e7,etag:r}}K(Tn,"bytesToHeader");function Hi(o){let r={buf:new Uint8Array(o),pos:0},s=pe(r),h=[],c=0;for(let p=0;p<s;p++){let u=pe(r);h.push({tileId:c+u,offset:0,length:0,runLength:1}),c+=u}for(let p=0;p<s;p++)h[p].runLength=pe(r);for(let p=0;p<s;p++)h[p].length=pe(r);for(let p=0;p<s;p++){let u=pe(r);u===0&&p>0?h[p].offset=h[p-1].offset+h[p-1].length:h[p].offset=u-1}return h}K(Hi,"deserializeIndex");var zn=class extends Error{};K(zn,"EtagMismatch");var Bi=zn;function Ui(o,r){return ct(this,null,function*(){let s=yield o.getBytes(0,16384);if(new DataView(s.data).getUint16(0,!0)!==19792)throw new Error("Wrong magic number for PMTiles archive");let h=s.data.slice(0,Fa),c=Tn(h,s.etag),p=s.data.slice(c.rootDirectoryOffset,c.rootDirectoryOffset+c.rootDirectoryLength),u=`${o.getKey()}|${c.etag||""}|${c.rootDirectoryOffset}|${c.rootDirectoryLength}`,_=Hi(yield r(p,c.internalCompression));return[c,[u,_.length,_]]})}K(Ui,"getHeaderAndRoot");function Wi(o,r,s,h,c){return ct(this,null,function*(){let p=yield o.getBytes(s,h,void 0,c.etag),u=yield r(p.data,c.internalCompression),_=Hi(u);if(_.length===0)throw new Error("Empty directory is invalid");return _})}K(Wi,"getDirectory");var Ka=class{constructor(o=100,r=!0,s=Je){this.cache=new Map,this.maxCacheEntries=o,this.counter=1,this.decompress=s}getHeader(o){return ct(this,null,function*(){let r=o.getKey(),s=this.cache.get(r);if(s)return s.lastUsed=this.counter++,s.data;let h=yield Ui(o,this.decompress);return h[1]&&this.cache.set(h[1][0],{lastUsed:this.counter++,data:h[1][2]}),this.cache.set(r,{lastUsed:this.counter++,data:h[0]}),this.prune(),h[0]})}getDirectory(o,r,s,h){return ct(this,null,function*(){let c=`${o.getKey()}|${h.etag||""}|${r}|${s}`,p=this.cache.get(c);if(p)return p.lastUsed=this.counter++,p.data;let u=yield Wi(o,this.decompress,r,s,h);return this.cache.set(c,{lastUsed:this.counter++,data:u}),this.prune(),u})}prune(){if(this.cache.size>this.maxCacheEntries){let o=1/0,r;this.cache.forEach((s,h)=>{s.lastUsed<o&&(o=s.lastUsed,r=h)}),r&&this.cache.delete(r)}}invalidate(o){return ct(this,null,function*(){this.cache.delete(o.getKey())})}};K(Ka,"ResolvedValueCache");var Cn=class{constructor(o=100,r=!0,s=Je){this.cache=new Map,this.invalidations=new Map,this.maxCacheEntries=o,this.counter=1,this.decompress=s}getHeader(o){return ct(this,null,function*(){let r=o.getKey(),s=this.cache.get(r);if(s)return s.lastUsed=this.counter++,yield s.data;let h=new Promise((c,p)=>{Ui(o,this.decompress).then(u=>{u[1]&&this.cache.set(u[1][0],{lastUsed:this.counter++,data:Promise.resolve(u[1][2])}),c(u[0]),this.prune()}).catch(u=>{p(u)})});return this.cache.set(r,{lastUsed:this.counter++,data:h}),h})}getDirectory(o,r,s,h){return ct(this,null,function*(){let c=`${o.getKey()}|${h.etag||""}|${r}|${s}`,p=this.cache.get(c);if(p)return p.lastUsed=this.counter++,yield p.data;let u=new Promise((_,v)=>{Wi(o,this.decompress,r,s,h).then(x=>{_(x),this.prune()}).catch(x=>{v(x)})});return this.cache.set(c,{lastUsed:this.counter++,data:u}),u})}prune(){if(this.cache.size>=this.maxCacheEntries){let o=1/0,r;this.cache.forEach((s,h)=>{s.lastUsed<o&&(o=s.lastUsed,r=h)}),r&&this.cache.delete(r)}}invalidate(o){return ct(this,null,function*(){let r=o.getKey();if(this.invalidations.get(r))return yield this.invalidations.get(r);this.cache.delete(o.getKey());let s=new Promise((h,c)=>{this.getHeader(o).then(p=>{h(),this.invalidations.delete(r)}).catch(p=>{c(p)})});this.invalidations.set(r,s)})}};K(Cn,"SharedPromiseCache");var Ya=Cn,En=class{constructor(o,r,s){typeof o=="string"?this.source=new Ga(o):this.source=o,s?this.decompress=s:this.decompress=Je,r?this.cache=r:this.cache=new Ya}getHeader(){return ct(this,null,function*(){return yield this.cache.getHeader(this.source)})}getZxyAttempt(o,r,s,h){return ct(this,null,function*(){let c=wn(o,r,s),p=yield this.cache.getHeader(this.source);if(o<p.minZoom||o>p.maxZoom)return;let u=p.rootDirectoryOffset,_=p.rootDirectoryLength;for(let v=0;v<=3;v++){let x=yield this.cache.getDirectory(this.source,u,_,p),y=Ln(x,c);if(y){if(y.runLength>0){let g=yield this.source.getBytes(p.tileDataOffset+y.offset,y.length,h,p.etag);return{data:yield this.decompress(g.data,p.tileCompression),cacheControl:g.cacheControl,expires:g.expires}}u=p.leafDirectoryOffset+y.offset,_=y.length}else return}throw new Error("Maximum directory depth exceeded")})}getZxy(o,r,s,h){return ct(this,null,function*(){try{return yield this.getZxyAttempt(o,r,s,h)}catch(c){if(c instanceof Bi)return this.cache.invalidate(this.source),yield this.getZxyAttempt(o,r,s,h);throw c}})}getMetadataAttempt(){return ct(this,null,function*(){let o=yield this.cache.getHeader(this.source),r=yield this.source.getBytes(o.jsonMetadataOffset,o.jsonMetadataLength,void 0,o.etag),s=yield this.decompress(r.data,o.internalCompression),h=new TextDecoder("utf-8");return JSON.parse(h.decode(s))})}getMetadata(){return ct(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(o){if(o instanceof Bi)return this.cache.invalidate(this.source),yield this.getMetadataAttempt();throw o}})}getTileJson(o){return ct(this,null,function*(){let r=yield this.getHeader(),s=yield this.getMetadata(),h=Mn(r.tileType);return{tilejson:"3.0.0",scheme:"xyz",tiles:[`${o}/{z}/{x}/{y}${h}`],vector_layers:s.vector_layers,attribution:s.attribution,description:s.description,name:s.name,version:s.version,bounds:[r.minLon,r.minLat,r.maxLon,r.maxLat],center:[r.centerLon,r.centerLat,r.centerZoom],minzoom:r.minZoom,maxzoom:r.maxZoom}})}};K(En,"PMTiles");var Ri=En,Qe={TEMP:"temp",DRAFTS:"drafts",ORIGINALS:"originals",PROCESSED:"processed"},$a=5,qt={WIDTH:30,HEIGHT:40,ANCHOR_X:16,ANCHOR_Y:36};function nn(o,r,s){if(o<=0||r<=0||s<0)return 0;let h=o*Math.pow(2,s);return Math.ceil(h/r)}function Xa(o,r,s,h){return{tileX:nn(o,s,h),tileY:nn(r,s,h)}}function rn(o){return`${Qe.PROCESSED}/${o}/preview/preview.webp`}function an(o){return`${Qe.PROCESSED}/${o}/preview/thumbnail.webp`}function sn(o){return`${Qe.PROCESSED}/${o}/annotated/preview/preview.webp`}function ln(o){return`${Qe.PROCESSED}/${o}/annotated/preview/thumbnail.webp`}function Ja(o,r,s,h){return o.replace("{z}",String(r)).replace("{x}",String(s)).replace("{y}",String(h))}function Qa(o,r){return[[0,0],[r,o]]}function Zn(o){return o.includes("{z}")&&o.includes("{x}")&&o.includes("{y}")}function ts(o){return o.endsWith(".pmtiles")}var es=class{config;tileLayer=null;constructor(o){if(!o)throw new Error("Tile configuration is required");if(!o.imageInfo)throw new Error("Image info is required");if(!o.tileUrl&&!o.pmtilesUrl)throw new Error("Either tileUrl or pmtilesUrl is required");if(o.tileUrl&&!Zn(o.tileUrl))throw new Error("Tile URL template must contain {z}, {x}, and {y} placeholders");if(o.pmtilesUrl&&!ts(o.pmtilesUrl))throw new Error("PMTiles URL must end with .pmtiles");this.config=o}createTileLayer(o){if(this.tileLayer)return console.warn("Tile layer already created. Use removeTileLayer() first."),this.tileLayer;try{let{imageInfo:r,keepBuffer:s,updateInterval:h}=this.config,c=this.calculateTileBounds(),p={minZoom:r.minZoom,maxZoom:r.maxZoom,maxNativeZoom:r.maxZoom,tileSize:r.tileSize,bounds:c,noWrap:!0,keepBuffer:s??4,updateWhenIdle:!1,updateWhenZooming:!0,updateInterval:h??50,opacity:1,className:"seamless-tiles"};if(this.config.pmtilesUrl){let u=new Ri(this.config.pmtilesUrl);if(r.minZoom===0){let _=u.getZxy.bind(u);u.getZxy=(v,x,y,g)=>_(v+1,x,y,g)}this.tileLayer=Na(u,p)}else{let u=this.config.tileUrl;if(!u)throw new Error("Tile URL is required in XYZ mode");this.tileLayer=vt.tileLayer(u,p)}return o&&this.setupEventListeners(o),console.log("TileLayerManager: Tile layer created successfully",{bounds:c,tileSize:r.tileSize,zoomRange:[r.minZoom,r.maxZoom]}),this.tileLayer}catch(r){let s=r instanceof Error?r.message:"Unknown error";throw new Error(`Failed to create tile layer: ${s}`)}}calculateTileBounds(){let{width:o,height:r}=this.config.imageInfo;return Qa(o,r)}calculateGridSize(o){let{width:r,height:s,tileSize:h}=this.config.imageInfo;return Xa(r,s,h,o)}getTileUrl(o,r,s){if(!this.config.tileUrl)throw new Error("getTileUrl is only supported in XYZ mode");return Ja(this.config.tileUrl,o,r,s)}getTileLayer(){return this.tileLayer}removeTileLayer(o){this.tileLayer&&(o&&o.removeLayer(this.tileLayer),this.tileLayer=null,console.log("TileLayerManager: Tile layer removed"))}setupEventListeners(o){this.tileLayer&&(this.tileLayer.on("tileloadstart",r=>{console.debug("Tile loading started",{url:r.tile.src})}),this.tileLayer.on("tileload",()=>{console.debug("Tile loaded successfully")}),this.tileLayer.on("tileerror",r=>{console.warn("Tile loading error",{url:r.tile.src,error:r.error})}))}getImageInfo(){return this.config.imageInfo}getConfig(){return this.config}},is=class{imageInfo;constructor(o){if(!o)throw new Error("Image info is required");if(o.width<=0||o.height<=0)throw new Error("Image width and height must be greater than 0");if(o.tileSize<=0)throw new Error("Tile size must be greater than 0");this.imageInfo=o}calculateImagePosition(){let o=this.imageInfo.tileSize||256,r=(this.imageInfo.minZoom||0)===0?o*2:o,s=r,h=r,c=this.imageInfo.width/this.imageInfo.height,p=s/h,u,_,v,x;return c>p?(u=s,_=s/c,v=0,x=(h-_)/2):(u=h*c,_=h,v=(s-u)/2,x=0),{imageRenderWidth:u,imageRenderHeight:_,imageOffsetX:v,imageOffsetY:x,canvasWidth:s,canvasHeight:h}}leafletToImage(o){this.validateLeafletCoords(o);let{imageRenderWidth:r,imageRenderHeight:s,imageOffsetX:h,imageOffsetY:c}=this.calculateImagePosition(),p=o[1],u=o[0],_=(p-h)/r,v=(u-c)/s,x=_*this.imageInfo.width,y=v*this.imageInfo.height,g=_>=0&&_<=1&&v>=0&&v<=1;return{x,y,withinBounds:g}}imageToLeaflet(o){this.validateImageCoords(o);let{imageRenderWidth:r,imageRenderHeight:s,imageOffsetX:h,imageOffsetY:c}=this.calculateImagePosition(),p=o.x/this.imageInfo.width,u=o.y/this.imageInfo.height,_=p*r+h;return[u*s+c,_]}getImageCenter(){let{imageRenderWidth:o,imageRenderHeight:r,imageOffsetX:s,imageOffsetY:h}=this.calculateImagePosition(),c=s+o/2,p=h+r/2;return{x:c,y:p}}calculateMapBounds(){let o=this.imageInfo.tileSize||256,r=(this.imageInfo.minZoom||0)===0?o*2:o;return vt.latLngBounds([0,0],[r,r])}validateLeafletCoords(o){if(!Array.isArray(o)||o.length!==2)throw new Error("Leaflet coordinates must be an array of 2 numbers [y, x]");let[r,s]=o;if(typeof r!="number"||typeof s!="number")throw new Error("Leaflet coordinates must be numbers");if(isNaN(r)||isNaN(s)||!isFinite(r)||!isFinite(s))throw new Error("Leaflet coordinates must be finite numbers")}validateImageCoords(o){if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Image coordinates must be an object with x and y properties");let{x:r,y:s}=o;if(typeof r!="number"||typeof s!="number")throw new Error("Image coordinates x and y must be numbers");if(isNaN(r)||isNaN(s)||!isFinite(r)||!isFinite(s))throw new Error("Image coordinates must be finite numbers");if(r<0||r>this.imageInfo.width)throw new Error(`Image x coordinate (${r}) is out of bounds [0, ${this.imageInfo.width}]`);if(s<0||s>this.imageInfo.height)throw new Error(`Image y coordinate (${s}) is out of bounds [0, ${this.imageInfo.height}]`)}createCustomCRS(){return vt.extend({},vt.CRS.Simple,{transformation:new vt.Transformation(1,0,1,0)})}getAspectRatio(){return this.imageInfo.width/this.imageInfo.height}getBounds(){return{minX:0,maxX:this.imageInfo.width,minY:0,maxY:this.imageInfo.height}}getImageInfo(){return{...this.imageInfo}}isWithinBounds(o){try{return this.validateImageCoords(o),!0}catch{return!1}}clampToBounds(o){return{x:Math.max(0,Math.min(this.imageInfo.width,o.x)),y:Math.max(0,Math.min(this.imageInfo.height,o.y))}}calculateCenterOffset(o,r,s){if(this.validateImageCoords(o),r<=0||s<=0)throw new Error("Container width and height must be greater than 0");return{x:o.x-r/2,y:o.y-s/2}}},os=class{map;imageInfo;config;zoomState;zoomChangeListeners=new Set;constructor(o){if(!o.map)throw new Error("Leaflet map instance is required");if(!o.imageInfo)throw new Error("Image info is required");if(o.imageInfo.width<=0||o.imageInfo.height<=0)throw new Error("Image width and height must be greater than 0");this.map=o.map,this.imageInfo=o.imageInfo;let r=this.calculateMaxZoomFromDimensions(),s=o.config?.minZoom??o.imageInfo.minZoom??0,h=o.config?.maxZoom??o.imageInfo.maxZoom??r;if(s<0)throw new Error("Minimum zoom must be >= 0");if(h<s)throw new Error("Maximum zoom must be >= minimum zoom");this.config={minZoom:s,maxZoom:h,initialZoom:o.config?.initialZoom,zoomSnap:o.config?.zoomSnap??1,zoomDelta:o.config?.zoomDelta??1};let c=this.map.getZoom();this.zoomState={currentZoom:this.constrainZoom(c),minZoom:this.config.minZoom,maxZoom:this.config.maxZoom},this.setupZoomListeners()}calculateMaxZoomFromDimensions(){let{width:o,height:r,tileSize:s=256}=this.imageInfo,h=Math.max(o,r),c=Math.floor(Math.log2(h/s)),p=Math.floor(Math.log2(16383/s))-1,u=Math.min(c,p,$a);return Math.max(0,u)}calculateOptimalInitialZoom(){if(typeof window>"u")return this.config.minZoom;let o=window.innerWidth,r;return o<=768?r=this.config.minZoom:r=Math.min(this.config.minZoom+1,this.config.maxZoom),this.constrainZoom(r)}constrainZoom(o){return Math.max(this.config.minZoom,Math.min(this.config.maxZoom,Math.round(o)))}isValidZoom(o){return Number.isInteger(o)&&o>=this.config.minZoom&&o<=this.config.maxZoom}zoomIn(o){let r=this.map.getZoom(),s=this.config.zoomDelta??1,h=this.constrainZoom(r+s);return h===r?!1:(this.setZoom(h,o),!0)}zoomOut(o){let r=this.map.getZoom(),s=this.config.zoomDelta??1,h=this.constrainZoom(r-s);return h===r?!1:(this.setZoom(h,o),!0)}setZoom(o,r){if(!Number.isFinite(o))throw new Error(`Invalid zoom level: ${o}. Must be a finite number between ${this.config.minZoom} and ${this.config.maxZoom}`);let s=this.constrainZoom(o),h=r?.animate!==!1;this.map.setZoom(s,{animate:h})}getZoomState(){return{...this.zoomState}}getZoom(){return this.map.getZoom()}getMinZoom(){return this.config.minZoom}getMaxZoom(){return this.config.maxZoom}canZoomIn(){return this.map.getZoom()<this.config.maxZoom}canZoomOut(){return this.map.getZoom()>this.config.minZoom}onZoomChange(o){return this.zoomChangeListeners.add(o),()=>{this.zoomChangeListeners.delete(o)}}removeAllListeners(){this.zoomChangeListeners.clear()}setupZoomListeners(){let o=()=>{let r=this.map.getZoom(),s=this.constrainZoom(r);if(r!==s){this.map.setView(this.map.getCenter(),s,{animate:!1});return}this.zoomState={currentZoom:s,minZoom:this.config.minZoom,maxZoom:this.config.maxZoom},this.zoomChangeListeners.forEach(h=>{h(this.zoomState)})};this.map.on("zoomend",o),this.map.on("zoom",o),o()}dispose(){this.removeAllListeners()}},Gt=null;function ns(o){Gt&&Gt.parentElement&&(Gt.parentElement.removeChild(Gt),Gt=null);let{marker:r,onSave:s,onCancel:h}=o,c=z=>z?z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):"",p=document.createElement("div");p.className="edgepdf-marker-edit-popup",p.innerHTML=`
|
|
4
4
|
<div class="edgepdf-marker-edit-popup-overlay"></div>
|
|
5
5
|
<div class="edgepdf-marker-edit-popup-content">
|
|
6
6
|
<div class="edgepdf-marker-edit-popup-header">
|
|
@@ -261,17 +261,7 @@ import{useEffect as bt,useRef as te}from"react";var sa=`@import"https://fonts.go
|
|
|
261
261
|
height: 40px;
|
|
262
262
|
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
263
263
|
transition: all 0.2s ease;
|
|
264
|
-
`,g.addEventListener("mouseenter",()=>{g.style.backgroundColor="#ffaa01",g.style.transform="scale(1.05)"}),g.addEventListener("mouseleave",()=>{g.style.backgroundColor="#ffaa01",g.style.transform="scale(1)"}),g.addEventListener("click",S=>{S.stopPropagation(),r.zoomOut(),k()});let k=()=>{let S=r.canZoomIn(),w=r.canZoomOut();y.disabled=!S,g.disabled=!w,S?(y.style.opacity="1",y.style.cursor="pointer"):(y.style.opacity="0.5",y.style.cursor="not-allowed"),w?(g.style.opacity="1",g.style.cursor="pointer"):(g.style.opacity="0.5",g.style.cursor="not-allowed")};return r.onZoomChange(()=>{k()}),x.appendChild(y),x.appendChild(g),o.appendChild(x),k(),x}var In=class{map=null;container;config;mapOptions;tileLayerManager=null;coordinateMapper=null;zoomController=null;markerManager=null;constructor(o){if(!o.container)throw new Error("Container element is required");if(!o.config)throw new Error("Viewer configuration is required");if(!o.config.tileUrl&&!o.config.pmtilesUrl)throw new Error("Either tileUrl or pmtilesUrl is required in configuration");if(!o.config.imageInfo)throw new Error("Image info is required in configuration");this.container=o.container,this.config=o.config,this.mapOptions=o.mapOptions}initialize(){if(this.map){console.warn("Map already initialized. Call dispose() before reinitializing.");return}try{this.coordinateMapper=new is(this.config.imageInfo);let o=this.coordinateMapper.createCustomCRS(),r=this.coordinateMapper.calculateMapBounds(),s=this.coordinateMapper.getImageCenter(),h=this.mapOptions?.center||[s.y,s.x],c=this.mapOptions?.zoom??this.calculateOptimalInitialZoom(),p={crs:o,center:h,zoom:c,minZoom:this.mapOptions?.minZoom??this.config.imageInfo.minZoom??0,maxZoom:this.mapOptions?.maxZoom??this.config.imageInfo.maxZoom??5,zoomControl:!1,attributionControl:!1,maxBounds:r,maxBoundsViscosity:1,zoomSnap:1,zoomDelta:1,wheelPxPerZoomLevel:60,...this.mapOptions};this.map=vt.map(this.container,p),!this.mapOptions?.center&&!this.mapOptions?.zoom&&this.map.setView([s.y,s.x],c),this.addTileLayer(),this.addSeamlessTileStyles(),this.zoomController=new os({map:this.map,imageInfo:this.config.imageInfo}),this.map.setMinZoom(this.zoomController.getMinZoom()),this.map.setMaxZoom(this.zoomController.getMaxZoom()),this.markerManager=new as({map:this.map,coordinateMapper:this.coordinateMapper,imageInfo:this.config.imageInfo}),ds(this.container,this.markerManager),Vi(this.container,this.zoomController),console.log("EdgePdfViewer initialized successfully",{bounds:r,center:[s.y,s.x],zoom:c,imageCenter:s})}catch(o){let r=o instanceof Error?o.message:"Unknown error";throw new Error(`Failed to initialize map: ${r}`)}}calculateOptimalInitialZoom(){let o=typeof window<"u"?window.innerWidth:1024,r=this.config.imageInfo.minZoom??0,s=this.config.imageInfo.maxZoom??5,h=r>=1?1:0,c;return o<=768?c=0+h:c=1+h,Math.max(r,Math.min(s,c))}addSeamlessTileStyles(){if(!(typeof document>"u")&&!document.getElementById("seamless-tiles-css")){let o=document.createElement("style");o.id="seamless-tiles-css",o.textContent=`
|
|
265
|
-
.seamless-tiles img, .leaflet-tile {
|
|
266
|
-
border: none !important;
|
|
267
|
-
outline: none !important;
|
|
268
|
-
margin: 0 !important;
|
|
269
|
-
padding: 0 !important;
|
|
270
|
-
}
|
|
271
|
-
.leaflet-layer {
|
|
272
|
-
border: none !important;
|
|
273
|
-
}
|
|
274
|
-
`,document.head.appendChild(o)}}getMap(){return this.map}isInitialized(){return this.map!==null}addTileLayer(){if(!this.map)throw new Error("Map must be initialized before adding tile layer");try{this.tileLayerManager=new es({tileUrl:this.config.tileUrl,pmtilesUrl:this.config.pmtilesUrl,imageInfo:this.config.imageInfo}),this.tileLayerManager.createTileLayer(this.map).addTo(this.map),console.log("Tile layer added to map successfully")}catch(o){let r=o instanceof Error?o.message:"Unknown error";throw new Error(`Failed to add tile layer: ${r}`)}}getTileLayerManager(){return this.tileLayerManager}getCoordinateMapper(){return this.coordinateMapper}getZoomController(){return this.zoomController}getMarkerManager(){return this.markerManager}focusMarker(o,r){return this.markerManager?this.markerManager.focusMarker(o,r):(console.warn("Marker manager not available"),!1)}dispose(){this.markerManager&&(this.markerManager.dispose(),this.markerManager=null),this.zoomController&&(this.zoomController.dispose(),this.zoomController=null),this.tileLayerManager&&this.map&&(this.tileLayerManager.removeTileLayer(this.map),this.tileLayerManager=null),this.map&&(this.map.remove(),this.map=null,console.log("EdgePdfViewer disposed successfully"))}},us=class{baseUrl;constructor(o){this.baseUrl=o.replace(/\/$/,"")}getBaseUrl(){return this.baseUrl}buildUrl(o){let r=o.startsWith("/")?o:`/${o}`;return`${this.baseUrl}${r}`}getOriginPreviewPath(o){return rn(o)}getOriginPreviewUrl(o){return this.buildUrl(rn(o))}getOriginPreviewThumbnailPath(o){return an(o)}getOriginPreviewThumbnailUrl(o){return this.buildUrl(an(o))}getAnnotatedPreviewPath(o){return sn(o)}getAnnotatedPreviewUrl(o){return this.buildUrl(sn(o))}getAnnotatedThumbnailPath(o){return ln(o)}getAnnotatedThumbnailUrl(o){return this.buildUrl(ln(o))}isValidTileUrl(o){return Zn(o)}};import{createContext as ps,useCallback as ms,useContext as fs,useState as ti}from"react";import{jsx as _s}from"react/jsx-runtime";var Sn=ps(null);function gs({children:o}){let[r,s]=ti(null),[h,c]=ti(!1),[p,u]=ti([]),[_,v]=ti(null),x=ms(g=>{g.viewer!==void 0&&s(g.viewer),g.isInitialized!==void 0&&c(g.isInitialized),g.markers!==void 0&&u(g.markers),g.zoomState!==void 0&&v(g.zoomState)},[]),y={viewer:r,isInitialized:h,markers:p,zoomState:_,setContextValue:x};return _s(Sn.Provider,{value:y,children:o})}function Ct(){let o=fs(Sn);if(!o)throw new Error("useViewerContext must be used within ViewerProvider");return o}import{useEffect as vs,useRef as ys}from"react";function Fi({className:o,style:r,position:s="top-right",showZoomLevel:h=!0}){let{viewer:c,isInitialized:p}=Ct(),u=ys(null);return vs(()=>{if(!c||!p)return;let _=c.getMap(),v=c.getZoomController();if(!_||!v)return;let x=_.getContainer(),y=Vi(x,v,{position:s});return u.current=y,o&&(y.className=`${y.className} ${o}`),r&&Object.assign(y.style,r),()=>{u.current=null}},[c,p,o,r,s]),null}import{jsx as An,jsxs as xs}from"react/jsx-runtime";function bs({config:o,mapOptions:r,className:s,style:h,showZoomControls:c=!0,zoomControlsPosition:p="top-right",showZoomLevel:u=!0,enableAnnotation:_=!0,showEditButton:v=!0,showDeleteButton:x=!0,defaultZoomLevel:y,onPinsUpdate:g,onMarkerClick:k,onMarkerUpdate:S,onMarkerDelete:w,onMarkerAdd:M,defaultPins:z,children:ot}){let{setContextValue:J}=Ct(),tt=te(null),q=te(null),ut=te(g),ft=te(k),Et=te(S),st=te(w),Zt=te(M);bt(()=>{ut.current=g},[g]),bt(()=>{ft.current=k},[k]),bt(()=>{Et.current=S},[S]),bt(()=>{st.current=w},[w]),bt(()=>{Zt.current=M},[M]);let ee={...o,onPinsUpdate:void 0},lt=y?{...r,zoom:y}:r;return bt(()=>{if(!tt.current||q.current)return;let E=null;try{E=new In({container:tt.current,config:ee,mapOptions:lt}),E.initialize(),q.current=E,J({viewer:E,isInitialized:!0});let D=E.getMarkerManager();if(D){if(D.setIconBasePath("/"),D.setInteractionConfig({draggable:_,selectable:_,showTooltips:!0,showPopups:!0,multiSelect:_,showEditButton:_,showDeleteButton:_}),z)try{let Y=Array.isArray(z)?{markers:z,version:"1.0"}:z,X=D.importMarkers(Y,{clearExisting:!1,validateCoordinates:!0});!X.success&&X.errors.length>0&&console.warn("Some default pins failed to import:",X.errors)}catch(Y){console.error("Failed to import default pins:",Y)}let et=D.getAllMarkers();J({markers:et}),ut.current&&ut.current(et)}let H=E.getZoomController();if(H){let et=H.getZoomState();J({zoomState:et})}}catch(D){console.error("Failed to initialize viewer:",D)}return()=>{E&&(E.dispose(),E=null,q.current=null,J({viewer:null,isInitialized:!1,markers:[],zoomState:null}))}},[]),bt(()=>{if(!q.current)return;let E=q.current.getMarkerManager();E&&E.setInteractionConfig({draggable:_,selectable:_,showTooltips:!0,showPopups:!0,multiSelect:_,showEditButton:v&&_,showDeleteButton:x&&_})},[_,v,x,J]),bt(()=>{if(!q.current)return;let E=q.current.getMap();if(!E)return;let D=q.current.getMarkerManager();if(!D)return;let H=et=>{if(_)try{let Y=[et.latlng.lat,et.latlng.lng],X=D.createMarker({position:Y,label:`Marker ${D.getMarkerCount()+1}`}),Z=D.getAllMarkers();J({markers:Z}),Zt.current&&Zt.current(X),ut.current&&ut.current(Z)}catch(Y){let X=Y instanceof Error?Y.message:"Unknown error";console.error("Error creating marker on map click:",X)}};return E.on("click",H),()=>{E.off("click",H)}},[_,J]),bt(()=>{if(!q.current)return;let E=q.current.getMarkerManager();if(!E)return;let D=E.on("click",H=>{ft.current&&ft.current(H.marker)});return()=>{D()}},[J]),bt(()=>{if(!q.current)return;let E=q.current.getMarkerManager();if(!E)return;let D=E.on("edit",H=>{Et.current&&Et.current(H.marker)});return()=>{D()}},[J]),bt(()=>{if(!q.current)return;let E=q.current.getMarkerManager();if(!E)return;let D=E.on("delete",H=>{st.current&&st.current(H.marker)});return()=>{D()}},[J]),bt(()=>{if(!q.current)return;let E=q.current.getMarkerManager();if(!E)return;let D=[],H=(C,G)=>{if(C.length!==G.length)return!1;let nt=new Map(G.map(W=>[W.id,W]));for(let W of C){let F=nt.get(W.id);if(!F||W.x!==F.x||W.y!==F.y||W.position[0]!==F.position[0]||W.position[1]!==F.position[1]||W.iconType!==F.iconType)return!1}return!0},et=()=>{let C=E.getAllMarkers();H(C,D)||(J({markers:C}),ut.current&&ut.current(C),D=C)},Y=E.on("delete",et),X=E.on("dragend",et),Z=E.on("edit",et),Ut=setInterval(et,500);return()=>{Y(),X(),Z(),clearInterval(Ut)}},[J]),bt(()=>{if(!q.current)return;let E=q.current.getMap();if(!E)return;let D=()=>{let H=q.current?.getZoomController();if(H){let et=H.getZoomState();J({zoomState:et})}};return E.on("zoomend",D),()=>{E.off("zoomend",D)}},[J]),xs("div",{className:s,style:{width:"100%",height:"100%",position:"relative",...h},children:[An("div",{ref:tt,style:{width:"100%",height:"100%"}}),c&&An(Fi,{position:p,showZoomLevel:u}),ot]})}import{useCallback as On}from"react";function ws(){let{viewer:o,isInitialized:r}=Ct(),s=On(()=>o?.getMap()??null,[o]),h=On(()=>o?.isInitialized()??!1,[o]);return{viewer:o,isInitialized:r,getMap:s,checkInitialized:h}}import{useCallback as Ht,useEffect as Bn,useState as ks}from"react";function Ms(){let{viewer:o,isInitialized:r,markers:s}=Ct(),[h,c]=ks(s);Bn(()=>{c(s)},[s]),Bn(()=>{if(!o||!r)return;let w=o.getMarkerManager();if(w){let M=w.getAllMarkers();c(M)}},[o,r]);let p=Ht(w=>{if(!o||!r)return console.warn("Viewer not initialized"),null;let M=o.getMarkerManager();if(!M)return console.warn("Marker manager not available"),null;try{let z=M.createMarker(w),ot=M.getAllMarkers();return c(ot),z}catch(z){return console.error("Failed to add marker:",z),null}},[o,r]),u=Ht(w=>{if(!o||!r)return console.warn("Viewer not initialized"),!1;let M=o.getMarkerManager();if(!M)return console.warn("Marker manager not available"),!1;try{let z=M.removeMarker(w);if(z){let ot=M.getAllMarkers();c(ot)}return z}catch(z){return console.error("Failed to remove marker:",z),!1}},[o,r]),_=Ht((w,M)=>{if(!o||!r)return console.warn("Viewer not initialized"),!1;let z=o.getMarkerManager();if(!z)return console.warn("Marker manager not available"),!1;try{let ot=z.getMarker(w);if(!ot)return!1;let J={...ot,...M},tt=z.updateMarker(w,J);if(tt){let q=z.getAllMarkers();c(q)}return tt}catch(ot){return console.error("Failed to update marker:",ot),!1}},[o,r]),v=Ht(w=>{if(!o||!r)return null;let M=o.getMarkerManager();return M?M.getMarker(w):null},[o,r]),x=Ht(()=>h,[h]),y=Ht(()=>{if(!o||!r)return{markers:[],version:"1.0"};let w=o.getMarkerManager();if(!w)return{markers:[],version:"1.0"};try{return w.exportMarkers()}catch(M){return console.error("Failed to export markers:",M),{markers:[],version:"1.0"}}},[o,r]),g=Ht(w=>{if(!o||!r)return console.warn("Viewer not initialized"),!1;let M=o.getMarkerManager();if(!M)return console.warn("Marker manager not available"),!1;try{let z=M.importMarkers(w);if(z.success){let ot=M.getAllMarkers();c(ot)}return z.success}catch(z){return console.error("Failed to import markers:",z),!1}},[o,r]),k=Ht(()=>{if(!o||!r){console.warn("Viewer not initialized");return}let w=o.getMarkerManager();if(!w){console.warn("Marker manager not available");return}try{w.getAllMarkers().forEach(z=>{w.removeMarker(z.id)}),c([])}catch(M){console.error("Failed to clear markers:",M)}},[o,r]),S=Ht((w,M)=>{if(!o||!r)return console.warn("Viewer not initialized"),!1;try{return o.focusMarker(w,M)}catch(z){return console.error("Failed to focus marker:",z),!1}},[o,r]);return{markers:h,addMarker:p,removeMarker:u,updateMarker:_,getMarker:v,getAllMarkers:x,exportMarkers:y,importMarkers:g,clearMarkers:k,focusMarker:S}}import{useCallback as Ie,useEffect as qi,useState as Ls}from"react";function Ps(){let{viewer:o,isInitialized:r,zoomState:s}=Ct(),[h,c]=Ls(s);qi(()=>{c(s)},[s]),qi(()=>{if(!o||!r)return;let y=o.getZoomController();if(y){let g=y.getZoomState();c(g)}},[o,r]),qi(()=>{if(!o||!r)return;let y=o.getMap();if(!y)return;let g=()=>{let k=o.getZoomController();if(k){let S=k.getZoomState();c(S)}};return y.on("zoomend",g),()=>{y.off("zoomend",g)}},[o,r]);let p=Ie(()=>{if(!o||!r){console.warn("Viewer not initialized");return}let y=o.getZoomController();if(!y){console.warn("Zoom controller not available");return}try{y.zoomIn();let g=y.getZoomState();c(g)}catch(g){console.error("Failed to zoom in:",g)}},[o,r]),u=Ie(()=>{if(!o||!r){console.warn("Viewer not initialized");return}let y=o.getZoomController();if(!y){console.warn("Zoom controller not available");return}try{y.zoomOut();let g=y.getZoomState();c(g)}catch(g){console.error("Failed to zoom out:",g)}},[o,r]),_=Ie(y=>{if(!o||!r){console.warn("Viewer not initialized");return}let g=o.getZoomController();if(!g){console.warn("Zoom controller not available");return}try{g.setZoom(y);let k=g.getZoomState();c(k)}catch(k){console.error("Failed to set zoom:",k)}},[o,r]),v=Ie(()=>h?h.currentZoom<h.maxZoom:!1,[h]),x=Ie(()=>h?h.currentZoom>h.minZoom:!1,[h]);return{zoomState:h,currentZoom:h?.currentZoom??0,minZoom:h?.minZoom??0,maxZoom:h?.maxZoom??5,zoomIn:p,zoomOut:u,setZoom:_,canZoomIn:v,canZoomOut:x}}export{us as CDNManager,bs as EdgePDFViewer,gs as ViewerProvider,Fi as ZoomControls,Ms as useMarkers,ws as useViewer,Ct as useViewerContext,Ps as useZoom};
|
|
264
|
+
`,g.addEventListener("mouseenter",()=>{g.style.backgroundColor="#ffaa01",g.style.transform="scale(1.05)"}),g.addEventListener("mouseleave",()=>{g.style.backgroundColor="#ffaa01",g.style.transform="scale(1)"}),g.addEventListener("click",S=>{S.stopPropagation(),r.zoomOut(),k()});let k=()=>{let S=r.canZoomIn(),w=r.canZoomOut();y.disabled=!S,g.disabled=!w,S?(y.style.opacity="1",y.style.cursor="pointer"):(y.style.opacity="0.5",y.style.cursor="not-allowed"),w?(g.style.opacity="1",g.style.cursor="pointer"):(g.style.opacity="0.5",g.style.cursor="not-allowed")};return r.onZoomChange(()=>{k()}),x.appendChild(y),x.appendChild(g),o.appendChild(x),k(),x}var In=class{map=null;container;config;mapOptions;tileLayerManager=null;coordinateMapper=null;zoomController=null;markerManager=null;constructor(o){if(!o.container)throw new Error("Container element is required");if(!o.config)throw new Error("Viewer configuration is required");if(!o.config.tileUrl&&!o.config.pmtilesUrl)throw new Error("Either tileUrl or pmtilesUrl is required in configuration");if(!o.config.imageInfo)throw new Error("Image info is required in configuration");this.container=o.container,this.config=o.config,this.mapOptions=o.mapOptions}initialize(){if(this.map){console.warn("Map already initialized. Call dispose() before reinitializing.");return}try{this.coordinateMapper=new is(this.config.imageInfo);let o=this.coordinateMapper.createCustomCRS(),r=this.coordinateMapper.calculateMapBounds(),s=this.coordinateMapper.getImageCenter(),h=this.mapOptions?.center||[s.y,s.x],c=this.mapOptions?.zoom??this.calculateOptimalInitialZoom(),p={crs:o,center:h,zoom:c,minZoom:this.mapOptions?.minZoom??this.config.imageInfo.minZoom??0,maxZoom:this.mapOptions?.maxZoom??this.config.imageInfo.maxZoom??5,zoomControl:!1,attributionControl:!1,maxBounds:r,maxBoundsViscosity:1,zoomSnap:1,zoomDelta:1,wheelPxPerZoomLevel:60,...this.mapOptions};this.map=vt.map(this.container,p),!this.mapOptions?.center&&!this.mapOptions?.zoom&&this.map.setView([s.y,s.x],c),this.addTileLayer(),this.container.style.background="#ffffff",this.zoomController=new os({map:this.map,imageInfo:this.config.imageInfo}),this.map.setMinZoom(this.zoomController.getMinZoom()),this.map.setMaxZoom(this.zoomController.getMaxZoom()),this.markerManager=new as({map:this.map,coordinateMapper:this.coordinateMapper,imageInfo:this.config.imageInfo}),ds(this.container,this.markerManager),Vi(this.container,this.zoomController),console.log("EdgePdfViewer initialized successfully",{bounds:r,center:[s.y,s.x],zoom:c,imageCenter:s})}catch(o){let r=o instanceof Error?o.message:"Unknown error";throw new Error(`Failed to initialize map: ${r}`)}}calculateOptimalInitialZoom(){let o=typeof window<"u"?window.innerWidth:1024,r=this.config.imageInfo.minZoom??0,s=this.config.imageInfo.maxZoom??5,h=r>=1?1:0,c;return o<=768?c=0+h:c=1+h,Math.max(r,Math.min(s,c))}getMap(){return this.map}isInitialized(){return this.map!==null}addTileLayer(){if(!this.map)throw new Error("Map must be initialized before adding tile layer");try{this.tileLayerManager=new es({tileUrl:this.config.tileUrl,pmtilesUrl:this.config.pmtilesUrl,imageInfo:this.config.imageInfo}),this.tileLayerManager.createTileLayer(this.map).addTo(this.map),console.log("Tile layer added to map successfully")}catch(o){let r=o instanceof Error?o.message:"Unknown error";throw new Error(`Failed to add tile layer: ${r}`)}}getTileLayerManager(){return this.tileLayerManager}getCoordinateMapper(){return this.coordinateMapper}getZoomController(){return this.zoomController}getMarkerManager(){return this.markerManager}focusMarker(o,r){return this.markerManager?this.markerManager.focusMarker(o,r):(console.warn("Marker manager not available"),!1)}dispose(){this.markerManager&&(this.markerManager.dispose(),this.markerManager=null),this.zoomController&&(this.zoomController.dispose(),this.zoomController=null),this.tileLayerManager&&this.map&&(this.tileLayerManager.removeTileLayer(this.map),this.tileLayerManager=null),this.map&&(this.map.remove(),this.map=null,console.log("EdgePdfViewer disposed successfully"))}},us=class{baseUrl;constructor(o){this.baseUrl=o.replace(/\/$/,"")}getBaseUrl(){return this.baseUrl}buildUrl(o){let r=o.startsWith("/")?o:`/${o}`;return`${this.baseUrl}${r}`}getOriginPreviewPath(o){return rn(o)}getOriginPreviewUrl(o){return this.buildUrl(rn(o))}getOriginPreviewThumbnailPath(o){return an(o)}getOriginPreviewThumbnailUrl(o){return this.buildUrl(an(o))}getAnnotatedPreviewPath(o){return sn(o)}getAnnotatedPreviewUrl(o){return this.buildUrl(sn(o))}getAnnotatedThumbnailPath(o){return ln(o)}getAnnotatedThumbnailUrl(o){return this.buildUrl(ln(o))}isValidTileUrl(o){return Zn(o)}};import{createContext as ps,useCallback as ms,useContext as fs,useState as ti}from"react";import{jsx as _s}from"react/jsx-runtime";var Sn=ps(null);function gs({children:o}){let[r,s]=ti(null),[h,c]=ti(!1),[p,u]=ti([]),[_,v]=ti(null),x=ms(g=>{g.viewer!==void 0&&s(g.viewer),g.isInitialized!==void 0&&c(g.isInitialized),g.markers!==void 0&&u(g.markers),g.zoomState!==void 0&&v(g.zoomState)},[]),y={viewer:r,isInitialized:h,markers:p,zoomState:_,setContextValue:x};return _s(Sn.Provider,{value:y,children:o})}function Ct(){let o=fs(Sn);if(!o)throw new Error("useViewerContext must be used within ViewerProvider");return o}import{useEffect as vs,useRef as ys}from"react";function Fi({className:o,style:r,position:s="top-right",showZoomLevel:h=!0}){let{viewer:c,isInitialized:p}=Ct(),u=ys(null);return vs(()=>{if(!c||!p)return;let _=c.getMap(),v=c.getZoomController();if(!_||!v)return;let x=_.getContainer(),y=Vi(x,v,{position:s});return u.current=y,o&&(y.className=`${y.className} ${o}`),r&&Object.assign(y.style,r),()=>{u.current=null}},[c,p,o,r,s]),null}import{jsx as An,jsxs as xs}from"react/jsx-runtime";function bs({config:o,mapOptions:r,className:s,style:h,showZoomControls:c=!0,zoomControlsPosition:p="top-right",showZoomLevel:u=!0,enableAnnotation:_=!0,showEditButton:v=!0,showDeleteButton:x=!0,defaultZoomLevel:y,onPinsUpdate:g,onMarkerClick:k,onMarkerUpdate:S,onMarkerDelete:w,onMarkerAdd:M,defaultPins:z,children:ot}){let{setContextValue:J}=Ct(),tt=te(null),q=te(null),ut=te(g),ft=te(k),Et=te(S),st=te(w),Zt=te(M);bt(()=>{ut.current=g},[g]),bt(()=>{ft.current=k},[k]),bt(()=>{Et.current=S},[S]),bt(()=>{st.current=w},[w]),bt(()=>{Zt.current=M},[M]);let ee={...o,onPinsUpdate:void 0},lt=y?{...r,zoom:y}:r;return bt(()=>{if(!tt.current||q.current)return;let E=null;try{E=new In({container:tt.current,config:ee,mapOptions:lt}),E.initialize(),q.current=E,J({viewer:E,isInitialized:!0});let D=E.getMarkerManager();if(D){if(D.setIconBasePath("/"),D.setInteractionConfig({draggable:_,selectable:_,showTooltips:!0,showPopups:!0,multiSelect:_,showEditButton:_,showDeleteButton:_}),z)try{let Y=Array.isArray(z)?{markers:z,version:"1.0"}:z,X=D.importMarkers(Y,{clearExisting:!1,validateCoordinates:!0});!X.success&&X.errors.length>0&&console.warn("Some default pins failed to import:",X.errors)}catch(Y){console.error("Failed to import default pins:",Y)}let et=D.getAllMarkers();J({markers:et}),ut.current&&ut.current(et)}let H=E.getZoomController();if(H){let et=H.getZoomState();J({zoomState:et})}}catch(D){console.error("Failed to initialize viewer:",D)}return()=>{E&&(E.dispose(),E=null,q.current=null,J({viewer:null,isInitialized:!1,markers:[],zoomState:null}))}},[]),bt(()=>{if(!q.current)return;let E=q.current.getMarkerManager();E&&E.setInteractionConfig({draggable:_,selectable:_,showTooltips:!0,showPopups:!0,multiSelect:_,showEditButton:v&&_,showDeleteButton:x&&_})},[_,v,x,J]),bt(()=>{if(!q.current)return;let E=q.current.getMap();if(!E)return;let D=q.current.getMarkerManager();if(!D)return;let H=et=>{if(_)try{let Y=[et.latlng.lat,et.latlng.lng],X=D.createMarker({position:Y,label:`Marker ${D.getMarkerCount()+1}`}),Z=D.getAllMarkers();J({markers:Z}),Zt.current&&Zt.current(X),ut.current&&ut.current(Z)}catch(Y){let X=Y instanceof Error?Y.message:"Unknown error";console.error("Error creating marker on map click:",X)}};return E.on("click",H),()=>{E.off("click",H)}},[_,J]),bt(()=>{if(!q.current)return;let E=q.current.getMarkerManager();if(!E)return;let D=E.on("click",H=>{ft.current&&ft.current(H.marker)});return()=>{D()}},[J]),bt(()=>{if(!q.current)return;let E=q.current.getMarkerManager();if(!E)return;let D=E.on("edit",H=>{Et.current&&Et.current(H.marker)});return()=>{D()}},[J]),bt(()=>{if(!q.current)return;let E=q.current.getMarkerManager();if(!E)return;let D=E.on("delete",H=>{st.current&&st.current(H.marker)});return()=>{D()}},[J]),bt(()=>{if(!q.current)return;let E=q.current.getMarkerManager();if(!E)return;let D=[],H=(C,G)=>{if(C.length!==G.length)return!1;let nt=new Map(G.map(W=>[W.id,W]));for(let W of C){let F=nt.get(W.id);if(!F||W.x!==F.x||W.y!==F.y||W.position[0]!==F.position[0]||W.position[1]!==F.position[1]||W.iconType!==F.iconType)return!1}return!0},et=()=>{let C=E.getAllMarkers();H(C,D)||(J({markers:C}),ut.current&&ut.current(C),D=C)},Y=E.on("delete",et),X=E.on("dragend",et),Z=E.on("edit",et),Ut=setInterval(et,500);return()=>{Y(),X(),Z(),clearInterval(Ut)}},[J]),bt(()=>{if(!q.current)return;let E=q.current.getMap();if(!E)return;let D=()=>{let H=q.current?.getZoomController();if(H){let et=H.getZoomState();J({zoomState:et})}};return E.on("zoomend",D),()=>{E.off("zoomend",D)}},[J]),xs("div",{className:s,style:{width:"100%",height:"100%",position:"relative",...h},children:[An("div",{ref:tt,style:{width:"100%",height:"100%"}}),c&&An(Fi,{position:p,showZoomLevel:u}),ot]})}import{useCallback as On}from"react";function ws(){let{viewer:o,isInitialized:r}=Ct(),s=On(()=>o?.getMap()??null,[o]),h=On(()=>o?.isInitialized()??!1,[o]);return{viewer:o,isInitialized:r,getMap:s,checkInitialized:h}}import{useCallback as Ht,useEffect as Bn,useState as ks}from"react";function Ms(){let{viewer:o,isInitialized:r,markers:s}=Ct(),[h,c]=ks(s);Bn(()=>{c(s)},[s]),Bn(()=>{if(!o||!r)return;let w=o.getMarkerManager();if(w){let M=w.getAllMarkers();c(M)}},[o,r]);let p=Ht(w=>{if(!o||!r)return console.warn("Viewer not initialized"),null;let M=o.getMarkerManager();if(!M)return console.warn("Marker manager not available"),null;try{let z=M.createMarker(w),ot=M.getAllMarkers();return c(ot),z}catch(z){return console.error("Failed to add marker:",z),null}},[o,r]),u=Ht(w=>{if(!o||!r)return console.warn("Viewer not initialized"),!1;let M=o.getMarkerManager();if(!M)return console.warn("Marker manager not available"),!1;try{let z=M.removeMarker(w);if(z){let ot=M.getAllMarkers();c(ot)}return z}catch(z){return console.error("Failed to remove marker:",z),!1}},[o,r]),_=Ht((w,M)=>{if(!o||!r)return console.warn("Viewer not initialized"),!1;let z=o.getMarkerManager();if(!z)return console.warn("Marker manager not available"),!1;try{let ot=z.getMarker(w);if(!ot)return!1;let J={...ot,...M},tt=z.updateMarker(w,J);if(tt){let q=z.getAllMarkers();c(q)}return tt}catch(ot){return console.error("Failed to update marker:",ot),!1}},[o,r]),v=Ht(w=>{if(!o||!r)return null;let M=o.getMarkerManager();return M?M.getMarker(w):null},[o,r]),x=Ht(()=>h,[h]),y=Ht(()=>{if(!o||!r)return{markers:[],version:"1.0"};let w=o.getMarkerManager();if(!w)return{markers:[],version:"1.0"};try{return w.exportMarkers()}catch(M){return console.error("Failed to export markers:",M),{markers:[],version:"1.0"}}},[o,r]),g=Ht(w=>{if(!o||!r)return console.warn("Viewer not initialized"),!1;let M=o.getMarkerManager();if(!M)return console.warn("Marker manager not available"),!1;try{let z=M.importMarkers(w);if(z.success){let ot=M.getAllMarkers();c(ot)}return z.success}catch(z){return console.error("Failed to import markers:",z),!1}},[o,r]),k=Ht(()=>{if(!o||!r){console.warn("Viewer not initialized");return}let w=o.getMarkerManager();if(!w){console.warn("Marker manager not available");return}try{w.getAllMarkers().forEach(z=>{w.removeMarker(z.id)}),c([])}catch(M){console.error("Failed to clear markers:",M)}},[o,r]),S=Ht((w,M)=>{if(!o||!r)return console.warn("Viewer not initialized"),!1;try{return o.focusMarker(w,M)}catch(z){return console.error("Failed to focus marker:",z),!1}},[o,r]);return{markers:h,addMarker:p,removeMarker:u,updateMarker:_,getMarker:v,getAllMarkers:x,exportMarkers:y,importMarkers:g,clearMarkers:k,focusMarker:S}}import{useCallback as Ie,useEffect as qi,useState as Ls}from"react";function Ps(){let{viewer:o,isInitialized:r,zoomState:s}=Ct(),[h,c]=Ls(s);qi(()=>{c(s)},[s]),qi(()=>{if(!o||!r)return;let y=o.getZoomController();if(y){let g=y.getZoomState();c(g)}},[o,r]),qi(()=>{if(!o||!r)return;let y=o.getMap();if(!y)return;let g=()=>{let k=o.getZoomController();if(k){let S=k.getZoomState();c(S)}};return y.on("zoomend",g),()=>{y.off("zoomend",g)}},[o,r]);let p=Ie(()=>{if(!o||!r){console.warn("Viewer not initialized");return}let y=o.getZoomController();if(!y){console.warn("Zoom controller not available");return}try{y.zoomIn();let g=y.getZoomState();c(g)}catch(g){console.error("Failed to zoom in:",g)}},[o,r]),u=Ie(()=>{if(!o||!r){console.warn("Viewer not initialized");return}let y=o.getZoomController();if(!y){console.warn("Zoom controller not available");return}try{y.zoomOut();let g=y.getZoomState();c(g)}catch(g){console.error("Failed to zoom out:",g)}},[o,r]),_=Ie(y=>{if(!o||!r){console.warn("Viewer not initialized");return}let g=o.getZoomController();if(!g){console.warn("Zoom controller not available");return}try{g.setZoom(y);let k=g.getZoomState();c(k)}catch(k){console.error("Failed to set zoom:",k)}},[o,r]),v=Ie(()=>h?h.currentZoom<h.maxZoom:!1,[h]),x=Ie(()=>h?h.currentZoom>h.minZoom:!1,[h]);return{zoomState:h,currentZoom:h?.currentZoom??0,minZoom:h?.minZoom??0,maxZoom:h?.maxZoom??5,zoomIn:p,zoomOut:u,setZoom:_,canZoomIn:v,canZoomOut:x}}export{us as CDNManager,bs as EdgePDFViewer,gs as ViewerProvider,Fi as ZoomControls,Ms as useMarkers,ws as useViewer,Ct as useViewerContext,Ps as useZoom};
|
|
275
265
|
/*! Bundled license information:
|
|
276
266
|
|
|
277
267
|
leaflet/dist/leaflet-src.js:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edgepdf/viewer-react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "EdgePDF Viewer - React components for viewing PDF documents with interactive markers and zoom controls",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"!**/*.tsbuildinfo"
|
|
45
45
|
],
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@edgepdf/viewer-js": "0.3.
|
|
47
|
+
"@edgepdf/viewer-js": "0.3.8",
|
|
48
48
|
"@edgepdf/types": "0.0.1",
|
|
49
|
-
"@edgepdf/utils": "0.0.1",
|
|
50
|
-
"@edgepdf/
|
|
49
|
+
"@edgepdf/testing-utils": "0.0.1",
|
|
50
|
+
"@edgepdf/utils": "0.0.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"react": "^18.0.0"
|