72 lines
494 KiB
JavaScript
72 lines
494 KiB
JavaScript
(function(j){typeof define=="function"&&define.amd?define(j):j()})((function(){"use strict";var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(j){return j&&j.__esModule&&Object.prototype.hasOwnProperty.call(j,"default")?j.default:j}var leafletSrc$1={exports:{}};var leafletSrc=leafletSrc$1.exports,hasRequiredLeafletSrc;function requireLeafletSrc(){return hasRequiredLeafletSrc||(hasRequiredLeafletSrc=1,(function(j,H){(function(G,X){X(H)})(leafletSrc,(function(G){var X="1.9.4";function tt(_){var M,S,D,z;for(S=1,D=arguments.length;S<D;S++){z=arguments[S];for(M in z)_[M]=z[M]}return _}var F=Object.create||(function(){function _(){}return function(M){return _.prototype=M,new _}})();function N(_,M){var S=Array.prototype.slice;if(_.bind)return _.bind.apply(_,S.call(arguments,1));var D=S.call(arguments,2);return function(){return _.apply(M,D.length?D.concat(S.call(arguments)):arguments)}}var W=0;function et(_){return"_leaflet_id"in _||(_._leaflet_id=++W),_._leaflet_id}function ft(_,M,S){var D,z,V,nt;return nt=function(){D=!1,z&&(V.apply(S,z),z=!1)},V=function(){D?z=arguments:(_.apply(S,arguments),setTimeout(nt,M),D=!0)},V}function Lt(_,M,S){var D=M[1],z=M[0],V=D-z;return _===D&&S?_:((_-z)%V+V)%V+z}function pt(){return!1}function Ct(_,M){if(M===!1)return _;var S=Math.pow(10,M===void 0?6:M);return Math.round(_*S)/S}function bt(_){return _.trim?_.trim():_.replace(/^\s+|\s+$/g,"")}function Dt(_){return bt(_).split(/\s+/)}function St(_,M){Object.prototype.hasOwnProperty.call(_,"options")||(_.options=_.options?F(_.options):{});for(var S in M)_.options[S]=M[S];return _.options}function Jt(_,M,S){var D=[];for(var z in _)D.push(encodeURIComponent(S?z.toUpperCase():z)+"="+encodeURIComponent(_[z]));return(!M||M.indexOf("?")===-1?"?":"&")+D.join("&")}var Zt=/\{ *([\w_ -]+) *\}/g;function ee(_,M){return _.replace(Zt,function(S,D){var z=M[D];if(z===void 0)throw new Error("No value provided for variable "+S);return typeof z=="function"&&(z=z(M)),z})}var ie=Array.isArray||function(_){return Object.prototype.toString.call(_)==="[object Array]"};function ei(_,M){for(var S=0;S<_.length;S++)if(_[S]===M)return S;return-1}var ke="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function Ve(_){return window["webkit"+_]||window["moz"+_]||window["ms"+_]}var pn=0;function Pr(_){var M=+new Date,S=Math.max(0,16-(M-pn));return pn=M+S,window.setTimeout(_,S)}var Rn=window.requestAnimationFrame||Ve("RequestAnimationFrame")||Pr,Si=window.cancelAnimationFrame||Ve("CancelAnimationFrame")||Ve("CancelRequestAnimationFrame")||function(_){window.clearTimeout(_)};function ue(_,M,S){if(S&&Rn===Pr)_.call(M);else return Rn.call(window,N(_,M))}function Me(_){_&&Si.call(window,_)}var qs={__proto__:null,extend:tt,create:F,bind:N,get lastId(){return W},stamp:et,throttle:ft,wrapNum:Lt,falseFn:pt,formatNum:Ct,trim:bt,splitWords:Dt,setOptions:St,getParamString:Jt,template:ee,isArray:ie,indexOf:ei,emptyImageUrl:ke,requestFn:Rn,cancelFn:Si,requestAnimFrame:ue,cancelAnimFrame:Me};function ii(){}ii.extend=function(_){var M=function(){St(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},S=M.__super__=this.prototype,D=F(S);D.constructor=M,M.prototype=D;for(var z in this)Object.prototype.hasOwnProperty.call(this,z)&&z!=="prototype"&&z!=="__super__"&&(M[z]=this[z]);return _.statics&&tt(M,_.statics),_.includes&&(Ks(_.includes),tt.apply(null,[D].concat(_.includes))),tt(D,_),delete D.statics,delete D.includes,D.options&&(D.options=S.options?F(S.options):{},tt(D.options,_.options)),D._initHooks=[],D.callInitHooks=function(){if(!this._initHooksCalled){S.callInitHooks&&S.callInitHooks.call(this),this._initHooksCalled=!0;for(var V=0,nt=D._initHooks.length;V<nt;V++)D._initHooks[V].call(this)}},M},ii.include=function(_){var M=this.prototype.options;return tt(this.prototype,_),_.options&&(this.prototype.options=M,this.mergeOptions(_.options)),this},ii.mergeOptions=function(_){return tt(this.prototype.options,_),this},ii.addInitHook=function(_){var M=Array.prototype.slice.call(arguments,1),S=typeof _=="function"?_:function(){this[_].apply(this,M)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(S),this};function Ks(_){if(!(typeof L>"u"||!L||!L.Mixin)){_=ie(_)?_:[_];for(var M=0;M<_.length;M++)_[M]===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 Te={on:function(_,M,S){if(typeof _=="object")for(var D in _)this._on(D,_[D],M);else{_=Dt(_);for(var z=0,V=_.length;z<V;z++)this._on(_[z],M,S)}return this},off:function(_,M,S){if(!arguments.length)delete this._events;else if(typeof _=="object")for(var D in _)this._off(D,_[D],M);else{_=Dt(_);for(var z=arguments.length===1,V=0,nt=_.length;V<nt;V++)z?this._off(_[V]):this._off(_[V],M,S)}return this},_on:function(_,M,S,D){if(typeof M!="function"){console.warn("wrong listener type: "+typeof M);return}if(this._listens(_,M,S)===!1){S===this&&(S=void 0);var z={fn:M,ctx:S};D&&(z.once=!0),this._events=this._events||{},this._events[_]=this._events[_]||[],this._events[_].push(z)}},_off:function(_,M,S){var D,z,V;if(this._events&&(D=this._events[_],!!D)){if(arguments.length===1){if(this._firingCount)for(z=0,V=D.length;z<V;z++)D[z].fn=pt;delete this._events[_];return}if(typeof M!="function"){console.warn("wrong listener type: "+typeof M);return}var nt=this._listens(_,M,S);if(nt!==!1){var dt=D[nt];this._firingCount&&(dt.fn=pt,this._events[_]=D=D.slice()),D.splice(nt,1)}}},fire:function(_,M,S){if(!this.listens(_,S))return this;var D=tt({},M,{type:_,target:this,sourceTarget:M&&M.sourceTarget||this});if(this._events){var z=this._events[_];if(z){this._firingCount=this._firingCount+1||1;for(var V=0,nt=z.length;V<nt;V++){var dt=z[V],gt=dt.fn;dt.once&&this.off(_,gt,dt.ctx),gt.call(dt.ctx||this,D)}this._firingCount--}}return S&&this._propagateEvent(D),this},listens:function(_,M,S,D){typeof _!="string"&&console.warn('"string" type argument expected');var z=M;typeof M!="function"&&(D=!!M,z=void 0,S=void 0);var V=this._events&&this._events[_];if(V&&V.length&&this._listens(_,z,S)!==!1)return!0;if(D){for(var nt in this._eventParents)if(this._eventParents[nt].listens(_,M,S,D))return!0}return!1},_listens:function(_,M,S){if(!this._events)return!1;var D=this._events[_]||[];if(!M)return!!D.length;S===this&&(S=void 0);for(var z=0,V=D.length;z<V;z++)if(D[z].fn===M&&D[z].ctx===S)return z;return!1},once:function(_,M,S){if(typeof _=="object")for(var D in _)this._on(D,_[D],M,!0);else{_=Dt(_);for(var z=0,V=_.length;z<V;z++)this._on(_[z],M,S,!0)}return this},addEventParent:function(_){return this._eventParents=this._eventParents||{},this._eventParents[et(_)]=_,this},removeEventParent:function(_){return this._eventParents&&delete this._eventParents[et(_)],this},_propagateEvent:function(_){for(var M in this._eventParents)this._eventParents[M].fire(_.type,tt({layer:_.target,propagatedFrom:_.target},_),!0)}};Te.addEventListener=Te.on,Te.removeEventListener=Te.clearAllEventListeners=Te.off,Te.addOneTimeEventListener=Te.once,Te.fireEvent=Te.fire,Te.hasEventListeners=Te.listens;var Yi=ii.extend(Te);function Gt(_,M,S){this.x=S?Math.round(_):_,this.y=S?Math.round(M):M}var In=Math.trunc||function(_){return _>0?Math.floor(_):Math.ceil(_)};Gt.prototype={clone:function(){return new Gt(this.x,this.y)},add:function(_){return this.clone()._add(zt(_))},_add:function(_){return this.x+=_.x,this.y+=_.y,this},subtract:function(_){return this.clone()._subtract(zt(_))},_subtract:function(_){return this.x-=_.x,this.y-=_.y,this},divideBy:function(_){return this.clone()._divideBy(_)},_divideBy:function(_){return this.x/=_,this.y/=_,this},multiplyBy:function(_){return this.clone()._multiplyBy(_)},_multiplyBy:function(_){return this.x*=_,this.y*=_,this},scaleBy:function(_){return new Gt(this.x*_.x,this.y*_.y)},unscaleBy:function(_){return new Gt(this.x/_.x,this.y/_.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=In(this.x),this.y=In(this.y),this},distanceTo:function(_){_=zt(_);var M=_.x-this.x,S=_.y-this.y;return Math.sqrt(M*M+S*S)},equals:function(_){return _=zt(_),_.x===this.x&&_.y===this.y},contains:function(_){return _=zt(_),Math.abs(_.x)<=Math.abs(this.x)&&Math.abs(_.y)<=Math.abs(this.y)},toString:function(){return"Point("+Ct(this.x)+", "+Ct(this.y)+")"}};function zt(_,M,S){return _ instanceof Gt?_:ie(_)?new Gt(_[0],_[1]):_==null?_:typeof _=="object"&&"x"in _&&"y"in _?new Gt(_.x,_.y):new Gt(_,M,S)}function ne(_,M){if(_)for(var S=M?[_,M]:_,D=0,z=S.length;D<z;D++)this.extend(S[D])}ne.prototype={extend:function(_){var M,S;if(!_)return this;if(_ instanceof Gt||typeof _[0]=="number"||"x"in _)M=S=zt(_);else if(_=we(_),M=_.min,S=_.max,!M||!S)return this;return!this.min&&!this.max?(this.min=M.clone(),this.max=S.clone()):(this.min.x=Math.min(M.x,this.min.x),this.max.x=Math.max(S.x,this.max.x),this.min.y=Math.min(M.y,this.min.y),this.max.y=Math.max(S.y,this.max.y)),this},getCenter:function(_){return zt((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,_)},getBottomLeft:function(){return zt(this.min.x,this.max.y)},getTopRight:function(){return zt(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(_){var M,S;return typeof _[0]=="number"||_ instanceof Gt?_=zt(_):_=we(_),_ instanceof ne?(M=_.min,S=_.max):M=S=_,M.x>=this.min.x&&S.x<=this.max.x&&M.y>=this.min.y&&S.y<=this.max.y},intersects:function(_){_=we(_);var M=this.min,S=this.max,D=_.min,z=_.max,V=z.x>=M.x&&D.x<=S.x,nt=z.y>=M.y&&D.y<=S.y;return V&&nt},overlaps:function(_){_=we(_);var M=this.min,S=this.max,D=_.min,z=_.max,V=z.x>M.x&&D.x<S.x,nt=z.y>M.y&&D.y<S.y;return V&&nt},isValid:function(){return!!(this.min&&this.max)},pad:function(_){var M=this.min,S=this.max,D=Math.abs(M.x-S.x)*_,z=Math.abs(M.y-S.y)*_;return we(zt(M.x-D,M.y-z),zt(S.x+D,S.y+z))},equals:function(_){return _?(_=we(_),this.min.equals(_.getTopLeft())&&this.max.equals(_.getBottomRight())):!1}};function we(_,M){return!_||_ instanceof ne?_:new ne(_,M)}function Ee(_,M){if(_)for(var S=M?[_,M]:_,D=0,z=S.length;D<z;D++)this.extend(S[D])}Ee.prototype={extend:function(_){var M=this._southWest,S=this._northEast,D,z;if(_ instanceof Qt)D=_,z=_;else if(_ instanceof Ee){if(D=_._southWest,z=_._northEast,!D||!z)return this}else return _?this.extend(Kt(_)||le(_)):this;return!M&&!S?(this._southWest=new Qt(D.lat,D.lng),this._northEast=new Qt(z.lat,z.lng)):(M.lat=Math.min(D.lat,M.lat),M.lng=Math.min(D.lng,M.lng),S.lat=Math.max(z.lat,S.lat),S.lng=Math.max(z.lng,S.lng)),this},pad:function(_){var M=this._southWest,S=this._northEast,D=Math.abs(M.lat-S.lat)*_,z=Math.abs(M.lng-S.lng)*_;return new Ee(new Qt(M.lat-D,M.lng-z),new Qt(S.lat+D,S.lng+z))},getCenter:function(){return new Qt((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 Qt(this.getNorth(),this.getWest())},getSouthEast:function(){return new Qt(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(_){typeof _[0]=="number"||_ instanceof Qt||"lat"in _?_=Kt(_):_=le(_);var M=this._southWest,S=this._northEast,D,z;return _ instanceof Ee?(D=_.getSouthWest(),z=_.getNorthEast()):D=z=_,D.lat>=M.lat&&z.lat<=S.lat&&D.lng>=M.lng&&z.lng<=S.lng},intersects:function(_){_=le(_);var M=this._southWest,S=this._northEast,D=_.getSouthWest(),z=_.getNorthEast(),V=z.lat>=M.lat&&D.lat<=S.lat,nt=z.lng>=M.lng&&D.lng<=S.lng;return V&&nt},overlaps:function(_){_=le(_);var M=this._southWest,S=this._northEast,D=_.getSouthWest(),z=_.getNorthEast(),V=z.lat>M.lat&&D.lat<S.lat,nt=z.lng>M.lng&&D.lng<S.lng;return V&&nt},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(_,M){return _?(_=le(_),this._southWest.equals(_.getSouthWest(),M)&&this._northEast.equals(_.getNorthEast(),M)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function le(_,M){return _ instanceof Ee?_:new Ee(_,M)}function Qt(_,M,S){if(isNaN(_)||isNaN(M))throw new Error("Invalid LatLng object: ("+_+", "+M+")");this.lat=+_,this.lng=+M,S!==void 0&&(this.alt=+S)}Qt.prototype={equals:function(_,M){if(!_)return!1;_=Kt(_);var S=Math.max(Math.abs(this.lat-_.lat),Math.abs(this.lng-_.lng));return S<=(M===void 0?1e-9:M)},toString:function(_){return"LatLng("+Ct(this.lat,_)+", "+Ct(this.lng,_)+")"},distanceTo:function(_){return li.distance(this,Kt(_))},wrap:function(){return li.wrapLatLng(this)},toBounds:function(_){var M=180*_/40075017,S=M/Math.cos(Math.PI/180*this.lat);return le([this.lat-M,this.lng-S],[this.lat+M,this.lng+S])},clone:function(){return new Qt(this.lat,this.lng,this.alt)}};function Kt(_,M,S){return _ instanceof Qt?_:ie(_)&&typeof _[0]!="object"?_.length===3?new Qt(_[0],_[1],_[2]):_.length===2?new Qt(_[0],_[1]):null:_==null?_:typeof _=="object"&&"lat"in _?new Qt(_.lat,"lng"in _?_.lng:_.lon,_.alt):M===void 0?null:new Qt(_,M,S)}var ni={latLngToPoint:function(_,M){var S=this.projection.project(_),D=this.scale(M);return this.transformation._transform(S,D)},pointToLatLng:function(_,M){var S=this.scale(M),D=this.transformation.untransform(_,S);return this.projection.unproject(D)},project:function(_){return this.projection.project(_)},unproject:function(_){return this.projection.unproject(_)},scale:function(_){return 256*Math.pow(2,_)},zoom:function(_){return Math.log(_/256)/Math.LN2},getProjectedBounds:function(_){if(this.infinite)return null;var M=this.projection.bounds,S=this.scale(_),D=this.transformation.transform(M.min,S),z=this.transformation.transform(M.max,S);return new ne(D,z)},infinite:!1,wrapLatLng:function(_){var M=this.wrapLng?Lt(_.lng,this.wrapLng,!0):_.lng,S=this.wrapLat?Lt(_.lat,this.wrapLat,!0):_.lat,D=_.alt;return new Qt(S,M,D)},wrapLatLngBounds:function(_){var M=_.getCenter(),S=this.wrapLatLng(M),D=M.lat-S.lat,z=M.lng-S.lng;if(D===0&&z===0)return _;var V=_.getSouthWest(),nt=_.getNorthEast(),dt=new Qt(V.lat-D,V.lng-z),gt=new Qt(nt.lat-D,nt.lng-z);return new Ee(dt,gt)}},li=tt({},ni,{wrapLng:[-180,180],R:6371e3,distance:function(_,M){var S=Math.PI/180,D=_.lat*S,z=M.lat*S,V=Math.sin((M.lat-_.lat)*S/2),nt=Math.sin((M.lng-_.lng)*S/2),dt=V*V+Math.cos(D)*Math.cos(z)*nt*nt,gt=2*Math.atan2(Math.sqrt(dt),Math.sqrt(1-dt));return this.R*gt}}),$i=6378137,zn={R:$i,MAX_LATITUDE:85.0511287798,project:function(_){var M=Math.PI/180,S=this.MAX_LATITUDE,D=Math.max(Math.min(S,_.lat),-S),z=Math.sin(D*M);return new Gt(this.R*_.lng*M,this.R*Math.log((1+z)/(1-z))/2)},unproject:function(_){var M=180/Math.PI;return new Qt((2*Math.atan(Math.exp(_.y/this.R))-Math.PI/2)*M,_.x*M/this.R)},bounds:(function(){var _=$i*Math.PI;return new ne([-_,-_],[_,_])})()};function Nn(_,M,S,D){if(ie(_)){this._a=_[0],this._b=_[1],this._c=_[2],this._d=_[3];return}this._a=_,this._b=M,this._c=S,this._d=D}Nn.prototype={transform:function(_,M){return this._transform(_.clone(),M)},_transform:function(_,M){return M=M||1,_.x=M*(this._a*_.x+this._b),_.y=M*(this._c*_.y+this._d),_},untransform:function(_,M){return M=M||1,new Gt((_.x/M-this._b)/this._a,(_.y/M-this._d)/this._c)}};function Xi(_,M,S,D){return new Nn(_,M,S,D)}var Gn=tt({},li,{code:"EPSG:3857",projection:zn,transformation:(function(){var _=.5/(Math.PI*zn.R);return Xi(_,.5,-_,.5)})()}),Sr=tt({},Gn,{code:"EPSG:900913"});function Ar(_){return document.createElementNS("http://www.w3.org/2000/svg",_)}function Tr(_,M){var S="",D,z,V,nt,dt,gt;for(D=0,V=_.length;D<V;D++){for(dt=_[D],z=0,nt=dt.length;z<nt;z++)gt=dt[z],S+=(z?"L":"M")+gt.x+" "+gt.y;S+=M?Rt.svg?"z":"x":""}return S||"M0 0"}var fn=document.documentElement.style,Ai="ActiveXObject"in window,Dr=Ai&&!document.addEventListener,Or="msLaunchUri"in navigator&&!("documentMode"in document),Zn=je("webkit"),Fr=je("android"),Rr=je("android 2")||je("android 3"),Ws=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Ys=Fr&&je("Google")&&Ws<537&&!("AudioNode"in window),jn=!!window.opera,Ir=!Or&&je("chrome"),zr=je("gecko")&&!Zn&&!jn&&!Ai,Nr=!Ir&&je("safari"),Un=je("phantom"),Gr="OTransition"in fn,Ti=navigator.platform.indexOf("Win")===0,Zr=Ai&&"transition"in fn,_n="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!Rr,Di="MozPerspective"in fn,jr=!window.L_DISABLE_3D&&(Zr||_n||Di)&&!Gr&&!Un,Li=typeof orientation<"u"||je("mobile"),$s=Li&&Zn,Xs=Li&&_n,Hn=!window.PointerEvent&&window.MSPointerEvent,Ur=!!(window.PointerEvent||Hn),Hr="ontouchstart"in window||!!window.TouchEvent,Js=!window.L_NO_TOUCH&&(Hr||Ur),Qs=Li&&jn,Vr=Li&&zr,qr=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,ta=(function(){var _=!1;try{var M=Object.defineProperty({},"passive",{get:function(){_=!0}});window.addEventListener("testPassiveEventSupport",pt,M),window.removeEventListener("testPassiveEventSupport",pt,M)}catch{}return _})(),ea=(function(){return!!document.createElement("canvas").getContext})(),Vn=!!(document.createElementNS&&Ar("svg").createSVGRect),Kr=!!Vn&&(function(){var _=document.createElement("div");return _.innerHTML="<svg/>",(_.firstChild&&_.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),ia=!Vn&&(function(){try{var _=document.createElement("div");_.innerHTML='<v:shape adj="1"/>';var M=_.firstChild;return M.style.behavior="url(#default#VML)",M&&typeof M.adj=="object"}catch{return!1}})(),na=navigator.platform.indexOf("Mac")===0,ra=navigator.platform.indexOf("Linux")===0;function je(_){return navigator.userAgent.toLowerCase().indexOf(_)>=0}var Rt={ie:Ai,ielt9:Dr,edge:Or,webkit:Zn,android:Fr,android23:Rr,androidStock:Ys,opera:jn,chrome:Ir,gecko:zr,safari:Nr,phantom:Un,opera12:Gr,win:Ti,ie3d:Zr,webkit3d:_n,gecko3d:Di,any3d:jr,mobile:Li,mobileWebkit:$s,mobileWebkit3d:Xs,msPointer:Hn,pointer:Ur,touch:Js,touchNative:Hr,mobileOpera:Qs,mobileGecko:Vr,retina:qr,passiveEvents:ta,canvas:ea,svg:Vn,vml:ia,inlineSvg:Kr,mac:na,linux:ra},Wr=Rt.msPointer?"MSPointerDown":"pointerdown",Yr=Rt.msPointer?"MSPointerMove":"pointermove",qn=Rt.msPointer?"MSPointerUp":"pointerup",$r=Rt.msPointer?"MSPointerCancel":"pointercancel",Kn={touchstart:Wr,touchmove:Yr,touchend:qn,touchcancel:$r},Xr={touchstart:la,touchmove:gn,touchend:gn,touchcancel:gn},Oi={},Jr=!1;function sa(_,M,S){return M==="touchstart"&&Wn(),Xr[M]?(S=Xr[M].bind(this,S),_.addEventListener(Kn[M],S,!1),S):(console.warn("wrong event specified:",M),pt)}function aa(_,M,S){if(!Kn[M]){console.warn("wrong event specified:",M);return}_.removeEventListener(Kn[M],S,!1)}function oa(_){Oi[_.pointerId]=_}function ua(_){Oi[_.pointerId]&&(Oi[_.pointerId]=_)}function mn(_){delete Oi[_.pointerId]}function Wn(){Jr||(document.addEventListener(Wr,oa,!0),document.addEventListener(Yr,ua,!0),document.addEventListener(qn,mn,!0),document.addEventListener($r,mn,!0),Jr=!0)}function gn(_,M){if(M.pointerType!==(M.MSPOINTER_TYPE_MOUSE||"mouse")){M.touches=[];for(var S in Oi)M.touches.push(Oi[S]);M.changedTouches=[M],_(M)}}function la(_,M){M.MSPOINTER_TYPE_TOUCH&&M.pointerType===M.MSPOINTER_TYPE_TOUCH&&me(M),gn(_,M)}function ha(_){var M={},S,D;for(D in _)S=_[D],M[D]=S&&S.bind?S.bind(_):S;return _=M,M.type="dblclick",M.detail=2,M.isTrusted=!1,M._simulated=!0,M}var ca=200;function da(_,M){_.addEventListener("dblclick",M);var S=0,D;function z(V){if(V.detail!==1){D=V.detail;return}if(!(V.pointerType==="mouse"||V.sourceCapabilities&&!V.sourceCapabilities.firesTouchEvents)){var nt=ns(V);if(!(nt.some(function(gt){return gt instanceof HTMLLabelElement&>.attributes.for})&&!nt.some(function(gt){return gt instanceof HTMLInputElement||gt instanceof HTMLSelectElement}))){var dt=Date.now();dt-S<=ca?(D++,D===2&&M(ha(V))):D=1,S=dt}}}return _.addEventListener("click",z),{dblclick:M,simDblclick:z}}function pa(_,M){_.removeEventListener("dblclick",M.dblclick),_.removeEventListener("click",M.simDblclick)}var Yn=vn(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Ji=vn(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Qr=Ji==="webkitTransition"||Ji==="OTransition"?Ji+"End":"transitionend";function ts(_){return typeof _=="string"?document.getElementById(_):_}function hi(_,M){var S=_.style[M]||_.currentStyle&&_.currentStyle[M];if((!S||S==="auto")&&document.defaultView){var D=document.defaultView.getComputedStyle(_,null);S=D?D[M]:null}return S==="auto"?null:S}function Yt(_,M,S){var D=document.createElement(_);return D.className=M||"",S&&S.appendChild(D),D}function re(_){var M=_.parentNode;M&&M.removeChild(_)}function Qi(_){for(;_.firstChild;)_.removeChild(_.firstChild)}function Fi(_){var M=_.parentNode;M&&M.lastChild!==_&&M.appendChild(_)}function Ri(_){var M=_.parentNode;M&&M.firstChild!==_&&M.insertBefore(_,M.firstChild)}function $n(_,M){if(_.classList!==void 0)return _.classList.contains(M);var S=yn(_);return S.length>0&&new RegExp("(^|\\s)"+M+"(\\s|$)").test(S)}function Ht(_,M){if(_.classList!==void 0)for(var S=Dt(M),D=0,z=S.length;D<z;D++)_.classList.add(S[D]);else if(!$n(_,M)){var V=yn(_);Xn(_,(V?V+" ":"")+M)}}function ae(_,M){_.classList!==void 0?_.classList.remove(M):Xn(_,bt((" "+yn(_)+" ").replace(" "+M+" "," ")))}function Xn(_,M){_.className.baseVal===void 0?_.className=M:_.className.baseVal=M}function yn(_){return _.correspondingElement&&(_=_.correspondingElement),_.className.baseVal===void 0?_.className:_.className.baseVal}function Re(_,M){"opacity"in _.style?_.style.opacity=M:"filter"in _.style&&fa(_,M)}function fa(_,M){var S=!1,D="DXImageTransform.Microsoft.Alpha";try{S=_.filters.item(D)}catch{if(M===1)return}M=Math.round(M*100),S?(S.Enabled=M!==100,S.Opacity=M):_.style.filter+=" progid:"+D+"(opacity="+M+")"}function vn(_){for(var M=document.documentElement.style,S=0;S<_.length;S++)if(_[S]in M)return _[S];return!1}function bi(_,M,S){var D=M||new Gt(0,0);_.style[Yn]=(Rt.ie3d?"translate("+D.x+"px,"+D.y+"px)":"translate3d("+D.x+"px,"+D.y+"px,0)")+(S?" scale("+S+")":"")}function he(_,M){_._leaflet_pos=M,Rt.any3d?bi(_,M):(_.style.left=M.x+"px",_.style.top=M.y+"px")}function ci(_){return _._leaflet_pos||new Gt(0,0)}var tn,en,Jn;if("onselectstart"in document)tn=function(){jt(window,"selectstart",me)},en=function(){$t(window,"selectstart",me)};else{var nn=vn(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);tn=function(){if(nn){var _=document.documentElement.style;Jn=_[nn],_[nn]="none"}},en=function(){nn&&(document.documentElement.style[nn]=Jn,Jn=void 0)}}function Qn(){jt(window,"dragstart",me)}function tr(){$t(window,"dragstart",me)}var Ln,er;function ir(_){for(;_.tabIndex===-1;)_=_.parentNode;_.style&&(bn(),Ln=_,er=_.style.outlineStyle,_.style.outlineStyle="none",jt(window,"keydown",bn))}function bn(){Ln&&(Ln.style.outlineStyle=er,Ln=void 0,er=void 0,$t(window,"keydown",bn))}function es(_){do _=_.parentNode;while((!_.offsetWidth||!_.offsetHeight)&&_!==document.body);return _}function nr(_){var M=_.getBoundingClientRect();return{x:M.width/_.offsetWidth||1,y:M.height/_.offsetHeight||1,boundingClientRect:M}}var _a={__proto__:null,TRANSFORM:Yn,TRANSITION:Ji,TRANSITION_END:Qr,get:ts,getStyle:hi,create:Yt,remove:re,empty:Qi,toFront:Fi,toBack:Ri,hasClass:$n,addClass:Ht,removeClass:ae,setClass:Xn,getClass:yn,setOpacity:Re,testProp:vn,setTransform:bi,setPosition:he,getPosition:ci,get disableTextSelection(){return tn},get enableTextSelection(){return en},disableImageDrag:Qn,enableImageDrag:tr,preventOutline:ir,restoreOutline:bn,getSizedParentNode:es,getScale:nr};function jt(_,M,S,D){if(M&&typeof M=="object")for(var z in M)sr(_,z,M[z],S);else{M=Dt(M);for(var V=0,nt=M.length;V<nt;V++)sr(_,M[V],S,D)}return this}var qe="_leaflet_events";function $t(_,M,S,D){if(arguments.length===1)is(_),delete _[qe];else if(M&&typeof M=="object")for(var z in M)ar(_,z,M[z],S);else if(M=Dt(M),arguments.length===2)is(_,function(dt){return ei(M,dt)!==-1});else for(var V=0,nt=M.length;V<nt;V++)ar(_,M[V],S,D);return this}function is(_,M){for(var S in _[qe]){var D=S.split(/\d/)[0];(!M||M(D))&&ar(_,D,null,null,S)}}var rr={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function sr(_,M,S,D){var z=M+et(S)+(D?"_"+et(D):"");if(_[qe]&&_[qe][z])return this;var V=function(dt){return S.call(D||_,dt||window.event)},nt=V;!Rt.touchNative&&Rt.pointer&&M.indexOf("touch")===0?V=sa(_,M,V):Rt.touch&&M==="dblclick"?V=da(_,V):"addEventListener"in _?M==="touchstart"||M==="touchmove"||M==="wheel"||M==="mousewheel"?_.addEventListener(rr[M]||M,V,Rt.passiveEvents?{passive:!1}:!1):M==="mouseenter"||M==="mouseleave"?(V=function(dt){dt=dt||window.event,Cn(_,dt)&&nt(dt)},_.addEventListener(rr[M],V,!1)):_.addEventListener(M,nt,!1):_.attachEvent("on"+M,V),_[qe]=_[qe]||{},_[qe][z]=V}function ar(_,M,S,D,z){z=z||M+et(S)+(D?"_"+et(D):"");var V=_[qe]&&_[qe][z];if(!V)return this;!Rt.touchNative&&Rt.pointer&&M.indexOf("touch")===0?aa(_,M,V):Rt.touch&&M==="dblclick"?pa(_,V):"removeEventListener"in _?_.removeEventListener(rr[M]||M,V,!1):_.detachEvent("on"+M,V),_[qe][z]=null}function Ci(_){return _.stopPropagation?_.stopPropagation():_.originalEvent?_.originalEvent._stopped=!0:_.cancelBubble=!0,this}function or(_){return sr(_,"wheel",Ci),this}function rn(_){return jt(_,"mousedown touchstart dblclick contextmenu",Ci),_._leaflet_disable_click=!0,this}function me(_){return _.preventDefault?_.preventDefault():_.returnValue=!1,this}function xi(_){return me(_),Ci(_),this}function ns(_){if(_.composedPath)return _.composedPath();for(var M=[],S=_.target;S;)M.push(S),S=S.parentNode;return M}function sn(_,M){if(!M)return new Gt(_.clientX,_.clientY);var S=nr(M),D=S.boundingClientRect;return new Gt((_.clientX-D.left)/S.x-M.clientLeft,(_.clientY-D.top)/S.y-M.clientTop)}var ma=Rt.linux&&Rt.chrome?window.devicePixelRatio:Rt.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function rs(_){return Rt.edge?_.wheelDeltaY/2:_.deltaY&&_.deltaMode===0?-_.deltaY/ma:_.deltaY&&_.deltaMode===1?-_.deltaY*20:_.deltaY&&_.deltaMode===2?-_.deltaY*60:_.deltaX||_.deltaZ?0:_.wheelDelta?(_.wheelDeltaY||_.wheelDelta)/2:_.detail&&Math.abs(_.detail)<32765?-_.detail*20:_.detail?_.detail/-32765*60:0}function Cn(_,M){var S=M.relatedTarget;if(!S)return!0;try{for(;S&&S!==_;)S=S.parentNode}catch{return!1}return S!==_}var Wt={__proto__:null,on:jt,off:$t,stopPropagation:Ci,disableScrollPropagation:or,disableClickPropagation:rn,preventDefault:me,stop:xi,getPropagationPath:ns,getMousePosition:sn,getWheelDelta:rs,isExternalTarget:Cn,addListener:jt,removeListener:$t},ss=Yi.extend({run:function(_,M,S,D){this.stop(),this._el=_,this._inProgress=!0,this._duration=S||.25,this._easeOutPower=1/Math.max(D||.5,.2),this._startPos=ci(_),this._offset=M.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=ue(this._animate,this),this._step()},_step:function(_){var M=+new Date-this._startTime,S=this._duration*1e3;M<S?this._runFrame(this._easeOut(M/S),_):(this._runFrame(1),this._complete())},_runFrame:function(_,M){var S=this._startPos.add(this._offset.multiplyBy(_));M&&S._round(),he(this._el,S),this.fire("step")},_complete:function(){Me(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(_){return 1-Math.pow(1-_,this._easeOutPower)}}),qt=Yi.extend({options:{crs:Gn,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(_,M){M=St(this,M),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(_),this._initLayout(),this._onResize=N(this._onResize,this),this._initEvents(),M.maxBounds&&this.setMaxBounds(M.maxBounds),M.zoom!==void 0&&(this._zoom=this._limitZoom(M.zoom)),M.center&&M.zoom!==void 0&&this.setView(Kt(M.center),M.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Ji&&Rt.any3d&&!Rt.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),jt(this._proxy,Qr,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(_,M,S){if(M=M===void 0?this._zoom:this._limitZoom(M),_=this._limitCenter(Kt(_),M,this.options.maxBounds),S=S||{},this._stop(),this._loaded&&!S.reset&&S!==!0){S.animate!==void 0&&(S.zoom=tt({animate:S.animate},S.zoom),S.pan=tt({animate:S.animate,duration:S.duration},S.pan));var D=this._zoom!==M?this._tryAnimatedZoom&&this._tryAnimatedZoom(_,M,S.zoom):this._tryAnimatedPan(_,S.pan);if(D)return clearTimeout(this._sizeTimer),this}return this._resetView(_,M,S.pan&&S.pan.noMoveStart),this},setZoom:function(_,M){return this._loaded?this.setView(this.getCenter(),_,{zoom:M}):(this._zoom=_,this)},zoomIn:function(_,M){return _=_||(Rt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+_,M)},zoomOut:function(_,M){return _=_||(Rt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-_,M)},setZoomAround:function(_,M,S){var D=this.getZoomScale(M),z=this.getSize().divideBy(2),V=_ instanceof Gt?_:this.latLngToContainerPoint(_),nt=V.subtract(z).multiplyBy(1-1/D),dt=this.containerPointToLatLng(z.add(nt));return this.setView(dt,M,{zoom:S})},_getBoundsCenterZoom:function(_,M){M=M||{},_=_.getBounds?_.getBounds():le(_);var S=zt(M.paddingTopLeft||M.padding||[0,0]),D=zt(M.paddingBottomRight||M.padding||[0,0]),z=this.getBoundsZoom(_,!1,S.add(D));if(z=typeof M.maxZoom=="number"?Math.min(M.maxZoom,z):z,z===1/0)return{center:_.getCenter(),zoom:z};var V=D.subtract(S).divideBy(2),nt=this.project(_.getSouthWest(),z),dt=this.project(_.getNorthEast(),z),gt=this.unproject(nt.add(dt).divideBy(2).add(V),z);return{center:gt,zoom:z}},fitBounds:function(_,M){if(_=le(_),!_.isValid())throw new Error("Bounds are not valid.");var S=this._getBoundsCenterZoom(_,M);return this.setView(S.center,S.zoom,M)},fitWorld:function(_){return this.fitBounds([[-90,-180],[90,180]],_)},panTo:function(_,M){return this.setView(_,this._zoom,{pan:M})},panBy:function(_,M){if(_=zt(_).round(),M=M||{},!_.x&&!_.y)return this.fire("moveend");if(M.animate!==!0&&!this.getSize().contains(_))return this._resetView(this.unproject(this.project(this.getCenter()).add(_)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ss,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),M.noMoveStart||this.fire("movestart"),M.animate!==!1){Ht(this._mapPane,"leaflet-pan-anim");var S=this._getMapPanePos().subtract(_).round();this._panAnim.run(this._mapPane,S,M.duration||.25,M.easeLinearity)}else this._rawPanBy(_),this.fire("move").fire("moveend");return this},flyTo:function(_,M,S){if(S=S||{},S.animate===!1||!Rt.any3d)return this.setView(_,M,S);this._stop();var D=this.project(this.getCenter()),z=this.project(_),V=this.getSize(),nt=this._zoom;_=Kt(_),M=M===void 0?nt:M;var dt=Math.max(V.x,V.y),gt=dt*this.getZoomScale(nt,M),Mt=z.distanceTo(D)||1,Tt=1.42,It=Tt*Tt;function Vt(se){var xe=se?-1:1,Se=se?gt:dt,Ds=gt*gt-dt*dt+xe*It*It*Mt*Mt,He=2*Se*It*Mt,Nt=Ds/He,On=Math.sqrt(Nt*Nt+1)-Nt,xr=On<1e-9?-18:Math.log(On);return xr}function Ce(se){return(Math.exp(se)-Math.exp(-se))/2}function _e(se){return(Math.exp(se)+Math.exp(-se))/2}function Ze(se){return Ce(se)/_e(se)}var Pe=Vt(0);function mi(se){return dt*(_e(Pe)/_e(Pe+Tt*se))}function Ss(se){return dt*(_e(Pe)*Ze(Pe+Tt*se)-Ce(Pe))/It}function Cr(se){return 1-Math.pow(1-se,1.5)}var Oa=Date.now(),As=(Vt(1)-Pe)/Tt,Fa=S.duration?1e3*S.duration:1e3*As*.8;function Ts(){var se=(Date.now()-Oa)/Fa,xe=Cr(se)*As;se<=1?(this._flyToFrame=ue(Ts,this),this._move(this.unproject(D.add(z.subtract(D).multiplyBy(Ss(xe)/Mt)),nt),this.getScaleZoom(dt/mi(xe),nt),{flyTo:!0})):this._move(_,M)._moveEnd(!0)}return this._moveStart(!0,S.noMoveStart),Ts.call(this),this},flyToBounds:function(_,M){var S=this._getBoundsCenterZoom(_,M);return this.flyTo(S.center,S.zoom,M)},setMaxBounds:function(_){return _=le(_),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),_.isValid()?(this.options.maxBounds=_,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(_){var M=this.options.minZoom;return this.options.minZoom=_,this._loaded&&M!==_&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(_):this},setMaxZoom:function(_){var M=this.options.maxZoom;return this.options.maxZoom=_,this._loaded&&M!==_&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(_):this},panInsideBounds:function(_,M){this._enforcingBounds=!0;var S=this.getCenter(),D=this._limitCenter(S,this._zoom,le(_));return S.equals(D)||this.panTo(D,M),this._enforcingBounds=!1,this},panInside:function(_,M){M=M||{};var S=zt(M.paddingTopLeft||M.padding||[0,0]),D=zt(M.paddingBottomRight||M.padding||[0,0]),z=this.project(this.getCenter()),V=this.project(_),nt=this.getPixelBounds(),dt=we([nt.min.add(S),nt.max.subtract(D)]),gt=dt.getSize();if(!dt.contains(V)){this._enforcingBounds=!0;var Mt=V.subtract(dt.getCenter()),Tt=dt.extend(V).getSize().subtract(gt);z.x+=Mt.x<0?-Tt.x:Tt.x,z.y+=Mt.y<0?-Tt.y:Tt.y,this.panTo(this.unproject(z),M),this._enforcingBounds=!1}return this},invalidateSize:function(_){if(!this._loaded)return this;_=tt({animate:!1,pan:!0},_===!0?{animate:!0}:_);var M=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var S=this.getSize(),D=M.divideBy(2).round(),z=S.divideBy(2).round(),V=D.subtract(z);return!V.x&&!V.y?this:(_.animate&&_.pan?this.panBy(V):(_.pan&&this._rawPanBy(V),this.fire("move"),_.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(N(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:M,newSize:S}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(_){if(_=this._locateOptions=tt({timeout:1e4,watch:!1},_),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var M=N(this._handleGeolocationResponse,this),S=N(this._handleGeolocationError,this);return _.watch?this._locationWatchId=navigator.geolocation.watchPosition(M,S,_):navigator.geolocation.getCurrentPosition(M,S,_),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(_){if(this._container._leaflet_id){var M=_.code,S=_.message||(M===1?"permission denied":M===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:M,message:"Geolocation error: "+S+"."})}},_handleGeolocationResponse:function(_){if(this._container._leaflet_id){var M=_.coords.latitude,S=_.coords.longitude,D=new Qt(M,S),z=D.toBounds(_.coords.accuracy*2),V=this._locateOptions;if(V.setView){var nt=this.getBoundsZoom(z);this.setView(D,V.maxZoom?Math.min(nt,V.maxZoom):nt)}var dt={latlng:D,bounds:z,timestamp:_.timestamp};for(var gt in _.coords)typeof _.coords[gt]=="number"&&(dt[gt]=_.coords[gt]);this.fire("locationfound",dt)}},addHandler:function(_,M){if(!M)return this;var S=this[_]=new M(this);return this._handlers.push(S),this.options[_]&&S.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(),re(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Me(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var _;for(_ in this._layers)this._layers[_].remove();for(_ in this._panes)re(this._panes[_]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(_,M){var S="leaflet-pane"+(_?" leaflet-"+_.replace("Pane","")+"-pane":""),D=Yt("div",S,M||this._mapPane);return _&&(this._panes[_]=D),D},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var _=this.getPixelBounds(),M=this.unproject(_.getBottomLeft()),S=this.unproject(_.getTopRight());return new Ee(M,S)},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(_,M,S){_=le(_),S=zt(S||[0,0]);var D=this.getZoom()||0,z=this.getMinZoom(),V=this.getMaxZoom(),nt=_.getNorthWest(),dt=_.getSouthEast(),gt=this.getSize().subtract(S),Mt=we(this.project(dt,D),this.project(nt,D)).getSize(),Tt=Rt.any3d?this.options.zoomSnap:1,It=gt.x/Mt.x,Vt=gt.y/Mt.y,Ce=M?Math.max(It,Vt):Math.min(It,Vt);return D=this.getScaleZoom(Ce,D),Tt&&(D=Math.round(D/(Tt/100))*(Tt/100),D=M?Math.ceil(D/Tt)*Tt:Math.floor(D/Tt)*Tt),Math.max(z,Math.min(V,D))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new Gt(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(_,M){var S=this._getTopLeftPoint(_,M);return new ne(S,S.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(_){return this.options.crs.getProjectedBounds(_===void 0?this.getZoom():_)},getPane:function(_){return typeof _=="string"?this._panes[_]:_},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(_,M){var S=this.options.crs;return M=M===void 0?this._zoom:M,S.scale(_)/S.scale(M)},getScaleZoom:function(_,M){var S=this.options.crs;M=M===void 0?this._zoom:M;var D=S.zoom(_*S.scale(M));return isNaN(D)?1/0:D},project:function(_,M){return M=M===void 0?this._zoom:M,this.options.crs.latLngToPoint(Kt(_),M)},unproject:function(_,M){return M=M===void 0?this._zoom:M,this.options.crs.pointToLatLng(zt(_),M)},layerPointToLatLng:function(_){var M=zt(_).add(this.getPixelOrigin());return this.unproject(M)},latLngToLayerPoint:function(_){var M=this.project(Kt(_))._round();return M._subtract(this.getPixelOrigin())},wrapLatLng:function(_){return this.options.crs.wrapLatLng(Kt(_))},wrapLatLngBounds:function(_){return this.options.crs.wrapLatLngBounds(le(_))},distance:function(_,M){return this.options.crs.distance(Kt(_),Kt(M))},containerPointToLayerPoint:function(_){return zt(_).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(_){return zt(_).add(this._getMapPanePos())},containerPointToLatLng:function(_){var M=this.containerPointToLayerPoint(zt(_));return this.layerPointToLatLng(M)},latLngToContainerPoint:function(_){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Kt(_)))},mouseEventToContainerPoint:function(_){return sn(_,this._container)},mouseEventToLayerPoint:function(_){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(_))},mouseEventToLatLng:function(_){return this.layerPointToLatLng(this.mouseEventToLayerPoint(_))},_initContainer:function(_){var M=this._container=ts(_);if(M){if(M._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");jt(M,"scroll",this._onScroll,this),this._containerId=et(M)},_initLayout:function(){var _=this._container;this._fadeAnimated=this.options.fadeAnimation&&Rt.any3d,Ht(_,"leaflet-container"+(Rt.touch?" leaflet-touch":"")+(Rt.retina?" leaflet-retina":"")+(Rt.ielt9?" leaflet-oldie":"")+(Rt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var M=hi(_,"position");M!=="absolute"&&M!=="relative"&&M!=="fixed"&&M!=="sticky"&&(_.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var _=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),he(this._mapPane,new Gt(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Ht(_.markerPane,"leaflet-zoom-hide"),Ht(_.shadowPane,"leaflet-zoom-hide"))},_resetView:function(_,M,S){he(this._mapPane,new Gt(0,0));var D=!this._loaded;this._loaded=!0,M=this._limitZoom(M),this.fire("viewprereset");var z=this._zoom!==M;this._moveStart(z,S)._move(_,M)._moveEnd(z),this.fire("viewreset"),D&&this.fire("load")},_moveStart:function(_,M){return _&&this.fire("zoomstart"),M||this.fire("movestart"),this},_move:function(_,M,S,D){M===void 0&&(M=this._zoom);var z=this._zoom!==M;return this._zoom=M,this._lastCenter=_,this._pixelOrigin=this._getNewPixelOrigin(_),D?S&&S.pinch&&this.fire("zoom",S):((z||S&&S.pinch)&&this.fire("zoom",S),this.fire("move",S)),this},_moveEnd:function(_){return _&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return Me(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(_){he(this._mapPane,this._getMapPanePos().subtract(_))},_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(_){this._targets={},this._targets[et(this._container)]=this;var M=_?$t:jt;M(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&M(window,"resize",this._onResize,this),Rt.any3d&&this.options.transform3DLimit&&(_?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Me(this._resizeRequest),this._resizeRequest=ue(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var _=this._getMapPanePos();Math.max(Math.abs(_.x),Math.abs(_.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(_,M){for(var S=[],D,z=M==="mouseout"||M==="mouseover",V=_.target||_.srcElement,nt=!1;V;){if(D=this._targets[et(V)],D&&(M==="click"||M==="preclick")&&this._draggableMoved(D)){nt=!0;break}if(D&&D.listens(M,!0)&&(z&&!Cn(V,_)||(S.push(D),z))||V===this._container)break;V=V.parentNode}return!S.length&&!nt&&!z&&this.listens(M,!0)&&(S=[this]),S},_isClickDisabled:function(_){for(;_&&_!==this._container;){if(_._leaflet_disable_click)return!0;_=_.parentNode}},_handleDOMEvent:function(_){var M=_.target||_.srcElement;if(!(!this._loaded||M._leaflet_disable_events||_.type==="click"&&this._isClickDisabled(M))){var S=_.type;S==="mousedown"&&ir(M),this._fireDOMEvent(_,S)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(_,M,S){if(_.type==="click"){var D=tt({},_);D.type="preclick",this._fireDOMEvent(D,D.type,S)}var z=this._findEventTargets(_,M);if(S){for(var V=[],nt=0;nt<S.length;nt++)S[nt].listens(M,!0)&&V.push(S[nt]);z=V.concat(z)}if(z.length){M==="contextmenu"&&me(_);var dt=z[0],gt={originalEvent:_};if(_.type!=="keypress"&&_.type!=="keydown"&&_.type!=="keyup"){var Mt=dt.getLatLng&&(!dt._radius||dt._radius<=10);gt.containerPoint=Mt?this.latLngToContainerPoint(dt.getLatLng()):this.mouseEventToContainerPoint(_),gt.layerPoint=this.containerPointToLayerPoint(gt.containerPoint),gt.latlng=Mt?dt.getLatLng():this.layerPointToLatLng(gt.layerPoint)}for(nt=0;nt<z.length;nt++)if(z[nt].fire(M,gt,!0),gt.originalEvent._stopped||z[nt].options.bubblingMouseEvents===!1&&ei(this._mouseEvents,M)!==-1)return}},_draggableMoved:function(_){return _=_.dragging&&_.dragging.enabled()?_:this,_.dragging&&_.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var _=0,M=this._handlers.length;_<M;_++)this._handlers[_].disable()},whenReady:function(_,M){return this._loaded?_.call(M||this,{target:this}):this.on("load",_,M),this},_getMapPanePos:function(){return ci(this._mapPane)||new Gt(0,0)},_moved:function(){var _=this._getMapPanePos();return _&&!_.equals([0,0])},_getTopLeftPoint:function(_,M){var S=_&&M!==void 0?this._getNewPixelOrigin(_,M):this.getPixelOrigin();return S.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(_,M){var S=this.getSize()._divideBy(2);return this.project(_,M)._subtract(S)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(_,M,S){var D=this._getNewPixelOrigin(S,M);return this.project(_,M)._subtract(D)},_latLngBoundsToNewLayerBounds:function(_,M,S){var D=this._getNewPixelOrigin(S,M);return we([this.project(_.getSouthWest(),M)._subtract(D),this.project(_.getNorthWest(),M)._subtract(D),this.project(_.getSouthEast(),M)._subtract(D),this.project(_.getNorthEast(),M)._subtract(D)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(_){return this.latLngToLayerPoint(_).subtract(this._getCenterLayerPoint())},_limitCenter:function(_,M,S){if(!S)return _;var D=this.project(_,M),z=this.getSize().divideBy(2),V=new ne(D.subtract(z),D.add(z)),nt=this._getBoundsOffset(V,S,M);return Math.abs(nt.x)<=1&&Math.abs(nt.y)<=1?_:this.unproject(D.add(nt),M)},_limitOffset:function(_,M){if(!M)return _;var S=this.getPixelBounds(),D=new ne(S.min.add(_),S.max.add(_));return _.add(this._getBoundsOffset(D,M))},_getBoundsOffset:function(_,M,S){var D=we(this.project(M.getNorthEast(),S),this.project(M.getSouthWest(),S)),z=D.min.subtract(_.min),V=D.max.subtract(_.max),nt=this._rebound(z.x,-V.x),dt=this._rebound(z.y,-V.y);return new Gt(nt,dt)},_rebound:function(_,M){return _+M>0?Math.round(_-M)/2:Math.max(0,Math.ceil(_))-Math.max(0,Math.floor(M))},_limitZoom:function(_){var M=this.getMinZoom(),S=this.getMaxZoom(),D=Rt.any3d?this.options.zoomSnap:1;return D&&(_=Math.round(_/D)*D),Math.max(M,Math.min(S,_))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ae(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(_,M){var S=this._getCenterOffset(_)._trunc();return(M&&M.animate)!==!0&&!this.getSize().contains(S)?!1:(this.panBy(S,M),!0)},_createAnimProxy:function(){var _=this._proxy=Yt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(_),this.on("zoomanim",function(M){var S=Yn,D=this._proxy.style[S];bi(this._proxy,this.project(M.center,M.zoom),this.getZoomScale(M.zoom,1)),D===this._proxy.style[S]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){re(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var _=this.getCenter(),M=this.getZoom();bi(this._proxy,this.project(_,M),this.getZoomScale(M,1))},_catchTransitionEnd:function(_){this._animatingZoom&&_.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(_,M,S){if(this._animatingZoom)return!0;if(S=S||{},!this._zoomAnimated||S.animate===!1||this._nothingToAnimate()||Math.abs(M-this._zoom)>this.options.zoomAnimationThreshold)return!1;var D=this.getZoomScale(M),z=this._getCenterOffset(_)._divideBy(1-1/D);return S.animate!==!0&&!this.getSize().contains(z)?!1:(ue(function(){this._moveStart(!0,S.noMoveStart||!1)._animateZoom(_,M,!0)},this),!0)},_animateZoom:function(_,M,S,D){this._mapPane&&(S&&(this._animatingZoom=!0,this._animateToCenter=_,this._animateToZoom=M,Ht(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:_,zoom:M,noUpdate:D}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(N(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ae(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 xn(_,M){return new qt(_,M)}var Ue=ii.extend({options:{position:"topright"},initialize:function(_){St(this,_)},getPosition:function(){return this.options.position},setPosition:function(_){var M=this._map;return M&&M.removeControl(this),this.options.position=_,M&&M.addControl(this),this},getContainer:function(){return this._container},addTo:function(_){this.remove(),this._map=_;var M=this._container=this.onAdd(_),S=this.getPosition(),D=_._controlCorners[S];return Ht(M,"leaflet-control"),S.indexOf("bottom")!==-1?D.insertBefore(M,D.firstChild):D.appendChild(M),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(re(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(_){this._map&&_&&_.screenX>0&&_.screenY>0&&this._map.getContainer().focus()}}),Ii=function(_){return new Ue(_)};qt.include({addControl:function(_){return _.addTo(this),this},removeControl:function(_){return _.remove(),this},_initControlPos:function(){var _=this._controlCorners={},M="leaflet-",S=this._controlContainer=Yt("div",M+"control-container",this._container);function D(z,V){var nt=M+z+" "+M+V;_[z+V]=Yt("div",nt,S)}D("top","left"),D("top","right"),D("bottom","left"),D("bottom","right")},_clearControlPos:function(){for(var _ in this._controlCorners)re(this._controlCorners[_]);re(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var as=Ue.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(_,M,S,D){return S<D?-1:D<S?1:0}},initialize:function(_,M,S){St(this,S),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var D in _)this._addLayer(_[D],D);for(D in M)this._addLayer(M[D],D,!0)},onAdd:function(_){this._initLayout(),this._update(),this._map=_,_.on("zoomend",this._checkDisabledLayers,this);for(var M=0;M<this._layers.length;M++)this._layers[M].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(_){return Ue.prototype.addTo.call(this,_),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var _=0;_<this._layers.length;_++)this._layers[_].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(_,M){return this._addLayer(_,M),this._map?this._update():this},addOverlay:function(_,M){return this._addLayer(_,M,!0),this._map?this._update():this},removeLayer:function(_){_.off("add remove",this._onLayerChange,this);var M=this._getLayer(et(_));return M&&this._layers.splice(this._layers.indexOf(M),1),this._map?this._update():this},expand:function(){Ht(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var _=this._map.getSize().y-(this._container.offsetTop+50);return _<this._section.clientHeight?(Ht(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=_+"px"):ae(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ae(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var _="leaflet-control-layers",M=this._container=Yt("div",_),S=this.options.collapsed;M.setAttribute("aria-haspopup",!0),rn(M),or(M);var D=this._section=Yt("section",_+"-list");S&&(this._map.on("click",this.collapse,this),jt(M,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var z=this._layersLink=Yt("a",_+"-toggle",M);z.href="#",z.title="Layers",z.setAttribute("role","button"),jt(z,{keydown:function(V){V.keyCode===13&&this._expandSafely()},click:function(V){me(V),this._expandSafely()}},this),S||this.expand(),this._baseLayersList=Yt("div",_+"-base",D),this._separator=Yt("div",_+"-separator",D),this._overlaysList=Yt("div",_+"-overlays",D),M.appendChild(D)},_getLayer:function(_){for(var M=0;M<this._layers.length;M++)if(this._layers[M]&&et(this._layers[M].layer)===_)return this._layers[M]},_addLayer:function(_,M,S){this._map&&_.on("add remove",this._onLayerChange,this),this._layers.push({layer:_,name:M,overlay:S}),this.options.sortLayers&&this._layers.sort(N(function(D,z){return this.options.sortFunction(D.layer,z.layer,D.name,z.name)},this)),this.options.autoZIndex&&_.setZIndex&&(this._lastZIndex++,_.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Qi(this._baseLayersList),Qi(this._overlaysList),this._layerControlInputs=[];var _,M,S,D,z=0;for(S=0;S<this._layers.length;S++)D=this._layers[S],this._addItem(D),M=M||D.overlay,_=_||!D.overlay,z+=D.overlay?0:1;return this.options.hideSingleBase&&(_=_&&z>1,this._baseLayersList.style.display=_?"":"none"),this._separator.style.display=M&&_?"":"none",this},_onLayerChange:function(_){this._handlingClick||this._update();var M=this._getLayer(et(_.target)),S=M.overlay?_.type==="add"?"overlayadd":"overlayremove":_.type==="add"?"baselayerchange":null;S&&this._map.fire(S,M)},_createRadioElement:function(_,M){var S='<input type="radio" class="leaflet-control-layers-selector" name="'+_+'"'+(M?' checked="checked"':"")+"/>",D=document.createElement("div");return D.innerHTML=S,D.firstChild},_addItem:function(_){var M=document.createElement("label"),S=this._map.hasLayer(_.layer),D;_.overlay?(D=document.createElement("input"),D.type="checkbox",D.className="leaflet-control-layers-selector",D.defaultChecked=S):D=this._createRadioElement("leaflet-base-layers_"+et(this),S),this._layerControlInputs.push(D),D.layerId=et(_.layer),jt(D,"click",this._onInputClick,this);var z=document.createElement("span");z.innerHTML=" "+_.name;var V=document.createElement("span");M.appendChild(V),V.appendChild(D),V.appendChild(z);var nt=_.overlay?this._overlaysList:this._baseLayersList;return nt.appendChild(M),this._checkDisabledLayers(),M},_onInputClick:function(){if(!this._preventClick){var _=this._layerControlInputs,M,S,D=[],z=[];this._handlingClick=!0;for(var V=_.length-1;V>=0;V--)M=_[V],S=this._getLayer(M.layerId).layer,M.checked?D.push(S):M.checked||z.push(S);for(V=0;V<z.length;V++)this._map.hasLayer(z[V])&&this._map.removeLayer(z[V]);for(V=0;V<D.length;V++)this._map.hasLayer(D[V])||this._map.addLayer(D[V]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var _=this._layerControlInputs,M,S,D=this._map.getZoom(),z=_.length-1;z>=0;z--)M=_[z],S=this._getLayer(M.layerId).layer,M.disabled=S.options.minZoom!==void 0&&D<S.options.minZoom||S.options.maxZoom!==void 0&&D>S.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var _=this._section;this._preventClick=!0,jt(_,"click",me),this.expand();var M=this;setTimeout(function(){$t(_,"click",me),M._preventClick=!1})}}),ur=function(_,M,S){return new as(_,M,S)},zi=Ue.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(_){var M="leaflet-control-zoom",S=Yt("div",M+" leaflet-bar"),D=this.options;return this._zoomInButton=this._createButton(D.zoomInText,D.zoomInTitle,M+"-in",S,this._zoomIn),this._zoomOutButton=this._createButton(D.zoomOutText,D.zoomOutTitle,M+"-out",S,this._zoomOut),this._updateDisabled(),_.on("zoomend zoomlevelschange",this._updateDisabled,this),S},onRemove:function(_){_.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(_){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(_.shiftKey?3:1))},_zoomOut:function(_){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(_.shiftKey?3:1))},_createButton:function(_,M,S,D,z){var V=Yt("a",S,D);return V.innerHTML=_,V.href="#",V.title=M,V.setAttribute("role","button"),V.setAttribute("aria-label",M),rn(V),jt(V,"click",xi),jt(V,"click",z,this),jt(V,"click",this._refocusOnMap,this),V},_updateDisabled:function(){var _=this._map,M="leaflet-disabled";ae(this._zoomInButton,M),ae(this._zoomOutButton,M),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||_._zoom===_.getMinZoom())&&(Ht(this._zoomOutButton,M),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||_._zoom===_.getMaxZoom())&&(Ht(this._zoomInButton,M),this._zoomInButton.setAttribute("aria-disabled","true"))}});qt.mergeOptions({zoomControl:!0}),qt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new zi,this.addControl(this.zoomControl))});var ga=function(_){return new zi(_)},ri=Ue.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(_){var M="leaflet-control-scale",S=Yt("div",M),D=this.options;return this._addScales(D,M+"-line",S),_.on(D.updateWhenIdle?"moveend":"move",this._update,this),_.whenReady(this._update,this),S},onRemove:function(_){_.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(_,M,S){_.metric&&(this._mScale=Yt("div",M,S)),_.imperial&&(this._iScale=Yt("div",M,S))},_update:function(){var _=this._map,M=_.getSize().y/2,S=_.distance(_.containerPointToLatLng([0,M]),_.containerPointToLatLng([this.options.maxWidth,M]));this._updateScales(S)},_updateScales:function(_){this.options.metric&&_&&this._updateMetric(_),this.options.imperial&&_&&this._updateImperial(_)},_updateMetric:function(_){var M=this._getRoundNum(_),S=M<1e3?M+" m":M/1e3+" km";this._updateScale(this._mScale,S,M/_)},_updateImperial:function(_){var M=_*3.2808399,S,D,z;M>5280?(S=M/5280,D=this._getRoundNum(S),this._updateScale(this._iScale,D+" mi",D/S)):(z=this._getRoundNum(M),this._updateScale(this._iScale,z+" ft",z/M))},_updateScale:function(_,M,S){_.style.width=Math.round(this.options.maxWidth*S)+"px",_.innerHTML=M},_getRoundNum:function(_){var M=Math.pow(10,(Math.floor(_)+"").length-1),S=_/M;return S=S>=10?10:S>=5?5:S>=3?3:S>=2?2:1,M*S}}),os=function(_){return new ri(_)},Ni='<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>',lr=Ue.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Rt.inlineSvg?Ni+" ":"")+"Leaflet</a>"},initialize:function(_){St(this,_),this._attributions={}},onAdd:function(_){_.attributionControl=this,this._container=Yt("div","leaflet-control-attribution"),rn(this._container);for(var M in _._layers)_._layers[M].getAttribution&&this.addAttribution(_._layers[M].getAttribution());return this._update(),_.on("layeradd",this._addAttribution,this),this._container},onRemove:function(_){_.off("layeradd",this._addAttribution,this)},_addAttribution:function(_){_.layer.getAttribution&&(this.addAttribution(_.layer.getAttribution()),_.layer.once("remove",function(){this.removeAttribution(_.layer.getAttribution())},this))},setPrefix:function(_){return this.options.prefix=_,this._update(),this},addAttribution:function(_){return _?(this._attributions[_]||(this._attributions[_]=0),this._attributions[_]++,this._update(),this):this},removeAttribution:function(_){return _?(this._attributions[_]&&(this._attributions[_]--,this._update()),this):this},_update:function(){if(this._map){var _=[];for(var M in this._attributions)this._attributions[M]&&_.push(M);var S=[];this.options.prefix&&S.push(this.options.prefix),_.length&&S.push(_.join(", ")),this._container.innerHTML=S.join(' <span aria-hidden="true">|</span> ')}}});qt.mergeOptions({attributionControl:!0}),qt.addInitHook(function(){this.options.attributionControl&&new lr().addTo(this)});var ya=function(_){return new lr(_)};Ue.Layers=as,Ue.Zoom=zi,Ue.Scale=ri,Ue.Attribution=lr,Ii.layers=ur,Ii.zoom=ga,Ii.scale=os,Ii.attribution=ya;var Ke=ii.extend({initialize:function(_){this._map=_},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}});Ke.addTo=function(_,M){return _.addHandler(M,this),this};var va={Events:Te},us=Rt.touch?"touchstart mousedown":"mousedown",di=Yi.extend({options:{clickTolerance:3},initialize:function(_,M,S,D){St(this,D),this._element=_,this._dragStartTarget=M||_,this._preventOutline=S},enable:function(){this._enabled||(jt(this._dragStartTarget,us,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(di._dragging===this&&this.finishDrag(!0),$t(this._dragStartTarget,us,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(_){if(this._enabled&&(this._moved=!1,!$n(this._element,"leaflet-zoom-anim"))){if(_.touches&&_.touches.length!==1){di._dragging===this&&this.finishDrag();return}if(!(di._dragging||_.shiftKey||_.which!==1&&_.button!==1&&!_.touches)&&(di._dragging=this,this._preventOutline&&ir(this._element),Qn(),tn(),!this._moving)){this.fire("down");var M=_.touches?_.touches[0]:_,S=es(this._element);this._startPoint=new Gt(M.clientX,M.clientY),this._startPos=ci(this._element),this._parentScale=nr(S);var D=_.type==="mousedown";jt(document,D?"mousemove":"touchmove",this._onMove,this),jt(document,D?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(_){if(this._enabled){if(_.touches&&_.touches.length>1){this._moved=!0;return}var M=_.touches&&_.touches.length===1?_.touches[0]:_,S=new Gt(M.clientX,M.clientY)._subtract(this._startPoint);!S.x&&!S.y||Math.abs(S.x)+Math.abs(S.y)<this.options.clickTolerance||(S.x/=this._parentScale.x,S.y/=this._parentScale.y,me(_),this._moved||(this.fire("dragstart"),this._moved=!0,Ht(document.body,"leaflet-dragging"),this._lastTarget=_.target||_.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Ht(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(S),this._moving=!0,this._lastEvent=_,this._updatePosition())}},_updatePosition:function(){var _={originalEvent:this._lastEvent};this.fire("predrag",_),he(this._element,this._newPos),this.fire("drag",_)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(_){ae(document.body,"leaflet-dragging"),this._lastTarget&&(ae(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),$t(document,"mousemove touchmove",this._onMove,this),$t(document,"mouseup touchend touchcancel",this._onUp,this),tr(),en();var M=this._moved&&this._moving;this._moving=!1,di._dragging=!1,M&&this.fire("dragend",{noInertia:_,distance:this._newPos.distanceTo(this._startPos)})}});function ls(_,M,S){var D,z=[1,4,2,8],V,nt,dt,gt,Mt,Tt,It,Vt;for(V=0,Tt=_.length;V<Tt;V++)_[V]._code=pi(_[V],M);for(dt=0;dt<4;dt++){for(It=z[dt],D=[],V=0,Tt=_.length,nt=Tt-1;V<Tt;nt=V++)gt=_[V],Mt=_[nt],gt._code&It?Mt._code&It||(Vt=kn(Mt,gt,It,M,S),Vt._code=pi(Vt,M),D.push(Vt)):(Mt._code&It&&(Vt=kn(Mt,gt,It,M,S),Vt._code=pi(Vt,M),D.push(Vt)),D.push(gt));_=D}return _}function hs(_,M){var S,D,z,V,nt,dt,gt,Mt,Tt;if(!_||_.length===0)throw new Error("latlngs not passed");ze(_)||(console.warn("latlngs are not flat! Only the first ring will be used"),_=_[0]);var It=Kt([0,0]),Vt=le(_),Ce=Vt.getNorthWest().distanceTo(Vt.getSouthWest())*Vt.getNorthEast().distanceTo(Vt.getNorthWest());Ce<1700&&(It=hr(_));var _e=_.length,Ze=[];for(S=0;S<_e;S++){var Pe=Kt(_[S]);Ze.push(M.project(Kt([Pe.lat-It.lat,Pe.lng-It.lng])))}for(dt=gt=Mt=0,S=0,D=_e-1;S<_e;D=S++)z=Ze[S],V=Ze[D],nt=z.y*V.x-V.y*z.x,gt+=(z.x+V.x)*nt,Mt+=(z.y+V.y)*nt,dt+=nt*3;dt===0?Tt=Ze[0]:Tt=[gt/dt,Mt/dt];var mi=M.unproject(zt(Tt));return Kt([mi.lat+It.lat,mi.lng+It.lng])}function hr(_){for(var M=0,S=0,D=0,z=0;z<_.length;z++){var V=Kt(_[z]);M+=V.lat,S+=V.lng,D++}return Kt([M/D,S/D])}var cs={__proto__:null,clipPolygon:ls,polygonCenter:hs,centroid:hr};function ds(_,M){if(!M||!_.length)return _.slice();var S=M*M;return _=Gi(_,S),_=La(_,S),_}function fe(_,M,S){return Math.sqrt(ji(_,M,S,!0))}function De(_,M,S){return ji(_,M,S)}function La(_,M){var S=_.length,D=typeof Uint8Array<"u"?Uint8Array:Array,z=new D(S);z[0]=z[S-1]=1,We(_,z,M,0,S-1);var V,nt=[];for(V=0;V<S;V++)z[V]&&nt.push(_[V]);return nt}function We(_,M,S,D,z){var V=0,nt,dt,gt;for(dt=D+1;dt<=z-1;dt++)gt=ji(_[dt],_[D],_[z],!0),gt>V&&(nt=dt,V=gt);V>S&&(M[nt]=1,We(_,M,S,D,nt),We(_,M,S,nt,z))}function Gi(_,M){for(var S=[_[0]],D=1,z=0,V=_.length;D<V;D++)Zi(_[D],_[z])>M&&(S.push(_[D]),z=D);return z<V-1&&S.push(_[V-1]),S}var an;function Ie(_,M,S,D,z){var V=D?an:pi(_,S),nt=pi(M,S),dt,gt,Mt;for(an=nt;;){if(!(V|nt))return[_,M];if(V&nt)return!1;dt=V||nt,gt=kn(_,M,dt,S,z),Mt=pi(gt,S),dt===V?(_=gt,V=Mt):(M=gt,nt=Mt)}}function kn(_,M,S,D,z){var V=M.x-_.x,nt=M.y-_.y,dt=D.min,gt=D.max,Mt,Tt;return S&8?(Mt=_.x+V*(gt.y-_.y)/nt,Tt=gt.y):S&4?(Mt=_.x+V*(dt.y-_.y)/nt,Tt=dt.y):S&2?(Mt=gt.x,Tt=_.y+nt*(gt.x-_.x)/V):S&1&&(Mt=dt.x,Tt=_.y+nt*(dt.x-_.x)/V),new Gt(Mt,Tt,z)}function pi(_,M){var S=0;return _.x<M.min.x?S|=1:_.x>M.max.x&&(S|=2),_.y<M.min.y?S|=4:_.y>M.max.y&&(S|=8),S}function Zi(_,M){var S=M.x-_.x,D=M.y-_.y;return S*S+D*D}function ji(_,M,S,D){var z=M.x,V=M.y,nt=S.x-z,dt=S.y-V,gt=nt*nt+dt*dt,Mt;return gt>0&&(Mt=((_.x-z)*nt+(_.y-V)*dt)/gt,Mt>1?(z=S.x,V=S.y):Mt>0&&(z+=nt*Mt,V+=dt*Mt)),nt=_.x-z,dt=_.y-V,D?nt*nt+dt*dt:new Gt(z,V)}function ze(_){return!ie(_[0])||typeof _[0][0]!="object"&&typeof _[0][0]<"u"}function ps(_){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),ze(_)}function fs(_,M){var S,D,z,V,nt,dt,gt,Mt;if(!_||_.length===0)throw new Error("latlngs not passed");ze(_)||(console.warn("latlngs are not flat! Only the first ring will be used"),_=_[0]);var Tt=Kt([0,0]),It=le(_),Vt=It.getNorthWest().distanceTo(It.getSouthWest())*It.getNorthEast().distanceTo(It.getNorthWest());Vt<1700&&(Tt=hr(_));var Ce=_.length,_e=[];for(S=0;S<Ce;S++){var Ze=Kt(_[S]);_e.push(M.project(Kt([Ze.lat-Tt.lat,Ze.lng-Tt.lng])))}for(S=0,D=0;S<Ce-1;S++)D+=_e[S].distanceTo(_e[S+1])/2;if(D===0)Mt=_e[0];else for(S=0,V=0;S<Ce-1;S++)if(nt=_e[S],dt=_e[S+1],z=nt.distanceTo(dt),V+=z,V>D){gt=(V-D)/z,Mt=[dt.x-gt*(dt.x-nt.x),dt.y-gt*(dt.y-nt.y)];break}var Pe=M.unproject(zt(Mt));return Kt([Pe.lat+Tt.lat,Pe.lng+Tt.lng])}var Mn={__proto__:null,simplify:ds,pointToSegmentDistance:fe,closestPointOnSegment:De,clipSegment:Ie,_getEdgeIntersection:kn,_getBitCode:pi,_sqClosestPointOnSegment:ji,isFlat:ze,_flat:ps,polylineCenter:fs},wn={project:function(_){return new Gt(_.lng,_.lat)},unproject:function(_){return new Qt(_.y,_.x)},bounds:new ne([-180,-90],[180,90])},cr={R:6378137,R_MINOR:6356752314245179e-9,bounds:new ne([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(_){var M=Math.PI/180,S=this.R,D=_.lat*M,z=this.R_MINOR/S,V=Math.sqrt(1-z*z),nt=V*Math.sin(D),dt=Math.tan(Math.PI/4-D/2)/Math.pow((1-nt)/(1+nt),V/2);return D=-S*Math.log(Math.max(dt,1e-10)),new Gt(_.lng*M*S,D)},unproject:function(_){for(var M=180/Math.PI,S=this.R,D=this.R_MINOR/S,z=Math.sqrt(1-D*D),V=Math.exp(-_.y/S),nt=Math.PI/2-2*Math.atan(V),dt=0,gt=.1,Mt;dt<15&&Math.abs(gt)>1e-7;dt++)Mt=z*Math.sin(nt),Mt=Math.pow((1-Mt)/(1+Mt),z/2),gt=Math.PI/2-2*Math.atan(V*Mt)-nt,nt+=gt;return new Qt(nt*M,_.x*M/S)}},_s={__proto__:null,LonLat:wn,Mercator:cr,SphericalMercator:zn},ba=tt({},li,{code:"EPSG:3395",projection:cr,transformation:(function(){var _=.5/(Math.PI*cr.R);return Xi(_,.5,-_,.5)})()}),dr=tt({},li,{code:"EPSG:4326",projection:wn,transformation:Xi(1/180,1,-1/180,.5)}),Ca=tt({},ni,{projection:wn,transformation:Xi(1,0,-1,0),scale:function(_){return Math.pow(2,_)},zoom:function(_){return Math.log(_)/Math.LN2},distance:function(_,M){var S=M.lng-_.lng,D=M.lat-_.lat;return Math.sqrt(S*S+D*D)},infinite:!0});ni.Earth=li,ni.EPSG3395=ba,ni.EPSG3857=Gn,ni.EPSG900913=Sr,ni.EPSG4326=dr,ni.Simple=Ca;var Be=Yi.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(_){return _.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(_){return _&&_.removeLayer(this),this},getPane:function(_){return this._map.getPane(_?this.options[_]||_:this.options.pane)},addInteractiveTarget:function(_){return this._map._targets[et(_)]=this,this},removeInteractiveTarget:function(_){return delete this._map._targets[et(_)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(_){var M=_.target;if(M.hasLayer(this)){if(this._map=M,this._zoomAnimated=M._zoomAnimated,this.getEvents){var S=this.getEvents();M.on(S,this),this.once("remove",function(){M.off(S,this)},this)}this.onAdd(M),this.fire("add"),M.fire("layeradd",{layer:this})}}});qt.include({addLayer:function(_){if(!_._layerAdd)throw new Error("The provided object is not a Layer.");var M=et(_);return this._layers[M]?this:(this._layers[M]=_,_._mapToAdd=this,_.beforeAdd&&_.beforeAdd(this),this.whenReady(_._layerAdd,_),this)},removeLayer:function(_){var M=et(_);return this._layers[M]?(this._loaded&&_.onRemove(this),delete this._layers[M],this._loaded&&(this.fire("layerremove",{layer:_}),_.fire("remove")),_._map=_._mapToAdd=null,this):this},hasLayer:function(_){return et(_)in this._layers},eachLayer:function(_,M){for(var S in this._layers)_.call(M,this._layers[S]);return this},_addLayers:function(_){_=_?ie(_)?_:[_]:[];for(var M=0,S=_.length;M<S;M++)this.addLayer(_[M])},_addZoomLimit:function(_){(!isNaN(_.options.maxZoom)||!isNaN(_.options.minZoom))&&(this._zoomBoundLayers[et(_)]=_,this._updateZoomLevels())},_removeZoomLimit:function(_){var M=et(_);this._zoomBoundLayers[M]&&(delete this._zoomBoundLayers[M],this._updateZoomLevels())},_updateZoomLevels:function(){var _=1/0,M=-1/0,S=this._getZoomSpan();for(var D in this._zoomBoundLayers){var z=this._zoomBoundLayers[D].options;_=z.minZoom===void 0?_:Math.min(_,z.minZoom),M=z.maxZoom===void 0?M:Math.max(M,z.maxZoom)}this._layersMaxZoom=M===-1/0?void 0:M,this._layersMinZoom=_===1/0?void 0:_,S!==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 si=Be.extend({initialize:function(_,M){St(this,M),this._layers={};var S,D;if(_)for(S=0,D=_.length;S<D;S++)this.addLayer(_[S])},addLayer:function(_){var M=this.getLayerId(_);return this._layers[M]=_,this._map&&this._map.addLayer(_),this},removeLayer:function(_){var M=_ in this._layers?_:this.getLayerId(_);return this._map&&this._layers[M]&&this._map.removeLayer(this._layers[M]),delete this._layers[M],this},hasLayer:function(_){var M=typeof _=="number"?_:this.getLayerId(_);return M in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(_){var M=Array.prototype.slice.call(arguments,1),S,D;for(S in this._layers)D=this._layers[S],D[_]&&D[_].apply(D,M);return this},onAdd:function(_){this.eachLayer(_.addLayer,_)},onRemove:function(_){this.eachLayer(_.removeLayer,_)},eachLayer:function(_,M){for(var S in this._layers)_.call(M,this._layers[S]);return this},getLayer:function(_){return this._layers[_]},getLayers:function(){var _=[];return this.eachLayer(_.push,_),_},setZIndex:function(_){return this.invoke("setZIndex",_)},getLayerId:function(_){return et(_)}}),En=function(_,M){return new si(_,M)},Ye=si.extend({addLayer:function(_){return this.hasLayer(_)?this:(_.addEventParent(this),si.prototype.addLayer.call(this,_),this.fire("layeradd",{layer:_}))},removeLayer:function(_){return this.hasLayer(_)?(_ in this._layers&&(_=this._layers[_]),_.removeEventParent(this),si.prototype.removeLayer.call(this,_),this.fire("layerremove",{layer:_})):this},setStyle:function(_){return this.invoke("setStyle",_)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var _=new Ee;for(var M in this._layers){var S=this._layers[M];_.extend(S.getBounds?S.getBounds():S.getLatLng())}return _}}),xa=function(_,M){return new Ye(_,M)},Ui=ii.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(_){St(this,_)},createIcon:function(_){return this._createIcon("icon",_)},createShadow:function(_){return this._createIcon("shadow",_)},_createIcon:function(_,M){var S=this._getIconUrl(_);if(!S){if(_==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var D=this._createImg(S,M&&M.tagName==="IMG"?M:null);return this._setIconStyles(D,_),(this.options.crossOrigin||this.options.crossOrigin==="")&&(D.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),D},_setIconStyles:function(_,M){var S=this.options,D=S[M+"Size"];typeof D=="number"&&(D=[D,D]);var z=zt(D),V=zt(M==="shadow"&&S.shadowAnchor||S.iconAnchor||z&&z.divideBy(2,!0));_.className="leaflet-marker-"+M+" "+(S.className||""),V&&(_.style.marginLeft=-V.x+"px",_.style.marginTop=-V.y+"px"),z&&(_.style.width=z.x+"px",_.style.height=z.y+"px")},_createImg:function(_,M){return M=M||document.createElement("img"),M.src=_,M},_getIconUrl:function(_){return Rt.retina&&this.options[_+"RetinaUrl"]||this.options[_+"Url"]}});function ka(_){return new Ui(_)}var on=Ui.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(_){return typeof on.imagePath!="string"&&(on.imagePath=this._detectIconPath()),(this.options.imagePath||on.imagePath)+Ui.prototype._getIconUrl.call(this,_)},_stripUrl:function(_){var M=function(S,D,z){var V=D.exec(S);return V&&V[z]};return _=M(_,/^url\((['"])?(.+)\1\)$/,2),_&&M(_,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var _=Yt("div","leaflet-default-icon-path",document.body),M=hi(_,"background-image")||hi(_,"backgroundImage");if(document.body.removeChild(_),M=this._stripUrl(M),M)return M;var S=document.querySelector('link[href$="leaflet.css"]');return S?S.href.substring(0,S.href.length-11-1):""}}),ms=Ke.extend({initialize:function(_){this._marker=_},addHooks:function(){var _=this._marker._icon;this._draggable||(this._draggable=new di(_,_,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Ht(_,"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&&ae(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(_){var M=this._marker,S=M._map,D=this._marker.options.autoPanSpeed,z=this._marker.options.autoPanPadding,V=ci(M._icon),nt=S.getPixelBounds(),dt=S.getPixelOrigin(),gt=we(nt.min._subtract(dt).add(z),nt.max._subtract(dt).subtract(z));if(!gt.contains(V)){var Mt=zt((Math.max(gt.max.x,V.x)-gt.max.x)/(nt.max.x-gt.max.x)-(Math.min(gt.min.x,V.x)-gt.min.x)/(nt.min.x-gt.min.x),(Math.max(gt.max.y,V.y)-gt.max.y)/(nt.max.y-gt.max.y)-(Math.min(gt.min.y,V.y)-gt.min.y)/(nt.min.y-gt.min.y)).multiplyBy(D);S.panBy(Mt,{animate:!1}),this._draggable._newPos._add(Mt),this._draggable._startPos._add(Mt),he(M._icon,this._draggable._newPos),this._onDrag(_),this._panRequest=ue(this._adjustPan.bind(this,_))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(_){this._marker.options.autoPan&&(Me(this._panRequest),this._panRequest=ue(this._adjustPan.bind(this,_)))},_onDrag:function(_){var M=this._marker,S=M._shadow,D=ci(M._icon),z=M._map.layerPointToLatLng(D);S&&he(S,D),M._latlng=z,_.latlng=z,_.oldLatLng=this._oldLatLng,M.fire("move",_).fire("drag",_)},_onDragEnd:function(_){Me(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",_)}}),Bn=Be.extend({options:{icon:new on,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(_,M){St(this,M),this._latlng=Kt(_)},onAdd:function(_){this._zoomAnimated=this._zoomAnimated&&_.options.markerZoomAnimation,this._zoomAnimated&&_.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(_){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&_.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(_){var M=this._latlng;return this._latlng=Kt(_),this.update(),this.fire("move",{oldLatLng:M,latlng:this._latlng})},setZIndexOffset:function(_){return this.options.zIndexOffset=_,this.update()},getIcon:function(){return this.options.icon},setIcon:function(_){return this.options.icon=_,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 _=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(_)}return this},_initIcon:function(){var _=this.options,M="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),S=_.icon.createIcon(this._icon),D=!1;S!==this._icon&&(this._icon&&this._removeIcon(),D=!0,_.title&&(S.title=_.title),S.tagName==="IMG"&&(S.alt=_.alt||"")),Ht(S,M),_.keyboard&&(S.tabIndex="0",S.setAttribute("role","button")),this._icon=S,_.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&jt(S,"focus",this._panOnFocus,this);var z=_.icon.createShadow(this._shadow),V=!1;z!==this._shadow&&(this._removeShadow(),V=!0),z&&(Ht(z,M),z.alt=""),this._shadow=z,_.opacity<1&&this._updateOpacity(),D&&this.getPane().appendChild(this._icon),this._initInteraction(),z&&V&&this.getPane(_.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&$t(this._icon,"focus",this._panOnFocus,this),re(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&re(this._shadow),this._shadow=null},_setPos:function(_){this._icon&&he(this._icon,_),this._shadow&&he(this._shadow,_),this._zIndex=_.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(_){this._icon&&(this._icon.style.zIndex=this._zIndex+_)},_animateZoom:function(_){var M=this._map._latLngToNewLayerPoint(this._latlng,_.zoom,_.center).round();this._setPos(M)},_initInteraction:function(){if(this.options.interactive&&(Ht(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),ms)){var _=this.options.draggable;this.dragging&&(_=this.dragging.enabled(),this.dragging.disable()),this.dragging=new ms(this),_&&this.dragging.enable()}},setOpacity:function(_){return this.options.opacity=_,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var _=this.options.opacity;this._icon&&Re(this._icon,_),this._shadow&&Re(this._shadow,_)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var _=this._map;if(_){var M=this.options.icon.options,S=M.iconSize?zt(M.iconSize):zt(0,0),D=M.iconAnchor?zt(M.iconAnchor):zt(0,0);_.panInside(this._latlng,{paddingTopLeft:D,paddingBottomRight:S.subtract(D)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function gs(_,M){return new Bn(_,M)}var Ne=Be.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(_){this._renderer=_.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(_){return St(this,_),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&_&&Object.prototype.hasOwnProperty.call(_,"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)}}),Pn=Ne.extend({options:{fill:!0,radius:10},initialize:function(_,M){St(this,M),this._latlng=Kt(_),this._radius=this.options.radius},setLatLng:function(_){var M=this._latlng;return this._latlng=Kt(_),this.redraw(),this.fire("move",{oldLatLng:M,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(_){return this.options.radius=this._radius=_,this.redraw()},getRadius:function(){return this._radius},setStyle:function(_){var M=_&&_.radius||this._radius;return Ne.prototype.setStyle.call(this,_),this.setRadius(M),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var _=this._radius,M=this._radiusY||_,S=this._clickTolerance(),D=[_+S,M+S];this._pxBounds=new ne(this._point.subtract(D),this._point.add(D))},_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(_){return _.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function pr(_,M){return new Pn(_,M)}var Hi=Pn.extend({initialize:function(_,M,S){if(typeof M=="number"&&(M=tt({},S,{radius:M})),St(this,M),this._latlng=Kt(_),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(_){return this._mRadius=_,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var _=[this._radius,this._radiusY||this._radius];return new Ee(this._map.layerPointToLatLng(this._point.subtract(_)),this._map.layerPointToLatLng(this._point.add(_)))},setStyle:Ne.prototype.setStyle,_project:function(){var _=this._latlng.lng,M=this._latlng.lat,S=this._map,D=S.options.crs;if(D.distance===li.distance){var z=Math.PI/180,V=this._mRadius/li.R/z,nt=S.project([M+V,_]),dt=S.project([M-V,_]),gt=nt.add(dt).divideBy(2),Mt=S.unproject(gt).lat,Tt=Math.acos((Math.cos(V*z)-Math.sin(M*z)*Math.sin(Mt*z))/(Math.cos(M*z)*Math.cos(Mt*z)))/z;(isNaN(Tt)||Tt===0)&&(Tt=V/Math.cos(Math.PI/180*M)),this._point=gt.subtract(S.getPixelOrigin()),this._radius=isNaN(Tt)?0:gt.x-S.project([Mt,_-Tt]).x,this._radiusY=gt.y-nt.y}else{var It=D.unproject(D.project(this._latlng).subtract([this._mRadius,0]));this._point=S.latLngToLayerPoint(this._latlng),this._radius=this._point.x-S.latLngToLayerPoint(It).x}this._updateBounds()}});function Ma(_,M,S){return new Hi(_,M,S)}var ai=Ne.extend({options:{smoothFactor:1,noClip:!1},initialize:function(_,M){St(this,M),this._setLatLngs(_)},getLatLngs:function(){return this._latlngs},setLatLngs:function(_){return this._setLatLngs(_),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(_){for(var M=1/0,S=null,D=ji,z,V,nt=0,dt=this._parts.length;nt<dt;nt++)for(var gt=this._parts[nt],Mt=1,Tt=gt.length;Mt<Tt;Mt++){z=gt[Mt-1],V=gt[Mt];var It=D(_,z,V,!0);It<M&&(M=It,S=D(_,z,V))}return S&&(S.distance=Math.sqrt(M)),S},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return fs(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(_,M){return M=M||this._defaultShape(),_=Kt(_),M.push(_),this._bounds.extend(_),this.redraw()},_setLatLngs:function(_){this._bounds=new Ee,this._latlngs=this._convertLatLngs(_)},_defaultShape:function(){return ze(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(_){for(var M=[],S=ze(_),D=0,z=_.length;D<z;D++)S?(M[D]=Kt(_[D]),this._bounds.extend(M[D])):M[D]=this._convertLatLngs(_[D]);return M},_project:function(){var _=new ne;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,_),this._bounds.isValid()&&_.isValid()&&(this._rawPxBounds=_,this._updateBounds())},_updateBounds:function(){var _=this._clickTolerance(),M=new Gt(_,_);this._rawPxBounds&&(this._pxBounds=new ne([this._rawPxBounds.min.subtract(M),this._rawPxBounds.max.add(M)]))},_projectLatlngs:function(_,M,S){var D=_[0]instanceof Qt,z=_.length,V,nt;if(D){for(nt=[],V=0;V<z;V++)nt[V]=this._map.latLngToLayerPoint(_[V]),S.extend(nt[V]);M.push(nt)}else for(V=0;V<z;V++)this._projectLatlngs(_[V],M,S)},_clipPoints:function(){var _=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(_))){if(this.options.noClip){this._parts=this._rings;return}var M=this._parts,S,D,z,V,nt,dt,gt;for(S=0,z=0,V=this._rings.length;S<V;S++)for(gt=this._rings[S],D=0,nt=gt.length;D<nt-1;D++)dt=Ie(gt[D],gt[D+1],_,D,!0),dt&&(M[z]=M[z]||[],M[z].push(dt[0]),(dt[1]!==gt[D+1]||D===nt-2)&&(M[z].push(dt[1]),z++))}},_simplifyPoints:function(){for(var _=this._parts,M=this.options.smoothFactor,S=0,D=_.length;S<D;S++)_[S]=ds(_[S],M)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(_,M){var S,D,z,V,nt,dt,gt=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(_))return!1;for(S=0,V=this._parts.length;S<V;S++)for(dt=this._parts[S],D=0,nt=dt.length,z=nt-1;D<nt;z=D++)if(!(!M&&D===0)&&fe(_,dt[z],dt[D])<=gt)return!0;return!1}});function fr(_,M){return new ai(_,M)}ai._flat=ps;var Le=ai.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 hs(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(_){var M=ai.prototype._convertLatLngs.call(this,_),S=M.length;return S>=2&&M[0]instanceof Qt&&M[0].equals(M[S-1])&&M.pop(),M},_setLatLngs:function(_){ai.prototype._setLatLngs.call(this,_),ze(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return ze(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var _=this._renderer._bounds,M=this.options.weight,S=new Gt(M,M);if(_=new ne(_.min.subtract(S),_.max.add(S)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(_))){if(this.options.noClip){this._parts=this._rings;return}for(var D=0,z=this._rings.length,V;D<z;D++)V=ls(this._rings[D],_,!0),V.length&&this._parts.push(V)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(_){var M=!1,S,D,z,V,nt,dt,gt,Mt;if(!this._pxBounds||!this._pxBounds.contains(_))return!1;for(V=0,gt=this._parts.length;V<gt;V++)for(S=this._parts[V],nt=0,Mt=S.length,dt=Mt-1;nt<Mt;dt=nt++)D=S[nt],z=S[dt],D.y>_.y!=z.y>_.y&&_.x<(z.x-D.x)*(_.y-D.y)/(z.y-D.y)+D.x&&(M=!M);return M||ai.prototype._containsPoint.call(this,_,!0)}});function _r(_,M){return new Le(_,M)}var oi=Ye.extend({initialize:function(_,M){St(this,M),this._layers={},_&&this.addData(_)},addData:function(_){var M=ie(_)?_:_.features,S,D,z;if(M){for(S=0,D=M.length;S<D;S++)z=M[S],(z.geometries||z.geometry||z.features||z.coordinates)&&this.addData(z);return this}var V=this.options;if(V.filter&&!V.filter(_))return this;var nt=un(_,V);return nt?(nt.feature=Sn(_),nt.defaultOptions=nt.options,this.resetStyle(nt),V.onEachFeature&&V.onEachFeature(_,nt),this.addLayer(nt)):this},resetStyle:function(_){return _===void 0?this.eachLayer(this.resetStyle,this):(_.options=tt({},_.defaultOptions),this._setLayerStyle(_,this.options.style),this)},setStyle:function(_){return this.eachLayer(function(M){this._setLayerStyle(M,_)},this)},_setLayerStyle:function(_,M){_.setStyle&&(typeof M=="function"&&(M=M(_.feature)),_.setStyle(M))}});function un(_,M){var S=_.type==="Feature"?_.geometry:_,D=S?S.coordinates:null,z=[],V=M&&M.pointToLayer,nt=M&&M.coordsToLatLng||mr,dt,gt,Mt,Tt;if(!D&&!S)return null;switch(S.type){case"Point":return dt=nt(D),ys(V,_,dt,M);case"MultiPoint":for(Mt=0,Tt=D.length;Mt<Tt;Mt++)dt=nt(D[Mt]),z.push(ys(V,_,dt,M));return new Ye(z);case"LineString":case"MultiLineString":return gt=Oe(D,S.type==="LineString"?0:1,nt),new ai(gt,M);case"Polygon":case"MultiPolygon":return gt=Oe(D,S.type==="Polygon"?1:2,nt),new Le(gt,M);case"GeometryCollection":for(Mt=0,Tt=S.geometries.length;Mt<Tt;Mt++){var It=un({geometry:S.geometries[Mt],type:"Feature",properties:_.properties},M);It&&z.push(It)}return new Ye(z);case"FeatureCollection":for(Mt=0,Tt=S.features.length;Mt<Tt;Mt++){var Vt=un(S.features[Mt],M);Vt&&z.push(Vt)}return new Ye(z);default:throw new Error("Invalid GeoJSON object.")}}function ys(_,M,S,D){return _?_(M,S):new Bn(S,D&&D.markersInheritOptions&&D)}function mr(_){return new Qt(_[1],_[0],_[2])}function Oe(_,M,S){for(var D=[],z=0,V=_.length,nt;z<V;z++)nt=M?Oe(_[z],M-1,S):(S||mr)(_[z]),D.push(nt);return D}function ui(_,M){return _=Kt(_),_.alt!==void 0?[Ct(_.lng,M),Ct(_.lat,M),Ct(_.alt,M)]:[Ct(_.lng,M),Ct(_.lat,M)]}function ki(_,M,S,D){for(var z=[],V=0,nt=_.length;V<nt;V++)z.push(M?ki(_[V],ze(_[V])?0:M-1,S,D):ui(_[V],D));return!M&&S&&z.length>0&&z.push(z[0].slice()),z}function Mi(_,M){return _.feature?tt({},_.feature,{geometry:M}):Sn(M)}function Sn(_){return _.type==="Feature"||_.type==="FeatureCollection"?_:{type:"Feature",properties:{},geometry:_}}var gr={toGeoJSON:function(_){return Mi(this,{type:"Point",coordinates:ui(this.getLatLng(),_)})}};Bn.include(gr),Hi.include(gr),Pn.include(gr),ai.include({toGeoJSON:function(_){var M=!ze(this._latlngs),S=ki(this._latlngs,M?1:0,!1,_);return Mi(this,{type:(M?"Multi":"")+"LineString",coordinates:S})}}),Le.include({toGeoJSON:function(_){var M=!ze(this._latlngs),S=M&&!ze(this._latlngs[0]),D=ki(this._latlngs,S?2:M?1:0,!0,_);return M||(D=[D]),Mi(this,{type:(S?"Multi":"")+"Polygon",coordinates:D})}}),si.include({toMultiPoint:function(_){var M=[];return this.eachLayer(function(S){M.push(S.toGeoJSON(_).geometry.coordinates)}),Mi(this,{type:"MultiPoint",coordinates:M})},toGeoJSON:function(_){var M=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(M==="MultiPoint")return this.toMultiPoint(_);var S=M==="GeometryCollection",D=[];return this.eachLayer(function(z){if(z.toGeoJSON){var V=z.toGeoJSON(_);if(S)D.push(V.geometry);else{var nt=Sn(V);nt.type==="FeatureCollection"?D.push.apply(D,nt.features):D.push(nt)}}}),S?Mi(this,{geometries:D,type:"GeometryCollection"}):{type:"FeatureCollection",features:D}}});function vs(_,M){return new oi(_,M)}var wa=vs,Vi=Be.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(_,M,S){this._url=_,this._bounds=le(M),St(this,S)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Ht(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){re(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(_){return this.options.opacity=_,this._image&&this._updateOpacity(),this},setStyle:function(_){return _.opacity&&this.setOpacity(_.opacity),this},bringToFront:function(){return this._map&&Fi(this._image),this},bringToBack:function(){return this._map&&Ri(this._image),this},setUrl:function(_){return this._url=_,this._image&&(this._image.src=_),this},setBounds:function(_){return this._bounds=le(_),this._map&&this._reset(),this},getEvents:function(){var _={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(_.zoomanim=this._animateZoom),_},setZIndex:function(_){return this.options.zIndex=_,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var _=this._url.tagName==="IMG",M=this._image=_?this._url:Yt("img");if(Ht(M,"leaflet-image-layer"),this._zoomAnimated&&Ht(M,"leaflet-zoom-animated"),this.options.className&&Ht(M,this.options.className),M.onselectstart=pt,M.onmousemove=pt,M.onload=N(this.fire,this,"load"),M.onerror=N(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(M.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),_){this._url=M.src;return}M.src=this._url,M.alt=this.options.alt},_animateZoom:function(_){var M=this._map.getZoomScale(_.zoom),S=this._map._latLngBoundsToNewLayerBounds(this._bounds,_.zoom,_.center).min;bi(this._image,S,M)},_reset:function(){var _=this._image,M=new ne(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),S=M.getSize();he(_,M.min),_.style.width=S.x+"px",_.style.height=S.y+"px"},_updateOpacity:function(){Re(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 _=this.options.errorOverlayUrl;_&&this._url!==_&&(this._url=_,this._image.src=_)},getCenter:function(){return this._bounds.getCenter()}}),Ea=function(_,M,S){return new Vi(_,M,S)},Ls=Vi.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var _=this._url.tagName==="VIDEO",M=this._image=_?this._url:Yt("video");if(Ht(M,"leaflet-image-layer"),this._zoomAnimated&&Ht(M,"leaflet-zoom-animated"),this.options.className&&Ht(M,this.options.className),M.onselectstart=pt,M.onmousemove=pt,M.onloadeddata=N(this.fire,this,"load"),_){for(var S=M.getElementsByTagName("source"),D=[],z=0;z<S.length;z++)D.push(S[z].src);this._url=S.length>0?D:[M.src];return}ie(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(M.style,"objectFit")&&(M.style.objectFit="fill"),M.autoplay=!!this.options.autoplay,M.loop=!!this.options.loop,M.muted=!!this.options.muted,M.playsInline=!!this.options.playsInline;for(var V=0;V<this._url.length;V++){var nt=Yt("source");nt.src=this._url[V],M.appendChild(nt)}}});function Ba(_,M,S){return new Ls(_,M,S)}var yr=Vi.extend({_initImage:function(){var _=this._image=this._url;Ht(_,"leaflet-image-layer"),this._zoomAnimated&&Ht(_,"leaflet-zoom-animated"),this.options.className&&Ht(_,this.options.className),_.onselectstart=pt,_.onmousemove=pt}});function Pa(_,M,S){return new yr(_,M,S)}var $e=Be.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(_,M){_&&(_ instanceof Qt||ie(_))?(this._latlng=Kt(_),St(this,M)):(St(this,_),this._source=M),this.options.content&&(this._content=this.options.content)},openOn:function(_){return _=arguments.length?_:this._source._map,_.hasLayer(this)||_.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(_){return this._map?this.close():(arguments.length?this._source=_:_=this._source,this._prepareOpen(),this.openOn(_._map)),this},onAdd:function(_){this._zoomAnimated=_._zoomAnimated,this._container||this._initLayout(),_._fadeAnimated&&Re(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),_._fadeAnimated&&Re(this._container,1),this.bringToFront(),this.options.interactive&&(Ht(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(_){_._fadeAnimated?(Re(this._container,0),this._removeTimeout=setTimeout(N(re,void 0,this._container),200)):re(this._container),this.options.interactive&&(ae(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(_){return this._latlng=Kt(_),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(_){return this._content=_,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 _={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(_.zoomanim=this._animateZoom),_},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Fi(this._container),this},bringToBack:function(){return this._map&&Ri(this._container),this},_prepareOpen:function(_){var M=this._source;if(!M._map)return!1;if(M instanceof Ye){M=null;var S=this._source._layers;for(var D in S)if(S[D]._map){M=S[D];break}if(!M)return!1;this._source=M}if(!_)if(M.getCenter)_=M.getCenter();else if(M.getLatLng)_=M.getLatLng();else if(M.getBounds)_=M.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(_),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var _=this._contentNode,M=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof M=="string")_.innerHTML=M;else{for(;_.hasChildNodes();)_.removeChild(_.firstChild);_.appendChild(M)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var _=this._map.latLngToLayerPoint(this._latlng),M=zt(this.options.offset),S=this._getAnchor();this._zoomAnimated?he(this._container,_.add(S)):M=M.add(_).add(S);var D=this._containerBottom=-M.y,z=this._containerLeft=-Math.round(this._containerWidth/2)+M.x;this._container.style.bottom=D+"px",this._container.style.left=z+"px"}},_getAnchor:function(){return[0,0]}});qt.include({_initOverlay:function(_,M,S,D){var z=M;return z instanceof _||(z=new _(D).setContent(M)),S&&z.setLatLng(S),z}}),Be.include({_initOverlay:function(_,M,S,D){var z=S;return z instanceof _?(St(z,D),z._source=this):(z=M&&!D?M:new _(D,this),z.setContent(S)),z}});var ln=$e.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(_){return _=arguments.length?_:this._source._map,!_.hasLayer(this)&&_._popup&&_._popup.options.autoClose&&_.removeLayer(_._popup),_._popup=this,$e.prototype.openOn.call(this,_)},onAdd:function(_){$e.prototype.onAdd.call(this,_),_.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Ne||this._source.on("preclick",Ci))},onRemove:function(_){$e.prototype.onRemove.call(this,_),_.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Ne||this._source.off("preclick",Ci))},getEvents:function(){var _=$e.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(_.preclick=this.close),this.options.keepInView&&(_.moveend=this._adjustPan),_},_initLayout:function(){var _="leaflet-popup",M=this._container=Yt("div",_+" "+(this.options.className||"")+" leaflet-zoom-animated"),S=this._wrapper=Yt("div",_+"-content-wrapper",M);if(this._contentNode=Yt("div",_+"-content",S),rn(M),or(this._contentNode),jt(M,"contextmenu",Ci),this._tipContainer=Yt("div",_+"-tip-container",M),this._tip=Yt("div",_+"-tip",this._tipContainer),this.options.closeButton){var D=this._closeButton=Yt("a",_+"-close-button",M);D.setAttribute("role","button"),D.setAttribute("aria-label","Close popup"),D.href="#close",D.innerHTML='<span aria-hidden="true">×</span>',jt(D,"click",function(z){me(z),this.close()},this)}},_updateLayout:function(){var _=this._contentNode,M=_.style;M.width="",M.whiteSpace="nowrap";var S=_.offsetWidth;S=Math.min(S,this.options.maxWidth),S=Math.max(S,this.options.minWidth),M.width=S+1+"px",M.whiteSpace="",M.height="";var D=_.offsetHeight,z=this.options.maxHeight,V="leaflet-popup-scrolled";z&&D>z?(M.height=z+"px",Ht(_,V)):ae(_,V),this._containerWidth=this._container.offsetWidth},_animateZoom:function(_){var M=this._map._latLngToNewLayerPoint(this._latlng,_.zoom,_.center),S=this._getAnchor();he(this._container,M.add(S))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var _=this._map,M=parseInt(hi(this._container,"marginBottom"),10)||0,S=this._container.offsetHeight+M,D=this._containerWidth,z=new Gt(this._containerLeft,-S-this._containerBottom);z._add(ci(this._container));var V=_.layerPointToContainerPoint(z),nt=zt(this.options.autoPanPadding),dt=zt(this.options.autoPanPaddingTopLeft||nt),gt=zt(this.options.autoPanPaddingBottomRight||nt),Mt=_.getSize(),Tt=0,It=0;V.x+D+gt.x>Mt.x&&(Tt=V.x+D-Mt.x+gt.x),V.x-Tt-dt.x<0&&(Tt=V.x-dt.x),V.y+S+gt.y>Mt.y&&(It=V.y+S-Mt.y+gt.y),V.y-It-dt.y<0&&(It=V.y-dt.y),(Tt||It)&&(this.options.keepInView&&(this._autopanning=!0),_.fire("autopanstart").panBy([Tt,It]))}},_getAnchor:function(){return zt(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Sa=function(_,M){return new ln(_,M)};qt.mergeOptions({closePopupOnClick:!0}),qt.include({openPopup:function(_,M,S){return this._initOverlay(ln,_,M,S).openOn(this),this},closePopup:function(_){return _=arguments.length?_:this._popup,_&&_.close(),this}}),Be.include({bindPopup:function(_,M){return this._popup=this._initOverlay(ln,this._popup,_,M),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(_){return this._popup&&(this instanceof Ye||(this._popup._source=this),this._popup._prepareOpen(_||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(_){return this._popup&&this._popup.setContent(_),this},getPopup:function(){return this._popup},_openPopup:function(_){if(!(!this._popup||!this._map)){xi(_);var M=_.layer||_.target;if(this._popup._source===M&&!(M instanceof Ne)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(_.latlng);return}this._popup._source=M,this.openPopup(_.latlng)}},_movePopup:function(_){this._popup.setLatLng(_.latlng)},_onKeyPress:function(_){_.originalEvent.keyCode===13&&this._openPopup(_)}});var An=$e.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(_){$e.prototype.onAdd.call(this,_),this.setOpacity(this.options.opacity),_.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(_){$e.prototype.onRemove.call(this,_),_.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var _=$e.prototype.getEvents.call(this);return this.options.permanent||(_.preclick=this.close),_},_initLayout:function(){var _="leaflet-tooltip",M=_+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Yt("div",M),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+et(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(_){var M,S,D=this._map,z=this._container,V=D.latLngToContainerPoint(D.getCenter()),nt=D.layerPointToContainerPoint(_),dt=this.options.direction,gt=z.offsetWidth,Mt=z.offsetHeight,Tt=zt(this.options.offset),It=this._getAnchor();dt==="top"?(M=gt/2,S=Mt):dt==="bottom"?(M=gt/2,S=0):dt==="center"?(M=gt/2,S=Mt/2):dt==="right"?(M=0,S=Mt/2):dt==="left"?(M=gt,S=Mt/2):nt.x<V.x?(dt="right",M=0,S=Mt/2):(dt="left",M=gt+(Tt.x+It.x)*2,S=Mt/2),_=_.subtract(zt(M,S,!0)).add(Tt).add(It),ae(z,"leaflet-tooltip-right"),ae(z,"leaflet-tooltip-left"),ae(z,"leaflet-tooltip-top"),ae(z,"leaflet-tooltip-bottom"),Ht(z,"leaflet-tooltip-"+dt),he(z,_)},_updatePosition:function(){var _=this._map.latLngToLayerPoint(this._latlng);this._setPosition(_)},setOpacity:function(_){this.options.opacity=_,this._container&&Re(this._container,_)},_animateZoom:function(_){var M=this._map._latLngToNewLayerPoint(this._latlng,_.zoom,_.center);this._setPosition(M)},_getAnchor:function(){return zt(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Aa=function(_,M){return new An(_,M)};qt.include({openTooltip:function(_,M,S){return this._initOverlay(An,_,M,S).openOn(this),this},closeTooltip:function(_){return _.close(),this}}),Be.include({bindTooltip:function(_,M){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(An,this._tooltip,_,M),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(_){if(!(!_&&this._tooltipHandlersAdded)){var M=_?"off":"on",S={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?S.add=this._openTooltip:(S.mouseover=this._openTooltip,S.mouseout=this.closeTooltip,S.click=this._openTooltip,this._map?this._addFocusListeners():S.add=this._addFocusListeners),this._tooltip.options.sticky&&(S.mousemove=this._moveTooltip),this[M](S),this._tooltipHandlersAdded=!_}},openTooltip:function(_){return this._tooltip&&(this instanceof Ye||(this._tooltip._source=this),this._tooltip._prepareOpen(_)&&(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(_){return this._tooltip&&this._tooltip.setContent(_),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(_){var M=typeof _.getElement=="function"&&_.getElement();M&&(jt(M,"focus",function(){this._tooltip._source=_,this.openTooltip()},this),jt(M,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(_){var M=typeof _.getElement=="function"&&_.getElement();M&&M.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(_){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var M=this;this._map.once("moveend",function(){M._openOnceFlag=!1,M._openTooltip(_)});return}this._tooltip._source=_.layer||_.target,this.openTooltip(this._tooltip.options.sticky?_.latlng:void 0)}},_moveTooltip:function(_){var M=_.latlng,S,D;this._tooltip.options.sticky&&_.originalEvent&&(S=this._map.mouseEventToContainerPoint(_.originalEvent),D=this._map.containerPointToLayerPoint(S),M=this._map.layerPointToLatLng(D)),this._tooltip.setLatLng(M)}});var fi=Ui.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(_){var M=_&&_.tagName==="DIV"?_:document.createElement("div"),S=this.options;if(S.html instanceof Element?(Qi(M),M.appendChild(S.html)):M.innerHTML=S.html!==!1?S.html:"",S.bgPos){var D=zt(S.bgPos);M.style.backgroundPosition=-D.x+"px "+-D.y+"px"}return this._setIconStyles(M,"icon"),M},createShadow:function(){return null}});function hn(_){return new fi(_)}Ui.Default=on;var cn=Be.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Rt.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(_){St(this,_)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(_){_._addZoomLimit(this)},onRemove:function(_){this._removeAllTiles(),re(this._container),_._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Fi(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Ri(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(_){return this.options.opacity=_,this._updateOpacity(),this},setZIndex:function(_){return this.options.zIndex=_,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var _=this._clampZoom(this._map.getZoom());_!==this._tileZoom&&(this._tileZoom=_,this._updateLevels()),this._update()}return this},getEvents:function(){var _={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=ft(this._onMoveEnd,this.options.updateInterval,this)),_.move=this._onMove),this._zoomAnimated&&(_.zoomanim=this._animateZoom),_},createTile:function(){return document.createElement("div")},getTileSize:function(){var _=this.options.tileSize;return _ instanceof Gt?_:new Gt(_,_)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(_){for(var M=this.getPane().children,S=-_(-1/0,1/0),D=0,z=M.length,V;D<z;D++)V=M[D].style.zIndex,M[D]!==this._container&&V&&(S=_(S,+V));isFinite(S)&&(this.options.zIndex=S+_(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Rt.ielt9){Re(this._container,this.options.opacity);var _=+new Date,M=!1,S=!1;for(var D in this._tiles){var z=this._tiles[D];if(!(!z.current||!z.loaded)){var V=Math.min(1,(_-z.loaded)/200);Re(z.el,V),V<1?M=!0:(z.active?S=!0:this._onOpaqueTile(z),z.active=!0)}}S&&!this._noPrune&&this._pruneTiles(),M&&(Me(this._fadeFrame),this._fadeFrame=ue(this._updateOpacity,this))}},_onOpaqueTile:pt,_initContainer:function(){this._container||(this._container=Yt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var _=this._tileZoom,M=this.options.maxZoom;if(_!==void 0){for(var S in this._levels)S=Number(S),this._levels[S].el.children.length||S===_?(this._levels[S].el.style.zIndex=M-Math.abs(_-S),this._onUpdateLevel(S)):(re(this._levels[S].el),this._removeTilesAtZoom(S),this._onRemoveLevel(S),delete this._levels[S]);var D=this._levels[_],z=this._map;return D||(D=this._levels[_]={},D.el=Yt("div","leaflet-tile-container leaflet-zoom-animated",this._container),D.el.style.zIndex=M,D.origin=z.project(z.unproject(z.getPixelOrigin()),_).round(),D.zoom=_,this._setZoomTransform(D,z.getCenter(),z.getZoom()),pt(D.el.offsetWidth),this._onCreateLevel(D)),this._level=D,D}},_onUpdateLevel:pt,_onRemoveLevel:pt,_onCreateLevel:pt,_pruneTiles:function(){if(this._map){var _,M,S=this._map.getZoom();if(S>this.options.maxZoom||S<this.options.minZoom){this._removeAllTiles();return}for(_ in this._tiles)M=this._tiles[_],M.retain=M.current;for(_ in this._tiles)if(M=this._tiles[_],M.current&&!M.active){var D=M.coords;this._retainParent(D.x,D.y,D.z,D.z-5)||this._retainChildren(D.x,D.y,D.z,D.z+2)}for(_ in this._tiles)this._tiles[_].retain||this._removeTile(_)}},_removeTilesAtZoom:function(_){for(var M in this._tiles)this._tiles[M].coords.z===_&&this._removeTile(M)},_removeAllTiles:function(){for(var _ in this._tiles)this._removeTile(_)},_invalidateAll:function(){for(var _ in this._levels)re(this._levels[_].el),this._onRemoveLevel(Number(_)),delete this._levels[_];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(_,M,S,D){var z=Math.floor(_/2),V=Math.floor(M/2),nt=S-1,dt=new Gt(+z,+V);dt.z=+nt;var gt=this._tileCoordsToKey(dt),Mt=this._tiles[gt];return Mt&&Mt.active?(Mt.retain=!0,!0):(Mt&&Mt.loaded&&(Mt.retain=!0),nt>D?this._retainParent(z,V,nt,D):!1)},_retainChildren:function(_,M,S,D){for(var z=2*_;z<2*_+2;z++)for(var V=2*M;V<2*M+2;V++){var nt=new Gt(z,V);nt.z=S+1;var dt=this._tileCoordsToKey(nt),gt=this._tiles[dt];if(gt&>.active){gt.retain=!0;continue}else gt&>.loaded&&(gt.retain=!0);S+1<D&&this._retainChildren(z,V,S+1,D)}},_resetView:function(_){var M=_&&(_.pinch||_.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),M,M)},_animateZoom:function(_){this._setView(_.center,_.zoom,!0,_.noUpdate)},_clampZoom:function(_){var M=this.options;return M.minNativeZoom!==void 0&&_<M.minNativeZoom?M.minNativeZoom:M.maxNativeZoom!==void 0&&M.maxNativeZoom<_?M.maxNativeZoom:_},_setView:function(_,M,S,D){var z=Math.round(M);this.options.maxZoom!==void 0&&z>this.options.maxZoom||this.options.minZoom!==void 0&&z<this.options.minZoom?z=void 0:z=this._clampZoom(z);var V=this.options.updateWhenZooming&&z!==this._tileZoom;(!D||V)&&(this._tileZoom=z,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),z!==void 0&&this._update(_),S||this._pruneTiles(),this._noPrune=!!S),this._setZoomTransforms(_,M)},_setZoomTransforms:function(_,M){for(var S in this._levels)this._setZoomTransform(this._levels[S],_,M)},_setZoomTransform:function(_,M,S){var D=this._map.getZoomScale(S,_.zoom),z=_.origin.multiplyBy(D).subtract(this._map._getNewPixelOrigin(M,S)).round();Rt.any3d?bi(_.el,z,D):he(_.el,z)},_resetGrid:function(){var _=this._map,M=_.options.crs,S=this._tileSize=this.getTileSize(),D=this._tileZoom,z=this._map.getPixelWorldBounds(this._tileZoom);z&&(this._globalTileRange=this._pxBoundsToTileRange(z)),this._wrapX=M.wrapLng&&!this.options.noWrap&&[Math.floor(_.project([0,M.wrapLng[0]],D).x/S.x),Math.ceil(_.project([0,M.wrapLng[1]],D).x/S.y)],this._wrapY=M.wrapLat&&!this.options.noWrap&&[Math.floor(_.project([M.wrapLat[0],0],D).y/S.x),Math.ceil(_.project([M.wrapLat[1],0],D).y/S.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(_){var M=this._map,S=M._animatingZoom?Math.max(M._animateToZoom,M.getZoom()):M.getZoom(),D=M.getZoomScale(S,this._tileZoom),z=M.project(_,this._tileZoom).floor(),V=M.getSize().divideBy(D*2);return new ne(z.subtract(V),z.add(V))},_update:function(_){var M=this._map;if(M){var S=this._clampZoom(M.getZoom());if(_===void 0&&(_=M.getCenter()),this._tileZoom!==void 0){var D=this._getTiledPixelBounds(_),z=this._pxBoundsToTileRange(D),V=z.getCenter(),nt=[],dt=this.options.keepBuffer,gt=new ne(z.getBottomLeft().subtract([dt,-dt]),z.getTopRight().add([dt,-dt]));if(!(isFinite(z.min.x)&&isFinite(z.min.y)&&isFinite(z.max.x)&&isFinite(z.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var Mt in this._tiles){var Tt=this._tiles[Mt].coords;(Tt.z!==this._tileZoom||!gt.contains(new Gt(Tt.x,Tt.y)))&&(this._tiles[Mt].current=!1)}if(Math.abs(S-this._tileZoom)>1){this._setView(_,S);return}for(var It=z.min.y;It<=z.max.y;It++)for(var Vt=z.min.x;Vt<=z.max.x;Vt++){var Ce=new Gt(Vt,It);if(Ce.z=this._tileZoom,!!this._isValidTile(Ce)){var _e=this._tiles[this._tileCoordsToKey(Ce)];_e?_e.current=!0:nt.push(Ce)}}if(nt.sort(function(Pe,mi){return Pe.distanceTo(V)-mi.distanceTo(V)}),nt.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Ze=document.createDocumentFragment();for(Vt=0;Vt<nt.length;Vt++)this._addTile(nt[Vt],Ze);this._level.el.appendChild(Ze)}}}},_isValidTile:function(_){var M=this._map.options.crs;if(!M.infinite){var S=this._globalTileRange;if(!M.wrapLng&&(_.x<S.min.x||_.x>S.max.x)||!M.wrapLat&&(_.y<S.min.y||_.y>S.max.y))return!1}if(!this.options.bounds)return!0;var D=this._tileCoordsToBounds(_);return le(this.options.bounds).overlaps(D)},_keyToBounds:function(_){return this._tileCoordsToBounds(this._keyToTileCoords(_))},_tileCoordsToNwSe:function(_){var M=this._map,S=this.getTileSize(),D=_.scaleBy(S),z=D.add(S),V=M.unproject(D,_.z),nt=M.unproject(z,_.z);return[V,nt]},_tileCoordsToBounds:function(_){var M=this._tileCoordsToNwSe(_),S=new Ee(M[0],M[1]);return this.options.noWrap||(S=this._map.wrapLatLngBounds(S)),S},_tileCoordsToKey:function(_){return _.x+":"+_.y+":"+_.z},_keyToTileCoords:function(_){var M=_.split(":"),S=new Gt(+M[0],+M[1]);return S.z=+M[2],S},_removeTile:function(_){var M=this._tiles[_];M&&(re(M.el),delete this._tiles[_],this.fire("tileunload",{tile:M.el,coords:this._keyToTileCoords(_)}))},_initTile:function(_){Ht(_,"leaflet-tile");var M=this.getTileSize();_.style.width=M.x+"px",_.style.height=M.y+"px",_.onselectstart=pt,_.onmousemove=pt,Rt.ielt9&&this.options.opacity<1&&Re(_,this.options.opacity)},_addTile:function(_,M){var S=this._getTilePos(_),D=this._tileCoordsToKey(_),z=this.createTile(this._wrapCoords(_),N(this._tileReady,this,_));this._initTile(z),this.createTile.length<2&&ue(N(this._tileReady,this,_,null,z)),he(z,S),this._tiles[D]={el:z,coords:_,current:!0},M.appendChild(z),this.fire("tileloadstart",{tile:z,coords:_})},_tileReady:function(_,M,S){M&&this.fire("tileerror",{error:M,tile:S,coords:_});var D=this._tileCoordsToKey(_);S=this._tiles[D],S&&(S.loaded=+new Date,this._map._fadeAnimated?(Re(S.el,0),Me(this._fadeFrame),this._fadeFrame=ue(this._updateOpacity,this)):(S.active=!0,this._pruneTiles()),M||(Ht(S.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:S.el,coords:_})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Rt.ielt9||!this._map._fadeAnimated?ue(this._pruneTiles,this):setTimeout(N(this._pruneTiles,this),250)))},_getTilePos:function(_){return _.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(_){var M=new Gt(this._wrapX?Lt(_.x,this._wrapX):_.x,this._wrapY?Lt(_.y,this._wrapY):_.y);return M.z=_.z,M},_pxBoundsToTileRange:function(_){var M=this.getTileSize();return new ne(_.min.unscaleBy(M).floor(),_.max.unscaleBy(M).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var _ in this._tiles)if(!this._tiles[_].loaded)return!1;return!0}});function bs(_){return new cn(_)}var _i=cn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(_,M){this._url=_,M=St(this,M),M.detectRetina&&Rt.retina&&M.maxZoom>0?(M.tileSize=Math.floor(M.tileSize/2),M.zoomReverse?(M.zoomOffset--,M.minZoom=Math.min(M.maxZoom,M.minZoom+1)):(M.zoomOffset++,M.maxZoom=Math.max(M.minZoom,M.maxZoom-1)),M.minZoom=Math.max(0,M.minZoom)):M.zoomReverse?M.minZoom=Math.min(M.maxZoom,M.minZoom):M.maxZoom=Math.max(M.minZoom,M.maxZoom),typeof M.subdomains=="string"&&(M.subdomains=M.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(_,M){return this._url===_&&M===void 0&&(M=!0),this._url=_,M||this.redraw(),this},createTile:function(_,M){var S=document.createElement("img");return jt(S,"load",N(this._tileOnLoad,this,M,S)),jt(S,"error",N(this._tileOnError,this,M,S)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(S.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(S.referrerPolicy=this.options.referrerPolicy),S.alt="",S.src=this.getTileUrl(_),S},getTileUrl:function(_){var M={r:Rt.retina?"@2x":"",s:this._getSubdomain(_),x:_.x,y:_.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var S=this._globalTileRange.max.y-_.y;this.options.tms&&(M.y=S),M["-y"]=S}return ee(this._url,tt(M,this.options))},_tileOnLoad:function(_,M){Rt.ielt9?setTimeout(N(_,this,null,M),0):_(null,M)},_tileOnError:function(_,M,S){var D=this.options.errorTileUrl;D&&M.getAttribute("src")!==D&&(M.src=D),_(S,M)},_onTileRemove:function(_){_.tile.onload=null},_getZoomForUrl:function(){var _=this._tileZoom,M=this.options.maxZoom,S=this.options.zoomReverse,D=this.options.zoomOffset;return S&&(_=M-_),_+D},_getSubdomain:function(_){var M=Math.abs(_.x+_.y)%this.options.subdomains.length;return this.options.subdomains[M]},_abortLoading:function(){var _,M;for(_ in this._tiles)if(this._tiles[_].coords.z!==this._tileZoom&&(M=this._tiles[_].el,M.onload=pt,M.onerror=pt,!M.complete)){M.src=ke;var S=this._tiles[_].coords;re(M),delete this._tiles[_],this.fire("tileabort",{tile:M,coords:S})}},_removeTile:function(_){var M=this._tiles[_];if(M)return M.el.setAttribute("src",ke),cn.prototype._removeTile.call(this,_)},_tileReady:function(_,M,S){if(!(!this._map||S&&S.getAttribute("src")===ke))return cn.prototype._tileReady.call(this,_,M,S)}});function Cs(_,M){return new _i(_,M)}var xs=_i.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(_,M){this._url=_;var S=tt({},this.defaultWmsParams);for(var D in M)D in this.options||(S[D]=M[D]);M=St(this,M);var z=M.detectRetina&&Rt.retina?2:1,V=this.getTileSize();S.width=V.x*z,S.height=V.y*z,this.wmsParams=S},onAdd:function(_){this._crs=this.options.crs||_.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var M=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[M]=this._crs.code,_i.prototype.onAdd.call(this,_)},getTileUrl:function(_){var M=this._tileCoordsToNwSe(_),S=this._crs,D=we(S.project(M[0]),S.project(M[1])),z=D.min,V=D.max,nt=(this._wmsVersion>=1.3&&this._crs===dr?[z.y,z.x,V.y,V.x]:[z.x,z.y,V.x,V.y]).join(","),dt=_i.prototype.getTileUrl.call(this,_);return dt+Jt(this.wmsParams,dt,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+nt},setParams:function(_,M){return tt(this.wmsParams,_),M||this.redraw(),this}});function ks(_,M){return new xs(_,M)}_i.WMS=xs,Cs.wms=ks;var Xe=Be.extend({options:{padding:.1},initialize:function(_){St(this,_),et(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Ht(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 _={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(_.zoomanim=this._onAnimZoom),_},_onAnimZoom:function(_){this._updateTransform(_.center,_.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(_,M){var S=this._map.getZoomScale(M,this._zoom),D=this._map.getSize().multiplyBy(.5+this.options.padding),z=this._map.project(this._center,M),V=D.multiplyBy(-S).add(z).subtract(this._map._getNewPixelOrigin(_,M));Rt.any3d?bi(this._container,V,S):he(this._container,V)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var _ in this._layers)this._layers[_]._reset()},_onZoomEnd:function(){for(var _ in this._layers)this._layers[_]._project()},_updatePaths:function(){for(var _ in this._layers)this._layers[_]._update()},_update:function(){var _=this.options.padding,M=this._map.getSize(),S=this._map.containerPointToLayerPoint(M.multiplyBy(-_)).round();this._bounds=new ne(S,S.add(M.multiplyBy(1+_*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Tn=Xe.extend({options:{tolerance:0},getEvents:function(){var _=Xe.prototype.getEvents.call(this);return _.viewprereset=this._onViewPreReset,_},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Xe.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var _=this._container=document.createElement("canvas");jt(_,"mousemove",this._onMouseMove,this),jt(_,"click dblclick mousedown mouseup contextmenu",this._onClick,this),jt(_,"mouseout",this._handleMouseOut,this),_._leaflet_disable_events=!0,this._ctx=_.getContext("2d")},_destroyContainer:function(){Me(this._redrawRequest),delete this._ctx,re(this._container),$t(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var _;this._redrawBounds=null;for(var M in this._layers)_=this._layers[M],_._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Xe.prototype._update.call(this);var _=this._bounds,M=this._container,S=_.getSize(),D=Rt.retina?2:1;he(M,_.min),M.width=D*S.x,M.height=D*S.y,M.style.width=S.x+"px",M.style.height=S.y+"px",Rt.retina&&this._ctx.scale(2,2),this._ctx.translate(-_.min.x,-_.min.y),this.fire("update")}},_reset:function(){Xe.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(_){this._updateDashArray(_),this._layers[et(_)]=_;var M=_._order={layer:_,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=M),this._drawLast=M,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(_){this._requestRedraw(_)},_removePath:function(_){var M=_._order,S=M.next,D=M.prev;S?S.prev=D:this._drawLast=D,D?D.next=S:this._drawFirst=S,delete _._order,delete this._layers[et(_)],this._requestRedraw(_)},_updatePath:function(_){this._extendRedrawBounds(_),_._project(),_._update(),this._requestRedraw(_)},_updateStyle:function(_){this._updateDashArray(_),this._requestRedraw(_)},_updateDashArray:function(_){if(typeof _.options.dashArray=="string"){var M=_.options.dashArray.split(/[, ]+/),S=[],D,z;for(z=0;z<M.length;z++){if(D=Number(M[z]),isNaN(D))return;S.push(D)}_.options._dashArray=S}else _.options._dashArray=_.options.dashArray},_requestRedraw:function(_){this._map&&(this._extendRedrawBounds(_),this._redrawRequest=this._redrawRequest||ue(this._redraw,this))},_extendRedrawBounds:function(_){if(_._pxBounds){var M=(_.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new ne,this._redrawBounds.extend(_._pxBounds.min.subtract([M,M])),this._redrawBounds.extend(_._pxBounds.max.add([M,M]))}},_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 _=this._redrawBounds;if(_){var M=_.getSize();this._ctx.clearRect(_.min.x,_.min.y,M.x,M.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 _,M=this._redrawBounds;if(this._ctx.save(),M){var S=M.getSize();this._ctx.beginPath(),this._ctx.rect(M.min.x,M.min.y,S.x,S.y),this._ctx.clip()}this._drawing=!0;for(var D=this._drawFirst;D;D=D.next)_=D.layer,(!M||_._pxBounds&&_._pxBounds.intersects(M))&&_._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(_,M){if(this._drawing){var S,D,z,V,nt=_._parts,dt=nt.length,gt=this._ctx;if(dt){for(gt.beginPath(),S=0;S<dt;S++){for(D=0,z=nt[S].length;D<z;D++)V=nt[S][D],gt[D?"lineTo":"moveTo"](V.x,V.y);M&>.closePath()}this._fillStroke(gt,_)}}},_updateCircle:function(_){if(!(!this._drawing||_._empty())){var M=_._point,S=this._ctx,D=Math.max(Math.round(_._radius),1),z=(Math.max(Math.round(_._radiusY),1)||D)/D;z!==1&&(S.save(),S.scale(1,z)),S.beginPath(),S.arc(M.x,M.y/z,D,0,Math.PI*2,!1),z!==1&&S.restore(),this._fillStroke(S,_)}},_fillStroke:function(_,M){var S=M.options;S.fill&&(_.globalAlpha=S.fillOpacity,_.fillStyle=S.fillColor||S.color,_.fill(S.fillRule||"evenodd")),S.stroke&&S.weight!==0&&(_.setLineDash&&_.setLineDash(M.options&&M.options._dashArray||[]),_.globalAlpha=S.opacity,_.lineWidth=S.weight,_.strokeStyle=S.color,_.lineCap=S.lineCap,_.lineJoin=S.lineJoin,_.stroke())},_onClick:function(_){for(var M=this._map.mouseEventToLayerPoint(_),S,D,z=this._drawFirst;z;z=z.next)S=z.layer,S.options.interactive&&S._containsPoint(M)&&(!(_.type==="click"||_.type==="preclick")||!this._map._draggableMoved(S))&&(D=S);this._fireEvent(D?[D]:!1,_)},_onMouseMove:function(_){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var M=this._map.mouseEventToLayerPoint(_);this._handleMouseHover(_,M)}},_handleMouseOut:function(_){var M=this._hoveredLayer;M&&(ae(this._container,"leaflet-interactive"),this._fireEvent([M],_,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(_,M){if(!this._mouseHoverThrottled){for(var S,D,z=this._drawFirst;z;z=z.next)S=z.layer,S.options.interactive&&S._containsPoint(M)&&(D=S);D!==this._hoveredLayer&&(this._handleMouseOut(_),D&&(Ht(this._container,"leaflet-interactive"),this._fireEvent([D],_,"mouseover"),this._hoveredLayer=D)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,_),this._mouseHoverThrottled=!0,setTimeout(N(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(_,M,S){this._map._fireDOMEvent(M,S||M.type,_)},_bringToFront:function(_){var M=_._order;if(M){var S=M.next,D=M.prev;if(S)S.prev=D;else return;D?D.next=S:S&&(this._drawFirst=S),M.prev=this._drawLast,this._drawLast.next=M,M.next=null,this._drawLast=M,this._requestRedraw(_)}},_bringToBack:function(_){var M=_._order;if(M){var S=M.next,D=M.prev;if(D)D.next=S;else return;S?S.prev=D:D&&(this._drawLast=D),M.prev=null,M.next=this._drawFirst,this._drawFirst.prev=M,this._drawFirst=M,this._requestRedraw(_)}}});function vr(_){return Rt.canvas?new Tn(_):null}var wi=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(_){return document.createElement("<lvml:"+_+' class="lvml">')}}catch{}return function(_){return document.createElement("<"+_+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),Ta={_initContainer:function(){this._container=Yt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Xe.prototype._update.call(this),this.fire("update"))},_initPath:function(_){var M=_._container=wi("shape");Ht(M,"leaflet-vml-shape "+(this.options.className||"")),M.coordsize="1 1",_._path=wi("path"),M.appendChild(_._path),this._updateStyle(_),this._layers[et(_)]=_},_addPath:function(_){var M=_._container;this._container.appendChild(M),_.options.interactive&&_.addInteractiveTarget(M)},_removePath:function(_){var M=_._container;re(M),_.removeInteractiveTarget(M),delete this._layers[et(_)]},_updateStyle:function(_){var M=_._stroke,S=_._fill,D=_.options,z=_._container;z.stroked=!!D.stroke,z.filled=!!D.fill,D.stroke?(M||(M=_._stroke=wi("stroke")),z.appendChild(M),M.weight=D.weight+"px",M.color=D.color,M.opacity=D.opacity,D.dashArray?M.dashStyle=ie(D.dashArray)?D.dashArray.join(" "):D.dashArray.replace(/( *, *)/g," "):M.dashStyle="",M.endcap=D.lineCap.replace("butt","flat"),M.joinstyle=D.lineJoin):M&&(z.removeChild(M),_._stroke=null),D.fill?(S||(S=_._fill=wi("fill")),z.appendChild(S),S.color=D.fillColor||D.color,S.opacity=D.fillOpacity):S&&(z.removeChild(S),_._fill=null)},_updateCircle:function(_){var M=_._point.round(),S=Math.round(_._radius),D=Math.round(_._radiusY||S);this._setPath(_,_._empty()?"M0 0":"AL "+M.x+","+M.y+" "+S+","+D+" 0,"+65535*360)},_setPath:function(_,M){_._path.v=M},_bringToFront:function(_){Fi(_._container)},_bringToBack:function(_){Ri(_._container)}},Ge=Rt.vml?wi:Ar,ce=Xe.extend({_initContainer:function(){this._container=Ge("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ge("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){re(this._container),$t(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Xe.prototype._update.call(this);var _=this._bounds,M=_.getSize(),S=this._container;(!this._svgSize||!this._svgSize.equals(M))&&(this._svgSize=M,S.setAttribute("width",M.x),S.setAttribute("height",M.y)),he(S,_.min),S.setAttribute("viewBox",[_.min.x,_.min.y,M.x,M.y].join(" ")),this.fire("update")}},_initPath:function(_){var M=_._path=Ge("path");_.options.className&&Ht(M,_.options.className),_.options.interactive&&Ht(M,"leaflet-interactive"),this._updateStyle(_),this._layers[et(_)]=_},_addPath:function(_){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(_._path),_.addInteractiveTarget(_._path)},_removePath:function(_){re(_._path),_.removeInteractiveTarget(_._path),delete this._layers[et(_)]},_updatePath:function(_){_._project(),_._update()},_updateStyle:function(_){var M=_._path,S=_.options;M&&(S.stroke?(M.setAttribute("stroke",S.color),M.setAttribute("stroke-opacity",S.opacity),M.setAttribute("stroke-width",S.weight),M.setAttribute("stroke-linecap",S.lineCap),M.setAttribute("stroke-linejoin",S.lineJoin),S.dashArray?M.setAttribute("stroke-dasharray",S.dashArray):M.removeAttribute("stroke-dasharray"),S.dashOffset?M.setAttribute("stroke-dashoffset",S.dashOffset):M.removeAttribute("stroke-dashoffset")):M.setAttribute("stroke","none"),S.fill?(M.setAttribute("fill",S.fillColor||S.color),M.setAttribute("fill-opacity",S.fillOpacity),M.setAttribute("fill-rule",S.fillRule||"evenodd")):M.setAttribute("fill","none"))},_updatePoly:function(_,M){this._setPath(_,Tr(_._parts,M))},_updateCircle:function(_){var M=_._point,S=Math.max(Math.round(_._radius),1),D=Math.max(Math.round(_._radiusY),1)||S,z="a"+S+","+D+" 0 1,0 ",V=_._empty()?"M0 0":"M"+(M.x-S)+","+M.y+z+S*2+",0 "+z+-S*2+",0 ";this._setPath(_,V)},_setPath:function(_,M){_._path.setAttribute("d",M)},_bringToFront:function(_){Fi(_._path)},_bringToBack:function(_){Ri(_._path)}});Rt.vml&&ce.include(Ta);function Ms(_){return Rt.svg||Rt.vml?new ce(_):null}qt.include({getRenderer:function(_){var M=_.options.renderer||this._getPaneRenderer(_.options.pane)||this.options.renderer||this._renderer;return M||(M=this._renderer=this._createRenderer()),this.hasLayer(M)||this.addLayer(M),M},_getPaneRenderer:function(_){if(_==="overlayPane"||_===void 0)return!1;var M=this._paneRenderers[_];return M===void 0&&(M=this._createRenderer({pane:_}),this._paneRenderers[_]=M),M},_createRenderer:function(_){return this.options.preferCanvas&&vr(_)||Ms(_)}});var Dn=Le.extend({initialize:function(_,M){Le.prototype.initialize.call(this,this._boundsToLatLngs(_),M)},setBounds:function(_){return this.setLatLngs(this._boundsToLatLngs(_))},_boundsToLatLngs:function(_){return _=le(_),[_.getSouthWest(),_.getNorthWest(),_.getNorthEast(),_.getSouthEast()]}});function Da(_,M){return new Dn(_,M)}ce.create=Ge,ce.pointsToPath=Tr,oi.geometryToLayer=un,oi.coordsToLatLng=mr,oi.coordsToLatLngs=Oe,oi.latLngToCoords=ui,oi.latLngsToCoords=ki,oi.getFeature=Mi,oi.asFeature=Sn,qt.mergeOptions({boxZoom:!0});var qi=Ke.extend({initialize:function(_){this._map=_,this._container=_._container,this._pane=_._panes.overlayPane,this._resetStateTimeout=0,_.on("unload",this._destroy,this)},addHooks:function(){jt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){$t(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){re(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(_){if(!_.shiftKey||_.which!==1&&_.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),tn(),Qn(),this._startPoint=this._map.mouseEventToContainerPoint(_),jt(document,{contextmenu:xi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(_){this._moved||(this._moved=!0,this._box=Yt("div","leaflet-zoom-box",this._container),Ht(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(_);var M=new ne(this._point,this._startPoint),S=M.getSize();he(this._box,M.min),this._box.style.width=S.x+"px",this._box.style.height=S.y+"px"},_finish:function(){this._moved&&(re(this._box),ae(this._container,"leaflet-crosshair")),en(),tr(),$t(document,{contextmenu:xi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(_){if(!(_.which!==1&&_.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(N(this._resetState,this),0);var M=new Ee(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(M).fire("boxzoomend",{boxZoomBounds:M})}},_onKeyDown:function(_){_.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});qt.addInitHook("addHandler","boxZoom",qi),qt.mergeOptions({doubleClickZoom:!0});var ws=Ke.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(_){var M=this._map,S=M.getZoom(),D=M.options.zoomDelta,z=_.originalEvent.shiftKey?S-D:S+D;M.options.doubleClickZoom==="center"?M.setZoom(z):M.setZoomAround(_.containerPoint,z)}});qt.addInitHook("addHandler","doubleClickZoom",ws),qt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Es=Ke.extend({addHooks:function(){if(!this._draggable){var _=this._map;this._draggable=new di(_._mapPane,_._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),_.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),_.on("zoomend",this._onZoomEnd,this),_.whenReady(this._onZoomEnd,this))}Ht(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ae(this._map._container,"leaflet-grab"),ae(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 _=this._map;if(_._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var M=le(this._map.options.maxBounds);this._offsetLimit=we(this._map.latLngToContainerPoint(M.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(M.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;_.fire("movestart").fire("dragstart"),_.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(_){if(this._map.options.inertia){var M=this._lastTime=+new Date,S=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(S),this._times.push(M),this._prunePositions(M)}this._map.fire("move",_).fire("drag",_)},_prunePositions:function(_){for(;this._positions.length>1&&_-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var _=this._map.getSize().divideBy(2),M=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=M.subtract(_).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(_,M){return _-(_-M)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var _=this._draggable._newPos.subtract(this._draggable._startPos),M=this._offsetLimit;_.x<M.min.x&&(_.x=this._viscousLimit(_.x,M.min.x)),_.y<M.min.y&&(_.y=this._viscousLimit(_.y,M.min.y)),_.x>M.max.x&&(_.x=this._viscousLimit(_.x,M.max.x)),_.y>M.max.y&&(_.y=this._viscousLimit(_.y,M.max.y)),this._draggable._newPos=this._draggable._startPos.add(_)}},_onPreDragWrap:function(){var _=this._worldWidth,M=Math.round(_/2),S=this._initialWorldOffset,D=this._draggable._newPos.x,z=(D-M+S)%_+M-S,V=(D+M+S)%_-M-S,nt=Math.abs(z+S)<Math.abs(V+S)?z:V;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=nt},_onDragEnd:function(_){var M=this._map,S=M.options,D=!S.inertia||_.noInertia||this._times.length<2;if(M.fire("dragend",_),D)M.fire("moveend");else{this._prunePositions(+new Date);var z=this._lastPos.subtract(this._positions[0]),V=(this._lastTime-this._times[0])/1e3,nt=S.easeLinearity,dt=z.multiplyBy(nt/V),gt=dt.distanceTo([0,0]),Mt=Math.min(S.inertiaMaxSpeed,gt),Tt=dt.multiplyBy(Mt/gt),It=Mt/(S.inertiaDeceleration*nt),Vt=Tt.multiplyBy(-It/2).round();!Vt.x&&!Vt.y?M.fire("moveend"):(Vt=M._limitOffset(Vt,M.options.maxBounds),ue(function(){M.panBy(Vt,{duration:It,easeLinearity:nt,noMoveStart:!0,animate:!0})}))}}});qt.addInitHook("addHandler","dragging",Es),qt.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Bs=Ke.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(_){this._map=_,this._setPanDelta(_.options.keyboardPanDelta),this._setZoomDelta(_.options.zoomDelta)},addHooks:function(){var _=this._map._container;_.tabIndex<=0&&(_.tabIndex="0"),jt(_,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),$t(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 _=document.body,M=document.documentElement,S=_.scrollTop||M.scrollTop,D=_.scrollLeft||M.scrollLeft;this._map._container.focus(),window.scrollTo(D,S)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(_){var M=this._panKeys={},S=this.keyCodes,D,z;for(D=0,z=S.left.length;D<z;D++)M[S.left[D]]=[-1*_,0];for(D=0,z=S.right.length;D<z;D++)M[S.right[D]]=[_,0];for(D=0,z=S.down.length;D<z;D++)M[S.down[D]]=[0,_];for(D=0,z=S.up.length;D<z;D++)M[S.up[D]]=[0,-1*_]},_setZoomDelta:function(_){var M=this._zoomKeys={},S=this.keyCodes,D,z;for(D=0,z=S.zoomIn.length;D<z;D++)M[S.zoomIn[D]]=_;for(D=0,z=S.zoomOut.length;D<z;D++)M[S.zoomOut[D]]=-_},_addHooks:function(){jt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){$t(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(_){if(!(_.altKey||_.ctrlKey||_.metaKey)){var M=_.keyCode,S=this._map,D;if(M in this._panKeys){if(!S._panAnim||!S._panAnim._inProgress)if(D=this._panKeys[M],_.shiftKey&&(D=zt(D).multiplyBy(3)),S.options.maxBounds&&(D=S._limitOffset(zt(D),S.options.maxBounds)),S.options.worldCopyJump){var z=S.wrapLatLng(S.unproject(S.project(S.getCenter()).add(D)));S.panTo(z)}else S.panBy(D)}else if(M in this._zoomKeys)S.setZoom(S.getZoom()+(_.shiftKey?3:1)*this._zoomKeys[M]);else if(M===27&&S._popup&&S._popup.options.closeOnEscapeKey)S.closePopup();else return;xi(_)}}});qt.addInitHook("addHandler","keyboard",Bs),qt.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Ei=Ke.extend({addHooks:function(){jt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){$t(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(_){var M=rs(_),S=this._map.options.wheelDebounceTime;this._delta+=M,this._lastMousePos=this._map.mouseEventToContainerPoint(_),this._startTime||(this._startTime=+new Date);var D=Math.max(S-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(N(this._performZoom,this),D),xi(_)},_performZoom:function(){var _=this._map,M=_.getZoom(),S=this._map.options.zoomSnap||0;_._stop();var D=this._delta/(this._map.options.wheelPxPerZoomLevel*4),z=4*Math.log(2/(1+Math.exp(-Math.abs(D))))/Math.LN2,V=S?Math.ceil(z/S)*S:z,nt=_._limitZoom(M+(this._delta>0?V:-V))-M;this._delta=0,this._startTime=null,nt&&(_.options.scrollWheelZoom==="center"?_.setZoom(M+nt):_.setZoomAround(this._lastMousePos,M+nt))}});qt.addInitHook("addHandler","scrollWheelZoom",Ei);var Ps=600;qt.mergeOptions({tapHold:Rt.touchNative&&Rt.safari&&Rt.mobile,tapTolerance:15});var Lr=Ke.extend({addHooks:function(){jt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){$t(this._map._container,"touchstart",this._onDown,this)},_onDown:function(_){if(clearTimeout(this._holdTimeout),_.touches.length===1){var M=_.touches[0];this._startPos=this._newPos=new Gt(M.clientX,M.clientY),this._holdTimeout=setTimeout(N(function(){this._cancel(),this._isTapValid()&&(jt(document,"touchend",me),jt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",M))},this),Ps),jt(document,"touchend touchcancel contextmenu",this._cancel,this),jt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function _(){$t(document,"touchend",me),$t(document,"touchend touchcancel",_)},_cancel:function(){clearTimeout(this._holdTimeout),$t(document,"touchend touchcancel contextmenu",this._cancel,this),$t(document,"touchmove",this._onMove,this)},_onMove:function(_){var M=_.touches[0];this._newPos=new Gt(M.clientX,M.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(_,M){var S=new MouseEvent(_,{bubbles:!0,cancelable:!0,view:window,screenX:M.screenX,screenY:M.screenY,clientX:M.clientX,clientY:M.clientY});S._simulated=!0,M.target.dispatchEvent(S)}});qt.addInitHook("addHandler","tapHold",Lr),qt.mergeOptions({touchZoom:Rt.touch,bounceAtZoomLimits:!0});var br=Ke.extend({addHooks:function(){Ht(this._map._container,"leaflet-touch-zoom"),jt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ae(this._map._container,"leaflet-touch-zoom"),$t(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(_){var M=this._map;if(!(!_.touches||_.touches.length!==2||M._animatingZoom||this._zooming)){var S=M.mouseEventToContainerPoint(_.touches[0]),D=M.mouseEventToContainerPoint(_.touches[1]);this._centerPoint=M.getSize()._divideBy(2),this._startLatLng=M.containerPointToLatLng(this._centerPoint),M.options.touchZoom!=="center"&&(this._pinchStartLatLng=M.containerPointToLatLng(S.add(D)._divideBy(2))),this._startDist=S.distanceTo(D),this._startZoom=M.getZoom(),this._moved=!1,this._zooming=!0,M._stop(),jt(document,"touchmove",this._onTouchMove,this),jt(document,"touchend touchcancel",this._onTouchEnd,this),me(_)}},_onTouchMove:function(_){if(!(!_.touches||_.touches.length!==2||!this._zooming)){var M=this._map,S=M.mouseEventToContainerPoint(_.touches[0]),D=M.mouseEventToContainerPoint(_.touches[1]),z=S.distanceTo(D)/this._startDist;if(this._zoom=M.getScaleZoom(z,this._startZoom),!M.options.bounceAtZoomLimits&&(this._zoom<M.getMinZoom()&&z<1||this._zoom>M.getMaxZoom()&&z>1)&&(this._zoom=M._limitZoom(this._zoom)),M.options.touchZoom==="center"){if(this._center=this._startLatLng,z===1)return}else{var V=S._add(D)._divideBy(2)._subtract(this._centerPoint);if(z===1&&V.x===0&&V.y===0)return;this._center=M.unproject(M.project(this._pinchStartLatLng,this._zoom).subtract(V),this._zoom)}this._moved||(M._moveStart(!0,!1),this._moved=!0),Me(this._animRequest);var nt=N(M._move,M,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=ue(nt,this,!0),me(_)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,Me(this._animRequest),$t(document,"touchmove",this._onTouchMove,this),$t(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))}});qt.addInitHook("addHandler","touchZoom",br),qt.BoxZoom=qi,qt.DoubleClickZoom=ws,qt.Drag=Es,qt.Keyboard=Bs,qt.ScrollWheelZoom=Ei,qt.TapHold=Lr,qt.TouchZoom=br,G.Bounds=ne,G.Browser=Rt,G.CRS=ni,G.Canvas=Tn,G.Circle=Hi,G.CircleMarker=Pn,G.Class=ii,G.Control=Ue,G.DivIcon=fi,G.DivOverlay=$e,G.DomEvent=Wt,G.DomUtil=_a,G.Draggable=di,G.Evented=Yi,G.FeatureGroup=Ye,G.GeoJSON=oi,G.GridLayer=cn,G.Handler=Ke,G.Icon=Ui,G.ImageOverlay=Vi,G.LatLng=Qt,G.LatLngBounds=Ee,G.Layer=Be,G.LayerGroup=si,G.LineUtil=Mn,G.Map=qt,G.Marker=Bn,G.Mixin=va,G.Path=Ne,G.Point=Gt,G.PolyUtil=cs,G.Polygon=Le,G.Polyline=ai,G.Popup=ln,G.PosAnimation=ss,G.Projection=_s,G.Rectangle=Dn,G.Renderer=Xe,G.SVG=ce,G.SVGOverlay=yr,G.TileLayer=_i,G.Tooltip=An,G.Transformation=Nn,G.Util=qs,G.VideoOverlay=Ls,G.bind=N,G.bounds=we,G.canvas=vr,G.circle=Ma,G.circleMarker=pr,G.control=Ii,G.divIcon=hn,G.extend=tt,G.featureGroup=xa,G.geoJSON=vs,G.geoJson=wa,G.gridLayer=bs,G.icon=ka,G.imageOverlay=Ea,G.latLng=Kt,G.latLngBounds=le,G.layerGroup=En,G.map=xn,G.marker=gs,G.point=zt,G.polygon=_r,G.polyline=fr,G.popup=Sa,G.rectangle=Da,G.setOptions=St,G.stamp=et,G.svg=Ms,G.svgOverlay=Pa,G.tileLayer=Cs,G.tooltip=Aa,G.transformation=Xi,G.version=X,G.videoOverlay=Ba;var be=window.L;G.noConflict=function(){return window.L=be,this},window.L=G}))})(leafletSrc$1,leafletSrc$1.exports)),leafletSrc$1.exports}var leafletSrcExports=requireLeafletSrc();const L$2=getDefaultExportFromCjs(leafletSrcExports),t=Object.freeze(Object.defineProperty({__proto__:null,default:L$2},Symbol.toStringTag,{value:"Module"}));function bound01(j,H){isOnePointZero(j)&&(j="100%");const G=isPercentage(j);return j=H===360?j:Math.min(H,Math.max(0,parseFloat(j))),G&&(j=parseInt(String(j*H),10)/100),Math.abs(j-H)<1e-6?1:(H===360?j=(j<0?j%H+H:j%H)/parseFloat(String(H)):j=j%H/parseFloat(String(H)),j)}function clamp01(j){return Math.min(1,Math.max(0,j))}function isOnePointZero(j){return typeof j=="string"&&j.indexOf(".")!==-1&&parseFloat(j)===1}function isPercentage(j){return typeof j=="string"&&j.indexOf("%")!==-1}function boundAlpha(j){return j=parseFloat(j),(isNaN(j)||j<0||j>1)&&(j=1),j}function convertToPercentage(j){return Number(j)<=1?`${Number(j)*100}%`:j}function pad2(j){return j.length===1?"0"+j:String(j)}function rgbToRgb(j,H,G){return{r:bound01(j,255)*255,g:bound01(H,255)*255,b:bound01(G,255)*255}}function rgbToHsl(j,H,G){j=bound01(j,255),H=bound01(H,255),G=bound01(G,255);const X=Math.max(j,H,G),tt=Math.min(j,H,G);let F=0,N=0;const W=(X+tt)/2;if(X===tt)N=0,F=0;else{const et=X-tt;switch(N=W>.5?et/(2-X-tt):et/(X+tt),X){case j:F=(H-G)/et+(H<G?6:0);break;case H:F=(G-j)/et+2;break;case G:F=(j-H)/et+4;break}F/=6}return{h:F,s:N,l:W}}function hue2rgb(j,H,G){return G<0&&(G+=1),G>1&&(G-=1),G<1/6?j+(H-j)*(6*G):G<1/2?H:G<2/3?j+(H-j)*(2/3-G)*6:j}function hslToRgb(j,H,G){let X,tt,F;if(j=bound01(j,360),H=bound01(H,100),G=bound01(G,100),H===0)tt=G,F=G,X=G;else{const N=G<.5?G*(1+H):G+H-G*H,W=2*G-N;X=hue2rgb(W,N,j+1/3),tt=hue2rgb(W,N,j),F=hue2rgb(W,N,j-1/3)}return{r:X*255,g:tt*255,b:F*255}}function rgbToHsv(j,H,G){j=bound01(j,255),H=bound01(H,255),G=bound01(G,255);const X=Math.max(j,H,G),tt=Math.min(j,H,G);let F=0;const N=X,W=X-tt,et=X===0?0:W/X;if(X===tt)F=0;else{switch(X){case j:F=(H-G)/W+(H<G?6:0);break;case H:F=(G-j)/W+2;break;case G:F=(j-H)/W+4;break}F/=6}return{h:F,s:et,v:N}}function hsvToRgb(j,H,G){j=bound01(j,360)*6,H=bound01(H,100),G=bound01(G,100);const X=Math.floor(j),tt=j-X,F=G*(1-H),N=G*(1-tt*H),W=G*(1-(1-tt)*H),et=X%6,ft=[G,N,F,F,W,G][et],Lt=[W,G,G,N,F,F][et],pt=[F,F,W,G,G,N][et];return{r:ft*255,g:Lt*255,b:pt*255}}function rgbToHex(j,H,G,X){const tt=[pad2(Math.round(j).toString(16)),pad2(Math.round(H).toString(16)),pad2(Math.round(G).toString(16))];return X&&tt[0].startsWith(tt[0].charAt(1))&&tt[1].startsWith(tt[1].charAt(1))&&tt[2].startsWith(tt[2].charAt(1))?tt[0].charAt(0)+tt[1].charAt(0)+tt[2].charAt(0):tt.join("")}function rgbaToHex(j,H,G,X,tt){const F=[pad2(Math.round(j).toString(16)),pad2(Math.round(H).toString(16)),pad2(Math.round(G).toString(16)),pad2(convertDecimalToHex(X))];return tt&&F[0].startsWith(F[0].charAt(1))&&F[1].startsWith(F[1].charAt(1))&&F[2].startsWith(F[2].charAt(1))&&F[3].startsWith(F[3].charAt(1))?F[0].charAt(0)+F[1].charAt(0)+F[2].charAt(0)+F[3].charAt(0):F.join("")}function cmykToRgb(j,H,G,X){const tt=j/100,F=H/100,N=G/100,W=X/100,et=255*(1-tt)*(1-W),ft=255*(1-F)*(1-W),Lt=255*(1-N)*(1-W);return{r:et,g:ft,b:Lt}}function rgbToCmyk(j,H,G){let X=1-j/255,tt=1-H/255,F=1-G/255,N=Math.min(X,tt,F);return N===1?(X=0,tt=0,F=0):(X=(X-N)/(1-N)*100,tt=(tt-N)/(1-N)*100,F=(F-N)/(1-N)*100),N*=100,{c:Math.round(X),m:Math.round(tt),y:Math.round(F),k:Math.round(N)}}function convertDecimalToHex(j){return Math.round(parseFloat(j)*255).toString(16)}function convertHexToDecimal(j){return parseIntFromHex(j)/255}function parseIntFromHex(j){return parseInt(j,16)}function numberInputToObject(j){return{r:j>>16,g:(j&65280)>>8,b:j&255}}const names={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function inputToRGB(j){let H={r:0,g:0,b:0},G=1,X=null,tt=null,F=null,N=!1,W=!1;return typeof j=="string"&&(j=stringInputToObject(j)),typeof j=="object"&&(isValidCSSUnit(j.r)&&isValidCSSUnit(j.g)&&isValidCSSUnit(j.b)?(H=rgbToRgb(j.r,j.g,j.b),N=!0,W=String(j.r).substr(-1)==="%"?"prgb":"rgb"):isValidCSSUnit(j.h)&&isValidCSSUnit(j.s)&&isValidCSSUnit(j.v)?(X=convertToPercentage(j.s),tt=convertToPercentage(j.v),H=hsvToRgb(j.h,X,tt),N=!0,W="hsv"):isValidCSSUnit(j.h)&&isValidCSSUnit(j.s)&&isValidCSSUnit(j.l)?(X=convertToPercentage(j.s),F=convertToPercentage(j.l),H=hslToRgb(j.h,X,F),N=!0,W="hsl"):isValidCSSUnit(j.c)&&isValidCSSUnit(j.m)&&isValidCSSUnit(j.y)&&isValidCSSUnit(j.k)&&(H=cmykToRgb(j.c,j.m,j.y,j.k),N=!0,W="cmyk"),Object.prototype.hasOwnProperty.call(j,"a")&&(G=j.a)),G=boundAlpha(G),{ok:N,format:j.format||W,r:Math.min(255,Math.max(H.r,0)),g:Math.min(255,Math.max(H.g,0)),b:Math.min(255,Math.max(H.b,0)),a:G}}const CSS_INTEGER="[-\\+]?\\d+%?",CSS_NUMBER="[-\\+]?\\d*\\.\\d+%?",CSS_UNIT="(?:"+CSS_NUMBER+")|(?:"+CSS_INTEGER+")",PERMISSIVE_MATCH3="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?",PERMISSIVE_MATCH4="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?",matchers={CSS_UNIT:new RegExp(CSS_UNIT),rgb:new RegExp("rgb"+PERMISSIVE_MATCH3),rgba:new RegExp("rgba"+PERMISSIVE_MATCH4),hsl:new RegExp("hsl"+PERMISSIVE_MATCH3),hsla:new RegExp("hsla"+PERMISSIVE_MATCH4),hsv:new RegExp("hsv"+PERMISSIVE_MATCH3),hsva:new RegExp("hsva"+PERMISSIVE_MATCH4),cmyk:new RegExp("cmyk"+PERMISSIVE_MATCH4),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function stringInputToObject(j){if(j=j.trim().toLowerCase(),j.length===0)return!1;let H=!1;if(names[j])j=names[j],H=!0;else if(j==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let G=matchers.rgb.exec(j);return G?{r:G[1],g:G[2],b:G[3]}:(G=matchers.rgba.exec(j),G?{r:G[1],g:G[2],b:G[3],a:G[4]}:(G=matchers.hsl.exec(j),G?{h:G[1],s:G[2],l:G[3]}:(G=matchers.hsla.exec(j),G?{h:G[1],s:G[2],l:G[3],a:G[4]}:(G=matchers.hsv.exec(j),G?{h:G[1],s:G[2],v:G[3]}:(G=matchers.hsva.exec(j),G?{h:G[1],s:G[2],v:G[3],a:G[4]}:(G=matchers.cmyk.exec(j),G?{c:G[1],m:G[2],y:G[3],k:G[4]}:(G=matchers.hex8.exec(j),G?{r:parseIntFromHex(G[1]),g:parseIntFromHex(G[2]),b:parseIntFromHex(G[3]),a:convertHexToDecimal(G[4]),format:H?"name":"hex8"}:(G=matchers.hex6.exec(j),G?{r:parseIntFromHex(G[1]),g:parseIntFromHex(G[2]),b:parseIntFromHex(G[3]),format:H?"name":"hex"}:(G=matchers.hex4.exec(j),G?{r:parseIntFromHex(G[1]+G[1]),g:parseIntFromHex(G[2]+G[2]),b:parseIntFromHex(G[3]+G[3]),a:convertHexToDecimal(G[4]+G[4]),format:H?"name":"hex8"}:(G=matchers.hex3.exec(j),G?{r:parseIntFromHex(G[1]+G[1]),g:parseIntFromHex(G[2]+G[2]),b:parseIntFromHex(G[3]+G[3]),format:H?"name":"hex"}:!1))))))))))}function isValidCSSUnit(j){return typeof j=="number"?!Number.isNaN(j):matchers.CSS_UNIT.test(j)}class TinyColor{constructor(H="",G={}){if(H instanceof TinyColor)return H;typeof H=="number"&&(H=numberInputToObject(H)),this.originalInput=H;const X=inputToRGB(H);this.originalInput=H,this.r=X.r,this.g=X.g,this.b=X.b,this.a=X.a,this.roundA=Math.round(100*this.a)/100,this.format=G.format??X.format,this.gradientType=G.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=X.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const H=this.toRgb();return(H.r*299+H.g*587+H.b*114)/1e3}getLuminance(){const H=this.toRgb();let G,X,tt;const F=H.r/255,N=H.g/255,W=H.b/255;return F<=.03928?G=F/12.92:G=Math.pow((F+.055)/1.055,2.4),N<=.03928?X=N/12.92:X=Math.pow((N+.055)/1.055,2.4),W<=.03928?tt=W/12.92:tt=Math.pow((W+.055)/1.055,2.4),.2126*G+.7152*X+.0722*tt}getAlpha(){return this.a}setAlpha(H){return this.a=boundAlpha(H),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:H}=this.toHsl();return H===0}toHsv(){const H=rgbToHsv(this.r,this.g,this.b);return{h:H.h*360,s:H.s,v:H.v,a:this.a}}toHsvString(){const H=rgbToHsv(this.r,this.g,this.b),G=Math.round(H.h*360),X=Math.round(H.s*100),tt=Math.round(H.v*100);return this.a===1?`hsv(${G}, ${X}%, ${tt}%)`:`hsva(${G}, ${X}%, ${tt}%, ${this.roundA})`}toHsl(){const H=rgbToHsl(this.r,this.g,this.b);return{h:H.h*360,s:H.s,l:H.l,a:this.a}}toHslString(){const H=rgbToHsl(this.r,this.g,this.b),G=Math.round(H.h*360),X=Math.round(H.s*100),tt=Math.round(H.l*100);return this.a===1?`hsl(${G}, ${X}%, ${tt}%)`:`hsla(${G}, ${X}%, ${tt}%, ${this.roundA})`}toHex(H=!1){return rgbToHex(this.r,this.g,this.b,H)}toHexString(H=!1){return"#"+this.toHex(H)}toHex8(H=!1){return rgbaToHex(this.r,this.g,this.b,this.a,H)}toHex8String(H=!1){return"#"+this.toHex8(H)}toHexShortString(H=!1){return this.a===1?this.toHexString(H):this.toHex8String(H)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const H=Math.round(this.r),G=Math.round(this.g),X=Math.round(this.b);return this.a===1?`rgb(${H}, ${G}, ${X})`:`rgba(${H}, ${G}, ${X}, ${this.roundA})`}toPercentageRgb(){const H=G=>`${Math.round(bound01(G,255)*100)}%`;return{r:H(this.r),g:H(this.g),b:H(this.b),a:this.a}}toPercentageRgbString(){const H=G=>Math.round(bound01(G,255)*100);return this.a===1?`rgb(${H(this.r)}%, ${H(this.g)}%, ${H(this.b)}%)`:`rgba(${H(this.r)}%, ${H(this.g)}%, ${H(this.b)}%, ${this.roundA})`}toCmyk(){return{...rgbToCmyk(this.r,this.g,this.b)}}toCmykString(){const{c:H,m:G,y:X,k:tt}=rgbToCmyk(this.r,this.g,this.b);return`cmyk(${H}, ${G}, ${X}, ${tt})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const H="#"+rgbToHex(this.r,this.g,this.b,!1);for(const[G,X]of Object.entries(names))if(H===X)return G;return!1}toString(H){const G=!!H;H=H??this.format;let X=!1;const tt=this.a<1&&this.a>=0;return!G&&tt&&(H.startsWith("hex")||H==="name")?H==="name"&&this.a===0?this.toName():this.toRgbString():(H==="rgb"&&(X=this.toRgbString()),H==="prgb"&&(X=this.toPercentageRgbString()),(H==="hex"||H==="hex6")&&(X=this.toHexString()),H==="hex3"&&(X=this.toHexString(!0)),H==="hex4"&&(X=this.toHex8String(!0)),H==="hex8"&&(X=this.toHex8String()),H==="name"&&(X=this.toName()),H==="hsl"&&(X=this.toHslString()),H==="hsv"&&(X=this.toHsvString()),H==="cmyk"&&(X=this.toCmykString()),X||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new TinyColor(this.toString())}lighten(H=10){const G=this.toHsl();return G.l+=H/100,G.l=clamp01(G.l),new TinyColor(G)}brighten(H=10){const G=this.toRgb();return G.r=Math.max(0,Math.min(255,G.r-Math.round(255*-(H/100)))),G.g=Math.max(0,Math.min(255,G.g-Math.round(255*-(H/100)))),G.b=Math.max(0,Math.min(255,G.b-Math.round(255*-(H/100)))),new TinyColor(G)}darken(H=10){const G=this.toHsl();return G.l-=H/100,G.l=clamp01(G.l),new TinyColor(G)}tint(H=10){return this.mix("white",H)}shade(H=10){return this.mix("black",H)}desaturate(H=10){const G=this.toHsl();return G.s-=H/100,G.s=clamp01(G.s),new TinyColor(G)}saturate(H=10){const G=this.toHsl();return G.s+=H/100,G.s=clamp01(G.s),new TinyColor(G)}greyscale(){return this.desaturate(100)}spin(H){const G=this.toHsl(),X=(G.h+H)%360;return G.h=X<0?360+X:X,new TinyColor(G)}mix(H,G=50){const X=this.toRgb(),tt=new TinyColor(H).toRgb(),F=G/100,N={r:(tt.r-X.r)*F+X.r,g:(tt.g-X.g)*F+X.g,b:(tt.b-X.b)*F+X.b,a:(tt.a-X.a)*F+X.a};return new TinyColor(N)}analogous(H=6,G=30){const X=this.toHsl(),tt=360/G,F=[this];for(X.h=(X.h-(tt*H>>1)+720)%360;--H;)X.h=(X.h+tt)%360,F.push(new TinyColor(X));return F}complement(){const H=this.toHsl();return H.h=(H.h+180)%360,new TinyColor(H)}monochromatic(H=6){const G=this.toHsv(),{h:X}=G,{s:tt}=G;let{v:F}=G;const N=[],W=1/H;for(;H--;)N.push(new TinyColor({h:X,s:tt,v:F})),F=(F+W)%1;return N}splitcomplement(){const H=this.toHsl(),{h:G}=H;return[this,new TinyColor({h:(G+72)%360,s:H.s,l:H.l}),new TinyColor({h:(G+216)%360,s:H.s,l:H.l})]}onBackground(H){const G=this.toRgb(),X=new TinyColor(H).toRgb(),tt=G.a+X.a*(1-G.a);return new TinyColor({r:(G.r*G.a+X.r*X.a*(1-G.a))/tt,g:(G.g*G.a+X.g*X.a*(1-G.a))/tt,b:(G.b*G.a+X.b*X.a*(1-G.a))/tt,a:tt})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(H){const G=this.toHsl(),{h:X}=G,tt=[this],F=360/H;for(let N=1;N<H;N++)tt.push(new TinyColor({h:(X+N*F)%360,s:G.s,l:G.l}));return tt}equals(H){const G=new TinyColor(H);return this.format==="cmyk"||G.format==="cmyk"?this.toCmykString()===G.toCmykString():this.toRgbString()===G.toRgbString()}}var leafletGeoman={},hasRequiredLeafletGeoman;function requireLeafletGeoman(){return hasRequiredLeafletGeoman||(hasRequiredLeafletGeoman=1,(()=>{var j=Object.create,H=Object.defineProperty,G=Object.getOwnPropertyDescriptor,X=Object.getOwnPropertyNames,tt=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty,N=(C,k)=>()=>(k||C((k={exports:{}}).exports,k),k.exports),W=(C,k,B,P)=>{if(k&&typeof k=="object"||typeof k=="function")for(let A of X(k))!F.call(C,A)&&A!==B&&H(C,A,{get:()=>k[A],enumerable:!(P=G(k,A))||P.enumerable});return C},et=(C,k,B)=>(B=C!=null?j(tt(C)):{},W(k||!C||!C.__esModule?H(B,"default",{value:C,enumerable:!0}):B,C)),ft=N((C,k)=>{function B(){this.__data__=[],this.size=0}k.exports=B}),Lt=N((C,k)=>{function B(P,A){return P===A||P!==P&&A!==A}k.exports=B}),pt=N((C,k)=>{var B=Lt();function P(A,T){for(var O=A.length;O--;)if(B(A[O][0],T))return O;return-1}k.exports=P}),Ct=N((C,k)=>{var B=pt(),P=Array.prototype,A=P.splice;function T(O){var R=this.__data__,Z=B(R,O);if(Z<0)return!1;var U=R.length-1;return Z==U?R.pop():A.call(R,Z,1),--this.size,!0}k.exports=T}),bt=N((C,k)=>{var B=pt();function P(A){var T=this.__data__,O=B(T,A);return O<0?void 0:T[O][1]}k.exports=P}),Dt=N((C,k)=>{var B=pt();function P(A){return B(this.__data__,A)>-1}k.exports=P}),St=N((C,k)=>{var B=pt();function P(A,T){var O=this.__data__,R=B(O,A);return R<0?(++this.size,O.push([A,T])):O[R][1]=T,this}k.exports=P}),Jt=N((C,k)=>{var B=ft(),P=Ct(),A=bt(),T=Dt(),O=St();function R(Z){var U=-1,Q=Z==null?0:Z.length;for(this.clear();++U<Q;){var Y=Z[U];this.set(Y[0],Y[1])}}R.prototype.clear=B,R.prototype.delete=P,R.prototype.get=A,R.prototype.has=T,R.prototype.set=O,k.exports=R}),Zt=N((C,k)=>{var B=Jt();function P(){this.__data__=new B,this.size=0}k.exports=P}),ee=N((C,k)=>{function B(P){var A=this.__data__,T=A.delete(P);return this.size=A.size,T}k.exports=B}),ie=N((C,k)=>{function B(P){return this.__data__.get(P)}k.exports=B}),ei=N((C,k)=>{function B(P){return this.__data__.has(P)}k.exports=B}),ke=N((C,k)=>{var B=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal;k.exports=B}),Ve=N((C,k)=>{var B=ke(),P=typeof self=="object"&&self&&self.Object===Object&&self,A=B||P||Function("return this")();k.exports=A}),pn=N((C,k)=>{var B=Ve(),P=B.Symbol;k.exports=P}),Pr=N((C,k)=>{var B=pn(),P=Object.prototype,A=P.hasOwnProperty,T=P.toString,O=B?B.toStringTag:void 0;function R(Z){var U=A.call(Z,O),Q=Z[O];try{Z[O]=void 0;var Y=!0}catch{}var ot=T.call(Z);return Y&&(U?Z[O]=Q:delete Z[O]),ot}k.exports=R}),Rn=N((C,k)=>{var B=Object.prototype,P=B.toString;function A(T){return P.call(T)}k.exports=A}),Si=N((C,k)=>{var B=pn(),P=Pr(),A=Rn(),T="[object Null]",O="[object Undefined]",R=B?B.toStringTag:void 0;function Z(U){return U==null?U===void 0?O:T:R&&R in Object(U)?P(U):A(U)}k.exports=Z}),ue=N((C,k)=>{function B(P){var A=typeof P;return P!=null&&(A=="object"||A=="function")}k.exports=B}),Me=N((C,k)=>{var B=Si(),P=ue(),A="[object AsyncFunction]",T="[object Function]",O="[object GeneratorFunction]",R="[object Proxy]";function Z(U){if(!P(U))return!1;var Q=B(U);return Q==T||Q==O||Q==A||Q==R}k.exports=Z}),qs=N((C,k)=>{var B=Ve(),P=B["__core-js_shared__"];k.exports=P}),ii=N((C,k)=>{var B=qs(),P=(function(){var T=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||"");return T?"Symbol(src)_1."+T:""})();function A(T){return!!P&&P in T}k.exports=A}),Ks=N((C,k)=>{var B=Function.prototype,P=B.toString;function A(T){if(T!=null){try{return P.call(T)}catch{}try{return T+""}catch{}}return""}k.exports=A}),Te=N((C,k)=>{var B=Me(),P=ii(),A=ue(),T=Ks(),O=/[\\^$.*+?()[\]{}|]/g,R=/^\[object .+?Constructor\]$/,Z=Function.prototype,U=Object.prototype,Q=Z.toString,Y=U.hasOwnProperty,ot=RegExp("^"+Q.call(Y).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ut(vt){if(!A(vt)||P(vt))return!1;var xt=B(vt)?ot:R;return xt.test(T(vt))}k.exports=ut}),Yi=N((C,k)=>{function B(P,A){return P?.[A]}k.exports=B}),Gt=N((C,k)=>{var B=Te(),P=Yi();function A(T,O){var R=P(T,O);return B(R)?R:void 0}k.exports=A}),In=N((C,k)=>{var B=Gt(),P=Ve(),A=B(P,"Map");k.exports=A}),zt=N((C,k)=>{var B=Gt(),P=B(Object,"create");k.exports=P}),ne=N((C,k)=>{var B=zt();function P(){this.__data__=B?B(null):{},this.size=0}k.exports=P}),we=N((C,k)=>{function B(P){var A=this.has(P)&&delete this.__data__[P];return this.size-=A?1:0,A}k.exports=B}),Ee=N((C,k)=>{var B=zt(),P="__lodash_hash_undefined__",A=Object.prototype,T=A.hasOwnProperty;function O(R){var Z=this.__data__;if(B){var U=Z[R];return U===P?void 0:U}return T.call(Z,R)?Z[R]:void 0}k.exports=O}),le=N((C,k)=>{var B=zt(),P=Object.prototype,A=P.hasOwnProperty;function T(O){var R=this.__data__;return B?R[O]!==void 0:A.call(R,O)}k.exports=T}),Qt=N((C,k)=>{var B=zt(),P="__lodash_hash_undefined__";function A(T,O){var R=this.__data__;return this.size+=this.has(T)?0:1,R[T]=B&&O===void 0?P:O,this}k.exports=A}),Kt=N((C,k)=>{var B=ne(),P=we(),A=Ee(),T=le(),O=Qt();function R(Z){var U=-1,Q=Z==null?0:Z.length;for(this.clear();++U<Q;){var Y=Z[U];this.set(Y[0],Y[1])}}R.prototype.clear=B,R.prototype.delete=P,R.prototype.get=A,R.prototype.has=T,R.prototype.set=O,k.exports=R}),ni=N((C,k)=>{var B=Kt(),P=Jt(),A=In();function T(){this.size=0,this.__data__={hash:new B,map:new(A||P),string:new B}}k.exports=T}),li=N((C,k)=>{function B(P){var A=typeof P;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?P!=="__proto__":P===null}k.exports=B}),$i=N((C,k)=>{var B=li();function P(A,T){var O=A.__data__;return B(T)?O[typeof T=="string"?"string":"hash"]:O.map}k.exports=P}),zn=N((C,k)=>{var B=$i();function P(A){var T=B(this,A).delete(A);return this.size-=T?1:0,T}k.exports=P}),Nn=N((C,k)=>{var B=$i();function P(A){return B(this,A).get(A)}k.exports=P}),Xi=N((C,k)=>{var B=$i();function P(A){return B(this,A).has(A)}k.exports=P}),Gn=N((C,k)=>{var B=$i();function P(A,T){var O=B(this,A),R=O.size;return O.set(A,T),this.size+=O.size==R?0:1,this}k.exports=P}),Sr=N((C,k)=>{var B=ni(),P=zn(),A=Nn(),T=Xi(),O=Gn();function R(Z){var U=-1,Q=Z==null?0:Z.length;for(this.clear();++U<Q;){var Y=Z[U];this.set(Y[0],Y[1])}}R.prototype.clear=B,R.prototype.delete=P,R.prototype.get=A,R.prototype.has=T,R.prototype.set=O,k.exports=R}),Ar=N((C,k)=>{var B=Jt(),P=In(),A=Sr(),T=200;function O(R,Z){var U=this.__data__;if(U instanceof B){var Q=U.__data__;if(!P||Q.length<T-1)return Q.push([R,Z]),this.size=++U.size,this;U=this.__data__=new A(Q)}return U.set(R,Z),this.size=U.size,this}k.exports=O}),Tr=N((C,k)=>{var B=Jt(),P=Zt(),A=ee(),T=ie(),O=ei(),R=Ar();function Z(U){var Q=this.__data__=new B(U);this.size=Q.size}Z.prototype.clear=P,Z.prototype.delete=A,Z.prototype.get=T,Z.prototype.has=O,Z.prototype.set=R,k.exports=Z}),fn=N((C,k)=>{var B=Gt(),P=(function(){try{var A=B(Object,"defineProperty");return A({},"",{}),A}catch{}})();k.exports=P}),Ai=N((C,k)=>{var B=fn();function P(A,T,O){T=="__proto__"&&B?B(A,T,{configurable:!0,enumerable:!0,value:O,writable:!0}):A[T]=O}k.exports=P}),Dr=N((C,k)=>{var B=Ai(),P=Lt();function A(T,O,R){(R!==void 0&&!P(T[O],R)||R===void 0&&!(O in T))&&B(T,O,R)}k.exports=A}),Or=N((C,k)=>{function B(P){return function(A,T,O){for(var R=-1,Z=Object(A),U=O(A),Q=U.length;Q--;){var Y=U[P?Q:++R];if(T(Z[Y],Y,Z)===!1)break}return A}}k.exports=B}),Zn=N((C,k)=>{var B=Or(),P=B();k.exports=P}),Fr=N((C,k)=>{var B=Ve(),P=typeof C=="object"&&C&&!C.nodeType&&C,A=P&&typeof k=="object"&&k&&!k.nodeType&&k,T=A&&A.exports===P,O=T?B.Buffer:void 0,R=O?O.allocUnsafe:void 0;function Z(U,Q){if(Q)return U.slice();var Y=U.length,ot=R?R(Y):new U.constructor(Y);return U.copy(ot),ot}k.exports=Z}),Rr=N((C,k)=>{var B=Ve(),P=B.Uint8Array;k.exports=P}),Ws=N((C,k)=>{var B=Rr();function P(A){var T=new A.constructor(A.byteLength);return new B(T).set(new B(A)),T}k.exports=P}),Ys=N((C,k)=>{var B=Ws();function P(A,T){var O=T?B(A.buffer):A.buffer;return new A.constructor(O,A.byteOffset,A.length)}k.exports=P}),jn=N((C,k)=>{function B(P,A){var T=-1,O=P.length;for(A||(A=Array(O));++T<O;)A[T]=P[T];return A}k.exports=B}),Ir=N((C,k)=>{var B=ue(),P=Object.create,A=(function(){function T(){}return function(O){if(!B(O))return{};if(P)return P(O);T.prototype=O;var R=new T;return T.prototype=void 0,R}})();k.exports=A}),zr=N((C,k)=>{function B(P,A){return function(T){return P(A(T))}}k.exports=B}),Nr=N((C,k)=>{var B=zr(),P=B(Object.getPrototypeOf,Object);k.exports=P}),Un=N((C,k)=>{var B=Object.prototype;function P(A){var T=A&&A.constructor,O=typeof T=="function"&&T.prototype||B;return A===O}k.exports=P}),Gr=N((C,k)=>{var B=Ir(),P=Nr(),A=Un();function T(O){return typeof O.constructor=="function"&&!A(O)?B(P(O)):{}}k.exports=T}),Ti=N((C,k)=>{function B(P){return P!=null&&typeof P=="object"}k.exports=B}),Zr=N((C,k)=>{var B=Si(),P=Ti(),A="[object Arguments]";function T(O){return P(O)&&B(O)==A}k.exports=T}),_n=N((C,k)=>{var B=Zr(),P=Ti(),A=Object.prototype,T=A.hasOwnProperty,O=A.propertyIsEnumerable,R=B((function(){return arguments})())?B:function(Z){return P(Z)&&T.call(Z,"callee")&&!O.call(Z,"callee")};k.exports=R}),Di=N((C,k)=>{var B=Array.isArray;k.exports=B}),jr=N((C,k)=>{var B=9007199254740991;function P(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=B}k.exports=P}),Li=N((C,k)=>{var B=Me(),P=jr();function A(T){return T!=null&&P(T.length)&&!B(T)}k.exports=A}),$s=N((C,k)=>{var B=Li(),P=Ti();function A(T){return P(T)&&B(T)}k.exports=A}),Xs=N((C,k)=>{function B(){return!1}k.exports=B}),Hn=N((C,k)=>{var B=Ve(),P=Xs(),A=typeof C=="object"&&C&&!C.nodeType&&C,T=A&&typeof k=="object"&&k&&!k.nodeType&&k,O=T&&T.exports===A,R=O?B.Buffer:void 0,Z=R?R.isBuffer:void 0,U=Z||P;k.exports=U}),Ur=N((C,k)=>{var B=Si(),P=Nr(),A=Ti(),T="[object Object]",O=Function.prototype,R=Object.prototype,Z=O.toString,U=R.hasOwnProperty,Q=Z.call(Object);function Y(ot){if(!A(ot)||B(ot)!=T)return!1;var ut=P(ot);if(ut===null)return!0;var vt=U.call(ut,"constructor")&&ut.constructor;return typeof vt=="function"&&vt instanceof vt&&Z.call(vt)==Q}k.exports=Y}),Hr=N((C,k)=>{var B=Si(),P=jr(),A=Ti(),T="[object Arguments]",O="[object Array]",R="[object Boolean]",Z="[object Date]",U="[object Error]",Q="[object Function]",Y="[object Map]",ot="[object Number]",ut="[object Object]",vt="[object RegExp]",xt="[object Set]",Pt="[object String]",At="[object WeakMap]",J="[object ArrayBuffer]",ht="[object DataView]",yt="[object Float32Array]",Bt="[object Float64Array]",wt="[object Int8Array]",Et="[object Int16Array]",q="[object Int32Array]",K="[object Uint8Array]",$="[object Uint8ClampedArray]",st="[object Uint16Array]",rt="[object Uint32Array]",it={};it[yt]=it[Bt]=it[wt]=it[Et]=it[q]=it[K]=it[$]=it[st]=it[rt]=!0,it[T]=it[O]=it[J]=it[R]=it[ht]=it[Z]=it[U]=it[Q]=it[Y]=it[ot]=it[ut]=it[vt]=it[xt]=it[Pt]=it[At]=!1;function ct(at){return A(at)&&P(at.length)&&!!it[B(at)]}k.exports=ct}),Js=N((C,k)=>{function B(P){return function(A){return P(A)}}k.exports=B}),Qs=N((C,k)=>{var B=ke(),P=typeof C=="object"&&C&&!C.nodeType&&C,A=P&&typeof k=="object"&&k&&!k.nodeType&&k,T=A&&A.exports===P,O=T&&B.process,R=(function(){try{var Z=A&&A.require&&A.require("util").types;return Z||O&&O.binding&&O.binding("util")}catch{}})();k.exports=R}),Vr=N((C,k)=>{var B=Hr(),P=Js(),A=Qs(),T=A&&A.isTypedArray,O=T?P(T):B;k.exports=O}),qr=N((C,k)=>{function B(P,A){if(!(A==="constructor"&&typeof P[A]=="function")&&A!="__proto__")return P[A]}k.exports=B}),ta=N((C,k)=>{var B=Ai(),P=Lt(),A=Object.prototype,T=A.hasOwnProperty;function O(R,Z,U){var Q=R[Z];(!(T.call(R,Z)&&P(Q,U))||U===void 0&&!(Z in R))&&B(R,Z,U)}k.exports=O}),ea=N((C,k)=>{var B=ta(),P=Ai();function A(T,O,R,Z){var U=!R;R||(R={});for(var Q=-1,Y=O.length;++Q<Y;){var ot=O[Q],ut=Z?Z(R[ot],T[ot],ot,R,T):void 0;ut===void 0&&(ut=T[ot]),U?P(R,ot,ut):B(R,ot,ut)}return R}k.exports=A}),Vn=N((C,k)=>{function B(P,A){for(var T=-1,O=Array(P);++T<P;)O[T]=A(T);return O}k.exports=B}),Kr=N((C,k)=>{var B=9007199254740991,P=/^(?:0|[1-9]\d*)$/;function A(T,O){var R=typeof T;return O=O??B,!!O&&(R=="number"||R!="symbol"&&P.test(T))&&T>-1&&T%1==0&&T<O}k.exports=A}),ia=N((C,k)=>{var B=Vn(),P=_n(),A=Di(),T=Hn(),O=Kr(),R=Vr(),Z=Object.prototype,U=Z.hasOwnProperty;function Q(Y,ot){var ut=A(Y),vt=!ut&&P(Y),xt=!ut&&!vt&&T(Y),Pt=!ut&&!vt&&!xt&&R(Y),At=ut||vt||xt||Pt,J=At?B(Y.length,String):[],ht=J.length;for(var yt in Y)(ot||U.call(Y,yt))&&!(At&&(yt=="length"||xt&&(yt=="offset"||yt=="parent")||Pt&&(yt=="buffer"||yt=="byteLength"||yt=="byteOffset")||O(yt,ht)))&&J.push(yt);return J}k.exports=Q}),na=N((C,k)=>{function B(P){var A=[];if(P!=null)for(var T in Object(P))A.push(T);return A}k.exports=B}),ra=N((C,k)=>{var B=ue(),P=Un(),A=na(),T=Object.prototype,O=T.hasOwnProperty;function R(Z){if(!B(Z))return A(Z);var U=P(Z),Q=[];for(var Y in Z)Y=="constructor"&&(U||!O.call(Z,Y))||Q.push(Y);return Q}k.exports=R}),je=N((C,k)=>{var B=ia(),P=ra(),A=Li();function T(O){return A(O)?B(O,!0):P(O)}k.exports=T}),Rt=N((C,k)=>{var B=ea(),P=je();function A(T){return B(T,P(T))}k.exports=A}),Wr=N((C,k)=>{var B=Dr(),P=Fr(),A=Ys(),T=jn(),O=Gr(),R=_n(),Z=Di(),U=$s(),Q=Hn(),Y=Me(),ot=ue(),ut=Ur(),vt=Vr(),xt=qr(),Pt=Rt();function At(J,ht,yt,Bt,wt,Et,q){var K=xt(J,yt),$=xt(ht,yt),st=q.get($);if(st){B(J,yt,st);return}var rt=Et?Et(K,$,yt+"",J,ht,q):void 0,it=rt===void 0;if(it){var ct=Z($),at=!ct&&Q($),lt=!ct&&!at&&vt($);rt=$,ct||at||lt?Z(K)?rt=K:U(K)?rt=T(K):at?(it=!1,rt=P($,!0)):lt?(it=!1,rt=A($,!0)):rt=[]:ut($)||R($)?(rt=K,R(K)?rt=Pt(K):(!ot(K)||Y(K))&&(rt=O($))):it=!1}it&&(q.set($,rt),wt(rt,$,Bt,Et,q),q.delete($)),B(J,yt,rt)}k.exports=At}),Yr=N((C,k)=>{var B=Tr(),P=Dr(),A=Zn(),T=Wr(),O=ue(),R=je(),Z=qr();function U(Q,Y,ot,ut,vt){Q!==Y&&A(Y,function(xt,Pt){if(vt||(vt=new B),O(xt))T(Q,Y,Pt,ot,U,ut,vt);else{var At=ut?ut(Z(Q,Pt),xt,Pt+"",Q,Y,vt):void 0;At===void 0&&(At=xt),P(Q,Pt,At)}},R)}k.exports=U}),qn=N((C,k)=>{function B(P){return P}k.exports=B}),$r=N((C,k)=>{function B(P,A,T){switch(T.length){case 0:return P.call(A);case 1:return P.call(A,T[0]);case 2:return P.call(A,T[0],T[1]);case 3:return P.call(A,T[0],T[1],T[2])}return P.apply(A,T)}k.exports=B}),Kn=N((C,k)=>{var B=$r(),P=Math.max;function A(T,O,R){return O=P(O===void 0?T.length-1:O,0),function(){for(var Z=arguments,U=-1,Q=P(Z.length-O,0),Y=Array(Q);++U<Q;)Y[U]=Z[O+U];U=-1;for(var ot=Array(O+1);++U<O;)ot[U]=Z[U];return ot[O]=R(Y),B(T,this,ot)}}k.exports=A}),Xr=N((C,k)=>{function B(P){return function(){return P}}k.exports=B}),Oi=N((C,k)=>{var B=Xr(),P=fn(),A=qn(),T=P?function(O,R){return P(O,"toString",{configurable:!0,enumerable:!1,value:B(R),writable:!0})}:A;k.exports=T}),Jr=N((C,k)=>{var B=800,P=16,A=Date.now;function T(O){var R=0,Z=0;return function(){var U=A(),Q=P-(U-Z);if(Z=U,Q>0){if(++R>=B)return arguments[0]}else R=0;return O.apply(void 0,arguments)}}k.exports=T}),sa=N((C,k)=>{var B=Oi(),P=Jr(),A=P(B);k.exports=A}),aa=N((C,k)=>{var B=qn(),P=Kn(),A=sa();function T(O,R){return A(P(O,R,B),O+"")}k.exports=T}),oa=N((C,k)=>{var B=Lt(),P=Li(),A=Kr(),T=ue();function O(R,Z,U){if(!T(U))return!1;var Q=typeof Z;return(Q=="number"?P(U)&&A(Z,U.length):Q=="string"&&Z in U)?B(U[Z],R):!1}k.exports=O}),ua=N((C,k)=>{var B=aa(),P=oa();function A(T){return B(function(O,R){var Z=-1,U=R.length,Q=U>1?R[U-1]:void 0,Y=U>2?R[2]:void 0;for(Q=T.length>3&&typeof Q=="function"?(U--,Q):void 0,Y&&P(R[0],R[1],Y)&&(Q=U<3?void 0:Q,U=1),O=Object(O);++Z<U;){var ot=R[Z];ot&&T(O,ot,Z,Q)}return O})}k.exports=A}),mn=N((C,k)=>{var B=Yr(),P=ua(),A=P(function(T,O,R){B(T,O,R)});k.exports=A}),Wn=N((C,k)=>{var B=Si(),P=Ti(),A="[object Symbol]";function T(O){return typeof O=="symbol"||P(O)&&B(O)==A}k.exports=T}),gn=N((C,k)=>{var B=Di(),P=Wn(),A=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/;function O(R,Z){if(B(R))return!1;var U=typeof R;return U=="number"||U=="symbol"||U=="boolean"||R==null||P(R)?!0:T.test(R)||!A.test(R)||Z!=null&&R in Object(Z)}k.exports=O}),la=N((C,k)=>{var B=Sr(),P="Expected a function";function A(T,O){if(typeof T!="function"||O!=null&&typeof O!="function")throw new TypeError(P);var R=function(){var Z=arguments,U=O?O.apply(this,Z):Z[0],Q=R.cache;if(Q.has(U))return Q.get(U);var Y=T.apply(this,Z);return R.cache=Q.set(U,Y)||Q,Y};return R.cache=new(A.Cache||B),R}A.Cache=B,k.exports=A}),ha=N((C,k)=>{var B=la(),P=500;function A(T){var O=B(T,function(Z){return R.size===P&&R.clear(),Z}),R=O.cache;return O}k.exports=A}),ca=N((C,k)=>{var B=ha(),P=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,A=/\\(\\)?/g,T=B(function(O){var R=[];return O.charCodeAt(0)===46&&R.push(""),O.replace(P,function(Z,U,Q,Y){R.push(Q?Y.replace(A,"$1"):U||Z)}),R});k.exports=T}),da=N((C,k)=>{function B(P,A){for(var T=-1,O=P==null?0:P.length,R=Array(O);++T<O;)R[T]=A(P[T],T,P);return R}k.exports=B}),pa=N((C,k)=>{var B=pn(),P=da(),A=Di(),T=Wn(),O=B?B.prototype:void 0,R=O?O.toString:void 0;function Z(U){if(typeof U=="string")return U;if(A(U))return P(U,Z)+"";if(T(U))return R?R.call(U):"";var Q=U+"";return Q=="0"&&1/U==-1/0?"-0":Q}k.exports=Z}),Yn=N((C,k)=>{var B=pa();function P(A){return A==null?"":B(A)}k.exports=P}),Ji=N((C,k)=>{var B=Di(),P=gn(),A=ca(),T=Yn();function O(R,Z){return B(R)?R:P(R,Z)?[R]:A(T(R))}k.exports=O}),Qr=N((C,k)=>{var B=Wn();function P(A){if(typeof A=="string"||B(A))return A;var T=A+"";return T=="0"&&1/A==-1/0?"-0":T}k.exports=P}),ts=N((C,k)=>{var B=Ji(),P=Qr();function A(T,O){O=B(O,T);for(var R=0,Z=O.length;T!=null&&R<Z;)T=T[P(O[R++])];return R&&R==Z?T:void 0}k.exports=A}),hi=N((C,k)=>{var B=ts();function P(A,T,O){var R=A==null?void 0:B(A,T);return R===void 0?O:R}k.exports=P}),Yt=N((C,k)=>{(function(B,P){typeof C=="object"&&typeof k<"u"?k.exports=P():(B=B||self).RBush=P()})(C,function(){function B(J,ht,yt,Bt,wt){(function Et(q,K,$,st,rt){for(;st>$;){if(st-$>600){var it=st-$+1,ct=K-$+1,at=Math.log(it),lt=.5*Math.exp(2*at/3),mt=.5*Math.sqrt(at*lt*(it-lt)/it)*(ct-it/2<0?-1:1),_t=Math.max($,Math.floor(K-ct*lt/it+mt)),kt=Math.min(st,Math.floor(K+(it-ct)*lt/it+mt));Et(q,K,_t,kt,rt)}var Ot=q[K],Ft=$,Ut=st;for(P(q,$,K),rt(q[st],Ot)>0&&P(q,$,st);Ft<Ut;){for(P(q,Ft,Ut),Ft++,Ut--;rt(q[Ft],Ot)<0;)Ft++;for(;rt(q[Ut],Ot)>0;)Ut--}rt(q[$],Ot)===0?P(q,$,Ut):P(q,++Ut,st),Ut<=K&&($=Ut+1),K<=Ut&&(st=Ut-1)}})(J,ht,yt||0,Bt||J.length-1,wt||A)}function P(J,ht,yt){var Bt=J[ht];J[ht]=J[yt],J[yt]=Bt}function A(J,ht){return J<ht?-1:J>ht?1:0}var T=function(J){J===void 0&&(J=9),this._maxEntries=Math.max(4,J),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function O(J,ht,yt){if(!yt)return ht.indexOf(J);for(var Bt=0;Bt<ht.length;Bt++)if(yt(J,ht[Bt]))return Bt;return-1}function R(J,ht){Z(J,0,J.children.length,ht,J)}function Z(J,ht,yt,Bt,wt){wt||(wt=Pt(null)),wt.minX=1/0,wt.minY=1/0,wt.maxX=-1/0,wt.maxY=-1/0;for(var Et=ht;Et<yt;Et++){var q=J.children[Et];U(wt,J.leaf?Bt(q):q)}return wt}function U(J,ht){return J.minX=Math.min(J.minX,ht.minX),J.minY=Math.min(J.minY,ht.minY),J.maxX=Math.max(J.maxX,ht.maxX),J.maxY=Math.max(J.maxY,ht.maxY),J}function Q(J,ht){return J.minX-ht.minX}function Y(J,ht){return J.minY-ht.minY}function ot(J){return(J.maxX-J.minX)*(J.maxY-J.minY)}function ut(J){return J.maxX-J.minX+(J.maxY-J.minY)}function vt(J,ht){return J.minX<=ht.minX&&J.minY<=ht.minY&&ht.maxX<=J.maxX&&ht.maxY<=J.maxY}function xt(J,ht){return ht.minX<=J.maxX&&ht.minY<=J.maxY&&ht.maxX>=J.minX&&ht.maxY>=J.minY}function Pt(J){return{children:J,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function At(J,ht,yt,Bt,wt){for(var Et=[ht,yt];Et.length;)if(!((yt=Et.pop())-(ht=Et.pop())<=Bt)){var q=ht+Math.ceil((yt-ht)/Bt/2)*Bt;B(J,q,ht,yt,wt),Et.push(ht,q,q,yt)}}return T.prototype.all=function(){return this._all(this.data,[])},T.prototype.search=function(J){var ht=this.data,yt=[];if(!xt(J,ht))return yt;for(var Bt=this.toBBox,wt=[];ht;){for(var Et=0;Et<ht.children.length;Et++){var q=ht.children[Et],K=ht.leaf?Bt(q):q;xt(J,K)&&(ht.leaf?yt.push(q):vt(J,K)?this._all(q,yt):wt.push(q))}ht=wt.pop()}return yt},T.prototype.collides=function(J){var ht=this.data;if(!xt(J,ht))return!1;for(var yt=[];ht;){for(var Bt=0;Bt<ht.children.length;Bt++){var wt=ht.children[Bt],Et=ht.leaf?this.toBBox(wt):wt;if(xt(J,Et)){if(ht.leaf||vt(J,Et))return!0;yt.push(wt)}}ht=yt.pop()}return!1},T.prototype.load=function(J){if(!J||!J.length)return this;if(J.length<this._minEntries){for(var ht=0;ht<J.length;ht++)this.insert(J[ht]);return this}var yt=this._build(J.slice(),0,J.length-1,0);if(this.data.children.length)if(this.data.height===yt.height)this._splitRoot(this.data,yt);else{if(this.data.height<yt.height){var Bt=this.data;this.data=yt,yt=Bt}this._insert(yt,this.data.height-yt.height-1,!0)}else this.data=yt;return this},T.prototype.insert=function(J){return J&&this._insert(J,this.data.height-1),this},T.prototype.clear=function(){return this.data=Pt([]),this},T.prototype.remove=function(J,ht){if(!J)return this;for(var yt,Bt,wt,Et=this.data,q=this.toBBox(J),K=[],$=[];Et||K.length;){if(Et||(Et=K.pop(),Bt=K[K.length-1],yt=$.pop(),wt=!0),Et.leaf){var st=O(J,Et.children,ht);if(st!==-1)return Et.children.splice(st,1),K.push(Et),this._condense(K),this}wt||Et.leaf||!vt(Et,q)?Bt?(yt++,Et=Bt.children[yt],wt=!1):Et=null:(K.push(Et),$.push(yt),yt=0,Bt=Et,Et=Et.children[0])}return this},T.prototype.toBBox=function(J){return J},T.prototype.compareMinX=function(J,ht){return J.minX-ht.minX},T.prototype.compareMinY=function(J,ht){return J.minY-ht.minY},T.prototype.toJSON=function(){return this.data},T.prototype.fromJSON=function(J){return this.data=J,this},T.prototype._all=function(J,ht){for(var yt=[];J;)J.leaf?ht.push.apply(ht,J.children):yt.push.apply(yt,J.children),J=yt.pop();return ht},T.prototype._build=function(J,ht,yt,Bt){var wt,Et=yt-ht+1,q=this._maxEntries;if(Et<=q)return R(wt=Pt(J.slice(ht,yt+1)),this.toBBox),wt;Bt||(Bt=Math.ceil(Math.log(Et)/Math.log(q)),q=Math.ceil(Et/Math.pow(q,Bt-1))),(wt=Pt([])).leaf=!1,wt.height=Bt;var K=Math.ceil(Et/q),$=K*Math.ceil(Math.sqrt(q));At(J,ht,yt,$,this.compareMinX);for(var st=ht;st<=yt;st+=$){var rt=Math.min(st+$-1,yt);At(J,st,rt,K,this.compareMinY);for(var it=st;it<=rt;it+=K){var ct=Math.min(it+K-1,rt);wt.children.push(this._build(J,it,ct,Bt-1))}}return R(wt,this.toBBox),wt},T.prototype._chooseSubtree=function(J,ht,yt,Bt){for(;Bt.push(ht),!ht.leaf&&Bt.length-1!==yt;){for(var wt=1/0,Et=1/0,q=void 0,K=0;K<ht.children.length;K++){var $=ht.children[K],st=ot($),rt=(it=J,ct=$,(Math.max(ct.maxX,it.maxX)-Math.min(ct.minX,it.minX))*(Math.max(ct.maxY,it.maxY)-Math.min(ct.minY,it.minY))-st);rt<Et?(Et=rt,wt=st<wt?st:wt,q=$):rt===Et&&st<wt&&(wt=st,q=$)}ht=q||ht.children[0]}var it,ct;return ht},T.prototype._insert=function(J,ht,yt){var Bt=yt?J:this.toBBox(J),wt=[],Et=this._chooseSubtree(Bt,this.data,ht,wt);for(Et.children.push(J),U(Et,Bt);ht>=0&&wt[ht].children.length>this._maxEntries;)this._split(wt,ht),ht--;this._adjustParentBBoxes(Bt,wt,ht)},T.prototype._split=function(J,ht){var yt=J[ht],Bt=yt.children.length,wt=this._minEntries;this._chooseSplitAxis(yt,wt,Bt);var Et=this._chooseSplitIndex(yt,wt,Bt),q=Pt(yt.children.splice(Et,yt.children.length-Et));q.height=yt.height,q.leaf=yt.leaf,R(yt,this.toBBox),R(q,this.toBBox),ht?J[ht-1].children.push(q):this._splitRoot(yt,q)},T.prototype._splitRoot=function(J,ht){this.data=Pt([J,ht]),this.data.height=J.height+1,this.data.leaf=!1,R(this.data,this.toBBox)},T.prototype._chooseSplitIndex=function(J,ht,yt){for(var Bt,wt,Et,q,K,$,st,rt=1/0,it=1/0,ct=ht;ct<=yt-ht;ct++){var at=Z(J,0,ct,this.toBBox),lt=Z(J,ct,yt,this.toBBox),mt=(wt=at,Et=lt,q=void 0,K=void 0,$=void 0,st=void 0,q=Math.max(wt.minX,Et.minX),K=Math.max(wt.minY,Et.minY),$=Math.min(wt.maxX,Et.maxX),st=Math.min(wt.maxY,Et.maxY),Math.max(0,$-q)*Math.max(0,st-K)),_t=ot(at)+ot(lt);mt<rt?(rt=mt,Bt=ct,it=_t<it?_t:it):mt===rt&&_t<it&&(it=_t,Bt=ct)}return Bt||yt-ht},T.prototype._chooseSplitAxis=function(J,ht,yt){var Bt=J.leaf?this.compareMinX:Q,wt=J.leaf?this.compareMinY:Y;this._allDistMargin(J,ht,yt,Bt)<this._allDistMargin(J,ht,yt,wt)&&J.children.sort(Bt)},T.prototype._allDistMargin=function(J,ht,yt,Bt){J.children.sort(Bt);for(var wt=this.toBBox,Et=Z(J,0,ht,wt),q=Z(J,yt-ht,yt,wt),K=ut(Et)+ut(q),$=ht;$<yt-ht;$++){var st=J.children[$];U(Et,J.leaf?wt(st):st),K+=ut(Et)}for(var rt=yt-ht-1;rt>=ht;rt--){var it=J.children[rt];U(q,J.leaf?wt(it):it),K+=ut(q)}return K},T.prototype._adjustParentBBoxes=function(J,ht,yt){for(var Bt=yt;Bt>=0;Bt--)U(ht[Bt],J)},T.prototype._condense=function(J){for(var ht=J.length-1,yt=void 0;ht>=0;ht--)J[ht].children.length===0?ht>0?(yt=J[ht-1].children).splice(yt.indexOf(J[ht]),1):this.clear():R(J[ht],this.toBBox)},T})});Array.prototype.findIndex=Array.prototype.findIndex||function(C){if(this===null)throw new TypeError("Array.prototype.findIndex called on null or undefined");if(typeof C!="function")throw new TypeError("callback must be a function");for(var k=Object(this),B=k.length>>>0,P=arguments[1],A=0;A<B;A++)if(C.call(P,k[A],A,k))return A;return-1},Array.prototype.find=Array.prototype.find||function(C){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof C!="function")throw new TypeError("callback must be a function");for(var k=Object(this),B=k.length>>>0,P=arguments[1],A=0;A<B;A++){var T=k[A];if(C.call(P,T,A,k))return T}},typeof Object.assign!="function"&&(Object.assign=function(C){if(C==null)throw new TypeError("Cannot convert undefined or null to object");C=Object(C);for(var k=1;k<arguments.length;k++){var B=arguments[k];if(B!=null)for(var P in B)Object.prototype.hasOwnProperty.call(B,P)&&(C[P]=B[P])}return C}),(function(C){C.forEach(function(k){k.hasOwnProperty("remove")||Object.defineProperty(k,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){this.parentNode.removeChild(this)}})})})([Element.prototype,CharacterData.prototype,DocumentType.prototype]),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(C,k){if(this==null)throw new TypeError('"this" is null or not defined');var B=Object(this),P=B.length>>>0;if(P===0)return!1;var A=k|0,T=Math.max(A>=0?A:P-Math.abs(A),0);function O(R,Z){return R===Z||typeof R=="number"&&typeof Z=="number"&&isNaN(R)&&isNaN(Z)}for(;T<P;){if(O(B[T],C))return!0;T++}return!1}});var re={version:"2.19.2"},Qi=et(mn()),Fi={tooltips:{placeMarker:"Click to place marker",placeMarkerTouch:"Tap the map to place a marker",firstVertex:"Click to place first vertex",continueLine:"Click to continue drawing",finishLine:"Click any existing marker to finish",finishPoly:"Click first marker to finish",finishRect:"Click to finish",startCircle:"Click to place circle center",finishCircle:"Click to finish circle",placeCircleMarker:"Click to place circle marker",placeText:"Click to place text",selectFirstLayerFor:"Select first layer for {action}",selectSecondLayerFor:"Select second layer for {action}"},actions:{finish:"Finish",cancel:"Cancel",removeLastVertex:"Remove Last Vertex"},buttonTitles:{drawMarkerButton:"Draw Marker",drawPolyButton:"Draw Polygons",drawLineButton:"Draw Polyline",drawCircleButton:"Draw Circle",drawRectButton:"Draw Rectangle",editButton:"Edit Layers",dragButton:"Drag Layers",cutButton:"Cut Layers",deleteButton:"Remove Layers",drawCircleMarkerButton:"Draw Circle Marker",snappingButton:"Snap dragged marker to other layers and vertices",pinningButton:"Pin shared vertices together",rotateButton:"Rotate Layers",drawTextButton:"Draw Text",scaleButton:"Scale Layers",autoTracingButton:"Auto trace Line",snapGuidesButton:"Show SnapGuides",unionButton:"Union layers",differenceButton:"Subtract layers"},measurements:{totalLength:"Length",segmentLength:"Segment length",area:"Area",radius:"Radius",perimeter:"Perimeter",height:"Height",width:"Width",coordinates:"Position",coordinatesMarker:"Position Marker"}},Ri={tooltips:{placeMarker:"Platziere den Marker mit Klick",placeMarkerTouch:"Tippe auf die Karte, um einen Marker zu platzieren",firstVertex:"Platziere den ersten Marker mit Klick",continueLine:"Klicke, um weiter zu zeichnen",finishLine:"Beende mit Klick auf existierenden Marker",finishPoly:"Beende mit Klick auf ersten Marker",finishRect:"Beende mit Klick",startCircle:"Platziere das Kreiszentrum mit Klick",finishCircle:"Beende den Kreis mit Klick",placeCircleMarker:"Platziere den Kreismarker mit Klick",placeText:"Platziere den Text mit Klick"},actions:{finish:"Beenden",cancel:"Abbrechen",removeLastVertex:"Letzten Vertex löschen"},buttonTitles:{drawMarkerButton:"Marker zeichnen",drawPolyButton:"Polygon zeichnen",drawLineButton:"Polyline zeichnen",drawCircleButton:"Kreis zeichnen",drawRectButton:"Rechteck zeichnen",editButton:"Layer editieren",dragButton:"Layer bewegen",cutButton:"Layer schneiden",deleteButton:"Layer löschen",drawCircleMarkerButton:"Kreismarker zeichnen",snappingButton:"Bewegter Layer an andere Layer oder Vertexe einhacken",pinningButton:"Vertexe an der gleichen Position verknüpfen",rotateButton:"Layer drehen",drawTextButton:"Text zeichnen",scaleButton:"Layer skalieren",autoTracingButton:"Linie automatisch nachzeichen"},measurements:{totalLength:"Länge",segmentLength:"Segment Länge",area:"Fläche",radius:"Radius",perimeter:"Umfang",height:"Höhe",width:"Breite",coordinates:"Position",coordinatesMarker:"Position Marker"}},$n={tooltips:{placeMarker:"Clicca per posizionare un Marker",placeMarkerTouch:"Tocca la mappa per posizionare un marker",firstVertex:"Clicca per posizionare il primo vertice",continueLine:"Clicca per continuare a disegnare",finishLine:"Clicca qualsiasi marker esistente per terminare",finishPoly:"Clicca il primo marker per terminare",finishRect:"Clicca per terminare",startCircle:"Clicca per posizionare il punto centrale del cerchio",finishCircle:"Clicca per terminare il cerchio",placeCircleMarker:"Clicca per posizionare un Marker del cherchio"},actions:{finish:"Termina",cancel:"Annulla",removeLastVertex:"Rimuovi l'ultimo vertice"},buttonTitles:{drawMarkerButton:"Disegna Marker",drawPolyButton:"Disegna Poligoni",drawLineButton:"Disegna Polilinea",drawCircleButton:"Disegna Cerchio",drawRectButton:"Disegna Rettangolo",editButton:"Modifica Livelli",dragButton:"Sposta Livelli",cutButton:"Ritaglia Livelli",deleteButton:"Elimina Livelli",drawCircleMarkerButton:"Disegna Marker del Cerchio",snappingButton:"Snap ha trascinato il pennarello su altri strati e vertici",pinningButton:"Pin condiviso vertici insieme",rotateButton:"Ruota livello"}},Ht={tooltips:{placeMarker:"Klik untuk menempatkan marker",placeMarkerTouch:"Ketuk peta untuk menempatkan marker",firstVertex:"Klik untuk menempatkan vertex pertama",continueLine:"Klik untuk meneruskan digitasi",finishLine:"Klik pada sembarang marker yang ada untuk mengakhiri",finishPoly:"Klik marker pertama untuk mengakhiri",finishRect:"Klik untuk mengakhiri",startCircle:"Klik untuk menempatkan titik pusat lingkaran",finishCircle:"Klik untuk mengakhiri lingkaran",placeCircleMarker:"Klik untuk menempatkan penanda lingkarann"},actions:{finish:"Selesai",cancel:"Batal",removeLastVertex:"Hilangkan Vertex Terakhir"},buttonTitles:{drawMarkerButton:"Digitasi Marker",drawPolyButton:"Digitasi Polygon",drawLineButton:"Digitasi Polyline",drawCircleButton:"Digitasi Lingkaran",drawRectButton:"Digitasi Segi Empat",editButton:"Edit Layer",dragButton:"Geser Layer",cutButton:"Potong Layer",deleteButton:"Hilangkan Layer",drawCircleMarkerButton:"Digitasi Penanda Lingkaran",snappingButton:"Jepretkan penanda yang ditarik ke lapisan dan simpul lain",pinningButton:"Sematkan simpul bersama bersama",rotateButton:"Putar lapisan"}},ae={tooltips:{placeMarker:"Adaugă un punct",placeMarkerTouch:"Atingeți harta pentru a plasa un punct",firstVertex:"Apasă aici pentru a adăuga primul Vertex",continueLine:"Apasă aici pentru a continua desenul",finishLine:"Apasă pe orice obiect pentru a finisa desenul",finishPoly:"Apasă pe primul obiect pentru a finisa",finishRect:"Apasă pentru a finisa",startCircle:"Apasă pentru a desena un cerc",finishCircle:"Apasă pentru a finisa un cerc",placeCircleMarker:"Adaugă un punct"},actions:{finish:"Termină",cancel:"Anulează",removeLastVertex:"Șterge ultimul Vertex"},buttonTitles:{drawMarkerButton:"Adaugă o bulină",drawPolyButton:"Desenează un poligon",drawLineButton:"Desenează o linie",drawCircleButton:"Desenează un cerc",drawRectButton:"Desenează un dreptunghi",editButton:"Editează straturile",dragButton:"Mută straturile",cutButton:"Taie straturile",deleteButton:"Șterge straturile",drawCircleMarkerButton:"Desenează marcatorul cercului",snappingButton:"Fixați marcatorul glisat pe alte straturi și vârfuri",pinningButton:"Fixați vârfurile partajate împreună",rotateButton:"Rotiți stratul"}},Xn={tooltips:{placeMarker:"Нажмите, чтобы нанести маркер",placeMarkerTouch:"Коснитесь карты, чтобы разместить маркер",firstVertex:"Нажмите, чтобы нанести первый объект",continueLine:"Нажмите, чтобы продолжить рисование",finishLine:"Нажмите любой существующий маркер для завершения",finishPoly:"Выберите первую точку, чтобы закончить",finishRect:"Нажмите, чтобы закончить",startCircle:"Нажмите, чтобы добавить центр круга",finishCircle:"Нажмите, чтобы задать радиус",placeCircleMarker:"Нажмите, чтобы нанести круговой маркер"},actions:{finish:"Завершить",cancel:"Отменить",removeLastVertex:"Отменить последнее действие"},buttonTitles:{drawMarkerButton:"Добавить маркер",drawPolyButton:"Рисовать полигон",drawLineButton:"Рисовать кривую",drawCircleButton:"Рисовать круг",drawRectButton:"Рисовать прямоугольник",editButton:"Редактировать слой",dragButton:"Перенести слой",cutButton:"Вырезать слой",deleteButton:"Удалить слой",drawCircleMarkerButton:"Добавить круговой маркер",snappingButton:"Привязать перетаскиваемый маркер к другим слоям и вершинам",pinningButton:"Связать общие точки вместе",rotateButton:"Поворот слоя"}},yn={tooltips:{placeMarker:"Presiona para colocar un marcador",placeMarkerTouch:"Toca el mapa para colocar un marcador",firstVertex:"Presiona para colocar el primer vértice",continueLine:"Presiona para continuar dibujando",finishLine:"Presiona cualquier marcador existente para finalizar",finishPoly:"Presiona el primer marcador para finalizar",finishRect:"Presiona para finalizar",startCircle:"Presiona para colocar el centro del círculo",finishCircle:"Presiona para finalizar el círculo",placeCircleMarker:"Presiona para colocar un marcador de círculo"},actions:{finish:"Finalizar",cancel:"Cancelar",removeLastVertex:"Eliminar último vértice"},buttonTitles:{drawMarkerButton:"Dibujar Marcador",drawPolyButton:"Dibujar Polígono",drawLineButton:"Dibujar Línea",drawCircleButton:"Dibujar Círculo",drawRectButton:"Dibujar Rectángulo",editButton:"Editar Capas",dragButton:"Arrastrar Capas",cutButton:"Cortar Capas",deleteButton:"Eliminar Capas",drawCircleMarkerButton:"Dibujar Marcador de Círculo",snappingButton:"El marcador de Snap arrastrado a otras capas y vértices",pinningButton:"Fijar juntos los vértices compartidos",rotateButton:"Rotar capa"}},Re={tooltips:{placeMarker:"Klik om een marker te plaatsen",placeMarkerTouch:"Tik op de kaart om een marker te plaatsen",firstVertex:"Klik om het eerste punt te plaatsen",continueLine:"Klik om te blijven tekenen",finishLine:"Klik op een bestaand punt om te beëindigen",finishPoly:"Klik op het eerst punt om te beëindigen",finishRect:"Klik om te beëindigen",startCircle:"Klik om het middelpunt te plaatsen",finishCircle:"Klik om de cirkel te beëindigen",placeCircleMarker:"Klik om een marker te plaatsen"},actions:{finish:"Bewaar",cancel:"Annuleer",removeLastVertex:"Verwijder laatste punt"},buttonTitles:{drawMarkerButton:"Plaats Marker",drawPolyButton:"Teken een vlak",drawLineButton:"Teken een lijn",drawCircleButton:"Teken een cirkel",drawRectButton:"Teken een vierkant",editButton:"Bewerk",dragButton:"Verplaats",cutButton:"Knip",deleteButton:"Verwijder",drawCircleMarkerButton:"Plaats Marker",snappingButton:"Snap gesleepte marker naar andere lagen en hoekpunten",pinningButton:"Speld gedeelde hoekpunten samen",rotateButton:"Laag roteren"}},fa={tooltips:{placeMarker:"Cliquez pour placer un marqueur",placeMarkerTouch:"Appuyez sur la carte pour placer un marqueur",firstVertex:"Cliquez pour placer le premier sommet",continueLine:"Cliquez pour continuer à dessiner",finishLine:"Cliquez sur n'importe quel marqueur pour terminer",finishPoly:"Cliquez sur le premier marqueur pour terminer",finishRect:"Cliquez pour terminer",startCircle:"Cliquez pour placer le centre du cercle",finishCircle:"Cliquez pour finir le cercle",placeCircleMarker:"Cliquez pour placer le marqueur circulaire"},actions:{finish:"Terminer",cancel:"Annuler",removeLastVertex:"Retirer le dernier sommet"},buttonTitles:{drawMarkerButton:"Placer des marqueurs",drawPolyButton:"Dessiner des polygones",drawLineButton:"Dessiner des polylignes",drawCircleButton:"Dessiner un cercle",drawRectButton:"Dessiner un rectangle",editButton:"Éditer des calques",dragButton:"Déplacer des calques",cutButton:"Couper des calques",deleteButton:"Supprimer des calques",drawCircleMarkerButton:"Dessiner un marqueur circulaire",snappingButton:"Glisser le marqueur vers d'autres couches et sommets",pinningButton:"Épingler ensemble les sommets partagés",rotateButton:"Tourner des calques"}},vn={tooltips:{placeMarker:"单击放置标记",placeMarkerTouch:"点击地图放置标记",firstVertex:"单击放置首个顶点",continueLine:"单击继续绘制",finishLine:"单击任何存在的标记以完成",finishPoly:"单击第一个标记以完成",finishRect:"单击完成",startCircle:"单击放置圆心",finishCircle:"单击完成圆形",placeCircleMarker:"点击放置圆形标记"},actions:{finish:"完成",cancel:"取消",removeLastVertex:"移除最后的顶点"},buttonTitles:{drawMarkerButton:"绘制标记",drawPolyButton:"绘制多边形",drawLineButton:"绘制线段",drawCircleButton:"绘制圆形",drawRectButton:"绘制长方形",editButton:"编辑图层",dragButton:"拖拽图层",cutButton:"剪切图层",deleteButton:"删除图层",drawCircleMarkerButton:"画圆圈标记",snappingButton:"将拖动的标记捕捉到其他图层和顶点",pinningButton:"将共享顶点固定在一起",rotateButton:"旋转图层"}},bi={tooltips:{placeMarker:"單擊放置標記",placeMarkerTouch:"點擊地圖放置標記",firstVertex:"單擊放置第一個頂點",continueLine:"單擊繼續繪製",finishLine:"單擊任何存在的標記以完成",finishPoly:"單擊第一個標記以完成",finishRect:"單擊完成",startCircle:"單擊放置圓心",finishCircle:"單擊完成圓形",placeCircleMarker:"點擊放置圓形標記"},actions:{finish:"完成",cancel:"取消",removeLastVertex:"移除最後一個頂點"},buttonTitles:{drawMarkerButton:"放置標記",drawPolyButton:"繪製多邊形",drawLineButton:"繪製線段",drawCircleButton:"繪製圓形",drawRectButton:"繪製方形",editButton:"編輯圖形",dragButton:"移動圖形",cutButton:"裁切圖形",deleteButton:"刪除圖形",drawCircleMarkerButton:"畫圓圈標記",snappingButton:"將拖動的標記對齊到其他圖層和頂點",pinningButton:"將共享頂點固定在一起",rotateButton:"旋轉圖形"}},he={tooltips:{placeMarker:"Clique para posicionar o marcador",placeMarkerTouch:"Toque no mapa para posicionar um marcador",firstVertex:"Clique para posicionar o primeiro vértice",continueLine:"Clique para continuar desenhando",finishLine:"Clique em qualquer marcador existente para finalizar",finishPoly:"Clique no primeiro marcador para finalizar",finishRect:"Clique para finalizar",startCircle:"Clique para posicionar o centro do círculo",finishCircle:"Clique para finalizar o círculo",placeCircleMarker:"Clique para posicionar o marcador circular",placeText:"Clique para inserir texto"},actions:{finish:"Finalizar",cancel:"Cancelar",removeLastVertex:"Remover último vértice"},buttonTitles:{drawMarkerButton:"Desenhar Marcador",drawPolyButton:"Desenhar Polígonos",drawLineButton:"Desenhar Linha Poligonal",drawCircleButton:"Desenhar Círculo",drawRectButton:"Desenhar Retângulo",editButton:"Editar Camadas",dragButton:"Arrastar Camadas",cutButton:"Recortar Camadas",deleteButton:"Remover Camadas",drawCircleMarkerButton:"Desenhar Marcador de Círculo",snappingButton:"Ajustar marcador arrastado a outras camadas e vértices",pinningButton:"Unir vértices compartilhados",rotateButton:"Rotacionar Camadas",drawTextButton:"Desenhar Texto",scaleButton:"Redimensionar Camadas",autoTracingButton:"Traçado Automático de Linha"},measurements:{totalLength:"Comprimento",segmentLength:"Comprimento do Segmento",area:"Área",radius:"Raio",perimeter:"Perímetro",height:"Altura",width:"Largura",coordinates:"Posição",coordinatesMarker:"Marcador de Posição"}},ci={tooltips:{placeMarker:"Clique para colocar marcador",placeMarkerTouch:"Toque no mapa para colocar um marcador",firstVertex:"Clique para colocar primeiro vértice",continueLine:"Clique para continuar a desenhar",finishLine:"Clique num marcador existente para terminar",finishPoly:"Clique no primeiro marcador para terminar",finishRect:"Clique para terminar",startCircle:"Clique para colocar o centro do círculo",finishCircle:"Clique para terminar o círculo",placeCircleMarker:"Clique para colocar marcador de círculo",placeText:"Clique para colocar texto"},actions:{finish:"Terminar",cancel:"Cancelar",removeLastVertex:"Remover Último Vértice"},buttonTitles:{drawMarkerButton:"Desenhar Marcador",drawPolyButton:"Desenhar Polígonos",drawLineButton:"Desenhar Polilinha",drawCircleButton:"Desenhar Círculo",drawRectButton:"Desenhar Retângulo",editButton:"Editar Camadas",dragButton:"Arrastar Camadas",cutButton:"Cortar Camadas",deleteButton:"Remover Camadas",drawCircleMarkerButton:"Desenhar Marcador de Círculo",snappingButton:"Ajustar marcador arrastado a outras camadas e vértices",pinningButton:"Unir vértices partilhados",rotateButton:"Rodar Camadas",drawTextButton:"Desenhar Texto",scaleButton:"Escalar Camadas",autoTracingButton:"Traçado Automático de Linha"},measurements:{totalLength:"Comprimento",segmentLength:"Comprimento do Segmento",area:"Área",radius:"Raio",perimeter:"Perímetro",height:"Altura",width:"Largura",coordinates:"Posição",coordinatesMarker:"Marcador de Posição"}},tn={tooltips:{placeMarker:"Kliknij, aby umieścić znacznik",placeMarkerTouch:"Dotknij mapę, aby umieścić znacznik",firstVertex:"Kliknij, aby umieścić pierwszy wierzchołek",continueLine:"Kliknij, aby kontynuować rysowanie",finishLine:"Kliknij dowolny istniejący znacznik, aby zakończyć",finishPoly:"Kliknij pierwszy znacznik, aby zakończyć",finishRect:"Kliknij, aby zakończyć",startCircle:"Kliknij, aby umieścić środek okręgu",finishCircle:"Kliknij, aby zakończyć okrąg",placeCircleMarker:"Kliknij, aby umieścić znacznik okręgu",placeText:"Kliknij, aby umieścić tekst"},actions:{finish:"Zakończ",cancel:"Anuluj",removeLastVertex:"Usuń ostatni wierzchołek"},buttonTitles:{drawMarkerButton:"Rysuj znacznik",drawPolyButton:"Rysuj wielokąt",drawLineButton:"Rysuj linię",drawCircleButton:"Rysuj okrąg",drawRectButton:"Rysuj prostokąt",editButton:"Edytuj warstwy",dragButton:"Przeciągnij warstwy",cutButton:"Wytnij warstwy",deleteButton:"Usuń warstwy",drawCircleMarkerButton:"Rysuj znacznik okrągły",snappingButton:"Przyciągnij przenoszony znacznik do innych warstw i wierzchołków",pinningButton:"Przypnij wspólne wierzchołki razem",rotateButton:"Obróć warstwy",drawTextButton:"Rysuj tekst",scaleButton:"Skaluj warstwy",autoTracingButton:"Automatyczne śledzenie linii"},measurements:{totalLength:"Długość",segmentLength:"Długość odcinka",area:"Obszar",radius:"Promień",perimeter:"Obwód",height:"Wysokość",width:"Szerokość",coordinates:"Pozycja",coordinatesMarker:"Znacznik pozycji"}},en={tooltips:{placeMarker:"Klicka för att placera markör",placeMarkerTouch:"Tryck på kartan för att placera en markör",firstVertex:"Klicka för att placera första hörnet",continueLine:"Klicka för att fortsätta rita",finishLine:"Klicka på en existerande punkt för att slutföra",finishPoly:"Klicka på den första punkten för att slutföra",finishRect:"Klicka för att slutföra",startCircle:"Klicka för att placera cirkelns centrum",finishCircle:"Klicka för att slutföra cirkeln",placeCircleMarker:"Klicka för att placera cirkelmarkör"},actions:{finish:"Slutför",cancel:"Avbryt",removeLastVertex:"Ta bort sista hörnet"},buttonTitles:{drawMarkerButton:"Rita Markör",drawPolyButton:"Rita Polygoner",drawLineButton:"Rita Linje",drawCircleButton:"Rita Cirkel",drawRectButton:"Rita Rektangel",editButton:"Redigera Lager",dragButton:"Dra Lager",cutButton:"Klipp i Lager",deleteButton:"Ta bort Lager",drawCircleMarkerButton:"Rita Cirkelmarkör",snappingButton:"Snäpp dra markören till andra lager och hörn",pinningButton:"Fäst delade hörn tillsammans",rotateButton:"Rotera lagret"}},Jn={tooltips:{placeMarker:"Κάντε κλικ για να τοποθετήσετε Δείκτη",placeMarkerTouch:"Πατήστε στο χάρτη για να τοποθετήσετε δείκτη",firstVertex:"Κάντε κλικ για να τοποθετήσετε το πρώτο σημείο",continueLine:"Κάντε κλικ για να συνεχίσετε να σχεδιάζετε",finishLine:"Κάντε κλικ σε οποιονδήποτε υπάρχον σημείο για να ολοκληρωθεί",finishPoly:"Κάντε κλικ στο πρώτο σημείο για να τελειώσετε",finishRect:"Κάντε κλικ για να τελειώσετε",startCircle:"Κάντε κλικ για να τοποθετήσετε κέντρο Κύκλου",finishCircle:"Κάντε κλικ για να ολοκληρώσετε τον Κύκλο",placeCircleMarker:"Κάντε κλικ για να τοποθετήσετε Κυκλικό Δείκτη"},actions:{finish:"Τέλος",cancel:"Ακύρωση",removeLastVertex:"Κατάργηση τελευταίου σημείου"},buttonTitles:{drawMarkerButton:"Σχεδίαση Δείκτη",drawPolyButton:"Σχεδίαση Πολυγώνου",drawLineButton:"Σχεδίαση Γραμμής",drawCircleButton:"Σχεδίαση Κύκλου",drawRectButton:"Σχεδίαση Ορθογωνίου",editButton:"Επεξεργασία Επιπέδων",dragButton:"Μεταφορά Επιπέδων",cutButton:"Αποκοπή Επιπέδων",deleteButton:"Κατάργηση Επιπέδων",drawCircleMarkerButton:"Σχεδίαση Κυκλικού Δείκτη",snappingButton:"Προσκόλληση του Δείκτη μεταφοράς σε άλλα Επίπεδα και Κορυφές",pinningButton:"Περικοπή κοινών κορυφών μαζί",rotateButton:"Περιστρέψτε το στρώμα"}},nn={tooltips:{placeMarker:"Kattintson a jelölő elhelyezéséhez",placeMarkerTouch:"Érintse meg a térképet a jelölő elhelyezéséhez",firstVertex:"Kattintson az első pont elhelyezéséhez",continueLine:"Kattintson a következő pont elhelyezéséhez",finishLine:"A befejezéshez kattintson egy meglévő pontra",finishPoly:"A befejezéshez kattintson az első pontra",finishRect:"Kattintson a befejezéshez",startCircle:"Kattintson a kör középpontjának elhelyezéséhez",finishCircle:"Kattintson a kör befejezéséhez",placeCircleMarker:"Kattintson a körjelölő elhelyezéséhez"},actions:{finish:"Befejezés",cancel:"Mégse",removeLastVertex:"Utolsó pont eltávolítása"},buttonTitles:{drawMarkerButton:"Jelölő rajzolása",drawPolyButton:"Poligon rajzolása",drawLineButton:"Vonal rajzolása",drawCircleButton:"Kör rajzolása",drawRectButton:"Négyzet rajzolása",editButton:"Elemek szerkesztése",dragButton:"Elemek mozgatása",cutButton:"Elemek vágása",deleteButton:"Elemek törlése",drawCircleMarkerButton:"Kör jelölő rajzolása",snappingButton:"Kapcsolja a jelöltőt másik elemhez vagy ponthoz",pinningButton:"Közös pontok összekötése",rotateButton:"Fólia elforgatása"}},Qn={tooltips:{placeMarker:"Tryk for at placere en markør",placeMarkerTouch:"Tryk på kortet for at placere en markør",firstVertex:"Tryk for at placere det første punkt",continueLine:"Tryk for at fortsætte linjen",finishLine:"Tryk på et eksisterende punkt for at afslutte",finishPoly:"Tryk på det første punkt for at afslutte",finishRect:"Tryk for at afslutte",startCircle:"Tryk for at placere cirklens center",finishCircle:"Tryk for at afslutte cirklen",placeCircleMarker:"Tryk for at placere en cirkelmarkør"},actions:{finish:"Afslut",cancel:"Afbryd",removeLastVertex:"Fjern sidste punkt"},buttonTitles:{drawMarkerButton:"Placer markør",drawPolyButton:"Tegn polygon",drawLineButton:"Tegn linje",drawCircleButton:"Tegn cirkel",drawRectButton:"Tegn firkant",editButton:"Rediger",dragButton:"Træk",cutButton:"Klip",deleteButton:"Fjern",drawCircleMarkerButton:"Tegn cirkelmarkør",snappingButton:"Fastgør trukket markør til andre elementer",pinningButton:"Sammenlæg delte elementer",rotateButton:"Roter laget"}},tr={tooltips:{placeMarker:"Klikk for å plassere punkt",placeMarkerTouch:"Trykk på kartet for å plassere et punkt",firstVertex:"Klikk for å plassere første punkt",continueLine:"Klikk for å tegne videre",finishLine:"Klikk på et eksisterende punkt for å fullføre",finishPoly:"Klikk første punkt for å fullføre",finishRect:"Klikk for å fullføre",startCircle:"Klikk for å sette sirkel midtpunkt",finishCircle:"Klikk for å fullføre sirkel",placeCircleMarker:"Klikk for å plassere sirkel",placeText:"Klikk for å plassere tekst"},actions:{finish:"Fullfør",cancel:"Kanseller",removeLastVertex:"Fjern forrige punkt"},buttonTitles:{drawMarkerButton:"Tegn punkt",drawPolyButton:"Tegn flate",drawLineButton:"Tegn linje",drawCircleButton:"Tegn sirkel",drawRectButton:"Tegn rektangel",editButton:"Rediger objekter",dragButton:"Dra objekter",cutButton:"Kutt objekter",deleteButton:"Fjern objekter",drawCircleMarkerButton:"Tegn sirkel-punkt",snappingButton:"Fest dratt punkt til andre objekter og punkt",pinningButton:"Pin delte punkter sammen",rotateButton:"Rotér objekter",drawTextButton:"Tegn tekst",scaleButton:"Skalér objekter",autoTracingButton:"Automatisk sporing av linje"},measurements:{totalLength:"Lengde",segmentLength:"Segmentlengde",area:"Område",radius:"Radius",perimeter:"Omriss",height:"Høyde",width:"Bredde",coordinates:"Posisjon",coordinatesMarker:"Posisjonsmarkør"}},Ln={tooltips:{placeMarker:"کلیک برای جانمایی نشان",placeMarkerTouch:"روی نقشه ضربه بزنید تا نشان بگذارید",firstVertex:"کلیک برای رسم اولین رأس",continueLine:"کلیک برای ادامه رسم",finishLine:"کلیک روی هر نشان موجود برای پایان",finishPoly:"کلیک روی اولین نشان برای پایان",finishRect:"کلیک برای پایان",startCircle:"کلیک برای رسم مرکز دایره",finishCircle:"کلیک برای پایان رسم دایره",placeCircleMarker:"کلیک برای رسم نشان دایره",placeText:"کلیک برای نوشتن متن"},actions:{finish:"پایان",cancel:"لفو",removeLastVertex:"حذف آخرین رأس"},buttonTitles:{drawMarkerButton:"درج نشان",drawPolyButton:"رسم چندضلعی",drawLineButton:"رسم خط",drawCircleButton:"رسم دایره",drawRectButton:"رسم چهارضلعی",editButton:"ویرایش لایهها",dragButton:"جابجایی لایهها",cutButton:"برش لایهها",deleteButton:"حذف لایهها",drawCircleMarkerButton:"رسم نشان دایره",snappingButton:"نشانگر را به لایهها و رئوس دیگر بکشید",pinningButton:"رئوس مشترک را با هم پین کنید",rotateButton:"چرخش لایه",drawTextButton:"رسم متن",scaleButton:"مقیاسگذاری",autoTracingButton:"ردیاب خودکار"},measurements:{totalLength:"طول",segmentLength:"طول بخش",area:"ناحیه",radius:"شعاع",perimeter:"محیط",height:"ارتفاع",width:"عرض",coordinates:"موقعیت",coordinatesMarker:"موقعیت نشان"}},er={tooltips:{placeMarker:"Натисніть, щоб нанести маркер",placeMarkerTouch:"Торкніться карти, щоб розмістити маркер",firstVertex:"Натисніть, щоб нанести першу вершину",continueLine:"Натисніть, щоб продовжити малювати",finishLine:"Натисніть будь-який існуючий маркер для завершення",finishPoly:"Виберіть перший маркер, щоб завершити",finishRect:"Натисніть, щоб завершити",startCircle:"Натисніть, щоб додати центр кола",finishCircle:"Натисніть, щоб завершити коло",placeCircleMarker:"Натисніть, щоб нанести круговий маркер"},actions:{finish:"Завершити",cancel:"Відмінити",removeLastVertex:"Видалити попередню вершину"},buttonTitles:{drawMarkerButton:"Малювати маркер",drawPolyButton:"Малювати полігон",drawLineButton:"Малювати криву",drawCircleButton:"Малювати коло",drawRectButton:"Малювати прямокутник",editButton:"Редагувати шари",dragButton:"Перенести шари",cutButton:"Вирізати шари",deleteButton:"Видалити шари",drawCircleMarkerButton:"Малювати круговий маркер",snappingButton:"Прив’язати перетягнутий маркер до інших шарів та вершин",pinningButton:"Зв'язати спільні вершини разом",rotateButton:"Повернути шар"}},ir={tooltips:{placeMarker:"İşaretçi yerleştirmek için tıklayın",placeMarkerTouch:"İşaretçi yerleştirmek için haritaya dokunun",firstVertex:"İlk tepe noktasını yerleştirmek için tıklayın",continueLine:"Çizime devam etmek için tıklayın",finishLine:"Bitirmek için mevcut herhangi bir işaretçiyi tıklayın",finishPoly:"Bitirmek için ilk işaretçiyi tıklayın",finishRect:"Bitirmek için tıklayın",startCircle:"Daire merkezine yerleştirmek için tıklayın",finishCircle:"Daireyi bitirmek için tıklayın",placeCircleMarker:"Daire işaretçisi yerleştirmek için tıklayın"},actions:{finish:"Bitir",cancel:"İptal",removeLastVertex:"Son köşeyi kaldır"},buttonTitles:{drawMarkerButton:"Çizim İşaretçisi",drawPolyButton:"Çokgenler çiz",drawLineButton:"Çoklu çizgi çiz",drawCircleButton:"Çember çiz",drawRectButton:"Dikdörtgen çiz",editButton:"Katmanları düzenle",dragButton:"Katmanları sürükle",cutButton:"Katmanları kes",deleteButton:"Katmanları kaldır",drawCircleMarkerButton:"Daire işaretçisi çiz",snappingButton:"Sürüklenen işaretçiyi diğer katmanlara ve köşelere yapıştır",pinningButton:"Paylaşılan köşeleri birbirine sabitle",rotateButton:"Katmanı döndür"}},bn={tooltips:{placeMarker:"Kliknutím vytvoříte značku",placeMarkerTouch:"Klepnutím na mapu umístíte značku",firstVertex:"Kliknutím vytvoříte první objekt",continueLine:"Kliknutím pokračujte v kreslení",finishLine:"Kliknutí na libovolnou existující značku pro dokončení",finishPoly:"Vyberte první bod pro dokončení",finishRect:"Klikněte pro dokončení",startCircle:"Kliknutím přidejte střed kruhu",finishCircle:"Нажмите, чтобы задать радиус",placeCircleMarker:"Kliknutím nastavte poloměr"},actions:{finish:"Dokončit",cancel:"Zrušit",removeLastVertex:"Zrušit poslední akci"},buttonTitles:{drawMarkerButton:"Přidat značku",drawPolyButton:"Nakreslit polygon",drawLineButton:"Nakreslit křivku",drawCircleButton:"Nakreslit kruh",drawRectButton:"Nakreslit obdélník",editButton:"Upravit vrstvu",dragButton:"Přeneste vrstvu",cutButton:"Vyjmout vrstvu",deleteButton:"Smazat vrstvu",drawCircleMarkerButton:"Přidat kruhovou značku",snappingButton:"Navázat tažnou značku k dalším vrstvám a vrcholům",pinningButton:"Spojit společné body dohromady",rotateButton:"Otočte vrstvu"}},es={tooltips:{placeMarker:"クリックしてマーカーを配置",placeMarkerTouch:"地図をタップしてマーカーを配置",firstVertex:"クリックして最初の頂点を配置",continueLine:"クリックして描画を続ける",finishLine:"任意のマーカーをクリックして終了",finishPoly:"最初のマーカーをクリックして終了",finishRect:"クリックして終了",startCircle:"クリックして円の中心を配置",finishCircle:"クリックして円の描画を終了",placeCircleMarker:"クリックして円マーカーを配置",placeText:"クリックしてテキストを配置"},actions:{finish:"終了",cancel:"キャンセル",removeLastVertex:"最後の頂点を削除"},buttonTitles:{drawMarkerButton:"マーカーを描画",drawPolyButton:"ポリゴンを描画",drawLineButton:"折れ線を描画",drawCircleButton:"円を描画",drawRectButton:"矩形を描画",editButton:"レイヤーを編集",dragButton:"レイヤーをドラッグ",cutButton:"レイヤーを切り取り",deleteButton:"レイヤーを削除",drawCircleMarkerButton:"円マーカーを描画",snappingButton:"ドラッグしたマーカーを他のレイヤーや頂点にスナップする",pinningButton:"共有する頂点を同時に動かす",rotateButton:"レイヤーを回転",drawTextButton:"テキストを描画"}},nr={tooltips:{placeMarker:"Klikkaa asettaaksesi merkin",placeMarkerTouch:"Napauta karttaa asettaaksesi merkin",firstVertex:"Klikkaa asettaakseni ensimmäisen osuuden",continueLine:"Klikkaa jatkaaksesi piirtämistä",finishLine:"Klikkaa olemassa olevaa merkkiä lopettaaksesi",finishPoly:"Klikkaa ensimmäistä merkkiä lopettaaksesi",finishRect:"Klikkaa lopettaaksesi",startCircle:"Klikkaa asettaaksesi ympyrän keskipisteen",finishCircle:"Klikkaa lopettaaksesi ympyrän",placeCircleMarker:"Klikkaa asettaaksesi ympyrämerkin",placeText:"Klikkaa asettaaksesi tekstin"},actions:{finish:"Valmis",cancel:"Peruuta",removeLastVertex:"Poista viimeinen osuus"},buttonTitles:{drawMarkerButton:"Piirrä merkkejä",drawPolyButton:"Piirrä monikulmioita",drawLineButton:"Piirrä viivoja",drawCircleButton:"Piirrä ympyrä",drawRectButton:"Piirrä neliskulmioita",editButton:"Muokkaa",dragButton:"Siirrä",cutButton:"Leikkaa",deleteButton:"Poista",drawCircleMarkerButton:"Piirrä ympyrämerkki",snappingButton:"Kiinnitä siirrettävä merkki toisiin muotoihin",pinningButton:"Kiinnitä jaetut muodot yhteen",rotateButton:"Käännä",drawTextButton:"Piirrä tekstiä"}},_a={tooltips:{placeMarker:"마커 위치를 클릭하세요",placeMarkerTouch:"지도를 탭하여 마커를 배치하세요",firstVertex:"첫번째 꼭지점 위치을 클릭하세요",continueLine:"계속 그리려면 클릭하세요",finishLine:"끝내려면 기존 마커를 클릭하세요",finishPoly:"끝내려면 처음 마커를 클릭하세요",finishRect:"끝내려면 클릭하세요",startCircle:"원의 중심이 될 위치를 클릭하세요",finishCircle:"원을 끝내려면 클릭하세요",placeCircleMarker:"원 마커 위치를 클릭하세요",placeText:"텍스트 위치를 클릭하세요"},actions:{finish:"끝내기",cancel:"취소",removeLastVertex:"마지막 꼭지점 제거"},buttonTitles:{drawMarkerButton:"마커 그리기",drawPolyButton:"다각형 그리기",drawLineButton:"다각선 그리기",drawCircleButton:"원 그리기",drawRectButton:"직사각형 그리기",editButton:"레이어 편집하기",dragButton:"레이어 끌기",cutButton:"레이어 자르기",deleteButton:"레이어 제거하기",drawCircleMarkerButton:"원 마커 그리기",snappingButton:"잡아끈 마커를 다른 레이어 및 꼭지점에 들러붙게 하기",pinningButton:"공유 꼭지점을 함께 찍기",rotateButton:"레이어 회전하기",drawTextButton:"텍스트 그리기"}},jt={tooltips:{placeMarker:"Маркерди жайгаштыруу үчүн басыңыз",placeMarkerTouch:"Маркерди жайгаштыруу үчүн картага тийиңиз",firstVertex:"Биринчи чокуну жайгаштырууну үчүн басыңыз",continueLine:"Сүрөт тартууну улантуу үчүн басыңыз",finishLine:"Аяктоо үчүн учурдагы маркерди басыңыз",finishPoly:"Бүтүрүү үчүн биринчи маркерди басыңыз",finishRect:"Бүтүрүү үчүн басыңыз",startCircle:"Айлананын борборун жайгаштырууну үчүн басыңыз",finishCircle:"Айлананы бүтүрүү үчүн басыңыз",placeCircleMarker:"Тегерек маркерди жайгаштыруу үчүн басыңыз",placeText:"Текстти жайгаштыруу үчүн басыңыз"},actions:{finish:"Аягы",cancel:"Жок кылуу",removeLastVertex:"Акыркы чокуну өчүрүү"},buttonTitles:{drawMarkerButton:"Маркерди чизуу",drawPolyButton:"Полигон чизуу",drawLineButton:"Полилиния чизуу",drawCircleButton:"Дайынды чизуу",drawRectButton:"Прямоугольник чизуу",editButton:"Слоопту түзөтүү",dragButton:"Слоопту карап сүйлөү",cutButton:"Слооптун башын кесүү",deleteButton:"Слооптун өчүрүү",drawCircleMarkerButton:"Дайынды маркерди чизуу",snappingButton:"Башка слооптордун жана вертекстердин арасына чекилдөө",pinningButton:"Бөлүшкөн вертекстерди бирге тутуштуруу",rotateButton:"Слооптун өзгөртүү",drawTextButton:"Текст чизуу",scaleButton:"Слооптун өлчөмүн өзгөртүү",autoTracingButton:"Автоматтык тизмеги чизуу"},measurements:{totalLength:"Узундук",segmentLength:"Сегмент узундугу",area:"Аймак",radius:"Радиус",perimeter:"Периметр",height:"Диаметр",width:"Кенчилик",coordinates:"Координаттар",coordinatesMarker:"Маркердин координаттары"}},qe=ci,$t={en:Fi,de:Ri,it:$n,id:Ht,ro:ae,ru:Xn,es:yn,nl:Re,fr:fa,pt:qe,pt_br:he,pt_pt:ci,zh:vn,zh_tw:bi,pl:tn,sv:en,el:Jn,hu:nn,da:Qn,no:tr,fa:Ln,ua:er,tr:ir,cz:bn,ja:es,fi:nr,ko:_a,ky:jt},is={_globalEditModeEnabled:!1,enableGlobalEditMode(C){let k={...C};this._globalEditModeEnabled=!0,this.Toolbar.toggleButton("editMode",this.globalEditModeEnabled()),L.PM.Utils.findLayers(this.map).forEach(B=>{this._isRelevantForEdit(B)&&B.pm.enable(k)}),this.throttledReInitEdit||(this.throttledReInitEdit=L.Util.throttle(this.handleLayerAdditionInGlobalEditMode,100,this)),this._addedLayersEdit={},this.map.on("layeradd",this._layerAddedEdit,this),this.map.on("layeradd",this.throttledReInitEdit,this),this._fireGlobalEditModeToggled(!0)},disableGlobalEditMode(){this._globalEditModeEnabled=!1,L.PM.Utils.findLayers(this.map).forEach(C=>{C.pm.disable()}),this.map.off("layeradd",this._layerAddedEdit,this),this.map.off("layeradd",this.throttledReInitEdit,this),this.Toolbar.toggleButton("editMode",this.globalEditModeEnabled()),this._fireGlobalEditModeToggled(!1)},globalEditEnabled(){return this.globalEditModeEnabled()},globalEditModeEnabled(){return this._globalEditModeEnabled},toggleGlobalEditMode(C=this.globalOptions){this.globalEditModeEnabled()?this.disableGlobalEditMode():this.enableGlobalEditMode(C)},handleLayerAdditionInGlobalEditMode(){let C=this._addedLayersEdit;if(this._addedLayersEdit={},this.globalEditModeEnabled())for(let k in C){let B=C[k];this._isRelevantForEdit(B)&&B.pm.enable({...this.globalOptions})}},_layerAddedEdit({layer:C}){this._addedLayersEdit[L.stamp(C)]=C},_isRelevantForEdit(C){return C.pm&&!(C instanceof L.LayerGroup)&&(!L.PM.optIn&&!C.options.pmIgnore||L.PM.optIn&&C.options.pmIgnore===!1)&&!C._pmTempLayer&&C.pm.options.allowEditing}},rr=is,sr={_globalDragModeEnabled:!1,enableGlobalDragMode(){let C=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!0,this._addedLayersDrag={},C.forEach(k=>{this._isRelevantForDrag(k)&&k.pm.enableLayerDrag()}),this.throttledReInitDrag||(this.throttledReInitDrag=L.Util.throttle(this.reinitGlobalDragMode,100,this)),this.map.on("layeradd",this._layerAddedDrag,this),this.map.on("layeradd",this.throttledReInitDrag,this),this.Toolbar.toggleButton("dragMode",this.globalDragModeEnabled()),this._fireGlobalDragModeToggled(!0)},disableGlobalDragMode(){let C=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!1,C.forEach(k=>{k.pm.disableLayerDrag()}),this.map.off("layeradd",this._layerAddedDrag,this),this.map.off("layeradd",this.throttledReInitDrag,this),this.Toolbar.toggleButton("dragMode",this.globalDragModeEnabled()),this._fireGlobalDragModeToggled(!1)},globalDragModeEnabled(){return!!this._globalDragModeEnabled},toggleGlobalDragMode(){this.globalDragModeEnabled()?this.disableGlobalDragMode():this.enableGlobalDragMode()},reinitGlobalDragMode(){let C=this._addedLayersDrag;if(this._addedLayersDrag={},this.globalDragModeEnabled())for(let k in C){let B=C[k];this._isRelevantForDrag(B)&&B.pm.enableLayerDrag()}},_layerAddedDrag({layer:C}){this._addedLayersDrag[L.stamp(C)]=C},_isRelevantForDrag(C){return C.pm&&!(C instanceof L.LayerGroup)&&(!L.PM.optIn&&!C.options.pmIgnore||L.PM.optIn&&C.options.pmIgnore===!1)&&!C._pmTempLayer&&C.pm.options.draggable}},ar=sr,Ci={_globalRemovalModeEnabled:!1,enableGlobalRemovalMode(){this._globalRemovalModeEnabled=!0,this.map.eachLayer(C=>{this._isRelevantForRemoval(C)&&(C.pm.enabled()&&C.pm.disable(),C.on("click",this.removeLayer,this))}),this.throttledReInitRemoval||(this.throttledReInitRemoval=L.Util.throttle(this.handleLayerAdditionInGlobalRemovalMode,100,this)),this._addedLayersRemoval={},this.map.on("layeradd",this._layerAddedRemoval,this),this.map.on("layeradd",this.throttledReInitRemoval,this),this.Toolbar.toggleButton("removalMode",this.globalRemovalModeEnabled()),this._fireGlobalRemovalModeToggled(!0)},disableGlobalRemovalMode(){this._globalRemovalModeEnabled=!1,this.map.eachLayer(C=>{C.off("click",this.removeLayer,this)}),this.map.off("layeradd",this._layerAddedRemoval,this),this.map.off("layeradd",this.throttledReInitRemoval,this),this.Toolbar.toggleButton("removalMode",this.globalRemovalModeEnabled()),this._fireGlobalRemovalModeToggled(!1)},globalRemovalEnabled(){return this.globalRemovalModeEnabled()},globalRemovalModeEnabled(){return!!this._globalRemovalModeEnabled},toggleGlobalRemovalMode(){this.globalRemovalModeEnabled()?this.disableGlobalRemovalMode():this.enableGlobalRemovalMode()},removeLayer(C){let k=C.target;this._isRelevantForRemoval(k)&&!k.pm.dragging()&&(k.removeFrom(this.map.pm._getContainingLayer()),k.remove(),k instanceof L.LayerGroup?(this._fireRemoveLayerGroup(k),this._fireRemoveLayerGroup(this.map,k)):(k.pm._fireRemove(k),k.pm._fireRemove(this.map,k)))},_isRelevantForRemoval(C){return C.pm&&!(C instanceof L.LayerGroup)&&(!L.PM.optIn&&!C.options.pmIgnore||L.PM.optIn&&C.options.pmIgnore===!1)&&!C._pmTempLayer&&C.pm.options.allowRemoval},handleLayerAdditionInGlobalRemovalMode(){let C=this._addedLayersRemoval;if(this._addedLayersRemoval={},this.globalRemovalModeEnabled())for(let k in C){let B=C[k];this._isRelevantForRemoval(B)&&(B.pm.enabled()&&B.pm.disable(),B.on("click",this.removeLayer,this))}},_layerAddedRemoval({layer:C}){this._addedLayersRemoval[L.stamp(C)]=C}},or=Ci,rn={_globalRotateModeEnabled:!1,enableGlobalRotateMode(){this._globalRotateModeEnabled=!0,L.PM.Utils.findLayers(this.map).filter(C=>C instanceof L.Polyline).forEach(C=>{this._isRelevantForRotate(C)&&C.pm.enableRotate()}),this.throttledReInitRotate||(this.throttledReInitRotate=L.Util.throttle(this.handleLayerAdditionInGlobalRotateMode,100,this)),this._addedLayersRotate={},this.map.on("layeradd",this._layerAddedRotate,this),this.map.on("layeradd",this.throttledReInitRotate,this),this.Toolbar.toggleButton("rotateMode",this.globalRotateModeEnabled()),this._fireGlobalRotateModeToggled()},disableGlobalRotateMode(){this._globalRotateModeEnabled=!1,L.PM.Utils.findLayers(this.map).filter(C=>C instanceof L.Polyline).forEach(C=>{C.pm.disableRotate()}),this.map.off("layeradd",this._layerAddedRotate,this),this.map.off("layeradd",this.throttledReInitRotate,this),this.Toolbar.toggleButton("rotateMode",this.globalRotateModeEnabled()),this._fireGlobalRotateModeToggled()},globalRotateModeEnabled(){return!!this._globalRotateModeEnabled},toggleGlobalRotateMode(){this.globalRotateModeEnabled()?this.disableGlobalRotateMode():this.enableGlobalRotateMode()},_isRelevantForRotate(C){return C.pm&&C instanceof L.Polyline&&!(C instanceof L.LayerGroup)&&(!L.PM.optIn&&!C.options.pmIgnore||L.PM.optIn&&C.options.pmIgnore===!1)&&!C._pmTempLayer&&C.pm.options.allowRotation},handleLayerAdditionInGlobalRotateMode(){let C=this._addedLayersRotate;if(this._addedLayersRotate={},this.globalRotateModeEnabled())for(let k in C){let B=C[k];this._isRelevantForRemoval(B)&&B.pm.enableRotate()}},_layerAddedRotate({layer:C}){this._addedLayersRotate[L.stamp(C)]=C}},me=rn,xi=et(mn()),ns={_fireDrawStart(C="Draw",k={}){this.__fire(this._map,"pm:drawstart",{shape:this._shape,workingLayer:this._layer},C,k)},_fireDrawEnd(C="Draw",k={}){this.__fire(this._map,"pm:drawend",{shape:this._shape},C,k)},_fireCreate(C,k="Draw",B={}){this.__fire(this._map,"pm:create",{shape:this._shape,marker:C,layer:C},k,B)},_fireCenterPlaced(C="Draw",k={}){let B=C==="Draw"?this._layer:void 0,P=C!=="Draw"?this._layer:void 0;this.__fire(this._layer,"pm:centerplaced",{shape:this._shape,workingLayer:B,layer:P,latlng:this._layer.getLatLng()},C,k)},_fireCut(C,k,B,P="Draw",A={}){this.__fire(C,"pm:cut",{shape:this._shape,layer:k,originalLayer:B},P,A)},_fireEdit(C=this._layer,k="Edit",B={}){this.__fire(C,"pm:edit",{layer:this._layer,shape:this.getShape()},k,B)},_fireEnable(C="Edit",k={}){this.__fire(this._layer,"pm:enable",{layer:this._layer,shape:this.getShape()},C,k)},_fireDisable(C="Edit",k={}){this.__fire(this._layer,"pm:disable",{layer:this._layer,shape:this.getShape()},C,k)},_fireUpdate(C="Edit",k={}){this.__fire(this._layer,"pm:update",{layer:this._layer,shape:this.getShape()},C,k)},_fireMarkerDragStart(C,k=void 0,B="Edit",P={}){this.__fire(this._layer,"pm:markerdragstart",{layer:this._layer,markerEvent:C,shape:this.getShape(),indexPath:k},B,P)},_fireMarkerDrag(C,k=void 0,B="Edit",P={}){this.__fire(this._layer,"pm:markerdrag",{layer:this._layer,markerEvent:C,shape:this.getShape(),indexPath:k},B,P)},_fireMarkerDragEnd(C,k=void 0,B=void 0,P="Edit",A={}){this.__fire(this._layer,"pm:markerdragend",{layer:this._layer,markerEvent:C,shape:this.getShape(),indexPath:k,intersectionReset:B},P,A)},_fireDragStart(C="Edit",k={}){this.__fire(this._layer,"pm:dragstart",{layer:this._layer,shape:this.getShape()},C,k)},_fireDrag(C,k="Edit",B={}){this.__fire(this._layer,"pm:drag",{...C,shape:this.getShape()},k,B)},_fireDragEnd(C="Edit",k={}){this.__fire(this._layer,"pm:dragend",{layer:this._layer,shape:this.getShape()},C,k)},_fireDragEnable(C="Edit",k={}){this.__fire(this._layer,"pm:dragenable",{layer:this._layer,shape:this.getShape()},C,k)},_fireDragDisable(C="Edit",k={}){this.__fire(this._layer,"pm:dragdisable",{layer:this._layer,shape:this.getShape()},C,k)},_fireRemove(C,k=C,B="Edit",P={}){this.__fire(C,"pm:remove",{layer:k,shape:this.getShape()},B,P)},_fireVertexAdded(C,k,B,P="Edit",A={}){this.__fire(this._layer,"pm:vertexadded",{layer:this._layer,workingLayer:this._layer,marker:C,indexPath:k,latlng:B,shape:this.getShape()},P,A)},_fireVertexRemoved(C,k,B="Edit",P={}){this.__fire(this._layer,"pm:vertexremoved",{layer:this._layer,marker:C,indexPath:k,shape:this.getShape()},B,P)},_fireVertexClick(C,k,B="Edit",P={}){this.__fire(this._layer,"pm:vertexclick",{layer:this._layer,markerEvent:C,indexPath:k,shape:this.getShape()},B,P)},_fireIntersect(C,k=this._layer,B="Edit",P={}){this.__fire(k,"pm:intersect",{layer:this._layer,intersection:C,shape:this.getShape()},B,P)},_fireLayerReset(C,k,B="Edit",P={}){this.__fire(this._layer,"pm:layerreset",{layer:this._layer,markerEvent:C,indexPath:k,shape:this.getShape()},B,P)},_fireChange(C,k="Edit",B={}){this.__fire(this._layer,"pm:change",{layer:this._layer,latlngs:C,shape:this.getShape()},k,B)},_fireTextChange(C,k="Edit",B={}){this.__fire(this._layer,"pm:textchange",{layer:this._layer,text:C,shape:this.getShape()},k,B)},_fireTextFocus(C="Edit",k={}){this.__fire(this._layer,"pm:textfocus",{layer:this._layer,shape:this.getShape()},C,k)},_fireTextBlur(C="Edit",k={}){this.__fire(this._layer,"pm:textblur",{layer:this._layer,shape:this.getShape()},C,k)},_fireSnapDrag(C,k,B="Snapping",P={}){this.__fire(C,"pm:snapdrag",k,B,P)},_fireSnap(C,k,B="Snapping",P={}){this.__fire(C,"pm:snap",k,B,P)},_fireUnsnap(C,k,B="Snapping",P={}){this.__fire(C,"pm:unsnap",k,B,P)},_fireRotationEnable(C,k,B="Rotation",P={}){this.__fire(C,"pm:rotateenable",{layer:this._layer,helpLayer:this._rotatePoly,shape:this.getShape()},B,P)},_fireRotationDisable(C,k="Rotation",B={}){this.__fire(C,"pm:rotatedisable",{layer:this._layer,shape:this.getShape()},k,B)},_fireRotationStart(C,k,B="Rotation",P={}){this.__fire(C,"pm:rotatestart",{layer:this._rotationLayer,helpLayer:this._layer,startAngle:this._startAngle,originLatLngs:k},B,P)},_fireRotation(C,k,B,P=this._rotationLayer,A="Rotation",T={}){this.__fire(C,"pm:rotate",{layer:P,helpLayer:this._layer,startAngle:this._startAngle,angle:P.pm.getAngle(),angleDiff:k,oldLatLngs:B,newLatLngs:P.getLatLngs()},A,T)},_fireRotationEnd(C,k,B,P="Rotation",A={}){this.__fire(C,"pm:rotateend",{layer:this._rotationLayer,helpLayer:this._layer,startAngle:k,angle:this._rotationLayer.pm.getAngle(),originLatLngs:B,newLatLngs:this._rotationLayer.getLatLngs()},P,A)},_fireActionClick(C,k,B,P="Toolbar",A={}){this.__fire(this._map,"pm:actionclick",{text:C.text,action:C,btnName:k,button:B},P,A)},_fireButtonClick(C,k,B="Toolbar",P={}){this.__fire(this._map,"pm:buttonclick",{btnName:C,button:k},B,P)},_fireLangChange(C,k,B,P,A="Global",T={}){this.__fire(this.map,"pm:langchange",{oldLang:C,activeLang:k,fallback:B,translations:P},A,T)},_fireGlobalDragModeToggled(C,k="Global",B={}){this.__fire(this.map,"pm:globaldragmodetoggled",{enabled:C,map:this.map},k,B)},_fireGlobalEditModeToggled(C,k="Global",B={}){this.__fire(this.map,"pm:globaleditmodetoggled",{enabled:C,map:this.map},k,B)},_fireGlobalRemovalModeToggled(C,k="Global",B={}){this.__fire(this.map,"pm:globalremovalmodetoggled",{enabled:C,map:this.map},k,B)},_fireGlobalCutModeToggled(C="Global",k={}){this.__fire(this._map,"pm:globalcutmodetoggled",{enabled:!!this._enabled,map:this._map},C,k)},_fireGlobalDrawModeToggled(C="Global",k={}){this.__fire(this._map,"pm:globaldrawmodetoggled",{enabled:this._enabled,shape:this._shape,map:this._map},C,k)},_fireGlobalRotateModeToggled(C="Global",k={}){this.__fire(this.map,"pm:globalrotatemodetoggled",{enabled:this.globalRotateModeEnabled(),map:this.map},C,k)},_fireRemoveLayerGroup(C,k=C,B="Edit",P={}){this.__fire(C,"pm:remove",{layer:k,shape:void 0},B,P)},_fireKeyeventEvent(C,k,B,P="Global",A={}){this.__fire(this.map,"pm:keyevent",{event:C,eventType:k,focusOn:B},P,A)},__fire(C,k,B,P,A={}){B=(0,xi.default)(B,A,{source:P}),L.PM.Utils._fireEvent(C,k,B)}},sn=ns,ma=()=>({_lastEvents:{keydown:void 0,keyup:void 0,current:void 0},_initKeyListener(C){this.map=C,L.DomEvent.on(document,"keydown keyup",this._onKeyListener,this),L.DomEvent.on(window,"blur",this._onBlur,this),C.once("unload",this._unbindKeyListenerEvents,this)},_handleEscapeKey(C){let k=this.map.pm;return!k.getGlobalOptions().exitModeOnEscape||!(k.globalDrawModeEnabled()||k.globalEditModeEnabled()||k.globalDragModeEnabled()||k.globalRemovalModeEnabled()||k.globalRotateModeEnabled()||k.globalCutModeEnabled())?!1:(C.preventDefault(),k.globalDrawModeEnabled()&&k.disableDraw(),k.globalEditModeEnabled()&&k.disableGlobalEditMode(),k.globalDragModeEnabled()&&k.disableGlobalDragMode(),k.globalRemovalModeEnabled()&&k.disableGlobalRemovalMode(),k.globalRotateModeEnabled()&&k.disableGlobalRotateMode(),k.globalCutModeEnabled()&&k.disableGlobalCutMode(),!0)},_handleEnterKey(C){let k=this.map.pm;if(!k.getGlobalOptions().finishOnEnter)return!1;let B=k.Draw.getActiveShape();if(!B)return!1;let P=k.Draw[B];return!P||!P._finishShape||!this._canFinishShape(P,B)?!1:(C.preventDefault(),P._finishShape(),!0)},_canFinishShape(C,k){if(["Marker","CircleMarker","Text"].includes(k))return!1;if(k==="Rectangle")return C._startMarker!==void 0;if(k==="Circle")return C._centerMarker&&C._layerGroup?.hasLayer(C._centerMarker);if(C._layer&&C._layer.getLatLngs){let B=C._layer.getLatLngs();if(k==="Line")return(B.flat?B.flat():B).length>=2;if(k==="Polygon"||k==="Cut")return B.length>=3}return!1},_unbindKeyListenerEvents(){L.DomEvent.off(document,"keydown keyup",this._onKeyListener,this),L.DomEvent.off(window,"blur",this._onBlur,this)},_onKeyListener(C){let k="document";this.map.getContainer().contains(C.target)&&(k="map");let B={event:C,eventType:C.type,focusOn:k};this._lastEvents[C.type]=B,this._lastEvents.current=B,this.map.pm._fireKeyeventEvent(C,C.type,k),C.type==="keydown"&&(C.key==="Escape"&&this._handleEscapeKey(C),C.key==="Enter"&&this._handleEnterKey(C))},_onBlur(C){C.altKey=!1;let k={event:C,eventType:C.type,focusOn:"document"};this._lastEvents[C.type]=k,this._lastEvents.current=k},getLastKeyEvent(C="current"){return this._lastEvents[C]},isShiftKeyPressed(){return this._lastEvents.current?.event.shiftKey},isAltKeyPressed(){return this._lastEvents.current?.event.altKey},isCtrlKeyPressed(){return this._lastEvents.current?.event.ctrlKey},isMetaKeyPressed(){return this._lastEvents.current?.event.metaKey},getPressedKey(){return this._lastEvents.current?.event.key}}),rs=ma,Cn=et(hi());function Wt(C){let k=L.PM.activeLang;return(0,Cn.default)($t[k],C)||(0,Cn.default)($t.en,C)||C}function ss(){return window.matchMedia?!window.matchMedia("(pointer: coarse)").matches:!0}function qt(C){for(let k=0;k<C.length;k+=1){let B=C[k];if(Array.isArray(B)){if(qt(B))return!0}else if(B!=null&&B!=="")return!0}return!1}function xn(C){return C.reduce((k,B)=>{if(B.length!==0){let P=Array.isArray(B)?xn(B):B;Array.isArray(P)?P.length!==0&&k.push(P):k.push(P)}return k},[])}function Ue(C,k,B){let P={a:L.CRS.Earth.R,b:63567523142e-4,f:.0033528106647474805},{a:A,b:T,f:O}=P,R=C.lng,Z=C.lat,U=B,Q=Math.PI,Y=k*Q/180,ot=Math.sin(Y),ut=Math.cos(Y),vt=(1-O)*Math.tan(Z*Q/180),xt=1/Math.sqrt(1+vt*vt),Pt=vt*xt,At=Math.atan2(vt,ut),J=xt*ot,ht=1-J*J,yt=ht*(A*A-T*T)/(T*T),Bt=1+yt/16384*(4096+yt*(-768+yt*(320-175*yt))),wt=yt/1024*(256+yt*(-128+yt*(74-47*yt))),Et=U/(T*Bt),q=2*Math.PI,K,$,st;for(;Math.abs(Et-q)>1e-12;){K=Math.cos(2*At+Et),$=Math.sin(Et),st=Math.cos(Et);let kt=wt*$*(K+wt/4*(st*(-1+2*K*K)-wt/6*K*(-3+4*$*$)*(-3+4*K*K)));q=Et,Et=U/(T*Bt)+kt}let rt=Pt*$-xt*st*ut,it=Math.atan2(Pt*st+xt*$*ut,(1-O)*Math.sqrt(J*J+rt*rt)),ct=Math.atan2($*ot,xt*st-Pt*$*ut),at=O/16*ht*(4+O*(4-3*ht)),lt=ct-(1-at)*O*J*(Et+at*$*(K+at*st*(-1+2*K*K))),mt=R+lt*180/Q,_t=it*180/Q;return L.latLng(mt,_t)}function Ii(C,k,B,P,A=!0){let T,O,R,Z=[];for(let U=0;U<B;U+=1){if(A)T=U*360/B+P,O=Ue(C,T,k),R=L.latLng(O.lng,O.lat);else{let Q=C.lat+Math.cos(2*U*Math.PI/B)*k,Y=C.lng+Math.sin(2*U*Math.PI/B)*k;R=L.latLng(Q,Y)}Z.push(R)}return Z}function as(C,k,B){k=(k+360)%360;let P=Math.PI/180,A=180/Math.PI,{R:T}=L.CRS.Earth,O=C.lng*P,R=C.lat*P,Z=k*P,U=Math.sin(R),Q=Math.cos(R),Y=Math.cos(B/T),ot=Math.sin(B/T),ut=Math.asin(U*Y+Q*ot*Math.cos(Z)),vt=O+Math.atan2(Math.sin(Z)*ot*Q,Y-U*Math.sin(ut));vt*=A;let xt=vt-360,Pt=vt<-180?vt+360:vt;return vt=vt>180?xt:Pt,L.latLng([ut*A,vt])}function ur(C,k,B){let P=C.latLngToContainerPoint(k),A=C.latLngToContainerPoint(B),T=Math.atan2(A.y-P.y,A.x-P.x)*180/Math.PI+90;return T+=T<0?360:0,T}function zi(C,k,B,P){let A=ur(C,k,B);return as(k,A,P)}function ga(C,k,B="asc"){if(!k||Object.keys(k).length===0)return(Z,U)=>Z-U;let P=Object.keys(k),A,T=P.length-1,O={};for(;T>=0;)A=P[T],O[A.toLowerCase()]=k[A],T-=1;function R(Z){if(Z instanceof L.Marker)return"Marker";if(Z instanceof L.Circle)return"Circle";if(Z instanceof L.CircleMarker)return"CircleMarker";if(Z instanceof L.Rectangle)return"Rectangle";if(Z instanceof L.Polygon)return"Polygon";if(Z instanceof L.Polyline)return"Line"}return(Z,U)=>{let Q,Y;if(Q=R(Z.layer).toLowerCase(),Y=R(U.layer).toLowerCase(),!Q||!Y)return 0;let ot=Q in O?O[Q]:Number.MAX_SAFE_INTEGER,ut=Y in O?O[Y]:Number.MAX_SAFE_INTEGER,vt=0;return ot<ut?vt=-1:ot>ut&&(vt=1),B==="desc"?vt*-1:vt}}function ri(C,k=C.getLatLngs()){return C instanceof L.Polygon?L.polygon(k).getLatLngs():L.polyline(k).getLatLngs()}function os(C,k){if(k.options.crs?.projection?.MAX_LATITUDE){let B=k.options.crs?.projection?.MAX_LATITUDE;C.lat=Math.max(Math.min(B,C.lat),-B)}return C}function Ni(C){return C.options.renderer||C._map&&(C._map._getPaneRenderer(C.options.pane)||C._map.options.renderer||C._map._renderer)||C._renderer}function lr(C,k){if(C=C.trim().toLowerCase(),k[C])return C;let B=C.replace(/[-_\s]/g,"_").match(/^([a-z]{2,3})(?:_([a-z]{2,3}))?$/);if(B){let P=[];B[2]&&P.push(`${B[1]}_${B[2]}`),P.push(B[1]);for(let A of P)if(k[A])return A}return C}var ya=L.Class.extend({includes:[rr,ar,or,me,sn],initialize(C){this.map=C,this.Draw=new L.PM.Draw(C),this.Toolbar=new L.PM.Toolbar(C),this.Keyboard=rs(),this.globalOptions={snappable:!0,layerGroup:void 0,snappingOrder:["Marker","CircleMarker","Circle","Line","Polygon","Rectangle"],panes:{vertexPane:"markerPane",layerPane:"overlayPane",markerPane:"markerPane"},draggable:!0,exitModeOnEscape:!1,finishOnEnter:!1},this.Keyboard._initKeyListener(C)},setLang(C="en",k,B="en"){C=lr(C,$t);let P=L.PM.activeLang;k&&($t[C]=(0,Qi.default)($t[B],k)),L.PM.activeLang=C,this.map.pm.Toolbar.reinit(),this._fireLangChange(P,C,B,$t[C])},addControls(C){this.Toolbar.addControls(C)},removeControls(){this.Toolbar.removeControls()},toggleControls(){this.Toolbar.toggleControls()},controlsVisible(){return this.Toolbar.isVisible},enableDraw(C="Polygon",k){C==="Poly"&&(C="Polygon"),this.Draw.enable(C,k)},disableDraw(C="Polygon"){C==="Poly"&&(C="Polygon"),this.Draw.disable(C)},setPathOptions(C,k={}){let B=k.ignoreShapes||[],P=k.merge||!1;this.map.pm.Draw.shapes.forEach(A=>{B.indexOf(A)===-1&&this.map.pm.Draw[A].setPathOptions(C,P)})},getGlobalOptions(){return this.globalOptions},setGlobalOptions(C){let k=(0,Qi.default)(this.globalOptions,C);k.editable&&(k.resizeableCircleMarker=k.editable,delete k.editable);let B=!1;this.map.pm.Draw.CircleMarker.enabled()&&!!this.map.pm.Draw.CircleMarker.options.resizeableCircleMarker!=!!k.resizeableCircleMarker&&(this.map.pm.Draw.CircleMarker.disable(),B=!0);let P=!1;this.map.pm.Draw.Circle.enabled()&&!!this.map.pm.Draw.Circle.options.resizeableCircle!=!!k.resizeableCircle&&(this.map.pm.Draw.Circle.disable(),P=!0),this.map.pm.Draw.shapes.forEach(A=>{this.map.pm.Draw[A].setOptions(k)}),B&&this.map.pm.Draw.CircleMarker.enable(),P&&this.map.pm.Draw.Circle.enable(),L.PM.Utils.findLayers(this.map).forEach(A=>{A.pm.setOptions(k)}),this.map.fire("pm:globaloptionschanged"),this.globalOptions=k,this.applyGlobalOptions()},applyGlobalOptions(){L.PM.Utils.findLayers(this.map).forEach(C=>{C.pm.enabled()&&C.pm.applyOptions()})},globalDrawModeEnabled(){return!!this.Draw.getActiveShape()},globalCutModeEnabled(){return!!this.Draw.Cut.enabled()},enableGlobalCutMode(C){return this.Draw.Cut.enable(C)},toggleGlobalCutMode(C){return this.Draw.Cut.toggle(C)},disableGlobalCutMode(){return this.Draw.Cut.disable()},getGeomanLayers(C=!1){let k=L.PM.Utils.findLayers(this.map);if(!C)return k;let B=L.featureGroup();return B._pmTempLayer=!0,k.forEach(P=>{B.addLayer(P)}),B},getGeomanDrawLayers(C=!1){let k=L.PM.Utils.findLayers(this.map).filter(P=>P._drawnByGeoman===!0);if(!C)return k;let B=L.featureGroup();return B._pmTempLayer=!0,k.forEach(P=>{B.addLayer(P)}),B},_getContainingLayer(){return this.globalOptions.layerGroup&&this.globalOptions.layerGroup instanceof L.LayerGroup?this.globalOptions.layerGroup:this.map},_isCRSSimple(){return this.map.options.crs===L.CRS.Simple},_touchEventCounter:0,_addTouchEvents(C){this._touchEventCounter===0&&(L.DomEvent.on(C,"touchmove",this._canvasTouchMove,this),L.DomEvent.on(C,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter+=1},_removeTouchEvents(C){this._touchEventCounter===1&&(L.DomEvent.off(C,"touchmove",this._canvasTouchMove,this),L.DomEvent.off(C,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter=this._touchEventCounter<=1?0:this._touchEventCounter-1},_canvasTouchMove(C){Ni(this.map)._onMouseMove(this._createMouseEvent("mousemove",C))},_canvasTouchClick(C){let k="";C.type==="touchstart"||C.type==="pointerdown"?k="mousedown":(C.type==="touchend"||C.type==="pointerup"||C.type==="touchcancel"||C.type==="pointercancel")&&(k="mouseup"),k&&Ni(this.map)._onClick(this._createMouseEvent(k,C))},_createMouseEvent(C,k){let B,P=k.touches[0]||k.changedTouches[0];try{B=new MouseEvent(C,{bubbles:k.bubbles,cancelable:k.cancelable,view:k.view,detail:P.detail,screenX:P.screenX,screenY:P.screenY,clientX:P.clientX,clientY:P.clientY,ctrlKey:k.ctrlKey,altKey:k.altKey,shiftKey:k.shiftKey,metaKey:k.metaKey,button:k.button,relatedTarget:k.relatedTarget})}catch{B=document.createEvent("MouseEvents"),B.initMouseEvent(C,k.bubbles,k.cancelable,k.view,P.detail,P.screenX,P.screenY,P.clientX,P.clientY,k.ctrlKey,k.altKey,k.shiftKey,k.metaKey,k.button,k.relatedTarget)}return B}}),Ke=ya,va=L.Control.extend({includes:[sn],options:{position:"topleft",disableByOtherButtons:!0},initialize(C){this._button=L.Util.extend({},this.options,C)},onAdd(C){return this._map=C,this._map.pm.Toolbar.options.oneBlock?this._container=this._map.pm.Toolbar._createContainer(this.options.position):this._button.tool==="edit"?this._container=this._map.pm.Toolbar.editContainer:this._button.tool==="options"?this._container=this._map.pm.Toolbar.optionsContainer:this._button.tool==="custom"?this._container=this._map.pm.Toolbar.customContainer:this._container=this._map.pm.Toolbar.drawContainer,this._renderButton(),this._container},_renderButton(){let C=this.buttonsDomNode;this.buttonsDomNode=this._makeButton(this._button),C?C.replaceWith(this.buttonsDomNode):this._container.appendChild(this.buttonsDomNode)},onRemove(){return this.buttonsDomNode.remove(),this._container},getText(){return this._button.text},getIconUrl(){return this._button.iconUrl},destroy(){this._button={},this._update()},toggle(C){return typeof C=="boolean"?this._button.toggleStatus=C:this._button.toggleStatus=!this._button.toggleStatus,this._applyStyleClasses(),this._updateActiveAction(this._button),this._button.toggleStatus},toggled(){return this._button.toggleStatus},onCreate(){this.toggle(!1)},disable(){this.toggle(!1),this._button.disabled=!0,this._updateDisabled()},enable(){this._button.disabled=!1,this._updateDisabled(),this._updateActiveAction(this._button)},_triggerClick(C){C&&C.preventDefault(),!this._button.disabled&&(this._button.onClick(C,{button:this,event:C}),this._clicked(C),this._button.afterClick(C,{button:this,event:C}))},_makeButton(C){let k=this.options.position.indexOf("right")>-1?"pos-right":"",B=L.DomUtil.create("div",`button-container ${k}`,this._container);C.title&&B.setAttribute("title",C.title);let P=L.DomUtil.create("a","leaflet-buttons-control-button",B);P.setAttribute("role","button"),P.setAttribute("tabindex","0"),P.href="#";let A=L.DomUtil.create("div",`leaflet-pm-actions-container ${k}`,B),T=C.actions,O={cancel:{text:Wt("actions.cancel"),title:Wt("actions.cancel"),onClick(){this._triggerClick()}},finishMode:{text:Wt("actions.finish"),title:Wt("actions.finish"),onClick(){this._triggerClick()}},removeLastVertex:{text:Wt("actions.removeLastVertex"),title:Wt("actions.removeLastVertex"),onClick(){this._map.pm.Draw[C.jsClass]._removeLastVertex()}},finish:{text:Wt("actions.finish"),title:Wt("actions.finish"),onClick(Z){this._map.pm.Draw[C.jsClass]._finishShape(Z)}}};C._preparedActions=T.map(Z=>{let U=typeof Z=="string"?Z:Z.name,Q;if(O[U])Q=O[U];else if(Z.text)Q=Z;else return Q;let Y=L.DomUtil.create("a",`leaflet-pm-action ${k} action-${U}`,A);if(Y.setAttribute("role","button"),Y.setAttribute("tabindex","0"),Y.href="#",Q.title&&(Y.title=Q.title),Y.innerHTML=Q.text,L.DomEvent.disableClickPropagation(Y),L.DomEvent.on(Y,"click",L.DomEvent.stop),Q._node=Y,!C.disabled&&Q.onClick){let ot=ut=>{ut.preventDefault();let vt="",{buttons:xt}=this._map.pm.Toolbar;for(let Pt in xt)if(xt[Pt]._button===C){vt=Pt;break}this._fireActionClick(Q,vt,C)};L.DomEvent.addListener(Y,"click",ot,this),L.DomEvent.addListener(Y,"click",Q.onClick,this),L.DomEvent.addListener(Y,"click",()=>this._updateActiveAction(C))}return Q}),this._updateActiveAction(C),C.toggleStatus&&L.DomUtil.addClass(B,"active");let R=L.DomUtil.create("div","control-icon",P);return C.iconUrl&&R.setAttribute("src",C.iconUrl),C.className&&L.DomUtil.addClass(R,C.className),L.DomEvent.disableClickPropagation(P),L.DomEvent.on(P,"click",L.DomEvent.stop),C.disabled||(L.DomEvent.addListener(P,"click",this._onBtnClick,this),L.DomEvent.addListener(P,"click",this._triggerClick,this)),C.disabled&&(L.DomUtil.addClass(P,"pm-disabled"),P.setAttribute("aria-disabled","true")),B},_applyStyleClasses(){this._container&&(!this._button.toggleStatus||this._button.cssToggle===!1?(L.DomUtil.removeClass(this.buttonsDomNode,"active"),L.DomUtil.removeClass(this._container,"activeChild")):(L.DomUtil.addClass(this.buttonsDomNode,"active"),L.DomUtil.addClass(this._container,"activeChild")))},_onBtnClick(){if(this._button.disabled)return;this._button.disableOtherButtons&&this._map.pm.Toolbar.triggerClickOnToggledButtons(this);let C="",{buttons:k}=this._map.pm.Toolbar;for(let B in k)if(k[B]._button===this._button){C=B;break}this._fireButtonClick(C,this._button)},_clicked(){this._button.doToggle&&this.toggle()},_updateDisabled(){if(!this._container)return;let C="pm-disabled",k=this.buttonsDomNode.children[0];this._button.disabled?(L.DomUtil.addClass(k,C),k.setAttribute("aria-disabled","true")):(L.DomUtil.removeClass(k,C),k.setAttribute("aria-disabled","false"))},_updateActiveAction(C){C._preparedActions?.forEach(k=>{k?._node&&(k.isActive&&k.isActive.call(this)?L.DomUtil.addClass(k._node,"active-action"):L.DomUtil.removeClass(k._node,"active-action"))})}}),us=va;L.Control.PMButton=us;var di=L.Class.extend({options:{drawMarker:!0,drawRectangle:!0,drawPolyline:!0,drawPolygon:!0,drawCircle:!0,drawCircleMarker:!0,drawText:!0,editMode:!0,dragMode:!0,cutPolygon:!0,removalMode:!0,rotateMode:!0,snappingOption:!0,drawControls:!0,editControls:!0,optionsControls:!0,customControls:!0,oneBlock:!1,position:"topleft",positions:{draw:"",edit:"",options:"",custom:""}},customButtons:[],initialize(C){this.customButtons=[],this.options.positions={draw:"",edit:"",options:"",custom:""},this.init(C)},reinit(){let C=this.isVisible;this.removeControls(),this._defineButtons(),C&&this.addControls()},init(C){this.map=C,this.buttons={},this.isVisible=!1,this.drawContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-draw leaflet-bar leaflet-control"),this.editContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-edit leaflet-bar leaflet-control"),this.optionsContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-options leaflet-bar leaflet-control"),this.customContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-custom leaflet-bar leaflet-control"),this._defineButtons()},_createContainer(C){let k=`${C}Container`;return this[k]||(this[k]=L.DomUtil.create("div",`leaflet-pm-toolbar leaflet-pm-${C} leaflet-bar leaflet-control`)),this[k]},getButtons(){return this.buttons},addControls(C=this.options){typeof C.editPolygon<"u"&&(C.editMode=C.editPolygon),typeof C.deleteLayer<"u"&&(C.removalMode=C.deleteLayer),L.Util.setOptions(this,C),this.applyIconStyle(),this.isVisible=!0,this._showHideButtons()},applyIconStyle(){let C=this.getButtons(),k={geomanIcons:{drawMarker:"control-icon leaflet-pm-icon-marker",drawPolyline:"control-icon leaflet-pm-icon-polyline",drawRectangle:"control-icon leaflet-pm-icon-rectangle",drawPolygon:"control-icon leaflet-pm-icon-polygon",drawCircle:"control-icon leaflet-pm-icon-circle",drawCircleMarker:"control-icon leaflet-pm-icon-circle-marker",editMode:"control-icon leaflet-pm-icon-edit",dragMode:"control-icon leaflet-pm-icon-drag",cutPolygon:"control-icon leaflet-pm-icon-cut",removalMode:"control-icon leaflet-pm-icon-delete",drawText:"control-icon leaflet-pm-icon-text"}};for(let B in C){let P=C[B];L.Util.setOptions(P,{className:k.geomanIcons[B]})}},removeControls(){let C=this.getButtons();for(let k in C)C[k].remove();this.isVisible=!1},deleteControl(C){let k=this._btnNameMapping(C);this.buttons[k]&&(this.buttons[k].remove(),delete this.buttons[k])},toggleControls(C=this.options){this.isVisible?this.removeControls():this.addControls(C)},_addButton(C,k){return this.buttons[C]=k,this.options[C]=!!this.options[C]||!1,this.buttons[C]},triggerClickOnToggledButtons(C){for(let k in this.buttons){let B=this.buttons[k];B._button.disableByOtherButtons&&B!==C&&B.toggled()&&B._triggerClick()}},toggleButton(C,k,B=!0){C==="editPolygon"&&(C="editMode"),C==="deleteLayer"&&(C="removalMode");let P=C;return B&&this.triggerClickOnToggledButtons(this.buttons[P]),this.buttons[P]?this.buttons[P].toggle(k):!1},_defineButtons(){let C={className:"control-icon leaflet-pm-icon-marker",title:Wt("buttonTitles.drawMarkerButton"),jsClass:"Marker",onClick:()=>{},afterClick:(ot,ut)=>{this.map.pm.Draw[ut.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},k={title:Wt("buttonTitles.drawPolyButton"),className:"control-icon leaflet-pm-icon-polygon",jsClass:"Polygon",onClick:()=>{},afterClick:(ot,ut)=>{this.map.pm.Draw[ut.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},B={className:"control-icon leaflet-pm-icon-polyline",title:Wt("buttonTitles.drawLineButton"),jsClass:"Line",onClick:()=>{},afterClick:(ot,ut)=>{this.map.pm.Draw[ut.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},P={title:Wt("buttonTitles.drawCircleButton"),className:"control-icon leaflet-pm-icon-circle",jsClass:"Circle",onClick:()=>{},afterClick:(ot,ut)=>{this.map.pm.Draw[ut.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},A={title:Wt("buttonTitles.drawCircleMarkerButton"),className:"control-icon leaflet-pm-icon-circle-marker",jsClass:"CircleMarker",onClick:()=>{},afterClick:(ot,ut)=>{this.map.pm.Draw[ut.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},T={title:Wt("buttonTitles.drawRectButton"),className:"control-icon leaflet-pm-icon-rectangle",jsClass:"Rectangle",onClick:()=>{},afterClick:(ot,ut)=>{this.map.pm.Draw[ut.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},O={title:Wt("buttonTitles.editButton"),className:"control-icon leaflet-pm-icon-edit",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalEditMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},R={title:Wt("buttonTitles.dragButton"),className:"control-icon leaflet-pm-icon-drag",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalDragMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},Z={title:Wt("buttonTitles.cutButton"),className:"control-icon leaflet-pm-icon-cut",jsClass:"Cut",onClick:()=>{},afterClick:(ot,ut)=>{this.map.pm.Draw[ut.button._button.jsClass].toggle({snappable:!0,cursorMarker:!0,allowSelfIntersection:!1})},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finish","removeLastVertex","cancel"]},U={title:Wt("buttonTitles.deleteButton"),className:"control-icon leaflet-pm-icon-delete",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalRemovalMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},Q={title:Wt("buttonTitles.rotateButton"),className:"control-icon leaflet-pm-icon-rotate",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalRotateMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},Y={className:"control-icon leaflet-pm-icon-text",title:Wt("buttonTitles.drawTextButton"),jsClass:"Text",onClick:()=>{},afterClick:(ot,ut)=>{this.map.pm.Draw[ut.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]};this._addButton("drawMarker",new L.Control.PMButton(C)),this._addButton("drawPolyline",new L.Control.PMButton(B)),this._addButton("drawRectangle",new L.Control.PMButton(T)),this._addButton("drawPolygon",new L.Control.PMButton(k)),this._addButton("drawCircle",new L.Control.PMButton(P)),this._addButton("drawCircleMarker",new L.Control.PMButton(A)),this._addButton("drawText",new L.Control.PMButton(Y)),this._addButton("editMode",new L.Control.PMButton(O)),this._addButton("dragMode",new L.Control.PMButton(R)),this._addButton("cutPolygon",new L.Control.PMButton(Z)),this._addButton("removalMode",new L.Control.PMButton(U)),this._addButton("rotateMode",new L.Control.PMButton(Q))},_showHideButtons(){if(!this.isVisible)return;this.removeControls(),this.isVisible=!0;let C=this.getButtons(),k=[];this.options.drawControls===!1&&(k=k.concat(Object.keys(C).filter(B=>!C[B]._button.tool))),this.options.editControls===!1&&(k=k.concat(Object.keys(C).filter(B=>C[B]._button.tool==="edit"))),this.options.optionsControls===!1&&(k=k.concat(Object.keys(C).filter(B=>C[B]._button.tool==="options"))),this.options.customControls===!1&&(k=k.concat(Object.keys(C).filter(B=>C[B]._button.tool==="custom")));for(let B in C)if(this.options[B]&&k.indexOf(B)===-1){let P=C[B]._button.tool;P||(P="draw"),C[B].setPosition(this._getBtnPosition(P)),C[B].addTo(this.map)}},_getBtnPosition(C){return this.options.positions&&this.options.positions[C]?this.options.positions[C]:this.options.position},setBlockPosition(C,k){this.options.positions[C]=k,this._showHideButtons(),this.changeControlOrder()},getBlockPositions(){return this.options.positions},copyDrawControl(C,k){if(k)typeof k!="object"&&(k={name:k});else throw new TypeError("Button has no name");let B=this._btnNameMapping(C);if(!k.name)throw new TypeError("Button has no name");if(this.buttons[k.name])throw new TypeError("Button with this name already exists");let P=this.map.pm.Draw.createNewDrawInstance(k.name,B);k={...this.buttons[B]._button,...k};let A=this.createCustomControl(k);return{drawInstance:P,control:A}},createCustomControl(C){if(!C.name)throw new TypeError("Button has no name");if(this.buttons[C.name])throw new TypeError("Button with this name already exists");C.onClick||(C.onClick=()=>{}),C.afterClick||(C.afterClick=()=>{}),C.toggle!==!1&&(C.toggle=!0),C.block&&(C.block=C.block.toLowerCase()),(!C.block||C.block==="draw")&&(C.block=""),C.className?C.className.indexOf("control-icon")===-1&&(C.className=`control-icon ${C.className}`):C.className="control-icon";let k={tool:C.block,className:C.className,title:C.title||"",jsClass:C.name,onClick:C.onClick,afterClick:C.afterClick,doToggle:C.toggle,toggleStatus:!1,disableOtherButtons:C.disableOtherButtons??!0,disableByOtherButtons:C.disableByOtherButtons??!0,cssToggle:C.toggle,position:this.options.position,actions:C.actions||[],disabled:!!C.disabled};this.options[C.name]!==!1&&(this.options[C.name]=!0);let B=this._addButton(C.name,new L.Control.PMButton(k));return this.changeControlOrder(),B},controlExists(C){return!!this.getButton(C)},getButton(C){return this.getButtons()[C]},getButtonsInBlock(C){let k={};if(C)for(let B in this.getButtons()){let P=this.getButtons()[B];(P._button.tool===C||C==="draw"&&!P._button.tool)&&(k[B]=P)}return k},changeControlOrder(C=[]){let k=this._shapeMapping(),B=[];C.forEach(T=>{k[T]?B.push(k[T]):B.push(T)});let P=this.getButtons(),A={};B.forEach(T=>{P[T]&&(A[T]=P[T])}),Object.keys(P).filter(T=>!P[T]._button.tool||P[T]._button.tool==="draw").forEach(T=>{B.indexOf(T)===-1&&(A[T]=P[T])}),Object.keys(P).filter(T=>P[T]._button.tool==="edit").forEach(T=>{B.indexOf(T)===-1&&(A[T]=P[T])}),Object.keys(P).filter(T=>P[T]._button.tool==="options").forEach(T=>{B.indexOf(T)===-1&&(A[T]=P[T])}),Object.keys(P).filter(T=>P[T]._button.tool==="custom").forEach(T=>{B.indexOf(T)===-1&&(A[T]=P[T])}),Object.keys(P).forEach(T=>{B.indexOf(T)===-1&&(A[T]=P[T])}),this.map.pm.Toolbar.buttons=A,this._showHideButtons()},getControlOrder(){let C=this.getButtons(),k=[];for(let B in C)k.push(B);return k},changeActionsOfControl(C,k){let B=this._btnNameMapping(C);if(!B)throw new TypeError("No name passed");if(!k)throw new TypeError("No actions passed");if(!this.buttons[B])throw new TypeError("Button with this name not exists");this.buttons[B]._button.actions=k,this.changeControlOrder()},setButtonDisabled(C,k){let B=this._btnNameMapping(C);k?this.buttons[B].disable():this.buttons[B].enable()},_shapeMapping(){return{Marker:"drawMarker",Circle:"drawCircle",Polygon:"drawPolygon",Rectangle:"drawRectangle",Polyline:"drawPolyline",Line:"drawPolyline",CircleMarker:"drawCircleMarker",Edit:"editMode",Drag:"dragMode",Cut:"cutPolygon",Removal:"removalMode",Rotate:"rotateMode",Text:"drawText"}},_btnNameMapping(C){let k=this._shapeMapping();return k[C]?k[C]:C}}),ls=di,hs=et(mn()),hr={_initSnappableMarkers(){this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0?!0:this.options.snapSegment,this._assignEvents(this._markers),this._layer.off("pm:dragstart",this._unsnap,this),this._layer.on("pm:dragstart",this._unsnap,this)},_disableSnapping(){this._layer.off("pm:dragstart",this._unsnap,this)},_assignEvents(C){C.forEach(k=>{if(Array.isArray(k)){this._assignEvents(k);return}k.off("drag",this._handleSnapping,this),k.on("drag",this._handleSnapping,this),k.off("dragend",this._cleanupSnapping,this),k.on("dragend",this._cleanupSnapping,this)})},_cleanupSnapping(C){if(C){let k=C.target;k._snapped=!1}delete this._snapList,this.throttledList&&(this._map.off("layeradd",this.throttledList,this),this.throttledList=void 0),this._map.off("layerremove",this._handleSnapLayerRemoval,this),this.debugIndicatorLines&&this.debugIndicatorLines.forEach(k=>{k.remove()})},_handleThrottleSnapping(){this.throttledList&&this._createSnapList()},_handleSnapping(C,k=!1){let B=C.target;if(B._snapped=!1,this.throttledList||(this.throttledList=L.Util.throttle(this._handleThrottleSnapping,100,this)),C?.originalEvent?.altKey||this._map?.pm?.Keyboard.isAltKeyPressed())return!1;let P;if(k){if(!this._otherSnapLayers||this._otherSnapLayers.length===0)return!1;P=this._otherSnapLayers}else this._snapList===void 0&&(this._createSnapList(),this._map.off("layeradd",this.throttledList,this),this._map.on("layeradd",this.throttledList,this)),P=this._snapList;if(P.length<=0)return!1;let A=this._calcClosestLayer(B.getLatLng(),P);if(Object.keys(A).length===0)return!1;let T=A.layer instanceof L.Marker||A.layer instanceof L.CircleMarker||!this.options.snapSegment,O;T?O=A.latlng:O=this._checkPrioritiySnapping(A);let R=this.options.snapDistance,Z={marker:B,shape:this._shape,snapLatLng:O,segment:A.segment,layer:this._layer,workingLayer:this._layer,layerInteractedWith:A.layer,distance:A.distance};if(this._fireSnapDrag(Z.marker,Z),this._fireSnapDrag(this._layer,Z),A.distance<R){B._orgLatLng=B.getLatLng(),B.setLatLng(O),B._snapped=!0,B._snapInfo=Z;let U=()=>{this._snapLatLng=O,this._fireSnap(B,Z),this._fireSnap(this._layer,Z)},Q=this._snapLatLng||{},Y=O||{};(Q.lat!==Y.lat||Q.lng!==Y.lng)&&U()}else this._snapLatLng&&(this._unsnap(Z),B._snapped=!1,B._snapInfo=void 0,this._fireUnsnap(Z.marker,Z),this._fireUnsnap(this._layer,Z));return!0},_createSnapList(){let C=[],k=[],B=this._map;B.off("layerremove",this._handleSnapLayerRemoval,this),B.on("layerremove",this._handleSnapLayerRemoval,this),B.eachLayer(P=>{if((P instanceof L.Polyline||P instanceof L.Marker||P instanceof L.CircleMarker||P instanceof L.ImageOverlay)&&P.options.snapIgnore!==!0){if(P.options.snapIgnore===void 0&&(!L.PM.optIn&&P.options.pmIgnore===!0||L.PM.optIn&&P.options.pmIgnore!==!1))return;(P instanceof L.Circle||P instanceof L.CircleMarker)&&P.pm&&P.pm._hiddenPolyCircle?C.push(P.pm._hiddenPolyCircle):P instanceof L.ImageOverlay&&(P=L.rectangle(P.getBounds())),C.push(P);let A=L.polyline([],{color:"red",pmIgnore:!0});A._pmTempLayer=!0,k.push(A),(P instanceof L.Circle||P instanceof L.CircleMarker)&&k.push(A)}}),C=C.filter(P=>this._layer!==P),C=C.filter(P=>P._latlng||P._latlngs&&qt(P._latlngs)),C=C.filter(P=>!P._pmTempLayer),this._otherSnapLayers?(this._otherSnapLayers.forEach(()=>{let P=L.polyline([],{color:"red",pmIgnore:!0});P._pmTempLayer=!0,k.push(P)}),this._snapList=C.concat(this._otherSnapLayers)):this._snapList=C,this.debugIndicatorLines=k},_handleSnapLayerRemoval({layer:C}){if(!C._leaflet_id)return;let k=this._snapList.findIndex(B=>B._leaflet_id===C._leaflet_id);k>-1&&this._snapList.splice(k,1)},_calcClosestLayer(C,k){return this._calcClosestLayers(C,k,1)[0]},_calcClosestLayers(C,k,B=1){let P=[],A={};k.forEach((O,R)=>{if(O._parentCopy&&O._parentCopy===this._layer||O.getLatLngs?.().flat(5).length<2)return;let Z=this._calcLayerDistances(C,O);if(Z.distance=Math.floor(Z.distance),this.debugIndicatorLines){if(!this.debugIndicatorLines[R]){let U=L.polyline([],{color:"red",pmIgnore:!0});U._pmTempLayer=!0,this.debugIndicatorLines[R]=U}this.debugIndicatorLines[R].setLatLngs([C,Z.latlng])}B===1&&(A.distance===void 0||Z.distance-5<=A.distance)?(Z.distance+5<A.distance&&(P=[]),A=Z,A.layer=O,P.push(A)):B!==1&&(A={},A=Z,A.layer=O,P.push(A))}),B!==1&&(P=P.sort((O,R)=>O.distance-R.distance)),B===-1&&(B=P.length);let T=this._getClosestLayerByPriority(P,B);return L.Util.isArray(T)?T:[T]},_calcLayerDistances(C,k){let B=this._map,P=k instanceof L.Marker||k instanceof L.CircleMarker,A=k instanceof L.Polygon,T=C;if(P){let O=k.getLatLng();return{latlng:{...O},distance:this._getDistance(B,O,T)}}return this._calcLatLngDistances(T,k.getLatLngs(),B,A)},_calcLatLngDistances(C,k,B,P=!1){let A,T,O,R=Z=>{Z.forEach((U,Q)=>{if(Array.isArray(U)){R(U);return}if(this.options.snapSegment){let Y=U,ot;P?ot=Q+1===Z.length?0:Q+1:ot=Q+1===Z.length?void 0:Q+1;let ut=Z[ot];if(ut){let vt=this._getDistanceToSegment(B,C,Y,ut);(T===void 0||vt<T)&&(T=vt,O=[Y,ut])}}else{let Y=this._getDistance(B,C,U);(T===void 0||Y<T)&&(T=Y,A=U)}})};return R(k),this.options.snapSegment?{latlng:{...this._getClosestPointOnSegment(B,C,O[0],O[1])},segment:O,distance:T}:{latlng:A,distance:T}},_getClosestLayerByPriority(C,k=1){C=C.sort((O,R)=>O._leaflet_id-R._leaflet_id);let B=["Marker","CircleMarker","Circle","Line","Polygon","Rectangle"],P=this._map.pm.globalOptions.snappingOrder||[],A=0,T={};return P.concat(B).forEach(O=>{T[O]||(A+=1,T[O]=A)}),C.sort(ga("instanceofShape",T)),k===1?C[0]||{}:C.slice(0,k)},_checkPrioritiySnapping(C){let k=this._map,B=C.segment[0],P=C.segment[1],A=C.latlng,T=A;if(this.options.snapVertex){let O=this._getDistance(k,B,A),R=this._getDistance(k,P,A),Z=O<R?B:P,U=O<R?O:R;if(this.options.snapMiddle){let Y=L.PM.Utils.calcMiddleLatLng(k,B,P),ot=this._getDistance(k,Y,A);ot<O&&ot<R&&(Z=Y,U=ot)}let Q=this.options.snapDistance;U<Q&&(T=Z)}return{...T}},_unsnap(){delete this._snapLatLng},_getClosestPointOnSegment(C,k,B,P){let A=C.getMaxZoom();A===1/0&&(A=C.getZoom());let T=C.project(k,A),O=C.project(B,A),R=C.project(P,A),Z=L.LineUtil.closestPointOnSegment(T,O,R);return C.unproject(Z,A)},_getDistanceToSegment(C,k,B,P){let A=C.latLngToContainerPoint(k),T=C.latLngToContainerPoint(B),O=C.latLngToContainerPoint(P);return L.LineUtil.pointToSegmentDistance(A,T,O)},_getDistance(C,k,B){return C.latLngToContainerPoint(k).distanceTo(C.latLngToContainerPoint(B))}},cs=hr,ds=L.Class.extend({includes:[cs,sn],options:{snappable:!0,snapDistance:20,snapMiddle:!1,allowSelfIntersection:!0,tooltips:!0,templineStyle:{},hintlineStyle:{color:"#3388ff",dashArray:"5,5"},pathOptions:null,cursorMarker:!0,finishOn:null,markerStyle:{draggable:!0,icon:L.icon()},hideMiddleMarkers:!1,minRadiusCircle:null,maxRadiusCircle:null,minRadiusCircleMarker:null,maxRadiusCircleMarker:null,resizeableCircleMarker:!1,resizeableCircle:!0,markerEditable:!0,continueDrawing:!1,snapSegment:!0,requireSnapToFinish:!1,rectangleAngle:0,textOptions:{text:null,focusAfterDraw:null,removeIfEmpty:null,className:null},snapVertex:!0},setOptions(C){L.Util.setOptions(this,C),this.setStyle(this.options)},setStyle(){},getOptions(){return this.options},initialize(C){let k=new L.Icon.Default;k.options.tooltipAnchor=[0,0],this.options.markerStyle.icon=k,this._map=C,this.shapes=["Marker","CircleMarker","Line","Polygon","Rectangle","Circle","Cut","Text"],this.shapes.forEach(B=>{this[B]=new L.PM.Draw[B](this._map)}),this.Marker.setOptions({continueDrawing:!0}),this.CircleMarker.setOptions({continueDrawing:!0})},setPathOptions(C,k=!1){k?this.options.pathOptions=(0,hs.default)(this.options.pathOptions,C):this.options.pathOptions=C},getShapes(){return this.shapes},getShape(){return this._shape},enable(C,k){if(!C)throw new Error(`Error: Please pass a shape as a parameter. Possible shapes are: ${this.getShapes().join(",")}`);this.disable(),this[C].enable(k)},disable(){this.shapes.forEach(C=>{this[C].disable()})},addControls(){this.shapes.forEach(C=>{this[C].addButton()})},getActiveShape(){let C;return this.shapes.forEach(k=>{this[k]._enabled&&(C=k)}),C},_setGlobalDrawMode(){this._shape==="Cut"?this._fireGlobalCutModeToggled():this._fireGlobalDrawModeToggled();let C=[];this._map.eachLayer(k=>{(k instanceof L.Polyline||k instanceof L.Marker||k instanceof L.Circle||k instanceof L.CircleMarker||k instanceof L.ImageOverlay)&&(k._pmTempLayer||C.push(k))}),this._enabled?C.forEach(k=>{L.PM.Utils.disablePopup(k)}):C.forEach(k=>{L.PM.Utils.enablePopup(k)})},createNewDrawInstance(C,k){let B=this._getShapeFromBtnName(k);if(this[C])throw new TypeError("Draw Type already exists");if(!L.PM.Draw[B])throw new TypeError(`There is no class L.PM.Draw.${B}`);return this[C]=new L.PM.Draw[B](this._map),this[C].toolbarButtonName=C,this[C]._shape=C,this.shapes.push(C),this[k]&&this[C].setOptions(this[k].options),this[C].setOptions(this[C].options),this[C]},_getShapeFromBtnName(C){let k={drawMarker:"Marker",drawCircle:"Circle",drawPolygon:"Polygon",drawPolyline:"Line",drawRectangle:"Rectangle",drawCircleMarker:"CircleMarker",editMode:"Edit",dragMode:"Drag",cutPolygon:"Cut",removalMode:"Removal",rotateMode:"Rotate",drawText:"Text"};return k[C]?k[C]:this[C]?this[C]._shape:C},_finishLayer(C){C.pm&&(C.pm.setOptions(this.options),C.pm._shape=this._shape,C.pm._map=this._map),this._addDrawnLayerProp(C)},_addDrawnLayerProp(C){C._drawnByGeoman=!0},_setPane(C,k){k==="layerPane"?C.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":k==="vertexPane"?C.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":k==="markerPane"&&(C.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.markerPane||"markerPane")},_isFirstLayer(){return(this._map||this._layer._map).pm.getGeomanLayers().length===0}}),fe=ds;fe.Marker=fe.extend({initialize(C){this._map=C,this._shape="Marker",this.toolbarButtonName="drawMarker",this._layerIsDragging=!1},enable(C){L.Util.setOptions(this,C),this._enabled=!0,this._isTouchDevice=!ss(),this._map.getContainer().classList.add("geoman-draw-cursor"),this._map.on("click",this._createMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._isTouchDevice?(this._createTouchHint(),this._hintMarker=L.marker(this._map.getCenter(),{...this.options.markerStyle,opacity:0,interactive:!1}),this._setPane(this._hintMarker,"markerPane"),this._hintMarker._pmTempLayer=!0):(this._hintMarker=L.marker(this._map.getCenter(),this.options.markerStyle),this._setPane(this._hintMarker,"markerPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this.options.tooltips&&this._hintMarker.bindTooltip(Wt("tooltips.placeMarker"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._map.on("mousemove",this._syncHintMarker,this)),this._layer=this._hintMarker,this.options.markerEditable&&this._map.eachLayer(k=>{this.isRelevantMarker(k)&&k.pm.enable()}),this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("click",this._createMarker,this),this._isTouchDevice?(this._removeTouchHint(),this._hintMarker=null):(this._hintMarker.remove(),this._map.off("mousemove",this._syncHintMarker,this)),this._map.eachLayer(C=>{this.isRelevantMarker(C)&&C.pm.disable()}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(C){this.enabled()?this.disable():this.enable(C)},isRelevantMarker(C){return C instanceof L.Marker&&C.pm&&!C._pmTempLayer&&!C.pm._initTextMarker},_syncHintMarker(C){if(this._hintMarker.setLatLng(C.latlng),this.options.snappable){let k=C;k.target=this._hintMarker,this._handleSnapping(k)}this._fireChange(this._hintMarker.getLatLng(),"Draw")},_createMarker(C){if(!C.latlng||this._layerIsDragging||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;this._hintMarker._snapped||this._hintMarker.setLatLng(C.latlng);let k=this._hintMarker.getLatLng(),B=new L.Marker(k,this.options.markerStyle);this._setPane(B,"markerPane"),this._finishLayer(B),B.pm||(B.options.draggable=!1),B.addTo(this._map.pm._getContainingLayer()),B.pm&&this.options.markerEditable?B.pm.enable():B.dragging&&B.dragging.disable(),this._fireCreate(B),this._cleanupSnapping(),this.options.continueDrawing||this.disable()},setStyle(){this.options.markerStyle?.icon&&this._hintMarker?.setIcon(this.options.markerStyle.icon)},_createTouchHint(){this.options.tooltips&&(this._touchHint=L.DomUtil.create("div","leaflet-pm-touch-hint"),this._touchHint.textContent=Wt("tooltips.placeMarkerTouch"),this._map.getContainer().appendChild(this._touchHint))},_removeTouchHint(){this._touchHint&&this._touchHint.parentNode&&(this._touchHint.parentNode.removeChild(this._touchHint),this._touchHint=null)}});var De=63710088e-1,La={centimeters:De*100,centimetres:De*100,degrees:360/(2*Math.PI),feet:De*3.28084,inches:De*39.37,kilometers:De/1e3,kilometres:De/1e3,meters:De,metres:De,miles:De/1609.344,millimeters:De*1e3,millimetres:De*1e3,nauticalmiles:De/1852,radians:1,yards:De*1.0936};function We(C,k,B={}){let P={type:"Feature"};return(B.id===0||B.id)&&(P.id=B.id),B.bbox&&(P.bbox=B.bbox),P.properties=k||{},P.geometry=C,P}function Gi(C,k,B={}){if(!C)throw new Error("coordinates is required");if(!Array.isArray(C))throw new Error("coordinates must be an Array");if(C.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ji(C[0])||!ji(C[1]))throw new Error("coordinates must contain numbers");return We({type:"Point",coordinates:C},k,B)}function an(C,k,B={}){if(C.length<2)throw new Error("coordinates must be an array of two or more positions");return We({type:"LineString",coordinates:C},k,B)}function Ie(C,k={}){let B={type:"FeatureCollection"};return k.id&&(B.id=k.id),k.bbox&&(B.bbox=k.bbox),B.features=C,B}function kn(C,k="kilometers"){let B=La[k];if(!B)throw new Error(k+" units is invalid");return C*B}function pi(C){return C%(2*Math.PI)*180/Math.PI}function Zi(C){return C%360*Math.PI/180}function ji(C){return!isNaN(C)&&C!==null&&!Array.isArray(C)}function ze(C){return C!==null&&typeof C=="object"&&!Array.isArray(C)}function ps(C){let k,B,P={type:"FeatureCollection",features:[]};if(C.type==="Feature"?B=C.geometry:B=C,B.type==="LineString")k=[B.coordinates];else if(B.type==="MultiLineString")k=B.coordinates;else if(B.type==="MultiPolygon")k=[].concat(...B.coordinates);else if(B.type==="Polygon")k=B.coordinates;else throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");return k.forEach(A=>{k.forEach(T=>{for(let O=0;O<A.length-1;O++)for(let R=O;R<T.length-1;R++){if(A===T&&(Math.abs(O-R)===1||O===0&&R===A.length-2&&A[O][0]===A[A.length-1][0]&&A[O][1]===A[A.length-1][1]))continue;let Z=fs(A[O][0],A[O][1],A[O+1][0],A[O+1][1],T[R][0],T[R][1],T[R+1][0],T[R+1][1]);Z&&P.features.push(Gi([Z[0],Z[1]]))}})}),P}function fs(C,k,B,P,A,T,O,R){let Z,U,Q,Y,ot,ut={x:null,y:null,onLine1:!1,onLine2:!1};return Z=(R-T)*(B-C)-(O-A)*(P-k),Z===0?ut.x!==null&&ut.y!==null?ut:!1:(U=k-T,Q=C-A,Y=(O-A)*U-(R-T)*Q,ot=(B-C)*U-(P-k)*Q,U=Y/Z,Q=ot/Z,ut.x=C+U*(B-C),ut.y=k+U*(P-k),U>=0&&U<=1&&(ut.onLine1=!0),Q>=0&&Q<=1&&(ut.onLine2=!0),ut.onLine1&&ut.onLine2?[ut.x,ut.y]:!1)}var Mn=ps;fe.Line=fe.extend({initialize(C){this._map=C,this._shape="Line",this.toolbarButtonName="drawPolyline",this._doesSelfIntersect=!1},enable(C){L.Util.setOptions(this,C),this._enabled=!0,this._markers=[],this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.polyline([],{...this.options.templineStyle,pmIgnore:!1}),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._layerGroup.addLayer(this._layer),this._hintline=L.polyline([],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._layerGroup.addLayer(this._hintline),this._hintMarker=L.marker(this._map.getCenter(),{interactive:!1,zIndexOffset:100,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Wt("tooltips.firstVertex"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._map.getContainer().classList.add("geoman-draw-cursor"),this._map.on("click",this._createVertex,this),this.options.finishOn&&this.options.finishOn!=="snap"&&this._map.on(this.options.finishOn,this._finishShape,this),this.options.finishOn==="dblclick"&&(this.tempMapDoubleClickZoomState=this._map.doubleClickZoom._enabled,this.tempMapDoubleClickZoomState&&this._map.doubleClickZoom.disable()),this._map.on("mousemove",this._syncHintMarker,this),this._hintMarker.on("move",this._syncHintLine,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[],this.isRed=!1,this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("click",this._createVertex,this),this._map.off("mousemove",this._syncHintMarker,this),this.options.finishOn&&this.options.finishOn!=="snap"&&this._map.off(this.options.finishOn,this._finishShape,this),this.tempMapDoubleClickZoomState&&this._map.doubleClickZoom.enable(),this._map.removeLayer(this._layerGroup),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(C){this.enabled()?this.disable():this.enable(C)},_syncHintLine(){let C=this._layer.getLatLngs();if(C.length>0){let k=C[C.length-1];this._hintline.setLatLngs([k,this._hintMarker.getLatLng()])}},_syncHintMarker(C){if(this._hintMarker.setLatLng(C.latlng),this.options.snappable){let B=C;B.target=this._hintMarker,this._handleSnapping(B)}else if(this._otherSnapLayers&&this._otherSnapLayers.length>0){let B=C;B.target=this._hintMarker,this._handleSnapping(B,!0)}this.options.allowSelfIntersection||this._handleSelfIntersection(!0,this._hintMarker.getLatLng());let k=this._layer._defaultShape().slice();k.push(this._hintMarker.getLatLng()),this._change(k)},hasSelfIntersection(){return Mn(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersection(C,k){let B=L.polyline(this._layer.getLatLngs());C&&(k||(k=this._hintMarker.getLatLng()),B.addLatLng(k));let P=Mn(B.toGeoJSON(15));this._doesSelfIntersect=P.features.length>0,this._doesSelfIntersect?this.isRed||(this.isRed=!0,this._hintline.setStyle({color:"#f00000ff"}),this._fireIntersect(P,this._map,"Draw")):this._hintline.isEmpty()||(this.isRed=!1,this._hintline.setStyle(this.options.hintlineStyle))},_createVertex(C){if(!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!0,C.latlng),this._doesSelfIntersect))return;this._hintMarker._snapped||this._hintMarker.setLatLng(C.latlng);let k=this._hintMarker.getLatLng(),B=this._layer.getLatLngs(),P=B[B.length-1];if(k.equals(B[0])||B.length>0&&k.equals(P)){this._finishShape();return}this._layer._latlngInfo=this._layer._latlngInfo||[],this._layer._latlngInfo.push({latlng:k,snapInfo:this._hintMarker._snapInfo}),this._layer.addLatLng(k);let A=this._createMarker(k);this._setTooltipText(),this._setHintLineAfterNewVertex(k),this._fireVertexAdded(A,void 0,k,"Draw"),this._change(this._layer.getLatLngs()),this.options.finishOn==="snap"&&this._hintMarker._snapped&&this._finishShape(C)},_setHintLineAfterNewVertex(C){this._hintline.setLatLngs([C,C])},_removeLastVertex(){let C=this._markers;if(C.length<=1){this.disable();return}let k=this._layer.getLatLngs(),B=C[C.length-1],{indexPath:P}=L.PM.Utils.findDeepMarkerIndex(C,B);C.pop(),this._layerGroup.removeLayer(B);let A=C[C.length-1],T=k.indexOf(A.getLatLng());k=k.slice(0,T+1),this._layer.setLatLngs(k),this._layer._latlngInfo.pop(),this._syncHintLine(),this._setTooltipText(),this._fireVertexRemoved(B,P,"Draw"),this._change(this._layer.getLatLngs())},_finishShape(){if(!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!1),this._doesSelfIntersect)||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;let C=this._layer.getLatLngs();if(C.length<=1)return;let k=L.polyline(C,this.options.pathOptions);this._setPane(k,"layerPane"),this._finishLayer(k),k.addTo(this._map.pm._getContainingLayer()),this._fireCreate(k),this.options.snappable&&this._cleanupSnapping();let B=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(B))},_createMarker(C){let k=new L.Marker(C,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(k,"vertexPane"),k._pmTempLayer=!0,this._layerGroup.addLayer(k),this._markers.push(k),k.on("click",this._finishShape,this),k},_setTooltipText(){let{length:C}=this._layer.getLatLngs().flat(),k="";C<=1?k=Wt("tooltips.continueLine"):k=Wt("tooltips.finishLine"),this._hintMarker.setTooltipContent(k)},_change(C){this._fireChange(C,"Draw")},setStyle(){this._layer?.setStyle(this.options.templineStyle),this._hintline?.setStyle(this.options.hintlineStyle)}}),fe.Polygon=fe.Line.extend({initialize(C){this._map=C,this._shape="Polygon",this.toolbarButtonName="drawPolygon"},enable(C){L.PM.Draw.Line.prototype.enable.call(this,C),this._layer.pm._shape="Polygon"},_createMarker(C){let k=new L.Marker(C,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(k,"vertexPane"),k._pmTempLayer=!0,this._layerGroup.addLayer(k),this._markers.push(k),this._layer.getLatLngs().flat().length===1?(k.on("click",this._finishShape,this),this._tempSnapLayerIndex=this._otherSnapLayers.push(k)-1,this.options.snappable&&this._cleanupSnapping()):k.on("click",()=>1),k},_setTooltipText(){let{length:C}=this._layer.getLatLngs().flat(),k="";C<=2?k=Wt("tooltips.continueLine"):k=Wt("tooltips.finishPoly"),this._hintMarker.setTooltipContent(k)},_finishShape(){if(!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!0,this._layer.getLatLngs()[0]),this._doesSelfIntersect)||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;let C=this._layer.getLatLngs();if(C.length<=2)return;let k=L.polygon(C,this.options.pathOptions);this._setPane(k,"layerPane"),this._finishLayer(k),k.addTo(this._map.pm._getContainingLayer()),this._fireCreate(k),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex;let B=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(B))}}),fe.Rectangle=fe.extend({initialize(C){this._map=C,this._shape="Rectangle",this.toolbarButtonName="drawRectangle"},enable(C){if(L.Util.setOptions(this,C),this._enabled=!0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.rectangle([[0,0],[0,0]],this.options.pathOptions),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._startMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon rect-start-marker"}),draggable:!1,zIndexOffset:-100,opacity:this.options.cursorMarker?1:0}),this._setPane(this._startMarker,"vertexPane"),this._startMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._startMarker),this._hintMarker=L.marker(this._map.getCenter(),{zIndexOffset:150,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Wt("tooltips.firstVertex"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this.options.cursorMarker){this._styleMarkers=[];for(let k=0;k<2;k+=1){let B=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon rect-style-marker"}),draggable:!1,zIndexOffset:100});this._setPane(B,"vertexPane"),B._pmTempLayer=!0,this._layerGroup.addLayer(B),this._styleMarkers.push(B)}}this._map.getContainer().classList.add("geoman-draw-cursor"),this._map.on("click",this._placeStartingMarkers,this),this._map.on("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[],this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("click",this._finishShape,this),this._map.off("click",this._placeStartingMarkers,this),this._map.off("mousemove",this._syncHintMarker,this),this._map.removeLayer(this._layerGroup),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(C){this.enabled()?this.disable():this.enable(C)},_placeStartingMarkers(C){this._hintMarker._snapped||this._hintMarker.setLatLng(C.latlng);let k=this._hintMarker.getLatLng();L.DomUtil.addClass(this._startMarker._icon,"visible"),this._startMarker.setLatLng(k),this.options.cursorMarker&&this._styleMarkers&&this._styleMarkers.forEach(B=>{L.DomUtil.addClass(B._icon,"visible"),B.setLatLng(k)}),this._map.off("click",this._placeStartingMarkers,this),this._map.on("click",this._finishShape,this),this._hintMarker.setTooltipContent(Wt("tooltips.finishRect")),this._setRectangleOrigin()},_setRectangleOrigin(){let C=this._startMarker.getLatLng();C&&(this._layerGroup.addLayer(this._layer),this._layer.setLatLngs([C,C]),this._hintMarker.on("move",this._syncRectangleSize,this))},_syncHintMarker(C){if(this._hintMarker.setLatLng(C.latlng),this.options.snappable){let B=C;B.target=this._hintMarker,this._handleSnapping(B)}let k=this._layerGroup&&this._layerGroup.hasLayer(this._layer)?this._layer.getLatLngs():[this._hintMarker.getLatLng()];this._fireChange(k,"Draw")},_syncRectangleSize(){let C=os(this._startMarker.getLatLng(),this._map),k=os(this._hintMarker.getLatLng(),this._map),B=L.PM.Utils._getRotatedRectangle(C,k,this.options.rectangleAngle||0,this._map);if(this._layer.setLatLngs(B),this.options.cursorMarker&&this._styleMarkers){let P=[];B.forEach(A=>{!A.equals(C,1e-8)&&!A.equals(k,1e-8)&&P.push(A)}),P.forEach((A,T)=>{try{this._styleMarkers[T].setLatLng(A)}catch{}})}},_findCorners(){let C=this._layer.getLatLngs()[0];return L.PM.Utils._getRotatedRectangle(C[0],C[2],this.options.rectangleAngle||0,this._map)},_finishShape(C){C?.latlng&&!this._hintMarker._snapped&&this._hintMarker.setLatLng(C.latlng);let k=this._hintMarker.getLatLng(),B=this._startMarker.getLatLng();if(this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer()||B.equals(k))return;let P=L.rectangle([B,k],this.options.pathOptions);if(this.options.rectangleAngle){let T=L.PM.Utils._getRotatedRectangle(B,k,this.options.rectangleAngle||0,this._map);P.setLatLngs(T),P.pm&&P.pm._setAngle(this.options.rectangleAngle||0)}this._setPane(P,"layerPane"),this._finishLayer(P),P.addTo(this._map.pm._getContainingLayer()),this._fireCreate(P);let A=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(A))},setStyle(){this._layer?.setStyle(this.options.pathOptions)}}),fe.CircleMarker=fe.extend({initialize(C){this._map=C,this._shape="CircleMarker",this.toolbarButtonName="drawCircleMarker",this._layerIsDragging=!1,this._BaseCircleClass=L.CircleMarker,this._minRadiusOption="minRadiusCircleMarker",this._maxRadiusOption="maxRadiusCircleMarker",this._editableOption="resizeableCircleMarker",this._defaultRadius=10},enable(C){if(L.Util.setOptions(this,C),this.options.editable&&(this.options.resizeableCircleMarker=this.options.editable,delete this.options.editable),this._enabled=!0,this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._map.getContainer().classList.add("geoman-draw-cursor"),this.options[this._editableOption]){let k={};L.extend(k,this.options.templineStyle),k.radius=0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=new this._BaseCircleClass(this._map.getCenter(),k),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._centerMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon"}),draggable:!1,zIndexOffset:100}),this._setPane(this._centerMarker,"vertexPane"),this._centerMarker._pmTempLayer=!0,this._hintMarker=L.marker(this._map.getCenter(),{zIndexOffset:110,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Wt("tooltips.startCircle"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._hintline=L.polyline([],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._layerGroup.addLayer(this._hintline),this._map.on("click",this._placeCenterMarker,this)}else this._map.on("click",this._createMarker,this),this._hintMarker=new this._BaseCircleClass(this._map.getCenter(),{radius:this._defaultRadius,...this.options.templineStyle}),this._setPane(this._hintMarker,"layerPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this._layer=this._hintMarker,this.options.tooltips&&this._hintMarker.bindTooltip(Wt("tooltips.placeCircleMarker"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip();this._map.on("mousemove",this._syncHintMarker,this),this._extendingEnable(),this._otherSnapLayers=[],this._fireDrawStart(),this._setGlobalDrawMode()},_extendingEnable(){!this.options[this._editableOption]&&this.options.markerEditable&&this._map.eachLayer(C=>{this.isRelevantMarker(C)&&C.pm.enable()}),this._layer.bringToBack()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this.options[this._editableOption]?(this._map.off("click",this._finishShape,this),this._map.off("click",this._placeCenterMarker,this),this._map.removeLayer(this._layerGroup)):(this._map.off("click",this._createMarker,this),this._extendingDisable(),this._hintMarker.remove()),this._map.off("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},_extendingDisable(){this._map.eachLayer(C=>{this.isRelevantMarker(C)&&C.pm.disable()})},enabled(){return this._enabled},toggle(C){this.enabled()?this.disable():this.enable(C)},_placeCenterMarker(C){this._hintMarker._snapped||this._hintMarker.setLatLng(C.latlng),this._layerGroup.addLayer(this._layer),this._layerGroup.addLayer(this._centerMarker);let k=this._hintMarker.getLatLng();this._centerMarker.setLatLng(k),this._map.off("click",this._placeCenterMarker,this),this._map.on("click",this._finishShape,this),this._placeCircleCenter()},_placeCircleCenter(){let C=this._centerMarker.getLatLng();C&&(this._layer.setLatLng(C),this._hintMarker.on("move",this._syncHintLine,this),this._hintMarker.on("move",this._syncCircleRadius,this),this._hintMarker.setTooltipContent(Wt("tooltips.finishCircle")),this._fireCenterPlaced(),this._fireChange(this._layer.getLatLng(),"Draw"))},_syncHintLine(){let C=this._centerMarker.getLatLng(),k=this._getNewDestinationOfHintMarker();this._hintline.setLatLngs([C,k])},_syncCircleRadius(){let C=this._centerMarker.getLatLng(),k=this._hintMarker.getLatLng(),B=this._distanceCalculation(C,k);this.options[this._minRadiusOption]&&B<this.options[this._minRadiusOption]?this._layer.setRadius(this.options[this._minRadiusOption]):this.options[this._maxRadiusOption]&&B>this.options[this._maxRadiusOption]?this._layer.setRadius(this.options[this._maxRadiusOption]):this._layer.setRadius(B)},_syncHintMarker(C){if(this._hintMarker.setLatLng(C.latlng),this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker()),this.options.snappable){let B=C;B.target=this._hintMarker,this._handleSnapping(B)}this._handleHintMarkerSnapping();let k=this._layerGroup&&this._layerGroup.hasLayer(this._centerMarker)?this._centerMarker.getLatLng():this._hintMarker.getLatLng();this._fireChange(k,"Draw")},isRelevantMarker(C){return C instanceof L.CircleMarker&&!(C instanceof L.Circle)&&C.pm&&!C._pmTempLayer},_createMarker(C){if(this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer()||!C.latlng||this._layerIsDragging)return;this._hintMarker._snapped||this._hintMarker.setLatLng(C.latlng);let k=this._hintMarker.getLatLng(),B=new this._BaseCircleClass(k,{radius:this._defaultRadius,...this.options.pathOptions});this._setPane(B,"layerPane"),this._finishLayer(B),B.addTo(this._map.pm._getContainingLayer()),this._extendingCreateMarker(B),this._fireCreate(B),this._cleanupSnapping(),this.options.continueDrawing||this.disable()},_extendingCreateMarker(C){C.pm&&this.options.markerEditable&&C.pm.enable()},_finishShape(C){if(this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;C?.latlng&&!this._hintMarker._snapped&&this._hintMarker.setLatLng(C.latlng);let k=this._centerMarker.getLatLng(),B=this._defaultRadius;if(this.options[this._editableOption]){let O=this._hintMarker.getLatLng();B=this._distanceCalculation(k,O),this.options[this._minRadiusOption]&&B<this.options[this._minRadiusOption]?B=this.options[this._minRadiusOption]:this.options[this._maxRadiusOption]&&B>this.options[this._maxRadiusOption]&&(B=this.options[this._maxRadiusOption])}let P={...this.options.pathOptions,radius:B},A=new this._BaseCircleClass(k,P);this._setPane(A,"layerPane"),this._finishLayer(A),A.addTo(this._map.pm._getContainingLayer()),A.pm&&A.pm._updateHiddenPolyCircle(),this._fireCreate(A);let T=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(T))},_getNewDestinationOfHintMarker(){let C=this._hintMarker.getLatLng();if(this.options[this._editableOption]){if(!this._layerGroup.hasLayer(this._centerMarker))return C;let k=this._centerMarker.getLatLng(),B=this._distanceCalculation(k,C);this.options[this._minRadiusOption]&&B<this.options[this._minRadiusOption]?C=zi(this._map,k,C,this._getMinDistanceInMeter()):this.options[this._maxRadiusOption]&&B>this.options[this._maxRadiusOption]&&(C=zi(this._map,k,C,this._getMaxDistanceInMeter()))}return C},_getMinDistanceInMeter(){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._minRadiusOption],this._map,this._centerMarker.getLatLng())},_getMaxDistanceInMeter(){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._maxRadiusOption],this._map,this._centerMarker.getLatLng())},_handleHintMarkerSnapping(){if(this.options[this._editableOption]){if(this._hintMarker._snapped){let C=this._centerMarker.getLatLng(),k=this._hintMarker.getLatLng(),B=this._distanceCalculation(C,k);this._layerGroup.hasLayer(this._centerMarker)&&(this.options[this._minRadiusOption]&&B<this.options[this._minRadiusOption]?this._hintMarker.setLatLng(this._hintMarker._orgLatLng):this.options[this._maxRadiusOption]&&B>this.options[this._maxRadiusOption]&&this._hintMarker.setLatLng(this._hintMarker._orgLatLng))}this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker())}},setStyle(){let C={};L.extend(C,this.options.templineStyle),this.options[this._editableOption]&&(C.radius=0),this._layer?.setStyle(C),this._hintline?.setStyle(this.options.hintlineStyle)},_distanceCalculation(C,k){return this._map.project(C).distanceTo(this._map.project(k))}}),fe.Circle=fe.CircleMarker.extend({initialize(C){this._map=C,this._shape="Circle",this.toolbarButtonName="drawCircle",this._BaseCircleClass=L.Circle,this._minRadiusOption="minRadiusCircle",this._maxRadiusOption="maxRadiusCircle",this._editableOption="resizeableCircle",this._defaultRadius=100},_extendingEnable(){},_extendingDisable(){},_extendingCreateMarker(){},isRelevantMarker(){},_getMinDistanceInMeter(){return this.options[this._minRadiusOption]},_getMaxDistanceInMeter(){return this.options[this._maxRadiusOption]},_distanceCalculation(C,k){return this._map.distance(C,k)}});var wn=class{constructor(C=[],k=cr){if(this.data=C,this.length=this.data.length,this.compare=k,this.length>0)for(let B=(this.length>>1)-1;B>=0;B--)this._down(B)}push(C){this.data.push(C),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let C=this.data[0],k=this.data.pop();return this.length--,this.length>0&&(this.data[0]=k,this._down(0)),C}peek(){return this.data[0]}_up(C){let{data:k,compare:B}=this,P=k[C];for(;C>0;){let A=C-1>>1,T=k[A];if(B(P,T)>=0)break;k[C]=T,C=A}k[C]=P}_down(C){let{data:k,compare:B}=this,P=this.length>>1,A=k[C];for(;C<P;){let T=(C<<1)+1,O=k[T],R=T+1;if(R<this.length&&B(k[R],O)<0&&(T=R,O=k[R]),B(O,A)>=0)break;k[C]=O,C=T}k[C]=A}};function cr(C,k){return C<k?-1:C>k?1:0}function _s(C,k){return C.p.x>k.p.x?1:C.p.x<k.p.x?-1:C.p.y!==k.p.y?C.p.y>k.p.y?1:-1:1}function ba(C,k){return C.rightSweepEvent.p.x>k.rightSweepEvent.p.x?1:C.rightSweepEvent.p.x<k.rightSweepEvent.p.x?-1:C.rightSweepEvent.p.y!==k.rightSweepEvent.p.y?C.rightSweepEvent.p.y<k.rightSweepEvent.p.y?1:-1:1}var dr=class{constructor(C,k,B,P){this.p={x:C[0],y:C[1]},this.featureId=k,this.ringId=B,this.eventId=P,this.otherEvent=null,this.isLeftEndpoint=null}isSamePoint(C){return this.p.x===C.p.x&&this.p.y===C.p.y}};function Ca(C,k){if(C.type==="FeatureCollection"){let B=C.features;for(let P=0;P<B.length;P++)Ye(B[P],k)}else Ye(C,k)}var Be=0,si=0,En=0;function Ye(C,k){let B=C.type==="Feature"?C.geometry:C,P=B.coordinates;(B.type==="Polygon"||B.type==="MultiLineString")&&(P=[P]),B.type==="LineString"&&(P=[[P]]);for(let A=0;A<P.length;A++)for(let T=0;T<P[A].length;T++){let O=P[A][T][0],R=null;si=si+1;for(let Z=0;Z<P[A][T].length-1;Z++){R=P[A][T][Z+1];let U=new dr(O,Be,si,En),Q=new dr(R,Be,si,En+1);U.otherEvent=Q,Q.otherEvent=U,_s(U,Q)>0?(Q.isLeftEndpoint=!0,U.isLeftEndpoint=!1):(U.isLeftEndpoint=!0,Q.isLeftEndpoint=!1),k.push(U),k.push(Q),O=R,En=En+1}}Be=Be+1}var xa=class{constructor(C){this.leftSweepEvent=C,this.rightSweepEvent=C.otherEvent}};function Ui(C,k){if(C===null||k===null||C.leftSweepEvent.ringId===k.leftSweepEvent.ringId&&(C.rightSweepEvent.isSamePoint(k.leftSweepEvent)||C.rightSweepEvent.isSamePoint(k.leftSweepEvent)||C.rightSweepEvent.isSamePoint(k.rightSweepEvent)||C.leftSweepEvent.isSamePoint(k.leftSweepEvent)||C.leftSweepEvent.isSamePoint(k.rightSweepEvent)))return!1;let B=C.leftSweepEvent.p.x,P=C.leftSweepEvent.p.y,A=C.rightSweepEvent.p.x,T=C.rightSweepEvent.p.y,O=k.leftSweepEvent.p.x,R=k.leftSweepEvent.p.y,Z=k.rightSweepEvent.p.x,U=k.rightSweepEvent.p.y,Q=(U-R)*(A-B)-(Z-O)*(T-P),Y=(Z-O)*(P-R)-(U-R)*(B-O),ot=(A-B)*(P-R)-(T-P)*(B-O);if(Q===0)return!1;let ut=Y/Q,vt=ot/Q;if(ut>=0&&ut<=1&&vt>=0&&vt<=1){let xt=B+ut*(A-B),Pt=P+ut*(T-P);return[xt,Pt]}return!1}function ka(C,k){k=k||!1;let B=[],P=new wn([],ba);for(;C.length;){let A=C.pop();if(A.isLeftEndpoint){let T=new xa(A);for(let O=0;O<P.data.length;O++){let R=P.data[O];if(k&&R.leftSweepEvent.featureId===A.featureId)continue;let Z=Ui(T,R);Z!==!1&&B.push(Z)}P.push(T)}else A.isLeftEndpoint===!1&&P.pop()}return B}function on(C,k){let B=new wn([],_s);return Ca(C,B),ka(B,k)}var ms=on,Bn=ms;function gs(C,k,B={}){let{removeDuplicates:P=!0,ignoreSelfIntersections:A=!0}=B,T=[];C.type==="FeatureCollection"?T=T.concat(C.features):C.type==="Feature"?T.push(C):(C.type==="LineString"||C.type==="Polygon"||C.type==="MultiLineString"||C.type==="MultiPolygon")&&T.push(We(C)),k.type==="FeatureCollection"?T=T.concat(k.features):k.type==="Feature"?T.push(k):(k.type==="LineString"||k.type==="Polygon"||k.type==="MultiLineString"||k.type==="MultiPolygon")&&T.push(We(k));let O=Bn(Ie(T),A),R=[];if(P){let Z={};O.forEach(U=>{let Q=U.join(",");Z[Q]||(Z[Q]=!0,R.push(U))})}else R=O;return Ie(R.map(Z=>Gi(Z)))}var Ne=gs,Pn=et(Yt(),1);function pr(C,k,B){if(C!==null)for(var P,A,T,O,R,Z,U,Q=0,Y=0,ot,ut=C.type,vt=ut==="FeatureCollection",xt=ut==="Feature",Pt=vt?C.features.length:1,At=0;At<Pt;At++){U=vt?C.features[At].geometry:xt?C.geometry:C,ot=U?U.type==="GeometryCollection":!1,R=ot?U.geometries.length:1;for(var J=0;J<R;J++){var ht=0,yt=0;if(O=ot?U.geometries[J]:U,O!==null){Z=O.coordinates;var Bt=O.type;switch(Q=0,Bt){case null:break;case"Point":if(k(Z,Y,At,ht,yt)===!1)return!1;Y++,ht++;break;case"LineString":case"MultiPoint":for(P=0;P<Z.length;P++){if(k(Z[P],Y,At,ht,yt)===!1)return!1;Y++,Bt==="MultiPoint"&&ht++}Bt==="LineString"&&ht++;break;case"Polygon":case"MultiLineString":for(P=0;P<Z.length;P++){for(A=0;A<Z[P].length-Q;A++){if(k(Z[P][A],Y,At,ht,yt)===!1)return!1;Y++}Bt==="MultiLineString"&&ht++,Bt==="Polygon"&&yt++}Bt==="Polygon"&&ht++;break;case"MultiPolygon":for(P=0;P<Z.length;P++){for(yt=0,A=0;A<Z[P].length;A++){for(T=0;T<Z[P][A].length-Q;T++){if(k(Z[P][A][T],Y,At,ht,yt)===!1)return!1;Y++}yt++}ht++}break;case"GeometryCollection":for(P=0;P<O.geometries.length;P++)if(pr(O.geometries[P],k)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Hi(C,k){if(C.type==="Feature")k(C,0);else if(C.type==="FeatureCollection")for(var B=0;B<C.features.length&&k(C.features[B],B)!==!1;B++);}function Ma(C,k,B){var P=B;return Hi(C,function(A,T){T===0&&B===void 0?P=A:P=k(P,A,T)}),P}function ai(C,k){var B,P,A,T,O,R,Z,U,Q,Y,ot=0,ut=C.type==="FeatureCollection",vt=C.type==="Feature",xt=ut?C.features.length:1;for(B=0;B<xt;B++){for(R=ut?C.features[B].geometry:vt?C.geometry:C,U=ut?C.features[B].properties:vt?C.properties:{},Q=ut?C.features[B].bbox:vt?C.bbox:void 0,Y=ut?C.features[B].id:vt?C.id:void 0,Z=R?R.type==="GeometryCollection":!1,O=Z?R.geometries.length:1,A=0;A<O;A++){if(T=Z?R.geometries[A]:R,T===null){if(k(null,ot,U,Q,Y)===!1)return!1;continue}switch(T.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(k(T,ot,U,Q,Y)===!1)return!1;break}case"GeometryCollection":{for(P=0;P<T.geometries.length;P++)if(k(T.geometries[P],ot,U,Q,Y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}ot++}}function fr(C,k){ai(C,function(B,P,A,T,O){var R=B===null?null:B.type;switch(R){case null:case"Point":case"LineString":case"Polygon":return k(We(B,A,{bbox:T,id:O}),P,0)===!1?!1:void 0}var Z;switch(R){case"MultiPoint":Z="Point";break;case"MultiLineString":Z="LineString";break;case"MultiPolygon":Z="Polygon";break}for(var U=0;U<B.coordinates.length;U++){var Q=B.coordinates[U],Y={type:Z,coordinates:Q};if(k(We(Y,A),P,U)===!1)return!1}})}function Le(C,k={}){if(C.bbox!=null&&k.recompute!==!0)return C.bbox;let B=[1/0,1/0,-1/0,-1/0];return pr(C,P=>{B[0]>P[0]&&(B[0]=P[0]),B[1]>P[1]&&(B[1]=P[1]),B[2]<P[0]&&(B[2]=P[0]),B[3]<P[1]&&(B[3]=P[1])}),B}function _r(C){var k;if(C.bbox)k=C.bbox;else if(Array.isArray(C)&&C.length===4)k=C;else if(Array.isArray(C)&&C.length===6)k=[C[0],C[1],C[3],C[4]];else if(C.type==="Feature")k=Le(C);else if(C.type==="FeatureCollection")k=Le(C);else throw new Error("invalid geojson");return{minX:k[0],minY:k[1],maxX:k[2],maxY:k[3]}}var oi=class{constructor(C=9){this.tree=new Pn.default(C),this.tree.toBBox=_r}insert(C){if(C.type!=="Feature")throw new Error("invalid feature");return C.bbox=C.bbox?C.bbox:Le(C),this.tree.insert(C),this}load(C){var k=[];return Array.isArray(C)?C.forEach(function(B){if(B.type!=="Feature")throw new Error("invalid features");B.bbox=B.bbox?B.bbox:Le(B),k.push(B)}):Hi(C,function(B){if(B.type!=="Feature")throw new Error("invalid features");B.bbox=B.bbox?B.bbox:Le(B),k.push(B)}),this.tree.load(k),this}remove(C,k){if(C.type!=="Feature")throw new Error("invalid feature");return C.bbox=C.bbox?C.bbox:Le(C),this.tree.remove(C,k),this}clear(){return this.tree.clear(),this}search(C){var k=this.tree.search(_r(C));return Ie(k)}collides(C){return this.tree.collides(_r(C))}all(){let C=this.tree.all();return Ie(C)}toJSON(){return this.tree.toJSON()}fromJSON(C){return this.tree.fromJSON(C),this}};function un(C){return new oi(C)}function ys(C,k){if(k=k??{},!ze(k))throw new Error("options is invalid");var B=k.precision,P=k.coordinates,A=k.mutate;if(B=B==null||isNaN(B)?6:B,P=P==null||isNaN(P)?3:P,!C)throw new Error("<geojson> is required");if(typeof B!="number")throw new Error("<precision> must be a number");if(typeof P!="number")throw new Error("<coordinates> must be a number");(A===!1||A===void 0)&&(C=JSON.parse(JSON.stringify(C)));var T=Math.pow(10,B);return pr(C,function(O){mr(O,T,P)}),C}function mr(C,k,B){C.length>B&&C.splice(B,C.length);for(var P=0;P<C.length;P++)C[P]=Math.round(C[P]*k)/k;return C}function Oe(C){if(!C)throw new Error("coord is required");if(!Array.isArray(C)){if(C.type==="Feature"&&C.geometry!==null&&C.geometry.type==="Point")return[...C.geometry.coordinates];if(C.type==="Point")return[...C.coordinates]}if(Array.isArray(C)&&C.length>=2&&!Array.isArray(C[0])&&!Array.isArray(C[1]))return[...C];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function ui(C){if(Array.isArray(C))return C;if(C.type==="Feature"){if(C.geometry!==null)return C.geometry.coordinates}else if(C.coordinates)return C.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function ki(C){return C.type==="Feature"?C.geometry:C}function Mi(C,k){return C.type==="FeatureCollection"?"FeatureCollection":C.type==="GeometryCollection"?"GeometryCollection":C.type==="Feature"&&C.geometry!==null?C.geometry.type:C.type}function Sn(C){if(!C)throw new Error("geojson is required");let k=[];return fr(C,B=>{gr(B,k)}),Ie(k)}function gr(C,k){let B=[],P=C.geometry;if(P!==null){switch(P.type){case"Polygon":B=ui(P);break;case"LineString":B=[ui(P)]}B.forEach(A=>{vs(A,C.properties).forEach(T=>{T.id=k.length,k.push(T)})})}}function vs(C,k){let B=[];return C.reduce((P,A)=>{let T=an([P,A],k);return T.bbox=wa(P,A),B.push(T),A}),B}function wa(C,k){let B=C[0],P=C[1],A=k[0],T=k[1],O=B<A?B:A,R=P<T?P:T,Z=B>A?B:A,U=P>T?P:T;return[O,R,Z,U]}function Vi(C,k,B={}){var P=Oe(C),A=Oe(k),T=Zi(A[1]-P[1]),O=Zi(A[0]-P[0]),R=Zi(P[1]),Z=Zi(A[1]),U=Math.pow(Math.sin(T/2),2)+Math.pow(Math.sin(O/2),2)*Math.cos(R)*Math.cos(Z);return kn(2*Math.atan2(Math.sqrt(U),Math.sqrt(1-U)),B.units)}var Ea=Object.defineProperty,Ls=Object.defineProperties,Ba=Object.getOwnPropertyDescriptors,yr=Object.getOwnPropertySymbols,Pa=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,ln=(C,k,B)=>k in C?Ea(C,k,{enumerable:!0,configurable:!0,writable:!0,value:B}):C[k]=B,Sa=(C,k)=>{for(var B in k||(k={}))Pa.call(k,B)&&ln(C,B,k[B]);if(yr)for(var B of yr(k))$e.call(k,B)&&ln(C,B,k[B]);return C},An=(C,k)=>Ls(C,Ba(k));function Aa(C,k,B={}){if(!C||!k)throw new Error("lines and inputPoint are required arguments");let P=Oe(k),A=Gi([1/0,1/0],{lineStringIndex:-1,segmentIndex:-1,totalDistance:-1,lineDistance:-1,segmentDistance:-1,pointDistance:1/0,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),T=0,O=0,R=-1;return fr(C,function(Z,U,Q){R!==Q&&(R=Q,O=0);let Y=ui(Z),ot=Y.length-2;for(let ut=0;ut<Y.length-1;ut++){let vt=Gi(Y[ut]),xt=Oe(vt),Pt=Gi(Y[ut+1]),At=Oe(Pt),J=Vi(vt,Pt,B),ht,yt;At[0]===P[0]&&At[1]===P[1]?[ht,yt]=[At,!0]:xt[0]===P[0]&&xt[1]===P[1]?[ht,yt]=[xt,!1]:[ht,yt]=xs(xt,At,P);let Bt=Vi(k,ht,B);if(Bt<A.properties.pointDistance){let wt=Vi(vt,ht,B);A=Gi(ht,{lineStringIndex:Q,segmentIndex:yt&&ut+1<=ot?ut+1:ut,totalDistance:T+wt,lineDistance:O+wt,segmentDistance:wt,pointDistance:Bt,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),A.properties=An(Sa({},A.properties),{multiFeatureIndex:A.properties.lineStringIndex,index:A.properties.segmentIndex,location:A.properties.totalDistance,dist:A.properties.pointDistance})}T+=J,O+=J}}),A}function fi(C,k){let[B,P,A]=C,[T,O,R]=k;return B*T+P*O+A*R}function hn(C,k){let[B,P,A]=C,[T,O,R]=k;return[P*R-A*O,A*T-B*R,B*O-P*T]}function cn(C){return Math.sqrt(Math.pow(C[0],2)+Math.pow(C[1],2)+Math.pow(C[2],2))}function bs(C){let k=cn(C);return[C[0]/k,C[1]/k,C[2]/k]}function _i(C){let k=Zi(C[1]),B=Zi(C[0]);return[Math.cos(k)*Math.cos(B),Math.cos(k)*Math.sin(B),Math.sin(k)]}function Cs(C){let[k,B,P]=C,A=Math.min(Math.max(P,-1),1),T=pi(Math.asin(A));return[pi(Math.atan2(B,k)),T]}function xs(C,k,B){let P=_i(C),A=_i(k),T=_i(B),O=hn(P,A);if(O[0]===0&&O[1]===0&&O[2]===0)return fi(P,A)>0?[[...k],!0]:[[...B],!1];let R=hn(O,T);if(R[0]===0&&R[1]===0&&R[2]===0)return[[...k],!0];let Z=hn(R,O),U=bs(Z),Q=[-U[0],-U[1],-U[2]],Y=fi(T,U)>fi(T,Q)?U:Q,ot=bs(O),ut=fi(hn(P,Y),ot),vt=fi(hn(Y,A),ot);return ut>=0&&vt>=0?[Cs(Y),!1]:fi(P,T)>fi(A,T)?[[...C],!1]:[[...k],!0]}function ks(C,k){if(!C)throw new Error("line is required");if(!k)throw new Error("splitter is required");let B=Mi(C),P=Mi(k);if(B!=="LineString")throw new Error("line must be LineString");if(P==="FeatureCollection")throw new Error("splitter cannot be a FeatureCollection");if(P==="GeometryCollection")throw new Error("splitter cannot be a GeometryCollection");var A=ys(k,{precision:7});switch(C.type!=="Feature"&&(C=We(C)),P){case"Point":return Tn(C,A);case"MultiPoint":return Xe(C,A);case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return Xe(C,gs(C,A,{ignoreSelfIntersections:!0}))}}function Xe(C,k){var B=[],P=un();return fr(k,function(A){if(B.forEach(function(R,Z){R.id=Z}),!B.length)B=Tn(C,A).features,P.load(Ie(B));else{var T=P.search(A);if(T.features.length){var O=vr(A,T);B=B.filter(function(R){return R.id!==O.id}),P.remove(O),Hi(Tn(O,A),function(R){B.push(R),P.insert(R)})}}}),Ie(B)}function Tn(C,k){var B=[],P=ui(C)[0],A=ui(C)[C.geometry.coordinates.length-1];if(wi(P,Oe(k))||wi(A,Oe(k)))return Ie([C]);var T=un(),O=Sn(C);T.load(O);var R=T.search(k);if(!R.features.length)return Ie([C]);var Z=vr(k,R),U=[P],Q=Ma(O,function(Y,ot,ut){var vt=ui(ot)[1],xt=Oe(k);return ut===Z.id?(Y.push(xt),B.push(an(Y)),wi(xt,vt)?[xt]:[xt,vt]):(Y.push(vt),Y)},U);return Q.length>1&&B.push(an(Q)),Ie(B)}function vr(C,k){if(!k.features.length)throw new Error("lines must contain features");if(k.features.length===1)return k.features[0];var B,P=1/0;return Hi(k,function(A){var T=Aa(A,C),O=T.properties.dist;O<P&&(B=A,P=O)}),B}function wi(C,k){return C[0]===k[0]&&C[1]===k[1]}var Ta=ks,Ge=11102230246251565e-32,ce=134217729,Ms=(3+8*Ge)*Ge;function Dn(C,k,B,P,A){let T,O,R,Z,U=k[0],Q=P[0],Y=0,ot=0;Q>U==Q>-U?(T=U,U=k[++Y]):(T=Q,Q=P[++ot]);let ut=0;if(Y<C&&ot<B)for(Q>U==Q>-U?(O=U+T,R=T-(O-U),U=k[++Y]):(O=Q+T,R=T-(O-Q),Q=P[++ot]),T=O,R!==0&&(A[ut++]=R);Y<C&&ot<B;)Q>U==Q>-U?(O=T+U,Z=O-T,R=T-(O-Z)+(U-Z),U=k[++Y]):(O=T+Q,Z=O-T,R=T-(O-Z)+(Q-Z),Q=P[++ot]),T=O,R!==0&&(A[ut++]=R);for(;Y<C;)O=T+U,Z=O-T,R=T-(O-Z)+(U-Z),U=k[++Y],T=O,R!==0&&(A[ut++]=R);for(;ot<B;)O=T+Q,Z=O-T,R=T-(O-Z)+(Q-Z),Q=P[++ot],T=O,R!==0&&(A[ut++]=R);return(T!==0||ut===0)&&(A[ut++]=T),ut}function Da(C,k){let B=k[0];for(let P=1;P<C;P++)B+=k[P];return B}function qi(C){return new Float64Array(C)}var ws=(3+16*Ge)*Ge,Es=(2+12*Ge)*Ge,Bs=(9+64*Ge)*Ge*Ge,Ei=qi(4),Ps=qi(8),Lr=qi(12),br=qi(16),be=qi(4);function _(C,k,B,P,A,T,O){let R,Z,U,Q,Y,ot,ut,vt,xt,Pt,At,J,ht,yt,Bt,wt,Et,q,K=C-A,$=B-A,st=k-T,rt=P-T;yt=K*rt,ot=ce*K,ut=ot-(ot-K),vt=K-ut,ot=ce*rt,xt=ot-(ot-rt),Pt=rt-xt,Bt=vt*Pt-(yt-ut*xt-vt*xt-ut*Pt),wt=st*$,ot=ce*st,ut=ot-(ot-st),vt=st-ut,ot=ce*$,xt=ot-(ot-$),Pt=$-xt,Et=vt*Pt-(wt-ut*xt-vt*xt-ut*Pt),At=Bt-Et,Y=Bt-At,Ei[0]=Bt-(At+Y)+(Y-Et),J=yt+At,Y=J-yt,ht=yt-(J-Y)+(At-Y),At=ht-wt,Y=ht-At,Ei[1]=ht-(At+Y)+(Y-wt),q=J+At,Y=q-J,Ei[2]=J-(q-Y)+(At-Y),Ei[3]=q;let it=Da(4,Ei),ct=Es*O;if(it>=ct||-it>=ct||(Y=C-K,R=C-(K+Y)+(Y-A),Y=B-$,U=B-($+Y)+(Y-A),Y=k-st,Z=k-(st+Y)+(Y-T),Y=P-rt,Q=P-(rt+Y)+(Y-T),R===0&&Z===0&&U===0&&Q===0)||(ct=Bs*O+Ms*Math.abs(it),it+=K*Q+rt*R-(st*U+$*Z),it>=ct||-it>=ct))return it;yt=R*rt,ot=ce*R,ut=ot-(ot-R),vt=R-ut,ot=ce*rt,xt=ot-(ot-rt),Pt=rt-xt,Bt=vt*Pt-(yt-ut*xt-vt*xt-ut*Pt),wt=Z*$,ot=ce*Z,ut=ot-(ot-Z),vt=Z-ut,ot=ce*$,xt=ot-(ot-$),Pt=$-xt,Et=vt*Pt-(wt-ut*xt-vt*xt-ut*Pt),At=Bt-Et,Y=Bt-At,be[0]=Bt-(At+Y)+(Y-Et),J=yt+At,Y=J-yt,ht=yt-(J-Y)+(At-Y),At=ht-wt,Y=ht-At,be[1]=ht-(At+Y)+(Y-wt),q=J+At,Y=q-J,be[2]=J-(q-Y)+(At-Y),be[3]=q;let at=Dn(4,Ei,4,be,Ps);yt=K*Q,ot=ce*K,ut=ot-(ot-K),vt=K-ut,ot=ce*Q,xt=ot-(ot-Q),Pt=Q-xt,Bt=vt*Pt-(yt-ut*xt-vt*xt-ut*Pt),wt=st*U,ot=ce*st,ut=ot-(ot-st),vt=st-ut,ot=ce*U,xt=ot-(ot-U),Pt=U-xt,Et=vt*Pt-(wt-ut*xt-vt*xt-ut*Pt),At=Bt-Et,Y=Bt-At,be[0]=Bt-(At+Y)+(Y-Et),J=yt+At,Y=J-yt,ht=yt-(J-Y)+(At-Y),At=ht-wt,Y=ht-At,be[1]=ht-(At+Y)+(Y-wt),q=J+At,Y=q-J,be[2]=J-(q-Y)+(At-Y),be[3]=q;let lt=Dn(at,Ps,4,be,Lr);yt=R*Q,ot=ce*R,ut=ot-(ot-R),vt=R-ut,ot=ce*Q,xt=ot-(ot-Q),Pt=Q-xt,Bt=vt*Pt-(yt-ut*xt-vt*xt-ut*Pt),wt=Z*U,ot=ce*Z,ut=ot-(ot-Z),vt=Z-ut,ot=ce*U,xt=ot-(ot-U),Pt=U-xt,Et=vt*Pt-(wt-ut*xt-vt*xt-ut*Pt),At=Bt-Et,Y=Bt-At,be[0]=Bt-(At+Y)+(Y-Et),J=yt+At,Y=J-yt,ht=yt-(J-Y)+(At-Y),At=ht-wt,Y=ht-At,be[1]=ht-(At+Y)+(Y-wt),q=J+At,Y=q-J,be[2]=J-(q-Y)+(At-Y),be[3]=q;let mt=Dn(lt,Lr,4,be,br);return br[mt-1]}function M(C,k,B,P,A,T){let O=(k-T)*(B-A),R=(C-A)*(P-T),Z=O-R,U=Math.abs(O+R);return Math.abs(Z)>=ws*U?Z:-_(C,k,B,P,A,T,U)}function S(C,k){var B,P,A=0,T,O,R,Z,U,Q,Y,ot=C[0],ut=C[1],vt=k.length;for(B=0;B<vt;B++){P=0;var xt=k[B],Pt=xt.length-1;if(Q=xt[0],Q[0]!==xt[Pt][0]&&Q[1]!==xt[Pt][1])throw new Error("First and last coordinates in a ring must be the same");for(O=Q[0]-ot,R=Q[1]-ut,P;P<Pt;P++){if(Y=xt[P+1],Z=Y[0]-ot,U=Y[1]-ut,R===0&&U===0){if(Z<=0&&O>=0||O<=0&&Z>=0)return 0}else if(U>=0&&R<=0||U<=0&&R>=0){if(T=M(O,Z,R,U,0,0),T===0)return 0;(T>0&&U>0&&R<=0||T<0&&U<=0&&R>0)&&A++}Q=Y,R=U,O=Z}}return A%2!==0}function D(C,k,B={}){if(!C)throw new Error("point is required");if(!k)throw new Error("polygon is required");let P=Oe(C),A=ki(k),T=A.type,O=k.bbox,R=A.coordinates;if(O&&z(P,O)===!1)return!1;T==="Polygon"&&(R=[R]);let Z=!1;for(var U=0;U<R.length;++U){let Q=S(P,R[U]);if(Q===0)return!B.ignoreBoundary;Q&&(Z=!0)}return Z}function z(C,k){return k[0]<=C[0]&&k[1]<=C[1]&&k[2]>=C[0]&&k[3]>=C[1]}function V(C,k,B={}){let P=Oe(C),A=ui(k);for(let T=0;T<A.length-1;T++){let O=!1;if(B.ignoreEndVertices&&(T===0&&(O="start"),T===A.length-2&&(O="end"),T===0&&T+1===A.length-1&&(O="both")),nt(A[T],A[T+1],P,O,typeof B.epsilon>"u"?null:B.epsilon))return!0}return!1}function nt(C,k,B,P,A){let T=B[0],O=B[1],R=C[0],Z=C[1],U=k[0],Q=k[1],Y=B[0]-R,ot=B[1]-Z,ut=U-R,vt=Q-Z,xt=Y*vt-ot*ut;if(A!==null){if(Math.abs(xt)>A)return!1}else if(xt!==0)return!1;if(Math.abs(ut)===Math.abs(vt)&&Math.abs(ut)===0)return P?!1:B[0]===C[0]&&B[1]===C[1];if(P){if(P==="start")return Math.abs(ut)>=Math.abs(vt)?ut>0?R<T&&T<=U:U<=T&&T<R:vt>0?Z<O&&O<=Q:Q<=O&&O<Z;if(P==="end")return Math.abs(ut)>=Math.abs(vt)?ut>0?R<=T&&T<U:U<T&&T<=R:vt>0?Z<=O&&O<Q:Q<O&&O<=Z;if(P==="both")return Math.abs(ut)>=Math.abs(vt)?ut>0?R<T&&T<U:U<T&&T<R:vt>0?Z<O&&O<Q:Q<O&&O<Z}else return Math.abs(ut)>=Math.abs(vt)?ut>0?R<=T&&T<=U:U<=T&&T<=R:vt>0?Z<=O&&O<=Q:Q<=O&&O<=Z;return!1}function dt(C,k){let B=ki(C),P=ki(k),A=B.type,T=P.type,O=B.coordinates,R=P.coordinates;switch(A){case"Point":if(T==="Point")return Cr(O,R);throw new Error("feature2 "+T+" geometry not supported");case"MultiPoint":switch(T){case"Point":return Tt(B,P);case"MultiPoint":return It(B,P);default:throw new Error("feature2 "+T+" geometry not supported")}case"LineString":switch(T){case"Point":return V(P,B,{ignoreEndVertices:!0});case"LineString":return _e(B,P);case"MultiPoint":return Vt(B,P);default:throw new Error("feature2 "+T+" geometry not supported")}case"Polygon":switch(T){case"Point":return D(P,B,{ignoreBoundary:!0});case"LineString":return Pe(B,P);case"Polygon":return mi(B,P);case"MultiPoint":return Ce(B,P);case"MultiPolygon":return Mt(B,P);default:throw new Error("feature2 "+T+" geometry not supported")}case"MultiPolygon":if(T==="Polygon")return gt(B,P);throw new Error("feature2 "+T+" geometry not supported");default:throw new Error("feature1 "+A+" geometry not supported")}}function gt(C,k){return C.coordinates.some(B=>mi({type:"Polygon",coordinates:B},k))}function Mt(C,k){return k.coordinates.every(B=>mi(C,{type:"Polygon",coordinates:B}))}function Tt(C,k){let B,P=!1;for(B=0;B<C.coordinates.length;B++)if(Cr(C.coordinates[B],k.coordinates)){P=!0;break}return P}function It(C,k){for(let B of k.coordinates){let P=!1;for(let A of C.coordinates)if(Cr(B,A)){P=!0;break}if(!P)return!1}return!0}function Vt(C,k){let B=!1;for(let P of k.coordinates)if(V(P,C,{ignoreEndVertices:!0})&&(B=!0),!V(P,C))return!1;return!!B}function Ce(C,k){for(let B of k.coordinates)if(!D(B,C,{ignoreBoundary:!0}))return!1;return!0}function _e(C,k){let B=!1;for(let P of k.coordinates)if(V({type:"Point",coordinates:P},C,{ignoreEndVertices:!0})&&(B=!0),!V({type:"Point",coordinates:P},C,{ignoreEndVertices:!1}))return!1;return B}function Ze(C,k){let B=C.coordinates,P=[];for(let A=0;A<B.length-1;A++){let T=an([B[A],B[A+1]]),O=ks(T,We(k));O.features.length===0?P.push(T):P.push(...O.features)}return Ie(P)}function Pe(C,k){let B=Le(C),P=Le(k);if(!Ss(B,P))return!1;for(let O of k.coordinates)if(!D(O,C))return!1;let A=!1,T=Ze(k,C);for(let O of T.features){let R=Oa(O.geometry.coordinates[0],O.geometry.coordinates[1]);if(!D(R,C))return!1;!A&&D(R,C,{ignoreBoundary:!0})&&(A=!0)}return A}function mi(C,k){if(C.type==="Feature"&&C.geometry===null||k.type==="Feature"&&k.geometry===null)return!1;let B=Le(C),P=Le(k);if(!Ss(B,P))return!1;let A=ki(k).coordinates;for(let T of A)for(let O of T)if(!D(O,C))return!1;return!0}function Ss(C,k){return!(C[0]>k[0]||C[2]<k[2]||C[1]>k[1]||C[3]<k[3])}function Cr(C,k){return C[0]===k[0]&&C[1]===k[1]}function Oa(C,k){return[(C[0]+k[0])/2,(C[1]+k[1])/2]}var As=dt,Fa=et(hi()),Ts=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,se=Math.ceil,xe=Math.floor,Se="[BigNumber Error] ",Ds=Se+"Number primitive has more than 15 significant digits: ",He=1e14,Nt=14,On=9007199254740991,xr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ki=1e7,ye=1e9;function Ua(C){var k,B,P,A=J.prototype={constructor:J,toString:null,valueOf:null},T=new J(1),O=20,R=4,Z=-7,U=21,Q=-1e7,Y=1e7,ot=!1,ut=1,vt=0,xt={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},Pt="0123456789abcdefghijklmnopqrstuvwxyz",At=!0;function J(q,K){var $,st,rt,it,ct,at,lt,mt,_t=this;if(!(_t instanceof J))return new J(q,K);if(K==null){if(q&&q._isBigNumber===!0){_t.s=q.s,!q.c||q.e>Y?_t.c=_t.e=null:q.e<Q?_t.c=[_t.e=0]:(_t.e=q.e,_t.c=q.c.slice());return}if((at=typeof q=="number")&&q*0==0){if(_t.s=1/q<0?(q=-q,-1):1,q===~~q){for(it=0,ct=q;ct>=10;ct/=10,it++);it>Y?_t.c=_t.e=null:(_t.e=it,_t.c=[q]);return}mt=String(q)}else{if(!Ts.test(mt=String(q)))return P(_t,mt,at);_t.s=mt.charCodeAt(0)==45?(mt=mt.slice(1),-1):1}(it=mt.indexOf("."))>-1&&(mt=mt.replace(".","")),(ct=mt.search(/e/i))>0?(it<0&&(it=ct),it+=+mt.slice(ct+1),mt=mt.substring(0,ct)):it<0&&(it=mt.length)}else{if(oe(K,2,Pt.length,"Base"),K==10&&At)return _t=new J(q),wt(_t,O+_t.e+1,R);if(mt=String(q),at=typeof q=="number"){if(q*0!=0)return P(_t,mt,at,K);if(_t.s=1/q<0?(mt=mt.slice(1),-1):1,J.DEBUG&&mt.replace(/^0\.0*|\./,"").length>15)throw Error(Ds+q)}else _t.s=mt.charCodeAt(0)===45?(mt=mt.slice(1),-1):1;for($=Pt.slice(0,K),it=ct=0,lt=mt.length;ct<lt;ct++)if($.indexOf(st=mt.charAt(ct))<0){if(st=="."){if(ct>it){it=lt;continue}}else if(!rt&&(mt==mt.toUpperCase()&&(mt=mt.toLowerCase())||mt==mt.toLowerCase()&&(mt=mt.toUpperCase()))){rt=!0,ct=-1,it=0;continue}return P(_t,String(q),at,K)}at=!1,mt=B(mt,K,10,_t.s),(it=mt.indexOf("."))>-1?mt=mt.replace(".",""):it=mt.length}for(ct=0;mt.charCodeAt(ct)===48;ct++);for(lt=mt.length;mt.charCodeAt(--lt)===48;);if(mt=mt.slice(ct,++lt)){if(lt-=ct,at&&J.DEBUG&<>15&&(q>On||q!==xe(q)))throw Error(Ds+_t.s*q);if((it=it-ct-1)>Y)_t.c=_t.e=null;else if(it<Q)_t.c=[_t.e=0];else{if(_t.e=it,_t.c=[],ct=(it+1)%Nt,it<0&&(ct+=Nt),ct<lt){for(ct&&_t.c.push(+mt.slice(0,ct)),lt-=Nt;ct<lt;)_t.c.push(+mt.slice(ct,ct+=Nt));ct=Nt-(mt=mt.slice(ct)).length}else ct-=lt;for(;ct--;mt+="0");_t.c.push(+mt)}}else _t.c=[_t.e=0]}J.clone=Ua,J.ROUND_UP=0,J.ROUND_DOWN=1,J.ROUND_CEIL=2,J.ROUND_FLOOR=3,J.ROUND_HALF_UP=4,J.ROUND_HALF_DOWN=5,J.ROUND_HALF_EVEN=6,J.ROUND_HALF_CEIL=7,J.ROUND_HALF_FLOOR=8,J.EUCLID=9,J.config=J.set=function(q){var K,$;if(q!=null)if(typeof q=="object"){if(q.hasOwnProperty(K="DECIMAL_PLACES")&&($=q[K],oe($,0,ye,K),O=$),q.hasOwnProperty(K="ROUNDING_MODE")&&($=q[K],oe($,0,8,K),R=$),q.hasOwnProperty(K="EXPONENTIAL_AT")&&($=q[K],$&&$.pop?(oe($[0],-ye,0,K),oe($[1],0,ye,K),Z=$[0],U=$[1]):(oe($,-ye,ye,K),Z=-(U=$<0?-$:$))),q.hasOwnProperty(K="RANGE"))if($=q[K],$&&$.pop)oe($[0],-ye,-1,K),oe($[1],1,ye,K),Q=$[0],Y=$[1];else if(oe($,-ye,ye,K),$)Q=-(Y=$<0?-$:$);else throw Error(Se+K+" cannot be zero: "+$);if(q.hasOwnProperty(K="CRYPTO"))if($=q[K],$===!!$)if($)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))ot=$;else throw ot=!$,Error(Se+"crypto unavailable");else ot=$;else throw Error(Se+K+" not true or false: "+$);if(q.hasOwnProperty(K="MODULO_MODE")&&($=q[K],oe($,0,9,K),ut=$),q.hasOwnProperty(K="POW_PRECISION")&&($=q[K],oe($,0,ye,K),vt=$),q.hasOwnProperty(K="FORMAT"))if($=q[K],typeof $=="object")xt=$;else throw Error(Se+K+" not an object: "+$);if(q.hasOwnProperty(K="ALPHABET"))if($=q[K],typeof $=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test($))At=$.slice(0,10)=="0123456789",Pt=$;else throw Error(Se+K+" invalid: "+$)}else throw Error(Se+"Object expected: "+q);return{DECIMAL_PLACES:O,ROUNDING_MODE:R,EXPONENTIAL_AT:[Z,U],RANGE:[Q,Y],CRYPTO:ot,MODULO_MODE:ut,POW_PRECISION:vt,FORMAT:xt,ALPHABET:Pt}},J.isBigNumber=function(q){if(!q||q._isBigNumber!==!0)return!1;if(!J.DEBUG)return!0;var K,$,st=q.c,rt=q.e,it=q.s;t:if({}.toString.call(st)=="[object Array]"){if((it===1||it===-1)&&rt>=-ye&&rt<=ye&&rt===xe(rt)){if(st[0]===0){if(rt===0&&st.length===1)return!0;break t}if(K=(rt+1)%Nt,K<1&&(K+=Nt),String(st[0]).length==K){for(K=0;K<st.length;K++)if($=st[K],$<0||$>=He||$!==xe($))break t;if($!==0)return!0}}}else if(st===null&&rt===null&&(it===null||it===1||it===-1))return!0;throw Error(Se+"Invalid BigNumber: "+q)},J.maximum=J.max=function(){return yt(arguments,-1)},J.minimum=J.min=function(){return yt(arguments,1)},J.random=(function(){var q=9007199254740992,K=Math.random()*q&2097151?function(){return xe(Math.random()*q)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function($){var st,rt,it,ct,at,lt=0,mt=[],_t=new J(T);if($==null?$=O:oe($,0,ye),ct=se($/Nt),ot)if(crypto.getRandomValues){for(st=crypto.getRandomValues(new Uint32Array(ct*=2));lt<ct;)at=st[lt]*131072+(st[lt+1]>>>11),at>=9e15?(rt=crypto.getRandomValues(new Uint32Array(2)),st[lt]=rt[0],st[lt+1]=rt[1]):(mt.push(at%1e14),lt+=2);lt=ct/2}else if(crypto.randomBytes){for(st=crypto.randomBytes(ct*=7);lt<ct;)at=(st[lt]&31)*281474976710656+st[lt+1]*1099511627776+st[lt+2]*4294967296+st[lt+3]*16777216+(st[lt+4]<<16)+(st[lt+5]<<8)+st[lt+6],at>=9e15?crypto.randomBytes(7).copy(st,lt):(mt.push(at%1e14),lt+=7);lt=ct/7}else throw ot=!1,Error(Se+"crypto unavailable");if(!ot)for(;lt<ct;)at=K(),at<9e15&&(mt[lt++]=at%1e14);for(ct=mt[--lt],$%=Nt,ct&&$&&(at=xr[Nt-$],mt[lt]=xe(ct/at)*at);mt[lt]===0;mt.pop(),lt--);if(lt<0)mt=[it=0];else{for(it=-1;mt[0]===0;mt.splice(0,1),it-=Nt);for(lt=1,at=mt[0];at>=10;at/=10,lt++);lt<Nt&&(it-=Nt-lt)}return _t.e=it,_t.c=mt,_t}})(),J.sum=function(){for(var q=1,K=arguments,$=new J(K[0]);q<K.length;)$=$.plus(K[q++]);return $},B=(function(){var q="0123456789";function K($,st,rt,it){for(var ct,at=[0],lt,mt=0,_t=$.length;mt<_t;){for(lt=at.length;lt--;at[lt]*=st);for(at[0]+=it.indexOf($.charAt(mt++)),ct=0;ct<at.length;ct++)at[ct]>rt-1&&(at[ct+1]==null&&(at[ct+1]=0),at[ct+1]+=at[ct]/rt|0,at[ct]%=rt)}return at.reverse()}return function($,st,rt,it,ct){var at,lt,mt,_t,kt,Ot,Ft,Ut,de=$.indexOf("."),ge=O,Xt=R;for(de>=0&&(_t=vt,vt=0,$=$.replace(".",""),Ut=new J(st),Ot=Ut.pow($.length-de),vt=_t,Ut.c=K(Bi(Qe(Ot.c),Ot.e,"0"),10,rt,q),Ut.e=Ut.c.length),Ft=K($,st,rt,ct?(at=Pt,q):(at=q,Pt)),mt=_t=Ft.length;Ft[--_t]==0;Ft.pop());if(!Ft[0])return at.charAt(0);if(de<0?--mt:(Ot.c=Ft,Ot.e=mt,Ot.s=it,Ot=k(Ot,Ut,ge,Xt,rt),Ft=Ot.c,kt=Ot.r,mt=Ot.e),lt=mt+ge+1,de=Ft[lt],_t=rt/2,kt=kt||lt<0||Ft[lt+1]!=null,kt=Xt<4?(de!=null||kt)&&(Xt==0||Xt==(Ot.s<0?3:2)):de>_t||de==_t&&(Xt==4||kt||Xt==6&&Ft[lt-1]&1||Xt==(Ot.s<0?8:7)),lt<1||!Ft[0])$=kt?Bi(at.charAt(1),-ge,at.charAt(0)):at.charAt(0);else{if(Ft.length=lt,kt)for(--rt;++Ft[--lt]>rt;)Ft[lt]=0,lt||(++mt,Ft=[1].concat(Ft));for(_t=Ft.length;!Ft[--_t];);for(de=0,$="";de<=_t;$+=at.charAt(Ft[de++]));$=Bi($,mt,at.charAt(0))}return $}})(),k=(function(){function q(st,rt,it){var ct,at,lt,mt,_t=0,kt=st.length,Ot=rt%Ki,Ft=rt/Ki|0;for(st=st.slice();kt--;)lt=st[kt]%Ki,mt=st[kt]/Ki|0,ct=Ft*lt+mt*Ot,at=Ot*lt+ct%Ki*Ki+_t,_t=(at/it|0)+(ct/Ki|0)+Ft*mt,st[kt]=at%it;return _t&&(st=[_t].concat(st)),st}function K(st,rt,it,ct){var at,lt;if(it!=ct)lt=it>ct?1:-1;else for(at=lt=0;at<it;at++)if(st[at]!=rt[at]){lt=st[at]>rt[at]?1:-1;break}return lt}function $(st,rt,it,ct){for(var at=0;it--;)st[it]-=at,at=st[it]<rt[it]?1:0,st[it]=at*ct+st[it]-rt[it];for(;!st[0]&&st.length>1;st.splice(0,1));}return function(st,rt,it,ct,at){var lt,mt,_t,kt,Ot,Ft,Ut,de,ge,Xt,te,Ae,Hs,Ga,Za,vi,Er,ti=st.s==rt.s?1:-1,Fe=st.c,pe=rt.c;if(!Fe||!Fe[0]||!pe||!pe[0])return new J(!st.s||!rt.s||(Fe?pe&&Fe[0]==pe[0]:!pe)?NaN:Fe&&Fe[0]==0||!pe?ti*0:ti/0);for(de=new J(ti),ge=de.c=[],mt=st.e-rt.e,ti=it+mt+1,at||(at=He,mt=Je(st.e/Nt)-Je(rt.e/Nt),ti=ti/Nt|0),_t=0;pe[_t]==(Fe[_t]||0);_t++);if(pe[_t]>(Fe[_t]||0)&&mt--,ti<0)ge.push(1),kt=!0;else{for(Ga=Fe.length,vi=pe.length,_t=0,ti+=2,Ot=xe(at/(pe[0]+1)),Ot>1&&(pe=q(pe,Ot,at),Fe=q(Fe,Ot,at),vi=pe.length,Ga=Fe.length),Hs=vi,Xt=Fe.slice(0,vi),te=Xt.length;te<vi;Xt[te++]=0);Er=pe.slice(),Er=[0].concat(Er),Za=pe[0],pe[1]>=at/2&&Za++;do{if(Ot=0,lt=K(pe,Xt,vi,te),lt<0){if(Ae=Xt[0],vi!=te&&(Ae=Ae*at+(Xt[1]||0)),Ot=xe(Ae/Za),Ot>1)for(Ot>=at&&(Ot=at-1),Ft=q(pe,Ot,at),Ut=Ft.length,te=Xt.length;K(Ft,Xt,Ut,te)==1;)Ot--,$(Ft,vi<Ut?Er:pe,Ut,at),Ut=Ft.length,lt=1;else Ot==0&&(lt=Ot=1),Ft=pe.slice(),Ut=Ft.length;if(Ut<te&&(Ft=[0].concat(Ft)),$(Xt,Ft,te,at),te=Xt.length,lt==-1)for(;K(pe,Xt,vi,te)<1;)Ot++,$(Xt,vi<te?Er:pe,te,at),te=Xt.length}else lt===0&&(Ot++,Xt=[0]);ge[_t++]=Ot,Xt[0]?Xt[te++]=Fe[Hs]||0:(Xt=[Fe[Hs]],te=1)}while((Hs++<Ga||Xt[0]!=null)&&ti--);kt=Xt[0]!=null,ge[0]||ge.splice(0,1)}if(at==He){for(_t=1,ti=ge[0];ti>=10;ti/=10,_t++);wt(de,it+(de.e=_t+mt*Nt-1)+1,ct,kt)}else de.e=mt,de.r=+kt;return de}})();function ht(q,K,$,st){var rt,it,ct,at,lt;if($==null?$=R:oe($,0,8),!q.c)return q.toString();if(rt=q.c[0],ct=q.e,K==null)lt=Qe(q.c),lt=st==1||st==2&&(ct<=Z||ct>=U)?Fs(lt,ct):Bi(lt,ct,"0");else if(q=wt(new J(q),K,$),it=q.e,lt=Qe(q.c),at=lt.length,st==1||st==2&&(K<=it||it<=Z)){for(;at<K;lt+="0",at++);lt=Fs(lt,it)}else if(K-=ct+(st===2&&it>ct),lt=Bi(lt,it,"0"),it+1>at){if(--K>0)for(lt+=".";K--;lt+="0");}else if(K+=it-at,K>0)for(it+1==at&&(lt+=".");K--;lt+="0");return q.s<0&&rt?"-"+lt:lt}function yt(q,K){for(var $,st,rt=1,it=new J(q[0]);rt<q.length;rt++)st=new J(q[rt]),(!st.s||($=dn(it,st))===K||$===0&&it.s===K)&&(it=st);return it}function Bt(q,K,$){for(var st=1,rt=K.length;!K[--rt];K.pop());for(rt=K[0];rt>=10;rt/=10,st++);return($=st+$*Nt-1)>Y?q.c=q.e=null:$<Q?q.c=[q.e=0]:(q.e=$,q.c=K),q}P=(function(){var q=/^(-?)0([xbo])(?=\w[\w.]*$)/i,K=/^([^.]+)\.$/,$=/^\.([^.]+)$/,st=/^-?(Infinity|NaN)$/,rt=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(it,ct,at,lt){var mt,_t=at?ct:ct.replace(rt,"");if(st.test(_t))it.s=isNaN(_t)?null:_t<0?-1:1;else{if(!at&&(_t=_t.replace(q,function(kt,Ot,Ft){return mt=(Ft=Ft.toLowerCase())=="x"?16:Ft=="b"?2:8,!lt||lt==mt?Ot:kt}),lt&&(mt=lt,_t=_t.replace(K,"$1").replace($,"0.$1")),ct!=_t))return new J(_t,mt);if(J.DEBUG)throw Error(Se+"Not a"+(lt?" base "+lt:"")+" number: "+ct);it.s=null}it.c=it.e=null}})();function wt(q,K,$,st){var rt,it,ct,at,lt,mt,_t,kt=q.c,Ot=xr;if(kt){t:{for(rt=1,at=kt[0];at>=10;at/=10,rt++);if(it=K-rt,it<0)it+=Nt,ct=K,lt=kt[mt=0],_t=xe(lt/Ot[rt-ct-1]%10);else if(mt=se((it+1)/Nt),mt>=kt.length)if(st){for(;kt.length<=mt;kt.push(0));lt=_t=0,rt=1,it%=Nt,ct=it-Nt+1}else break t;else{for(lt=at=kt[mt],rt=1;at>=10;at/=10,rt++);it%=Nt,ct=it-Nt+rt,_t=ct<0?0:xe(lt/Ot[rt-ct-1]%10)}if(st=st||K<0||kt[mt+1]!=null||(ct<0?lt:lt%Ot[rt-ct-1]),st=$<4?(_t||st)&&($==0||$==(q.s<0?3:2)):_t>5||_t==5&&($==4||st||$==6&&(it>0?ct>0?lt/Ot[rt-ct]:0:kt[mt-1])%10&1||$==(q.s<0?8:7)),K<1||!kt[0])return kt.length=0,st?(K-=q.e+1,kt[0]=Ot[(Nt-K%Nt)%Nt],q.e=-K||0):kt[0]=q.e=0,q;if(it==0?(kt.length=mt,at=1,mt--):(kt.length=mt+1,at=Ot[Nt-it],kt[mt]=ct>0?xe(lt/Ot[rt-ct]%Ot[ct])*at:0),st)for(;;)if(mt==0){for(it=1,ct=kt[0];ct>=10;ct/=10,it++);for(ct=kt[0]+=at,at=1;ct>=10;ct/=10,at++);it!=at&&(q.e++,kt[0]==He&&(kt[0]=1));break}else{if(kt[mt]+=at,kt[mt]!=He)break;kt[mt--]=0,at=1}for(it=kt.length;kt[--it]===0;kt.pop());}q.e>Y?q.c=q.e=null:q.e<Q&&(q.c=[q.e=0])}return q}function Et(q){var K,$=q.e;return $===null?q.toString():(K=Qe(q.c),K=$<=Z||$>=U?Fs(K,$):Bi(K,$,"0"),q.s<0?"-"+K:K)}return A.absoluteValue=A.abs=function(){var q=new J(this);return q.s<0&&(q.s=1),q},A.comparedTo=function(q,K){return dn(this,new J(q,K))},A.decimalPlaces=A.dp=function(q,K){var $,st,rt,it=this;if(q!=null)return oe(q,0,ye),K==null?K=R:oe(K,0,8),wt(new J(it),q+it.e+1,K);if(!($=it.c))return null;if(st=((rt=$.length-1)-Je(this.e/Nt))*Nt,rt=$[rt])for(;rt%10==0;rt/=10,st--);return st<0&&(st=0),st},A.dividedBy=A.div=function(q,K){return k(this,new J(q,K),O,R)},A.dividedToIntegerBy=A.idiv=function(q,K){return k(this,new J(q,K),0,1)},A.exponentiatedBy=A.pow=function(q,K){var $,st,rt,it,ct,at,lt,mt,_t,kt=this;if(q=new J(q),q.c&&!q.isInteger())throw Error(Se+"Exponent not an integer: "+Et(q));if(K!=null&&(K=new J(K)),at=q.e>14,!kt.c||!kt.c[0]||kt.c[0]==1&&!kt.e&&kt.c.length==1||!q.c||!q.c[0])return _t=new J(Math.pow(+Et(kt),at?q.s*(2-Os(q)):+Et(q))),K?_t.mod(K):_t;if(lt=q.s<0,K){if(K.c?!K.c[0]:!K.s)return new J(NaN);st=!lt&&kt.isInteger()&&K.isInteger(),st&&(kt=kt.mod(K))}else{if(q.e>9&&(kt.e>0||kt.e<-1||(kt.e==0?kt.c[0]>1||at&&kt.c[1]>=24e7:kt.c[0]<8e13||at&&kt.c[0]<=9999975e7)))return it=kt.s<0&&Os(q)?-0:0,kt.e>-1&&(it=1/it),new J(lt?1/it:it);vt&&(it=se(vt/Nt+2))}for(at?($=new J(.5),lt&&(q.s=1),mt=Os(q)):(rt=Math.abs(+Et(q)),mt=rt%2),_t=new J(T);;){if(mt){if(_t=_t.times(kt),!_t.c)break;it?_t.c.length>it&&(_t.c.length=it):st&&(_t=_t.mod(K))}if(rt){if(rt=xe(rt/2),rt===0)break;mt=rt%2}else if(q=q.times($),wt(q,q.e+1,1),q.e>14)mt=Os(q);else{if(rt=+Et(q),rt===0)break;mt=rt%2}kt=kt.times(kt),it?kt.c&&kt.c.length>it&&(kt.c.length=it):st&&(kt=kt.mod(K))}return st?_t:(lt&&(_t=T.div(_t)),K?_t.mod(K):it?wt(_t,vt,R,ct):_t)},A.integerValue=function(q){var K=new J(this);return q==null?q=R:oe(q,0,8),wt(K,K.e+1,q)},A.isEqualTo=A.eq=function(q,K){return dn(this,new J(q,K))===0},A.isFinite=function(){return!!this.c},A.isGreaterThan=A.gt=function(q,K){return dn(this,new J(q,K))>0},A.isGreaterThanOrEqualTo=A.gte=function(q,K){return(K=dn(this,new J(q,K)))===1||K===0},A.isInteger=function(){return!!this.c&&Je(this.e/Nt)>this.c.length-2},A.isLessThan=A.lt=function(q,K){return dn(this,new J(q,K))<0},A.isLessThanOrEqualTo=A.lte=function(q,K){return(K=dn(this,new J(q,K)))===-1||K===0},A.isNaN=function(){return!this.s},A.isNegative=function(){return this.s<0},A.isPositive=function(){return this.s>0},A.isZero=function(){return!!this.c&&this.c[0]==0},A.minus=function(q,K){var $,st,rt,it,ct=this,at=ct.s;if(q=new J(q,K),K=q.s,!at||!K)return new J(NaN);if(at!=K)return q.s=-K,ct.plus(q);var lt=ct.e/Nt,mt=q.e/Nt,_t=ct.c,kt=q.c;if(!lt||!mt){if(!_t||!kt)return _t?(q.s=-K,q):new J(kt?ct:NaN);if(!_t[0]||!kt[0])return kt[0]?(q.s=-K,q):new J(_t[0]?ct:R==3?-0:0)}if(lt=Je(lt),mt=Je(mt),_t=_t.slice(),at=lt-mt){for((it=at<0)?(at=-at,rt=_t):(mt=lt,rt=kt),rt.reverse(),K=at;K--;rt.push(0));rt.reverse()}else for(st=(it=(at=_t.length)<(K=kt.length))?at:K,at=K=0;K<st;K++)if(_t[K]!=kt[K]){it=_t[K]<kt[K];break}if(it&&(rt=_t,_t=kt,kt=rt,q.s=-q.s),K=(st=kt.length)-($=_t.length),K>0)for(;K--;_t[$++]=0);for(K=He-1;st>at;){if(_t[--st]<kt[st]){for($=st;$&&!_t[--$];_t[$]=K);--_t[$],_t[st]+=He}_t[st]-=kt[st]}for(;_t[0]==0;_t.splice(0,1),--mt);return _t[0]?Bt(q,_t,mt):(q.s=R==3?-1:1,q.c=[q.e=0],q)},A.modulo=A.mod=function(q,K){var $,st,rt=this;return q=new J(q,K),!rt.c||!q.s||q.c&&!q.c[0]?new J(NaN):!q.c||rt.c&&!rt.c[0]?new J(rt):(ut==9?(st=q.s,q.s=1,$=k(rt,q,0,3),q.s=st,$.s*=st):$=k(rt,q,0,ut),q=rt.minus($.times(q)),!q.c[0]&&ut==1&&(q.s=rt.s),q)},A.multipliedBy=A.times=function(q,K){var $,st,rt,it,ct,at,lt,mt,_t,kt,Ot,Ft,Ut,de,ge,Xt=this,te=Xt.c,Ae=(q=new J(q,K)).c;if(!te||!Ae||!te[0]||!Ae[0])return!Xt.s||!q.s||te&&!te[0]&&!Ae||Ae&&!Ae[0]&&!te?q.c=q.e=q.s=null:(q.s*=Xt.s,!te||!Ae?q.c=q.e=null:(q.c=[0],q.e=0)),q;for(st=Je(Xt.e/Nt)+Je(q.e/Nt),q.s*=Xt.s,lt=te.length,kt=Ae.length,lt<kt&&(Ut=te,te=Ae,Ae=Ut,rt=lt,lt=kt,kt=rt),rt=lt+kt,Ut=[];rt--;Ut.push(0));for(de=He,ge=Ki,rt=kt;--rt>=0;){for($=0,Ot=Ae[rt]%ge,Ft=Ae[rt]/ge|0,ct=lt,it=rt+ct;it>rt;)mt=te[--ct]%ge,_t=te[ct]/ge|0,at=Ft*mt+_t*Ot,mt=Ot*mt+at%ge*ge+Ut[it]+$,$=(mt/de|0)+(at/ge|0)+Ft*_t,Ut[it--]=mt%de;Ut[it]=$}return $?++st:Ut.splice(0,1),Bt(q,Ut,st)},A.negated=function(){var q=new J(this);return q.s=-q.s||null,q},A.plus=function(q,K){var $,st=this,rt=st.s;if(q=new J(q,K),K=q.s,!rt||!K)return new J(NaN);if(rt!=K)return q.s=-K,st.minus(q);var it=st.e/Nt,ct=q.e/Nt,at=st.c,lt=q.c;if(!it||!ct){if(!at||!lt)return new J(rt/0);if(!at[0]||!lt[0])return lt[0]?q:new J(at[0]?st:rt*0)}if(it=Je(it),ct=Je(ct),at=at.slice(),rt=it-ct){for(rt>0?(ct=it,$=lt):(rt=-rt,$=at),$.reverse();rt--;$.push(0));$.reverse()}for(rt=at.length,K=lt.length,rt-K<0&&($=lt,lt=at,at=$,K=rt),rt=0;K;)rt=(at[--K]=at[K]+lt[K]+rt)/He|0,at[K]=He===at[K]?0:at[K]%He;return rt&&(at=[rt].concat(at),++ct),Bt(q,at,ct)},A.precision=A.sd=function(q,K){var $,st,rt,it=this;if(q!=null&&q!==!!q)return oe(q,1,ye),K==null?K=R:oe(K,0,8),wt(new J(it),q,K);if(!($=it.c))return null;if(rt=$.length-1,st=rt*Nt+1,rt=$[rt]){for(;rt%10==0;rt/=10,st--);for(rt=$[0];rt>=10;rt/=10,st++);}return q&&it.e+1>st&&(st=it.e+1),st},A.shiftedBy=function(q){return oe(q,-On,On),this.times("1e"+q)},A.squareRoot=A.sqrt=function(){var q,K,$,st,rt,it=this,ct=it.c,at=it.s,lt=it.e,mt=O+4,_t=new J("0.5");if(at!==1||!ct||!ct[0])return new J(!at||at<0&&(!ct||ct[0])?NaN:ct?it:1/0);if(at=Math.sqrt(+Et(it)),at==0||at==1/0?(K=Qe(ct),(K.length+lt)%2==0&&(K+="0"),at=Math.sqrt(+K),lt=Je((lt+1)/2)-(lt<0||lt%2),at==1/0?K="5e"+lt:(K=at.toExponential(),K=K.slice(0,K.indexOf("e")+1)+lt),$=new J(K)):$=new J(at+""),$.c[0]){for(lt=$.e,at=lt+mt,at<3&&(at=0);;)if(rt=$,$=_t.times(rt.plus(k(it,rt,mt,1))),Qe(rt.c).slice(0,at)===(K=Qe($.c)).slice(0,at))if($.e<lt&&--at,K=K.slice(at-3,at+1),K=="9999"||!st&&K=="4999"){if(!st&&(wt(rt,rt.e+O+2,0),rt.times(rt).eq(it))){$=rt;break}mt+=4,at+=4,st=1}else{(!+K||!+K.slice(1)&&K.charAt(0)=="5")&&(wt($,$.e+O+2,1),q=!$.times($).eq(it));break}}return wt($,$.e+O+1,R,q)},A.toExponential=function(q,K){return q!=null&&(oe(q,0,ye),q++),ht(this,q,K,1)},A.toFixed=function(q,K){return q!=null&&(oe(q,0,ye),q=q+this.e+1),ht(this,q,K)},A.toFormat=function(q,K,$){var st,rt=this;if($==null)q!=null&&K&&typeof K=="object"?($=K,K=null):q&&typeof q=="object"?($=q,q=K=null):$=xt;else if(typeof $!="object")throw Error(Se+"Argument not an object: "+$);if(st=rt.toFixed(q,K),rt.c){var it,ct=st.split("."),at=+$.groupSize,lt=+$.secondaryGroupSize,mt=$.groupSeparator||"",_t=ct[0],kt=ct[1],Ot=rt.s<0,Ft=Ot?_t.slice(1):_t,Ut=Ft.length;if(lt&&(it=at,at=lt,lt=it,Ut-=it),at>0&&Ut>0){for(it=Ut%at||at,_t=Ft.substr(0,it);it<Ut;it+=at)_t+=mt+Ft.substr(it,at);lt>0&&(_t+=mt+Ft.slice(it)),Ot&&(_t="-"+_t)}st=kt?_t+($.decimalSeparator||"")+((lt=+$.fractionGroupSize)?kt.replace(new RegExp("\\d{"+lt+"}\\B","g"),"$&"+($.fractionGroupSeparator||"")):kt):_t}return($.prefix||"")+st+($.suffix||"")},A.toFraction=function(q){var K,$,st,rt,it,ct,at,lt,mt,_t,kt,Ot,Ft=this,Ut=Ft.c;if(q!=null&&(at=new J(q),!at.isInteger()&&(at.c||at.s!==1)||at.lt(T)))throw Error(Se+"Argument "+(at.isInteger()?"out of range: ":"not an integer: ")+Et(at));if(!Ut)return new J(Ft);for(K=new J(T),mt=$=new J(T),st=lt=new J(T),Ot=Qe(Ut),it=K.e=Ot.length-Ft.e-1,K.c[0]=xr[(ct=it%Nt)<0?Nt+ct:ct],q=!q||at.comparedTo(K)>0?it>0?K:mt:at,ct=Y,Y=1/0,at=new J(Ot),lt.c[0]=0;_t=k(at,K,0,1),rt=$.plus(_t.times(st)),rt.comparedTo(q)!=1;)$=st,st=rt,mt=lt.plus(_t.times(rt=mt)),lt=rt,K=at.minus(_t.times(rt=K)),at=rt;return rt=k(q.minus($),st,0,1),lt=lt.plus(rt.times(mt)),$=$.plus(rt.times(st)),lt.s=mt.s=Ft.s,it=it*2,kt=k(mt,st,it,R).minus(Ft).abs().comparedTo(k(lt,$,it,R).minus(Ft).abs())<1?[mt,st]:[lt,$],Y=ct,kt},A.toNumber=function(){return+Et(this)},A.toPrecision=function(q,K){return q!=null&&oe(q,1,ye),ht(this,q,K,2)},A.toString=function(q){var K,$=this,st=$.s,rt=$.e;return rt===null?st?(K="Infinity",st<0&&(K="-"+K)):K="NaN":(q==null?K=rt<=Z||rt>=U?Fs(Qe($.c),rt):Bi(Qe($.c),rt,"0"):q===10&&At?($=wt(new J($),O+rt+1,R),K=Bi(Qe($.c),$.e,"0")):(oe(q,2,Pt.length,"Base"),K=B(Bi(Qe($.c),rt,"0"),10,q,st,!0)),st<0&&$.c[0]&&(K="-"+K)),K},A.valueOf=A.toJSON=function(){return Et(this)},A._isBigNumber=!0,A[Symbol.toStringTag]="BigNumber",A[Symbol.for("nodejs.util.inspect.custom")]=A.valueOf,C!=null&&J.set(C),J}function Je(C){var k=C|0;return C>0||C===k?k:k-1}function Qe(C){for(var k,B,P=1,A=C.length,T=C[0]+"";P<A;){for(k=C[P++]+"",B=Nt-k.length;B--;k="0"+k);T+=k}for(A=T.length;T.charCodeAt(--A)===48;);return T.slice(0,A+1||1)}function dn(C,k){var B,P,A=C.c,T=k.c,O=C.s,R=k.s,Z=C.e,U=k.e;if(!O||!R)return null;if(B=A&&!A[0],P=T&&!T[0],B||P)return B?P?0:-R:O;if(O!=R)return O;if(B=O<0,P=Z==U,!A||!T)return P?0:!A^B?1:-1;if(!P)return Z>U^B?1:-1;for(R=(Z=A.length)<(U=T.length)?Z:U,O=0;O<R;O++)if(A[O]!=T[O])return A[O]>T[O]^B?1:-1;return Z==U?0:Z>U^B?1:-1}function oe(C,k,B,P){if(C<k||C>B||C!==xe(C))throw Error(Se+(P||"Argument")+(typeof C=="number"?C<k||C>B?" out of range: ":" not an integer: ":" not a primitive number: ")+String(C))}function Os(C){var k=C.c.length-1;return Je(C.e/Nt)==k&&C.c[k]%2!=0}function Fs(C,k){return(C.length>1?C.charAt(0)+"."+C.slice(1):C)+(k<0?"e":"e+")+k}function Bi(C,k,B){var P,A;if(k<0){for(A=B+".";++k;A+=B);C=A+C}else if(P=C.length,++k>P){for(A=B,k-=P;--k;A+=B);C+=A}else k<P&&(C=C.slice(0,k)+"."+C.slice(k));return C}var ro=Ua(),gi=ro,so=class{key;left=null;right=null;constructor(C){this.key=C}},kr=class extends so{constructor(C){super(C)}},ao=class{size=0;modificationCount=0;splayCount=0;splay(C){let k=this.root;if(k==null)return this.compare(C,C),-1;let B=null,P=null,A=null,T=null,O=k,R=this.compare,Z;for(;;)if(Z=R(O.key,C),Z>0){let U=O.left;if(U==null||(Z=R(U.key,C),Z>0&&(O.left=U.right,U.right=O,O=U,U=O.left,U==null)))break;B==null?P=O:B.left=O,B=O,O=U}else if(Z<0){let U=O.right;if(U==null||(Z=R(U.key,C),Z<0&&(O.right=U.left,U.left=O,O=U,U=O.right,U==null)))break;A==null?T=O:A.right=O,A=O,O=U}else break;return A!=null&&(A.right=O.left,O.left=T),B!=null&&(B.left=O.right,O.right=P),this.root!==O&&(this.root=O,this.splayCount++),Z}splayMin(C){let k=C,B=k.left;for(;B!=null;){let P=B;k.left=P.right,P.right=k,k=P,B=k.left}return k}splayMax(C){let k=C,B=k.right;for(;B!=null;){let P=B;k.right=P.left,P.left=k,k=P,B=k.right}return k}_delete(C){if(this.root==null||this.splay(C)!=0)return null;let k=this.root,B=k,P=k.left;if(this.size--,P==null)this.root=k.right;else{let A=k.right;k=this.splayMax(P),k.right=A,this.root=k}return this.modificationCount++,B}addNewRoot(C,k){this.size++,this.modificationCount++;let B=this.root;if(B==null){this.root=C;return}k<0?(C.left=B,C.right=B.right,B.right=null):(C.right=B,C.left=B.left,B.left=null),this.root=C}_first(){let C=this.root;return C==null?null:(this.root=this.splayMin(C),this.root)}_last(){let C=this.root;return C==null?null:(this.root=this.splayMax(C),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(C){return this.validKey(C)&&this.splay(C)==0}defaultCompare(){return(C,k)=>C<k?-1:C>k?1:0}wrap(){return{getRoot:()=>this.root,setRoot:C=>{this.root=C},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:C=>{this.splayCount=C},splay:C=>this.splay(C),has:C=>this.has(C)}}},Rs=class Br extends ao{root=null;compare;validKey;constructor(k,B){super(),this.compare=k??this.defaultCompare(),this.validKey=B??(P=>P!=null&&P!=null)}delete(k){return this.validKey(k)?this._delete(k)!=null:!1}deleteAll(k){for(let B of k)this.delete(B)}forEach(k){let B=this[Symbol.iterator](),P;for(;P=B.next(),!P.done;)k(P.value,P.value,this)}add(k){let B=this.splay(k);return B!=0&&this.addNewRoot(new kr(k),B),this}addAndReturn(k){let B=this.splay(k);return B!=0&&this.addNewRoot(new kr(k),B),this.root.key}addAll(k){for(let B of k)this.add(B)}isEmpty(){return this.root==null}isNotEmpty(){return this.root!=null}single(){if(this.size==0)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(this.size==0)throw"Bad state: No element";return this._first().key}last(){if(this.size==0)throw"Bad state: No element";return this._last().key}lastBefore(k){if(k==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(k)<0)return this.root.key;let B=this.root.left;if(B==null)return null;let P=B.right;for(;P!=null;)B=P,P=B.right;return B.key}firstAfter(k){if(k==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(k)>0)return this.root.key;let B=this.root.right;if(B==null)return null;let P=B.left;for(;P!=null;)B=P,P=B.left;return B.key}retainAll(k){let B=new Br(this.compare,this.validKey),P=this.modificationCount;for(let A of k){if(P!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(A)&&this.splay(A)==0&&B.add(this.root.key)}B.size!=this.size&&(this.root=B.root,this.size=B.size,this.modificationCount++)}lookup(k){return!this.validKey(k)||this.splay(k)!=0?null:this.root.key}intersection(k){let B=new Br(this.compare,this.validKey);for(let P of this)k.has(P)&&B.add(P);return B}difference(k){let B=new Br(this.compare,this.validKey);for(let P of this)k.has(P)||B.add(P);return B}union(k){let B=this.clone();return B.addAll(k),B}clone(){let k=new Br(this.compare,this.validKey);return k.size=this.size,k.root=this.copyNode(this.root),k}copyNode(k){if(k==null)return null;function B(A,T){let O,R;do{if(O=A.left,R=A.right,O!=null){let Z=new kr(O.key);T.left=Z,B(O,Z)}if(R!=null){let Z=new kr(R.key);T.right=Z,A=R,T=Z}}while(R!=null)}let P=new kr(k.key);return B(k,P),P}toSet(){return this.clone()}entries(){return new uo(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[Symbol.iterator](){return new oo(this.wrap())}[Symbol.toStringTag]="[object Set]"},Ha=class{tree;path=new Array;modificationCount=null;splayCount;constructor(C){this.tree=C,this.splayCount=C.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;let C=this.path[this.path.length-1];return this.getValue(C)}rebuildPath(C){this.path.splice(0,this.path.length),this.tree.splay(C),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(C){for(;C!=null;)this.path.push(C),C=C.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(this.modificationCount==null){this.modificationCount=this.tree.getModificationCount();let B=this.tree.getRoot();for(;B!=null;)this.path.push(B),B=B.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let C=this.path[this.path.length-1],k=C.right;if(k!=null){for(;k!=null;)this.path.push(k),k=k.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===C;)C=this.path.pop();return this.path.length>0}},oo=class extends Ha{getValue(C){return C.key}},uo=class extends Ha{getValue(C){return[C.key,C.key]}},Va=C=>()=>C,Ra=C=>{let k=C?(B,P)=>P.minus(B).abs().isLessThanOrEqualTo(C):Va(!1);return(B,P)=>k(B,P)?0:B.comparedTo(P)};function lo(C){let k=C?(B,P,A,T,O)=>B.exponentiatedBy(2).isLessThanOrEqualTo(T.minus(P).exponentiatedBy(2).plus(O.minus(A).exponentiatedBy(2)).times(C)):Va(!1);return(B,P,A)=>{let T=B.x,O=B.y,R=A.x,Z=A.y,U=O.minus(Z).times(P.x.minus(R)).minus(T.minus(R).times(P.y.minus(Z)));return k(U,T,O,R,Z)?0:U.comparedTo(0)}}var ho=C=>C,co=C=>{if(C){let k=new Rs(Ra(C)),B=new Rs(Ra(C)),P=(T,O)=>O.addAndReturn(T),A=T=>({x:P(T.x,k),y:P(T.y,B)});return A({x:new gi(0),y:new gi(0)}),A}return ho},Ia=C=>({set:k=>{Pi=Ia(k)},reset:()=>Ia(C),compare:Ra(C),snap:co(C),orient:lo(C)}),Pi=Ia(),Mr=(C,k)=>C.ll.x.isLessThanOrEqualTo(k.x)&&k.x.isLessThanOrEqualTo(C.ur.x)&&C.ll.y.isLessThanOrEqualTo(k.y)&&k.y.isLessThanOrEqualTo(C.ur.y),za=(C,k)=>{if(k.ur.x.isLessThan(C.ll.x)||C.ur.x.isLessThan(k.ll.x)||k.ur.y.isLessThan(C.ll.y)||C.ur.y.isLessThan(k.ll.y))return null;let B=C.ll.x.isLessThan(k.ll.x)?k.ll.x:C.ll.x,P=C.ur.x.isLessThan(k.ur.x)?C.ur.x:k.ur.x,A=C.ll.y.isLessThan(k.ll.y)?k.ll.y:C.ll.y,T=C.ur.y.isLessThan(k.ur.y)?C.ur.y:k.ur.y;return{ll:{x:B,y:A},ur:{x:P,y:T}}},Is=(C,k)=>C.x.times(k.y).minus(C.y.times(k.x)),qa=(C,k)=>C.x.times(k.x).plus(C.y.times(k.y)),zs=C=>qa(C,C).sqrt(),po=(C,k,B)=>{let P={x:k.x.minus(C.x),y:k.y.minus(C.y)},A={x:B.x.minus(C.x),y:B.y.minus(C.y)};return Is(A,P).div(zs(A)).div(zs(P))},fo=(C,k,B)=>{let P={x:k.x.minus(C.x),y:k.y.minus(C.y)},A={x:B.x.minus(C.x),y:B.y.minus(C.y)};return qa(A,P).div(zs(A)).div(zs(P))},Ka=(C,k,B)=>k.y.isZero()?null:{x:C.x.plus(k.x.div(k.y).times(B.minus(C.y))),y:B},Wa=(C,k,B)=>k.x.isZero()?null:{x:B,y:C.y.plus(k.y.div(k.x).times(B.minus(C.x)))},_o=(C,k,B,P)=>{if(k.x.isZero())return Wa(B,P,C.x);if(P.x.isZero())return Wa(C,k,B.x);if(k.y.isZero())return Ka(B,P,C.y);if(P.y.isZero())return Ka(C,k,B.y);let A=Is(k,P);if(A.isZero())return null;let T={x:B.x.minus(C.x),y:B.y.minus(C.y)},O=Is(T,k).div(A),R=Is(T,P).div(A),Z=C.x.plus(R.times(k.x)),U=B.x.plus(O.times(P.x)),Q=C.y.plus(R.times(k.y)),Y=B.y.plus(O.times(P.y)),ot=Z.plus(U).div(2),ut=Q.plus(Y).div(2);return{x:ot,y:ut}},yi=class no{point;isLeft;segment;otherSE;consumedBy;static compare(k,B){let P=no.comparePoints(k.point,B.point);return P!==0?P:(k.point!==B.point&&k.link(B),k.isLeft!==B.isLeft?k.isLeft?1:-1:Gs.compare(k.segment,B.segment))}static comparePoints(k,B){return k.x.isLessThan(B.x)?-1:k.x.isGreaterThan(B.x)?1:k.y.isLessThan(B.y)?-1:k.y.isGreaterThan(B.y)?1:0}constructor(k,B){k.events===void 0?k.events=[this]:k.events.push(this),this.point=k,this.isLeft=B}link(k){if(k.point===this.point)throw new Error("Tried to link already linked events");let B=k.point.events;for(let P=0,A=B.length;P<A;P++){let T=B[P];this.point.events.push(T),T.point=this.point}this.checkForConsuming()}checkForConsuming(){let k=this.point.events.length;for(let B=0;B<k;B++){let P=this.point.events[B];if(P.segment.consumedBy===void 0)for(let A=B+1;A<k;A++){let T=this.point.events[A];T.consumedBy===void 0&&P.otherSE.point.events===T.otherSE.point.events&&P.segment.consume(T.segment)}}}getAvailableLinkedEvents(){let k=[];for(let B=0,P=this.point.events.length;B<P;B++){let A=this.point.events[B];A!==this&&!A.segment.ringOut&&A.segment.isInResult()&&k.push(A)}return k}getLeftmostComparator(k){let B=new Map,P=A=>{let T=A.otherSE;B.set(A,{sine:po(this.point,k.point,T.point),cosine:fo(this.point,k.point,T.point)})};return(A,T)=>{B.has(A)||P(A),B.has(T)||P(T);let{sine:O,cosine:R}=B.get(A),{sine:Z,cosine:U}=B.get(T);return O.isGreaterThanOrEqualTo(0)&&Z.isGreaterThanOrEqualTo(0)?R.isLessThan(U)?1:R.isGreaterThan(U)?-1:0:O.isLessThan(0)&&Z.isLessThan(0)?R.isLessThan(U)?-1:R.isGreaterThan(U)?1:0:Z.isLessThan(O)?-1:Z.isGreaterThan(O)?1:0}}},mo=class ja{events;poly;_isExteriorRing;_enclosingRing;static factory(k){let B=[];for(let P=0,A=k.length;P<A;P++){let T=k[P];if(!T.isInResult()||T.ringOut)continue;let O=null,R=T.leftSE,Z=T.rightSE,U=[R],Q=R.point,Y=[];for(;O=R,R=Z,U.push(R),R.point!==Q;)for(;;){let ot=R.getAvailableLinkedEvents();if(ot.length===0){let xt=U[0].point,Pt=U[U.length-1].point;throw new Error(`Unable to complete output ring starting at [${xt.x}, ${xt.y}]. Last matching segment found ends at [${Pt.x}, ${Pt.y}].`)}if(ot.length===1){Z=ot[0].otherSE;break}let ut=null;for(let xt=0,Pt=Y.length;xt<Pt;xt++)if(Y[xt].point===R.point){ut=xt;break}if(ut!==null){let xt=Y.splice(ut)[0],Pt=U.splice(xt.index);Pt.unshift(Pt[0].otherSE),B.push(new ja(Pt.reverse()));continue}Y.push({index:U.length,point:R.point});let vt=R.getLeftmostComparator(O);Z=ot.sort(vt)[0].otherSE;break}B.push(new ja(U))}return B}constructor(k){this.events=k;for(let B=0,P=k.length;B<P;B++)k[B].segment.ringOut=this;this.poly=null}getGeom(){let k=this.events[0].point,B=[k];for(let U=1,Q=this.events.length-1;U<Q;U++){let Y=this.events[U].point,ot=this.events[U+1].point;Pi.orient(Y,k,ot)!==0&&(B.push(Y),k=Y)}if(B.length===1)return null;let P=B[0],A=B[1];Pi.orient(P,k,A)===0&&B.shift(),B.push(B[0]);let T=this.isExteriorRing()?1:-1,O=this.isExteriorRing()?0:B.length-1,R=this.isExteriorRing()?B.length:-1,Z=[];for(let U=O;U!=R;U+=T)Z.push([B[U].x.toNumber(),B[U].y.toNumber()]);return Z}isExteriorRing(){if(this._isExteriorRing===void 0){let k=this.enclosingRing();this._isExteriorRing=k?!k.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let k=this.events[0];for(let A=1,T=this.events.length;A<T;A++){let O=this.events[A];yi.compare(k,O)>0&&(k=O)}let B=k.segment.prevInResult(),P=B?B.prevInResult():null;for(;;){if(!B)return null;if(!P)return B.ringOut;if(P.ringOut!==B.ringOut)return P.ringOut?.enclosingRing()!==B.ringOut?B.ringOut:B.ringOut?.enclosingRing();B=P.prevInResult(),P=B?B.prevInResult():null}}},Ya=class{exteriorRing;interiorRings;constructor(C){this.exteriorRing=C,C.poly=this,this.interiorRings=[]}addInterior(C){this.interiorRings.push(C),C.poly=this}getGeom(){let C=this.exteriorRing.getGeom();if(C===null)return null;let k=[C];for(let B=0,P=this.interiorRings.length;B<P;B++){let A=this.interiorRings[B].getGeom();A!==null&&k.push(A)}return k}},go=class{rings;polys;constructor(C){this.rings=C,this.polys=this._composePolys(C)}getGeom(){let C=[];for(let k=0,B=this.polys.length;k<B;k++){let P=this.polys[k].getGeom();P!==null&&C.push(P)}return C}_composePolys(C){let k=[];for(let B=0,P=C.length;B<P;B++){let A=C[B];if(!A.poly)if(A.isExteriorRing())k.push(new Ya(A));else{let T=A.enclosingRing();T?.poly||k.push(new Ya(T)),T?.poly?.addInterior(A)}}return k}},yo=class{queue;tree;segments;constructor(C,k=Gs.compare){this.queue=C,this.tree=new Rs(k),this.segments=[]}process(C){let k=C.segment,B=[];if(C.consumedBy)return C.isLeft?this.queue.delete(C.otherSE):this.tree.delete(k),B;C.isLeft&&this.tree.add(k);let P=k,A=k;do P=this.tree.lastBefore(P);while(P!=null&&P.consumedBy!=null);do A=this.tree.firstAfter(A);while(A!=null&&A.consumedBy!=null);if(C.isLeft){let T=null;if(P){let R=P.getIntersection(k);if(R!==null&&(k.isAnEndpoint(R)||(T=R),!P.isAnEndpoint(R))){let Z=this._splitSafely(P,R);for(let U=0,Q=Z.length;U<Q;U++)B.push(Z[U])}}let O=null;if(A){let R=A.getIntersection(k);if(R!==null&&(k.isAnEndpoint(R)||(O=R),!A.isAnEndpoint(R))){let Z=this._splitSafely(A,R);for(let U=0,Q=Z.length;U<Q;U++)B.push(Z[U])}}if(T!==null||O!==null){let R=null;T===null?R=O:O===null?R=T:R=yi.comparePoints(T,O)<=0?T:O,this.queue.delete(k.rightSE),B.push(k.rightSE);let Z=k.split(R);for(let U=0,Q=Z.length;U<Q;U++)B.push(Z[U])}B.length>0?(this.tree.delete(k),B.push(C)):(this.segments.push(k),k.prev=P)}else{if(P&&A){let T=P.getIntersection(A);if(T!==null){if(!P.isAnEndpoint(T)){let O=this._splitSafely(P,T);for(let R=0,Z=O.length;R<Z;R++)B.push(O[R])}if(!A.isAnEndpoint(T)){let O=this._splitSafely(A,T);for(let R=0,Z=O.length;R<Z;R++)B.push(O[R])}}}this.tree.delete(k)}return B}_splitSafely(C,k){this.tree.delete(C);let B=C.rightSE;this.queue.delete(B);let P=C.split(k);return P.push(B),C.consumedBy===void 0&&this.tree.add(C),P}},vo=class{type;numMultiPolys;run(C,k,B){wr.type=C;let P=[new Xa(k,!0)];for(let Z=0,U=B.length;Z<U;Z++)P.push(new Xa(B[Z],!1));if(wr.numMultiPolys=P.length,wr.type==="difference"){let Z=P[0],U=1;for(;U<P.length;)za(P[U].bbox,Z.bbox)!==null?U++:P.splice(U,1)}if(wr.type==="intersection")for(let Z=0,U=P.length;Z<U;Z++){let Q=P[Z];for(let Y=Z+1,ot=P.length;Y<ot;Y++)if(za(Q.bbox,P[Y].bbox)===null)return[]}let A=new Rs(yi.compare);for(let Z=0,U=P.length;Z<U;Z++){let Q=P[Z].getSweepEvents();for(let Y=0,ot=Q.length;Y<ot;Y++)A.add(Q[Y])}let T=new yo(A),O=null;for(A.size!=0&&(O=A.first(),A.delete(O));O;){let Z=T.process(O);for(let U=0,Q=Z.length;U<Q;U++){let Y=Z[U];Y.consumedBy===void 0&&A.add(Y)}A.size!=0?(O=A.first(),A.delete(O)):O=null}Pi.reset();let R=mo.factory(T.segments);return new go(R).getGeom()}},wr=new vo,Ns=wr,Lo=0,Gs=class Vs{id;leftSE;rightSE;rings;windings;ringOut;consumedBy;prev;_prevInResult;_beforeState;_afterState;_isInResult;static compare(k,B){let P=k.leftSE.point.x,A=B.leftSE.point.x,T=k.rightSE.point.x,O=B.rightSE.point.x;if(O.isLessThan(P))return 1;if(T.isLessThan(A))return-1;let R=k.leftSE.point.y,Z=B.leftSE.point.y,U=k.rightSE.point.y,Q=B.rightSE.point.y;if(P.isLessThan(A)){if(Z.isLessThan(R)&&Z.isLessThan(U))return 1;if(Z.isGreaterThan(R)&&Z.isGreaterThan(U))return-1;let Y=k.comparePoint(B.leftSE.point);if(Y<0)return 1;if(Y>0)return-1;let ot=B.comparePoint(k.rightSE.point);return ot!==0?ot:-1}if(P.isGreaterThan(A)){if(R.isLessThan(Z)&&R.isLessThan(Q))return-1;if(R.isGreaterThan(Z)&&R.isGreaterThan(Q))return 1;let Y=B.comparePoint(k.leftSE.point);if(Y!==0)return Y;let ot=k.comparePoint(B.rightSE.point);return ot<0?1:ot>0?-1:1}if(R.isLessThan(Z))return-1;if(R.isGreaterThan(Z))return 1;if(T.isLessThan(O)){let Y=B.comparePoint(k.rightSE.point);if(Y!==0)return Y}if(T.isGreaterThan(O)){let Y=k.comparePoint(B.rightSE.point);if(Y<0)return 1;if(Y>0)return-1}if(!T.eq(O)){let Y=U.minus(R),ot=T.minus(P),ut=Q.minus(Z),vt=O.minus(A);if(Y.isGreaterThan(ot)&&ut.isLessThan(vt))return 1;if(Y.isLessThan(ot)&&ut.isGreaterThan(vt))return-1}return T.isGreaterThan(O)?1:T.isLessThan(O)||U.isLessThan(Q)?-1:U.isGreaterThan(Q)?1:k.id<B.id?-1:k.id>B.id?1:0}constructor(k,B,P,A){this.id=++Lo,this.leftSE=k,k.segment=this,k.otherSE=B,this.rightSE=B,B.segment=this,B.otherSE=k,this.rings=P,this.windings=A}static fromRing(k,B,P){let A,T,O,R=yi.comparePoints(k,B);if(R<0)A=k,T=B,O=1;else if(R>0)A=B,T=k,O=-1;else throw new Error(`Tried to create degenerate segment at [${k.x}, ${k.y}]`);let Z=new yi(A,!0),U=new yi(T,!1);return new Vs(Z,U,[P],[O])}replaceRightSE(k){this.rightSE=k,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let k=this.leftSE.point.y,B=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:k.isLessThan(B)?k:B},ur:{x:this.rightSE.point.x,y:k.isGreaterThan(B)?k:B}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(k){return k.x.eq(this.leftSE.point.x)&&k.y.eq(this.leftSE.point.y)||k.x.eq(this.rightSE.point.x)&&k.y.eq(this.rightSE.point.y)}comparePoint(k){return Pi.orient(this.leftSE.point,k,this.rightSE.point)}getIntersection(k){let B=this.bbox(),P=k.bbox(),A=za(B,P);if(A===null)return null;let T=this.leftSE.point,O=this.rightSE.point,R=k.leftSE.point,Z=k.rightSE.point,U=Mr(B,R)&&this.comparePoint(R)===0,Q=Mr(P,T)&&k.comparePoint(T)===0,Y=Mr(B,Z)&&this.comparePoint(Z)===0,ot=Mr(P,O)&&k.comparePoint(O)===0;if(Q&&U)return ot&&!Y?O:!ot&&Y?Z:null;if(Q)return Y&&T.x.eq(Z.x)&&T.y.eq(Z.y)?null:T;if(U)return ot&&O.x.eq(R.x)&&O.y.eq(R.y)?null:R;if(ot&&Y)return null;if(ot)return O;if(Y)return Z;let ut=_o(T,this.vector(),R,k.vector());return ut===null||!Mr(A,ut)?null:Pi.snap(ut)}split(k){let B=[],P=k.events!==void 0,A=new yi(k,!0),T=new yi(k,!1),O=this.rightSE;this.replaceRightSE(T),B.push(T),B.push(A);let R=new Vs(A,O,this.rings.slice(),this.windings.slice());return yi.comparePoints(R.leftSE.point,R.rightSE.point)>0&&R.swapEvents(),yi.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),P&&(A.checkForConsuming(),T.checkForConsuming()),B}swapEvents(){let k=this.rightSE;this.rightSE=this.leftSE,this.leftSE=k,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let B=0,P=this.windings.length;B<P;B++)this.windings[B]*=-1}consume(k){let B=this,P=k;for(;B.consumedBy;)B=B.consumedBy;for(;P.consumedBy;)P=P.consumedBy;let A=Vs.compare(B,P);if(A!==0){if(A>0){let T=B;B=P,P=T}if(B.prev===P){let T=B;B=P,P=T}for(let T=0,O=P.rings.length;T<O;T++){let R=P.rings[T],Z=P.windings[T],U=B.rings.indexOf(R);U===-1?(B.rings.push(R),B.windings.push(Z)):B.windings[U]+=Z}P.rings=null,P.windings=null,P.consumedBy=B,P.leftSE.consumedBy=B.leftSE,P.rightSE.consumedBy=B.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let k=this.prev.consumedBy||this.prev;this._beforeState=k.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let k=this.beforeState();this._afterState={rings:k.rings.slice(0),windings:k.windings.slice(0),multiPolys:[]};let B=this._afterState.rings,P=this._afterState.windings,A=this._afterState.multiPolys;for(let R=0,Z=this.rings.length;R<Z;R++){let U=this.rings[R],Q=this.windings[R],Y=B.indexOf(U);Y===-1?(B.push(U),P.push(Q)):P[Y]+=Q}let T=[],O=[];for(let R=0,Z=B.length;R<Z;R++){if(P[R]===0)continue;let U=B[R],Q=U.poly;if(O.indexOf(Q)===-1)if(U.isExterior)T.push(Q);else{O.indexOf(Q)===-1&&O.push(Q);let Y=T.indexOf(U.poly);Y!==-1&&T.splice(Y,1)}}for(let R=0,Z=T.length;R<Z;R++){let U=T[R].multiPoly;A.indexOf(U)===-1&&A.push(U)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let k=this.beforeState().multiPolys,B=this.afterState().multiPolys;switch(Ns.type){case"union":{let P=k.length===0,A=B.length===0;this._isInResult=P!==A;break}case"intersection":{let P,A;k.length<B.length?(P=k.length,A=B.length):(P=B.length,A=k.length),this._isInResult=A===Ns.numMultiPolys&&P<A;break}case"xor":{let P=Math.abs(k.length-B.length);this._isInResult=P%2===1;break}case"difference":{let P=A=>A.length===1&&A[0].isSubject;this._isInResult=P(k)!==P(B);break}}return this._isInResult}},$a=class{poly;isExterior;segments;bbox;constructor(C,k,B){if(!Array.isArray(C)||C.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=k,this.isExterior=B,this.segments=[],typeof C[0][0]!="number"||typeof C[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let P=Pi.snap({x:new gi(C[0][0]),y:new gi(C[0][1])});this.bbox={ll:{x:P.x,y:P.y},ur:{x:P.x,y:P.y}};let A=P;for(let T=1,O=C.length;T<O;T++){if(typeof C[T][0]!="number"||typeof C[T][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let R=Pi.snap({x:new gi(C[T][0]),y:new gi(C[T][1])});R.x.eq(A.x)&&R.y.eq(A.y)||(this.segments.push(Gs.fromRing(A,R,this)),R.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=R.x),R.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=R.y),R.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=R.x),R.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=R.y),A=R)}(!P.x.eq(A.x)||!P.y.eq(A.y))&&this.segments.push(Gs.fromRing(A,P,this))}getSweepEvents(){let C=[];for(let k=0,B=this.segments.length;k<B;k++){let P=this.segments[k];C.push(P.leftSE),C.push(P.rightSE)}return C}},bo=class{multiPoly;exteriorRing;interiorRings;bbox;constructor(C,k){if(!Array.isArray(C))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new $a(C[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let B=1,P=C.length;B<P;B++){let A=new $a(C[B],this,!1);A.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=A.bbox.ll.x),A.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=A.bbox.ll.y),A.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=A.bbox.ur.x),A.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=A.bbox.ur.y),this.interiorRings.push(A)}this.multiPoly=k}getSweepEvents(){let C=this.exteriorRing.getSweepEvents();for(let k=0,B=this.interiorRings.length;k<B;k++){let P=this.interiorRings[k].getSweepEvents();for(let A=0,T=P.length;A<T;A++)C.push(P[A])}return C}},Xa=class{isSubject;polys;bbox;constructor(C,k){if(!Array.isArray(C))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof C[0][0][0]=="number"&&(C=[C])}catch{}this.polys=[],this.bbox={ll:{x:new gi(Number.POSITIVE_INFINITY),y:new gi(Number.POSITIVE_INFINITY)},ur:{x:new gi(Number.NEGATIVE_INFINITY),y:new gi(Number.NEGATIVE_INFINITY)}};for(let B=0,P=C.length;B<P;B++){let A=new bo(C[B],this);A.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=A.bbox.ll.x),A.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=A.bbox.ll.y),A.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=A.bbox.ur.x),A.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=A.bbox.ur.y),this.polys.push(A)}this.isSubject=k}getSweepEvents(){let C=[];for(let k=0,B=this.polys.length;k<B;k++){let P=this.polys[k].getSweepEvents();for(let A=0,T=P.length;A<T;A++)C.push(P[A])}return C}},Co=(C,...k)=>Ns.run("intersection",C,k),xo=(C,...k)=>Ns.run("difference",C,k);Pi.set;function Zs(C){let k={type:"Feature"};return k.geometry=C,k}function js(C){return C.type==="Feature"?C.geometry:C}function Ja(C){return C&&C.geometry&&C.geometry.coordinates?C.geometry.coordinates:C}function ko(C){return Zs({type:"LineString",coordinates:C})}function Mo(C){return Zs({type:"MultiLineString",coordinates:C})}function Qa(C){return Zs({type:"Polygon",coordinates:C})}function to(C){return Zs({type:"MultiPolygon",coordinates:C})}function wo(C,k){let B=js(C),P=js(k),A=Co(B.coordinates,P.coordinates);return A.length===0?null:A.length===1?Qa(A[0]):to(A)}function Eo(C,k){let B=js(C),P=js(k),A=xo(B.coordinates,P.coordinates);return A.length===0?null:A.length===1?Qa(A[0]):to(A)}function eo(C){return Array.isArray(C)?1+eo(C[0]):-1}function Bo(C){C instanceof L.Polyline&&(C=C.toGeoJSON(15));let k=Ja(C),B=eo(k),P=[];return B>1?k.forEach(A=>{P.push(ko(A))}):P.push(C),P}function Po(C){let k=[];return C.eachLayer(B=>{k.push(Ja(B.toGeoJSON(15)))}),Mo(k)}fe.Cut=fe.Polygon.extend({initialize(C){this._map=C,this._shape="Cut",this.toolbarButtonName="cutPolygon"},_finishShape(){if(this._editedLayers=[],!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!0,this._layer.getLatLngs()[0]),this._doesSelfIntersect)||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;let C=this._layer.getLatLngs();if(C.length<=2)return;let k=L.polygon(C,this.options.pathOptions);k._latlngInfos=this._layer._latlngInfo,this.cut(k),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex,this._editedLayers.forEach(({layer:P,originalLayer:A})=>{this._fireCut(A,P,A),this._fireCut(this._map,P,A),A.pm._fireEdit()}),this._editedLayers=[];let B=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(B))},cut(C){let k=this._map._layers,B=C._latlngInfos||[];Object.keys(k).map(P=>k[P]).filter(P=>P.pm).filter(P=>!P._pmTempLayer).filter(P=>!L.PM.optIn&&!P.options.pmIgnore||L.PM.optIn&&P.options.pmIgnore===!1).filter(P=>P instanceof L.Polyline).filter(P=>P!==C).filter(P=>P.pm.options.allowCutting).filter(P=>this.options.layersToCut&&L.Util.isArray(this.options.layersToCut)&&this.options.layersToCut.length>0?this.options.layersToCut.indexOf(P)>-1:!0).filter(P=>!this._layerGroup.hasLayer(P)).filter(P=>{try{let A=!!Ne(C.toGeoJSON(15),P.toGeoJSON(15)).features.length>0;return A||P instanceof L.Polyline&&!(P instanceof L.Polygon)?A:!!wo(C.toGeoJSON(15),P.toGeoJSON(15))}catch{return P instanceof L.Polygon&&console.error("You can't cut polygons with self-intersections"),!1}}).forEach(P=>{let A;if(P instanceof L.Polygon){A=L.polygon(P.getLatLngs());let Z=A.getLatLngs();B.forEach(U=>{if(U&&U.snapInfo){let{latlng:Q}=U,Y=this._calcClosestLayer(Q,[A]);if(Y&&Y.segment&&Y.distance<this.options.snapDistance){let{segment:ot}=Y;if(ot&&ot.length===2){let{indexPath:ut,parentPath:vt,newIndex:xt}=L.PM.Utils._getIndexFromSegment(Z,ot);(ut.length>1?(0,Fa.default)(Z,vt):Z).splice(xt,0,Q)}}}})}else A=P;let T=this._cutLayer(C,A),O=L.geoJSON(T,P.options);O.getLayers().length===1&&([O]=O.getLayers()),this._setPane(O,"layerPane");let R=O.addTo(this._map.pm._getContainingLayer());if(R.pm.enable(P.pm.options),R.pm.disable(),P._pmTempLayer=!0,C._pmTempLayer=!0,P.remove(),P.removeFrom(this._map.pm._getContainingLayer()),C.remove(),C.removeFrom(this._map.pm._getContainingLayer()),R.getLayers&&R.getLayers().length===0&&this._map.pm.removeLayer({target:R}),R instanceof L.LayerGroup?(R.eachLayer(Z=>{this._addDrawnLayerProp(Z)}),this._addDrawnLayerProp(R)):this._addDrawnLayerProp(R),this.options.layersToCut&&L.Util.isArray(this.options.layersToCut)&&this.options.layersToCut.length>0){let Z=this.options.layersToCut.indexOf(P);Z>-1&&this.options.layersToCut.splice(Z,1)}this._editedLayers.push({layer:R,originalLayer:P})})},_cutLayer(C,k){let B=L.geoJSON(),P;if(k instanceof L.Polygon)P=Eo(k.toGeoJSON(15),C.toGeoJSON(15));else{let A=Bo(k);A.forEach(T=>{let O=Ta(T,C.toGeoJSON(15)),R;O&&O.features.length>0?R=L.geoJSON(O):R=L.geoJSON(T),R.getLayers().forEach(Z=>{As(C.toGeoJSON(15),Z.toGeoJSON(15))||Z.addTo(B)})}),A.length>1?P=Po(B):P=B.toGeoJSON(15)}return P},_change:L.Util.falseFn}),fe.Text=fe.extend({initialize(C){this._map=C,this._shape="Text",this.toolbarButtonName="drawText"},enable(C){L.Util.setOptions(this,C),this._enabled=!0,this._map.on("click",this._createMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._hintMarker=L.marker(this._map.getCenter(),{interactive:!1,zIndexOffset:100,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Wt("tooltips.placeText"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._layer=this._hintMarker,this._map.on("mousemove",this._syncHintMarker,this),this._map.getContainer().classList.add("geoman-draw-cursor"),this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.off("click",this._createMarker,this),this._hintMarker?.remove(),this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("mousemove",this._syncHintMarker,this),this._map.off("mousemove",this._showHintMarkerAfterMoving,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(C){this.enabled()?this.disable():this.enable(C)},_syncHintMarker(C){if(this._hintMarker.setLatLng(C.latlng),this.options.snappable){let k=C;k.target=this._hintMarker,this._handleSnapping(k)}},_createMarker(C){if(!C.latlng||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;this._hintMarker._snapped||this._hintMarker.setLatLng(C.latlng);let k=this._hintMarker.getLatLng();if(this.textArea=this._createTextArea(),this.options.textOptions?.className){let A=this.options.textOptions.className.split(" ");this.textArea.classList.add(...A)}let B=this._createTextIcon(this.textArea),P=new L.Marker(k,{textMarker:!0,_textMarkerOverPM:!0,icon:B});if(this._setPane(P,"markerPane"),this._finishLayer(P),P.pm||(P.options.draggable=!1),P.addTo(this._map.pm._getContainingLayer()),P.pm){P.pm.textArea=this.textArea,L.setOptions(P.pm,{removeIfEmpty:this.options.textOptions?.removeIfEmpty??!0});let A=this.options.textOptions?.focusAfterDraw??!0;P.pm._createTextMarker(A),this.options.textOptions?.text&&P.pm.setText(this.options.textOptions.text)}this._fireCreate(P),this._cleanupSnapping(),this.disable(),this.options.continueDrawing&&this._map.once("mousemove",this._showHintMarkerAfterMoving,this)},_showHintMarkerAfterMoving(C){this.enable(),this._hintMarker.setLatLng(C.latlng)},_createTextArea(){let C=document.createElement("textarea");return C.readOnly=!0,C.classList.add("pm-textarea","pm-disabled"),C},_createTextIcon(C){return L.divIcon({className:"pm-text-marker",html:C})}});var So={enableLayerDrag(){if(!this.options.draggable||!this._layer._map)return;this.disable(),this._layerDragEnabled=!0,this._map||(this._map=this._layer._map),(this._layer instanceof L.Marker||this._layer instanceof L.ImageOverlay)&&L.DomEvent.on(this._getDOMElem(),"dragstart",this._stopDOMImageDrag),this._layer.dragging&&this._layer.dragging.disable(),this._tempDragCoord=null,Ni(this._layer)instanceof L.Canvas?(this._layer.on("mouseout",this.removeDraggingClass,this),this._layer.on("mouseover",this.addDraggingClass,this)):this.addDraggingClass(),this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!0;let C=this._getDOMElem();C&&(Ni(this._layer)instanceof L.Canvas?(this._layer.on("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._addTouchEvents(C)):L.DomEvent.on(C,"touchstart mousedown",this._simulateMouseDownEvent,this)),this._fireDragEnable()},disableLayerDrag(){this._layerDragEnabled=!1,Ni(this._layer)instanceof L.Canvas?(this._layer.off("mouseout",this.removeDraggingClass,this),this._layer.off("mouseover",this.addDraggingClass,this)):this.removeDraggingClass(),this._originalMapDragState&&this._dragging&&this._map.dragging.enable(),this._safeToCacheDragState=!1,this._layer.dragging&&this._layer.dragging.disable();let C=this._getDOMElem();C&&(Ni(this._layer)instanceof L.Canvas?(this._layer.off("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._removeTouchEvents(C)):L.DomEvent.off(C,"touchstart mousedown",this._simulateMouseDownEvent,this)),this._layerDragged&&this._fireUpdate(),this._layerDragged=!1,this._fireDragDisable()},dragging(){return this._dragging},layerDragEnabled(){return!!this._layerDragEnabled},_simulateMouseDownEvent(C){let k=C.touches?C.touches[0]:C,B={originalEvent:k,target:this._layer};return B.containerPoint=this._map.mouseEventToContainerPoint(k),B.latlng=this._map.containerPointToLatLng(B.containerPoint),this._dragMixinOnMouseDown(B),!1},_simulateMouseMoveEvent(C){let k=C.touches?C.touches[0]:C,B={originalEvent:k,target:this._layer};return B.containerPoint=this._map.mouseEventToContainerPoint(k),B.latlng=this._map.containerPointToLatLng(B.containerPoint),this._dragMixinOnMouseMove(B),!1},_simulateMouseUpEvent(C){let k={originalEvent:C.touches?C.touches[0]:C,target:this._layer};return C.type.indexOf("touch")===-1&&(k.containerPoint=this._map.mouseEventToContainerPoint(C),k.latlng=this._map.containerPointToLatLng(k.containerPoint)),this._dragMixinOnMouseUp(k),!1},_dragMixinOnMouseDown(C){if(C.originalEvent.button>0)return;this._overwriteEventIfItComesFromMarker(C);let k=C._fromLayerSync,B=this._syncLayers("_dragMixinOnMouseDown",C);if(this._layer instanceof L.Marker&&(this.options.snappable&&!k&&!B?this._initSnappableMarkers():this._disableSnapping()),this._layer instanceof L.CircleMarker){let P="resizeableCircleMarker";this._layer instanceof L.Circle&&(P="resizeableCircle"),this.options.snappable&&!k&&!B?this._layer.pm.options[P]||this._initSnappableMarkersDrag():this._layer.pm.options[P]?this._layer.pm._disableSnapping():this._layer.pm._disableSnappingDrag()}this._safeToCacheDragState&&(this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!1),this._tempDragCoord=C.latlng,L.DomEvent.on(this._map.getContainer(),"touchend mouseup",this._simulateMouseUpEvent,this),L.DomEvent.on(this._map.getContainer(),"touchmove mousemove",this._simulateMouseMoveEvent,this)},_dragMixinOnMouseMove(C){this._overwriteEventIfItComesFromMarker(C);let k=this._getDOMElem();this._syncLayers("_dragMixinOnMouseMove",C),this._dragging||(this._dragging=!0,L.DomUtil.addClass(k,"leaflet-pm-dragging"),this._layer instanceof L.Marker||this._layer.bringToFront(),this._originalMapDragState&&this._map.dragging.disable(),this._fireDragStart()),this._tempDragCoord||(this._tempDragCoord=C.latlng),this._onLayerDrag(C),this._layer instanceof L.CircleMarker&&this._layer.pm._updateHiddenPolyCircle()},_dragMixinOnMouseUp(C){let k=this._getDOMElem();return this._syncLayers("_dragMixinOnMouseUp",C),this._originalMapDragState&&this._map.dragging.enable(),this._safeToCacheDragState=!0,L.DomEvent.off(this._map.getContainer(),"touchmove mousemove",this._simulateMouseMoveEvent,this),L.DomEvent.off(this._map.getContainer(),"touchend mouseup",this._simulateMouseUpEvent,this),this._dragging?(this._layer instanceof L.CircleMarker&&this._layer.pm._updateHiddenPolyCircle(),this._layerDragged=!0,window.setTimeout(()=>{this._dragging=!1,k&&L.DomUtil.removeClass(k,"leaflet-pm-dragging"),this._fireDragEnd(),this._fireEdit(),this._layerEdited=!0},10),!0):!1},_onLayerDrag(C){let{latlng:k}=C,B={lat:k.lat-this._tempDragCoord.lat,lng:k.lng-this._tempDragCoord.lng},P=A=>A.map(T=>{if(Array.isArray(T))return P(T);let O={lat:T.lat+B.lat,lng:T.lng+B.lng};return(T.alt||T.alt===0)&&(O.alt=T.alt),O});if(this._layer instanceof L.Circle&&this._layer.options.resizeableCircle||this._layer instanceof L.CircleMarker&&this._layer.options.resizeableCircleMarker){let A=P([this._layer.getLatLng()]);this._layer.setLatLng(A[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.CircleMarker||this._layer instanceof L.Marker){let A=this._layer.getLatLng();this._layer._snapped&&(A=this._layer._orgLatLng);let T=P([A]);this._layer.setLatLng(T[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.ImageOverlay){let A=P([this._layer.getBounds().getNorthWest(),this._layer.getBounds().getSouthEast()]);this._layer.setBounds(A),this._fireChange(this._layer.getBounds(),"Edit")}else{let A=P(this._layer.getLatLngs());this._layer.setLatLngs(A),this._fireChange(this._layer.getLatLngs(),"Edit")}this._tempDragCoord=k,C.layer=this._layer,this._fireDrag(C)},addDraggingClass(){let C=this._getDOMElem();C&&L.DomUtil.addClass(C,"leaflet-pm-draggable")},removeDraggingClass(){let C=this._getDOMElem();C&&L.DomUtil.removeClass(C,"leaflet-pm-draggable")},_getDOMElem(){let C=null;return this._layer._path?C=this._layer._path:this._layer._renderer&&this._layer._renderer._container?C=this._layer._renderer._container:this._layer._image?C=this._layer._image:this._layer._icon&&(C=this._layer._icon),C},_overwriteEventIfItComesFromMarker(C){C.target.getLatLng&&(!C.target._radius||C.target._radius<=10)&&(C.containerPoint=this._map.mouseEventToContainerPoint(C.originalEvent),C.latlng=this._map.containerPointToLatLng(C.containerPoint))},_syncLayers(C,k){if(this.enabled())return!1;if(!k._fromLayerSync&&this._layer===k.target&&this.options.syncLayersOnDrag){k._fromLayerSync=!0;let B=[];if(L.Util.isArray(this.options.syncLayersOnDrag))B=this.options.syncLayersOnDrag,this.options.syncLayersOnDrag.forEach(P=>{P instanceof L.LayerGroup&&(B=B.concat(P.pm.getLayers(!0)))});else if(this.options.syncLayersOnDrag===!0&&this._parentLayerGroup)for(let P in this._parentLayerGroup){let A=this._parentLayerGroup[P];A.pm&&(B=A.pm.getLayers(!0))}return L.Util.isArray(B)&&B.length>0&&(B=B.filter(P=>!!P.pm).filter(P=>!!P.pm.options.draggable),B.forEach(P=>{P!==this._layer&&P.pm[C]&&(P._snapped=!1,P.pm[C](k))})),B.length>0}return!1},_stopDOMImageDrag(C){return C.preventDefault(),!1}},Ao=So,To=et(hi());function Do(C,k,B,P){return B.unproject(k.transform(B.project(C,P)),P)}function io(C,k,B){let P=B.getMaxZoom();if(P===1/0&&(P=B.getZoom()),L.Util.isArray(C)){let A=[];return C.forEach(T=>{A.push(io(T,k,B))}),A}return C instanceof L.LatLng?Do(C,k,B,P):null}function Fn(C,k){k instanceof L.Layer&&(k=k.getLatLng());let B=C.getMaxZoom();return B===1/0&&(B=C.getZoom()),C.project(k,B)}function Us(C,k){let B=C.getMaxZoom();return B===1/0&&(B=C.getZoom()),C.unproject(k,B)}var Oo={_onRotateStart(C){this._preventRenderingMarkers(!0),this._rotationOriginLatLng=this._getRotationCenter().clone(),this._rotationOriginPoint=Fn(this._map,this._rotationOriginLatLng),this._rotationStartPoint=Fn(this._map,C.target.getLatLng()),this._initialRotateLatLng=ri(this._layer),this._startAngle=this.getAngle();let k=ri(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._fireRotationStart(this._rotationLayer,k),this._fireRotationStart(this._map,k)},_onRotate(C){let k=Fn(this._map,C.target.getLatLng()),B=this._rotationStartPoint,P=this._rotationOriginPoint,A=Math.atan2(k.y-P.y,k.x-P.x)-Math.atan2(B.y-P.y,B.x-P.x);this._layer.setLatLngs(this._rotateLayer(A,this._initialRotateLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));let T=this;function O(Q,Y=[],ot=-1){if(ot>-1&&Y.push(ot),L.Util.isArray(Q[0]))Q.forEach((ut,vt)=>O(ut,Y.slice(),vt));else{let ut=Y.length>0?(0,To.default)(T._markers,Y):T._markers[0];Q.forEach((vt,xt)=>{ut[xt].setLatLng(vt)})}}O(this._layer.getLatLngs());let R=ri(this._rotationLayer);this._rotationLayer.setLatLngs(this._rotateLayer(A,this._rotationLayer.pm._rotateOrgLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));let Z=A*180/Math.PI;Z=Z<0?Z+360:Z;let U=Z+this._startAngle;this._setAngle(U),this._rotationLayer.pm._setAngle(U),this._fireRotation(this._rotationLayer,Z,R),this._fireRotation(this._map,Z,R),this._rotationLayer.pm._fireChange(this._rotationLayer.getLatLngs(),"Rotation")},_onRotateEnd(){let C=this._startAngle;delete this._rotationOriginLatLng,delete this._rotationOriginPoint,delete this._rotationStartPoint,delete this._initialRotateLatLng,delete this._startAngle;let k=ri(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._rotationLayer.pm._rotateOrgLatLng=ri(this._rotationLayer),this._fireRotationEnd(this._rotationLayer,C,k),this._fireRotationEnd(this._map,C,k),this._rotationLayer.pm._fireEdit(this._rotationLayer,"Rotation"),this._preventRenderingMarkers(!1),this._layerRotated=!0},_rotateLayer(C,k,B,P,A){let T=Fn(A,B);return this._matrix=P.clone().rotate(C,T).flip(),io(k,this._matrix,A)},_setAngle(C){C=C<0?C+360:C,this._angle=C%360},_getRotationCenter(){if(this._rotationCenter)return this._rotationCenter;let C=L.polygon(this._layer.getLatLngs(),{stroke:!1,fill:!1,pmIgnore:!0}).addTo(this._layer._map),k=C.getCenter();return C.removeFrom(this._layer._map),k},enableRotate(){if(!this.options.allowRotation){this.disableRotate();return}this.rotateEnabled()&&this.disableRotate(),this._layer instanceof L.Rectangle&&this._angle===void 0&&this.setInitAngle(ur(this._layer._map,this._layer.getLatLngs()[0][0],this._layer.getLatLngs()[0][1])||0);let C={fill:!1,stroke:!1,pmIgnore:!1,snapIgnore:!0};this._rotatePoly=L.polygon(this._layer.getLatLngs(),C),this._rotatePoly._pmTempLayer=!0,this._rotatePoly.addTo(this._layer._map),this._rotatePoly.pm._setAngle(this.getAngle()),this._rotatePoly.pm.setRotationCenter(this.getRotationCenter()),this._rotatePoly.pm.setOptions(this._layer._map.pm.getGlobalOptions()),this._rotatePoly.pm.setOptions({rotate:!0,snappable:!1,hideMiddleMarkers:!0}),this._rotatePoly.pm._rotationLayer=this._layer,this._rotatePoly.pm.enable(),this._rotateOrgLatLng=ri(this._layer),this._rotateEnabled=!0,this._layer.on("remove",this.disableRotate,this),this._fireRotationEnable(this._layer),this._fireRotationEnable(this._layer._map)},disableRotate(){this.rotateEnabled()&&(this._rotatePoly.pm._layerRotated&&this._fireUpdate(),this._rotatePoly.pm._layerRotated=!1,this._rotatePoly.pm.disable(),this._rotatePoly.remove(),this._rotatePoly.pm.setOptions({rotate:!1}),this._rotatePoly=void 0,this._rotateOrgLatLng=void 0,this._layer.off("remove",this.disableRotate,this),this._rotateEnabled=!1,this._fireRotationDisable(this._layer),this._fireRotationDisable(this._layer._map))},rotateEnabled(){return!!this._rotateEnabled},rotateLayer(C){let k=this.getAngle(),B=this._layer.getLatLngs(),P=C*(Math.PI/180);this._layer.setLatLngs(this._rotateLayer(P,this._layer.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._layer._map)),this._rotateOrgLatLng=L.polygon(this._layer.getLatLngs()).getLatLngs(),this._setAngle(this.getAngle()+C),this.rotateEnabled()&&this._rotatePoly&&this._rotatePoly.pm.enabled()&&(this._rotatePoly.setLatLngs(this._rotateLayer(P,this._rotatePoly.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._rotatePoly._map)),this._rotatePoly.pm._initMarkers());let A=this.getAngle()-k;A=A<0?A+360:A,this._startAngle=k,this._fireRotation(this._layer,A,B,this._layer),this._fireRotation(this._map||this._layer._map,A,B,this._layer),delete this._startAngle,this._fireChange(this._layer.getLatLngs(),"Rotation")},rotateLayerToAngle(C){let k=C-this.getAngle();this.rotateLayer(k)},getAngle(){return this._angle||0},setInitAngle(C){this._setAngle(C)},getRotationCenter(){return this._getRotationCenter()},setRotationCenter(C){this._rotationCenter=C,this._rotatePoly&&this._rotatePoly.pm.setRotationCenter(C)}},Fo=Oo,Ro=L.Class.extend({includes:[Ao,cs,Fo,sn],options:{snappable:!0,snapDistance:20,allowSelfIntersection:!0,allowSelfIntersectionEdit:!1,preventMarkerRemoval:!1,removeLayerBelowMinVertexCount:!0,limitMarkersToCount:-1,hideMiddleMarkers:!1,snapSegment:!0,syncLayersOnDrag:!1,draggable:!0,allowEditing:!0,allowRemoval:!0,allowCutting:!0,allowRotation:!0,addVertexOn:"click",removeVertexOn:"contextmenu",removeVertexValidation:void 0,addVertexValidation:void 0,moveVertexValidation:void 0,resizeableCircleMarker:!1,resizeableCircle:!0,snapMiddle:!1,snapVertex:!0},setOptions(C){L.Util.setOptions(this,C)},getOptions(){return this.options},applyOptions(){},isPolygon(){return this._layer instanceof L.Polygon},getShape(){return this._shape},_setPane(C,k){k==="layerPane"?C.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":k==="vertexPane"?C.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":k==="markerPane"&&(C.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.markerPane||"markerPane")},remove(){(this._map||this._layer._map).pm.removeLayer({target:this._layer})},_vertexValidation(C,k){let B=k.target,P={layer:this._layer,marker:B,event:k},A="";return C==="move"?A="moveVertexValidation":C==="add"?A="addVertexValidation":C==="remove"&&(A="removeVertexValidation"),this.options[A]&&typeof this.options[A]=="function"&&!this.options[A](P)?(C==="move"&&(B._cancelDragEventChain=B.getLatLng()),!1):(B._cancelDragEventChain=null,!0)},_vertexValidationDrag(C){return C._cancelDragEventChain?(C._latlng=C._cancelDragEventChain,C.update(),!1):!0},_vertexValidationDragEnd(C){return C._cancelDragEventChain?(C._cancelDragEventChain=null,!1):!0}}),ve=Ro;ve.LayerGroup=L.Class.extend({initialize(C){this._layerGroup=C,this._layers=this.getLayers(),this._getMap(),this._layers.forEach(P=>this._initLayer(P));let k=P=>{if(P.layer._pmTempLayer)return;this._layers=this.getLayers();let A=this._layers.filter(T=>!T.pm._parentLayerGroup||!(this._layerGroup._leaflet_id in T.pm._parentLayerGroup));A.forEach(T=>{this._initLayer(T)}),A.length>0&&this._getMap()&&this._getMap().pm.globalEditModeEnabled()&&this.enabled()&&this.enable(this.getOptions())};this._layerGroup.on("layeradd",L.Util.throttle(k,100,this),this),this._layerGroup.on("layerremove",P=>{this._removeLayerFromGroup(P.target)},this);let B=P=>{P.target._pmTempLayer||(this._layers=this.getLayers())};this._layerGroup.on("layerremove",L.Util.throttle(B,100,this),this)},enable(C,k=[]){k.length===0&&(this._layers=this.getLayers()),this._options=C,this._layers.forEach(B=>{B instanceof L.LayerGroup?k.indexOf(B._leaflet_id)===-1&&(k.push(B._leaflet_id),B.pm.enable(C,k)):B.pm.enable(C)})},disable(C=[]){C.length===0&&(this._layers=this.getLayers()),this._layers.forEach(k=>{k instanceof L.LayerGroup?C.indexOf(k._leaflet_id)===-1&&(C.push(k._leaflet_id),k.pm.disable(C)):k.pm.disable()})},enabled(C=[]){return C.length===0&&(this._layers=this.getLayers()),!!this._layers.find(k=>k instanceof L.LayerGroup?C.indexOf(k._leaflet_id)===-1?(C.push(k._leaflet_id),k.pm.enabled(C)):!1:k.pm.enabled())},toggleEdit(C,k=[]){k.length===0&&(this._layers=this.getLayers()),this._options=C,this._layers.forEach(B=>{B instanceof L.LayerGroup?k.indexOf(B._leaflet_id)===-1&&(k.push(B._leaflet_id),B.pm.toggleEdit(C,k)):B.pm.toggleEdit(C)})},_initLayer(C){let k=L.Util.stamp(this._layerGroup);C.pm._parentLayerGroup||(C.pm._parentLayerGroup={}),C.pm._parentLayerGroup[k]=this._layerGroup},_removeLayerFromGroup(C){if(C.pm&&C.pm._layerGroup){let k=L.Util.stamp(this._layerGroup);delete C.pm._layerGroup[k]}},dragging(){return this._layers=this.getLayers(),this._layers?!!this._layers.find(C=>C.pm.dragging()):!1},getOptions(){return this.options},_getMap(){return this._map||this._layers.find(C=>!!C._map)?._map||null},getLayers(C=!1,k=!0,B=!0,P=[]){let A=[];return C?this._layerGroup.getLayers().forEach(T=>{A.push(T),T instanceof L.LayerGroup&&P.indexOf(T._leaflet_id)===-1&&(P.push(T._leaflet_id),A=A.concat(T.pm.getLayers(!0,!0,!0,P)))}):A=this._layerGroup.getLayers(),B&&(A=A.filter(T=>!(T instanceof L.LayerGroup))),k&&(A=A.filter(T=>!!T.pm),A=A.filter(T=>!T._pmTempLayer),A=A.filter(T=>!L.PM.optIn&&!T.options.pmIgnore||L.PM.optIn&&T.options.pmIgnore===!1)),A},setOptions(C,k=[]){k.length===0&&(this._layers=this.getLayers()),this.options=C,this._layers.forEach(B=>{B.pm&&(B instanceof L.LayerGroup?k.indexOf(B._leaflet_id)===-1&&(k.push(B._leaflet_id),B.pm.setOptions(C,k)):B.pm.setOptions(C))})}}),ve.Marker=ve.extend({_shape:"Marker",initialize(C){this._layer=C,this._enabled=!1,this._layer.on("dragend",this._onDragEnd,this)},enable(C={draggable:!0}){if(L.Util.setOptions(this,C),!this.options.allowEditing||!this._layer._map){this.disable();return}this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._layer.on("pm:dragstart",this._onDragStart,this),this._layer.on("pm:dragend",this._onMarkerDragEnd,this),this._fireEnable()},disable(){this.enabled()&&(this.disableLayerDrag(),this._layer.off("remove",this.disable,this),this._layer.off("contextmenu",this._removeMarker,this),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1)},enabled(){return this._enabled},toggleEdit(C){this.enabled()?this.disable():this.enable(C)},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping(),this.options.draggable?this.enableLayerDrag():this.disableLayerDrag(),this.options.preventMarkerRemoval||this._layer.on("contextmenu",this._removeMarker,this)},_removeMarker(C){let k=C.target;k.remove(),this._fireRemove(k),this._fireRemove(this._map,k)},_onDragStart(){this._map.pm.Draw.Marker._layerIsDragging=!0},_onMarkerDragEnd(){this._map.pm.Draw.Marker._layerIsDragging=!1},_onDragEnd(){this._fireEdit(),this._layerEdited=!0},_initSnappableMarkers(){let C=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0?!0:this.options.snapSegment,C.off("pm:drag",this._handleSnapping,this),C.on("pm:drag",this._handleSnapping,this),C.off("pm:dragend",this._cleanupSnapping,this),C.on("pm:dragend",this._cleanupSnapping,this),C.off("pm:dragstart",this._unsnap,this),C.on("pm:dragstart",this._unsnap,this)},_disableSnapping(){let C=this._layer;C.off("pm:drag",this._handleSnapping,this),C.off("pm:dragend",this._cleanupSnapping,this),C.off("pm:dragstart",this._unsnap,this)}});var Wi=et(hi()),Io={filterMarkerGroup(){this.markerCache=[],this.createCache(),this._layer.on("pm:edit",this.createCache,this),this.applyLimitFilters({}),this.throttledApplyLimitFilters||(this.throttledApplyLimitFilters=L.Util.throttle(this.applyLimitFilters,100,this)),this._layer.on("pm:disable",this._removeMarkerLimitEvents,this),this._layer.on("remove",this._removeMarkerLimitEvents,this),this.options.limitMarkersToCount>-1&&(this._layer.on("pm:vertexremoved",this._initMarkers,this),this._map.on("mousemove",this.throttledApplyLimitFilters,this))},_removeMarkerLimitEvents(){this._map.off("mousemove",this.throttledApplyLimitFilters,this),this._layer.off("pm:edit",this.createCache,this),this._layer.off("pm:disable",this._removeMarkerLimitEvents,this),this._layer.off("pm:vertexremoved",this._initMarkers,this)},createCache(){let C=[...this._markerGroup.getLayers(),...this.markerCache];this.markerCache=C.filter((k,B,P)=>P.indexOf(k)===B)},_removeFromCache(C){let k=this.markerCache.indexOf(C);k>-1&&this.markerCache.splice(k,1)},renderLimits(C){this.markerCache.forEach(k=>{C.includes(k)?this._markerGroup.addLayer(k):this._markerGroup.removeLayer(k)})},applyLimitFilters({latlng:C={lat:0,lng:0}}){if(this._preventRenderMarkers)return;let k=[...this._filterClosestMarkers(C)];this.renderLimits(k)},_filterClosestMarkers(C){let k=[...this.markerCache],B=this.options.limitMarkersToCount;return B===-1?k:(k.sort((P,A)=>{let T=P._latlng.distanceTo(C),O=A._latlng.distanceTo(C);return T-O}),k.filter((P,A)=>B>-1?A<B:!0))},_preventRenderMarkers:!1,_preventRenderingMarkers(C){this._preventRenderMarkers=!!C}},zo=Io;ve.Line=ve.extend({includes:[zo],_shape:"Line",initialize(C){this._layer=C,this._enabled=!1},enable(C){if(L.Util.setOptions(this,C),this._map=this._layer._map,!!this._map){if(!this.options.allowEditing){this.disable();return}this.enabled()&&this.disable(),this._enabled=!0,this._initMarkers(),this.applyOptions(),this._layer.on("remove",this.disable,this),this.options.allowSelfIntersection||this._layer.on("pm:vertexremoved",this._handleSelfIntersectionOnVertexRemoval,this),this.options.allowSelfIntersection?this.cachedColor=void 0:(this._layer.options.color!=="#f00000ff"?(this.cachedColor=this._layer.options.color,this.isRed=!1):this.isRed=!0,this._handleLayerStyle()),this._fireEnable()}},disable(){if(!this.enabled()||this._dragging)return;this._enabled=!1,this._markerGroup.clearLayers(),this._markerGroup.removeFrom(this._map),this._layer.off("remove",this.disable,this),this.options.allowSelfIntersection||this._layer.off("pm:vertexremoved",this._handleSelfIntersectionOnVertexRemoval,this);let C=this._layer._path?this._layer._path:this._layer._renderer._container;L.DomUtil.removeClass(C,"leaflet-pm-draggable"),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable()},enabled(){return this._enabled},toggleEdit(C){return this.enabled()?this.disable():this.enable(C),this.enabled()},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping()},_initMarkers(){let C=this._map,k=this._layer.getLatLngs();this._markerGroup&&(this._markerGroup.removeFrom(C),this._markerGroup.clearLayers()),this._markerGroup=new L.FeatureGroup,this._markerGroup._pmTempLayer=!0;let B=P=>{if(Array.isArray(P[0]))return P.map(B,this);let A=P.map(this._createMarker,this);return this.options.hideMiddleMarkers!==!0&&P.map((T,O)=>{let R=this.isPolygon()?(O+1)%P.length:O+1;return this._createMiddleMarker(A[O],A[R])}),A};this._markers=B(k),this.filterMarkerGroup(),C.addLayer(this._markerGroup)},_createMarker(C){let k=new L.Marker(C,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(k,"vertexPane"),k._pmTempLayer=!0,this.options.rotate?(k.on("dragstart",this._onRotateStart,this),k.on("drag",this._onRotate,this),k.on("dragend",this._onRotateEnd,this)):(k.on("click",this._onVertexClick,this),k.on("dragstart",this._onMarkerDragStart,this),k.on("move",this._onMarkerDrag,this),k.on("dragend",this._onMarkerDragEnd,this),this.options.preventMarkerRemoval||k.on(this.options.removeVertexOn,this._removeMarker,this)),this._markerGroup.addLayer(k),k},_createMiddleMarker(C,k){if(!C||!k)return!1;let B=L.PM.Utils.calcMiddleLatLng(this._map,C.getLatLng(),k.getLatLng()),P=this._createMarker(B),A=L.divIcon({className:"marker-icon marker-icon-middle"});return P.setIcon(A),P.leftM=C,P.rightM=k,C._middleMarkerNext=P,k._middleMarkerPrev=P,P.on(this.options.addVertexOn,this._onMiddleMarkerClick,this),P.on("movestart",this._onMiddleMarkerMoveStart,this),P},_onMiddleMarkerClick(C){let k=C.target;if(!this._vertexValidation("add",C))return;let B=L.divIcon({className:"marker-icon"});k.setIcon(B),this._addMarker(k,k.leftM,k.rightM)},_onMiddleMarkerMoveStart(C){let k=C.target;if(k.on("moveend",this._onMiddleMarkerMoveEnd,this),!this._vertexValidation("add",C)){k.on("move",this._onMiddleMarkerMovePrevent,this);return}k._dragging=!0,this._addMarker(k,k.leftM,k.rightM)},_onMiddleMarkerMovePrevent(C){let k=C.target;this._vertexValidationDrag(k)},_onMiddleMarkerMoveEnd(C){let k=C.target;if(k.off("move",this._onMiddleMarkerMovePrevent,this),k.off("moveend",this._onMiddleMarkerMoveEnd,this),!this._vertexValidationDragEnd(k))return;let B=L.divIcon({className:"marker-icon"});k.setIcon(B),setTimeout(()=>{delete k._dragging},100)},_addMarker(C,k,B){C.off("movestart",this._onMiddleMarkerMoveStart,this),C.off(this.options.addVertexOn,this._onMiddleMarkerClick,this);let P=C.getLatLng(),A=this._layer._latlngs;delete C.leftM,delete C.rightM;let{indexPath:T,index:O,parentPath:R}=L.PM.Utils.findDeepMarkerIndex(this._markers,k),Z=T.length>1?(0,Wi.default)(A,R):A,U=T.length>1?(0,Wi.default)(this._markers,R):this._markers;Z.splice(O+1,0,P),U.splice(O+1,0,C),this._layer.setLatLngs(A),this.options.hideMiddleMarkers!==!0&&(this._createMiddleMarker(k,C),this._createMiddleMarker(C,B)),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit"),this._fireVertexAdded(C,L.PM.Utils.findDeepMarkerIndex(this._markers,C).indexPath,P),this.options.snappable&&this._initSnappableMarkers()},hasSelfIntersection(){return Mn(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersectionOnVertexRemoval(){this._handleLayerStyle(!0)&&(this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers())},_handleLayerStyle(C){let k=this._layer,B,P;if(this.options.allowSelfIntersection?B=!1:(P=Mn(this._layer.toGeoJSON(15)),B=P.features.length>0),B){if(!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!0),this.isRed)return B;C?this._flashLayer():(k.setStyle({color:"#f00000ff"}),this.isRed=!0),this._fireIntersect(P)}else k.setStyle({color:this.cachedColor}),this.isRed=!1,!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!1);return B},_flashLayer(){this.cachedColor||(this.cachedColor=this._layer.options.color),this._layer.setStyle({color:"#f00000ff"}),this.isRed=!0,window.setTimeout(()=>{this._layer.setStyle({color:this.cachedColor}),this.isRed=!1},200)},_updateDisabledMarkerStyle(C,k){C.forEach(B=>{Array.isArray(B)?this._updateDisabledMarkerStyle(B,k):B._icon&&(k&&!this._checkMarkerAllowedToDrag(B)?L.DomUtil.addClass(B._icon,"vertexmarker-disabled"):L.DomUtil.removeClass(B._icon,"vertexmarker-disabled"))})},_removeMarker(C){let k=C.target;if(!this._vertexValidation("remove",C))return;this.options.allowSelfIntersection||(this._coordsBeforeEdit=ri(this._layer,this._layer.getLatLngs()));let B=this._layer.getLatLngs(),{indexPath:P,index:A,parentPath:T}=L.PM.Utils.findDeepMarkerIndex(this._markers,k);if(!P)return;let O=P.length>1?(0,Wi.default)(B,T):B,R=P.length>1?(0,Wi.default)(this._markers,T):this._markers,Z=T[T.length-1]>0&&this._layer instanceof L.Polygon;if(!this.options.removeLayerBelowMinVertexCount&&!Z&&(O.length<=2||this.isPolygon()&&O.length<=3)){this._flashLayer();return}O.splice(A,1),this._layer.setLatLngs(B),this.isPolygon()&&O.length<=2&&O.splice(0,O.length);let U=!1;if(O.length<=1&&(O.splice(0,O.length),T.length>1&&P.length>1&&(B=xn(B)),this._layer.setLatLngs(B),this._initMarkers(),U=!0),qt(B)||this._layer.remove(),B=xn(B),this._layer.setLatLngs(B),this._markers=xn(this._markers),!U&&(R=P.length>1?(0,Wi.default)(this._markers,T):this._markers,k._middleMarkerPrev&&(this._markerGroup.removeLayer(k._middleMarkerPrev),this._removeFromCache(k._middleMarkerPrev)),k._middleMarkerNext&&(this._markerGroup.removeLayer(k._middleMarkerNext),this._removeFromCache(k._middleMarkerNext)),this._markerGroup.removeLayer(k),this._removeFromCache(k),R)){let Q,Y;if(this.isPolygon()?(Q=(A+1)%R.length,Y=(A+(R.length-1))%R.length):(Y=A-1<0?void 0:A-1,Q=A+1>=R.length?void 0:A+1),Q!==Y){let ot=R[Y],ut=R[Q];this.options.hideMiddleMarkers!==!0&&this._createMiddleMarker(ot,ut)}R.splice(A,1)}this._fireEdit(),this._layerEdited=!0,this._fireVertexRemoved(k,P),this._fireChange(this._layer.getLatLngs(),"Edit")},updatePolygonCoordsFromMarkerDrag(C){let k=this._layer.getLatLngs(),B=C.getLatLng(),{indexPath:P,index:A,parentPath:T}=L.PM.Utils.findDeepMarkerIndex(this._markers,C),O=P.length>1?(0,Wi.default)(k,T):k;B.alt=O[A].alt,O.splice(A,1,B),this._layer.setLatLngs(k)},_getNeighborMarkers(C){let{indexPath:k,index:B,parentPath:P}=L.PM.Utils.findDeepMarkerIndex(this._markers,C),A=k.length>1?(0,Wi.default)(this._markers,P):this._markers,T=(B+1)%A.length,O=(B+(A.length-1))%A.length,R=A[O],Z=A[T];return{prevMarker:R,nextMarker:Z}},_checkMarkerAllowedToDrag(C){let{prevMarker:k,nextMarker:B}=this._getNeighborMarkers(C),P=L.polyline([k.getLatLng(),C.getLatLng()]),A=L.polyline([C.getLatLng(),B.getLatLng()]),T=Ne(this._layer.toGeoJSON(15),P.toGeoJSON(15)).features.filter(R=>{let Z=R.geometry.coordinates,U=L.latLng(Z[1],Z[0]);return!U.equals(k.getLatLng())&&!U.equals(C.getLatLng())}).length,O=Ne(this._layer.toGeoJSON(15),A.toGeoJSON(15)).features.filter(R=>{let Z=R.geometry.coordinates,U=L.latLng(Z[1],Z[0]);return!U.equals(B.getLatLng())&&!U.equals(C.getLatLng())}).length;return!(T<1&&O<1)},_onMarkerDragStart(C){let k=C.target;if(this._preventRenderingMarkers(!0),this.cachedColor||(this.cachedColor=this._layer.options.color),!this._vertexValidation("move",C))return;let{indexPath:B}=L.PM.Utils.findDeepMarkerIndex(this._markers,k);this._fireMarkerDragStart(C,B),this.options.allowSelfIntersection||(this._coordsBeforeEdit=ri(this._layer,this._layer.getLatLngs())),!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this.hasSelfIntersection()?this._markerAllowedToDrag=this._checkMarkerAllowedToDrag(k):this._markerAllowedToDrag=null},_onMarkerDrag(C){let k=C.target;if(!this._vertexValidationDrag(k))return;let{indexPath:B,index:P,parentPath:A}=L.PM.Utils.findDeepMarkerIndex(this._markers,k);if(!B)return;if(!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this.hasSelfIntersection()&&this._markerAllowedToDrag===!1){this._layer.setLatLngs(this._coordsBeforeEdit),this._initMarkers(),this._handleLayerStyle();return}this.updatePolygonCoordsFromMarkerDrag(k);let T=B.length>1?(0,Wi.default)(this._markers,A):this._markers,O=(P+1)%T.length,R=(P+(T.length-1))%T.length,Z=k.getLatLng(),U=T[R].getLatLng(),Q=T[O].getLatLng();if(k._middleMarkerNext){let Y=L.PM.Utils.calcMiddleLatLng(this._map,Z,Q);k._middleMarkerNext.setLatLng(Y)}if(k._middleMarkerPrev){let Y=L.PM.Utils.calcMiddleLatLng(this._map,Z,U);k._middleMarkerPrev.setLatLng(Y)}this.options.allowSelfIntersection||this._handleLayerStyle(),this._fireMarkerDrag(C,B),this._fireChange(this._layer.getLatLngs(),"Edit")},_onMarkerDragEnd(C){let k=C.target;if(this._preventRenderingMarkers(!1),!this._vertexValidationDragEnd(k))return;let{indexPath:B}=L.PM.Utils.findDeepMarkerIndex(this._markers,k),P=!this.options.allowSelfIntersection&&this.hasSelfIntersection();P&&this.options.allowSelfIntersectionEdit&&this._markerAllowedToDrag&&(P=!1);let A=!this.options.allowSelfIntersection&&P;if(this._fireMarkerDragEnd(C,B,A),A){this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers(),this.options.snappable&&this._initSnappableMarkers(),this._handleLayerStyle(),this._fireLayerReset(C,B);return}!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._handleLayerStyle(),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit")},_onVertexClick(C){let k=C.target;if(k._dragging)return;let{indexPath:B}=L.PM.Utils.findDeepMarkerIndex(this._markers,k);this._fireVertexClick(C,B)}}),ve.Polygon=ve.Line.extend({_shape:"Polygon",_checkMarkerAllowedToDrag(C){let{prevMarker:k,nextMarker:B}=this._getNeighborMarkers(C),P=L.polyline([k.getLatLng(),C.getLatLng()]),A=L.polyline([C.getLatLng(),B.getLatLng()]),T=Ne(this._layer.toGeoJSON(15),P.toGeoJSON(15)).features.filter(R=>{let Z=R.geometry.coordinates,U=L.latLng(Z[1],Z[0]);return!U.equals(k.getLatLng())&&!U.equals(C.getLatLng())}).length,O=Ne(this._layer.toGeoJSON(15),A.toGeoJSON(15)).features.filter(R=>{let Z=R.geometry.coordinates,U=L.latLng(Z[1],Z[0]);return!U.equals(B.getLatLng())&&!U.equals(C.getLatLng())}).length;return!(T<1&&O<1)}}),ve.Rectangle=ve.Polygon.extend({_shape:"Rectangle",_initMarkers(){let C=this._map,k=this._findCorners();this._markerGroup&&this._markerGroup.clearLayers(),this._markerGroup=new L.FeatureGroup,this._markerGroup._pmTempLayer=!0,C.addLayer(this._markerGroup),this._markers=[],this._markers[0]=k.map(this._createMarker,this),[this._cornerMarkers]=this._markers,this._layer.getLatLngs()[0].forEach((B,P)=>{let A=this._cornerMarkers.find(T=>T._index===P);A&&A.setLatLng(B)})},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping(),this._addMarkerEvents()},_createMarker(C,k){let B=new L.Marker(C,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(B,"vertexPane"),B._origLatLng=C,B._index=k,B._pmTempLayer=!0,B.on("click",this._onVertexClick,this),this._markerGroup.addLayer(B),B},_addMarkerEvents(){this._markers[0].forEach(C=>{C.on("dragstart",this._onMarkerDragStart,this),C.on("drag",this._onMarkerDrag,this),C.on("dragend",this._onMarkerDragEnd,this),this.options.preventMarkerRemoval||C.on("contextmenu",this._removeMarker,this)})},_removeMarker(){return null},_onMarkerDragStart(C){if(!this._vertexValidation("move",C))return;let k=C.target,B=this._cornerMarkers;k._oppositeCornerLatLng=B.find(A=>A._index===(k._index+2)%4).getLatLng(),k._snapped=!1;let{indexPath:P}=L.PM.Utils.findDeepMarkerIndex(this._markers,k);this._fireMarkerDragStart(C,P)},_onMarkerDrag(C){let k=C.target;if(!this._vertexValidationDrag(k)||k._index===void 0)return;this._adjustRectangleForMarkerMove(k);let{indexPath:B}=L.PM.Utils.findDeepMarkerIndex(this._markers,k);this._fireMarkerDrag(C,B),this._fireChange(this._layer.getLatLngs(),"Edit")},_onMarkerDragEnd(C){let k=C.target;if(!this._vertexValidationDragEnd(k))return;this._cornerMarkers.forEach(P=>{delete P._oppositeCornerLatLng});let{indexPath:B}=L.PM.Utils.findDeepMarkerIndex(this._markers,k);this._fireMarkerDragEnd(C,B),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit")},_adjustRectangleForMarkerMove(C){L.extend(C._origLatLng,C._latlng);let k=L.PM.Utils._getRotatedRectangle(C.getLatLng(),C._oppositeCornerLatLng,this.getAngle(),this._map);this._layer.setLatLngs(k),this._adjustAllMarkers(C),this._layer.redraw()},_adjustAllMarkers(C){let k=this._layer.getLatLngs()[0];if(k&&k.length!==4&&k.length>0)k.forEach((B,P)=>{this._cornerMarkers[P].setLatLng(B)}),this._cornerMarkers.slice(k.length).forEach(B=>{B.setLatLng(k[0])});else if(!k||!k.length)console.error("The layer has no LatLngs");else{let B=k.findIndex(P=>C.getLatLng().equals(P));B>-1?(this._cornerMarkers[(C._index+1)%4].setLatLng(k[(B+1)%4]),this._cornerMarkers[(C._index+2)%4].setLatLng(k[(B+2)%4]),this._cornerMarkers[(C._index+3)%4].setLatLng(k[(B+3)%4])):this._cornerMarkers.forEach(P=>{P.setLatLng(k[P._index])})}},_findCorners(){this._angle===void 0&&this.setInitAngle(ur(this._map,this._layer.getLatLngs()[0][0],this._layer.getLatLngs()[0][1])||0);let C=this._layer.getLatLngs()[0];return L.PM.Utils._getRotatedRectangle(C[0],C[2],this.getAngle(),this._map||this)}}),ve.CircleMarker=ve.extend({_shape:"CircleMarker",initialize(C){this._layer=C,this._enabled=!1,this._minRadiusOption="minRadiusCircleMarker",this._maxRadiusOption="maxRadiusCircleMarker",this._editableOption="resizeableCircleMarker",this._updateHiddenPolyCircle()},enable(C={draggable:!0,snappable:!0}){if(L.Util.setOptions(this,C),this.options.editable&&(this.options.resizeableCircleMarker=this.options.editable,delete this.options.editable),!this.options.allowEditing||!this._layer._map){this.disable();return}this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._extendingEnable(),this._updateHiddenPolyCircle(),this._fireEnable()},_extendingEnable(){this._layer.on("pm:dragstart",this._onDragStart,this),this._layer.on("pm:drag",this._onMarkerDrag,this),this._layer.on("pm:dragend",this._onMarkerDragEnd,this)},disable(){this.dragging()||(this._map||(this._map=this._layer._map),this._map&&this.enabled()&&(this.layerDragEnabled()&&this.disableLayerDrag(),this._helperLayers&&(this._helperLayers.clearLayers(),this._helperLayers.removeFrom(this._map)),this.options[this._editableOption]?(this._map.off("move",this._syncMarkers,this),this._outerMarker.off("drag",this._handleOuterMarkerSnapping,this)):this._map.off("move",this._updateHiddenPolyCircle,this),this._extendingDisable(),this._layer.off("remove",this.disable,this),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1))},_extendingDisable(){this._layer.off("contextmenu",this._removeMarker,this)},enabled(){return this._enabled},toggleEdit(C){this.enabled()?this.disable():this.enable(C)},applyOptions(){this.options[this._editableOption]?(this._initMarkers(),this._map.on("move",this._syncMarkers,this),this.options.snappable?(this._initSnappableMarkers(),this._outerMarker.on("drag",this._handleOuterMarkerSnapping,this),this._outerMarker.on("move",this._syncHintLine,this),this._outerMarker.on("move",this._syncCircleRadius,this)):this._disableSnapping()):(this.options.draggable&&this.enableLayerDrag(),this._map.on("move",this._updateHiddenPolyCircle,this),this.options.snappable?this._initSnappableMarkersDrag():this._disableSnappingDrag()),this._extendingApplyOptions()},_extendingApplyOptions(){this.options.preventMarkerRemoval||this._layer.on("contextmenu",this._removeMarker,this)},_initMarkers(){let C=this._map;this._helperLayers&&(this._helperLayers.removeFrom(C),this._helperLayers.clearLayers()),this._helperLayers=new L.FeatureGroup,this._helperLayers._pmTempLayer=!0,this._helperLayers.addTo(C);let k=this._layer.getLatLng(),B=this._layer._radius,P=this._getLatLngOnCircle(k,B);this._centerMarker=this._createCenterMarker(k),this._outerMarker=this._createOuterMarker(P),this._markers=[this._centerMarker,this._outerMarker],this._createHintLine(this._centerMarker,this._outerMarker)},_getLatLngOnCircle(C,k){let B=this._map.project(C),P=L.point(B.x+k,B.y);return this._map.unproject(P)},_createHintLine(C,k){let B=C.getLatLng(),P=k.getLatLng();this._hintline=L.polyline([B,P],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._helperLayers.addLayer(this._hintline)},_createCenterMarker(C){let k=this._createMarker(C);return this.options.draggable?(L.DomUtil.addClass(k._icon,"leaflet-pm-draggable"),k.on("move",this._moveCircle,this)):k.dragging.disable(),k},_createOuterMarker(C){let k=this._createMarker(C);return k.on("drag",this._resizeCircle,this),k},_createMarker(C){let k=new L.Marker(C,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(k,"vertexPane"),k._origLatLng=C,k._pmTempLayer=!0,k.on("dragstart",this._onMarkerDragStart,this),k.on("drag",this._onMarkerDrag,this),k.on("dragend",this._onMarkerDragEnd,this),k.on("click",this._onVertexClick,this),this._helperLayers.addLayer(k),k},_moveCircle(C){if(C.target._cancelDragEventChain)return;let k=this._centerMarker.getLatLng();this._layer.setLatLng(k);let B=this._layer._radius,P=this._getLatLngOnCircle(k,B);this._outerMarker._latlng=P,this._outerMarker.update(),this._syncHintLine(),this._updateHiddenPolyCircle(),this._fireCenterPlaced("Edit"),this._fireChange(this._layer.getLatLng(),"Edit")},_syncMarkers(){let C=this._layer.getLatLng(),k=this._layer._radius,B=this._getLatLngOnCircle(C,k);this._outerMarker.setLatLng(B),this._centerMarker.setLatLng(C),this._syncHintLine(),this._updateHiddenPolyCircle()},_resizeCircle(){this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker()),this._syncHintLine(),this._syncCircleRadius()},_syncCircleRadius(){let C=this._centerMarker.getLatLng(),k=this._outerMarker.getLatLng(),B=this._distanceCalculation(C,k);this.options[this._minRadiusOption]&&B<this.options[this._minRadiusOption]?this._layer.setRadius(this.options[this._minRadiusOption]):this.options[this._maxRadiusOption]&&B>this.options[this._maxRadiusOption]?this._layer.setRadius(this.options[this._maxRadiusOption]):this._layer.setRadius(B),this._updateHiddenPolyCircle(),this._fireChange(this._layer.getLatLng(),"Edit")},_syncHintLine(){let C=this._centerMarker.getLatLng(),k=this._outerMarker.getLatLng();this._hintline.setLatLngs([C,k])},_removeMarker(){this.options[this._editableOption]&&this.disable(),this._layer.remove(),this._fireRemove(this._layer),this._fireRemove(this._map,this._layer)},_onDragStart(){this._map.pm.Draw.CircleMarker._layerIsDragging=!0},_onMarkerDragStart(C){this._vertexValidation("move",C)&&this._fireMarkerDragStart(C)},_onMarkerDrag(C){let k=C.target;k instanceof L.Marker&&!this._vertexValidationDrag(k)||this._fireMarkerDrag(C)},_onMarkerDragEnd(C){this._extedingMarkerDragEnd();let k=C.target;this._vertexValidationDragEnd(k)&&(this.options[this._editableOption]&&(this._fireEdit(),this._layerEdited=!0),this._fireMarkerDragEnd(C))},_extedingMarkerDragEnd(){this._map.pm.Draw.CircleMarker._layerIsDragging=!1},_initSnappableMarkersDrag(){let C=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0?!0:this.options.snapSegment,C.off("pm:drag",this._handleSnapping,this),C.on("pm:drag",this._handleSnapping,this),C.off("pm:dragend",this._cleanupSnapping,this),C.on("pm:dragend",this._cleanupSnapping,this),C.off("pm:dragstart",this._unsnap,this),C.on("pm:dragstart",this._unsnap,this)},_disableSnappingDrag(){let C=this._layer;C.off("pm:drag",this._handleSnapping,this),C.off("pm:dragend",this._cleanupSnapping,this),C.off("pm:dragstart",this._unsnap,this)},_updateHiddenPolyCircle(){let C=this._layer._map||this._map;if(C){let k=L.PM.Utils.pxRadiusToMeterRadius(this._layer.getRadius(),C,this._layer.getLatLng()),B=L.circle(this._layer.getLatLng(),this._layer.options);B.setRadius(k);let P=C&&C.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(B,200,!P).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(B,200,!P),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)}},_getNewDestinationOfOuterMarker(){let C=this._centerMarker.getLatLng(),k=this._outerMarker.getLatLng(),B=this._distanceCalculation(C,k);return this.options[this._minRadiusOption]&&B<this.options[this._minRadiusOption]?k=zi(this._map,C,k,this._getMinDistanceInMeter(C)):this.options[this._maxRadiusOption]&&B>this.options[this._maxRadiusOption]&&(k=zi(this._map,C,k,this._getMaxDistanceInMeter(C))),k},_handleOuterMarkerSnapping(){if(this._outerMarker._snapped){let C=this._centerMarker.getLatLng(),k=this._outerMarker.getLatLng(),B=this._distanceCalculation(C,k);this.options[this._minRadiusOption]&&B<this.options[this._minRadiusOption]?this._outerMarker.setLatLng(this._outerMarker._orgLatLng):this.options[this._maxRadiusOption]&&B>this.options[this._maxRadiusOption]&&this._outerMarker.setLatLng(this._outerMarker._orgLatLng)}this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker())},_distanceCalculation(C,k){return this._map.project(C).distanceTo(this._map.project(k))},_getMinDistanceInMeter(C){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._minRadiusOption],this._map,C)},_getMaxDistanceInMeter(C){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._maxRadiusOption],this._map,C)},_onVertexClick(C){C.target._dragging||this._fireVertexClick(C,void 0)}}),ve.Circle=ve.CircleMarker.extend({_shape:"Circle",initialize(C){this._layer=C,this._enabled=!1,this._minRadiusOption="minRadiusCircle",this._maxRadiusOption="maxRadiusCircle",this._editableOption="resizeableCircle",this._updateHiddenPolyCircle()},enable(C){L.PM.Edit.CircleMarker.prototype.enable.call(this,C||{})},_extendingEnable(){},_extendingDisable(){this._layer.off("remove",this.disable,this);let C=this._layer._path?this._layer._path:this._layer._renderer._container;L.DomUtil.removeClass(C,"leaflet-pm-draggable")},_extendingApplyOptions(){},_syncMarkers(){},_removeMarker(){},_onDragStart(){},_extedingMarkerDragEnd(){},_updateHiddenPolyCircle(){let C=this._map&&this._map.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(this._layer,200,!C).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(this._layer,200,!C),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)},_distanceCalculation(C,k){return this._map.distance(C,k)},_getMinDistanceInMeter(){return this.options[this._minRadiusOption]},_getMaxDistanceInMeter(){return this.options[this._maxRadiusOption]},_onVertexClick(C){C.target._dragging||this._fireVertexClick(C,void 0)}}),ve.ImageOverlay=ve.extend({_shape:"ImageOverlay",initialize(C){this._layer=C,this._enabled=!1},toggleEdit(C){this.enabled()?this.disable():this.enable(C)},enabled(){return this._enabled},enable(C={draggable:!0,snappable:!0}){if(L.Util.setOptions(this,C),this._map=this._layer._map,!!this._map){if(!this.options.allowEditing){this.disable();return}this.enabled()||this.disable(),this.enableLayerDrag(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._otherSnapLayers=this._findCorners(),this._fireEnable()}},disable(){this._dragging||(this._map||(this._map=this._layer._map),this.disableLayerDrag(),this._layer.off("remove",this.disable,this),this.enabled()||(this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable()),this._enabled=!1)},_findCorners(){let C=this._layer.getBounds(),k=C.getNorthWest(),B=C.getNorthEast(),P=C.getSouthEast(),A=C.getSouthWest();return[k,B,P,A]}}),ve.Text=ve.extend({_shape:"Text",initialize(C){this._layer=C,this._enabled=!1},enable(C){if(L.Util.setOptions(this,C),!!this.textArea){if(!this.options.allowEditing||!this._layer._map){this.disable();return}this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._safeToCacheDragState=!0,this._focusChange(),this.textArea.readOnly=!1,this.textArea.classList.remove("pm-disabled"),this._layer.on("remove",this.disable,this),L.DomEvent.on(this.textArea,"input",this._autoResize,this),L.DomEvent.on(this.textArea,"focus",this._focusChange,this),L.DomEvent.on(this.textArea,"blur",this._focusChange,this),this._layer.on("dblclick",L.DomEvent.stop),L.DomEvent.off(this.textArea,"mousedown",this._preventTextSelection),this._enabled=!0,this._fireEnable()}},disable(){if(!this.enabled())return;this._layer.off("remove",this.disable,this),L.DomEvent.off(this.textArea,"input",this._autoResize,this),L.DomEvent.off(this.textArea,"focus",this._focusChange,this),L.DomEvent.off(this.textArea,"blur",this._focusChange,this),document.removeEventListener("click",this._documentClickThis,{capture:!0}),this._focusChange(),this.textArea.readOnly=!0,this.textArea.classList.add("pm-disabled");let C=document.activeElement;this.textArea.focus(),this.textArea.selectionStart=0,this.textArea.selectionEnd=0,L.DomEvent.on(this.textArea,"mousedown",this._preventTextSelection),C.focus(),this._disableOnBlurActive=!1,this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1},enabled(){return this._enabled},toggleEdit(C){this.enabled()?this.disable():this.enable(C)},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping()},_initSnappableMarkers(){let C=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0?!0:this.options.snapSegment,C.off("pm:drag",this._handleSnapping,this),C.on("pm:drag",this._handleSnapping,this),C.off("pm:dragend",this._cleanupSnapping,this),C.on("pm:dragend",this._cleanupSnapping,this),C.off("pm:dragstart",this._unsnap,this),C.on("pm:dragstart",this._unsnap,this)},_disableSnapping(){let C=this._layer;C.off("pm:drag",this._handleSnapping,this),C.off("pm:dragend",this._cleanupSnapping,this),C.off("pm:dragstart",this._unsnap,this)},_autoResize(){this.textArea.style.height="1px",this.textArea.style.width="1px";let C=this.textArea.scrollHeight>21?this.textArea.scrollHeight:21,k=this.textArea.scrollWidth>16?this.textArea.scrollWidth:16;this.textArea.style.height=`${C}px`,this.textArea.style.width=`${k}px`,this._layer.options.text=this.getText(),this._fireTextChange(this.getText())},_disableOnBlur(){this._disableOnBlurActive=!0,setTimeout(()=>{this.enabled()&&(this._documentClickThis=this._documentClickThis||this._documentClick.bind(this),document.addEventListener("click",this._documentClickThis,{capture:!0}))},100)},_documentClick(C){C.target!==this.textArea&&(this.disable(),!this.getText()&&this.options.removeIfEmpty&&this.remove())},_focusChange(C={}){let k=this._hasFocus;this._hasFocus=C.type==="focus",!k!=!this._hasFocus&&(this._hasFocus?(this._applyFocus(),this._focusText=this.getText(),this._fireTextFocus()):(this._removeFocus(),this._fireTextBlur(),this._focusText!==this.getText()&&(this._fireEdit(),this._layerEdited=!0)))},_applyFocus(){this.textArea.classList.add("pm-hasfocus"),this._map.dragging&&(this._safeToCacheDragState&&(this._originalMapDragState=this._map.dragging._enabled,this._safeToCacheDragState=!1),this._map.dragging.disable())},_removeFocus(){this._map.dragging&&(this._originalMapDragState&&this._map.dragging.enable(),this._safeToCacheDragState=!0),this.textArea.classList.remove("pm-hasfocus")},focus(){if(!this.enabled())throw new TypeError("Layer is not enabled");this.textArea.focus()},blur(){if(!this.enabled())throw new TypeError("Layer is not enabled");this.textArea.blur(),this._disableOnBlurActive&&this.disable()},hasFocus(){return this._hasFocus},getElement(){return this.textArea},setText(C){C&&(this.textArea.value=C),this._autoResize()},getText(){return this.textArea.value},_initTextMarker(){if(this.textArea=L.PM.Draw.Text.prototype._createTextArea.call(this),this.options.className){let k=this.options.className.split(" ");this.textArea.classList.add(...k)}let C=L.PM.Draw.Text.prototype._createTextIcon.call(this,this.textArea);this._layer.setIcon(C),this._layer.once("add",this._createTextMarker,this)},_createTextMarker(C=!1){this._layer.off("add",this._createTextMarker,this),this._layer.getElement().tabIndex=-1,this.textArea.wrap="off",this.textArea.style.overflow="hidden",this.textArea.style.height=L.DomUtil.getStyle(this.textArea,"font-size"),this.textArea.style.width="1px",this._layer.options.text&&this.setText(this._layer.options.text),this._autoResize(),C===!0&&(this.enable(),this.focus(),this._disableOnBlur())},_preventTextSelection(C){C.preventDefault()}});var Na=function(C,k,B,P,A,T){this._matrix=[C,k,B,P,A,T]};Na.init=()=>new L.PM.Matrix(1,0,0,1,0,0),Na.prototype={transform(C){return this._transform(C.clone())},_transform(C){let k=this._matrix,{x:B,y:P}=C;return C.x=k[0]*B+k[1]*P+k[4],C.y=k[2]*B+k[3]*P+k[5],C},untransform(C){let k=this._matrix;return new L.Point((C.x/k[0]-k[4])/k[0],(C.y/k[2]-k[5])/k[2])},clone(){let C=this._matrix;return new L.PM.Matrix(C[0],C[1],C[2],C[3],C[4],C[5])},translate(C){if(C===void 0)return new L.Point(this._matrix[4],this._matrix[5]);let k,B;return typeof C=="number"?(k=C,B=C):(k=C.x,B=C.y),this._add(1,0,0,1,k,B)},scale(C,k){if(C===void 0)return new L.Point(this._matrix[0],this._matrix[3]);let B,P;return k=k||L.point(0,0),typeof C=="number"?(B=C,P=C):(B=C.x,P=C.y),this._add(B,0,0,P,k.x,k.y)._add(1,0,0,1,-k.x,-k.y)},rotate(C,k){let B=Math.cos(C),P=Math.sin(C);return k=k||new L.Point(0,0),this._add(B,P,-P,B,k.x,k.y)._add(1,0,0,1,-k.x,-k.y)},flip(){return this._matrix[1]*=-1,this._matrix[2]*=-1,this},_add(C,k,B,P,A,T){let O=[[],[],[]],R=this._matrix,Z=[[R[0],R[2],R[4]],[R[1],R[3],R[5]],[0,0,1]],U=[[C,B,A],[k,P,T],[0,0,1]],Q;C&&C instanceof L.PM.Matrix&&(R=C._matrix,U=[[R[0],R[2],R[4]],[R[1],R[3],R[5]],[0,0,1]]);for(let Y=0;Y<3;Y+=1)for(let ot=0;ot<3;ot+=1){Q=0;for(let ut=0;ut<3;ut+=1)Q+=Z[Y][ut]*U[ut][ot];O[Y][ot]=Q}return this._matrix=[O[0][0],O[1][0],O[0][1],O[1][1],O[0][2],O[1][2]],this}};var No=Na,Go={calcMiddleLatLng(C,k,B){let P=C.project(k),A=C.project(B);return C.unproject(P._add(A)._divideBy(2))},findLayers(C){let k=[];return C.eachLayer(B=>{(B instanceof L.Polyline||B instanceof L.Marker||B instanceof L.Circle||B instanceof L.CircleMarker||B instanceof L.ImageOverlay)&&k.push(B)}),k=k.filter(B=>!!B.pm),k=k.filter(B=>!B._pmTempLayer),k=k.filter(B=>!L.PM.optIn&&!B.options.pmIgnore||L.PM.optIn&&B.options.pmIgnore===!1),k},circleToPolygon(C,k=60,B=!0){let P=C.getLatLng(),A=C.getRadius(),T=Ii(P,A,k,0,B),O=[];for(let R=0;R<T.length;R+=1){let Z=[T[R].lat,T[R].lng];O.push(Z)}return L.polygon(O,C.options)},disablePopup(C){C.getPopup()&&(C._tempPopupCopy=C.getPopup(),C.unbindPopup())},enablePopup(C){C._tempPopupCopy&&(C.bindPopup(C._tempPopupCopy),delete C._tempPopupCopy)},_fireEvent(C,k,B,P=!1){C.fire(k,B,P);let{groups:A}=this.getAllParentGroups(C);A.forEach(T=>{T.fire(k,B,P)})},getAllParentGroups(C){let k=[],B=[],P=A=>{for(let T in A._eventParents)if(k.indexOf(T)===-1){k.push(T);let O=A._eventParents[T];B.push(O),P(O)}};return!C._pmLastGroupFetch||!C._pmLastGroupFetch.time||new Date().getTime()-C._pmLastGroupFetch.time>1e3?(P(C),C._pmLastGroupFetch={time:new Date().getTime(),groups:B,groupIds:k},{groupIds:k,groups:B}):{groups:C._pmLastGroupFetch.groups,groupIds:C._pmLastGroupFetch.groupIds}},createGeodesicPolygon:Ii,getTranslation:Wt,findDeepCoordIndex(C,k,B=!0){let P,A=O=>(R,Z)=>{let U=O.concat(Z);if(B){if(R.lat&&R.lat===k.lat&&R.lng===k.lng)return P=U,!0}else if(R.lat&&L.latLng(R).equals(k))return P=U,!0;return Array.isArray(R)&&R.some(A(U))};C.some(A([]));let T={};return P&&(T={indexPath:P,index:P[P.length-1],parentPath:P.slice(0,P.length-1)}),T},findDeepMarkerIndex(C,k){let B,P=T=>(O,R)=>{let Z=T.concat(R);return O._leaflet_id===k._leaflet_id?(B=Z,!0):Array.isArray(O)&&O.some(P(Z))};C.some(P([]));let A={};return B&&(A={indexPath:B,index:B[B.length-1],parentPath:B.slice(0,B.length-1)}),A},_getIndexFromSegment(C,k){if(k&&k.length===2){let B=this.findDeepCoordIndex(C,k[0]),P=this.findDeepCoordIndex(C,k[1]),A=Math.max(B.index,P.index);return(B.index===0||P.index===0)&&A!==1&&(A+=1),{indexA:B,indexB:P,newIndex:A,indexPath:B.indexPath,parentPath:B.parentPath}}return null},_getRotatedRectangle(C,k,B,P){let A=Fn(P,C),T=Fn(P,k),O=B*Math.PI/180,R=Math.cos(O),Z=Math.sin(O),U=(T.x-A.x)*R+(T.y-A.y)*Z,Q=(T.y-A.y)*R-(T.x-A.x)*Z,Y=U*R+A.x,ot=U*Z+A.y,ut=-Q*Z+A.x,vt=Q*R+A.y,xt=Us(P,A),Pt=Us(P,{x:Y,y:ot}),At=Us(P,T),J=Us(P,{x:ut,y:vt});return[xt,Pt,At,J]},pxRadiusToMeterRadius(C,k,B){let P=k.project(B),A=L.point(P.x+C,P.y);return k.distance(k.unproject(A),B)}},Zo=Go;L.PM=L.PM||{version:re.version,Map:Ke,Toolbar:ls,Draw:fe,Edit:ve,Utils:Zo,Matrix:No,activeLang:"en",optIn:!1,initialize(C){this.addInitHooks(C)},setOptIn(C){this.optIn=!!C},addInitHooks(){function C(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Map(this)):this.options.pmIgnore||(this.pm=new L.PM.Map(this)),this.pm&&this.pm.setGlobalOptions({})}L.Map.addInitHook(C);function k(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.LayerGroup(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.LayerGroup(this))}L.LayerGroup.addInitHook(k);function B(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.options.textMarker?(this.pm=new L.PM.Edit.Text(this),this.options._textMarkerOverPM||this.pm._initTextMarker(),delete this.options._textMarkerOverPM):this.pm=new L.PM.Edit.Marker(this)):this.options.pmIgnore||(this.options.textMarker?(this.pm=new L.PM.Edit.Text(this),this.options._textMarkerOverPM||this.pm._initTextMarker(),delete this.options._textMarkerOverPM):this.pm=new L.PM.Edit.Marker(this))}L.Marker.addInitHook(B);function P(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.CircleMarker(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.CircleMarker(this))}L.CircleMarker.addInitHook(P);function A(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Line(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Line(this))}L.Polyline.addInitHook(A);function T(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Polygon(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Polygon(this))}L.Polygon.addInitHook(T);function O(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Rectangle(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Rectangle(this))}L.Rectangle.addInitHook(O);function R(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Circle(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Circle(this))}L.Circle.addInitHook(R);function Z(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.ImageOverlay(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.ImageOverlay(this))}L.ImageOverlay.addInitHook(Z)},reInitLayer(C){C instanceof L.LayerGroup&&C.eachLayer(k=>{this.reInitLayer(k)}),C.pm||L.PM.optIn&&C.options.pmIgnore!==!1||C.options.pmIgnore||(C instanceof L.Map?C.pm=new L.PM.Map(C):C instanceof L.Marker?C.options.textMarker?(C.pm=new L.PM.Edit.Text(C),C.pm._initTextMarker(),C.pm._createTextMarker(!1)):C.pm=new L.PM.Edit.Marker(C):C instanceof L.Circle?C.pm=new L.PM.Edit.Circle(C):C instanceof L.CircleMarker?C.pm=new L.PM.Edit.CircleMarker(C):C instanceof L.Rectangle?C.pm=new L.PM.Edit.Rectangle(C):C instanceof L.Polygon?C.pm=new L.PM.Edit.Polygon(C):C instanceof L.Polyline?C.pm=new L.PM.Edit.Line(C):C instanceof L.LayerGroup?C.pm=new L.PM.Edit.LayerGroup(C):C instanceof L.ImageOverlay&&(C.pm=new L.PM.Edit.ImageOverlay(C)))}},L.version==="1.7.1"&&L.Canvas.include({_onClick(C){let k=this._map.mouseEventToLayerPoint(C),B,P;for(let A=this._drawFirst;A;A=A.next)B=A.layer,B.options.interactive&&B._containsPoint(k)&&(!(C.type==="click"||C.type==="preclick")||!this._map._draggableMoved(B))&&(P=B);P&&(L.DomEvent.fakeStop(C),this._fireEvent([P],C))}}),L.PM.initialize()})()),leafletGeoman}requireLeafletGeoman();var leaflet_markerclusterSrc$1={exports:{}},leaflet_markerclusterSrc=leaflet_markerclusterSrc$1.exports,hasRequiredLeaflet_markerclusterSrc;function requireLeaflet_markerclusterSrc(){return hasRequiredLeaflet_markerclusterSrc||(hasRequiredLeaflet_markerclusterSrc=1,(function(j,H){(function(G,X){X(H)})(leaflet_markerclusterSrc,function(G){var X=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(F){L.Util.setOptions(this,F),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var N=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,N?this._withAnimation:this._noAnimation),this._markerCluster=N?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(F){if(F instanceof L.LayerGroup)return this.addLayers([F]);if(!F.getLatLng)return this._nonPointGroup.addLayer(F),this.fire("layeradd",{layer:F}),this;if(!this._map)return this._needsClustering.push(F),this.fire("layeradd",{layer:F}),this;if(this.hasLayer(F))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(F,this._maxZoom),this.fire("layeradd",{layer:F}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var N=F,W=this._zoom;if(F.__parent)for(;N.__parent._zoom>=W;)N=N.__parent;return this._currentShownBounds.contains(N.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(F,N):this._animationAddLayerNonAnimated(F,N)),this},removeLayer:function(F){return F instanceof L.LayerGroup?this.removeLayers([F]):F.getLatLng?this._map?F.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(F)),this._removeLayer(F,!0),this.fire("layerremove",{layer:F}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),F.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(F)&&(this._featureGroup.removeLayer(F),F.clusterShow&&F.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,F)&&this.hasLayer(F)&&this._needsRemoving.push({layer:F,latlng:F._latlng}),this.fire("layerremove",{layer:F}),this):(this._nonPointGroup.removeLayer(F),this.fire("layerremove",{layer:F}),this)},addLayers:function(F,N){if(!L.Util.isArray(F))return this.addLayer(F);var W=this._featureGroup,et=this._nonPointGroup,ft=this.options.chunkedLoading,Lt=this.options.chunkInterval,pt=this.options.chunkProgress,Ct=F.length,bt=0,Dt=!0,St;if(this._map){var Jt=new Date().getTime(),Zt=L.bind(function(){var ie=new Date().getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();bt<Ct;bt++){if(ft&&bt%200===0){var ei=new Date().getTime()-ie;if(ei>Lt)break}if(St=F[bt],St instanceof L.LayerGroup){Dt&&(F=F.slice(),Dt=!1),this._extractNonGroupLayers(St,F),Ct=F.length;continue}if(!St.getLatLng){et.addLayer(St),N||this.fire("layeradd",{layer:St});continue}if(!this.hasLayer(St)&&(this._addLayer(St,this._maxZoom),N||this.fire("layeradd",{layer:St}),St.__parent&&St.__parent.getChildCount()===2)){var ke=St.__parent.getAllChildMarkers(),Ve=ke[0]===St?ke[1]:ke[0];W.removeLayer(Ve)}}pt&&pt(bt,Ct,new Date().getTime()-Jt),bt===Ct?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(Zt,this.options.chunkDelay)},this);Zt()}else for(var ee=this._needsClustering;bt<Ct;bt++){if(St=F[bt],St instanceof L.LayerGroup){Dt&&(F=F.slice(),Dt=!1),this._extractNonGroupLayers(St,F),Ct=F.length;continue}if(!St.getLatLng){et.addLayer(St);continue}this.hasLayer(St)||ee.push(St)}return this},removeLayers:function(F){var N,W,et=F.length,ft=this._featureGroup,Lt=this._nonPointGroup,pt=!0;if(!this._map){for(N=0;N<et;N++){if(W=F[N],W instanceof L.LayerGroup){pt&&(F=F.slice(),pt=!1),this._extractNonGroupLayers(W,F),et=F.length;continue}this._arraySplice(this._needsClustering,W),Lt.removeLayer(W),this.hasLayer(W)&&this._needsRemoving.push({layer:W,latlng:W._latlng}),this.fire("layerremove",{layer:W})}return this}if(this._unspiderfy){this._unspiderfy();var Ct=F.slice(),bt=et;for(N=0;N<bt;N++){if(W=Ct[N],W instanceof L.LayerGroup){this._extractNonGroupLayers(W,Ct),bt=Ct.length;continue}this._unspiderfyLayer(W)}}for(N=0;N<et;N++){if(W=F[N],W instanceof L.LayerGroup){pt&&(F=F.slice(),pt=!1),this._extractNonGroupLayers(W,F),et=F.length;continue}if(!W.__parent){Lt.removeLayer(W),this.fire("layerremove",{layer:W});continue}this._removeLayer(W,!0,!0),this.fire("layerremove",{layer:W}),ft.hasLayer(W)&&(ft.removeLayer(W),W.clusterShow&&W.clusterShow())}return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(F){F.off(this._childMarkerEventHandlers,this),delete F.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var F=new L.LatLngBounds;this._topClusterLevel&&F.extend(this._topClusterLevel._bounds);for(var N=this._needsClustering.length-1;N>=0;N--)F.extend(this._needsClustering[N].getLatLng());return F.extend(this._nonPointGroup.getBounds()),F},eachLayer:function(F,N){var W=this._needsClustering.slice(),et=this._needsRemoving,ft,Lt,pt;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(W),Lt=W.length-1;Lt>=0;Lt--){for(ft=!0,pt=et.length-1;pt>=0;pt--)if(et[pt].layer===W[Lt]){ft=!1;break}ft&&F.call(N,W[Lt])}this._nonPointGroup.eachLayer(F,N)},getLayers:function(){var F=[];return this.eachLayer(function(N){F.push(N)}),F},getLayer:function(F){var N=null;return F=parseInt(F,10),this.eachLayer(function(W){L.stamp(W)===F&&(N=W)}),N},hasLayer:function(F){if(!F)return!1;var N,W=this._needsClustering;for(N=W.length-1;N>=0;N--)if(W[N]===F)return!0;for(W=this._needsRemoving,N=W.length-1;N>=0;N--)if(W[N].layer===F)return!1;return!!(F.__parent&&F.__parent._group===this)||this._nonPointGroup.hasLayer(F)},zoomToShowLayer:function(F,N){var W=this._map;typeof N!="function"&&(N=function(){});var et=function(){(W.hasLayer(F)||W.hasLayer(F.__parent))&&!this._inZoomAnimation&&(this._map.off("moveend",et,this),this.off("animationend",et,this),W.hasLayer(F)?N():F.__parent._icon&&(this.once("spiderfied",N,this),F.__parent.spiderfy()))};F._icon&&this._map.getBounds().contains(F.getLatLng())?N():F.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",et,this),this._map.panTo(F.getLatLng())):(this._map.on("moveend",et,this),this.on("animationend",et,this),F.__parent.zoomToBounds())},onAdd:function(F){this._map=F;var N,W,et;if(!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(F),this._nonPointGroup.addTo(F),this._gridClusters||this._generateInitialClusters(),this._maxLat=F.options.crs.projection.MAX_LATITUDE,N=0,W=this._needsRemoving.length;N<W;N++)et=this._needsRemoving[N],et.newlatlng=et.layer._latlng,et.layer._latlng=et.latlng;for(N=0,W=this._needsRemoving.length;N<W;N++)et=this._needsRemoving[N],this._removeLayer(et.layer,!0),et.layer._latlng=et.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),W=this._needsClustering,this._needsClustering=[],this.addLayers(W,!0)},onRemove:function(F){F.off("zoomend",this._zoomEnd,this),F.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(F){for(var N=F;N&&!N._icon;)N=N.__parent;return N||null},_arraySplice:function(F,N){for(var W=F.length-1;W>=0;W--)if(F[W]===N)return F.splice(W,1),!0},_removeFromGridUnclustered:function(F,N){for(var W=this._map,et=this._gridUnclustered,ft=Math.floor(this._map.getMinZoom());N>=ft&&et[N].removeObject(F,W.project(F.getLatLng(),N));N--);},_childMarkerDragStart:function(F){F.target.__dragStart=F.target._latlng},_childMarkerMoved:function(F){if(!this._ignoreMove&&!F.target.__dragStart){var N=F.target._popup&&F.target._popup.isOpen();this._moveChild(F.target,F.oldLatLng,F.latlng),N&&F.target.openPopup()}},_moveChild:function(F,N,W){F._latlng=N,this.removeLayer(F),F._latlng=W,this.addLayer(F)},_childMarkerDragEnd:function(F){var N=F.target.__dragStart;delete F.target.__dragStart,N&&this._moveChild(F.target,N,F.target._latlng)},_removeLayer:function(F,N,W){var et=this._gridClusters,ft=this._gridUnclustered,Lt=this._featureGroup,pt=this._map,Ct=Math.floor(this._map.getMinZoom());N&&this._removeFromGridUnclustered(F,this._maxZoom);var bt=F.__parent,Dt=bt._markers,St;for(this._arraySplice(Dt,F);bt&&(bt._childCount--,bt._boundsNeedUpdate=!0,!(bt._zoom<Ct));)N&&bt._childCount<=1?(St=bt._markers[0]===F?bt._markers[1]:bt._markers[0],et[bt._zoom].removeObject(bt,pt.project(bt._cLatLng,bt._zoom)),ft[bt._zoom].addObject(St,pt.project(St.getLatLng(),bt._zoom)),this._arraySplice(bt.__parent._childClusters,bt),bt.__parent._markers.push(St),St.__parent=bt.__parent,bt._icon&&(Lt.removeLayer(bt),W||Lt.addLayer(St))):bt._iconNeedsUpdate=!0,bt=bt.__parent;delete F.__parent},_isOrIsParent:function(F,N){for(;N;){if(F===N)return!0;N=N.parentNode}return!1},fire:function(F,N,W){if(N&&N.layer instanceof L.MarkerCluster){if(N.originalEvent&&this._isOrIsParent(N.layer._icon,N.originalEvent.relatedTarget))return;F="cluster"+F}L.FeatureGroup.prototype.fire.call(this,F,N,W)},listens:function(F,N){return L.FeatureGroup.prototype.listens.call(this,F,N)||L.FeatureGroup.prototype.listens.call(this,"cluster"+F,N)},_defaultIconCreateFunction:function(F){var N=F.getChildCount(),W=" marker-cluster-";return N<10?W+="small":N<100?W+="medium":W+="large",new L.DivIcon({html:"<div><span>"+N+"</span></div>",className:"marker-cluster"+W,iconSize:new L.Point(40,40)})},_bindEvents:function(){var F=this._map,N=this.options.spiderfyOnMaxZoom,W=this.options.showCoverageOnHover,et=this.options.zoomToBoundsOnClick,ft=this.options.spiderfyOnEveryZoom;(N||et||ft)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),W&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),F.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(F){var N=F.layer,W=N;if(!(F.type==="clusterkeypress"&&F.originalEvent&&F.originalEvent.keyCode!==13)){for(;W._childClusters.length===1;)W=W._childClusters[0];W._zoom===this._maxZoom&&W._childCount===N._childCount&&this.options.spiderfyOnMaxZoom?N.spiderfy():this.options.zoomToBoundsOnClick&&N.zoomToBounds(),this.options.spiderfyOnEveryZoom&&N.spiderfy(),F.originalEvent&&F.originalEvent.keyCode===13&&this._map._container.focus()}},_showCoverage:function(F){var N=this._map;this._inZoomAnimation||(this._shownPolygon&&N.removeLayer(this._shownPolygon),F.layer.getChildCount()>2&&F.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(F.layer.getConvexHull(),this.options.polygonOptions),N.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var F=this.options.spiderfyOnMaxZoom,N=this.options.showCoverageOnHover,W=this.options.zoomToBoundsOnClick,et=this.options.spiderfyOnEveryZoom,ft=this._map;(F||W||et)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),N&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),ft.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var F=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,F),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),F),this._currentShownBounds=F}},_generateInitialClusters:function(){var F=Math.ceil(this._map.getMaxZoom()),N=Math.floor(this._map.getMinZoom()),W=this.options.maxClusterRadius,et=W;typeof W!="function"&&(et=function(){return W}),this.options.disableClusteringAtZoom!==null&&(F=this.options.disableClusteringAtZoom-1),this._maxZoom=F,this._gridClusters={},this._gridUnclustered={};for(var ft=F;ft>=N;ft--)this._gridClusters[ft]=new L.DistanceGrid(et(ft)),this._gridUnclustered[ft]=new L.DistanceGrid(et(ft));this._topClusterLevel=new this._markerCluster(this,N-1)},_addLayer:function(F,N){var W=this._gridClusters,et=this._gridUnclustered,ft=Math.floor(this._map.getMinZoom()),Lt,pt;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(F),F.on(this._childMarkerEventHandlers,this);N>=ft;N--){Lt=this._map.project(F.getLatLng(),N);var Ct=W[N].getNearObject(Lt);if(Ct){Ct._addChild(F),F.__parent=Ct;return}if(Ct=et[N].getNearObject(Lt),Ct){var bt=Ct.__parent;bt&&this._removeLayer(Ct,!1);var Dt=new this._markerCluster(this,N,Ct,F);W[N].addObject(Dt,this._map.project(Dt._cLatLng,N)),Ct.__parent=Dt,F.__parent=Dt;var St=Dt;for(pt=N-1;pt>bt._zoom;pt--)St=new this._markerCluster(this,pt,St),W[pt].addObject(St,this._map.project(Ct.getLatLng(),pt));bt._addChild(St),this._removeFromGridUnclustered(Ct,N);return}et[N].addObject(F,Lt)}this._topClusterLevel._addChild(F),F.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(F){F instanceof L.MarkerCluster&&F._iconNeedsUpdate&&F._updateIcon()})},_enqueue:function(F){this._queue.push(F),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var F=0;F<this._queue.length;F++)this._queue[F].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var F=Math.round(this._map._zoom);this._processQueue(),this._zoom<F&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,F)):this._zoom>F?(this._animationStart(),this._animationZoomOut(this._zoom,F)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(this.options.removeOutsideVisibleBounds){if(L.Browser.mobile)return this._checkBoundsMaxLat(this._map.getBounds())}else return this._mapBoundsInfinite;return this._checkBoundsMaxLat(this._map.getBounds().pad(1))},_checkBoundsMaxLat:function(F){var N=this._maxLat;return N!==void 0&&(F.getNorth()>=N&&(F._northEast.lat=1/0),F.getSouth()<=-N&&(F._southWest.lat=-1/0)),F},_animationAddLayerNonAnimated:function(F,N){if(N===F)this._featureGroup.addLayer(F);else if(N._childCount===2){N._addToMap();var W=N.getAllChildMarkers();this._featureGroup.removeLayer(W[0]),this._featureGroup.removeLayer(W[1])}else N._updateIcon()},_extractNonGroupLayers:function(F,N){var W=F.getLayers(),et=0,ft;for(N=N||[];et<W.length;et++){if(ft=W[et],ft instanceof L.LayerGroup){this._extractNonGroupLayers(ft,N);continue}N.push(ft)}return N},_overrideMarkerIcon:function(F){var N=F.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[F]}});return N}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(F,N){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),F),this._topClusterLevel._recursivelyAddChildrenToMap(null,N,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(F,N){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),F),this._topClusterLevel._recursivelyAddChildrenToMap(null,N,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(F,N){this._animationAddLayerNonAnimated(F,N)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(F,N){var W=this._getExpandedVisibleBounds(),et=this._featureGroup,ft=Math.floor(this._map.getMinZoom()),Lt;this._ignoreMove=!0,this._topClusterLevel._recursively(W,F,ft,function(pt){var Ct=pt._latlng,bt=pt._markers,Dt;for(W.contains(Ct)||(Ct=null),pt._isSingleParent()&&F+1===N?(et.removeLayer(pt),pt._recursivelyAddChildrenToMap(null,N,W)):(pt.clusterHide(),pt._recursivelyAddChildrenToMap(Ct,N,W)),Lt=bt.length-1;Lt>=0;Lt--)Dt=bt[Lt],W.contains(Dt._latlng)||et.removeLayer(Dt)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(W,N),et.eachLayer(function(pt){!(pt instanceof L.MarkerCluster)&&pt._icon&&pt.clusterShow()}),this._topClusterLevel._recursively(W,F,N,function(pt){pt._recursivelyRestoreChildPositions(N)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(W,F,ft,function(pt){et.removeLayer(pt),pt.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(F,N){this._animationZoomOutSingle(this._topClusterLevel,F-1,N),this._topClusterLevel._recursivelyAddChildrenToMap(null,N,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),F,this._getExpandedVisibleBounds())},_animationAddLayer:function(F,N){var W=this,et=this._featureGroup;et.addLayer(F),N!==F&&(N._childCount>2?(N._updateIcon(),this._forceLayout(),this._animationStart(),F._setPos(this._map.latLngToLayerPoint(N.getLatLng())),F.clusterHide(),this._enqueue(function(){et.removeLayer(F),F.clusterShow(),W._animationEnd()})):(this._forceLayout(),W._animationStart(),W._animationZoomOutSingle(N,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(F,N,W){var et=this._getExpandedVisibleBounds(),ft=Math.floor(this._map.getMinZoom());F._recursivelyAnimateChildrenInAndAddSelfToMap(et,ft,N+1,W);var Lt=this;this._forceLayout(),F._recursivelyBecomeVisible(et,W),this._enqueue(function(){if(F._childCount===1){var pt=F._markers[0];this._ignoreMove=!0,pt.setLatLng(pt.getLatLng()),this._ignoreMove=!1,pt.clusterShow&&pt.clusterShow()}else F._recursively(et,W,ft,function(Ct){Ct._recursivelyRemoveChildrenFromMap(et,ft,N+1)});Lt._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(F){return new L.MarkerClusterGroup(F)};var tt=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(F,N,W,et){L.Marker.prototype.initialize.call(this,W?W._cLatLng||W.getLatLng():new L.LatLng(0,0),{icon:this,pane:F.options.clusterPane}),this._group=F,this._zoom=N,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,W&&this._addChild(W),et&&this._addChild(et)},getAllChildMarkers:function(F,N){F=F||[];for(var W=this._childClusters.length-1;W>=0;W--)this._childClusters[W].getAllChildMarkers(F,N);for(var et=this._markers.length-1;et>=0;et--)N&&this._markers[et].__dragStart||F.push(this._markers[et]);return F},getChildCount:function(){return this._childCount},zoomToBounds:function(F){for(var N=this._childClusters.slice(),W=this._group._map,et=W.getBoundsZoom(this._bounds),ft=this._zoom+1,Lt=W.getZoom(),pt;N.length>0&&et>ft;){ft++;var Ct=[];for(pt=0;pt<N.length;pt++)Ct=Ct.concat(N[pt]._childClusters);N=Ct}et>ft?this._group._map.setView(this._latlng,ft):et<=Lt?this._group._map.setView(this._latlng,Lt+1):this._group._map.fitBounds(this._bounds,F)},getBounds:function(){var F=new L.LatLngBounds;return F.extend(this._bounds),F},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(F,N){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(F),F instanceof L.MarkerCluster?(N||(this._childClusters.push(F),F.__parent=this),this._childCount+=F._childCount):(N||this._markers.push(F),this._childCount++),this.__parent&&this.__parent._addChild(F,!0)},_setClusterCenter:function(F){this._cLatLng||(this._cLatLng=F._cLatLng||F._latlng)},_resetBounds:function(){var F=this._bounds;F._southWest&&(F._southWest.lat=1/0,F._southWest.lng=1/0),F._northEast&&(F._northEast.lat=-1/0,F._northEast.lng=-1/0)},_recalculateBounds:function(){var F=this._markers,N=this._childClusters,W=0,et=0,ft=this._childCount,Lt,pt,Ct,bt;if(ft!==0){for(this._resetBounds(),Lt=0;Lt<F.length;Lt++)Ct=F[Lt]._latlng,this._bounds.extend(Ct),W+=Ct.lat,et+=Ct.lng;for(Lt=0;Lt<N.length;Lt++)pt=N[Lt],pt._boundsNeedUpdate&&pt._recalculateBounds(),this._bounds.extend(pt._bounds),Ct=pt._wLatLng,bt=pt._childCount,W+=Ct.lat*bt,et+=Ct.lng*bt;this._latlng=this._wLatLng=new L.LatLng(W/ft,et/ft),this._boundsNeedUpdate=!1}},_addToMap:function(F){F&&(this._backupLatlng=this._latlng,this.setLatLng(F)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(F,N,W){this._recursively(F,this._group._map.getMinZoom(),W-1,function(et){var ft=et._markers,Lt,pt;for(Lt=ft.length-1;Lt>=0;Lt--)pt=ft[Lt],pt._icon&&(pt._setPos(N),pt.clusterHide())},function(et){var ft=et._childClusters,Lt,pt;for(Lt=ft.length-1;Lt>=0;Lt--)pt=ft[Lt],pt._icon&&(pt._setPos(N),pt.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(F,N,W,et){this._recursively(F,et,N,function(ft){ft._recursivelyAnimateChildrenIn(F,ft._group._map.latLngToLayerPoint(ft.getLatLng()).round(),W),ft._isSingleParent()&&W-1===et?(ft.clusterShow(),ft._recursivelyRemoveChildrenFromMap(F,N,W)):ft.clusterHide(),ft._addToMap()})},_recursivelyBecomeVisible:function(F,N){this._recursively(F,this._group._map.getMinZoom(),N,null,function(W){W.clusterShow()})},_recursivelyAddChildrenToMap:function(F,N,W){this._recursively(W,this._group._map.getMinZoom()-1,N,function(et){if(N!==et._zoom)for(var ft=et._markers.length-1;ft>=0;ft--){var Lt=et._markers[ft];W.contains(Lt._latlng)&&(F&&(Lt._backupLatlng=Lt.getLatLng(),Lt.setLatLng(F),Lt.clusterHide&&Lt.clusterHide()),et._group._featureGroup.addLayer(Lt))}},function(et){et._addToMap(F)})},_recursivelyRestoreChildPositions:function(F){for(var N=this._markers.length-1;N>=0;N--){var W=this._markers[N];W._backupLatlng&&(W.setLatLng(W._backupLatlng),delete W._backupLatlng)}if(F-1===this._zoom)for(var et=this._childClusters.length-1;et>=0;et--)this._childClusters[et]._restorePosition();else for(var ft=this._childClusters.length-1;ft>=0;ft--)this._childClusters[ft]._recursivelyRestoreChildPositions(F)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(F,N,W,et){var ft,Lt;this._recursively(F,N-1,W-1,function(pt){for(Lt=pt._markers.length-1;Lt>=0;Lt--)ft=pt._markers[Lt],(!et||!et.contains(ft._latlng))&&(pt._group._featureGroup.removeLayer(ft),ft.clusterShow&&ft.clusterShow())},function(pt){for(Lt=pt._childClusters.length-1;Lt>=0;Lt--)ft=pt._childClusters[Lt],(!et||!et.contains(ft._latlng))&&(pt._group._featureGroup.removeLayer(ft),ft.clusterShow&&ft.clusterShow())})},_recursively:function(F,N,W,et,ft){var Lt=this._childClusters,pt=this._zoom,Ct,bt;if(N<=pt&&(et&&et(this),ft&&pt===W&&ft(this)),pt<N||pt<W)for(Ct=Lt.length-1;Ct>=0;Ct--)bt=Lt[Ct],bt._boundsNeedUpdate&&bt._recalculateBounds(),F.intersects(bt._bounds)&&bt._recursively(F,N,W,et,ft)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var F=this.options.opacity;return this.setOpacity(0),this.options.opacity=F,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(F){this._cellSize=F,this._sqCellSize=F*F,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(F,N){var W=this._getCoord(N.x),et=this._getCoord(N.y),ft=this._grid,Lt=ft[et]=ft[et]||{},pt=Lt[W]=Lt[W]||[],Ct=L.Util.stamp(F);this._objectPoint[Ct]=N,pt.push(F)},updateObject:function(F,N){this.removeObject(F),this.addObject(F,N)},removeObject:function(F,N){var W=this._getCoord(N.x),et=this._getCoord(N.y),ft=this._grid,Lt=ft[et]=ft[et]||{},pt=Lt[W]=Lt[W]||[],Ct,bt;for(delete this._objectPoint[L.Util.stamp(F)],Ct=0,bt=pt.length;Ct<bt;Ct++)if(pt[Ct]===F)return pt.splice(Ct,1),bt===1&&delete Lt[W],!0},eachObject:function(F,N){var W,et,ft,Lt,pt,Ct,bt,Dt=this._grid;for(W in Dt){pt=Dt[W];for(et in pt)for(Ct=pt[et],ft=0,Lt=Ct.length;ft<Lt;ft++)bt=F.call(N,Ct[ft]),bt&&(ft--,Lt--)}},getNearObject:function(F){var N=this._getCoord(F.x),W=this._getCoord(F.y),et,ft,Lt,pt,Ct,bt,Dt,St,Jt=this._objectPoint,Zt=this._sqCellSize,ee=null;for(et=W-1;et<=W+1;et++)if(pt=this._grid[et],pt){for(ft=N-1;ft<=N+1;ft++)if(Ct=pt[ft],Ct)for(Lt=0,bt=Ct.length;Lt<bt;Lt++)Dt=Ct[Lt],St=this._sqDist(Jt[L.Util.stamp(Dt)],F),(St<Zt||St<=Zt&&ee===null)&&(Zt=St,ee=Dt)}return ee},_getCoord:function(F){var N=Math.floor(F/this._cellSize);return isFinite(N)?N:F},_sqDist:function(F,N){var W=N.x-F.x,et=N.y-F.y;return W*W+et*et}},(function(){L.QuickHull={getDistant:function(F,N){var W=N[1].lat-N[0].lat,et=N[0].lng-N[1].lng;return et*(F.lat-N[0].lat)+W*(F.lng-N[0].lng)},findMostDistantPointFromBaseLine:function(F,N){var W=0,et=null,ft=[],Lt,pt,Ct;for(Lt=N.length-1;Lt>=0;Lt--){if(pt=N[Lt],Ct=this.getDistant(pt,F),Ct>0)ft.push(pt);else continue;Ct>W&&(W=Ct,et=pt)}return{maxPoint:et,newPoints:ft}},buildConvexHull:function(F,N){var W=[],et=this.findMostDistantPointFromBaseLine(F,N);return et.maxPoint?(W=W.concat(this.buildConvexHull([F[0],et.maxPoint],et.newPoints)),W=W.concat(this.buildConvexHull([et.maxPoint,F[1]],et.newPoints)),W):[F[0]]},getConvexHull:function(F){var N=!1,W=!1,et=!1,ft=!1,Lt=null,pt=null,Ct=null,bt=null,Dt=null,St=null,Jt;for(Jt=F.length-1;Jt>=0;Jt--){var Zt=F[Jt];(N===!1||Zt.lat>N)&&(Lt=Zt,N=Zt.lat),(W===!1||Zt.lat<W)&&(pt=Zt,W=Zt.lat),(et===!1||Zt.lng>et)&&(Ct=Zt,et=Zt.lng),(ft===!1||Zt.lng<ft)&&(bt=Zt,ft=Zt.lng)}W!==N?(St=pt,Dt=Lt):(St=bt,Dt=Ct);var ee=[].concat(this.buildConvexHull([St,Dt],F),this.buildConvexHull([Dt,St],F));return ee}}})(),L.MarkerCluster.include({getConvexHull:function(){var F=this.getAllChildMarkers(),N=[],W,et;for(et=F.length-1;et>=0;et--)W=F[et].getLatLng(),N.push(W);return L.QuickHull.getConvexHull(N)}}),L.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var F=this.getAllChildMarkers(null,!0),N=this._group,W=N._map,et=W.latLngToLayerPoint(this._latlng),ft;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?ft=this._group.options.spiderfyShapePositions(F.length,et):F.length>=this._circleSpiralSwitchover?ft=this._generatePointsSpiral(F.length,et):(et.y+=10,ft=this._generatePointsCircle(F.length,et)),this._animationSpiderfy(F,ft)}},unspiderfy:function(F){this._group._inZoomAnimation||(this._animationUnspiderfy(F),this._group._spiderfied=null)},_generatePointsCircle:function(F,N){var W=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+F),et=W/this._2PI,ft=this._2PI/F,Lt=[],pt,Ct;for(et=Math.max(et,35),Lt.length=F,pt=0;pt<F;pt++)Ct=this._circleStartAngle+pt*ft,Lt[pt]=new L.Point(N.x+et*Math.cos(Ct),N.y+et*Math.sin(Ct))._round();return Lt},_generatePointsSpiral:function(F,N){var W=this._group.options.spiderfyDistanceMultiplier,et=W*this._spiralLengthStart,ft=W*this._spiralFootSeparation,Lt=W*this._spiralLengthFactor*this._2PI,pt=0,Ct=[],bt;for(Ct.length=F,bt=F;bt>=0;bt--)bt<F&&(Ct[bt]=new L.Point(N.x+et*Math.cos(pt),N.y+et*Math.sin(pt))._round()),pt+=ft/et+bt*5e-4,et+=Lt/pt;return Ct},_noanimationUnspiderfy:function(){var F=this._group,N=F._map,W=F._featureGroup,et=this.getAllChildMarkers(null,!0),ft,Lt;for(F._ignoreMove=!0,this.setOpacity(1),Lt=et.length-1;Lt>=0;Lt--)ft=et[Lt],W.removeLayer(ft),ft._preSpiderfyLatlng&&(ft.setLatLng(ft._preSpiderfyLatlng),delete ft._preSpiderfyLatlng),ft.setZIndexOffset&&ft.setZIndexOffset(0),ft._spiderLeg&&(N.removeLayer(ft._spiderLeg),delete ft._spiderLeg);F.fire("unspiderfied",{cluster:this,markers:et}),F._ignoreMove=!1,F._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(F,N){var W=this._group,et=W._map,ft=W._featureGroup,Lt=this._group.options.spiderLegPolylineOptions,pt,Ct,bt,Dt;for(W._ignoreMove=!0,pt=0;pt<F.length;pt++)Dt=et.layerPointToLatLng(N[pt]),Ct=F[pt],bt=new L.Polyline([this._latlng,Dt],Lt),et.addLayer(bt),Ct._spiderLeg=bt,Ct._preSpiderfyLatlng=Ct._latlng,Ct.setLatLng(Dt),Ct.setZIndexOffset&&Ct.setZIndexOffset(1e6),ft.addLayer(Ct);this.setOpacity(.3),W._ignoreMove=!1,W.fire("spiderfied",{cluster:this,markers:F})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(F,N){var W=this,et=this._group,ft=et._map,Lt=et._featureGroup,pt=this._latlng,Ct=ft.latLngToLayerPoint(pt),bt=L.Path.SVG,Dt=L.extend({},this._group.options.spiderLegPolylineOptions),St=Dt.opacity,Jt,Zt,ee,ie,ei,ke;for(St===void 0&&(St=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),bt?(Dt.opacity=0,Dt.className=(Dt.className||"")+" leaflet-cluster-spider-leg"):Dt.opacity=St,et._ignoreMove=!0,Jt=0;Jt<F.length;Jt++)Zt=F[Jt],ke=ft.layerPointToLatLng(N[Jt]),ee=new L.Polyline([pt,ke],Dt),ft.addLayer(ee),Zt._spiderLeg=ee,bt&&(ie=ee._path,ei=ie.getTotalLength()+.1,ie.style.strokeDasharray=ei,ie.style.strokeDashoffset=ei),Zt.setZIndexOffset&&Zt.setZIndexOffset(1e6),Zt.clusterHide&&Zt.clusterHide(),Lt.addLayer(Zt),Zt._setPos&&Zt._setPos(Ct);for(et._forceLayout(),et._animationStart(),Jt=F.length-1;Jt>=0;Jt--)ke=ft.layerPointToLatLng(N[Jt]),Zt=F[Jt],Zt._preSpiderfyLatlng=Zt._latlng,Zt.setLatLng(ke),Zt.clusterShow&&Zt.clusterShow(),bt&&(ee=Zt._spiderLeg,ie=ee._path,ie.style.strokeDashoffset=0,ee.setStyle({opacity:St}));this.setOpacity(.3),et._ignoreMove=!1,setTimeout(function(){et._animationEnd(),et.fire("spiderfied",{cluster:W,markers:F})},200)},_animationUnspiderfy:function(F){var N=this,W=this._group,et=W._map,ft=W._featureGroup,Lt=F?et._latLngToNewLayerPoint(this._latlng,F.zoom,F.center):et.latLngToLayerPoint(this._latlng),pt=this.getAllChildMarkers(null,!0),Ct=L.Path.SVG,bt,Dt,St,Jt,Zt,ee;for(W._ignoreMove=!0,W._animationStart(),this.setOpacity(1),Dt=pt.length-1;Dt>=0;Dt--)bt=pt[Dt],bt._preSpiderfyLatlng&&(bt.closePopup(),bt.setLatLng(bt._preSpiderfyLatlng),delete bt._preSpiderfyLatlng,ee=!0,bt._setPos&&(bt._setPos(Lt),ee=!1),bt.clusterHide&&(bt.clusterHide(),ee=!1),ee&&ft.removeLayer(bt),Ct&&(St=bt._spiderLeg,Jt=St._path,Zt=Jt.getTotalLength()+.1,Jt.style.strokeDashoffset=Zt,St.setStyle({opacity:0})));W._ignoreMove=!1,setTimeout(function(){var ie=0;for(Dt=pt.length-1;Dt>=0;Dt--)bt=pt[Dt],bt._spiderLeg&&ie++;for(Dt=pt.length-1;Dt>=0;Dt--)bt=pt[Dt],bt._spiderLeg&&(bt.clusterShow&&bt.clusterShow(),bt.setZIndexOffset&&bt.setZIndexOffset(0),ie>1&&ft.removeLayer(bt),et.removeLayer(bt._spiderLeg),delete bt._spiderLeg);W._animationEnd(),W.fire("unspiderfied",{cluster:N,markers:pt})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(F){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(F))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(F){this._spiderfied&&this._spiderfied.unspiderfy(F)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(F){F._spiderLeg&&(this._featureGroup.removeLayer(F),F.clusterShow&&F.clusterShow(),F.setZIndexOffset&&F.setZIndexOffset(0),this._map.removeLayer(F._spiderLeg),delete F._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(F){return F?F instanceof L.MarkerClusterGroup?F=F._topClusterLevel.getAllChildMarkers():F instanceof L.LayerGroup?F=F._layers:F instanceof L.MarkerCluster?F=F.getAllChildMarkers():F instanceof L.Marker&&(F=[F]):F=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(F),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(F),this},_flagParentsIconsNeedUpdate:function(F){var N,W;for(N in F)for(W=F[N].__parent;W;)W._iconNeedsUpdate=!0,W=W.__parent},_refreshSingleMarkerModeMarkers:function(F){var N,W;for(N in F)W=F[N],this.hasLayer(W)&&W.setIcon(this._overrideMarkerIcon(W))}}),L.Marker.include({refreshIconOptions:function(F,N){var W=this.options.icon;return L.setOptions(W,F),this.setIcon(W),N&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),G.MarkerClusterGroup=X,G.MarkerCluster=tt,Object.defineProperty(G,"__esModule",{value:!0})})})(leaflet_markerclusterSrc$1,leaflet_markerclusterSrc$1.exports)),leaflet_markerclusterSrc$1.exports}requireLeaflet_markerclusterSrc();typeof document>"u"&&console.warn('"window.document" is undefined; leaflet.fullscreen requires this object to access the DOM');const nativeAPI=(()=>{const j=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"]],H=j[0],G={};for(const X of j)if(X[1]in document){for(let tt=0;tt<X.length;tt++)G[H[tt]]=X[tt];return G}return!1})(),eventNameMap={change:nativeAPI.fullscreenchange,error:nativeAPI.fullscreenerror},fullscreenAPI={async request(j,H){j=j||document.documentElement;const G=nativeAPI.requestFullscreen;await this._callNative(()=>j[G](H))},async exit(){if(!this.isFullscreen)return;const j=nativeAPI.exitFullscreen;await this._callNative(()=>document[j]())},async _callNative(j){const H=j();if(H instanceof Promise){await H;return}await new Promise(G=>{const X=()=>{this.off("change",X),G()};this.on("change",X)})},on(j,H){const G=eventNameMap[j];G&&document.addEventListener(G,H)},off(j,H){const G=eventNameMap[j];G&&document.removeEventListener(G,H)},nativeAPI};Object.defineProperties(fullscreenAPI,{isFullscreen:{get(){return!!document[nativeAPI.fullscreenElement]}},isEnabled:{enumerable:!0,get(){return!!document[nativeAPI.fullscreenEnabled]}}});const FullScreen=leafletSrcExports.Control.extend({options:{position:"topleft",title:"Full Screen",titleCancel:"Exit Full Screen",forceSeparateButton:!1,forcePseudoFullscreen:!1,fullscreenElement:!1},_screenfull:fullscreenAPI,onAdd(j){let H="leaflet-control-zoom-fullscreen",G,X="";return j.zoomControl&&!this.options.forceSeparateButton?G=j.zoomControl._container:(G=document.createElement("div"),G.className="leaflet-bar"),this.options.content?X=this.options.content:H+=" leaflet-fullscreen-icon",this._createButton(this.options.title,H,X,G,this.toggleFullScreen,this),this._map.fullscreenControl=this,this._map.on("enterFullscreen exitFullscreen",this._toggleState,this),G},onRemove(){leafletSrcExports.DomEvent.off(this.link,"click",leafletSrcExports.DomEvent.stop).off(this.link,"click",this.toggleFullScreen,this),this._screenfull.isEnabled&&leafletSrcExports.DomEvent.off(document,this._screenfull.nativeAPI.fullscreenchange,leafletSrcExports.DomEvent.stop).off(document,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,this)},_createButton(j,H,G,X,tt,F){return this.link=document.createElement("a"),this.link.className=H,X.appendChild(this.link),this.link.href="#",this.link.title=j,this.link.innerHTML=G,this.link.setAttribute("role","button"),this.link.setAttribute("aria-label",j),leafletSrcExports.DomEvent.disableClickPropagation(X),leafletSrcExports.DomEvent.on(this.link,"click",leafletSrcExports.DomEvent.stop).on(this.link,"click",tt,F),this._screenfull.isEnabled&&leafletSrcExports.DomEvent.on(document,this._screenfull.nativeAPI.fullscreenchange,leafletSrcExports.DomEvent.stop).on(document,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,F),this.link},async toggleFullScreen(){const j=this._map,{fullscreenElement:H,forcePseudoFullscreen:G}=this.options,X=H||j.getContainer(),tt=this._screenfull.isEnabled&&!G;j._isFullscreen?(j._exitFired=!0,tt?await this._screenfull.exit():X.classList.remove("leaflet-pseudo-fullscreen"),j.invalidateSize(),j._isFullscreen=!1,j.fire("exitFullscreen")):(j._exitFired=!1,tt?await this._screenfull.request(X):X.classList.add("leaflet-pseudo-fullscreen"),j.invalidateSize(),j._isFullscreen=!0,j.fire("enterFullscreen"))},_toggleState(){const{title:j,titleCancel:H}=this.options,G=this._map._isFullscreen;this.link.title=G?H:j,this.link.setAttribute("aria-label",this.link.title),this.link.setAttribute("aria-pressed",G.toString()),this.link.classList.toggle("leaflet-fullscreen-on",G)},_handleFullscreenChange(){const j=this._map;!this._screenfull.isFullscreen&&j._isFullscreen&&!j._exitFired&&(j._exitFired=!0,j._isFullscreen=!1,j.fire("exitFullscreen"),j.invalidateSize())}});leafletSrcExports.Map.include({toggleFullscreen(){this.fullscreenControl.toggleFullScreen()}});function e(){return e=Object.assign?Object.assign.bind():function(j){for(var H=1;H<arguments.length;H++){var G=arguments[H];for(var X in G)Object.prototype.hasOwnProperty.call(G,X)&&(j[X]=G[X])}return j},e.apply(this,arguments)}function r(j,H){j.prototype=Object.create(H.prototype),j.prototype.constructor=j,n(j,H)}function n(j,H){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(G,X){return G.__proto__=X,G},n(j,H)}function o(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function i(j,H,G){return i=o()?Reflect.construct.bind():function(X,tt,F){var N=[null];N.push.apply(N,tt);var W=new(Function.bind.apply(X,N));return F&&n(W,F.prototype),W},i.apply(null,arguments)}function s(j,H,G,X){H===void 0&&(H=""),X===void 0&&(X={});var tt=document.createElement(j);return H&&(tt.className=H),Object.keys(X).forEach(function(F){if(typeof X[F]=="function"){var N=F.indexOf("on")===0?F.substr(2).toLowerCase():F;tt.addEventListener(N,X[F])}else F==="html"?tt.innerHTML=X[F]:F==="text"?tt.innerText=X[F]:tt.setAttribute(F,X[F])}),G&&G.appendChild(tt),tt}function a(j){j.preventDefault(),j.stopPropagation()}var l=function(){return[].slice.call(arguments).filter(Boolean).join(" ").trim()};function c(j,H){j&&j.classList&&(Array.isArray(H)?H:[H]).forEach(function(G){j.classList.contains(G)||j.classList.add(G)})}function u(j,H){j&&j.classList&&(Array.isArray(H)?H:[H]).forEach(function(G){j.classList.contains(G)&&j.classList.remove(G)})}var h,p=13,d=40,f=38,m=[p,27,d,f,37,39],v=(function(){function j(G){var X=this,tt=G.handleSubmit,F=G.searchLabel,N=G.classNames,W=N===void 0?{}:N;this.container=void 0,this.form=void 0,this.input=void 0,this.handleSubmit=void 0,this.hasError=!1,this.container=s("div",l("geosearch",W.container)),this.form=s("form",["",W.form].join(" "),this.container,{autocomplete:"none",onClick:a,onDblClick:a,touchStart:a,touchEnd:a}),this.input=s("input",["glass",W.input].join(" "),this.form,{type:"text",placeholder:F||"search",onInput:this.onInput,onKeyUp:function(et){return X.onKeyUp(et)},onKeyPress:function(et){return X.onKeyPress(et)},onFocus:this.onFocus,onBlur:this.onBlur,onClick:function(){X.input.focus(),X.input.dispatchEvent(new Event("focus"))}}),this.handleSubmit=tt}var H=j.prototype;return H.onFocus=function(){c(this.form,"active")},H.onBlur=function(){u(this.form,"active")},H.onSubmit=function(G){try{var X=this;return a(G),u(tt=X.container,"error"),c(tt,"pending"),Promise.resolve(X.handleSubmit({query:X.input.value})).then(function(){u(X.container,"pending")})}catch(F){return Promise.reject(F)}var tt},H.onInput=function(){this.hasError&&(u(this.container,"error"),this.hasError=!1)},H.onKeyUp=function(G){G.keyCode===27&&(u(this.container,["pending","active"]),this.input.value="",document.body.focus(),document.body.blur())},H.onKeyPress=function(G){G.keyCode===p&&this.onSubmit(G)},H.setQuery=function(G){this.input.value=G},j})(),g=(function(){function j(G){var X=this,tt=G.handleClick,F=G.classNames,N=F===void 0?{}:F,W=G.notFoundMessage;this.handleClick=void 0,this.selected=-1,this.results=[],this.container=void 0,this.resultItem=void 0,this.notFoundMessage=void 0,this.onClick=function(et){if(typeof X.handleClick=="function"){var ft=et.target;if(ft&&X.container.contains(ft)&&ft.hasAttribute("data-key")){var Lt=Number(ft.getAttribute("data-key"));X.handleClick({result:X.results[Lt]})}}},this.handleClick=tt,this.notFoundMessage=W?s("div",l(N.notfound),void 0,{html:W}):void 0,this.container=s("div",l("results",N.resultlist)),this.container.addEventListener("click",this.onClick,!0),this.resultItem=s("div",l(N.item))}var H=j.prototype;return H.render=function(G,X){var tt=this;G===void 0&&(G=[]),this.clear(),G.forEach(function(F,N){var W=tt.resultItem.cloneNode(!0);W.setAttribute("data-key",""+N),W.innerHTML=X({result:F}),tt.container.appendChild(W)}),G.length>0?(c(this.container.parentElement,"open"),c(this.container,"active")):this.notFoundMessage&&(this.container.appendChild(this.notFoundMessage),c(this.container.parentElement,"open")),this.results=G},H.select=function(G){return Array.from(this.container.children).forEach(function(X,tt){return tt===G?c(X,"active"):u(X,"active")}),this.selected=G,this.results[G]},H.count=function(){return this.results?this.results.length:0},H.clear=function(){for(this.selected=-1;this.container.lastChild;)this.container.removeChild(this.container.lastChild);u(this.container.parentElement,"open"),u(this.container,"active")},j})(),y={position:"topleft",style:"button",showMarker:!0,showPopup:!1,popupFormat:function(j){return""+j.result.label},resultFormat:function(j){return""+j.result.label},marker:{icon:t&&leafletSrcExports.Icon?new leafletSrcExports.Icon.Default:void 0,draggable:!1},maxMarkers:1,maxSuggestions:5,retainZoomLevel:!1,animateZoom:!0,searchLabel:"Enter address",clearSearchLabel:"Clear search",notFoundMessage:"",messageHideDelay:3e3,zoomLevel:18,classNames:{container:"leaflet-bar leaflet-control leaflet-control-geosearch",button:"leaflet-bar-part leaflet-bar-part-single",resetButton:"reset",msgbox:"leaflet-bar message",form:"",input:"",resultlist:"",item:"",notfound:"leaflet-bar-notfound"},autoComplete:!0,autoCompleteDelay:250,autoClose:!1,keepResult:!1,updateMap:!0,resetButton:"×"},b="Leaflet must be loaded before instantiating the GeoSearch control",E={options:e({},y),classNames:e({},y.classNames),initialize:function(j){var H,G,X,tt,F=this;if(!t)throw new Error(b);if(!j.provider)throw new Error("Provider is missing from options");this.options=e({},y,j),this.classNames=e({},this.classNames,j.classNames),this.markers=new leafletSrcExports.FeatureGroup,this.classNames.container+=" leaflet-geosearch-"+this.options.style,this.searchElement=new v({searchLabel:this.options.searchLabel,classNames:{container:this.classNames.container,form:this.classNames.form,input:this.classNames.input},handleSubmit:function(N){return F.onSubmit(N)}}),this.button=s("a",this.classNames.button,this.searchElement.container,{title:this.options.searchLabel,href:"#",onClick:function(N){return F.onClick(N)}}),leafletSrcExports.DomEvent.disableClickPropagation(this.button),this.resetButton=s("button",this.classNames.resetButton,this.searchElement.form,{text:this.options.resetButton,"aria-label":this.options.clearSearchLabel,onClick:function(){F.searchElement.input.value===""?F.close():F.clearResults(null,!0)}}),leafletSrcExports.DomEvent.disableClickPropagation(this.resetButton),this.options.autoComplete&&(this.resultList=new g({handleClick:function(N){var W=N.result;F.searchElement.input.value=W.label,F.onSubmit({query:W.label,data:W})},classNames:{resultlist:this.classNames.resultlist,item:this.classNames.item,notfound:this.classNames.notfound},notFoundMessage:this.options.notFoundMessage}),this.searchElement.form.appendChild(this.resultList.container),this.searchElement.input.addEventListener("keyup",(H=function(N){return F.autoSearch(N)},(G=this.options.autoCompleteDelay)===void 0&&(G=250),X===void 0&&(X=!1),function(){var N=[].slice.call(arguments);tt&&clearTimeout(tt),tt=setTimeout(function(){tt=null,X||H.apply(void 0,N)},G),X&&!tt&&H.apply(void 0,N)}),!0),this.searchElement.input.addEventListener("keydown",function(N){return F.selectResult(N)},!0),this.searchElement.input.addEventListener("keydown",function(N){return F.clearResults(N,!0)},!0)),this.searchElement.form.addEventListener("click",function(N){N.preventDefault()},!1)},onAdd:function(j){var H=this.options,G=H.showMarker,X=H.style;if(this.map=j,G&&this.markers.addTo(j),X==="bar"){var tt=j.getContainer().querySelector(".leaflet-control-container");this.container=s("div","leaflet-control-geosearch leaflet-geosearch-bar"),this.container.appendChild(this.searchElement.form),tt.appendChild(this.container)}return leafletSrcExports.DomEvent.disableClickPropagation(this.searchElement.form),this.searchElement.container},onRemove:function(){var j;return(j=this.container)==null||j.remove(),this},open:function(){var j=this.searchElement,H=j.input;c(j.container,"active"),H.focus()},close:function(){u(this.searchElement.container,"active"),this.clearResults()},onClick:function(j){j.preventDefault(),j.stopPropagation(),this.searchElement.container.classList.contains("active")?this.close():this.open()},selectResult:function(j){if([p,d,f].indexOf(j.keyCode)!==-1)if(j.preventDefault(),j.keyCode!==p){var H=this.resultList.count()-1;if(!(H<0)){var G=this.resultList.selected,X=j.keyCode===d?G+1:G-1,tt=this.resultList.select(X<0?H:X>H?0:X);this.searchElement.input.value=tt.label}}else{var F=this.resultList.select(this.resultList.selected);this.onSubmit({query:this.searchElement.input.value,data:F})}},clearResults:function(j,H){if(H===void 0&&(H=!1),!j||j.keyCode===27){var G=this.options,X=G.autoComplete;!H&&G.keepResult||(this.searchElement.input.value="",this.markers.clearLayers()),X&&this.resultList.clear()}},autoSearch:function(j){try{var H=this;if(m.indexOf(j.keyCode)>-1)return Promise.resolve();var G=j.target.value,X=H.options.provider,tt=(function(){if(G.length)return Promise.resolve(X.search({query:G})).then(function(F){F=F.slice(0,H.options.maxSuggestions),H.resultList.render(F,H.options.resultFormat)});H.resultList.clear()})();return Promise.resolve(tt&&tt.then?tt.then(function(){}):void 0)}catch(F){return Promise.reject(F)}},onSubmit:function(j){try{var H=this;return H.resultList.clear(),Promise.resolve(H.options.provider.search(j)).then(function(G){G&&G.length>0&&H.showResult(G[0],j)})}catch(G){return Promise.reject(G)}},showResult:function(j,H){var G=this.options,X=G.autoClose,tt=G.updateMap,F=this.markers.getLayers();F.length>=this.options.maxMarkers&&this.markers.removeLayer(F[0]);var N=this.addMarker(j,H);tt&&this.centerMap(j),this.map.fireEvent("geosearch/showlocation",{location:j,marker:N}),X&&this.closeResults()},closeResults:function(){var j=this.searchElement.container;j.classList.contains("active")&&u(j,"active"),this.clearResults()},addMarker:function(j,H){var G=this,X=this.options,tt=X.marker,F=X.showPopup,N=X.popupFormat,W=new leafletSrcExports.Marker([j.y,j.x],tt),et=j.label;return typeof N=="function"&&(et=N({query:H,result:j})),W.bindPopup(et),this.markers.addLayer(W),F&&W.openPopup(),tt.draggable&&W.on("dragend",function(ft){G.map.fireEvent("geosearch/marker/dragend",{location:W.getLatLng(),event:ft})}),W},centerMap:function(j){var H=this.options,G=H.retainZoomLevel,X=H.animateZoom,tt=j.bounds?new leafletSrcExports.LatLngBounds(j.bounds):new leafletSrcExports.LatLng(j.y,j.x).toBounds(10),F=tt.isValid()?tt:this.markers.getBounds();!G&&tt.isValid()&&!j.bounds||G||!tt.isValid()?this.map.setView(F.getCenter(),this.getZoom(),{animate:X}):this.map.fitBounds(F,{animate:X})},getZoom:function(){var j=this.options,H=j.zoomLevel;return j.retainZoomLevel?this.map.getZoom():H}};function w(){if(!t)throw new Error(b);var j=leafletSrcExports.Control.extend(E);return i(j,[].slice.call(arguments))}(function(j){j[j.SEARCH=0]="SEARCH",j[j.REVERSE=1]="REVERSE"})(h||(h={}));var x=(function(){function j(G){G===void 0&&(G={}),this.options=void 0,this.options=G}var H=j.prototype;return H.getParamString=function(G){G===void 0&&(G={});var X=e({},this.options.params,G);return Object.keys(X).map(function(tt){return encodeURIComponent(tt)+"="+encodeURIComponent(X[tt])}).join("&")},H.getUrl=function(G,X){return G+"?"+this.getParamString(X)},H.search=function(G){try{var X=this,tt=X.endpoint({query:G.query,type:h.SEARCH});return Promise.resolve(fetch(tt)).then(function(F){return Promise.resolve(F.json()).then(function(N){return X.parse({data:N})})})}catch(F){return Promise.reject(F)}},j})(),L$1=(function(j){function H(){for(var X,tt=arguments.length,F=new Array(tt),N=0;N<tt;N++)F[N]=arguments[N];return(X=j.call.apply(j,[this].concat(F))||this).searchUrl="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find",X}r(H,j);var G=H.prototype;return G.endpoint=function(X){var tt=X.query,F=typeof tt=="string"?{text:tt}:tt;return F.f="json",this.getUrl(this.searchUrl,F)},G.parse=function(X){return X.data.locations.map(function(tt){return{x:tt.feature.geometry.x,y:tt.feature.geometry.y,label:tt.name,bounds:[[tt.extent.ymin,tt.extent.xmin],[tt.extent.ymax,tt.extent.xmax]],raw:tt}})},H})(x);typeof SuppressedError=="function"&&SuppressedError;var I;(function(j){j[j.INITIALIZED=0]="INITIALIZED",j[j.LOADING=1]="LOADING",j[j.SUCCESS=2]="SUCCESS",j[j.FAILURE=3]="FAILURE"})(I||(I={}));class LeafletMapCore{constructor(j){this.map=null,this.config=j,this.layers=new Map,this.layerGroups=new Map,this.baseLayers={},this.geoJsonLayer=null,this.info=null,this.layerControl=null,this.isDrawing=!1,this.callbacks={}}init(){this.createMap(),this.addTileLayers(),this.addLayerGroups(),this.setupMapControls(),Object.keys(this.config.geoJsonData)?.length&&(this.setupInfoControl(),this.loadGeoJson()),this.addLayers()}getTranslation(j,H=""){return window.filamentData?.translations?.[j]||H}createMap(){this.map=L$2.map(this.config.mapId,this.config.mapConfig||{}).setView(this.config.defaultCoord,this.config.defaultZoom),this.config.autoCenter&&this.map.locate({setView:!0}),new ResizeObserver(()=>{this.map&&Alpine.raw(this.map).invalidateSize()}).observe(Alpine.raw(this.map._container))}addTileLayers(){this.config.tileLayersUrl.forEach(([j,H,G],X)=>{const tt=L$2.tileLayer(H,{maxZoom:this.config.zoomConfig.max,minZoom:this.config.zoomConfig.min,attribution:G});this.baseLayers[j]=Alpine.raw(tt),X===0&&Alpine.raw(tt).addTo(Alpine.raw(this.map))})}setupInfoControl(){this.info=L$2.control(),this.info.onAdd=()=>{const j=L$2.DomUtil.create("div","info");return this.info._div=j,j.style.display="none",j},this.info.update=j=>{if(this.info._div)if(j){this.info._div.style.display="block";let H=this.config.infoText.replace("{state}",j.name).replace("{density}",j.density);this.info._div.innerHTML=H}else this.info._div.style.display="none"},this.info.addTo(Alpine.raw(this.map))}async loadGeoJson(){if(this.config.geoJsonUrl)try{const H=await(await fetch(this.config.geoJsonUrl)).json(),G=Object.entries(this.config.geoJsonData).filter(([X])=>H[X]).map(([X,tt])=>({type:"Feature",id:X,properties:{name:H[X].name,density:tt},geometry:{type:"Polygon",coordinates:H[X].coordinates}}));this.geoJsonLayer=L$2.geoJson({type:"FeatureCollection",features:G},{style:X=>this.getFeatureStyle(X),onEachFeature:(X,tt)=>{tt.on({mouseover:F=>this.info?.update(F.target.feature.properties),mouseout:()=>this.info?.update(),click:F=>Alpine.raw(this.map).fitBounds(F.target.getBounds())})}}).addTo(Alpine.raw(this.map))}catch(j){console.error("Erro GeoJSON:",j)}}getFeatureStyle(j){const H=Object.values(this.config.geoJsonData),G=j.properties.density/Math.max(...H),X=Math.max(0,Math.ceil(G*this.config.geoJsonColors.length)-1);return{fillColor:this.config.geoJsonColors[X],weight:2,opacity:1,color:"white",dashArray:"3",fillOpacity:.8}}removeLayer(j){let H=this.layers.get(j.id);H&&Alpine.raw(this.map).removeLayer(Alpine.raw(H.layer))}addLayer(layerData){let layer=null;switch(layerData.type){case"marker":layer=this.createMarker(layerData);break;case"circle":layer=this.createCircle(layerData);break;case"circleMarker":layer=this.createCircleMarker(layerData);break;case"rectangle":layer=this.createRectangle(layerData);break;case"polygon":layer=this.createPolygon(layerData);break;case"polyline":layer=this.createPolyline(layerData);break;default:console.warn(`Tipo de layer desconhecido: ${layerData.type}`);return}if(!layer)return;layer.options.group=layerData.group||null,layerData.popup&&this.bindPopup(layer,layerData.popup),layerData.tooltip&&this.bindTooltip(layer,layerData.tooltip),layer.on("click",()=>{this.callbacks.onLayerClick&&this.callbacks.onLayerClick(layerData.id)}),layerData.onMouseOver&&layer.on("mouseover",function(){eval(layerData.onMouseOver)}),layerData.onMouseOut&&layer.on("mouseout",function(){eval(layerData.onMouseOut)}),layerData.isEditable?layer.pm.enable():layer.pm.disable();const updateHandler=j=>{if(this.callbacks.onLayerUpdated){const H=j.target;console.log(H);let G={};H instanceof L$2.Marker?G=H.getLatLng():H instanceof L$2.Circle||H instanceof L$2.CircleMarker?G={lat:H.getLatLng().lat,lng:H.getLatLng().lng,radius:H.getRadius()}:H instanceof L$2.Rectangle?G={bounds:Object.values(H.getBounds()).map(tt=>[tt.lat,tt.lng])}:H instanceof L$2.Polygon?G={points:H.getLatLngs()[0].map(tt=>[tt.lat,tt.lng])}:H instanceof L$2.Polyline&&(G={points:H.getLatLngs().map(tt=>[tt.lat,tt.lng])}),this.callbacks.onLayerUpdated(layerData.id,G)}};if(layer.on("dragend",updateHandler),layer.on("pm:update",updateHandler),layerData.group){const j=this.layerGroups.get(layerData.group);Alpine.raw(layer).addTo(Alpine.raw(j.layer))}else Alpine.raw(layer).addTo(Alpine.raw(this.map));Alpine.raw(this.layers).set(layerData.id,{layer:Alpine.raw(layer),data:layerData})}addLayers(){const j=Alpine.raw(this.config.layersData);j?.length&&j.forEach(H=>this.addLayer(H))}addLayerGroups(){const j=Alpine.raw(this.config.layerGroupsData);!Object.keys(j)?.length>0||j.forEach(H=>{let G=null;switch(H.options={pmIgnore:!0},H.type){case"group":G=L$2.layerGroup(H.options);break;case"feature":G=L$2.featureGroup(H.options);break;case"cluster":G=L$2.markerClusterGroup(H.options);break;default:console.warn(`Tipo de grupo desconhecido: ${H.type}`);return}G&&(this.layerGroups.set(H.id,{name:H.name,layer:G}),G.addTo(Alpine.raw(this.map)))})}createMarker(j){const H=this.createIcon(j.icon);return L$2.marker(j.coords,{icon:H,draggable:j.draggable})}createCircle(j){return L$2.circle(j.center,j.options)}createCircleMarker(j){return L$2.circleMarker(j.center,j.options)}createRectangle(j){return L$2.rectangle(j.bounds,j.options)}createPolygon(j){return L$2.polygon(j.points,j.options)}createPolyline(j){return L$2.polyline(j.points,j.options)}createIcon(j){const H=j?.url,G=j?.size||[24,36],X=j?.heroicon||null,tt=[G[0]/2,G[1]],F=[0,G[1]/1.25*-1],N=[0,G[1]/1.25*-1];let W={className:"",iconSize:G,iconAnchor:tt,popupAnchor:F,tooltipAnchor:N};if(H)W.html=`
|
||
<div style="position: relative; width: ${G[0]}px; height: ${G[1]}px; overflow: visible;">
|
||
|
||
<!-- SHADOW -->
|
||
<img src="${H}" style="
|
||
position: absolute;
|
||
width: 100%;
|
||
height: 100%;
|
||
left: 0;
|
||
top: 0;
|
||
filter: brightness(0) blur(2px) opacity(0.5);
|
||
transform: skewX(-35deg) scale(0.65);
|
||
transform-origin: bottom center;
|
||
z-index: 0;
|
||
pointer-events: none; /* Evita que o mouse interaja com a sombra */
|
||
"/>
|
||
|
||
<!-- MARKER IMAGE -->
|
||
<img src="${H}" style="
|
||
position: absolute;
|
||
width: 100%;
|
||
height: 100%;
|
||
left: 0;
|
||
top: 0;
|
||
z-index: 1;
|
||
"/>
|
||
|
||
</div>
|
||
`;else{const et=new TinyColor(j?.color||"#2b7fff"),ft=et.toHexString(),Lt=et.darken(15).toHexString(),pt=`grad-${ft.replace("#","")}`,Ct=`shadow-${ft.replace("#","")}`,bt="M12 0C5.4 0 0 5.4 0 12c0 9 12 24 12 24s12-15 12-24C24 5.4 18.6 0 12 0z";let Dt;X?Dt=`
|
||
<foreignObject x="2" y="2" width="20" height="20" style="color: white;">
|
||
${X}
|
||
</foreignObject>
|
||
`:Dt=`<circle cx="12" cy="12" r="5" fill="white" stroke="${Lt}" stroke-width="1" />`,W.html=`
|
||
<svg
|
||
xmlns="http://www.w3.org/2000/svg"
|
||
viewBox="0 0 24 36"
|
||
width="${G[0]}"
|
||
height="${G[1]}"
|
||
style="overflow: visible; display: block;"
|
||
>
|
||
<defs>
|
||
<linearGradient id="${pt}" x1="0%" y1="0%" x2="100%" y2="100%">
|
||
<stop offset="0%" stop-color="${ft}" />
|
||
<stop offset="100%" stop-color="${Lt}" />
|
||
</linearGradient>
|
||
|
||
<filter id="${Ct}" x="-50%" y="-50%" width="200%" height="200%">
|
||
<feGaussianBlur in="SourceGraphic" stdDeviation="2.5" />
|
||
</filter>
|
||
</defs>
|
||
|
||
<!-- SHADOW -->
|
||
<path
|
||
d="${bt}"
|
||
fill="rgba(0,0,0,0.25)"
|
||
filter="url(#${Ct})"
|
||
transform="translate(12, 36) skewX(-30) scale(1, 0.5) translate(-12, -30)"
|
||
/>
|
||
|
||
<!-- MARKER -->
|
||
<path
|
||
d="${bt}"
|
||
fill="url(#${pt})"
|
||
stroke="${Lt}"
|
||
stroke-width="1"
|
||
/>
|
||
|
||
<!-- INNER ICON (heroicon ou dot) -->
|
||
${Dt}
|
||
|
||
</svg>
|
||
`}return L$2.divIcon(W)}bindPopup(j,H){let G='<div class="custom-popup">';H.title&&(G+=`<strong>${H.title}</strong>`),H.content&&(G+=`<div>${H.content}</div>`),H.actions&&H.actions.length>0&&H.actions.forEach(X=>{G+=`<button onclick="${X.action}">${X.label}</button>`}),G+="</div>",j.bindPopup(G,H.options||{})}bindTooltip(j,H){const G=H.content,X=H.options||{};j.bindTooltip(G,X)}setupLayerControl(){let j=Array.from(this.layerGroups.values()).filter(tt=>tt&&tt.name).map(tt=>[tt.name,tt.layer]);j=Object.fromEntries(j);let H=Alpine.raw(this.baseLayers);const G=Object.keys(H)?.length>1,X=Object.keys(j)?.length>0;!G&&!X||(this.layerControl&&Alpine.raw(this.map).removeControl(Alpine.raw(this.layerControl)),this.layerControl=L$2.control.layers(H,j),Alpine.raw(this.layerControl).addTo(Alpine.raw(this.map)))}setupMapControls(){this.config.mapControls.attributionControl&&this.setupAttributionControl(),this.config.mapControls.scaleControl&&this.setupScaleControl(),this.config.mapControls.zoomControl&&this.setupZoomControl(),this.config.mapControls.fullscreenControl&&this.setupFullscreenControl(),this.config.mapControls.searchControl&&this.setupSearchControl(),this.config.mapControls.drawControls&&this.setupDrawControl(),this.setupLayerControl()}setupAttributionControl(){new L$2.control.attribution().addTo(Alpine.raw(this.map))}setupScaleControl(){new L$2.control.scale().addTo(Alpine.raw(this.map))}setupZoomControl(){new L$2.control.zoom().addTo(Alpine.raw(this.map))}setupSearchControl(){const j=new L$1;new w({provider:j,notFoundMessage:this.getTranslation("address_not_found",""),searchLabel:this.getTranslation("enter_address",""),marker:{icon:this.createIcon(),draggable:!1}}).addTo(Alpine.raw(this.map))}setupFullscreenControl(){new FullScreen({title:this.getTranslation("full_screen",""),titleCancel:this.getTranslation("exit_full_screen",""),forceSeparateButton:!0}).addTo(Alpine.raw(this.map))}setupDrawControl(){Alpine.raw(this.map.pm).setLang(window.filamentData?.language),Alpine.raw(this.map.pm).setGlobalOptions({snappable:!0,snapDistance:20,markerStyle:{icon:this.createIcon()}}),Alpine.raw(this.map.pm).addControls(this.config.mapControls.drawControls)}setupEventHandlers(j={}){this.callbacks=j,Alpine.raw(this.map).on("click",G=>{if(this.isDrawing)return;const X=G.latlng;this.callbacks.onMapClick&&this.callbacks.onMapClick(X.lat,X.lng)});let H=null;Alpine.raw(this.map).on("move",()=>{if(!this.config.mapConfig.recenterMapTimeout)return;clearTimeout(H);const G=this.map.getCenter(),X=this.map.getZoom();Math.abs(G.lat-this.config.defaultCoord[0])<1&&Math.abs(G.lng-this.config.defaultCoord[1])<1&&Math.abs(X-this.config.defaultZoom)<1||(H=setTimeout(()=>{this.map.flyTo(this.config.defaultCoord,this.config.defaultZoom)},this.config.mapConfig.recenterMapTimeout))}),Alpine.raw(this.map).on("pm:globaldrawmodetoggled",G=>{this.isDrawing=G.enabled}),Alpine.raw(this.map).on("pm:globaleditmodetoggled",G=>{this.isDrawing=G.enabled}),Alpine.raw(this.map).on("pm:globaldragmodetoggled",G=>{this.isDrawing=G.enabled}),Alpine.raw(this.map).on("pm:globalremovalmodetoggled",G=>{this.isDrawing=G.enabled}),Alpine.raw(this.map).on("pm:globalcutmodetoggled",G=>{this.isDrawing=G.enabled}),Alpine.raw(this.map).on("pm:globalrotatemodetoggled",G=>{this.isDrawing=G.enabled})}updateMapData(j){const H=this.config;this.config=j;let G=[],X=[];H.layersData.forEach(tt=>{this.config.layersData.find(F=>F.id==tt.id)||X.push(tt)}),this.config.layersData.forEach(tt=>{H.layersData.find(F=>F.id==tt.id)||G.push(tt)}),X.forEach(tt=>this.removeLayer(tt)),G.forEach(tt=>this.addLayer(tt)),Object.keys(this.config.geoJsonData)?.length&&(this.setupInfoControl(),this.loadGeoJson())}clearLayers(){Object.values(this.layers).forEach(({layer:j})=>{j.options.group?Alpine.raw(this.layerGroups[j.options.group].layer).removeLayer(Alpine.raw(j)):Alpine.raw(this.map).removeLayer(Alpine.raw(j))}),this.layers.clear(),Object.values(this.layerGroups).forEach(({layer:j})=>{Alpine.raw(this.map).removeLayer(Alpine.raw(j))}),this.layerGroups.clear(),this.layerControl&&(Alpine.raw(this.map).removeControl(this.layerControl),this.layerControl=null)}destroy(){this.map&&(this.clearLayers(),Alpine.raw(this.map).remove(),this.map=null)}}document.addEventListener("livewire:init",()=>{const j=(H,G)=>({mapCore:null,config:G,$wire:H,state:void 0,pickMarker:null,init(){this.mapCore=new LeafletMapCore(this.config),this.state=this.getState(),this.mapCore.init(),this.setupEventHandlers(),this.updatePickMarker(),this.watchState()},getState(){if(!this.config.state)return;const X=this.$wire.get(this.config.state.statePath);return{lat:X?X[this.config.state.latitudeFieldName]:this.config.defaultCoord[0],lng:X?X[this.config.state.longitudeFieldName]:this.config.defaultCoord[1]}},setState(X,tt){this.config.state&&(this.$wire.set(this.config.state.statePath,{[this.config.state.latitudeFieldName]:X,[this.config.state.longitudeFieldName]:tt}),this.updatePickMarker())},watchState(){this.config.state&&this.$wire.watch(this.config.state.statePath,()=>{this.updatePickMarker()})},updatePickMarker(){this.pickMarker&&Alpine.raw(this.pickMarker).removeFrom(Alpine.raw(this.mapCore.map));const X=this.getState();let tt=this.config.state.pickMarker;tt.coords=Object.values(X),this.pickMarker=this.mapCore.createMarker(tt),Alpine.raw(this.pickMarker).addTo(Alpine.raw(this.mapCore.map))},setupEventHandlers(){const X={onMapClick:(tt,F)=>{this.config.state.disabled||this.setState(tt,F),this.callFieldMethod("handleMapClick",{latitude:tt,longitude:F})},onLayerClick:tt=>{this.callFieldMethod("handleLayerClick",{layerId:tt})},onLayerUpdated:(tt,F)=>{this.callFieldMethod("handleLayerUpdated",{layerId:tt,data:F})}};this.mapCore.setupEventHandlers(X)},callFieldMethod(X,tt){this.$wire.callSchemaComponentMethod(G.state.key,X,tt)}});window.leafletMapField=j}),document.addEventListener("livewire:init",()=>{const j=(H,G)=>({mapCore:null,config:G,$wire:H,init(){this.mapCore=new LeafletMapCore(this.config),this.mapCore.init(),this.setupEventHandlers(),this.setupLivewireListeners()},setupEventHandlers(){const X={onMapClick:(tt,F)=>{this.$wire.call("handleMapClick",tt,F)},onLayerClick:tt=>{this.$wire.call("handleLayerClick",tt)},onLayerUpdated:(tt,F)=>{this.$wire.call("handleLayerUpdated",tt,F)}};this.mapCore.setupEventHandlers(X)},setupLivewireListeners(){window.addEventListener(`update-leaflet-${this.config.mapId}`,X=>{this.updateMapData(X.detail.config)})},updateMapData(X){this.config=X,this.mapCore.updateMapData(X)}});window.leafletMapWidget=j}),document.addEventListener("livewire:init",()=>{const j=(H,G)=>({mapCore:null,config:G,$wire:H,state:void 0,pickMarker:null,init(){this.mapCore=new LeafletMapCore(this.config),this.state=this.getState(),this.mapCore.init(),this.setupEventHandlers(),this.setupPickMarker()},getState(){if(!this.config.state)return;const X=this.config.state.state;return{lat:X?X[this.config.state.latitudeFieldName]:this.config.defaultCoord[0],lng:X?X[this.config.state.longitudeFieldName]:this.config.defaultCoord[1]}},setupPickMarker(){const X=this.getState();this.pickMarker&&Alpine.raw(this.pickMarker).removeFrom(Alpine.raw(this.mapCore.map));let tt=this.config.state.pickMarker;tt.coords=Object.values(X),this.pickMarker=this.mapCore.createMarker(tt),Alpine.raw(this.pickMarker).addTo(Alpine.raw(this.mapCore.map))},setupEventHandlers(){const X={onMapClick:(tt,F)=>{this.callFieldMethod("handleMapClick",{latitude:tt,longitude:F})},onLayerClick:tt=>{this.callFieldMethod("handleLayerClick",{layerId:tt})},onLayerUpdated:(tt,F)=>{this.callFieldMethod("handleLayerUpdated",{layerId:tt,data:F})}};this.mapCore.setupEventHandlers(X)},callFieldMethod(X,tt){this.$wire.callSchemaComponentMethod(G.state.key,X,tt)}});window.leafletMapEntry=j}),document.addEventListener("livewire:init",()=>{const j=(H,G)=>({mapCore:null,config:G,$wire:H,state:void 0,pickMarker:null,init(){this.mapCore=new LeafletMapCore(this.config),this.state=this.getState(),this.mapCore.init(),this.setupEventHandlers(),this.setupPickMarker()},getState(){if(!this.config.state)return;const X=this.config.state.state;return{lat:X?X[this.config.state.latitudeFieldName]:this.config.defaultCoord[0],lng:X?X[this.config.state.longitudeFieldName]:this.config.defaultCoord[1]}},setupPickMarker(){const X=this.getState();this.pickMarker&&Alpine.raw(this.pickMarker).removeFrom(Alpine.raw(this.mapCore.map));let tt=this.config.state.pickMarker;tt.coords=Object.values(X),this.pickMarker=this.mapCore.createMarker(tt),Alpine.raw(this.pickMarker).addTo(Alpine.raw(this.mapCore.map))},setupEventHandlers(){const X={onMapClick:(tt,F)=>{this.callColumnMethod("handleMapClick",{latitude:tt,longitude:F})},onLayerClick:tt=>{this.callColumnMethod("handleLayerClick",{layerId:tt})},onLayerUpdated:(tt,F)=>{this.callColumnMethod("handleLayerUpdated",{layerId:tt,data:F})}};this.mapCore.setupEventHandlers(X)},callColumnMethod(X,tt){this.$wire.callTableColumnMethod(G.state.name,G.state.recordKey,X,tt)}});window.leafletMapColumn=j})}));
|