(self.webpackChunkiot_web_ui=self.webpackChunkiot_web_ui||[]).push([[299],{7299:(io,qe,_)=>{"use strict";_.r(qe),_.d(qe,{OverviewModule:()=>Mt});var zt=_(6814),N=_(2058),mt=_(8433),v=_(5879);let Xe=(()=>{class l{constructor(){this.houseIcon=mt.icon({iconUrl:"../../../../assets/images/icon.png",iconSize:[38,48],shadowSize:[50,64]}),this.fireIcon=mt.icon({iconUrl:"../../../../assets/images/fire.gif",iconSize:[38,48]})}ngOnInit(){}ngAfterViewInit(){this.initMap()}initMap(){if(document.getElementById("map")){this.map=mt.map("map",{center:[10.8494,106.7537],zoom:12}),mt.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:18,minZoom:3,attribution:'© OpenStreetMap'}).addTo(this.map);let c='
Vinhome qu\u1eadn 9
\n Xem chi ti\u1ebft',f='\n S\u1ef1 c\u1ed1 ch\xe1y\n
\n \u0110\u1ecba \u0111i\u1ec3m: 120 Xa L\u1ed9 H\xe0 N\u1ed9i, Th\xe0nh Ph\u1ed1, Th\u1ee7 \u0110\u1ee9c, Th\xe0nh ph\u1ed1 H\u1ed3 Ch\xed Minh
\n\n T\u1ecda \u0111\u1ed9: 10.8661\xb0 N, 106.8029\xb0 E
\n Th\u1eddi gian: 01:54, 16/05/2022
\n\n Xem chi ti\u1ebft';mt.marker([10.8356,106.83],{icon:this.houseIcon}).addTo(this.map).bindPopup(c),mt.marker([10.8661,106.8029],{icon:this.fireIcon}).addTo(this.map).bindPopup(f)}else console.error("Map container not found")}static#t=this.\u0275fac=function(h){return new(h||l)};static#e=this.\u0275cmp=v.Xpm({type:l,selectors:[["app-map"]],decls:3,vars:0,consts:[[1,"map-container"],[1,"map-frame"],["id","map"]],template:function(h,c){1&h&&(v.TgZ(0,"div",0)(1,"div",1),v._UZ(2,"div",2),v.qZA()())},styles:[".map-container[_ngcontent-%COMP%]{position:absolute;inset:0;margin:30px}.map-frame[_ngcontent-%COMP%]{border:2px solid black;height:100%}#map[_ngcontent-%COMP%]{height:100%}p[_ngcontent-%COMP%]{margin:0 0 0 16px!important}.box-custom[_ngcontent-%COMP%]{color:#f33152;padding:3px 2px;background-color:rbg(243,49,82,.1)}"]})}return l})();var I=_(8645),Ve=_(305),Ct=_(5592),W=_(7394),at=_(4552);class Ut extends I.x{constructor(a=1/0,r=1/0,h=at.l){super(),this._bufferSize=a,this._windowTime=r,this._timestampProvider=h,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=r===1/0,this._bufferSize=Math.max(1,a),this._windowTime=Math.max(1,r)}next(a){const{isStopped:r,_buffer:h,_infiniteTimeWindow:c,_timestampProvider:f,_windowTime:m}=this;r||(h.push(a),!c&&h.push(f.now()+m)),this._trimBuffer(),super.next(a)}_subscribe(a){this._throwIfClosed(),this._trimBuffer();const r=this._innerSubscribe(a),{_infiniteTimeWindow:h,_buffer:c}=this,f=c.slice();for(let m=0;mJSON.parse(l.data),serializer:l=>JSON.stringify(l)};class ie extends I.u{constructor(a,r){if(super(),this._socket=null,a instanceof Ct.y)this.destination=r,this.source=a;else{const h=this._config=Object.assign({},St);if(this._output=new I.x,"string"==typeof a)h.url=a;else for(const c in a)a.hasOwnProperty(c)&&(h[c]=a[c]);if(!h.WebSocketCtor&&WebSocket)h.WebSocketCtor=WebSocket;else if(!h.WebSocketCtor)throw new Error("no WebSocket constructor can be found");this.destination=new Ut}}lift(a){const r=new ie(this._config,this.destination);return r.operator=a,r.source=this,r}_resetState(){this._socket=null,this.source||(this.destination=new Ut),this._output=new I.x}multiplex(a,r,h){const c=this;return new Ct.y(f=>{try{c.next(a())}catch(b){f.error(b)}const m=c.subscribe({next:b=>{try{h(b)&&f.next(b)}catch(w){f.error(w)}},error:b=>f.error(b),complete:()=>f.complete()});return()=>{try{c.next(r())}catch(b){f.error(b)}m.unsubscribe()}})}_connectSocket(){const{WebSocketCtor:a,protocol:r,url:h,binaryType:c}=this._config,f=this._output;let m=null;try{m=r?new a(h,r):new a(h),this._socket=m,c&&(this._socket.binaryType=c)}catch(w){return void f.error(w)}const b=new W.w0(()=>{this._socket=null,m&&1===m.readyState&&m.close()});m.onopen=w=>{const{_socket:B}=this;if(!B)return m.close(),void this._resetState();const{openObserver:Y}=this._config;Y&&Y.next(w);const P=this.destination;this.destination=Ve.Lv.create(H=>{if(1===m.readyState)try{const{serializer:V}=this._config;m.send(V(H))}catch(V){this.destination.error(V)}},H=>{const{closingObserver:V}=this._config;V&&V.next(void 0),H&&H.code?m.close(H.code,H.reason):f.error(new TypeError("WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }")),this._resetState()},()=>{const{closingObserver:H}=this._config;H&&H.next(void 0),m.close(),this._resetState()}),P&&P instanceof Ut&&b.add(P.subscribe(this.destination))},m.onerror=w=>{this._resetState(),f.error(w)},m.onclose=w=>{m===this._socket&&this._resetState();const{closeObserver:B}=this._config;B&&B.next(w),w.wasClean?f.complete():f.error(w)},m.onmessage=w=>{try{const{deserializer:B}=this._config;f.next(B(w))}catch(B){f.error(B)}}}_subscribe(a){const{source:r}=this;return r?r.subscribe(a):(this._socket||this._connectSocket(),this._output.subscribe(a),a.add(()=>{const{_socket:h}=this;0===this._output.observers.length&&(h&&(1===h.readyState||0===h.readyState)&&h.close(),this._resetState())}),a)}unsubscribe(){const{_socket:a}=this;a&&(1===a.readyState||0===a.readyState)&&a.close(),this._resetState(),super.unsubscribe()}}var Ge=_(5619);let we=(()=>{class l{constructor(){this.gateway="wss:/socket.aztrace.vn/ws",this.isConnected=!1,this.messagesSubject$=new I.x,this.messages$=this.messagesSubject$.asObservable(),this.statusSubject=new Ge.X(this.isConnected),this.status$=this.statusSubject.asObservable()}connect(r={reconnect:!1}){(!this.websocket$||this.websocket$.closed)&&(console.log("Trying to open a WebSocket connection\u2026"),this.websocket$=this.getNewWebSocket(),this.websocket$.subscribe(h=>{this.messagesSubject$.next(h)}))}close(){this.websocket$.complete()}sendMessage(r){this.websocket$.next(r)}getNewWebSocket(){return function Ai(l){return new ie(l)}({url:this.gateway,openObserver:{next:()=>{console.log("Connection ok"),this.isConnected=!0,this.statusSubject.next(this.isConnected)}},closeObserver:{next:()=>{console.log("Connection closed"),this.isConnected=!1,this.connect({reconnect:!0}),this.statusSubject.next(this.isConnected)}}})}static#t=this.\u0275fac=function(h){return new(h||l)};static#e=this.\u0275prov=v.Yz7({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();var ne=_(2296),Nt=_(3814);const Je=[{path:"",component:Xe},{path:"overall-ground",component:(()=>{class l{constructor(r){this.socketService$=r,this.isConnected=!1,this.state5="",this.state6=""}ngOnInit(){this.socketService$.connect(),this.statusSubscription=this.socketService$.status$.subscribe(r=>{this.isConnected=r,this.isConnected&&(this.intervalId=setInterval(()=>this.getReadings(),2e3),this.messageSubscription=this.socketService$.messages$.subscribe(h=>{this.onMessage(h)}))})}ngOnDestroy(){this.statusSubscription&&this.statusSubscription.unsubscribe(),this.messageSubscription&&this.messageSubscription.unsubscribe(),this.intervalId&&clearInterval(this.intervalId),this.socketService$.close()}getReadings(){this.socketService$.sendMessage({id:"0",type:"get"})}toggleState1(){let h={id:"0",type:"cmd",state1:("ON"!==this.state5).toString()};this.socketService$.sendMessage(h)}toggleState2(){let h={id:"0",type:"cmd",state2:("ON"!==this.state6).toString()};this.socketService$.sendMessage(h)}onMessage(r){"0"==r.id&&"get"===r.type&&(this.state5="1"===r.state5?"ON":"OFF",this.state6="1"===r.state6?"ON":"OFF")}static#t=this.\u0275fac=function(h){return new(h||l)(v.Y36(we))};static#e=this.\u0275cmp=v.Xpm({type:l,selectors:[["app-overall-ground"]],decls:9,vars:9,consts:[["fxLayout","row","fxLayoutAlign","space-around center","fxLayoutGap","20px",1,"p-3"],["src","assets/images/ground.png","fxFlex","70",1,"map-image"],["fxLayout","column","fxLayoutGap","50px"],["mat-flat-button","","type","button",1,"red-bg",3,"disabled"],["mat-flat-button","",3,"disabled","color","click"]],template:function(h,c){1&h&&(v.TgZ(0,"div",0),v._UZ(1,"img",1),v.TgZ(2,"div",2)(3,"button",3),v._uU(4,"ARM SYSTEM"),v.qZA(),v.TgZ(5,"button",4),v.NdJ("click",function(){return c.toggleState1()}),v._uU(6),v.qZA(),v.TgZ(7,"button",4),v.NdJ("click",function(){return c.toggleState2()}),v._uU(8),v.qZA()()()),2&h&&(v.xp6(3),v.Q6J("disabled",!c.isConnected),v.xp6(2),v.s9C("color","ON"===c.state5?"primary":"warn"),v.Q6J("disabled",!c.isConnected),v.xp6(1),v.hij("LIGHT ",""==c.state5?"OFF":c.state5,""),v.xp6(1),v.ekj("on","ON"===c.state6),v.s9C("color","ON"===c.state6?"primary":"warn"),v.Q6J("disabled",!c.isConnected),v.xp6(1),v.hij("BELL ",""==c.state6?"OFF":c.state6,""))},dependencies:[ne.lW,Nt.xw,Nt.SQ,Nt.Wh,Nt.yH],styles:["button[_ngcontent-%COMP%]{padding:50px 30px!important}.red-bg[_ngcontent-%COMP%]{background-color:red!important;color:#fff!important}.green-bg[_ngcontent-%COMP%]{background-color:green!important;color:#fff!important}h1[_ngcontent-%COMP%]{font-size:1.8rem;color:#fff}.topnav[_ngcontent-%COMP%]{overflow:hidden;background-color:#0a1128}body[_ngcontent-%COMP%]{margin:0}p[_ngcontent-%COMP%]{text-align:center}.content[_ngcontent-%COMP%]{padding:50px}.card-grid[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;display:grid;grid-gap:2rem;grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}.card[_ngcontent-%COMP%]{background-color:#fff;box-shadow:2px 2px 12px 1px #8c8c8c80}.card-title[_ngcontent-%COMP%]{font-size:1.2rem;font-weight:700;color:#034078}.reading[_ngcontent-%COMP%]{font-size:1.2rem;color:#1282a2}.button[_ngcontent-%COMP%]{padding:15px 50px;font-size:24px;text-align:center;outline:none;color:#fff;background-color:#0f8b8d;border:none;border-radius:5px;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.button[_ngcontent-%COMP%]:active{background-color:#0f8b8d;box-shadow:2px 2px #cdcdcd;transform:translateY(2px)}.state[_ngcontent-%COMP%]{font-size:1.5rem;color:#8c8c8c;font-weight:700;text-align:center}.content[_ngcontent-%COMP%]{padding:30px;max-width:600px;margin:0 auto}.card[_ngcontent-%COMP%]{background-color:#f8f7f9;box-shadow:2px 2px 12px 1px #8c8c8c80;padding-top:10px;padding-bottom:20px}.map-image[_ngcontent-%COMP%]{object-fit:scale-down;height:100%;width:100%}"]})}return l})()}];var xe=_(8943),be=_(3680);_(2096),_(8504),_(7453),_(4829),_(4564),_(8251),_(7400),_(2714),_(9397),_(7398),_(6306),_(4716),_(3020),_(6328),_(2181),_(6593);let Fe=(()=>{class l{static#t=this.\u0275fac=function(h){return new(h||l)};static#e=this.\u0275mod=v.oAB({type:l});static#i=this.\u0275inj=v.cJS({imports:[be.BQ,be.BQ]})}return l})(),Mt=(()=>{class l{static#t=this.\u0275fac=function(h){return new(h||l)};static#e=this.\u0275mod=v.oAB({type:l});static#i=this.\u0275inj=v.cJS({imports:[zt.ez,N.Bz.forChild(Je),xe.m,Fe]})}return l})()},8433:function(io,qe){!function(_){"use strict";function N(t){var e,i,n,o;for(i=1,n=arguments.length;i"u")&&L&&L.Mixin){t=nt(t)?t:[t];for(var e=0;e0?Math.floor(t):Math.ceil(t)};function C(t,e,i){return t instanceof S?t:nt(t)?new S(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new S(t.x,t.y):new S(t,e,i)}function A(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=$(t);var e=this.min,i=this.max,n=t.min,o=t.max;return o.x>=e.x&&n.x<=i.x&&o.y>=e.y&&n.y<=i.y},overlaps:function(t){t=$(t);var e=this.min,i=this.max,n=t.min,o=t.max;return o.x>e.x&&n.xe.y&&n.y=e.lat&&o.lat<=i.lat&&n.lng>=e.lng&&o.lng<=i.lng},intersects:function(t){t=j(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast();return o.lat>=e.lat&&n.lat<=i.lat&&o.lng>=e.lng&&n.lng<=i.lng},overlaps:function(t){t=j(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast();return o.lat>e.lat&&n.late.lng&&n.lng1,oi=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",W,e),window.removeEventListener("testPassiveEventSupport",W,e)}catch{}return t}(),_n=!!document.createElement("canvas").getContext,si=!(!document.createElementNS||!Le("svg").createSVGRect),mn=!!si&&function(){var t=document.createElement("div");return t.innerHTML="","http://www.w3.org/2000/svg"===(t.firstChild&&t.firstChild.namespaceURI)}(),gn=!si&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch{return!1}}();function ct(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var x={ie:Ce,ielt9:Zi,edge:Ye,webkit:oe,android:Se,android23:Ee,androidStock:Vt,opera:Gt,chrome:Qe,gecko:Me,safari:Jt,phantom:Di,opera12:se,win:Ie,ie3d:Hi,webkit3d:ke,gecko3d:Wi,any3d:ti,mobile:re,mobileWebkit:ei,mobileWebkit3d:pn,msPointer:ii,pointer:ni,touch:ji,touchNative:Ui,mobileOpera:ae,mobileGecko:qi,retina:Xi,passiveEvents:oi,canvas:_n,svg:si,vml:gn,inlineSvg:mn,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},Oe=x.msPointer?"MSPointerDown":"pointerdown",ri=x.msPointer?"MSPointerMove":"pointermove",Vi=x.msPointer?"MSPointerUp":"pointerup",Gi=x.msPointer?"MSPointerCancel":"pointercancel",ai={touchstart:Oe,touchmove:ri,touchend:Vi,touchcancel:Gi},Ae={touchstart:function Tt(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&r(e),Re(t,e)},touchmove:Re,touchend:Re,touchcancel:Re},Pt={},hi=!1;function Ji(t,e,i){return"touchstart"===e&&function Ki(){hi||(document.addEventListener(Oe,ui,!0),document.addEventListener(ri,li,!0),document.addEventListener(Vi,ci,!0),document.addEventListener(Gi,ci,!0),hi=!0)}(),Ae[e]?(i=Ae[e].bind(this,i),t.addEventListener(ai[e],i,!1),i):(console.warn("wrong event specified:",e),W)}function ui(t){Pt[t.pointerId]=t}function li(t){Pt[t.pointerId]&&(Pt[t.pointerId]=t)}function ci(t){delete Pt[t.pointerId]}function Re(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],Pt)e.touches.push(Pt[i]);e.changedTouches=[e],t(e)}}var wn=200;var Bt,Kt,ce,de,_i,fi=Ze(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),he=Ze(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Yi="webkitTransition"===he||"OTransition"===he?he+"End":"transitionend";function Qi(t){return"string"==typeof t?document.getElementById(t):t}function ue(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function R(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function D(t){var e=t.parentNode;e&&e.removeChild(t)}function ze(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function $t(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function vt(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function Ne(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=le(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function M(t,e){if(void 0!==t.classList)for(var i=St(e),n=0,o=i.length;n0?2*window.devicePixelRatio:1;function b(t){return x.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/m:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function w(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch{return!1}return i!==t}var B={__proto__:null,on:E,off:Z,stopPropagation:Mt,disableScrollPropagation:l,disableClickPropagation:a,preventDefault:r,stop:h,getPropagationPath:c,getMousePosition:f,getWheelDelta:b,isExternalTarget:w,addListener:E,removeListener:Z},Y=jt.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=rt(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=X(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,j(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=C((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=C(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),s=this.project(t),u=this.getPixelBounds(),d=$([u.min.add(i),u.max.subtract(n)]),p=d.getSize();if(!d.contains(s)){this._enforcingBounds=!0;var g=s.subtract(d.getCenter()),y=d.extend(s).getSize().subtract(p);o.x+=g.x<0?-y.x:y.x,o.y+=g.y<0?-y.y:y.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=N({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),o=i.divideBy(2).round(),s=n.subtract(o);return s.x||s.y?(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(v(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=N({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=v(this._handleGeolocationResponse,this),i=v(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var n=new z(t.coords.latitude,t.coords.longitude),o=n.toBounds(2*t.coords.accuracy),s=this._locateOptions;if(s.setView){var u=this.getBoundsZoom(o);this.setView(n,s.maxZoom?Math.min(u,s.maxZoom):u)}var d={latlng:n,bounds:o,timestamp:t.timestamp};for(var p in t.coords)"number"==typeof t.coords[p]&&(d[p]=t.coords[p]);this.fire("locationfound",d)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),D(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(et(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)D(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var n=R("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new K(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=j(t),i=C(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),u=t.getNorthWest(),d=t.getSouthEast(),p=this.getSize().subtract(i),g=$(this.project(d,n),this.project(u,n)).getSize(),y=x.any3d?this.options.zoomSnap:1,T=p.x/g.x,k=p.y/g.y,tt=e?Math.max(T,k):Math.min(T,k);return n=this.getScaleZoom(tt,n),y&&(n=Math.round(n/(y/100))*(y/100),n=e?Math.ceil(n/y)*y:Math.floor(n/y)*y),Math.max(o,Math.min(s,n))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new S(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new A(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,n=i.zoom(t*i.scale(e=void 0===e?this._zoom:e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(O(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(C(t),e)},layerPointToLatLng:function(t){var e=C(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(O(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(O(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(j(t))},distance:function(t,e){return this.options.crs.distance(O(t),O(e))},containerPointToLayerPoint:function(t){return C(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return C(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(C(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(O(t)))},mouseEventToContainerPoint:function(t){return f(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=Qi(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");E(e,"scroll",this._onScroll,this),this._containerId=I(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&x.any3d,M(t,"leaflet-container"+(x.touch?" leaflet-touch":"")+(x.retina?" leaflet-retina":"")+(x.ielt9?" leaflet-oldie":"")+(x.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=ue(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),q(this._mapPane,new S(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(M(t.markerPane,"leaflet-zoom-hide"),M(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){q(this._mapPane,new S(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return et(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){q(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[I(this._container)]=this;var e=t?Z:E;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),x.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){et(this._resizeRequest),this._resizeRequest=X(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n,i=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,u=!1;s;){if((n=this._targets[I(s)])&&("click"===e||"preclick"===e)&&this._draggableMoved(n)){u=!0;break}if(n&&n.listens(e,!0)&&(o&&!w(s,t)||(i.push(n),o))||s===this._container)break;s=s.parentNode}return!i.length&&!u&&!o&&this.listens(e,!0)&&(i=[this]),i},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var i=t.type;"mousedown"===i&&Ft(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var n=N({},t);n.type="preclick",this._fireDOMEvent(n,n.type,i)}var o=this._findEventTargets(t,e);if(i){for(var s=[],u=0;u0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=x.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){U(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=R("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(e){var i=fi,n=this._proxy.style[i];dt(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){D(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();dt(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(X(function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)},this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,M(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(v(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&U(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))}});var V=gt.extend({options:{position:"topright"},initialize:function(t){F(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return M(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(D(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),It=function(t){return new V(t)};P.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=R("div",e+"control-container",this._container);function n(o,s){t[o+s]=R("div",e+o+" "+e+s,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)D(this._controlCorners[t]);D(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var wt=V.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i1)?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(I(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var n,e=document.createElement("label"),i=this._map.hasLayer(t.layer);t.overlay?((n=document.createElement("input")).type="checkbox",n.className="leaflet-control-layers-selector",n.defaultChecked=i):n=this._createRadioElement("leaflet-base-layers_"+I(this),i),this._layerControlInputs.push(n),n.layerId=I(t.layer),E(n,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("span");return e.appendChild(s),s.appendChild(n),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){if(!this._preventClick){var e,i,t=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=t.length-1;s>=0;s--)i=this._getLayer((e=t[s]).layerId).layer,e.checked?n.push(i):e.checked||o.push(i);for(s=0;s=0;o--)i=this._getLayer((e=t[o]).layerId).layer,e.disabled=void 0!==i.options.minZoom&&ni.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,E(t,"click",r),this.expand();var e=this;setTimeout(function(){Z(t,"click",r),e._preventClick=!1})}}),te=V.extend({options:{position:"topleft",zoomInText:'+',zoomInTitle:"Zoom in",zoomOutText:'−',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=R("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var s=R("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),a(s),E(s,"click",h),E(s,"click",o,this),E(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";U(this._zoomInButton,e),U(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(M(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(M(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});P.mergeOptions({zoomControl:!0}),P.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new te,this.addControl(this.zoomControl))});var wi=V.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=R("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=R("div",e,i)),t.imperial&&(this._iScale=R("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var i,n,o,e=3.2808399*t;e>5280?(n=this._getRoundNum(i=e/5280),this._updateScale(this._iScale,n+" mi",n/i)):(o=this._getRoundNum(e),this._updateScale(this._iScale,o+" ft",o/e))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),fe=V.extend({options:{position:"bottomright",prefix:''+(x.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){F(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=R("div","leaflet-control-attribution"),a(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' | ')}}});P.mergeOptions({attributionControl:!0}),P.addInitHook(function(){this.options.attributionControl&&(new fe).addTo(this)});V.Layers=wt,V.Zoom=te,V.Scale=wi,V.Attribution=fe,It.layers=function(t,e,i){return new wt(t,e,i)},It.zoom=function(t){return new te(t)},It.scale=function(t){return new wi(t)},It.attribution=function(t){return new fe(t)};var xt=gt.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});xt.addTo=function(t,e){return t.addHandler(e,this),this};var no={Events:Q},Tn=x.touch?"touchstart mousedown":"mousedown",Ht=jt.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){F(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(E(this._dragStartTarget,Tn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ht._dragging===this&&this.finishDrag(!0),Z(this._dragStartTarget,Tn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!Ne(this._element,"leaflet-zoom-anim"))){if(t.touches&&1!==t.touches.length)return void(Ht._dragging===this&&this.finishDrag());if(!(Ht._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(Ht._dragging=this,this._preventOutline&&Ft(this._element),yt(),Bt(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,i=mi(this._element);this._startPoint=new S(e.clientX,e.clientY),this._startPos=rt(this._element),this._parentScale=gi(i);var n="mousedown"===t.type;E(document,n?"mousemove":"touchmove",this._onMove,this),E(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1)return void(this._moved=!0);var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new S(e.clientX,e.clientY)._subtract(this._startPoint);!i.x&&!i.y||Math.abs(i.x)+Math.abs(i.y)e&&(i.push(t[n]),o=n);return os&&(u=d,s=p);s>i&&(e[u]=1,rn(t,e,i,n,u),rn(t,e,i,u,o))}function In(t,e,i,n,o){var d,p,g,s=n?Mn:ee(t,i),u=ee(e,i);for(Mn=u;;){if(!(s|u))return[t,e];if(s&u)return!1;g=ee(p=xi(t,e,d=s||u,i,o),i),d===s?(t=p,s=g):(e=p,u=g)}}function xi(t,e,i,n,o){var g,y,s=e.x-t.x,u=e.y-t.y,d=n.min,p=n.max;return 8&i?(g=t.x+s*(p.y-t.y)/u,y=p.y):4&i?(g=t.x+s*(d.y-t.y)/u,y=d.y):2&i?(g=p.x,y=t.y+u*(p.x-t.x)/s):1&i&&(g=d.x,y=t.y+u*(d.x-t.x)/s),new S(g,y,o)}function ee(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i}function ho(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function De(t,e,i,n){var g,o=e.x,s=e.y,u=i.x-o,d=i.y-s,p=u*u+d*d;return p>0&&((g=((t.x-o)*u+(t.y-s)*d)/p)>1?(o=i.x,s=i.y):g>0&&(o+=u*g,s+=d*g)),u=t.x-o,d=t.y-s,n?u*u+d*d:new S(o,s)}function pt(t){return!nt(t[0])||"object"!=typeof t[0][0]&&typeof t[0][0]<"u"}function kn(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),pt(t)}function On(t,e){var i,n,o,s,u,d,p,g;if(!t||0===t.length)throw new Error("latlngs not passed");pt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var y=O([0,0]),T=j(t);T.getNorthWest().distanceTo(T.getSouthWest())*T.getNorthEast().distanceTo(T.getNorthWest())<1700&&(y=sn(t));var tt=t.length,J=[];for(i=0;in){g=[d.x-(p=(s-n)/o)*(d.x-u.x),d.y-p*(d.y-u.y)];break}var it=e.unproject(C(g));return O([it.lat+y.lat,it.lng+y.lng])}var uo={__proto__:null,simplify:Sn,pointToSegmentDistance:En,closestPointOnSegment:function so(t,e,i){return De(t,e,i)},clipSegment:In,_getEdgeIntersection:xi,_getBitCode:ee,_sqClosestPointOnSegment:De,isFlat:pt,_flat:kn,polylineCenter:On},an={project:function(t){return new S(t.lng,t.lat)},unproject:function(t){return new z(t.y,t.x)},bounds:new A([-180,-90],[180,90])},hn={R:6378137,R_MINOR:6356752.314245179,bounds:new A([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,s=Math.sqrt(1-o*o),u=s*Math.sin(n),d=Math.tan(Math.PI/4-n/2)/Math.pow((1-u)/(1+u),s/2);return n=-i*Math.log(Math.max(d,1e-10)),new S(t.lng*e*i,n)},unproject:function(t){for(var g,e=180/Math.PI,i=this.R,n=this.R_MINOR/i,o=Math.sqrt(1-n*n),s=Math.exp(-t.y/i),u=Math.PI/2-2*Math.atan(s),d=0,p=.1;d<15&&Math.abs(p)>1e-7;d++)g=o*Math.sin(u),g=Math.pow((1-g)/(1+g),o/2),u+=p=Math.PI/2-2*Math.atan(s*g)-u;return new z(u*e,t.x*e/i)}},lo={__proto__:null,LonLat:an,Mercator:hn,SphericalMercator:Ke},co=N({},ht,{code:"EPSG:3395",projection:hn,transformation:function(){var t=.5/(Math.PI*hn.R);return qt(t,.5,-t,.5)}()}),An=N({},ht,{code:"EPSG:4326",projection:an,transformation:qt(1/180,1,-1/180,.5)}),fo=N({},ot,{projection:an,transformation:qt(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});ot.Earth=ht,ot.EPSG3395=co,ot.EPSG3857=Te,ot.EPSG900913=Bi,ot.EPSG4326=An,ot.Simple=fo;var bt=jt.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[I(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[I(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",function(){e.off(i,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});P.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=I(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=I(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return I(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?nt(t)?t:[t]:[]).length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof z&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){Ot.prototype._setLatLngs.call(this,t),pt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return pt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new S(e,e);if(t=new A(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t)){if(this.options.noClip)return void(this._parts=this._rings);for(var s,n=0,o=this._rings.length;nt.y!=(o=i[d]).y>t.y&&t.x<(o.x-n.x)*(t.y-n.y)/(o.y-n.y)+n.x&&(e=!e);return e||Ot.prototype._containsPoint.call(this,t,!0)}});var At=kt.extend({initialize:function(t,e){F(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var i,n,o,e=nt(t)?t:t.features;if(e){for(i=0,n=e.length;i0&&o.push(o[0].slice()),o}function ge(t,e){return t.feature?N({},t.feature,{geometry:e}):Si(e)}function Si(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var dn={toGeoJSON:function(t){return ge(this,{type:"Point",coordinates:cn(this.getLatLng(),t)})}};function Nn(t,e){return new At(t,e)}bi.include(dn),un.include(dn),Pi.include(dn),Ot.include({toGeoJSON:function(t){var e=!pt(this._latlngs);return ge(this,{type:(e?"Multi":"")+"LineString",coordinates:Ci(this._latlngs,e?1:0,!1,t)})}}),me.include({toGeoJSON:function(t){var e=!pt(this._latlngs),i=e&&!pt(this._latlngs[0]),n=Ci(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),ge(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),pe.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(i){e.push(i.toGeoJSON(t).geometry.coordinates)}),ge(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer(function(o){if(o.toGeoJSON){var s=o.toGeoJSON(t);if(i)n.push(s.geometry);else{var u=Si(s);"FeatureCollection"===u.type?n.push.apply(n,u.features):n.push(u)}}}),i?ge(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var bo=Nn,Ei=bt.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=j(e),F(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(M(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){D(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&$t(this._image),this},bringToBack:function(){return this._map&&vt(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=j(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:R("img");M(e,"leaflet-image-layer"),this._zoomAnimated&&M(e,"leaflet-zoom-animated"),this.options.className&&M(e,this.options.className),e.onselectstart=W,e.onmousemove=W,e.onload=v(this.fire,this,"load"),e.onerror=v(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;dt(this._image,i,e)},_reset:function(){var t=this._image,e=new A(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();q(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){st(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&null!=this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Bn=Ei.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:R("video");if(M(e,"leaflet-image-layer"),this._zoomAnimated&&M(e,"leaflet-zoom-animated"),this.options.className&&M(e,this.options.className),e.onselectstart=W,e.onmousemove=W,e.onloadeddata=v(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o0?n:[e.src]}else{nt(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;s×',E(n,"click",function(o){r(o),this.close()},this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var o=this.options.maxHeight,s="leaflet-popup-scrolled";o&&t.offsetHeight>o?(e.height=o+"px",M(t,s)):U(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();q(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)return void(this._autopanning=!1);var t=this._map,e=parseInt(ue(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new S(this._containerLeft,-i-this._containerBottom);o._add(rt(this._container));var s=t.layerPointToContainerPoint(o),u=C(this.options.autoPanPadding),d=C(this.options.autoPanPaddingTopLeft||u),p=C(this.options.autoPanPaddingBottomRight||u),g=t.getSize(),y=0,T=0;s.x+n+p.x>g.x&&(y=s.x+n-g.x+p.x),s.x-y-d.x<0&&(y=s.x-d.x),s.y+i+p.y>g.y&&(T=s.y+i-g.y+p.y),s.y-T-d.y<0&&(T=s.y-d.y),(y||T)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([y,T]))}},_getAnchor:function(){return C(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});P.mergeOptions({closePopupOnClick:!0}),P.include({openPopup:function(t,e,i){return this._initOverlay(Mi,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),bt.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Mi,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof kt||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){h(t);var e=t.layer||t.target;if(this._popup._source===e&&!(e instanceof Wt))return void(this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng));this._popup._source=e,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Ii=Lt.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Lt.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Lt.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Lt.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){this._contentNode=this._container=R("div","leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide")),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+I(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,o=this._container,s=n.latLngToContainerPoint(n.getCenter()),u=n.layerPointToContainerPoint(t),d=this.options.direction,p=o.offsetWidth,g=o.offsetHeight,y=C(this.options.offset),T=this._getAnchor();"top"===d?(e=p/2,i=g):"bottom"===d?(e=p/2,i=0):"center"===d?(e=p/2,i=g/2):"right"===d?(e=0,i=g/2):"left"===d?(e=p,i=g/2):u.xthis.options.maxZoom||in&&this._retainParent(o,s,u,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var u=new S(o,s);u.z=i+1;var d=this._tileCoordsToKey(u),p=this._tiles[d];p&&p.active?p.retain=!0:(p&&p.loaded&&(p.retain=!0),i+1this.options.maxZoom||void 0!==this.options.minZoom&&o1)return void this._setView(t,i);for(var T=o.min.y;T<=o.max.y;T++)for(var k=o.min.x;k<=o.max.x;k++){var tt=new S(k,T);if(tt.z=this._tileZoom,this._isValidTile(tt)){var J=this._tiles[this._tileCoordsToKey(tt)];J?J.current=!0:u.push(tt)}}if(u.sort(function(it,ye){return it.distanceTo(s)-ye.distanceTo(s)}),0!==u.length){this._loading||(this._loading=!0,this.fire("loading"));var _t=document.createDocumentFragment();for(k=0;ki.max.x)||!e.wrapLat&&(t.yi.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return j(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new K(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new S(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(D(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){M(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=W,t.onmousemove=W,x.ielt9&&this.options.opacity<1&&st(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),v(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&X(v(this._tileReady,this,t,null,o)),q(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(st(i.el,0),et(this._fadeFrame),this._fadeFrame=X(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(M(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),x.ielt9||!this._map._fadeAnimated?X(this._pruneTiles,this):setTimeout(v(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new S(this._wrapX?Ct(t.x,this._wrapX):t.x,this._wrapY?Ct(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new A(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var ve=We.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=F(this,e)).detectRetina&&x.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return E(i,"load",v(this._tileOnLoad,this,e,i)),E(i,"error",v(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:x.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return Ge(this._url,N(e,this.options))},_tileOnLoad:function(t,e){x.ielt9?setTimeout(v(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom;return this.options.zoomReverse&&(t=this.options.maxZoom-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=W,e.onerror=W,!e.complete)){e.src=ne;var i=this._tiles[t].coords;D(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",ne),We.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==ne))return We.prototype._tileReady.call(this,t,e,i)}});function Dn(t,e){return new ve(t,e)}var Hn=ve.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=N({},this.defaultWmsParams);for(var n in e)n in this.options||(i[n]=e[n]);var o=(e=F(this,e)).detectRetina&&x.retina?2:1,s=this.getTileSize();i.width=s.x*o,i.height=s.y*o,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version),this.wmsParams[this._wmsVersion>=1.3?"crs":"srs"]=this._crs.code,ve.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=$(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,u=(this._wmsVersion>=1.3&&this._crs===An?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),d=ve.prototype.getTileUrl.call(this,t);return d+ie(this.wmsParams,d,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+u},setParams:function(t,e){return N(this.wmsParams,t),e||this.redraw(),this}});ve.WMS=Hn,Dn.wms=function Io(t,e){return new Hn(t,e)};var Rt=bt.extend({options:{padding:.1},initialize:function(t){F(this,t),I(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),M(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),s=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));x.any3d?dt(this._container,s,i):q(this._container,s)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new A(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Wn=Rt.extend({options:{tolerance:0},getEvents:function(){var t=Rt.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Rt.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");E(t,"mousemove",this._onMouseMove,this),E(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),E(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){et(this._redrawRequest),delete this._ctx,D(this._container),Z(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var e in this._redrawBounds=null,this._layers)this._layers[e]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Rt.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=x.retina?2:1;q(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",x.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Rt.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[I(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[I(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var n,o,e=t.options.dashArray.split(/[, ]+/),i=[];for(o=0;o')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),ko={_initContainer:function(){this._container=R("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Rt.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Ue("shape");M(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Ue("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[I(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;D(e),t.removeInteractiveTarget(e),delete this._layers[I(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=Ue("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,e.dashStyle=n.dashArray?nt(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):"",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=Ue("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){$t(t._container)},_bringToBack:function(t){vt(t._container)}},ki=x.vml?Ue:Le,je=Rt.extend({_initContainer:function(){this._container=ki("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=ki("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){D(this._container),Z(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){Rt.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;(!this._svgSize||!this._svgSize.equals(e))&&(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),q(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=ki("path");t.options.className&&M(e,t.options.className),t.options.interactive&&M(e,"leaflet-interactive"),this._updateStyle(t),this._layers[I(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){D(t._path),t.removeInteractiveTarget(t._path),delete this._layers[I(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,Xt(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),o="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",s=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+2*i+",0 "+o+2*-i+",0 ";this._setPath(t,s)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){$t(t._path)},_bringToBack:function(t){vt(t._path)}});function jn(t){return x.svg||x.vml?new je(t):null}x.vml&&je.include(ko),P.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Un(t)||jn(t)}});var qn=me.extend({initialize:function(t,e){me.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=j(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});je.create=ki,je.pointsToPath=Xt,At.geometryToLayer=Ti,At.coordsToLatLng=ln,At.coordsToLatLngs=Li,At.latLngToCoords=cn,At.latLngsToCoords=Ci,At.getFeature=ge,At.asFeature=Si,P.mergeOptions({boxZoom:!0});var Xn=xt.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){E(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Z(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){D(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),Bt(),yt(),this._startPoint=this._map.mouseEventToContainerPoint(t),E(document,{contextmenu:h,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=R("div","leaflet-zoom-box",this._container),M(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new A(this._point,this._startPoint),i=e.getSize();q(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(D(this._box),U(this._container,"leaflet-crosshair")),Kt(),Yt(),Z(document,{contextmenu:h,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(v(this._resetState,this),0);var e=new K(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});P.addInitHook("addHandler","boxZoom",Xn),P.mergeOptions({doubleClickZoom:!0});var Vn=xt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});P.addInitHook("addHandler","doubleClickZoom",Vn),P.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Gn=xt.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Ht(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}M(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){U(this._map._container,"leaflet-grab"),U(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=j(this._map.options.maxBounds);this._offsetLimit=$(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,u=Math.abs(o+i)0?s:-s))-e;this._delta=0,this._startTime=null,u&&("center"===t.options.scrollWheelZoom?t.setZoom(e+u):t.setZoomAround(this._lastMousePos,e+u))}});P.addInitHook("addHandler","scrollWheelZoom",$n);P.mergeOptions({tapHold:x.touchNative&&x.safari&&x.mobile,tapTolerance:15});var Kn=xt.extend({addHooks:function(){E(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Z(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new S(e.clientX,e.clientY),this._holdTimeout=setTimeout(v(function(){this._cancel(),this._isTapValid()&&(E(document,"touchend",r),E(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),600),E(document,"touchend touchcancel contextmenu",this._cancel,this),E(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){Z(document,"touchend",r),Z(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),Z(document,"touchend touchcancel contextmenu",this._cancel,this),Z(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new S(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});P.addInitHook("addHandler","tapHold",Kn),P.mergeOptions({touchZoom:x.touch,bounceAtZoomLimits:!0});var Yn=xt.extend({addHooks:function(){M(this._map._container,"leaflet-touch-zoom"),E(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){U(this._map._container,"leaflet-touch-zoom"),Z(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),E(document,"touchmove",this._onTouchMove,this),E(document,"touchend touchcancel",this._onTouchEnd,this),r(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var s=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===s.x&&0===s.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),et(this._animRequest);var u=v(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=X(u,this,!0),r(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,et(this._animRequest),Z(document,"touchmove",this._onTouchMove,this),Z(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});P.addInitHook("addHandler","touchZoom",Yn),P.BoxZoom=Xn,P.DoubleClickZoom=Vn,P.Drag=Gn,P.Keyboard=Jn,P.ScrollWheelZoom=$n,P.TapHold=Kn,P.TouchZoom=Yn,_.Bounds=A,_.Browser=x,_.CRS=ot,_.Canvas=Wn,_.Circle=un,_.CircleMarker=Pi,_.Class=gt,_.Control=V,_.DivIcon=Fn,_.DivOverlay=Lt,_.DomEvent=B,_.DomUtil=bn,_.Draggable=Ht,_.Evented=jt,_.FeatureGroup=kt,_.GeoJSON=At,_.GridLayer=We,_.Handler=xt,_.Icon=_e,_.ImageOverlay=Ei,_.LatLng=z,_.LatLngBounds=K,_.Layer=bt,_.LayerGroup=pe,_.LineUtil=uo,_.Map=P,_.Marker=bi,_.Mixin=no,_.Path=Wt,_.Point=S,_.PolyUtil=oo,_.Polygon=me,_.Polyline=Ot,_.Popup=Mi,_.PosAnimation=Y,_.Projection=lo,_.Rectangle=qn,_.Renderer=Rt,_.SVG=je,_.SVGOverlay=Zn,_.TileLayer=ve,_.Tooltip=Ii,_.Transformation=Pe,_.Util=zi,_.VideoOverlay=Bn,_.bind=v,_.bounds=$,_.canvas=Un,_.circle=function yo(t,e,i){return new un(t,e,i)},_.circleMarker=function vo(t,e){return new Pi(t,e)},_.control=It,_.divIcon=function Eo(t){return new Fn(t)},_.extend=N,_.featureGroup=function(t,e){return new kt(t,e)},_.geoJSON=Nn,_.geoJson=bo,_.gridLayer=function Mo(t){return new We(t)},_.icon=function mo(t){return new _e(t)},_.imageOverlay=function(t,e,i){return new Ei(t,e,i)},_.latLng=O,_.latLngBounds=j,_.layerGroup=function(t,e){return new pe(t,e)},_.map=function H(t,e){return new P(t,e)},_.marker=function go(t,e){return new bi(t,e)},_.point=C,_.polygon=function xo(t,e){return new me(t,e)},_.polyline=function wo(t,e){return new Ot(t,e)},_.popup=function(t,e){return new Mi(t,e)},_.rectangle=function Oo(t,e){return new qn(t,e)},_.setOptions=F,_.stamp=I,_.svg=jn,_.svgOverlay=function Lo(t,e,i){return new Zn(t,e,i)},_.tileLayer=Dn,_.tooltip=function(t,e){return new Ii(t,e)},_.transformation=qt,_.version="1.9.4",_.videoOverlay=function To(t,e,i){return new Bn(t,e,i)};var Ro=window.L;_.noConflict=function(){return window.L=Ro,this},window.L=_}(qe)}}]);