From 4eb1466884369f6369927973c989bf32b65f75c4 Mon Sep 17 00:00:00 2001 From: keksobot Date: Fri, 22 Mar 2024 16:36:36 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=94=EF=B8=8F=20=D0=A1=D0=B1=D0=BE=D1=80?= =?UTF-8?q?=D0=BA=D0=B0=20#6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 6/assets/{index-3786ccc4.js => index-2ff87097.js} | 2 +- 6/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename 6/assets/{index-3786ccc4.js => index-2ff87097.js} (92%) diff --git a/6/assets/index-3786ccc4.js b/6/assets/index-2ff87097.js similarity index 92% rename from 6/assets/index-3786ccc4.js rename to 6/assets/index-2ff87097.js index d768e27..736daba 100644 --- a/6/assets/index-3786ccc4.js +++ b/6/assets/index-2ff87097.js @@ -68,4 +68,4 @@ Error generating stack: `+l.message+` ${e}__bookmark-button button`,t&&`${e}__bookmark-button--active`),type:"button",children:[_.jsx("svg",{className:`${e}__bookmark-icon`,...i[e],children:_.jsx("use",{xlinkHref:"#icon-bookmark"})}),_.jsx("span",{className:"visually-hidden",children:t?"In bookmarks":"To bookmarks"})]})}const $y=e=>e*100/5,Wy=e=>e.charAt(0).toUpperCase()+e.slice(1);function ic({componentType:e,rating:t}){return _.jsx("div",{className:`${e}__rating rating`,children:_.jsxs("div",{className:`${e}__stars rating__stars`,children:[_.jsx("span",{style:{width:`${$y(t)}%`}}),_.jsx("span",{className:"visually-hidden",children:"Rating"})]})})}function rc({offer:e,componentType:t,hoverHandler:i}){const{id:o,isPremium:a,previewImage:l,price:c,isFavorite:f,rating:d,title:m,type:S}=e,x=`${Ke.Offer}/${o}`,T={cities:{width:"260",height:"200"},"near-places":{width:"260",height:"200"},favorites:{width:"150",height:"110"}},z=()=>i&&i(e),M=()=>i&&i();return _.jsxs("article",{className:`${t}__card place-card`,onMouseEnter:z,onMouseLeave:M,children:[a&&_.jsx("div",{className:"place-card__mark",children:_.jsx("span",{children:"Premium"})}),_.jsx("div",{className:`${t}__image-wrapper place-card__image-wrapper`,children:_.jsx(Cn,{to:x,children:_.jsx("img",{className:"place-card__image",src:l,alt:"Place image",...T[t]})})}),_.jsxs("div",{className:"place-card__info",children:[_.jsxs("div",{className:"place-card__price-wrapper",children:[_.jsxs("div",{className:"place-card__price",children:[_.jsxs("b",{className:"place-card__price-value",children:["€",c]}),_.jsx("span",{className:"place-card__price-text",children:"/ night"})]}),_.jsx(Kp,{componentType:"place-card",isFavorite:f})]}),_.jsx(ic,{componentType:"place-card",rating:d}),_.jsx("h2",{className:"place-card__name",children:_.jsx(Cn,{to:x,children:m})}),_.jsx("p",{className:"place-card__type",children:S})]})]})}function oc(){const e=zn(),t=_.jsx("img",{className:"header__logo",src:"img/logo.svg",alt:"6 cities logo",width:"81",height:"41"});return Vi.map(o=>o.slug).includes(e.pathname.split("/").join(""))?_.jsx("span",{className:"header__logo-link header__logo-link--active",children:t}):_.jsx(Cn,{to:Ke.Root,className:"header__logo-link",children:t})}function Hs(){return _.jsx("header",{className:"header",children:_.jsx("div",{className:"container",children:_.jsxs("div",{className:"header__wrapper",children:[_.jsx("div",{className:"header__left",children:_.jsx(oc,{})}),_.jsx("nav",{className:"header__nav",children:_.jsxs("ul",{className:"header__nav-list",children:[_.jsx("li",{className:"header__nav-item user",children:_.jsxs(Cn,{to:Ke.Favorites,className:"header__nav-link header__nav-link--profile",children:[_.jsx("div",{className:"header__avatar-wrapper user__avatar-wrapper"}),_.jsx("span",{className:"header__user-name user__name",children:"Oliver.conner@gmail.com"}),_.jsx("span",{className:"header__favorite-count",children:"3"})]})}),_.jsx("li",{className:"header__nav-item",children:_.jsx("a",{className:"header__nav-link",href:"#",children:_.jsx("span",{className:"header__signout",children:"Sign out"})})})]})})]})})})}function Hy({cities:e=Vi}){return e.map(t=>_.jsx(Fy,{to:Ke.Root+t.slug,className:({isActive:i})=>nc("locations__item-link tabs__item",i&&"tabs__item--active"),children:_.jsx("span",{children:t.name})},t.slug))}const Vy=()=>{const e=document.title;return()=>{document.title=e}};function qr(e){Z.useEffect(Vy,[]),Z.useEffect(()=>{document.title=`${e} | 6 cities`},[e])}var Jl={exports:{}};/* @preserve * Leaflet 1.7.1, a JS library for interactive maps. http://leafletjs.com * (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */(function(e,t){(function(i,o){o(t)})(Pf,function(i){var o="1.7.1";function a(n){var r,s,u,h;for(s=1,u=arguments.length;s"u"||!L||!L.Mixin)){n=w(n)?n:[n];for(var r=0;r0?Math.floor(n):Math.ceil(n)};P.prototype={clone:function(){return new P(this.x,this.y)},add:function(n){return this.clone()._add(N(n))},_add:function(n){return this.x+=n.x,this.y+=n.y,this},subtract:function(n){return this.clone()._subtract(N(n))},_subtract:function(n){return this.x-=n.x,this.y-=n.y,this},divideBy:function(n){return this.clone()._divideBy(n)},_divideBy:function(n){return this.x/=n,this.y/=n,this},multiplyBy:function(n){return this.clone()._multiplyBy(n)},_multiplyBy:function(n){return this.x*=n,this.y*=n,this},scaleBy:function(n){return new P(this.x*n.x,this.y*n.y)},unscaleBy:function(n){return new P(this.x/n.x,this.y/n.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=D(this.x),this.y=D(this.y),this},distanceTo:function(n){n=N(n);var r=n.x-this.x,s=n.y-this.y;return Math.sqrt(r*r+s*s)},equals:function(n){return n=N(n),n.x===this.x&&n.y===this.y},contains:function(n){return n=N(n),Math.abs(n.x)<=Math.abs(this.x)&&Math.abs(n.y)<=Math.abs(this.y)},toString:function(){return"Point("+T(this.x)+", "+T(this.y)+")"}};function N(n,r,s){return n instanceof P?n:w(n)?new P(n[0],n[1]):n==null?n:typeof n=="object"&&"x"in n&&"y"in n?new P(n.x,n.y):new P(n,r,s)}function F(n,r){if(n)for(var s=r?[n,r]:n,u=0,h=s.length;u=this.min.x&&s.x<=this.max.x&&r.y>=this.min.y&&s.y<=this.max.y},intersects:function(n){n=q(n);var r=this.min,s=this.max,u=n.min,h=n.max,p=h.x>=r.x&&u.x<=s.x,g=h.y>=r.y&&u.y<=s.y;return p&&g},overlaps:function(n){n=q(n);var r=this.min,s=this.max,u=n.min,h=n.max,p=h.x>r.x&&u.xr.y&&u.y=r.lat&&h.lat<=s.lat&&u.lng>=r.lng&&h.lng<=s.lng},intersects:function(n){n=ee(n);var r=this._southWest,s=this._northEast,u=n.getSouthWest(),h=n.getNorthEast(),p=h.lat>=r.lat&&u.lat<=s.lat,g=h.lng>=r.lng&&u.lng<=s.lng;return p&&g},overlaps:function(n){n=ee(n);var r=this._southWest,s=this._northEast,u=n.getSouthWest(),h=n.getNorthEast(),p=h.lat>r.lat&&u.latr.lng&&u.lng1,ni=function(){var n=!1;try{var r=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("testPassiveEventSupport",x,r),window.removeEventListener("testPassiveEventSupport",x,r)}catch{}return n}(),pc=function(){return!!document.createElement("canvas").getContext}(),no=!!(document.createElementNS&&sc("svg").createSVGRect),io=!no&&function(){try{var n=document.createElement("div");n.innerHTML='';var r=n.firstChild;return r.style.behavior="url(#default#VML)",r&&typeof r.adj=="object"}catch{return!1}}();function Mt(n){return navigator.userAgent.toLowerCase().indexOf(n)>=0}var sm={ie:Jr,ielt9:ei,edge:eo,webkit:bs,android:Ki,android23:Yi,androidStock:lc,opera:Gs,chrome:Ks,gecko:Ys,safari:to,phantom:uc,opera12:cc,win:hc,ie3d:Qs,webkit3d:Xs,gecko3d:fc,any3d:st,mobile:ti,mobileWebkit:im,mobileWebkit3d:rm,msPointer:nn,pointer:Et,touch:Nt,mobileOpera:dc,mobileGecko:om,retina:rn,passiveEvents:ni,canvas:pc,svg:no,vml:io},qs=nn?"MSPointerDown":"pointerdown",Js=nn?"MSPointerMove":"pointermove",ea=nn?"MSPointerUp":"pointerup",ta=nn?"MSPointerCancel":"pointercancel",ii={},mc=!1;function am(n,r,s,u){return r==="touchstart"?um(n,s,u):r==="touchmove"?fm(n,s,u):r==="touchend"&&dm(n,s,u),this}function lm(n,r,s){var u=n["_leaflet_"+r+s];return r==="touchstart"?n.removeEventListener(qs,u,!1):r==="touchmove"?n.removeEventListener(Js,u,!1):r==="touchend"&&(n.removeEventListener(ea,u,!1),n.removeEventListener(ta,u,!1)),this}function um(n,r,s){var u=c(function(h){h.MSPOINTER_TYPE_TOUCH&&h.pointerType===h.MSPOINTER_TYPE_TOUCH&<(h),na(h,r)});n["_leaflet_touchstart"+s]=u,n.addEventListener(qs,u,!1),mc||(document.addEventListener(qs,cm,!0),document.addEventListener(Js,hm,!0),document.addEventListener(ea,_c,!0),document.addEventListener(ta,_c,!0),mc=!0)}function cm(n){ii[n.pointerId]=n}function hm(n){ii[n.pointerId]&&(ii[n.pointerId]=n)}function _c(n){delete ii[n.pointerId]}function na(n,r){n.touches=[];for(var s in ii)n.touches.push(ii[s]);n.changedTouches=[n],r(n)}function fm(n,r,s){var u=function(h){h.pointerType===(h.MSPOINTER_TYPE_MOUSE||"mouse")&&h.buttons===0||na(h,r)};n["_leaflet_touchmove"+s]=u,n.addEventListener(Js,u,!1)}function dm(n,r,s){var u=function(h){na(h,r)};n["_leaflet_touchend"+s]=u,n.addEventListener(ea,u,!1),n.addEventListener(ta,u,!1)}var ro=nn?"MSPointerDown":Et?"pointerdown":"touchstart",oo=nn?"MSPointerUp":Et?"pointerup":"touchend",ri="_leaflet_";function pm(n,r,s){var u,h,p=!1,g=250;function k(I){if(Et){if(!I.isPrimary||I.pointerType==="mouse")return}else if(I.touches.length>1)return;var U=Date.now(),X=U-(u||U);h=I.touches?I.touches[0]:I,p=X>0&&X<=g,u=U}function C(I){if(p&&!h.cancelBubble){if(Et){if(I.pointerType==="mouse")return;var U={},X,ue;for(ue in h)X=h[ue],U[ue]=X&&X.bind?X.bind(h):X;h=U}h.type="dblclick",h.button=0,r(h),u=null}}return n[ri+ro+s]=k,n[ri+oo+s]=C,n[ri+"dblclick"+s]=r,n.addEventListener(ro,k,ni?{passive:!1}:!1),n.addEventListener(oo,C,ni?{passive:!1}:!1),n.addEventListener("dblclick",r,!1),this}function mm(n,r){var s=n[ri+ro+r],u=n[ri+oo+r],h=n[ri+"dblclick"+r];return n.removeEventListener(ro,s,ni?{passive:!1}:!1),n.removeEventListener(oo,u,ni?{passive:!1}:!1),n.removeEventListener("dblclick",h,!1),this}var ia=lo(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Qi=lo(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),vc=Qi==="webkitTransition"||Qi==="OTransition"?Qi+"End":"transitionend";function gc(n){return typeof n=="string"?document.getElementById(n):n}function Xi(n,r){var s=n.style[r]||n.currentStyle&&n.currentStyle[r];if((!s||s==="auto")&&document.defaultView){var u=document.defaultView.getComputedStyle(n,null);s=u?u[r]:null}return s==="auto"?null:s}function le(n,r,s){var u=document.createElement(n);return u.className=r||"",s&&s.appendChild(u),u}function ve(n){var r=n.parentNode;r&&r.removeChild(n)}function so(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function oi(n){var r=n.parentNode;r&&r.lastChild!==n&&r.appendChild(n)}function si(n){var r=n.parentNode;r&&r.firstChild!==n&&r.insertBefore(n,r.firstChild)}function ra(n,r){if(n.classList!==void 0)return n.classList.contains(r);var s=ao(n);return s.length>0&&new RegExp("(^|\\s)"+r+"(\\s|$)").test(s)}function te(n,r){if(n.classList!==void 0)for(var s=M(r),u=0,h=s.length;uthis.options.maxZoom)?this.setZoom(n):this},panInsideBounds:function(n,r){this._enforcingBounds=!0;var s=this.getCenter(),u=this._limitCenter(s,this._zoom,ee(n));return s.equals(u)||this.panTo(u,r),this._enforcingBounds=!1,this},panInside:function(n,r){r=r||{};var s=N(r.paddingTopLeft||r.padding||[0,0]),u=N(r.paddingBottomRight||r.padding||[0,0]),h=this.getCenter(),p=this.project(h),g=this.project(n),k=this.getPixelBounds(),C=k.getSize().divideBy(2),I=q([k.min.add(s),k.max.subtract(u)]);if(!I.contains(g)){this._enforcingBounds=!0;var U=p.subtract(g),X=N(g.x+U.x,g.y+U.y);(g.xI.max.x)&&(X.x=p.x-U.x,U.x>0?X.x+=C.x-s.x:X.x-=C.x-u.x),(g.yI.max.y)&&(X.y=p.y-U.y,U.y>0?X.y+=C.y-s.y:X.y-=C.y-u.y),this.panTo(this.unproject(X),r),this._enforcingBounds=!1}return this},invalidateSize:function(n){if(!this._loaded)return this;n=a({animate:!1,pan:!0},n===!0?{animate:!0}:n);var r=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var s=this.getSize(),u=r.divideBy(2).round(),h=s.divideBy(2).round(),p=u.subtract(h);return!p.x&&!p.y?this:(n.animate&&n.pan?this.panBy(p):(n.pan&&this._rawPanBy(p),this.fire("move"),n.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(c(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:r,newSize:s}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(n){if(n=this._locateOptions=a({timeout:1e4,watch:!1},n),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var r=c(this._handleGeolocationResponse,this),s=c(this._handleGeolocationError,this);return n.watch?this._locationWatchId=navigator.geolocation.watchPosition(r,s,n):navigator.geolocation.getCurrentPosition(r,s,n),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(n){var r=n.code,s=n.message||(r===1?"permission denied":r===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:r,message:"Geolocation error: "+s+"."})},_handleGeolocationResponse:function(n){var r=n.coords.latitude,s=n.coords.longitude,u=new J(r,s),h=u.toBounds(n.coords.accuracy*2),p=this._locateOptions;if(p.setView){var g=this.getBoundsZoom(h);this.setView(u,p.maxZoom?Math.min(g,p.maxZoom):g)}var k={latlng:u,bounds:h,timestamp:n.timestamp};for(var C in n.coords)typeof n.coords[C]=="number"&&(k[C]=n.coords[C]);this.fire("locationfound",k)},addHandler:function(n,r){if(!r)return this;var s=this[n]=new r(this);return this._handlers.push(s),this.options[n]&&s.enable(),this},remove:function(){if(this._initEvents(!0),this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),ve(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(de(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var n;for(n in this._layers)this._layers[n].remove();for(n in this._panes)ve(this._panes[n]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(n,r){var s="leaflet-pane"+(n?" leaflet-"+n.replace("Pane","")+"-pane":""),u=le("div",s,r||this._mapPane);return n&&(this._panes[n]=u),u},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var n=this.getPixelBounds(),r=this.unproject(n.getBottomLeft()),s=this.unproject(n.getTopRight());return new ne(r,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(n,r,s){n=ee(n),s=N(s||[0,0]);var u=this.getZoom()||0,h=this.getMinZoom(),p=this.getMaxZoom(),g=n.getNorthWest(),k=n.getSouthEast(),C=this.getSize().subtract(s),I=q(this.project(k,u),this.project(g,u)).getSize(),U=st?this.options.zoomSnap:1,X=C.x/I.x,ue=C.y/I.y,Wt=r?Math.max(X,ue):Math.min(X,ue);return u=this.getScaleZoom(Wt,u),U&&(u=Math.round(u/(U/100))*(U/100),u=r?Math.ceil(u/U)*U:Math.floor(u/U)*U),Math.max(h,Math.min(p,u))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new P(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(n,r){var s=this._getTopLeftPoint(n,r);return new F(s,s.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(n){return this.options.crs.getProjectedBounds(n===void 0?this.getZoom():n)},getPane:function(n){return typeof n=="string"?this._panes[n]:n},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(n,r){var s=this.options.crs;return r=r===void 0?this._zoom:r,s.scale(n)/s.scale(r)},getScaleZoom:function(n,r){var s=this.options.crs;r=r===void 0?this._zoom:r;var u=s.zoom(n*s.scale(r));return isNaN(u)?1/0:u},project:function(n,r){return r=r===void 0?this._zoom:r,this.options.crs.latLngToPoint(ie(n),r)},unproject:function(n,r){return r=r===void 0?this._zoom:r,this.options.crs.pointToLatLng(N(n),r)},layerPointToLatLng:function(n){var r=N(n).add(this.getPixelOrigin());return this.unproject(r)},latLngToLayerPoint:function(n){var r=this.project(ie(n))._round();return r._subtract(this.getPixelOrigin())},wrapLatLng:function(n){return this.options.crs.wrapLatLng(ie(n))},wrapLatLngBounds:function(n){return this.options.crs.wrapLatLngBounds(ee(n))},distance:function(n,r){return this.options.crs.distance(ie(n),ie(r))},containerPointToLayerPoint:function(n){return N(n).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(n){return N(n).add(this._getMapPanePos())},containerPointToLatLng:function(n){var r=this.containerPointToLayerPoint(N(n));return this.layerPointToLatLng(r)},latLngToContainerPoint:function(n){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ie(n)))},mouseEventToContainerPoint:function(n){return xc(n,this._container)},mouseEventToLayerPoint:function(n){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(n))},mouseEventToLatLng:function(n){return this.layerPointToLatLng(this.mouseEventToLayerPoint(n))},_initContainer:function(n){var r=this._container=gc(n);if(r){if(r._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");re(r,"scroll",this._onScroll,this),this._containerId=d(r)},_initLayout:function(){var n=this._container;this._fadeAnimated=this.options.fadeAnimation&&st,te(n,"leaflet-container"+(Nt?" leaflet-touch":"")+(rn?" leaflet-retina":"")+(ei?" leaflet-oldie":"")+(to?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var r=Xi(n,"position");r!=="absolute"&&r!=="relative"&&r!=="fixed"&&(n.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var n=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ce(this._mapPane,new P(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(te(n.markerPane,"leaflet-zoom-hide"),te(n.shadowPane,"leaflet-zoom-hide"))},_resetView:function(n,r){Ce(this._mapPane,new P(0,0));var s=!this._loaded;this._loaded=!0,r=this._limitZoom(r),this.fire("viewprereset");var u=this._zoom!==r;this._moveStart(u,!1)._move(n,r)._moveEnd(u),this.fire("viewreset"),s&&this.fire("load")},_moveStart:function(n,r){return n&&this.fire("zoomstart"),r||this.fire("movestart"),this},_move:function(n,r,s){r===void 0&&(r=this._zoom);var u=this._zoom!==r;return this._zoom=r,this._lastCenter=n,this._pixelOrigin=this._getNewPixelOrigin(n),(u||s&&s.pinch)&&this.fire("zoom",s),this.fire("move",s)},_moveEnd:function(n){return n&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return de(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(n){Ce(this._mapPane,this._getMapPanePos().subtract(n))},_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(n){this._targets={},this._targets[d(this._container)]=this;var r=n?ke:re;r(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&r(window,"resize",this._onResize,this),st&&this.options.transform3DLimit&&(n?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){de(this._resizeRequest),this._resizeRequest=Y(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var n=this._getMapPanePos();Math.max(Math.abs(n.x),Math.abs(n.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(n,r){for(var s=[],u,h=r==="mouseout"||r==="mouseover",p=n.target||n.srcElement,g=!1;p;){if(u=this._targets[d(p)],u&&(r==="click"||r==="preclick")&&!n._simulated&&this._draggableMoved(u)){g=!0;break}if(u&&u.listens(r,!0)&&(h&&!fo(p,n)||(s.push(u),h))||p===this._container)break;p=p.parentNode}return!s.length&&!g&&!h&&fo(p,n)&&(s=[this]),s},_handleDOMEvent:function(n){if(!(!this._loaded||va(n))){var r=n.type;(r==="mousedown"||r==="keypress"||r==="keyup"||r==="keydown")&&ca(n.target||n.srcElement),this._fireDOMEvent(n,r)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(n,r,s){if(n.type==="click"){var u=a({},n);u.type="preclick",this._fireDOMEvent(u,u.type,s)}if(!n._stopped&&(s=(s||[]).concat(this._findEventTargets(n,r)),!!s.length)){var h=s[0];r==="contextmenu"&&h.listens(r,!0)&<(n);var p={originalEvent:n};if(n.type!=="keypress"&&n.type!=="keydown"&&n.type!=="keyup"){var g=h.getLatLng&&(!h._radius||h._radius<=10);p.containerPoint=g?this.latLngToContainerPoint(h.getLatLng()):this.mouseEventToContainerPoint(n),p.layerPoint=this.containerPointToLayerPoint(p.containerPoint),p.latlng=g?h.getLatLng():this.layerPointToLatLng(p.layerPoint)}for(var k=0;k0?Math.round(n-r)/2:Math.max(0,Math.ceil(n))-Math.max(0,Math.floor(r))},_limitZoom:function(n){var r=this.getMinZoom(),s=this.getMaxZoom(),u=st?this.options.zoomSnap:1;return u&&(n=Math.round(n/u)*u),Math.max(r,Math.min(s,n))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Pe(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(n,r){var s=this._getCenterOffset(n)._trunc();return(r&&r.animate)!==!0&&!this.getSize().contains(s)?!1:(this.panBy(s,r),!0)},_createAnimProxy:function(){var n=this._proxy=le("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(n),this.on("zoomanim",function(r){var s=ia,u=this._proxy.style[s];On(this._proxy,this.project(r.center,r.zoom),this.getZoomScale(r.zoom,1)),u===this._proxy.style[s]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ve(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var n=this.getCenter(),r=this.getZoom();On(this._proxy,this.project(n,r),this.getZoomScale(r,1))},_catchTransitionEnd:function(n){this._animatingZoom&&n.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(n,r,s){if(this._animatingZoom)return!0;if(s=s||{},!this._zoomAnimated||s.animate===!1||this._nothingToAnimate()||Math.abs(r-this._zoom)>this.options.zoomAnimationThreshold)return!1;var u=this.getZoomScale(r),h=this._getCenterOffset(n)._divideBy(1-1/u);return s.animate!==!0&&!this.getSize().contains(h)?!1:(Y(function(){this._moveStart(!0,!1)._animateZoom(n,r,!0)},this),!0)},_animateZoom:function(n,r,s,u){this._mapPane&&(s&&(this._animatingZoom=!0,this._animateToCenter=n,this._animateToZoom=r,te(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:n,zoom:r,noUpdate:u}),setTimeout(c(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Pe(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),Y(function(){this._moveEnd(!0)},this))}});function wm(n,r){return new se(n,r)}var vt=Q.extend({options:{position:"topright"},initialize:function(n){E(this,n)},getPosition:function(){return this.options.position},setPosition:function(n){var r=this._map;return r&&r.removeControl(this),this.options.position=n,r&&r.addControl(this),this},getContainer:function(){return this._container},addTo:function(n){this.remove(),this._map=n;var r=this._container=this.onAdd(n),s=this.getPosition(),u=n._controlCorners[s];return te(r,"leaflet-control"),s.indexOf("bottom")!==-1?u.insertBefore(r,u.firstChild):u.appendChild(r),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ve(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(n){this._map&&n&&n.screenX>0&&n.screenY>0&&this._map.getContainer().focus()}}),nr=function(n){return new vt(n)};se.include({addControl:function(n){return n.addTo(this),this},removeControl:function(n){return n.remove(),this},_initControlPos:function(){var n=this._controlCorners={},r="leaflet-",s=this._controlContainer=le("div",r+"control-container",this._container);function u(h,p){var g=r+h+" "+r+p;n[h+p]=le("div",g,s)}u("top","left"),u("top","right"),u("bottom","left"),u("bottom","right")},_clearControlPos:function(){for(var n in this._controlCorners)ve(this._controlCorners[n]);ve(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var kc=vt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(n,r,s,u){return s1,this._baseLayersList.style.display=n?"":"none"),this._separator.style.display=r&&n?"":"none",this},_onLayerChange:function(n){this._handlingClick||this._update();var r=this._getLayer(d(n.target)),s=r.overlay?n.type==="add"?"overlayadd":"overlayremove":n.type==="add"?"baselayerchange":null;s&&this._map.fire(s,r)},_createRadioElement:function(n,r){var s='",u=document.createElement("div");return u.innerHTML=s,u.firstChild},_addItem:function(n){var r=document.createElement("label"),s=this._map.hasLayer(n.layer),u;n.overlay?(u=document.createElement("input"),u.type="checkbox",u.className="leaflet-control-layers-selector",u.defaultChecked=s):u=this._createRadioElement("leaflet-base-layers_"+d(this),s),this._layerControlInputs.push(u),u.layerId=d(n.layer),re(u,"click",this._onInputClick,this);var h=document.createElement("span");h.innerHTML=" "+n.name;var p=document.createElement("div");r.appendChild(p),p.appendChild(u),p.appendChild(h);var g=n.overlay?this._overlaysList:this._baseLayersList;return g.appendChild(r),this._checkDisabledLayers(),r},_onInputClick:function(){var n=this._layerControlInputs,r,s,u=[],h=[];this._handlingClick=!0;for(var p=n.length-1;p>=0;p--)r=n[p],s=this._getLayer(r.layerId).layer,r.checked?u.push(s):r.checked||h.push(s);for(p=0;p=0;h--)r=n[h],s=this._getLayer(r.layerId).layer,r.disabled=s.options.minZoom!==void 0&&us.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),xm=function(n,r,s){return new kc(n,r,s)},ga=vt.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(n){var r="leaflet-control-zoom",s=le("div",r+" leaflet-bar"),u=this.options;return this._zoomInButton=this._createButton(u.zoomInText,u.zoomInTitle,r+"-in",s,this._zoomIn),this._zoomOutButton=this._createButton(u.zoomOutText,u.zoomOutTitle,r+"-out",s,this._zoomOut),this._updateDisabled(),n.on("zoomend zoomlevelschange",this._updateDisabled,this),s},onRemove:function(n){n.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(n){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(n.shiftKey?3:1))},_createButton:function(n,r,s,u,h){var p=le("a",s,u);return p.innerHTML=n,p.href="#",p.title=r,p.setAttribute("role","button"),p.setAttribute("aria-label",r),tr(p),re(p,"click",Dt),re(p,"click",h,this),re(p,"click",this._refocusOnMap,this),p},_updateDisabled:function(){var n=this._map,r="leaflet-disabled";Pe(this._zoomInButton,r),Pe(this._zoomOutButton,r),(this._disabled||n._zoom===n.getMinZoom())&&te(this._zoomOutButton,r),(this._disabled||n._zoom===n.getMaxZoom())&&te(this._zoomInButton,r)}});se.mergeOptions({zoomControl:!0}),se.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new ga,this.addControl(this.zoomControl))});var Pm=function(n){return new ga(n)},Lc=vt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(n){var r="leaflet-control-scale",s=le("div",r),u=this.options;return this._addScales(u,r+"-line",s),n.on(u.updateWhenIdle?"moveend":"move",this._update,this),n.whenReady(this._update,this),s},onRemove:function(n){n.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(n,r,s){n.metric&&(this._mScale=le("div",r,s)),n.imperial&&(this._iScale=le("div",r,s))},_update:function(){var n=this._map,r=n.getSize().y/2,s=n.distance(n.containerPointToLatLng([0,r]),n.containerPointToLatLng([this.options.maxWidth,r]));this._updateScales(s)},_updateScales:function(n){this.options.metric&&n&&this._updateMetric(n),this.options.imperial&&n&&this._updateImperial(n)},_updateMetric:function(n){var r=this._getRoundNum(n),s=r<1e3?r+" m":r/1e3+" km";this._updateScale(this._mScale,s,r/n)},_updateImperial:function(n){var r=n*3.2808399,s,u,h;r>5280?(s=r/5280,u=this._getRoundNum(s),this._updateScale(this._iScale,u+" mi",u/s)):(h=this._getRoundNum(r),this._updateScale(this._iScale,h+" ft",h/r))},_updateScale:function(n,r,s){n.style.width=Math.round(this.options.maxWidth*s)+"px",n.innerHTML=r},_getRoundNum:function(n){var r=Math.pow(10,(Math.floor(n)+"").length-1),s=n/r;return s=s>=10?10:s>=5?5:s>=3?3:s>=2?2:1,r*s}}),Sm=function(n){return new Lc(n)},ya=vt.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(n){E(this,n),this._attributions={}},onAdd:function(n){n.attributionControl=this,this._container=le("div","leaflet-control-attribution"),tr(this._container);for(var r in n._layers)n._layers[r].getAttribution&&this.addAttribution(n._layers[r].getAttribution());return this._update(),this._container},setPrefix:function(n){return this.options.prefix=n,this._update(),this},addAttribution:function(n){return n?(this._attributions[n]||(this._attributions[n]=0),this._attributions[n]++,this._update(),this):this},removeAttribution:function(n){return n?(this._attributions[n]&&(this._attributions[n]--,this._update()),this):this},_update:function(){if(this._map){var n=[];for(var r in this._attributions)this._attributions[r]&&n.push(r);var s=[];this.options.prefix&&s.push(this.options.prefix),n.length&&s.push(n.join(", ")),this._container.innerHTML=s.join(" | ")}}});se.mergeOptions({attributionControl:!0}),se.addInitHook(function(){this.options.attributionControl&&new ya().addTo(this)});var km=function(n){return new ya(n)};vt.Layers=kc,vt.Zoom=ga,vt.Scale=Lc,vt.Attribution=ya,nr.layers=xm,nr.zoom=Pm,nr.scale=Sm,nr.attribution=km;var zt=Q.extend({initialize:function(n){this._map=n},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}});zt.addTo=function(n,r){return n.addHandler(r,this),this};var Lm={Events:j},Tc=Nt?"touchstart mousedown":"mousedown",Cc={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},wa={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},Rn=V.extend({options:{clickTolerance:3},initialize:function(n,r,s,u){E(this,u),this._element=n,this._dragStartTarget=r||n,this._preventOutline=s},enable:function(){this._enabled||(re(this._dragStartTarget,Tc,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Rn._dragging===this&&this.finishDrag(),ke(this._dragStartTarget,Tc,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(n){if(!(n._simulated||!this._enabled)&&(this._moved=!1,!ra(this._element,"leaflet-zoom-anim")&&!(Rn._dragging||n.shiftKey||n.which!==1&&n.button!==1&&!n.touches)&&(Rn._dragging=this,this._preventOutline&&ca(this._element),aa(),qi(),!this._moving))){this.fire("down");var r=n.touches?n.touches[0]:n,s=yc(this._element);this._startPoint=new P(r.clientX,r.clientY),this._parentScale=ha(s),re(document,wa[n.type],this._onMove,this),re(document,Cc[n.type],this._onUp,this)}},_onMove:function(n){if(!(n._simulated||!this._enabled)){if(n.touches&&n.touches.length>1){this._moved=!0;return}var r=n.touches&&n.touches.length===1?n.touches[0]:n,s=new P(r.clientX,r.clientY)._subtract(this._startPoint);!s.x&&!s.y||Math.abs(s.x)+Math.abs(s.y)p&&(g=k,p=C);p>s&&(r[g]=1,xa(n,r,s,u,g),xa(n,r,s,g,h))}function Em(n,r){for(var s=[n[0]],u=1,h=0,p=n.length;ur&&(s.push(n[u]),h=u);return hr.max.x&&(s|=2),n.yr.max.y&&(s|=8),s}function Nm(n,r){var s=r.x-n.x,u=r.y-n.y;return s*s+u*u}function ir(n,r,s,u){var h=r.x,p=r.y,g=s.x-h,k=s.y-p,C=g*g+k*k,I;return C>0&&(I=((n.x-h)*g+(n.y-p)*k)/C,I>1?(h=s.x,p=s.y):I>0&&(h+=g*I,p+=k*I)),g=n.x-h,k=n.y-p,u?g*g+k*k:new P(h,p)}function Zt(n){return!w(n[0])||typeof n[0][0]!="object"&&typeof n[0][0]<"u"}function Oc(n){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Zt(n)}var Mm={simplify:Ec,pointToSegmentDistance:Nc,closestPointOnSegment:Tm,clipSegment:zc,_getEdgeIntersection:po,_getBitCode:jn,_sqClosestPointOnSegment:ir,isFlat:Zt,_flat:Oc};function Ic(n,r,s){var u,h=[1,4,2,8],p,g,k,C,I,U,X,ue;for(p=0,U=n.length;p1e-7;k++)I=h*Math.sin(g),I=Math.pow((1-I)/(1+I),h/2),C=Math.PI/2-2*Math.atan(p*I)-g,g+=C;return new J(g*r,n.x*r/s)}},Om={LonLat:Pa,Mercator:Sa,SphericalMercator:Oe},Im=a({},be,{code:"EPSG:3395",projection:Sa,transformation:function(){var n=.5/(Math.PI*Sa.R);return mt(n,.5,-n,.5)}()}),Rc=a({},be,{code:"EPSG:4326",projection:Pa,transformation:mt(1/180,1,-1/180,.5)}),Rm=a({},xe,{projection:Pa,transformation:mt(1,0,-1,0),scale:function(n){return Math.pow(2,n)},zoom:function(n){return Math.log(n)/Math.LN2},distance:function(n,r){var s=r.lng-n.lng,u=r.lat-n.lat;return Math.sqrt(s*s+u*u)},infinite:!0});xe.Earth=be,xe.EPSG3395=Im,xe.EPSG3857=tn,xe.EPSG900913=tm,xe.EPSG4326=Rc,xe.Simple=Rm;var gt=V.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(n){return n.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(n){return n&&n.removeLayer(this),this},getPane:function(n){return this._map.getPane(n?this.options[n]||n:this.options.pane)},addInteractiveTarget:function(n){return this._map._targets[d(n)]=this,this},removeInteractiveTarget:function(n){return delete this._map._targets[d(n)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(n){var r=n.target;if(r.hasLayer(this)){if(this._map=r,this._zoomAnimated=r._zoomAnimated,this.getEvents){var s=this.getEvents();r.on(s,this),this.once("remove",function(){r.off(s,this)},this)}this.onAdd(r),this.getAttribution&&r.attributionControl&&r.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),r.fire("layeradd",{layer:this})}}});se.include({addLayer:function(n){if(!n._layerAdd)throw new Error("The provided object is not a Layer.");var r=d(n);return this._layers[r]?this:(this._layers[r]=n,n._mapToAdd=this,n.beforeAdd&&n.beforeAdd(this),this.whenReady(n._layerAdd,n),this)},removeLayer:function(n){var r=d(n);return this._layers[r]?(this._loaded&&n.onRemove(this),n.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(n.getAttribution()),delete this._layers[r],this._loaded&&(this.fire("layerremove",{layer:n}),n.fire("remove")),n._map=n._mapToAdd=null,this):this},hasLayer:function(n){return!!n&&d(n)in this._layers},eachLayer:function(n,r){for(var s in this._layers)n.call(r,this._layers[s]);return this},_addLayers:function(n){n=n?w(n)?n:[n]:[];for(var r=0,s=n.length;rthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()r)return g=(u-r)/s,this._map.layerPointToLatLng([p.x-g*(p.x-h.x),p.y-g*(p.y-h.y)])},getBounds:function(){return this._bounds},addLatLng:function(n,r){return r=r||this._defaultShape(),n=ie(n),r.push(n),this._bounds.extend(n),this.redraw()},_setLatLngs:function(n){this._bounds=new ne,this._latlngs=this._convertLatLngs(n)},_defaultShape:function(){return Zt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(n){for(var r=[],s=Zt(n),u=0,h=n.length;u=2&&r[0]instanceof J&&r[0].equals(r[s-1])&&r.pop(),r},_setLatLngs:function(n){Ft.prototype._setLatLngs.call(this,n),Zt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Zt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var n=this._renderer._bounds,r=this.options.weight,s=new P(r,r);if(n=new F(n.min.subtract(s),n.max.add(s)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(n))){if(this.options.noClip){this._parts=this._rings;return}for(var u=0,h=this._rings.length,p;un.y!=h.y>n.y&&n.x<(h.x-u.x)*(n.y-u.y)/(h.y-u.y)+u.x&&(r=!r);return r||Ft.prototype._containsPoint.call(this,n,!0)}});function $m(n,r){return new ci(n,r)}var Ut=li.extend({initialize:function(n,r){E(this,r),this._layers={},n&&this.addData(n)},addData:function(n){var r=w(n)?n:n.features,s,u,h;if(r){for(s=0,u=r.length;s0?u:[r.src];return}w(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(r.style,"objectFit")&&(r.style.objectFit="fill"),r.autoplay=!!this.options.autoplay,r.loop=!!this.options.loop,r.muted=!!this.options.muted;for(var p=0;ph?(r.height=h+"px",te(n,p)):Pe(n,p),this._containerWidth=this._container.offsetWidth},_animateZoom:function(n){var r=this._map._latLngToNewLayerPoint(this._latlng,n.zoom,n.center),s=this._getAnchor();Ce(this._container,r.add(s))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var n=this._map,r=parseInt(Xi(this._container,"marginBottom"),10)||0,s=this._container.offsetHeight+r,u=this._containerWidth,h=new P(this._containerLeft,-s-this._containerBottom);h._add(on(this._container));var p=n.layerPointToContainerPoint(h),g=N(this.options.autoPanPadding),k=N(this.options.autoPanPaddingTopLeft||g),C=N(this.options.autoPanPaddingBottomRight||g),I=n.getSize(),U=0,X=0;p.x+u+C.x>I.x&&(U=p.x+u-I.x+C.x),p.x-U-k.x<0&&(U=p.x-k.x),p.y+s+C.y>I.y&&(X=p.y+s-I.y+C.y),p.y-X-k.y<0&&(X=p.y-k.y),(U||X)&&n.fire("autopanstart").panBy([U,X])}},_onCloseButtonClick:function(n){this._close(),Dt(n)},_getAnchor:function(){return N(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Gm=function(n,r){return new fi(n,r)};se.mergeOptions({closePopupOnClick:!0}),se.include({openPopup:function(n,r,s){return n instanceof fi||(n=new fi(s).setContent(n)),r&&n.setLatLng(r),this.hasLayer(n)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=n,this.addLayer(n))},closePopup:function(n){return(!n||n===this._popup)&&(n=this._popup,this._popup=null),n&&this.removeLayer(n),this}}),gt.include({bindPopup:function(n,r){return n instanceof fi?(E(n,r),this._popup=n,n._source=this):((!this._popup||r)&&(this._popup=new fi(r,this)),this._popup.setContent(n)),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(n,r){return this._popup&&this._map&&(r=this._popup._prepareOpen(this,n,r),this._map.openPopup(this._popup,r)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(n){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(n)),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(n){return this._popup&&this._popup.setContent(n),this},getPopup:function(){return this._popup},_openPopup:function(n){var r=n.layer||n.target;if(this._popup&&this._map){if(Dt(n),r instanceof sn){this.openPopup(n.layer||n.target,n.latlng);return}this._map.hasLayer(this._popup)&&this._popup._source===r?this.closePopup():this.openPopup(r,n.latlng)}},_movePopup:function(n){this._popup.setLatLng(n.latlng)},_onKeyPress:function(n){n.originalEvent.keyCode===13&&this._openPopup(n)}});var di=$t.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(n){$t.prototype.onAdd.call(this,n),this.setOpacity(this.options.opacity),n.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(n){$t.prototype.onRemove.call(this,n),n.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var n=$t.prototype.getEvents.call(this);return Nt&&!this.options.permanent&&(n.preclick=this._close),n},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var n="leaflet-tooltip",r=n+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=le("div",r)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(n){var r,s,u=this._map,h=this._container,p=u.latLngToContainerPoint(u.getCenter()),g=u.layerPointToContainerPoint(n),k=this.options.direction,C=h.offsetWidth,I=h.offsetHeight,U=N(this.options.offset),X=this._getAnchor();k==="top"?(r=C/2,s=I):k==="bottom"?(r=C/2,s=0):k==="center"?(r=C/2,s=I/2):k==="right"?(r=0,s=I/2):k==="left"?(r=C,s=I/2):g.xthis.options.maxZoom||su?this._retainParent(h,p,g,u):!1)},_retainChildren:function(n,r,s,u){for(var h=2*n;h<2*n+2;h++)for(var p=2*r;p<2*r+2;p++){var g=new P(h,p);g.z=s+1;var k=this._tileCoordsToKey(g),C=this._tiles[k];if(C&&C.active){C.retain=!0;continue}else C&&C.loaded&&(C.retain=!0);s+1this.options.maxZoom||this.options.minZoom!==void 0&&h1){this._setView(n,s);return}for(var X=h.min.y;X<=h.max.y;X++)for(var ue=h.min.x;ue<=h.max.x;ue++){var Wt=new P(ue,X);if(Wt.z=this._tileZoom,!!this._isValidTile(Wt)){var An=this._tiles[this._tileCoordsToKey(Wt)];An?An.current=!0:g.push(Wt)}}if(g.sort(function(an,Na){return an.distanceTo(p)-Na.distanceTo(p)}),g.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Po=document.createDocumentFragment();for(ue=0;ues.max.x)||!r.wrapLat&&(n.ys.max.y))return!1}if(!this.options.bounds)return!0;var u=this._tileCoordsToBounds(n);return ee(this.options.bounds).overlaps(u)},_keyToBounds:function(n){return this._tileCoordsToBounds(this._keyToTileCoords(n))},_tileCoordsToNwSe:function(n){var r=this._map,s=this.getTileSize(),u=n.scaleBy(s),h=u.add(s),p=r.unproject(u,n.z),g=r.unproject(h,n.z);return[p,g]},_tileCoordsToBounds:function(n){var r=this._tileCoordsToNwSe(n),s=new ne(r[0],r[1]);return this.options.noWrap||(s=this._map.wrapLatLngBounds(s)),s},_tileCoordsToKey:function(n){return n.x+":"+n.y+":"+n.z},_keyToTileCoords:function(n){var r=n.split(":"),s=new P(+r[0],+r[1]);return s.z=+r[2],s},_removeTile:function(n){var r=this._tiles[n];r&&(ve(r.el),delete this._tiles[n],this.fire("tileunload",{tile:r.el,coords:this._keyToTileCoords(n)}))},_initTile:function(n){te(n,"leaflet-tile");var r=this.getTileSize();n.style.width=r.x+"px",n.style.height=r.y+"px",n.onselectstart=x,n.onmousemove=x,ei&&this.options.opacity<1&&at(n,this.options.opacity),Ki&&!Yi&&(n.style.WebkitBackfaceVisibility="hidden")},_addTile:function(n,r){var s=this._getTilePos(n),u=this._tileCoordsToKey(n),h=this.createTile(this._wrapCoords(n),c(this._tileReady,this,n));this._initTile(h),this.createTile.length<2&&Y(c(this._tileReady,this,n,null,h)),Ce(h,s),this._tiles[u]={el:h,coords:n,current:!0},r.appendChild(h),this.fire("tileloadstart",{tile:h,coords:n})},_tileReady:function(n,r,s){r&&this.fire("tileerror",{error:r,tile:s,coords:n});var u=this._tileCoordsToKey(n);s=this._tiles[u],s&&(s.loaded=+new Date,this._map._fadeAnimated?(at(s.el,0),de(this._fadeFrame),this._fadeFrame=Y(this._updateOpacity,this)):(s.active=!0,this._pruneTiles()),r||(te(s.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:s.el,coords:n})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ei||!this._map._fadeAnimated?Y(this._pruneTiles,this):setTimeout(c(this._pruneTiles,this),250)))},_getTilePos:function(n){return n.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(n){var r=new P(this._wrapX?S(n.x,this._wrapX):n.x,this._wrapY?S(n.y,this._wrapY):n.y);return r.z=n.z,r},_pxBoundsToTileRange:function(n){var r=this.getTileSize();return new F(n.min.unscaleBy(r).floor(),n.max.unscaleBy(r).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var n in this._tiles)if(!this._tiles[n].loaded)return!1;return!0}});function Qm(n){return new or(n)}var pi=or.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(n,r){this._url=n,r=E(this,r),r.detectRetina&&rn&&r.maxZoom>0&&(r.tileSize=Math.floor(r.tileSize/2),r.zoomReverse?(r.zoomOffset--,r.minZoom++):(r.zoomOffset++,r.maxZoom--),r.minZoom=Math.max(0,r.minZoom)),typeof r.subdomains=="string"&&(r.subdomains=r.subdomains.split("")),Ki||this.on("tileunload",this._onTileRemove)},setUrl:function(n,r){return this._url===n&&r===void 0&&(r=!0),this._url=n,r||this.redraw(),this},createTile:function(n,r){var s=document.createElement("img");return re(s,"load",c(this._tileOnLoad,this,r,s)),re(s,"error",c(this._tileOnError,this,r,s)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(s.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),s.alt="",s.setAttribute("role","presentation"),s.src=this.getTileUrl(n),s},getTileUrl:function(n){var r={r:rn?"@2x":"",s:this._getSubdomain(n),x:n.x,y:n.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var s=this._globalTileRange.max.y-n.y;this.options.tms&&(r.y=s),r["-y"]=s}return v(this._url,a(r,this.options))},_tileOnLoad:function(n,r){ei?setTimeout(c(n,this,null,r),0):n(null,r)},_tileOnError:function(n,r,s){var u=this.options.errorTileUrl;u&&r.getAttribute("src")!==u&&(r.src=u),n(s,r)},_onTileRemove:function(n){n.tile.onload=null},_getZoomForUrl:function(){var n=this._tileZoom,r=this.options.maxZoom,s=this.options.zoomReverse,u=this.options.zoomOffset;return s&&(n=r-n),n+u},_getSubdomain:function(n){var r=Math.abs(n.x+n.y)%this.options.subdomains.length;return this.options.subdomains[r]},_abortLoading:function(){var n,r;for(n in this._tiles)this._tiles[n].coords.z!==this._tileZoom&&(r=this._tiles[n].el,r.onload=x,r.onerror=x,r.complete||(r.src=B,ve(r),delete this._tiles[n]))},_removeTile:function(n){var r=this._tiles[n];if(r)return lc||r.el.setAttribute("src",B),or.prototype._removeTile.call(this,n)},_tileReady:function(n,r,s){if(!(!this._map||s&&s.getAttribute("src")===B))return or.prototype._tileReady.call(this,n,r,s)}});function Uc(n,r){return new pi(n,r)}var $c=pi.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(n,r){this._url=n;var s=a({},this.defaultWmsParams);for(var u in r)u in this.options||(s[u]=r[u]);r=E(this,r);var h=r.detectRetina&&rn?2:1,p=this.getTileSize();s.width=p.x*h,s.height=p.y*h,this.wmsParams=s},onAdd:function(n){this._crs=this.options.crs||n.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var r=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[r]=this._crs.code,pi.prototype.onAdd.call(this,n)},getTileUrl:function(n){var r=this._tileCoordsToNwSe(n),s=this._crs,u=q(s.project(r[0]),s.project(r[1])),h=u.min,p=u.max,g=(this._wmsVersion>=1.3&&this._crs===Rc?[h.y,h.x,p.y,p.x]:[h.x,h.y,p.x,p.y]).join(","),k=pi.prototype.getTileUrl.call(this,n);return k+b(this.wmsParams,k,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+g},setParams:function(n,r){return a(this.wmsParams,n),r||this.redraw(),this}});function Xm(n,r){return new $c(n,r)}pi.WMS=$c,Uc.wms=Xm;var Ot=gt.extend({options:{padding:.1,tolerance:0},initialize:function(n){E(this,n),d(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&te(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 n={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(n.zoomanim=this._onAnimZoom),n},_onAnimZoom:function(n){this._updateTransform(n.center,n.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(n,r){var s=this._map.getZoomScale(r,this._zoom),u=on(this._container),h=this._map.getSize().multiplyBy(.5+this.options.padding),p=this._map.project(this._center,r),g=this._map.project(n,r),k=g.subtract(p),C=h.multiplyBy(-s).add(u).add(h).subtract(k);st?On(this._container,C,s):Ce(this._container,C)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var n in this._layers)this._layers[n]._reset()},_onZoomEnd:function(){for(var n in this._layers)this._layers[n]._project()},_updatePaths:function(){for(var n in this._layers)this._layers[n]._update()},_update:function(){var n=this.options.padding,r=this._map.getSize(),s=this._map.containerPointToLayerPoint(r.multiplyBy(-n)).round();this._bounds=new F(s,s.add(r.multiplyBy(1+n*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Wc=Ot.extend({getEvents:function(){var n=Ot.prototype.getEvents.call(this);return n.viewprereset=this._onViewPreReset,n},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Ot.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var n=this._container=document.createElement("canvas");re(n,"mousemove",this._onMouseMove,this),re(n,"click dblclick mousedown mouseup contextmenu",this._onClick,this),re(n,"mouseout",this._handleMouseOut,this),this._ctx=n.getContext("2d")},_destroyContainer:function(){de(this._redrawRequest),delete this._ctx,ve(this._container),ke(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var n;this._redrawBounds=null;for(var r in this._layers)n=this._layers[r],n._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ot.prototype._update.call(this);var n=this._bounds,r=this._container,s=n.getSize(),u=rn?2:1;Ce(r,n.min),r.width=u*s.x,r.height=u*s.y,r.style.width=s.x+"px",r.style.height=s.y+"px",rn&&this._ctx.scale(2,2),this._ctx.translate(-n.min.x,-n.min.y),this.fire("update")}},_reset:function(){Ot.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(n){this._updateDashArray(n),this._layers[d(n)]=n;var r=n._order={layer:n,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=r),this._drawLast=r,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(n){this._requestRedraw(n)},_removePath:function(n){var r=n._order,s=r.next,u=r.prev;s?s.prev=u:this._drawLast=u,u?u.next=s:this._drawFirst=s,delete n._order,delete this._layers[d(n)],this._requestRedraw(n)},_updatePath:function(n){this._extendRedrawBounds(n),n._project(),n._update(),this._requestRedraw(n)},_updateStyle:function(n){this._updateDashArray(n),this._requestRedraw(n)},_updateDashArray:function(n){if(typeof n.options.dashArray=="string"){var r=n.options.dashArray.split(/[, ]+/),s=[],u,h;for(h=0;h')}}catch{return function(r){return document.createElement("<"+r+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),qm={_initContainer:function(){this._container=le("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Ot.prototype._update.call(this),this.fire("update"))},_initPath:function(n){var r=n._container=sr("shape");te(r,"leaflet-vml-shape "+(this.options.className||"")),r.coordsize="1 1",n._path=sr("path"),r.appendChild(n._path),this._updateStyle(n),this._layers[d(n)]=n},_addPath:function(n){var r=n._container;this._container.appendChild(r),n.options.interactive&&n.addInteractiveTarget(r)},_removePath:function(n){var r=n._container;ve(r),n.removeInteractiveTarget(r),delete this._layers[d(n)]},_updateStyle:function(n){var r=n._stroke,s=n._fill,u=n.options,h=n._container;h.stroked=!!u.stroke,h.filled=!!u.fill,u.stroke?(r||(r=n._stroke=sr("stroke")),h.appendChild(r),r.weight=u.weight+"px",r.color=u.color,r.opacity=u.opacity,u.dashArray?r.dashStyle=w(u.dashArray)?u.dashArray.join(" "):u.dashArray.replace(/( *, *)/g," "):r.dashStyle="",r.endcap=u.lineCap.replace("butt","flat"),r.joinstyle=u.lineJoin):r&&(h.removeChild(r),n._stroke=null),u.fill?(s||(s=n._fill=sr("fill")),h.appendChild(s),s.color=u.fillColor||u.color,s.opacity=u.fillOpacity):s&&(h.removeChild(s),n._fill=null)},_updateCircle:function(n){var r=n._point.round(),s=Math.round(n._radius),u=Math.round(n._radiusY||s);this._setPath(n,n._empty()?"M0 0":"AL "+r.x+","+r.y+" "+s+","+u+" 0,"+65535*360)},_setPath:function(n,r){n._path.v=r},_bringToFront:function(n){oi(n._container)},_bringToBack:function(n){si(n._container)}},xo=io?sr:sc,ar=Ot.extend({getEvents:function(){var n=Ot.prototype.getEvents.call(this);return n.zoomstart=this._onZoomStart,n},_initContainer:function(){this._container=xo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=xo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ve(this._container),ke(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ot.prototype._update.call(this);var n=this._bounds,r=n.getSize(),s=this._container;(!this._svgSize||!this._svgSize.equals(r))&&(this._svgSize=r,s.setAttribute("width",r.x),s.setAttribute("height",r.y)),Ce(s,n.min),s.setAttribute("viewBox",[n.min.x,n.min.y,r.x,r.y].join(" ")),this.fire("update")}},_initPath:function(n){var r=n._path=xo("path");n.options.className&&te(r,n.options.className),n.options.interactive&&te(r,"leaflet-interactive"),this._updateStyle(n),this._layers[d(n)]=n},_addPath:function(n){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(n._path),n.addInteractiveTarget(n._path)},_removePath:function(n){ve(n._path),n.removeInteractiveTarget(n._path),delete this._layers[d(n)]},_updatePath:function(n){n._project(),n._update()},_updateStyle:function(n){var r=n._path,s=n.options;r&&(s.stroke?(r.setAttribute("stroke",s.color),r.setAttribute("stroke-opacity",s.opacity),r.setAttribute("stroke-width",s.weight),r.setAttribute("stroke-linecap",s.lineCap),r.setAttribute("stroke-linejoin",s.lineJoin),s.dashArray?r.setAttribute("stroke-dasharray",s.dashArray):r.removeAttribute("stroke-dasharray"),s.dashOffset?r.setAttribute("stroke-dashoffset",s.dashOffset):r.removeAttribute("stroke-dashoffset")):r.setAttribute("stroke","none"),s.fill?(r.setAttribute("fill",s.fillColor||s.color),r.setAttribute("fill-opacity",s.fillOpacity),r.setAttribute("fill-rule",s.fillRule||"evenodd")):r.setAttribute("fill","none"))},_updatePoly:function(n,r){this._setPath(n,ac(n._parts,r))},_updateCircle:function(n){var r=n._point,s=Math.max(Math.round(n._radius),1),u=Math.max(Math.round(n._radiusY),1)||s,h="a"+s+","+u+" 0 1,0 ",p=n._empty()?"M0 0":"M"+(r.x-s)+","+r.y+h+s*2+",0 "+h+-s*2+",0 ";this._setPath(n,p)},_setPath:function(n,r){n._path.setAttribute("d",r)},_bringToFront:function(n){oi(n._path)},_bringToBack:function(n){si(n._path)}});io&&ar.include(qm);function Vc(n){return no||io?new ar(n):null}se.include({getRenderer:function(n){var r=n.options.renderer||this._getPaneRenderer(n.options.pane)||this.options.renderer||this._renderer;return r||(r=this._renderer=this._createRenderer()),this.hasLayer(r)||this.addLayer(r),r},_getPaneRenderer:function(n){if(n==="overlayPane"||n===void 0)return!1;var r=this._paneRenderers[n];return r===void 0&&(r=this._createRenderer({pane:n}),this._paneRenderers[n]=r),r},_createRenderer:function(n){return this.options.preferCanvas&&Hc(n)||Vc(n)}});var bc=ci.extend({initialize:function(n,r){ci.prototype.initialize.call(this,this._boundsToLatLngs(n),r)},setBounds:function(n){return this.setLatLngs(this._boundsToLatLngs(n))},_boundsToLatLngs:function(n){return n=ee(n),[n.getSouthWest(),n.getNorthWest(),n.getNorthEast(),n.getSouthEast()]}});function Jm(n,r){return new bc(n,r)}ar.create=xo,ar.pointsToPath=ac,Ut.geometryToLayer=La,Ut.coordsToLatLng=Ta,Ut.coordsToLatLngs=vo,Ut.latLngToCoords=Ca,Ut.latLngsToCoords=go,Ut.getFeature=hi,Ut.asFeature=yo,se.mergeOptions({boxZoom:!0});var Gc=zt.extend({initialize:function(n){this._map=n,this._container=n._container,this._pane=n._panes.overlayPane,this._resetStateTimeout=0,n.on("unload",this._destroy,this)},addHooks:function(){re(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){ke(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ve(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(n){if(!n.shiftKey||n.which!==1&&n.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),qi(),aa(),this._startPoint=this._map.mouseEventToContainerPoint(n),re(document,{contextmenu:Dt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(n){this._moved||(this._moved=!0,this._box=le("div","leaflet-zoom-box",this._container),te(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(n);var r=new F(this._point,this._startPoint),s=r.getSize();Ce(this._box,r.min),this._box.style.width=s.x+"px",this._box.style.height=s.y+"px"},_finish:function(){this._moved&&(ve(this._box),Pe(this._container,"leaflet-crosshair")),Ji(),la(),ke(document,{contextmenu:Dt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(n){if(!(n.which!==1&&n.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(c(this._resetState,this),0);var r=new ne(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(r).fire("boxzoomend",{boxZoomBounds:r})}},_onKeyDown:function(n){n.keyCode===27&&this._finish()}});se.addInitHook("addHandler","boxZoom",Gc),se.mergeOptions({doubleClickZoom:!0});var Kc=zt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(n){var r=this._map,s=r.getZoom(),u=r.options.zoomDelta,h=n.originalEvent.shiftKey?s-u:s+u;r.options.doubleClickZoom==="center"?r.setZoom(h):r.setZoomAround(n.containerPoint,h)}});se.addInitHook("addHandler","doubleClickZoom",Kc),se.mergeOptions({dragging:!0,inertia:!Yi,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Yc=zt.extend({addHooks:function(){if(!this._draggable){var n=this._map;this._draggable=new Rn(n._mapPane,n._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),n.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),n.on("zoomend",this._onZoomEnd,this),n.whenReady(this._onZoomEnd,this))}te(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Pe(this._map._container,"leaflet-grab"),Pe(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 n=this._map;if(n._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var r=ee(this._map.options.maxBounds);this._offsetLimit=q(this._map.latLngToContainerPoint(r.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(r.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;n.fire("movestart").fire("dragstart"),n.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(n){if(this._map.options.inertia){var r=this._lastTime=+new Date,s=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(s),this._times.push(r),this._prunePositions(r)}this._map.fire("move",n).fire("drag",n)},_prunePositions:function(n){for(;this._positions.length>1&&n-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var n=this._map.getSize().divideBy(2),r=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=r.subtract(n).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(n,r){return n-(n-r)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var n=this._draggable._newPos.subtract(this._draggable._startPos),r=this._offsetLimit;n.xr.max.x&&(n.x=this._viscousLimit(n.x,r.max.x)),n.y>r.max.y&&(n.y=this._viscousLimit(n.y,r.max.y)),this._draggable._newPos=this._draggable._startPos.add(n)}},_onPreDragWrap:function(){var n=this._worldWidth,r=Math.round(n/2),s=this._initialWorldOffset,u=this._draggable._newPos.x,h=(u-r+s)%n+r-s,p=(u+r+s)%n-r-s,g=Math.abs(h+s)0?p:-p))-r;this._delta=0,this._startTime=null,g&&(n.options.scrollWheelZoom==="center"?n.setZoom(r+g):n.setZoomAround(this._lastMousePos,r+g))}});se.addInitHook("addHandler","scrollWheelZoom",Xc),se.mergeOptions({tap:!0,tapTolerance:15});var qc=zt.extend({addHooks:function(){re(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){ke(this._map._container,"touchstart",this._onDown,this)},_onDown:function(n){if(n.touches){if(lt(n),this._fireClick=!0,n.touches.length>1){this._fireClick=!1,clearTimeout(this._holdTimeout);return}var r=n.touches[0],s=r.target;this._startPos=this._newPos=new P(r.clientX,r.clientY),s.tagName&&s.tagName.toLowerCase()==="a"&&te(s,"leaflet-active"),this._holdTimeout=setTimeout(c(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",r))},this),1e3),this._simulateEvent("mousedown",r),re(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(n){if(clearTimeout(this._holdTimeout),ke(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&n&&n.changedTouches){var r=n.changedTouches[0],s=r.target;s&&s.tagName&&s.tagName.toLowerCase()==="a"&&Pe(s,"leaflet-active"),this._simulateEvent("mouseup",r),this._isTapValid()&&this._simulateEvent("click",r)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(n){var r=n.touches[0];this._newPos=new P(r.clientX,r.clientY),this._simulateEvent("mousemove",r)},_simulateEvent:function(n,r){var s=document.createEvent("MouseEvents");s._simulated=!0,r.target._simulatedClick=!0,s.initMouseEvent(n,!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),r.target.dispatchEvent(s)}});Nt&&(!Et||to)&&se.addInitHook("addHandler","tap",qc),se.mergeOptions({touchZoom:Nt&&!Yi,bounceAtZoomLimits:!0});var Jc=zt.extend({addHooks:function(){te(this._map._container,"leaflet-touch-zoom"),re(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Pe(this._map._container,"leaflet-touch-zoom"),ke(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(n){var r=this._map;if(!(!n.touches||n.touches.length!==2||r._animatingZoom||this._zooming)){var s=r.mouseEventToContainerPoint(n.touches[0]),u=r.mouseEventToContainerPoint(n.touches[1]);this._centerPoint=r.getSize()._divideBy(2),this._startLatLng=r.containerPointToLatLng(this._centerPoint),r.options.touchZoom!=="center"&&(this._pinchStartLatLng=r.containerPointToLatLng(s.add(u)._divideBy(2))),this._startDist=s.distanceTo(u),this._startZoom=r.getZoom(),this._moved=!1,this._zooming=!0,r._stop(),re(document,"touchmove",this._onTouchMove,this),re(document,"touchend",this._onTouchEnd,this),lt(n)}},_onTouchMove:function(n){if(!(!n.touches||n.touches.length!==2||!this._zooming)){var r=this._map,s=r.mouseEventToContainerPoint(n.touches[0]),u=r.mouseEventToContainerPoint(n.touches[1]),h=s.distanceTo(u)/this._startDist;if(this._zoom=r.getScaleZoom(h,this._startZoom),!r.options.bounceAtZoomLimits&&(this._zoomr.getMaxZoom()&&h>1)&&(this._zoom=r._limitZoom(this._zoom)),r.options.touchZoom==="center"){if(this._center=this._startLatLng,h===1)return}else{var p=s._add(u)._divideBy(2)._subtract(this._centerPoint);if(h===1&&p.x===0&&p.y===0)return;this._center=r.unproject(r.project(this._pinchStartLatLng,this._zoom).subtract(p),this._zoom)}this._moved||(r._moveStart(!0,!1),this._moved=!0),de(this._animRequest);var g=c(r._move,r,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=Y(g,this,!0),lt(n)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,de(this._animRequest),ke(document,"touchmove",this._onTouchMove,this),ke(document,"touchend",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});se.addInitHook("addHandler","touchZoom",Jc),se.BoxZoom=Gc,se.DoubleClickZoom=Kc,se.Drag=Yc,se.Keyboard=Qc,se.ScrollWheelZoom=Xc,se.Tap=qc,se.TouchZoom=Jc,i.version=o,i.Control=vt,i.control=nr,i.Browser=sm,i.Evented=V,i.Mixin=Lm,i.Util=Tt,i.Class=Q,i.Handler=zt,i.extend=a,i.bind=c,i.stamp=d,i.setOptions=E,i.DomEvent=ym,i.DomUtil=vm,i.PosAnimation=Sc,i.Draggable=Rn,i.LineUtil=Mm,i.PolyUtil=zm,i.Point=P,i.point=N,i.Bounds=F,i.bounds=q,i.Transformation=ot,i.transformation=mt,i.Projection=Om,i.LatLng=J,i.latLng=ie,i.LatLngBounds=ne,i.latLngBounds=ee,i.CRS=xe,i.GeoJSON=Ut,i.geoJSON=Bc,i.geoJson=Wm,i.Layer=gt,i.LayerGroup=ai,i.layerGroup=jm,i.FeatureGroup=li,i.featureGroup=Am,i.ImageOverlay=wo,i.imageOverlay=Hm,i.VideoOverlay=Dc,i.videoOverlay=Vm,i.SVGOverlay=Zc,i.svgOverlay=bm,i.DivOverlay=$t,i.Popup=fi,i.popup=Gm,i.Tooltip=di,i.tooltip=Km,i.Icon=ui,i.icon=Bm,i.DivIcon=Fc,i.divIcon=Ym,i.Marker=mo,i.marker=Dm,i.TileLayer=pi,i.tileLayer=Uc,i.GridLayer=or,i.gridLayer=Qm,i.SVG=ar,i.svg=Vc,i.Renderer=Ot,i.Canvas=Wc,i.canvas=Hc,i.Path=sn,i.CircleMarker=_o,i.circleMarker=Zm,i.Circle=ka,i.circle=Fm,i.Polyline=Ft,i.polyline=Um,i.Polygon=ci,i.polygon=$m,i.Rectangle=bc,i.rectangle=Jm,i.Map=se,i.map=wm;var e_=window.L;i.noConflict=function(){return window.L=e_,this},window.L=i})})(Jl,Jl.exports);var Ui=Jl.exports;function by(e,t){const[i,o]=Z.useState(null),a=Z.useRef(!1);return Z.useEffect(()=>{if(e.current!==null&&!a.current){const l=new Ui.Map(e.current,{center:{lat:t.location.latitude,lng:t.location.longitude},zoom:12}),c=new Ui.TileLayer("https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png",{attribution:'© OpenStreetMap contributors © CARTO'});l.addLayer(c),o(l),a.current=!0}},[e,t]),i}const Gy=new Ui.Icon({iconUrl:$g,iconSize:[40,40],iconAnchor:[20,40]}),Ky=new Ui.Icon({iconUrl:Wg,iconSize:[40,40],iconAnchor:[20,40]});function Yp({container:e,city:t,offers:i,activeOffer:o}){const a=Z.useRef(null),l=by(a,t);return Z.useEffect(()=>{if(l){const c=Ui.layerGroup().addTo(l);return i.forEach(f=>{new Ui.Marker({lat:f.location.latitude,lng:f.location.longitude}).setIcon(o!=null&&f.id===o.id?Ky:Gy).addTo(c)}),l.flyTo([t.location.latitude,t.location.longitude],12),()=>{l.removeLayer(c)}}},[t,l,i,o]),_.jsx("section",{ref:a,className:`${e}__map map`})}function Yy({offers:e,offersCount:t,title:i="Main"}){qr(i);const[o,a]=Z.useState(null),l=zn(),[c,f]=Z.useState(l.pathname.split("/").pop());Z.useEffect(()=>{f(l.pathname.split("/").pop())},[l]);const d=Vi.find(m=>m.slug===c);return _.jsxs("div",{className:"page page--gray page--main",children:[_.jsx(Hs,{}),_.jsxs("main",{className:"page__main page__main--index",children:[_.jsx("h1",{className:"visually-hidden",children:"Cities"}),_.jsx("div",{className:"tabs",children:_.jsx("section",{className:"locations container",children:_.jsx("ul",{className:"locations__list tabs__list",children:_.jsx(Hy,{})})})}),_.jsx("div",{className:"cities",children:_.jsxs("div",{className:"cities__places-container container",children:[_.jsxs("section",{className:"cities__places places",children:[_.jsxs("span",{children:["Now active offer id: ",o==null?void 0:o.id]}),_.jsx("h2",{className:"visually-hidden",children:"Places"}),_.jsxs("b",{className:"places__found",children:[t," places to stay in Amsterdam"]}),_.jsxs("form",{className:"places__sorting",action:"#",method:"get",children:[_.jsx("span",{className:"places__sorting-caption",children:"Sort by"}),_.jsxs("span",{className:"places__sorting-type",tabIndex:0,children:["Popular",_.jsx("svg",{className:"places__sorting-arrow",width:"7",height:"4",children:_.jsx("use",{xlinkHref:"#icon-arrow-select"})})]}),_.jsxs("ul",{className:"places__options places__options--custom places__options--opened",children:[_.jsx("li",{className:"places__option places__option--active",tabIndex:0,children:"Popular"}),_.jsx("li",{className:"places__option",tabIndex:0,children:"Price: low to high"}),_.jsx("li",{className:"places__option",tabIndex:0,children:"Price: high to low"}),_.jsx("li",{className:"places__option",tabIndex:0,children:"Top rated first"})]})]}),_.jsx("div",{className:"cities__places-list places__list tabs__content",children:e.map(m=>_.jsx(rc,{hoverHandler:()=>a(m||null),componentType:"cities",offer:m},m.id))})]}),_.jsx("div",{className:"cities__right-section",children:d&&_.jsx(Yp,{container:"cities",city:d,offers:e,activeOffer:o})})]})})]})]})}const Qy="_container_e270g_1",Xy={container:Qy};function eu({title:e="404"}){return qr(e),_.jsxs("div",{className:"page page--gray",children:[_.jsx("header",{className:"header",children:_.jsx("div",{className:"container",children:_.jsx("div",{className:"header__wrapper",children:_.jsx("div",{className:"header__left",children:_.jsx(oc,{})})})})}),_.jsxs("main",{className:Xy.container,children:[_.jsxs("h1",{children:["Ошибка 404. ",_.jsx("br",{}),"Страница не найдена 😕"]}),_.jsxs(Cn,{to:"/",className:"locations__item-link",children:[" ","<- Вернуться на главную страницу"]})]})]})}function Qp(){return _.jsx("footer",{className:"footer container",children:_.jsx(Cn,{className:"footer__logo-link",to:Ke.Root,children:_.jsx("img",{className:"footer__logo",src:"img/logo.svg",alt:"6 cities logo",width:"64",height:"33"})})})}function qy(){return _.jsxs("div",{className:"page page--favorites-empty",children:[_.jsx(Hs,{}),_.jsx("main",{className:"page__main page__main--favorites page__main--favorites-empty",children:_.jsx("div",{className:"page__favorites-container container",children:_.jsxs("section",{className:"favorites favorites--empty",children:[_.jsx("h1",{className:"visually-hidden",children:"Favorites (empty)"}),_.jsxs("div",{className:"favorites__status-wrapper",children:[_.jsx("b",{className:"favorites__status",children:"Nothing yet saved."}),_.jsx("p",{className:"favorites__status-description",children:"Save properties to narrow down search or plan your future trips."})]})]})})}),_.jsx(Qp,{})]})}function Jy({title:e="Favorites",offersFavorites:t}){return qr(e),t.length?_.jsxs("div",{className:"page",children:[_.jsx(Hs,{}),_.jsx("main",{className:"page__main page__main--favorites",children:_.jsx("div",{className:"page__favorites-container container",children:_.jsxs("section",{className:"favorites",children:[_.jsx("h1",{className:"favorites__title",children:"Saved listing"}),_.jsx("ul",{className:"favorites__list",children:_.jsxs("li",{className:"favorites__locations-items",children:[_.jsx("div",{className:"favorites__locations locations locations--current",children:_.jsx("div",{className:"locations__item",children:_.jsx(Cn,{className:"locations__item-link",to:`${Ke.Root}`,children:_.jsx("span",{children:"Amsterdam"})})})}),_.jsx("div",{className:"favorites__places",children:t.map(i=>_.jsx(rc,{componentType:"favorites",offer:i},i.id))})]})})]})})}),_.jsx(Qp,{})]}):_.jsx(qy,{})}const Xp=[{id:"655253b6-082c-4276-a0e2-15464a0c9d30",title:"Amazing and Extremely Central Flat",type:"apartment",price:307,previewImage:"https://15.design.htmlacademy.pro/static/hotel/8.jpg",city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3909553943508,longitude:4.85309666406198,zoom:16},isFavorite:!0,isPremium:!0,rating:2},{id:"c5bc3b98-c10a-45e7-b617-93d69ab16712",title:"The Pondhouse - A Magical Place",type:"house",price:528,previewImage:"https://15.design.htmlacademy.pro/static/hotel/4.jpg",city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3609553943508,longitude:4.85309666406198,zoom:16},isFavorite:!1,isPremium:!0,rating:1.1},{id:"31abd117-5027-4adb-8b89-388d1d4a9650",title:"Perfectly located Castro",type:"house",price:923,previewImage:"https://15.design.htmlacademy.pro/static/hotel/7.jpg",city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3909553943508,longitude:4.929309666406198,zoom:16},isFavorite:!1,isPremium:!0,rating:2.3},{id:"0afa3f92-633b-4049-9199-cdd249a9a2f6",title:"Amazing and Extremely Central Flat",type:"apartment",price:123,previewImage:"https://15.design.htmlacademy.pro/static/hotel/19.jpg",city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3809553943508,longitude:4.939309666406198,zoom:16},isFavorite:!1,isPremium:!1,rating:2.8}],e0=[{id:"655253b6-082c-4276-a0e2-15464a0c9d30",title:"Amazing and Extremely Central Flat",description:"I am happy to welcome you to my apartment in the city center! Three words: location, cosy and chic!",type:"apartment",price:307,images:["https://15.design.htmlacademy.pro/static/hotel/20.jpg","https://15.design.htmlacademy.pro/static/hotel/13.jpg","https://15.design.htmlacademy.pro/static/hotel/3.jpg","https://15.design.htmlacademy.pro/static/hotel/8.jpg","https://15.design.htmlacademy.pro/static/hotel/4.jpg","https://15.design.htmlacademy.pro/static/hotel/19.jpg"],city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3909553943508,longitude:4.85309666406198,zoom:16},goods:["Washing machine","Breakfast","Baby seat","Coffee machine","Air conditioning"],host:{isPro:!0,name:"Angelina",avatarUrl:"https://15.design.htmlacademy.pro/static/host/avatar-angelina.jpg"},isPremium:!0,isFavorite:!1,rating:2,bedrooms:1,maxAdults:1},{id:"c5bc3b98-c10a-45e7-b617-93d69ab16712",title:"The Pondhouse - A Magical Place",description:"I am happy to welcome you to my apartment in the city center! Three words: location, cosy and chic!",type:"house",price:528,images:["https://15.design.htmlacademy.pro/static/hotel/4.jpg","https://15.design.htmlacademy.pro/static/hotel/14.jpg","https://15.design.htmlacademy.pro/static/hotel/12.jpg","https://15.design.htmlacademy.pro/static/hotel/16.jpg","https://15.design.htmlacademy.pro/static/hotel/6.jpg","https://15.design.htmlacademy.pro/static/hotel/5.jpg"],city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3609553943508,longitude:4.85309666406198,zoom:16},goods:["Fridge","Baby seat","Dishwasher","Wi-Fi","Kitchen","Breakfast","Towels","Coffee machine","Washer"],host:{isPro:!0,name:"Angelina",avatarUrl:"https://15.design.htmlacademy.pro/static/host/avatar-angelina.jpg"},isPremium:!0,isFavorite:!1,rating:1.1,bedrooms:2,maxAdults:3},{id:"31abd117-5027-4adb-8b89-388d1d4a9650",title:"Perfectly located Castro",description:"A new spacious villa, one floor. All commodities, jacuzzi and beautiful scenery. Ideal for families or friends.",type:"house",price:923,images:["https://15.design.htmlacademy.pro/static/hotel/15.jpg","https://15.design.htmlacademy.pro/static/hotel/7.jpg","https://15.design.htmlacademy.pro/static/hotel/18.jpg","https://15.design.htmlacademy.pro/static/hotel/4.jpg","https://15.design.htmlacademy.pro/static/hotel/1.jpg","https://15.design.htmlacademy.pro/static/hotel/10.jpg"],city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3909553943508,longitude:4.929309666406198,zoom:16},goods:["Baby seat","Fridge","Washer","Dishwasher","Laptop friendly workspace","Air conditioning","Breakfast","Wi-Fi","Cable TV","Kitchen","Coffee machine","Washing machine","Towels"],host:{isPro:!0,name:"Angelina",avatarUrl:"https://15.design.htmlacademy.pro/static/host/avatar-angelina.jpg"},isPremium:!0,isFavorite:!1,rating:2.3,bedrooms:5,maxAdults:5},{id:"0afa3f92-633b-4049-9199-cdd249a9a2f6",title:"Amazing and Extremely Central Flat",description:"Design interior in most sympathetic area! Complitely renovated, well-equipped, cosy studio in idyllic, over 100 years old wooden house. Calm street, fast connection to center and airport.",type:"apartment",price:123,images:["https://15.design.htmlacademy.pro/static/hotel/2.jpg","https://15.design.htmlacademy.pro/static/hotel/1.jpg","https://15.design.htmlacademy.pro/static/hotel/20.jpg","https://15.design.htmlacademy.pro/static/hotel/5.jpg","https://15.design.htmlacademy.pro/static/hotel/15.jpg","https://15.design.htmlacademy.pro/static/hotel/18.jpg"],city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3809553943508,longitude:4.939309666406198,zoom:16},goods:["Wi-Fi","Heating","Cable TV","Baby seat","Kitchen","Fridge","Washing machine","Dishwasher"],host:{isPro:!0,name:"Angelina",avatarUrl:"https://15.design.htmlacademy.pro/static/host/avatar-angelina.jpg"},isPremium:!1,isFavorite:!1,rating:2.8,bedrooms:3,maxAdults:3}],qp=()=>Xp,t0=()=>Xp.filter(e=>e.isFavorite),n0=e=>e0.find(t=>t.id===e),i0=[{offerId:"655253b6-082c-4276-a0e2-15464a0c9d30",id:"3893572c-8c1d-48c8-9933-b3d0e7b1e1a2",comment:"This villa is perfect in every way: the view on mountains and waterfalls, the hot tub and the villa itself. The evening here became a great continuation of our journeys over country.",date:"2024-02-09T21:00:00.379Z",rating:5,user:{name:"Mollie",avatarUrl:"https://15.design.htmlacademy.pro/static/avatar/4.jpg",isPro:!1}},{offerId:"c5bc3b98-c10a-45e7-b617-93d69ab16712",id:"a6d4afc6-a8a2-441b-b300-3d20059671c5",comment:"Bathed in the nature. Completely unplugged. Unforgettable.",date:"2024-02-10T21:00:00.379Z",rating:4,user:{name:"Max",avatarUrl:"https://15.design.htmlacademy.pro/static/avatar/1.jpg",isPro:!0}},{offerId:"c5bc3b98-c10a-45e7-b617-93d69ab16712",id:"efc128ed-48cd-4fe3-a804-34cf2833c241",comment:"We loved it so much, the house, the veiw, the location just great.. Highly reccomend :)",date:"2024-02-07T21:00:00.379Z",rating:5,user:{name:"Inna",avatarUrl:"https://15.design.htmlacademy.pro/static/avatar/6.jpg",isPro:!1}},{offerId:"0afa3f92-633b-4049-9199-cdd249a9a2f6",id:"b67ddfd5-b953-4a30-8c8d-bd083cd6b62a",comment:"A quiet cozy and picturesque that hides behind a a river by the unique lightness of Amsterdam.",date:"2019-05-08T14:13:56.569Z",rating:4,user:{name:"Oliver Conner",avatarUrl:"https://15.design.htmlacademy.pro/static/avatar/3.jpg",isPro:!1}}],r0=e=>{const t=i0.filter(i=>i.offerId===e);return t.length?t:[]};function o0({host:e,description:t}){const{name:i,avatarUrl:o,isPro:a}=e;return _.jsxs("div",{className:"offer__host",children:[_.jsx("h2",{className:"offer__host-title",children:"Meet the host"}),_.jsxs("div",{className:"offer__host-user user",children:[_.jsx("div",{className:nc("offer__avatar-wrapper user__avatar-wrapper",a&&"offer__avatar-wrapper--pro"),children:_.jsx("img",{className:"offer__avatar user__avatar",src:o,width:"74",height:"74",alt:"Host avatar"})}),_.jsx("span",{className:"offer__user-name",children:i}),a&&_.jsx("span",{className:"offer__user-status",children:"Pro"})]}),_.jsx("div",{className:"offer__description",children:_.jsx("p",{className:"offer__text",children:t})})]})}var Jp={exports:{}};(function(e,t){(function(i,o){e.exports=o()})(Pf,function(){var i=1e3,o=6e4,a=36e5,l="millisecond",c="second",f="minute",d="hour",m="day",S="week",x="month",T="quarter",z="year",M="date",E="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Q){var $=["th","st","nd","rd"],j=Q%100;return"["+Q+($[(j-20)%10]||$[j]||$[0])+"]"}},w=function(Q,$,j){var V=String(Q);return!V||V.length>=$?Q:""+Array($+1-V.length).join(j)+Q},O={s:w,z:function(Q){var $=-Q.utcOffset(),j=Math.abs($),V=Math.floor(j/60),P=j%60;return($<=0?"+":"-")+w(V,2,"0")+":"+w(P,2,"0")},m:function Q($,j){if($.date()1)return Q(N[0])}else{var F=$.name;A[F]=$,P=F}return!V&&P&&(B=P),P||!V&&B},K=function(Q,$){if(G(Q))return Q.clone();var j=typeof $=="object"?$:{};return j.date=Q,j.args=arguments,new de(j)},Y=O;Y.l=ce,Y.i=G,Y.w=function(Q,$){return K(Q,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var de=function(){function Q(j){this.$L=ce(j.locale,null,!0),this.parse(j),this.$x=this.$x||j.x||{},this[H]=!0}var $=Q.prototype;return $.parse=function(j){this.$d=function(V){var P=V.date,D=V.utc;if(P===null)return new Date(NaN);if(Y.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var N=P.match(b);if(N){var F=N[2]-1||0,q=(N[7]||"0").substring(0,3);return D?new Date(Date.UTC(N[1],F,N[3]||1,N[4]||0,N[5]||0,N[6]||0,q)):new Date(N[1],F,N[3]||1,N[4]||0,N[5]||0,N[6]||0,q)}}return new Date(P)}(j),this.init()},$.init=function(){var j=this.$d;this.$y=j.getFullYear(),this.$M=j.getMonth(),this.$D=j.getDate(),this.$W=j.getDay(),this.$H=j.getHours(),this.$m=j.getMinutes(),this.$s=j.getSeconds(),this.$ms=j.getMilliseconds()},$.$utils=function(){return Y},$.isValid=function(){return this.$d.toString()!==E},$.isSame=function(j,V){var P=K(j);return this.startOf(V)<=P&&P<=this.endOf(V)},$.isAfter=function(j,V){return K(j)i(t),htmlFor:`${t}-stars`,className:"reviews__rating-label form__rating-label",title:e,children:_.jsx("svg",{className:"form__star-image",width:"37",height:"33",children:_.jsx("use",{xlinkHref:"#icon-star"})})})]})}function u0(){const[e,t]=Z.useState(0),[i,o]=Z.useState(""),a=l=>{l.preventDefault()};return _.jsxs("form",{onSubmit:l=>a(l),className:"reviews__form form",action:"#",method:"post",children:[_.jsx("label",{className:"reviews__label form__label",htmlFor:"review",children:"Your review"}),_.jsx("div",{className:"reviews__rating-form form__rating",children:Object.entries(jg).map(([l,c])=>_.jsx(l0,{onClickHandle:t,starTitle:l,starValue:c},l))}),_.jsx("textarea",{onChange:l=>o(l.target.value),className:"reviews__textarea form__textarea",id:"review",name:"review",placeholder:"Tell how was your stay, what you like and what can be improved"}),_.jsxs("div",{className:"reviews__button-wrapper",children:[_.jsxs("p",{className:"reviews__help",children:["To submit review please make sure to set ",_.jsx("span",{className:"reviews__star",children:"rating"})," and describe your stay with at least ",_.jsx("b",{className:"reviews__text-amount",children:"50 characters"}),"."]}),_.jsx("button",{className:"reviews__submit form__submit button",type:"submit",disabled:i.lengthA.name===v.name),B=qp().filter(A=>A.id!==w);return _.jsxs("div",{className:"page",children:[_.jsx(Hs,{}),_.jsxs("main",{className:"page__main page__main--offer",children:[_.jsxs("section",{className:"offer",children:[_.jsx("div",{className:"offer__gallery-container container",children:_.jsx("div",{className:"offer__gallery",children:f.map(A=>_.jsx("div",{className:"offer__image-wrapper",children:_.jsx("img",{className:"offer__image",src:A,alt:"Photo studio"})},A))})}),_.jsx("div",{className:"offer__container container",children:_.jsxs("div",{className:"offer__wrapper",children:[d&&_.jsx("div",{className:"offer__mark",children:_.jsx("span",{children:"Premium"})}),_.jsxs("div",{className:"offer__name-wrapper",children:[_.jsx("h1",{className:"offer__name",children:l.title}),_.jsx(Kp,{componentType:"offer",isFavorite:m})]}),_.jsx(ic,{componentType:"offer",rating:S}),_.jsxs("ul",{className:"offer__features",children:[_.jsx("li",{className:"offer__feature offer__feature--entire",children:Wy(x)}),_.jsxs("li",{className:"offer__feature offer__feature--bedrooms",children:[T," Bedrooms"]}),_.jsxs("li",{className:"offer__feature offer__feature--adults",children:["Max ",z," adults"]})]}),_.jsxs("div",{className:"offer__price",children:[_.jsxs("b",{className:"offer__price-value",children:["€",M]}),_.jsx("span",{className:"offer__price-text",children:" night"})]}),_.jsxs("div",{className:"offer__inside",children:[_.jsx("h2",{className:"offer__inside-title",children:"What's inside"}),_.jsx("ul",{className:"offer__inside-list",children:E.map(A=>_.jsx("li",{className:"offer__inside-item",children:A},A))})]}),_.jsx(o0,{host:b,description:y}),_.jsxs("section",{className:"offer__reviews reviews",children:[_.jsxs("h2",{className:"reviews__title",children:["Reviews · ",_.jsx("span",{className:"reviews__amount",children:c.length})]}),_.jsx("ul",{className:"reviews__list",children:c.length>0&&c.map(A=>_.jsx(a0,{review:A},A.id))}),t===Vn.Auth&&_.jsx(u0,{})]})]})}),O&&_.jsx(Yp,{container:"offer",city:O,offers:B,activeOffer:o})]}),_.jsx("div",{className:"container",children:_.jsxs("section",{className:"near-places places",children:[_.jsx("h2",{className:"near-places__title",children:"Other places in the neighbourhood"}),_.jsx("div",{className:"near-places__list places__list",children:B.map(A=>_.jsx(rc,{offer:A,componentType:"near-places",hoverHandler:()=>a(A)},A.id))})]})})]})]})}function h0({authorizationStatus:e,children:t}){return e===Vn.Auth?t:_.jsx(tc,{to:Ke.Login})}function f0({title:e="Login"}){return qr(e),_.jsxs("div",{className:"page page--gray page--login",children:[_.jsx("header",{className:"header",children:_.jsx("div",{className:"container",children:_.jsx("div",{className:"header__wrapper",children:_.jsx("div",{className:"header__left",children:_.jsx(oc,{})})})})}),_.jsx("main",{className:"page__main page__main--login",children:_.jsxs("div",{className:"page__login-container container",children:[_.jsxs("section",{className:"login",children:[_.jsx("h1",{className:"login__title",children:"Sign in"}),_.jsxs("form",{className:"login__form form",action:"#",method:"post",children:[_.jsxs("div",{className:"login__input-wrapper form__input-wrapper",children:[_.jsx("label",{className:"visually-hidden",children:"E-mail"}),_.jsx("input",{className:"login__input form__input",type:"email",name:"email",placeholder:"Email",required:!0})]}),_.jsxs("div",{className:"login__input-wrapper form__input-wrapper",children:[_.jsx("label",{className:"visually-hidden",children:"Password"}),_.jsx("input",{className:"login__input form__input",type:"password",name:"password",placeholder:"Password",required:!0})]}),_.jsx("button",{className:"login__submit form__submit button",type:"submit",children:"Sign in"})]})]}),_.jsx("section",{className:"locations locations--login locations--current",children:_.jsx("div",{className:"locations__item",children:_.jsx("a",{className:"locations__item-link",href:"#",children:_.jsx("span",{children:"Amsterdam"})})})})]})})]})}function d0({authorizationStatus:e,children:t}){return e===Vn.NoAuth?t:_.jsx(tc,{to:Ke.Root})}function p0({offersCount:e,offers:t,offersFavorites:i}){return _.jsx(By,{children:_.jsxs(zy,{children:[_.jsx(Zn,{path:Ke.Root,element:_.jsx(tc,{to:Zg})}),Vi.map(o=>_.jsx(Zn,{path:Ke.Root+o.slug,element:_.jsx(Yy,{offers:t,offersCount:e})},o.slug)),_.jsx(Zn,{path:Ke.Login,element:_.jsx(d0,{authorizationStatus:Vn.Auth,children:_.jsx(f0,{})})}),_.jsx(Zn,{path:Ke.Favorites,element:_.jsx(h0,{authorizationStatus:Vn.Auth,children:_.jsx(Jy,{offersFavorites:i})})}),_.jsx(Zn,{path:`${Ke.Offer}/:offerId`,element:_.jsx(c0,{userAuth:Vn.Auth})}),_.jsx(Zn,{path:"/*",element:_.jsx(eu,{})})]})})}const m0=qp(),_0=t0(),v0=rl.createRoot(document.getElementById("root"));v0.render(_.jsx(If.StrictMode,{children:_.jsx(p0,{offers:m0,offersFavorites:_0,offersCount:Dg})})); + */(function(e,t){(function(i,o){o(t)})(Pf,function(i){var o="1.7.1";function a(n){var r,s,u,h;for(s=1,u=arguments.length;s"u"||!L||!L.Mixin)){n=w(n)?n:[n];for(var r=0;r0?Math.floor(n):Math.ceil(n)};P.prototype={clone:function(){return new P(this.x,this.y)},add:function(n){return this.clone()._add(N(n))},_add:function(n){return this.x+=n.x,this.y+=n.y,this},subtract:function(n){return this.clone()._subtract(N(n))},_subtract:function(n){return this.x-=n.x,this.y-=n.y,this},divideBy:function(n){return this.clone()._divideBy(n)},_divideBy:function(n){return this.x/=n,this.y/=n,this},multiplyBy:function(n){return this.clone()._multiplyBy(n)},_multiplyBy:function(n){return this.x*=n,this.y*=n,this},scaleBy:function(n){return new P(this.x*n.x,this.y*n.y)},unscaleBy:function(n){return new P(this.x/n.x,this.y/n.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=D(this.x),this.y=D(this.y),this},distanceTo:function(n){n=N(n);var r=n.x-this.x,s=n.y-this.y;return Math.sqrt(r*r+s*s)},equals:function(n){return n=N(n),n.x===this.x&&n.y===this.y},contains:function(n){return n=N(n),Math.abs(n.x)<=Math.abs(this.x)&&Math.abs(n.y)<=Math.abs(this.y)},toString:function(){return"Point("+T(this.x)+", "+T(this.y)+")"}};function N(n,r,s){return n instanceof P?n:w(n)?new P(n[0],n[1]):n==null?n:typeof n=="object"&&"x"in n&&"y"in n?new P(n.x,n.y):new P(n,r,s)}function F(n,r){if(n)for(var s=r?[n,r]:n,u=0,h=s.length;u=this.min.x&&s.x<=this.max.x&&r.y>=this.min.y&&s.y<=this.max.y},intersects:function(n){n=q(n);var r=this.min,s=this.max,u=n.min,h=n.max,p=h.x>=r.x&&u.x<=s.x,g=h.y>=r.y&&u.y<=s.y;return p&&g},overlaps:function(n){n=q(n);var r=this.min,s=this.max,u=n.min,h=n.max,p=h.x>r.x&&u.xr.y&&u.y=r.lat&&h.lat<=s.lat&&u.lng>=r.lng&&h.lng<=s.lng},intersects:function(n){n=ee(n);var r=this._southWest,s=this._northEast,u=n.getSouthWest(),h=n.getNorthEast(),p=h.lat>=r.lat&&u.lat<=s.lat,g=h.lng>=r.lng&&u.lng<=s.lng;return p&&g},overlaps:function(n){n=ee(n);var r=this._southWest,s=this._northEast,u=n.getSouthWest(),h=n.getNorthEast(),p=h.lat>r.lat&&u.latr.lng&&u.lng1,ni=function(){var n=!1;try{var r=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("testPassiveEventSupport",x,r),window.removeEventListener("testPassiveEventSupport",x,r)}catch{}return n}(),pc=function(){return!!document.createElement("canvas").getContext}(),no=!!(document.createElementNS&&sc("svg").createSVGRect),io=!no&&function(){try{var n=document.createElement("div");n.innerHTML='';var r=n.firstChild;return r.style.behavior="url(#default#VML)",r&&typeof r.adj=="object"}catch{return!1}}();function Mt(n){return navigator.userAgent.toLowerCase().indexOf(n)>=0}var sm={ie:Jr,ielt9:ei,edge:eo,webkit:bs,android:Ki,android23:Yi,androidStock:lc,opera:Gs,chrome:Ks,gecko:Ys,safari:to,phantom:uc,opera12:cc,win:hc,ie3d:Qs,webkit3d:Xs,gecko3d:fc,any3d:st,mobile:ti,mobileWebkit:im,mobileWebkit3d:rm,msPointer:nn,pointer:Et,touch:Nt,mobileOpera:dc,mobileGecko:om,retina:rn,passiveEvents:ni,canvas:pc,svg:no,vml:io},qs=nn?"MSPointerDown":"pointerdown",Js=nn?"MSPointerMove":"pointermove",ea=nn?"MSPointerUp":"pointerup",ta=nn?"MSPointerCancel":"pointercancel",ii={},mc=!1;function am(n,r,s,u){return r==="touchstart"?um(n,s,u):r==="touchmove"?fm(n,s,u):r==="touchend"&&dm(n,s,u),this}function lm(n,r,s){var u=n["_leaflet_"+r+s];return r==="touchstart"?n.removeEventListener(qs,u,!1):r==="touchmove"?n.removeEventListener(Js,u,!1):r==="touchend"&&(n.removeEventListener(ea,u,!1),n.removeEventListener(ta,u,!1)),this}function um(n,r,s){var u=c(function(h){h.MSPOINTER_TYPE_TOUCH&&h.pointerType===h.MSPOINTER_TYPE_TOUCH&<(h),na(h,r)});n["_leaflet_touchstart"+s]=u,n.addEventListener(qs,u,!1),mc||(document.addEventListener(qs,cm,!0),document.addEventListener(Js,hm,!0),document.addEventListener(ea,_c,!0),document.addEventListener(ta,_c,!0),mc=!0)}function cm(n){ii[n.pointerId]=n}function hm(n){ii[n.pointerId]&&(ii[n.pointerId]=n)}function _c(n){delete ii[n.pointerId]}function na(n,r){n.touches=[];for(var s in ii)n.touches.push(ii[s]);n.changedTouches=[n],r(n)}function fm(n,r,s){var u=function(h){h.pointerType===(h.MSPOINTER_TYPE_MOUSE||"mouse")&&h.buttons===0||na(h,r)};n["_leaflet_touchmove"+s]=u,n.addEventListener(Js,u,!1)}function dm(n,r,s){var u=function(h){na(h,r)};n["_leaflet_touchend"+s]=u,n.addEventListener(ea,u,!1),n.addEventListener(ta,u,!1)}var ro=nn?"MSPointerDown":Et?"pointerdown":"touchstart",oo=nn?"MSPointerUp":Et?"pointerup":"touchend",ri="_leaflet_";function pm(n,r,s){var u,h,p=!1,g=250;function k(I){if(Et){if(!I.isPrimary||I.pointerType==="mouse")return}else if(I.touches.length>1)return;var U=Date.now(),X=U-(u||U);h=I.touches?I.touches[0]:I,p=X>0&&X<=g,u=U}function C(I){if(p&&!h.cancelBubble){if(Et){if(I.pointerType==="mouse")return;var U={},X,ue;for(ue in h)X=h[ue],U[ue]=X&&X.bind?X.bind(h):X;h=U}h.type="dblclick",h.button=0,r(h),u=null}}return n[ri+ro+s]=k,n[ri+oo+s]=C,n[ri+"dblclick"+s]=r,n.addEventListener(ro,k,ni?{passive:!1}:!1),n.addEventListener(oo,C,ni?{passive:!1}:!1),n.addEventListener("dblclick",r,!1),this}function mm(n,r){var s=n[ri+ro+r],u=n[ri+oo+r],h=n[ri+"dblclick"+r];return n.removeEventListener(ro,s,ni?{passive:!1}:!1),n.removeEventListener(oo,u,ni?{passive:!1}:!1),n.removeEventListener("dblclick",h,!1),this}var ia=lo(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Qi=lo(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),vc=Qi==="webkitTransition"||Qi==="OTransition"?Qi+"End":"transitionend";function gc(n){return typeof n=="string"?document.getElementById(n):n}function Xi(n,r){var s=n.style[r]||n.currentStyle&&n.currentStyle[r];if((!s||s==="auto")&&document.defaultView){var u=document.defaultView.getComputedStyle(n,null);s=u?u[r]:null}return s==="auto"?null:s}function le(n,r,s){var u=document.createElement(n);return u.className=r||"",s&&s.appendChild(u),u}function ve(n){var r=n.parentNode;r&&r.removeChild(n)}function so(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function oi(n){var r=n.parentNode;r&&r.lastChild!==n&&r.appendChild(n)}function si(n){var r=n.parentNode;r&&r.firstChild!==n&&r.insertBefore(n,r.firstChild)}function ra(n,r){if(n.classList!==void 0)return n.classList.contains(r);var s=ao(n);return s.length>0&&new RegExp("(^|\\s)"+r+"(\\s|$)").test(s)}function te(n,r){if(n.classList!==void 0)for(var s=M(r),u=0,h=s.length;uthis.options.maxZoom)?this.setZoom(n):this},panInsideBounds:function(n,r){this._enforcingBounds=!0;var s=this.getCenter(),u=this._limitCenter(s,this._zoom,ee(n));return s.equals(u)||this.panTo(u,r),this._enforcingBounds=!1,this},panInside:function(n,r){r=r||{};var s=N(r.paddingTopLeft||r.padding||[0,0]),u=N(r.paddingBottomRight||r.padding||[0,0]),h=this.getCenter(),p=this.project(h),g=this.project(n),k=this.getPixelBounds(),C=k.getSize().divideBy(2),I=q([k.min.add(s),k.max.subtract(u)]);if(!I.contains(g)){this._enforcingBounds=!0;var U=p.subtract(g),X=N(g.x+U.x,g.y+U.y);(g.xI.max.x)&&(X.x=p.x-U.x,U.x>0?X.x+=C.x-s.x:X.x-=C.x-u.x),(g.yI.max.y)&&(X.y=p.y-U.y,U.y>0?X.y+=C.y-s.y:X.y-=C.y-u.y),this.panTo(this.unproject(X),r),this._enforcingBounds=!1}return this},invalidateSize:function(n){if(!this._loaded)return this;n=a({animate:!1,pan:!0},n===!0?{animate:!0}:n);var r=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var s=this.getSize(),u=r.divideBy(2).round(),h=s.divideBy(2).round(),p=u.subtract(h);return!p.x&&!p.y?this:(n.animate&&n.pan?this.panBy(p):(n.pan&&this._rawPanBy(p),this.fire("move"),n.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(c(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:r,newSize:s}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(n){if(n=this._locateOptions=a({timeout:1e4,watch:!1},n),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var r=c(this._handleGeolocationResponse,this),s=c(this._handleGeolocationError,this);return n.watch?this._locationWatchId=navigator.geolocation.watchPosition(r,s,n):navigator.geolocation.getCurrentPosition(r,s,n),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(n){var r=n.code,s=n.message||(r===1?"permission denied":r===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:r,message:"Geolocation error: "+s+"."})},_handleGeolocationResponse:function(n){var r=n.coords.latitude,s=n.coords.longitude,u=new J(r,s),h=u.toBounds(n.coords.accuracy*2),p=this._locateOptions;if(p.setView){var g=this.getBoundsZoom(h);this.setView(u,p.maxZoom?Math.min(g,p.maxZoom):g)}var k={latlng:u,bounds:h,timestamp:n.timestamp};for(var C in n.coords)typeof n.coords[C]=="number"&&(k[C]=n.coords[C]);this.fire("locationfound",k)},addHandler:function(n,r){if(!r)return this;var s=this[n]=new r(this);return this._handlers.push(s),this.options[n]&&s.enable(),this},remove:function(){if(this._initEvents(!0),this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),ve(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(de(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var n;for(n in this._layers)this._layers[n].remove();for(n in this._panes)ve(this._panes[n]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(n,r){var s="leaflet-pane"+(n?" leaflet-"+n.replace("Pane","")+"-pane":""),u=le("div",s,r||this._mapPane);return n&&(this._panes[n]=u),u},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var n=this.getPixelBounds(),r=this.unproject(n.getBottomLeft()),s=this.unproject(n.getTopRight());return new ne(r,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(n,r,s){n=ee(n),s=N(s||[0,0]);var u=this.getZoom()||0,h=this.getMinZoom(),p=this.getMaxZoom(),g=n.getNorthWest(),k=n.getSouthEast(),C=this.getSize().subtract(s),I=q(this.project(k,u),this.project(g,u)).getSize(),U=st?this.options.zoomSnap:1,X=C.x/I.x,ue=C.y/I.y,Wt=r?Math.max(X,ue):Math.min(X,ue);return u=this.getScaleZoom(Wt,u),U&&(u=Math.round(u/(U/100))*(U/100),u=r?Math.ceil(u/U)*U:Math.floor(u/U)*U),Math.max(h,Math.min(p,u))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new P(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(n,r){var s=this._getTopLeftPoint(n,r);return new F(s,s.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(n){return this.options.crs.getProjectedBounds(n===void 0?this.getZoom():n)},getPane:function(n){return typeof n=="string"?this._panes[n]:n},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(n,r){var s=this.options.crs;return r=r===void 0?this._zoom:r,s.scale(n)/s.scale(r)},getScaleZoom:function(n,r){var s=this.options.crs;r=r===void 0?this._zoom:r;var u=s.zoom(n*s.scale(r));return isNaN(u)?1/0:u},project:function(n,r){return r=r===void 0?this._zoom:r,this.options.crs.latLngToPoint(ie(n),r)},unproject:function(n,r){return r=r===void 0?this._zoom:r,this.options.crs.pointToLatLng(N(n),r)},layerPointToLatLng:function(n){var r=N(n).add(this.getPixelOrigin());return this.unproject(r)},latLngToLayerPoint:function(n){var r=this.project(ie(n))._round();return r._subtract(this.getPixelOrigin())},wrapLatLng:function(n){return this.options.crs.wrapLatLng(ie(n))},wrapLatLngBounds:function(n){return this.options.crs.wrapLatLngBounds(ee(n))},distance:function(n,r){return this.options.crs.distance(ie(n),ie(r))},containerPointToLayerPoint:function(n){return N(n).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(n){return N(n).add(this._getMapPanePos())},containerPointToLatLng:function(n){var r=this.containerPointToLayerPoint(N(n));return this.layerPointToLatLng(r)},latLngToContainerPoint:function(n){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ie(n)))},mouseEventToContainerPoint:function(n){return xc(n,this._container)},mouseEventToLayerPoint:function(n){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(n))},mouseEventToLatLng:function(n){return this.layerPointToLatLng(this.mouseEventToLayerPoint(n))},_initContainer:function(n){var r=this._container=gc(n);if(r){if(r._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");re(r,"scroll",this._onScroll,this),this._containerId=d(r)},_initLayout:function(){var n=this._container;this._fadeAnimated=this.options.fadeAnimation&&st,te(n,"leaflet-container"+(Nt?" leaflet-touch":"")+(rn?" leaflet-retina":"")+(ei?" leaflet-oldie":"")+(to?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var r=Xi(n,"position");r!=="absolute"&&r!=="relative"&&r!=="fixed"&&(n.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var n=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ce(this._mapPane,new P(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(te(n.markerPane,"leaflet-zoom-hide"),te(n.shadowPane,"leaflet-zoom-hide"))},_resetView:function(n,r){Ce(this._mapPane,new P(0,0));var s=!this._loaded;this._loaded=!0,r=this._limitZoom(r),this.fire("viewprereset");var u=this._zoom!==r;this._moveStart(u,!1)._move(n,r)._moveEnd(u),this.fire("viewreset"),s&&this.fire("load")},_moveStart:function(n,r){return n&&this.fire("zoomstart"),r||this.fire("movestart"),this},_move:function(n,r,s){r===void 0&&(r=this._zoom);var u=this._zoom!==r;return this._zoom=r,this._lastCenter=n,this._pixelOrigin=this._getNewPixelOrigin(n),(u||s&&s.pinch)&&this.fire("zoom",s),this.fire("move",s)},_moveEnd:function(n){return n&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return de(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(n){Ce(this._mapPane,this._getMapPanePos().subtract(n))},_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(n){this._targets={},this._targets[d(this._container)]=this;var r=n?ke:re;r(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&r(window,"resize",this._onResize,this),st&&this.options.transform3DLimit&&(n?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){de(this._resizeRequest),this._resizeRequest=Y(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var n=this._getMapPanePos();Math.max(Math.abs(n.x),Math.abs(n.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(n,r){for(var s=[],u,h=r==="mouseout"||r==="mouseover",p=n.target||n.srcElement,g=!1;p;){if(u=this._targets[d(p)],u&&(r==="click"||r==="preclick")&&!n._simulated&&this._draggableMoved(u)){g=!0;break}if(u&&u.listens(r,!0)&&(h&&!fo(p,n)||(s.push(u),h))||p===this._container)break;p=p.parentNode}return!s.length&&!g&&!h&&fo(p,n)&&(s=[this]),s},_handleDOMEvent:function(n){if(!(!this._loaded||va(n))){var r=n.type;(r==="mousedown"||r==="keypress"||r==="keyup"||r==="keydown")&&ca(n.target||n.srcElement),this._fireDOMEvent(n,r)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(n,r,s){if(n.type==="click"){var u=a({},n);u.type="preclick",this._fireDOMEvent(u,u.type,s)}if(!n._stopped&&(s=(s||[]).concat(this._findEventTargets(n,r)),!!s.length)){var h=s[0];r==="contextmenu"&&h.listens(r,!0)&<(n);var p={originalEvent:n};if(n.type!=="keypress"&&n.type!=="keydown"&&n.type!=="keyup"){var g=h.getLatLng&&(!h._radius||h._radius<=10);p.containerPoint=g?this.latLngToContainerPoint(h.getLatLng()):this.mouseEventToContainerPoint(n),p.layerPoint=this.containerPointToLayerPoint(p.containerPoint),p.latlng=g?h.getLatLng():this.layerPointToLatLng(p.layerPoint)}for(var k=0;k0?Math.round(n-r)/2:Math.max(0,Math.ceil(n))-Math.max(0,Math.floor(r))},_limitZoom:function(n){var r=this.getMinZoom(),s=this.getMaxZoom(),u=st?this.options.zoomSnap:1;return u&&(n=Math.round(n/u)*u),Math.max(r,Math.min(s,n))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Pe(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(n,r){var s=this._getCenterOffset(n)._trunc();return(r&&r.animate)!==!0&&!this.getSize().contains(s)?!1:(this.panBy(s,r),!0)},_createAnimProxy:function(){var n=this._proxy=le("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(n),this.on("zoomanim",function(r){var s=ia,u=this._proxy.style[s];On(this._proxy,this.project(r.center,r.zoom),this.getZoomScale(r.zoom,1)),u===this._proxy.style[s]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ve(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var n=this.getCenter(),r=this.getZoom();On(this._proxy,this.project(n,r),this.getZoomScale(r,1))},_catchTransitionEnd:function(n){this._animatingZoom&&n.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(n,r,s){if(this._animatingZoom)return!0;if(s=s||{},!this._zoomAnimated||s.animate===!1||this._nothingToAnimate()||Math.abs(r-this._zoom)>this.options.zoomAnimationThreshold)return!1;var u=this.getZoomScale(r),h=this._getCenterOffset(n)._divideBy(1-1/u);return s.animate!==!0&&!this.getSize().contains(h)?!1:(Y(function(){this._moveStart(!0,!1)._animateZoom(n,r,!0)},this),!0)},_animateZoom:function(n,r,s,u){this._mapPane&&(s&&(this._animatingZoom=!0,this._animateToCenter=n,this._animateToZoom=r,te(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:n,zoom:r,noUpdate:u}),setTimeout(c(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Pe(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),Y(function(){this._moveEnd(!0)},this))}});function wm(n,r){return new se(n,r)}var vt=Q.extend({options:{position:"topright"},initialize:function(n){E(this,n)},getPosition:function(){return this.options.position},setPosition:function(n){var r=this._map;return r&&r.removeControl(this),this.options.position=n,r&&r.addControl(this),this},getContainer:function(){return this._container},addTo:function(n){this.remove(),this._map=n;var r=this._container=this.onAdd(n),s=this.getPosition(),u=n._controlCorners[s];return te(r,"leaflet-control"),s.indexOf("bottom")!==-1?u.insertBefore(r,u.firstChild):u.appendChild(r),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ve(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(n){this._map&&n&&n.screenX>0&&n.screenY>0&&this._map.getContainer().focus()}}),nr=function(n){return new vt(n)};se.include({addControl:function(n){return n.addTo(this),this},removeControl:function(n){return n.remove(),this},_initControlPos:function(){var n=this._controlCorners={},r="leaflet-",s=this._controlContainer=le("div",r+"control-container",this._container);function u(h,p){var g=r+h+" "+r+p;n[h+p]=le("div",g,s)}u("top","left"),u("top","right"),u("bottom","left"),u("bottom","right")},_clearControlPos:function(){for(var n in this._controlCorners)ve(this._controlCorners[n]);ve(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var kc=vt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(n,r,s,u){return s1,this._baseLayersList.style.display=n?"":"none"),this._separator.style.display=r&&n?"":"none",this},_onLayerChange:function(n){this._handlingClick||this._update();var r=this._getLayer(d(n.target)),s=r.overlay?n.type==="add"?"overlayadd":"overlayremove":n.type==="add"?"baselayerchange":null;s&&this._map.fire(s,r)},_createRadioElement:function(n,r){var s='",u=document.createElement("div");return u.innerHTML=s,u.firstChild},_addItem:function(n){var r=document.createElement("label"),s=this._map.hasLayer(n.layer),u;n.overlay?(u=document.createElement("input"),u.type="checkbox",u.className="leaflet-control-layers-selector",u.defaultChecked=s):u=this._createRadioElement("leaflet-base-layers_"+d(this),s),this._layerControlInputs.push(u),u.layerId=d(n.layer),re(u,"click",this._onInputClick,this);var h=document.createElement("span");h.innerHTML=" "+n.name;var p=document.createElement("div");r.appendChild(p),p.appendChild(u),p.appendChild(h);var g=n.overlay?this._overlaysList:this._baseLayersList;return g.appendChild(r),this._checkDisabledLayers(),r},_onInputClick:function(){var n=this._layerControlInputs,r,s,u=[],h=[];this._handlingClick=!0;for(var p=n.length-1;p>=0;p--)r=n[p],s=this._getLayer(r.layerId).layer,r.checked?u.push(s):r.checked||h.push(s);for(p=0;p=0;h--)r=n[h],s=this._getLayer(r.layerId).layer,r.disabled=s.options.minZoom!==void 0&&us.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),xm=function(n,r,s){return new kc(n,r,s)},ga=vt.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(n){var r="leaflet-control-zoom",s=le("div",r+" leaflet-bar"),u=this.options;return this._zoomInButton=this._createButton(u.zoomInText,u.zoomInTitle,r+"-in",s,this._zoomIn),this._zoomOutButton=this._createButton(u.zoomOutText,u.zoomOutTitle,r+"-out",s,this._zoomOut),this._updateDisabled(),n.on("zoomend zoomlevelschange",this._updateDisabled,this),s},onRemove:function(n){n.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(n){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(n.shiftKey?3:1))},_createButton:function(n,r,s,u,h){var p=le("a",s,u);return p.innerHTML=n,p.href="#",p.title=r,p.setAttribute("role","button"),p.setAttribute("aria-label",r),tr(p),re(p,"click",Dt),re(p,"click",h,this),re(p,"click",this._refocusOnMap,this),p},_updateDisabled:function(){var n=this._map,r="leaflet-disabled";Pe(this._zoomInButton,r),Pe(this._zoomOutButton,r),(this._disabled||n._zoom===n.getMinZoom())&&te(this._zoomOutButton,r),(this._disabled||n._zoom===n.getMaxZoom())&&te(this._zoomInButton,r)}});se.mergeOptions({zoomControl:!0}),se.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new ga,this.addControl(this.zoomControl))});var Pm=function(n){return new ga(n)},Lc=vt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(n){var r="leaflet-control-scale",s=le("div",r),u=this.options;return this._addScales(u,r+"-line",s),n.on(u.updateWhenIdle?"moveend":"move",this._update,this),n.whenReady(this._update,this),s},onRemove:function(n){n.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(n,r,s){n.metric&&(this._mScale=le("div",r,s)),n.imperial&&(this._iScale=le("div",r,s))},_update:function(){var n=this._map,r=n.getSize().y/2,s=n.distance(n.containerPointToLatLng([0,r]),n.containerPointToLatLng([this.options.maxWidth,r]));this._updateScales(s)},_updateScales:function(n){this.options.metric&&n&&this._updateMetric(n),this.options.imperial&&n&&this._updateImperial(n)},_updateMetric:function(n){var r=this._getRoundNum(n),s=r<1e3?r+" m":r/1e3+" km";this._updateScale(this._mScale,s,r/n)},_updateImperial:function(n){var r=n*3.2808399,s,u,h;r>5280?(s=r/5280,u=this._getRoundNum(s),this._updateScale(this._iScale,u+" mi",u/s)):(h=this._getRoundNum(r),this._updateScale(this._iScale,h+" ft",h/r))},_updateScale:function(n,r,s){n.style.width=Math.round(this.options.maxWidth*s)+"px",n.innerHTML=r},_getRoundNum:function(n){var r=Math.pow(10,(Math.floor(n)+"").length-1),s=n/r;return s=s>=10?10:s>=5?5:s>=3?3:s>=2?2:1,r*s}}),Sm=function(n){return new Lc(n)},ya=vt.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(n){E(this,n),this._attributions={}},onAdd:function(n){n.attributionControl=this,this._container=le("div","leaflet-control-attribution"),tr(this._container);for(var r in n._layers)n._layers[r].getAttribution&&this.addAttribution(n._layers[r].getAttribution());return this._update(),this._container},setPrefix:function(n){return this.options.prefix=n,this._update(),this},addAttribution:function(n){return n?(this._attributions[n]||(this._attributions[n]=0),this._attributions[n]++,this._update(),this):this},removeAttribution:function(n){return n?(this._attributions[n]&&(this._attributions[n]--,this._update()),this):this},_update:function(){if(this._map){var n=[];for(var r in this._attributions)this._attributions[r]&&n.push(r);var s=[];this.options.prefix&&s.push(this.options.prefix),n.length&&s.push(n.join(", ")),this._container.innerHTML=s.join(" | ")}}});se.mergeOptions({attributionControl:!0}),se.addInitHook(function(){this.options.attributionControl&&new ya().addTo(this)});var km=function(n){return new ya(n)};vt.Layers=kc,vt.Zoom=ga,vt.Scale=Lc,vt.Attribution=ya,nr.layers=xm,nr.zoom=Pm,nr.scale=Sm,nr.attribution=km;var zt=Q.extend({initialize:function(n){this._map=n},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}});zt.addTo=function(n,r){return n.addHandler(r,this),this};var Lm={Events:j},Tc=Nt?"touchstart mousedown":"mousedown",Cc={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},wa={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},Rn=V.extend({options:{clickTolerance:3},initialize:function(n,r,s,u){E(this,u),this._element=n,this._dragStartTarget=r||n,this._preventOutline=s},enable:function(){this._enabled||(re(this._dragStartTarget,Tc,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Rn._dragging===this&&this.finishDrag(),ke(this._dragStartTarget,Tc,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(n){if(!(n._simulated||!this._enabled)&&(this._moved=!1,!ra(this._element,"leaflet-zoom-anim")&&!(Rn._dragging||n.shiftKey||n.which!==1&&n.button!==1&&!n.touches)&&(Rn._dragging=this,this._preventOutline&&ca(this._element),aa(),qi(),!this._moving))){this.fire("down");var r=n.touches?n.touches[0]:n,s=yc(this._element);this._startPoint=new P(r.clientX,r.clientY),this._parentScale=ha(s),re(document,wa[n.type],this._onMove,this),re(document,Cc[n.type],this._onUp,this)}},_onMove:function(n){if(!(n._simulated||!this._enabled)){if(n.touches&&n.touches.length>1){this._moved=!0;return}var r=n.touches&&n.touches.length===1?n.touches[0]:n,s=new P(r.clientX,r.clientY)._subtract(this._startPoint);!s.x&&!s.y||Math.abs(s.x)+Math.abs(s.y)p&&(g=k,p=C);p>s&&(r[g]=1,xa(n,r,s,u,g),xa(n,r,s,g,h))}function Em(n,r){for(var s=[n[0]],u=1,h=0,p=n.length;ur&&(s.push(n[u]),h=u);return hr.max.x&&(s|=2),n.yr.max.y&&(s|=8),s}function Nm(n,r){var s=r.x-n.x,u=r.y-n.y;return s*s+u*u}function ir(n,r,s,u){var h=r.x,p=r.y,g=s.x-h,k=s.y-p,C=g*g+k*k,I;return C>0&&(I=((n.x-h)*g+(n.y-p)*k)/C,I>1?(h=s.x,p=s.y):I>0&&(h+=g*I,p+=k*I)),g=n.x-h,k=n.y-p,u?g*g+k*k:new P(h,p)}function Zt(n){return!w(n[0])||typeof n[0][0]!="object"&&typeof n[0][0]<"u"}function Oc(n){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Zt(n)}var Mm={simplify:Ec,pointToSegmentDistance:Nc,closestPointOnSegment:Tm,clipSegment:zc,_getEdgeIntersection:po,_getBitCode:jn,_sqClosestPointOnSegment:ir,isFlat:Zt,_flat:Oc};function Ic(n,r,s){var u,h=[1,4,2,8],p,g,k,C,I,U,X,ue;for(p=0,U=n.length;p1e-7;k++)I=h*Math.sin(g),I=Math.pow((1-I)/(1+I),h/2),C=Math.PI/2-2*Math.atan(p*I)-g,g+=C;return new J(g*r,n.x*r/s)}},Om={LonLat:Pa,Mercator:Sa,SphericalMercator:Oe},Im=a({},be,{code:"EPSG:3395",projection:Sa,transformation:function(){var n=.5/(Math.PI*Sa.R);return mt(n,.5,-n,.5)}()}),Rc=a({},be,{code:"EPSG:4326",projection:Pa,transformation:mt(1/180,1,-1/180,.5)}),Rm=a({},xe,{projection:Pa,transformation:mt(1,0,-1,0),scale:function(n){return Math.pow(2,n)},zoom:function(n){return Math.log(n)/Math.LN2},distance:function(n,r){var s=r.lng-n.lng,u=r.lat-n.lat;return Math.sqrt(s*s+u*u)},infinite:!0});xe.Earth=be,xe.EPSG3395=Im,xe.EPSG3857=tn,xe.EPSG900913=tm,xe.EPSG4326=Rc,xe.Simple=Rm;var gt=V.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(n){return n.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(n){return n&&n.removeLayer(this),this},getPane:function(n){return this._map.getPane(n?this.options[n]||n:this.options.pane)},addInteractiveTarget:function(n){return this._map._targets[d(n)]=this,this},removeInteractiveTarget:function(n){return delete this._map._targets[d(n)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(n){var r=n.target;if(r.hasLayer(this)){if(this._map=r,this._zoomAnimated=r._zoomAnimated,this.getEvents){var s=this.getEvents();r.on(s,this),this.once("remove",function(){r.off(s,this)},this)}this.onAdd(r),this.getAttribution&&r.attributionControl&&r.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),r.fire("layeradd",{layer:this})}}});se.include({addLayer:function(n){if(!n._layerAdd)throw new Error("The provided object is not a Layer.");var r=d(n);return this._layers[r]?this:(this._layers[r]=n,n._mapToAdd=this,n.beforeAdd&&n.beforeAdd(this),this.whenReady(n._layerAdd,n),this)},removeLayer:function(n){var r=d(n);return this._layers[r]?(this._loaded&&n.onRemove(this),n.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(n.getAttribution()),delete this._layers[r],this._loaded&&(this.fire("layerremove",{layer:n}),n.fire("remove")),n._map=n._mapToAdd=null,this):this},hasLayer:function(n){return!!n&&d(n)in this._layers},eachLayer:function(n,r){for(var s in this._layers)n.call(r,this._layers[s]);return this},_addLayers:function(n){n=n?w(n)?n:[n]:[];for(var r=0,s=n.length;rthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()r)return g=(u-r)/s,this._map.layerPointToLatLng([p.x-g*(p.x-h.x),p.y-g*(p.y-h.y)])},getBounds:function(){return this._bounds},addLatLng:function(n,r){return r=r||this._defaultShape(),n=ie(n),r.push(n),this._bounds.extend(n),this.redraw()},_setLatLngs:function(n){this._bounds=new ne,this._latlngs=this._convertLatLngs(n)},_defaultShape:function(){return Zt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(n){for(var r=[],s=Zt(n),u=0,h=n.length;u=2&&r[0]instanceof J&&r[0].equals(r[s-1])&&r.pop(),r},_setLatLngs:function(n){Ft.prototype._setLatLngs.call(this,n),Zt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Zt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var n=this._renderer._bounds,r=this.options.weight,s=new P(r,r);if(n=new F(n.min.subtract(s),n.max.add(s)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(n))){if(this.options.noClip){this._parts=this._rings;return}for(var u=0,h=this._rings.length,p;un.y!=h.y>n.y&&n.x<(h.x-u.x)*(n.y-u.y)/(h.y-u.y)+u.x&&(r=!r);return r||Ft.prototype._containsPoint.call(this,n,!0)}});function $m(n,r){return new ci(n,r)}var Ut=li.extend({initialize:function(n,r){E(this,r),this._layers={},n&&this.addData(n)},addData:function(n){var r=w(n)?n:n.features,s,u,h;if(r){for(s=0,u=r.length;s0?u:[r.src];return}w(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(r.style,"objectFit")&&(r.style.objectFit="fill"),r.autoplay=!!this.options.autoplay,r.loop=!!this.options.loop,r.muted=!!this.options.muted;for(var p=0;ph?(r.height=h+"px",te(n,p)):Pe(n,p),this._containerWidth=this._container.offsetWidth},_animateZoom:function(n){var r=this._map._latLngToNewLayerPoint(this._latlng,n.zoom,n.center),s=this._getAnchor();Ce(this._container,r.add(s))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var n=this._map,r=parseInt(Xi(this._container,"marginBottom"),10)||0,s=this._container.offsetHeight+r,u=this._containerWidth,h=new P(this._containerLeft,-s-this._containerBottom);h._add(on(this._container));var p=n.layerPointToContainerPoint(h),g=N(this.options.autoPanPadding),k=N(this.options.autoPanPaddingTopLeft||g),C=N(this.options.autoPanPaddingBottomRight||g),I=n.getSize(),U=0,X=0;p.x+u+C.x>I.x&&(U=p.x+u-I.x+C.x),p.x-U-k.x<0&&(U=p.x-k.x),p.y+s+C.y>I.y&&(X=p.y+s-I.y+C.y),p.y-X-k.y<0&&(X=p.y-k.y),(U||X)&&n.fire("autopanstart").panBy([U,X])}},_onCloseButtonClick:function(n){this._close(),Dt(n)},_getAnchor:function(){return N(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Gm=function(n,r){return new fi(n,r)};se.mergeOptions({closePopupOnClick:!0}),se.include({openPopup:function(n,r,s){return n instanceof fi||(n=new fi(s).setContent(n)),r&&n.setLatLng(r),this.hasLayer(n)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=n,this.addLayer(n))},closePopup:function(n){return(!n||n===this._popup)&&(n=this._popup,this._popup=null),n&&this.removeLayer(n),this}}),gt.include({bindPopup:function(n,r){return n instanceof fi?(E(n,r),this._popup=n,n._source=this):((!this._popup||r)&&(this._popup=new fi(r,this)),this._popup.setContent(n)),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(n,r){return this._popup&&this._map&&(r=this._popup._prepareOpen(this,n,r),this._map.openPopup(this._popup,r)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(n){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(n)),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(n){return this._popup&&this._popup.setContent(n),this},getPopup:function(){return this._popup},_openPopup:function(n){var r=n.layer||n.target;if(this._popup&&this._map){if(Dt(n),r instanceof sn){this.openPopup(n.layer||n.target,n.latlng);return}this._map.hasLayer(this._popup)&&this._popup._source===r?this.closePopup():this.openPopup(r,n.latlng)}},_movePopup:function(n){this._popup.setLatLng(n.latlng)},_onKeyPress:function(n){n.originalEvent.keyCode===13&&this._openPopup(n)}});var di=$t.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(n){$t.prototype.onAdd.call(this,n),this.setOpacity(this.options.opacity),n.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(n){$t.prototype.onRemove.call(this,n),n.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var n=$t.prototype.getEvents.call(this);return Nt&&!this.options.permanent&&(n.preclick=this._close),n},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var n="leaflet-tooltip",r=n+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=le("div",r)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(n){var r,s,u=this._map,h=this._container,p=u.latLngToContainerPoint(u.getCenter()),g=u.layerPointToContainerPoint(n),k=this.options.direction,C=h.offsetWidth,I=h.offsetHeight,U=N(this.options.offset),X=this._getAnchor();k==="top"?(r=C/2,s=I):k==="bottom"?(r=C/2,s=0):k==="center"?(r=C/2,s=I/2):k==="right"?(r=0,s=I/2):k==="left"?(r=C,s=I/2):g.xthis.options.maxZoom||su?this._retainParent(h,p,g,u):!1)},_retainChildren:function(n,r,s,u){for(var h=2*n;h<2*n+2;h++)for(var p=2*r;p<2*r+2;p++){var g=new P(h,p);g.z=s+1;var k=this._tileCoordsToKey(g),C=this._tiles[k];if(C&&C.active){C.retain=!0;continue}else C&&C.loaded&&(C.retain=!0);s+1this.options.maxZoom||this.options.minZoom!==void 0&&h1){this._setView(n,s);return}for(var X=h.min.y;X<=h.max.y;X++)for(var ue=h.min.x;ue<=h.max.x;ue++){var Wt=new P(ue,X);if(Wt.z=this._tileZoom,!!this._isValidTile(Wt)){var An=this._tiles[this._tileCoordsToKey(Wt)];An?An.current=!0:g.push(Wt)}}if(g.sort(function(an,Na){return an.distanceTo(p)-Na.distanceTo(p)}),g.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Po=document.createDocumentFragment();for(ue=0;ues.max.x)||!r.wrapLat&&(n.ys.max.y))return!1}if(!this.options.bounds)return!0;var u=this._tileCoordsToBounds(n);return ee(this.options.bounds).overlaps(u)},_keyToBounds:function(n){return this._tileCoordsToBounds(this._keyToTileCoords(n))},_tileCoordsToNwSe:function(n){var r=this._map,s=this.getTileSize(),u=n.scaleBy(s),h=u.add(s),p=r.unproject(u,n.z),g=r.unproject(h,n.z);return[p,g]},_tileCoordsToBounds:function(n){var r=this._tileCoordsToNwSe(n),s=new ne(r[0],r[1]);return this.options.noWrap||(s=this._map.wrapLatLngBounds(s)),s},_tileCoordsToKey:function(n){return n.x+":"+n.y+":"+n.z},_keyToTileCoords:function(n){var r=n.split(":"),s=new P(+r[0],+r[1]);return s.z=+r[2],s},_removeTile:function(n){var r=this._tiles[n];r&&(ve(r.el),delete this._tiles[n],this.fire("tileunload",{tile:r.el,coords:this._keyToTileCoords(n)}))},_initTile:function(n){te(n,"leaflet-tile");var r=this.getTileSize();n.style.width=r.x+"px",n.style.height=r.y+"px",n.onselectstart=x,n.onmousemove=x,ei&&this.options.opacity<1&&at(n,this.options.opacity),Ki&&!Yi&&(n.style.WebkitBackfaceVisibility="hidden")},_addTile:function(n,r){var s=this._getTilePos(n),u=this._tileCoordsToKey(n),h=this.createTile(this._wrapCoords(n),c(this._tileReady,this,n));this._initTile(h),this.createTile.length<2&&Y(c(this._tileReady,this,n,null,h)),Ce(h,s),this._tiles[u]={el:h,coords:n,current:!0},r.appendChild(h),this.fire("tileloadstart",{tile:h,coords:n})},_tileReady:function(n,r,s){r&&this.fire("tileerror",{error:r,tile:s,coords:n});var u=this._tileCoordsToKey(n);s=this._tiles[u],s&&(s.loaded=+new Date,this._map._fadeAnimated?(at(s.el,0),de(this._fadeFrame),this._fadeFrame=Y(this._updateOpacity,this)):(s.active=!0,this._pruneTiles()),r||(te(s.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:s.el,coords:n})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ei||!this._map._fadeAnimated?Y(this._pruneTiles,this):setTimeout(c(this._pruneTiles,this),250)))},_getTilePos:function(n){return n.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(n){var r=new P(this._wrapX?S(n.x,this._wrapX):n.x,this._wrapY?S(n.y,this._wrapY):n.y);return r.z=n.z,r},_pxBoundsToTileRange:function(n){var r=this.getTileSize();return new F(n.min.unscaleBy(r).floor(),n.max.unscaleBy(r).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var n in this._tiles)if(!this._tiles[n].loaded)return!1;return!0}});function Qm(n){return new or(n)}var pi=or.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(n,r){this._url=n,r=E(this,r),r.detectRetina&&rn&&r.maxZoom>0&&(r.tileSize=Math.floor(r.tileSize/2),r.zoomReverse?(r.zoomOffset--,r.minZoom++):(r.zoomOffset++,r.maxZoom--),r.minZoom=Math.max(0,r.minZoom)),typeof r.subdomains=="string"&&(r.subdomains=r.subdomains.split("")),Ki||this.on("tileunload",this._onTileRemove)},setUrl:function(n,r){return this._url===n&&r===void 0&&(r=!0),this._url=n,r||this.redraw(),this},createTile:function(n,r){var s=document.createElement("img");return re(s,"load",c(this._tileOnLoad,this,r,s)),re(s,"error",c(this._tileOnError,this,r,s)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(s.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),s.alt="",s.setAttribute("role","presentation"),s.src=this.getTileUrl(n),s},getTileUrl:function(n){var r={r:rn?"@2x":"",s:this._getSubdomain(n),x:n.x,y:n.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var s=this._globalTileRange.max.y-n.y;this.options.tms&&(r.y=s),r["-y"]=s}return v(this._url,a(r,this.options))},_tileOnLoad:function(n,r){ei?setTimeout(c(n,this,null,r),0):n(null,r)},_tileOnError:function(n,r,s){var u=this.options.errorTileUrl;u&&r.getAttribute("src")!==u&&(r.src=u),n(s,r)},_onTileRemove:function(n){n.tile.onload=null},_getZoomForUrl:function(){var n=this._tileZoom,r=this.options.maxZoom,s=this.options.zoomReverse,u=this.options.zoomOffset;return s&&(n=r-n),n+u},_getSubdomain:function(n){var r=Math.abs(n.x+n.y)%this.options.subdomains.length;return this.options.subdomains[r]},_abortLoading:function(){var n,r;for(n in this._tiles)this._tiles[n].coords.z!==this._tileZoom&&(r=this._tiles[n].el,r.onload=x,r.onerror=x,r.complete||(r.src=B,ve(r),delete this._tiles[n]))},_removeTile:function(n){var r=this._tiles[n];if(r)return lc||r.el.setAttribute("src",B),or.prototype._removeTile.call(this,n)},_tileReady:function(n,r,s){if(!(!this._map||s&&s.getAttribute("src")===B))return or.prototype._tileReady.call(this,n,r,s)}});function Uc(n,r){return new pi(n,r)}var $c=pi.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(n,r){this._url=n;var s=a({},this.defaultWmsParams);for(var u in r)u in this.options||(s[u]=r[u]);r=E(this,r);var h=r.detectRetina&&rn?2:1,p=this.getTileSize();s.width=p.x*h,s.height=p.y*h,this.wmsParams=s},onAdd:function(n){this._crs=this.options.crs||n.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var r=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[r]=this._crs.code,pi.prototype.onAdd.call(this,n)},getTileUrl:function(n){var r=this._tileCoordsToNwSe(n),s=this._crs,u=q(s.project(r[0]),s.project(r[1])),h=u.min,p=u.max,g=(this._wmsVersion>=1.3&&this._crs===Rc?[h.y,h.x,p.y,p.x]:[h.x,h.y,p.x,p.y]).join(","),k=pi.prototype.getTileUrl.call(this,n);return k+b(this.wmsParams,k,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+g},setParams:function(n,r){return a(this.wmsParams,n),r||this.redraw(),this}});function Xm(n,r){return new $c(n,r)}pi.WMS=$c,Uc.wms=Xm;var Ot=gt.extend({options:{padding:.1,tolerance:0},initialize:function(n){E(this,n),d(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&te(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 n={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(n.zoomanim=this._onAnimZoom),n},_onAnimZoom:function(n){this._updateTransform(n.center,n.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(n,r){var s=this._map.getZoomScale(r,this._zoom),u=on(this._container),h=this._map.getSize().multiplyBy(.5+this.options.padding),p=this._map.project(this._center,r),g=this._map.project(n,r),k=g.subtract(p),C=h.multiplyBy(-s).add(u).add(h).subtract(k);st?On(this._container,C,s):Ce(this._container,C)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var n in this._layers)this._layers[n]._reset()},_onZoomEnd:function(){for(var n in this._layers)this._layers[n]._project()},_updatePaths:function(){for(var n in this._layers)this._layers[n]._update()},_update:function(){var n=this.options.padding,r=this._map.getSize(),s=this._map.containerPointToLayerPoint(r.multiplyBy(-n)).round();this._bounds=new F(s,s.add(r.multiplyBy(1+n*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Wc=Ot.extend({getEvents:function(){var n=Ot.prototype.getEvents.call(this);return n.viewprereset=this._onViewPreReset,n},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Ot.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var n=this._container=document.createElement("canvas");re(n,"mousemove",this._onMouseMove,this),re(n,"click dblclick mousedown mouseup contextmenu",this._onClick,this),re(n,"mouseout",this._handleMouseOut,this),this._ctx=n.getContext("2d")},_destroyContainer:function(){de(this._redrawRequest),delete this._ctx,ve(this._container),ke(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var n;this._redrawBounds=null;for(var r in this._layers)n=this._layers[r],n._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ot.prototype._update.call(this);var n=this._bounds,r=this._container,s=n.getSize(),u=rn?2:1;Ce(r,n.min),r.width=u*s.x,r.height=u*s.y,r.style.width=s.x+"px",r.style.height=s.y+"px",rn&&this._ctx.scale(2,2),this._ctx.translate(-n.min.x,-n.min.y),this.fire("update")}},_reset:function(){Ot.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(n){this._updateDashArray(n),this._layers[d(n)]=n;var r=n._order={layer:n,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=r),this._drawLast=r,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(n){this._requestRedraw(n)},_removePath:function(n){var r=n._order,s=r.next,u=r.prev;s?s.prev=u:this._drawLast=u,u?u.next=s:this._drawFirst=s,delete n._order,delete this._layers[d(n)],this._requestRedraw(n)},_updatePath:function(n){this._extendRedrawBounds(n),n._project(),n._update(),this._requestRedraw(n)},_updateStyle:function(n){this._updateDashArray(n),this._requestRedraw(n)},_updateDashArray:function(n){if(typeof n.options.dashArray=="string"){var r=n.options.dashArray.split(/[, ]+/),s=[],u,h;for(h=0;h')}}catch{return function(r){return document.createElement("<"+r+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),qm={_initContainer:function(){this._container=le("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Ot.prototype._update.call(this),this.fire("update"))},_initPath:function(n){var r=n._container=sr("shape");te(r,"leaflet-vml-shape "+(this.options.className||"")),r.coordsize="1 1",n._path=sr("path"),r.appendChild(n._path),this._updateStyle(n),this._layers[d(n)]=n},_addPath:function(n){var r=n._container;this._container.appendChild(r),n.options.interactive&&n.addInteractiveTarget(r)},_removePath:function(n){var r=n._container;ve(r),n.removeInteractiveTarget(r),delete this._layers[d(n)]},_updateStyle:function(n){var r=n._stroke,s=n._fill,u=n.options,h=n._container;h.stroked=!!u.stroke,h.filled=!!u.fill,u.stroke?(r||(r=n._stroke=sr("stroke")),h.appendChild(r),r.weight=u.weight+"px",r.color=u.color,r.opacity=u.opacity,u.dashArray?r.dashStyle=w(u.dashArray)?u.dashArray.join(" "):u.dashArray.replace(/( *, *)/g," "):r.dashStyle="",r.endcap=u.lineCap.replace("butt","flat"),r.joinstyle=u.lineJoin):r&&(h.removeChild(r),n._stroke=null),u.fill?(s||(s=n._fill=sr("fill")),h.appendChild(s),s.color=u.fillColor||u.color,s.opacity=u.fillOpacity):s&&(h.removeChild(s),n._fill=null)},_updateCircle:function(n){var r=n._point.round(),s=Math.round(n._radius),u=Math.round(n._radiusY||s);this._setPath(n,n._empty()?"M0 0":"AL "+r.x+","+r.y+" "+s+","+u+" 0,"+65535*360)},_setPath:function(n,r){n._path.v=r},_bringToFront:function(n){oi(n._container)},_bringToBack:function(n){si(n._container)}},xo=io?sr:sc,ar=Ot.extend({getEvents:function(){var n=Ot.prototype.getEvents.call(this);return n.zoomstart=this._onZoomStart,n},_initContainer:function(){this._container=xo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=xo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ve(this._container),ke(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ot.prototype._update.call(this);var n=this._bounds,r=n.getSize(),s=this._container;(!this._svgSize||!this._svgSize.equals(r))&&(this._svgSize=r,s.setAttribute("width",r.x),s.setAttribute("height",r.y)),Ce(s,n.min),s.setAttribute("viewBox",[n.min.x,n.min.y,r.x,r.y].join(" ")),this.fire("update")}},_initPath:function(n){var r=n._path=xo("path");n.options.className&&te(r,n.options.className),n.options.interactive&&te(r,"leaflet-interactive"),this._updateStyle(n),this._layers[d(n)]=n},_addPath:function(n){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(n._path),n.addInteractiveTarget(n._path)},_removePath:function(n){ve(n._path),n.removeInteractiveTarget(n._path),delete this._layers[d(n)]},_updatePath:function(n){n._project(),n._update()},_updateStyle:function(n){var r=n._path,s=n.options;r&&(s.stroke?(r.setAttribute("stroke",s.color),r.setAttribute("stroke-opacity",s.opacity),r.setAttribute("stroke-width",s.weight),r.setAttribute("stroke-linecap",s.lineCap),r.setAttribute("stroke-linejoin",s.lineJoin),s.dashArray?r.setAttribute("stroke-dasharray",s.dashArray):r.removeAttribute("stroke-dasharray"),s.dashOffset?r.setAttribute("stroke-dashoffset",s.dashOffset):r.removeAttribute("stroke-dashoffset")):r.setAttribute("stroke","none"),s.fill?(r.setAttribute("fill",s.fillColor||s.color),r.setAttribute("fill-opacity",s.fillOpacity),r.setAttribute("fill-rule",s.fillRule||"evenodd")):r.setAttribute("fill","none"))},_updatePoly:function(n,r){this._setPath(n,ac(n._parts,r))},_updateCircle:function(n){var r=n._point,s=Math.max(Math.round(n._radius),1),u=Math.max(Math.round(n._radiusY),1)||s,h="a"+s+","+u+" 0 1,0 ",p=n._empty()?"M0 0":"M"+(r.x-s)+","+r.y+h+s*2+",0 "+h+-s*2+",0 ";this._setPath(n,p)},_setPath:function(n,r){n._path.setAttribute("d",r)},_bringToFront:function(n){oi(n._path)},_bringToBack:function(n){si(n._path)}});io&&ar.include(qm);function Vc(n){return no||io?new ar(n):null}se.include({getRenderer:function(n){var r=n.options.renderer||this._getPaneRenderer(n.options.pane)||this.options.renderer||this._renderer;return r||(r=this._renderer=this._createRenderer()),this.hasLayer(r)||this.addLayer(r),r},_getPaneRenderer:function(n){if(n==="overlayPane"||n===void 0)return!1;var r=this._paneRenderers[n];return r===void 0&&(r=this._createRenderer({pane:n}),this._paneRenderers[n]=r),r},_createRenderer:function(n){return this.options.preferCanvas&&Hc(n)||Vc(n)}});var bc=ci.extend({initialize:function(n,r){ci.prototype.initialize.call(this,this._boundsToLatLngs(n),r)},setBounds:function(n){return this.setLatLngs(this._boundsToLatLngs(n))},_boundsToLatLngs:function(n){return n=ee(n),[n.getSouthWest(),n.getNorthWest(),n.getNorthEast(),n.getSouthEast()]}});function Jm(n,r){return new bc(n,r)}ar.create=xo,ar.pointsToPath=ac,Ut.geometryToLayer=La,Ut.coordsToLatLng=Ta,Ut.coordsToLatLngs=vo,Ut.latLngToCoords=Ca,Ut.latLngsToCoords=go,Ut.getFeature=hi,Ut.asFeature=yo,se.mergeOptions({boxZoom:!0});var Gc=zt.extend({initialize:function(n){this._map=n,this._container=n._container,this._pane=n._panes.overlayPane,this._resetStateTimeout=0,n.on("unload",this._destroy,this)},addHooks:function(){re(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){ke(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ve(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(n){if(!n.shiftKey||n.which!==1&&n.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),qi(),aa(),this._startPoint=this._map.mouseEventToContainerPoint(n),re(document,{contextmenu:Dt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(n){this._moved||(this._moved=!0,this._box=le("div","leaflet-zoom-box",this._container),te(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(n);var r=new F(this._point,this._startPoint),s=r.getSize();Ce(this._box,r.min),this._box.style.width=s.x+"px",this._box.style.height=s.y+"px"},_finish:function(){this._moved&&(ve(this._box),Pe(this._container,"leaflet-crosshair")),Ji(),la(),ke(document,{contextmenu:Dt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(n){if(!(n.which!==1&&n.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(c(this._resetState,this),0);var r=new ne(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(r).fire("boxzoomend",{boxZoomBounds:r})}},_onKeyDown:function(n){n.keyCode===27&&this._finish()}});se.addInitHook("addHandler","boxZoom",Gc),se.mergeOptions({doubleClickZoom:!0});var Kc=zt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(n){var r=this._map,s=r.getZoom(),u=r.options.zoomDelta,h=n.originalEvent.shiftKey?s-u:s+u;r.options.doubleClickZoom==="center"?r.setZoom(h):r.setZoomAround(n.containerPoint,h)}});se.addInitHook("addHandler","doubleClickZoom",Kc),se.mergeOptions({dragging:!0,inertia:!Yi,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Yc=zt.extend({addHooks:function(){if(!this._draggable){var n=this._map;this._draggable=new Rn(n._mapPane,n._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),n.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),n.on("zoomend",this._onZoomEnd,this),n.whenReady(this._onZoomEnd,this))}te(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Pe(this._map._container,"leaflet-grab"),Pe(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 n=this._map;if(n._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var r=ee(this._map.options.maxBounds);this._offsetLimit=q(this._map.latLngToContainerPoint(r.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(r.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;n.fire("movestart").fire("dragstart"),n.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(n){if(this._map.options.inertia){var r=this._lastTime=+new Date,s=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(s),this._times.push(r),this._prunePositions(r)}this._map.fire("move",n).fire("drag",n)},_prunePositions:function(n){for(;this._positions.length>1&&n-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var n=this._map.getSize().divideBy(2),r=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=r.subtract(n).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(n,r){return n-(n-r)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var n=this._draggable._newPos.subtract(this._draggable._startPos),r=this._offsetLimit;n.xr.max.x&&(n.x=this._viscousLimit(n.x,r.max.x)),n.y>r.max.y&&(n.y=this._viscousLimit(n.y,r.max.y)),this._draggable._newPos=this._draggable._startPos.add(n)}},_onPreDragWrap:function(){var n=this._worldWidth,r=Math.round(n/2),s=this._initialWorldOffset,u=this._draggable._newPos.x,h=(u-r+s)%n+r-s,p=(u+r+s)%n-r-s,g=Math.abs(h+s)0?p:-p))-r;this._delta=0,this._startTime=null,g&&(n.options.scrollWheelZoom==="center"?n.setZoom(r+g):n.setZoomAround(this._lastMousePos,r+g))}});se.addInitHook("addHandler","scrollWheelZoom",Xc),se.mergeOptions({tap:!0,tapTolerance:15});var qc=zt.extend({addHooks:function(){re(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){ke(this._map._container,"touchstart",this._onDown,this)},_onDown:function(n){if(n.touches){if(lt(n),this._fireClick=!0,n.touches.length>1){this._fireClick=!1,clearTimeout(this._holdTimeout);return}var r=n.touches[0],s=r.target;this._startPos=this._newPos=new P(r.clientX,r.clientY),s.tagName&&s.tagName.toLowerCase()==="a"&&te(s,"leaflet-active"),this._holdTimeout=setTimeout(c(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",r))},this),1e3),this._simulateEvent("mousedown",r),re(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(n){if(clearTimeout(this._holdTimeout),ke(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&n&&n.changedTouches){var r=n.changedTouches[0],s=r.target;s&&s.tagName&&s.tagName.toLowerCase()==="a"&&Pe(s,"leaflet-active"),this._simulateEvent("mouseup",r),this._isTapValid()&&this._simulateEvent("click",r)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(n){var r=n.touches[0];this._newPos=new P(r.clientX,r.clientY),this._simulateEvent("mousemove",r)},_simulateEvent:function(n,r){var s=document.createEvent("MouseEvents");s._simulated=!0,r.target._simulatedClick=!0,s.initMouseEvent(n,!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),r.target.dispatchEvent(s)}});Nt&&(!Et||to)&&se.addInitHook("addHandler","tap",qc),se.mergeOptions({touchZoom:Nt&&!Yi,bounceAtZoomLimits:!0});var Jc=zt.extend({addHooks:function(){te(this._map._container,"leaflet-touch-zoom"),re(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Pe(this._map._container,"leaflet-touch-zoom"),ke(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(n){var r=this._map;if(!(!n.touches||n.touches.length!==2||r._animatingZoom||this._zooming)){var s=r.mouseEventToContainerPoint(n.touches[0]),u=r.mouseEventToContainerPoint(n.touches[1]);this._centerPoint=r.getSize()._divideBy(2),this._startLatLng=r.containerPointToLatLng(this._centerPoint),r.options.touchZoom!=="center"&&(this._pinchStartLatLng=r.containerPointToLatLng(s.add(u)._divideBy(2))),this._startDist=s.distanceTo(u),this._startZoom=r.getZoom(),this._moved=!1,this._zooming=!0,r._stop(),re(document,"touchmove",this._onTouchMove,this),re(document,"touchend",this._onTouchEnd,this),lt(n)}},_onTouchMove:function(n){if(!(!n.touches||n.touches.length!==2||!this._zooming)){var r=this._map,s=r.mouseEventToContainerPoint(n.touches[0]),u=r.mouseEventToContainerPoint(n.touches[1]),h=s.distanceTo(u)/this._startDist;if(this._zoom=r.getScaleZoom(h,this._startZoom),!r.options.bounceAtZoomLimits&&(this._zoomr.getMaxZoom()&&h>1)&&(this._zoom=r._limitZoom(this._zoom)),r.options.touchZoom==="center"){if(this._center=this._startLatLng,h===1)return}else{var p=s._add(u)._divideBy(2)._subtract(this._centerPoint);if(h===1&&p.x===0&&p.y===0)return;this._center=r.unproject(r.project(this._pinchStartLatLng,this._zoom).subtract(p),this._zoom)}this._moved||(r._moveStart(!0,!1),this._moved=!0),de(this._animRequest);var g=c(r._move,r,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=Y(g,this,!0),lt(n)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,de(this._animRequest),ke(document,"touchmove",this._onTouchMove,this),ke(document,"touchend",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});se.addInitHook("addHandler","touchZoom",Jc),se.BoxZoom=Gc,se.DoubleClickZoom=Kc,se.Drag=Yc,se.Keyboard=Qc,se.ScrollWheelZoom=Xc,se.Tap=qc,se.TouchZoom=Jc,i.version=o,i.Control=vt,i.control=nr,i.Browser=sm,i.Evented=V,i.Mixin=Lm,i.Util=Tt,i.Class=Q,i.Handler=zt,i.extend=a,i.bind=c,i.stamp=d,i.setOptions=E,i.DomEvent=ym,i.DomUtil=vm,i.PosAnimation=Sc,i.Draggable=Rn,i.LineUtil=Mm,i.PolyUtil=zm,i.Point=P,i.point=N,i.Bounds=F,i.bounds=q,i.Transformation=ot,i.transformation=mt,i.Projection=Om,i.LatLng=J,i.latLng=ie,i.LatLngBounds=ne,i.latLngBounds=ee,i.CRS=xe,i.GeoJSON=Ut,i.geoJSON=Bc,i.geoJson=Wm,i.Layer=gt,i.LayerGroup=ai,i.layerGroup=jm,i.FeatureGroup=li,i.featureGroup=Am,i.ImageOverlay=wo,i.imageOverlay=Hm,i.VideoOverlay=Dc,i.videoOverlay=Vm,i.SVGOverlay=Zc,i.svgOverlay=bm,i.DivOverlay=$t,i.Popup=fi,i.popup=Gm,i.Tooltip=di,i.tooltip=Km,i.Icon=ui,i.icon=Bm,i.DivIcon=Fc,i.divIcon=Ym,i.Marker=mo,i.marker=Dm,i.TileLayer=pi,i.tileLayer=Uc,i.GridLayer=or,i.gridLayer=Qm,i.SVG=ar,i.svg=Vc,i.Renderer=Ot,i.Canvas=Wc,i.canvas=Hc,i.Path=sn,i.CircleMarker=_o,i.circleMarker=Zm,i.Circle=ka,i.circle=Fm,i.Polyline=Ft,i.polyline=Um,i.Polygon=ci,i.polygon=$m,i.Rectangle=bc,i.rectangle=Jm,i.Map=se,i.map=wm;var e_=window.L;i.noConflict=function(){return window.L=e_,this},window.L=i})})(Jl,Jl.exports);var Ui=Jl.exports;function by(e,t){const[i,o]=Z.useState(null),a=Z.useRef(!1);return Z.useEffect(()=>{if(e.current!==null&&!a.current){const l=new Ui.Map(e.current,{center:{lat:t.location.latitude,lng:t.location.longitude},zoom:12}),c=new Ui.TileLayer("https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png",{attribution:'© OpenStreetMap contributors © CARTO'});l.addLayer(c),o(l),a.current=!0}},[e,t]),i}const Gy=new Ui.Icon({iconUrl:$g,iconSize:[40,40],iconAnchor:[20,40]}),Ky=new Ui.Icon({iconUrl:Wg,iconSize:[40,40],iconAnchor:[20,40]});function Yp({container:e,city:t,offers:i,activeOffer:o}){const a=Z.useRef(null),l=by(a,t);return Z.useEffect(()=>{if(l){const c=Ui.layerGroup().addTo(l);return i.forEach(f=>{new Ui.Marker({lat:f.location.latitude,lng:f.location.longitude}).setIcon(o!==null&&f.id===o.id?Ky:Gy).addTo(c)}),l.flyTo([t.location.latitude,t.location.longitude],12),()=>{l.removeLayer(c)}}},[t,l,i,o]),_.jsx("section",{ref:a,className:`${e}__map map`})}function Yy({offers:e,offersCount:t,title:i="Main"}){qr(i);const[o,a]=Z.useState(null),l=zn(),[c,f]=Z.useState(l.pathname.split("/").pop());Z.useEffect(()=>{f(l.pathname.split("/").pop())},[l]);const d=Vi.find(m=>m.slug===c);return _.jsxs("div",{className:"page page--gray page--main",children:[_.jsx(Hs,{}),_.jsxs("main",{className:"page__main page__main--index",children:[_.jsx("h1",{className:"visually-hidden",children:"Cities"}),_.jsx("div",{className:"tabs",children:_.jsx("section",{className:"locations container",children:_.jsx("ul",{className:"locations__list tabs__list",children:_.jsx(Hy,{})})})}),_.jsx("div",{className:"cities",children:_.jsxs("div",{className:"cities__places-container container",children:[_.jsxs("section",{className:"cities__places places",children:[_.jsxs("span",{children:["Now active offer id: ",o==null?void 0:o.id]}),_.jsx("h2",{className:"visually-hidden",children:"Places"}),_.jsxs("b",{className:"places__found",children:[t," places to stay in Amsterdam"]}),_.jsxs("form",{className:"places__sorting",action:"#",method:"get",children:[_.jsx("span",{className:"places__sorting-caption",children:"Sort by"}),_.jsxs("span",{className:"places__sorting-type",tabIndex:0,children:["Popular",_.jsx("svg",{className:"places__sorting-arrow",width:"7",height:"4",children:_.jsx("use",{xlinkHref:"#icon-arrow-select"})})]}),_.jsxs("ul",{className:"places__options places__options--custom places__options--opened",children:[_.jsx("li",{className:"places__option places__option--active",tabIndex:0,children:"Popular"}),_.jsx("li",{className:"places__option",tabIndex:0,children:"Price: low to high"}),_.jsx("li",{className:"places__option",tabIndex:0,children:"Price: high to low"}),_.jsx("li",{className:"places__option",tabIndex:0,children:"Top rated first"})]})]}),_.jsx("div",{className:"cities__places-list places__list tabs__content",children:e.map(m=>_.jsx(rc,{hoverHandler:()=>a(m||null),componentType:"cities",offer:m},m.id))})]}),_.jsx("div",{className:"cities__right-section",children:d&&_.jsx(Yp,{container:"cities",city:d,offers:e,activeOffer:o})})]})})]})]})}const Qy="_container_e270g_1",Xy={container:Qy};function eu({title:e="404"}){return qr(e),_.jsxs("div",{className:"page page--gray",children:[_.jsx("header",{className:"header",children:_.jsx("div",{className:"container",children:_.jsx("div",{className:"header__wrapper",children:_.jsx("div",{className:"header__left",children:_.jsx(oc,{})})})})}),_.jsxs("main",{className:Xy.container,children:[_.jsxs("h1",{children:["Ошибка 404. ",_.jsx("br",{}),"Страница не найдена 😕"]}),_.jsxs(Cn,{to:"/",className:"locations__item-link",children:[" ","<- Вернуться на главную страницу"]})]})]})}function Qp(){return _.jsx("footer",{className:"footer container",children:_.jsx(Cn,{className:"footer__logo-link",to:Ke.Root,children:_.jsx("img",{className:"footer__logo",src:"img/logo.svg",alt:"6 cities logo",width:"64",height:"33"})})})}function qy(){return _.jsxs("div",{className:"page page--favorites-empty",children:[_.jsx(Hs,{}),_.jsx("main",{className:"page__main page__main--favorites page__main--favorites-empty",children:_.jsx("div",{className:"page__favorites-container container",children:_.jsxs("section",{className:"favorites favorites--empty",children:[_.jsx("h1",{className:"visually-hidden",children:"Favorites (empty)"}),_.jsxs("div",{className:"favorites__status-wrapper",children:[_.jsx("b",{className:"favorites__status",children:"Nothing yet saved."}),_.jsx("p",{className:"favorites__status-description",children:"Save properties to narrow down search or plan your future trips."})]})]})})}),_.jsx(Qp,{})]})}function Jy({title:e="Favorites",offersFavorites:t}){return qr(e),t.length?_.jsxs("div",{className:"page",children:[_.jsx(Hs,{}),_.jsx("main",{className:"page__main page__main--favorites",children:_.jsx("div",{className:"page__favorites-container container",children:_.jsxs("section",{className:"favorites",children:[_.jsx("h1",{className:"favorites__title",children:"Saved listing"}),_.jsx("ul",{className:"favorites__list",children:_.jsxs("li",{className:"favorites__locations-items",children:[_.jsx("div",{className:"favorites__locations locations locations--current",children:_.jsx("div",{className:"locations__item",children:_.jsx(Cn,{className:"locations__item-link",to:`${Ke.Root}`,children:_.jsx("span",{children:"Amsterdam"})})})}),_.jsx("div",{className:"favorites__places",children:t.map(i=>_.jsx(rc,{componentType:"favorites",offer:i},i.id))})]})})]})})}),_.jsx(Qp,{})]}):_.jsx(qy,{})}const Xp=[{id:"655253b6-082c-4276-a0e2-15464a0c9d30",title:"Amazing and Extremely Central Flat",type:"apartment",price:307,previewImage:"https://15.design.htmlacademy.pro/static/hotel/8.jpg",city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3909553943508,longitude:4.85309666406198,zoom:16},isFavorite:!0,isPremium:!0,rating:2},{id:"c5bc3b98-c10a-45e7-b617-93d69ab16712",title:"The Pondhouse - A Magical Place",type:"house",price:528,previewImage:"https://15.design.htmlacademy.pro/static/hotel/4.jpg",city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3609553943508,longitude:4.85309666406198,zoom:16},isFavorite:!1,isPremium:!0,rating:1.1},{id:"31abd117-5027-4adb-8b89-388d1d4a9650",title:"Perfectly located Castro",type:"house",price:923,previewImage:"https://15.design.htmlacademy.pro/static/hotel/7.jpg",city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3909553943508,longitude:4.929309666406198,zoom:16},isFavorite:!1,isPremium:!0,rating:2.3},{id:"0afa3f92-633b-4049-9199-cdd249a9a2f6",title:"Amazing and Extremely Central Flat",type:"apartment",price:123,previewImage:"https://15.design.htmlacademy.pro/static/hotel/19.jpg",city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3809553943508,longitude:4.939309666406198,zoom:16},isFavorite:!1,isPremium:!1,rating:2.8}],e0=[{id:"655253b6-082c-4276-a0e2-15464a0c9d30",title:"Amazing and Extremely Central Flat",description:"I am happy to welcome you to my apartment in the city center! Three words: location, cosy and chic!",type:"apartment",price:307,images:["https://15.design.htmlacademy.pro/static/hotel/20.jpg","https://15.design.htmlacademy.pro/static/hotel/13.jpg","https://15.design.htmlacademy.pro/static/hotel/3.jpg","https://15.design.htmlacademy.pro/static/hotel/8.jpg","https://15.design.htmlacademy.pro/static/hotel/4.jpg","https://15.design.htmlacademy.pro/static/hotel/19.jpg"],city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3909553943508,longitude:4.85309666406198,zoom:16},goods:["Washing machine","Breakfast","Baby seat","Coffee machine","Air conditioning"],host:{isPro:!0,name:"Angelina",avatarUrl:"https://15.design.htmlacademy.pro/static/host/avatar-angelina.jpg"},isPremium:!0,isFavorite:!1,rating:2,bedrooms:1,maxAdults:1},{id:"c5bc3b98-c10a-45e7-b617-93d69ab16712",title:"The Pondhouse - A Magical Place",description:"I am happy to welcome you to my apartment in the city center! Three words: location, cosy and chic!",type:"house",price:528,images:["https://15.design.htmlacademy.pro/static/hotel/4.jpg","https://15.design.htmlacademy.pro/static/hotel/14.jpg","https://15.design.htmlacademy.pro/static/hotel/12.jpg","https://15.design.htmlacademy.pro/static/hotel/16.jpg","https://15.design.htmlacademy.pro/static/hotel/6.jpg","https://15.design.htmlacademy.pro/static/hotel/5.jpg"],city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3609553943508,longitude:4.85309666406198,zoom:16},goods:["Fridge","Baby seat","Dishwasher","Wi-Fi","Kitchen","Breakfast","Towels","Coffee machine","Washer"],host:{isPro:!0,name:"Angelina",avatarUrl:"https://15.design.htmlacademy.pro/static/host/avatar-angelina.jpg"},isPremium:!0,isFavorite:!1,rating:1.1,bedrooms:2,maxAdults:3},{id:"31abd117-5027-4adb-8b89-388d1d4a9650",title:"Perfectly located Castro",description:"A new spacious villa, one floor. All commodities, jacuzzi and beautiful scenery. Ideal for families or friends.",type:"house",price:923,images:["https://15.design.htmlacademy.pro/static/hotel/15.jpg","https://15.design.htmlacademy.pro/static/hotel/7.jpg","https://15.design.htmlacademy.pro/static/hotel/18.jpg","https://15.design.htmlacademy.pro/static/hotel/4.jpg","https://15.design.htmlacademy.pro/static/hotel/1.jpg","https://15.design.htmlacademy.pro/static/hotel/10.jpg"],city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3909553943508,longitude:4.929309666406198,zoom:16},goods:["Baby seat","Fridge","Washer","Dishwasher","Laptop friendly workspace","Air conditioning","Breakfast","Wi-Fi","Cable TV","Kitchen","Coffee machine","Washing machine","Towels"],host:{isPro:!0,name:"Angelina",avatarUrl:"https://15.design.htmlacademy.pro/static/host/avatar-angelina.jpg"},isPremium:!0,isFavorite:!1,rating:2.3,bedrooms:5,maxAdults:5},{id:"0afa3f92-633b-4049-9199-cdd249a9a2f6",title:"Amazing and Extremely Central Flat",description:"Design interior in most sympathetic area! Complitely renovated, well-equipped, cosy studio in idyllic, over 100 years old wooden house. Calm street, fast connection to center and airport.",type:"apartment",price:123,images:["https://15.design.htmlacademy.pro/static/hotel/2.jpg","https://15.design.htmlacademy.pro/static/hotel/1.jpg","https://15.design.htmlacademy.pro/static/hotel/20.jpg","https://15.design.htmlacademy.pro/static/hotel/5.jpg","https://15.design.htmlacademy.pro/static/hotel/15.jpg","https://15.design.htmlacademy.pro/static/hotel/18.jpg"],city:{name:"Amsterdam",location:{latitude:52.37454,longitude:4.897976,zoom:13}},location:{latitude:52.3809553943508,longitude:4.939309666406198,zoom:16},goods:["Wi-Fi","Heating","Cable TV","Baby seat","Kitchen","Fridge","Washing machine","Dishwasher"],host:{isPro:!0,name:"Angelina",avatarUrl:"https://15.design.htmlacademy.pro/static/host/avatar-angelina.jpg"},isPremium:!1,isFavorite:!1,rating:2.8,bedrooms:3,maxAdults:3}],qp=()=>Xp,t0=()=>Xp.filter(e=>e.isFavorite),n0=e=>e0.find(t=>t.id===e),i0=[{offerId:"655253b6-082c-4276-a0e2-15464a0c9d30",id:"3893572c-8c1d-48c8-9933-b3d0e7b1e1a2",comment:"This villa is perfect in every way: the view on mountains and waterfalls, the hot tub and the villa itself. The evening here became a great continuation of our journeys over country.",date:"2024-02-09T21:00:00.379Z",rating:5,user:{name:"Mollie",avatarUrl:"https://15.design.htmlacademy.pro/static/avatar/4.jpg",isPro:!1}},{offerId:"c5bc3b98-c10a-45e7-b617-93d69ab16712",id:"a6d4afc6-a8a2-441b-b300-3d20059671c5",comment:"Bathed in the nature. Completely unplugged. Unforgettable.",date:"2024-02-10T21:00:00.379Z",rating:4,user:{name:"Max",avatarUrl:"https://15.design.htmlacademy.pro/static/avatar/1.jpg",isPro:!0}},{offerId:"c5bc3b98-c10a-45e7-b617-93d69ab16712",id:"efc128ed-48cd-4fe3-a804-34cf2833c241",comment:"We loved it so much, the house, the veiw, the location just great.. Highly reccomend :)",date:"2024-02-07T21:00:00.379Z",rating:5,user:{name:"Inna",avatarUrl:"https://15.design.htmlacademy.pro/static/avatar/6.jpg",isPro:!1}},{offerId:"0afa3f92-633b-4049-9199-cdd249a9a2f6",id:"b67ddfd5-b953-4a30-8c8d-bd083cd6b62a",comment:"A quiet cozy and picturesque that hides behind a a river by the unique lightness of Amsterdam.",date:"2019-05-08T14:13:56.569Z",rating:4,user:{name:"Oliver Conner",avatarUrl:"https://15.design.htmlacademy.pro/static/avatar/3.jpg",isPro:!1}}],r0=e=>{const t=i0.filter(i=>i.offerId===e);return t.length?t:[]};function o0({host:e,description:t}){const{name:i,avatarUrl:o,isPro:a}=e;return _.jsxs("div",{className:"offer__host",children:[_.jsx("h2",{className:"offer__host-title",children:"Meet the host"}),_.jsxs("div",{className:"offer__host-user user",children:[_.jsx("div",{className:nc("offer__avatar-wrapper user__avatar-wrapper",a&&"offer__avatar-wrapper--pro"),children:_.jsx("img",{className:"offer__avatar user__avatar",src:o,width:"74",height:"74",alt:"Host avatar"})}),_.jsx("span",{className:"offer__user-name",children:i}),a&&_.jsx("span",{className:"offer__user-status",children:"Pro"})]}),_.jsx("div",{className:"offer__description",children:_.jsx("p",{className:"offer__text",children:t})})]})}var Jp={exports:{}};(function(e,t){(function(i,o){e.exports=o()})(Pf,function(){var i=1e3,o=6e4,a=36e5,l="millisecond",c="second",f="minute",d="hour",m="day",S="week",x="month",T="quarter",z="year",M="date",E="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Q){var $=["th","st","nd","rd"],j=Q%100;return"["+Q+($[(j-20)%10]||$[j]||$[0])+"]"}},w=function(Q,$,j){var V=String(Q);return!V||V.length>=$?Q:""+Array($+1-V.length).join(j)+Q},O={s:w,z:function(Q){var $=-Q.utcOffset(),j=Math.abs($),V=Math.floor(j/60),P=j%60;return($<=0?"+":"-")+w(V,2,"0")+":"+w(P,2,"0")},m:function Q($,j){if($.date()1)return Q(N[0])}else{var F=$.name;A[F]=$,P=F}return!V&&P&&(B=P),P||!V&&B},K=function(Q,$){if(G(Q))return Q.clone();var j=typeof $=="object"?$:{};return j.date=Q,j.args=arguments,new de(j)},Y=O;Y.l=ce,Y.i=G,Y.w=function(Q,$){return K(Q,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var de=function(){function Q(j){this.$L=ce(j.locale,null,!0),this.parse(j),this.$x=this.$x||j.x||{},this[H]=!0}var $=Q.prototype;return $.parse=function(j){this.$d=function(V){var P=V.date,D=V.utc;if(P===null)return new Date(NaN);if(Y.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var N=P.match(b);if(N){var F=N[2]-1||0,q=(N[7]||"0").substring(0,3);return D?new Date(Date.UTC(N[1],F,N[3]||1,N[4]||0,N[5]||0,N[6]||0,q)):new Date(N[1],F,N[3]||1,N[4]||0,N[5]||0,N[6]||0,q)}}return new Date(P)}(j),this.init()},$.init=function(){var j=this.$d;this.$y=j.getFullYear(),this.$M=j.getMonth(),this.$D=j.getDate(),this.$W=j.getDay(),this.$H=j.getHours(),this.$m=j.getMinutes(),this.$s=j.getSeconds(),this.$ms=j.getMilliseconds()},$.$utils=function(){return Y},$.isValid=function(){return this.$d.toString()!==E},$.isSame=function(j,V){var P=K(j);return this.startOf(V)<=P&&P<=this.endOf(V)},$.isAfter=function(j,V){return K(j)i(t),htmlFor:`${t}-stars`,className:"reviews__rating-label form__rating-label",title:e,children:_.jsx("svg",{className:"form__star-image",width:"37",height:"33",children:_.jsx("use",{xlinkHref:"#icon-star"})})})]})}function u0(){const[e,t]=Z.useState(0),[i,o]=Z.useState(""),a=l=>{l.preventDefault()};return _.jsxs("form",{onSubmit:l=>a(l),className:"reviews__form form",action:"#",method:"post",children:[_.jsx("label",{className:"reviews__label form__label",htmlFor:"review",children:"Your review"}),_.jsx("div",{className:"reviews__rating-form form__rating",children:Object.entries(jg).map(([l,c])=>_.jsx(l0,{onClickHandle:t,starTitle:l,starValue:c},l))}),_.jsx("textarea",{onChange:l=>o(l.target.value),className:"reviews__textarea form__textarea",id:"review",name:"review",placeholder:"Tell how was your stay, what you like and what can be improved"}),_.jsxs("div",{className:"reviews__button-wrapper",children:[_.jsxs("p",{className:"reviews__help",children:["To submit review please make sure to set ",_.jsx("span",{className:"reviews__star",children:"rating"})," and describe your stay with at least ",_.jsx("b",{className:"reviews__text-amount",children:"50 characters"}),"."]}),_.jsx("button",{className:"reviews__submit form__submit button",type:"submit",disabled:i.lengthA.name===v.name),B=qp().filter(A=>A.id!==w);return _.jsxs("div",{className:"page",children:[_.jsx(Hs,{}),_.jsxs("main",{className:"page__main page__main--offer",children:[_.jsxs("section",{className:"offer",children:[_.jsx("div",{className:"offer__gallery-container container",children:_.jsx("div",{className:"offer__gallery",children:f.map(A=>_.jsx("div",{className:"offer__image-wrapper",children:_.jsx("img",{className:"offer__image",src:A,alt:"Photo studio"})},A))})}),_.jsx("div",{className:"offer__container container",children:_.jsxs("div",{className:"offer__wrapper",children:[d&&_.jsx("div",{className:"offer__mark",children:_.jsx("span",{children:"Premium"})}),_.jsxs("div",{className:"offer__name-wrapper",children:[_.jsx("h1",{className:"offer__name",children:l.title}),_.jsx(Kp,{componentType:"offer",isFavorite:m})]}),_.jsx(ic,{componentType:"offer",rating:S}),_.jsxs("ul",{className:"offer__features",children:[_.jsx("li",{className:"offer__feature offer__feature--entire",children:Wy(x)}),_.jsxs("li",{className:"offer__feature offer__feature--bedrooms",children:[T," Bedrooms"]}),_.jsxs("li",{className:"offer__feature offer__feature--adults",children:["Max ",z," adults"]})]}),_.jsxs("div",{className:"offer__price",children:[_.jsxs("b",{className:"offer__price-value",children:["€",M]}),_.jsx("span",{className:"offer__price-text",children:" night"})]}),_.jsxs("div",{className:"offer__inside",children:[_.jsx("h2",{className:"offer__inside-title",children:"What's inside"}),_.jsx("ul",{className:"offer__inside-list",children:E.map(A=>_.jsx("li",{className:"offer__inside-item",children:A},A))})]}),_.jsx(o0,{host:b,description:y}),_.jsxs("section",{className:"offer__reviews reviews",children:[_.jsxs("h2",{className:"reviews__title",children:["Reviews · ",_.jsx("span",{className:"reviews__amount",children:c.length})]}),_.jsx("ul",{className:"reviews__list",children:c.length>0&&c.map(A=>_.jsx(a0,{review:A},A.id))}),t===Vn.Auth&&_.jsx(u0,{})]})]})}),O&&_.jsx(Yp,{container:"offer",city:O,offers:B,activeOffer:o})]}),_.jsx("div",{className:"container",children:_.jsxs("section",{className:"near-places places",children:[_.jsx("h2",{className:"near-places__title",children:"Other places in the neighbourhood"}),_.jsx("div",{className:"near-places__list places__list",children:B.map(A=>_.jsx(rc,{offer:A,componentType:"near-places",hoverHandler:()=>a(A)},A.id))})]})})]})]})}function h0({authorizationStatus:e,children:t}){return e===Vn.Auth?t:_.jsx(tc,{to:Ke.Login})}function f0({title:e="Login"}){return qr(e),_.jsxs("div",{className:"page page--gray page--login",children:[_.jsx("header",{className:"header",children:_.jsx("div",{className:"container",children:_.jsx("div",{className:"header__wrapper",children:_.jsx("div",{className:"header__left",children:_.jsx(oc,{})})})})}),_.jsx("main",{className:"page__main page__main--login",children:_.jsxs("div",{className:"page__login-container container",children:[_.jsxs("section",{className:"login",children:[_.jsx("h1",{className:"login__title",children:"Sign in"}),_.jsxs("form",{className:"login__form form",action:"#",method:"post",children:[_.jsxs("div",{className:"login__input-wrapper form__input-wrapper",children:[_.jsx("label",{className:"visually-hidden",children:"E-mail"}),_.jsx("input",{className:"login__input form__input",type:"email",name:"email",placeholder:"Email",required:!0})]}),_.jsxs("div",{className:"login__input-wrapper form__input-wrapper",children:[_.jsx("label",{className:"visually-hidden",children:"Password"}),_.jsx("input",{className:"login__input form__input",type:"password",name:"password",placeholder:"Password",required:!0})]}),_.jsx("button",{className:"login__submit form__submit button",type:"submit",children:"Sign in"})]})]}),_.jsx("section",{className:"locations locations--login locations--current",children:_.jsx("div",{className:"locations__item",children:_.jsx("a",{className:"locations__item-link",href:"#",children:_.jsx("span",{children:"Amsterdam"})})})})]})})]})}function d0({authorizationStatus:e,children:t}){return e===Vn.NoAuth?t:_.jsx(tc,{to:Ke.Root})}function p0({offersCount:e,offers:t,offersFavorites:i}){return _.jsx(By,{children:_.jsxs(zy,{children:[_.jsx(Zn,{path:Ke.Root,element:_.jsx(tc,{to:Zg})}),Vi.map(o=>_.jsx(Zn,{path:Ke.Root+o.slug,element:_.jsx(Yy,{offers:t,offersCount:e})},o.slug)),_.jsx(Zn,{path:Ke.Login,element:_.jsx(d0,{authorizationStatus:Vn.Auth,children:_.jsx(f0,{})})}),_.jsx(Zn,{path:Ke.Favorites,element:_.jsx(h0,{authorizationStatus:Vn.Auth,children:_.jsx(Jy,{offersFavorites:i})})}),_.jsx(Zn,{path:`${Ke.Offer}/:offerId`,element:_.jsx(c0,{userAuth:Vn.Auth})}),_.jsx(Zn,{path:"/*",element:_.jsx(eu,{})})]})})}const m0=qp(),_0=t0(),v0=rl.createRoot(document.getElementById("root"));v0.render(_.jsx(If.StrictMode,{children:_.jsx(p0,{offers:m0,offersFavorites:_0,offersCount:Dg})})); diff --git a/6/index.html b/6/index.html index fbf4e68..450cba2 100644 --- a/6/index.html +++ b/6/index.html @@ -7,7 +7,7 @@ 6 cities - +