/*! YOOtheme Pro v4.4.8 | https://yootheme.com */

(function(t,w,a){"use strict";async function C(d,{type:p,center:o,zoom:s,min_zoom:b,max_zoom:x,zooming:f,dragging:G,clustering:S,cluster_icons:i,controls:v,markers:u,popup_max_width:$,baseUrl:A}){t.Icon.Default.imagePath=`${A}/images/`;const c=t.map(d,{zoom:s,minZoom:Number(b),maxZoom:Number(x),center:o,dragging:G,zoomControl:v,touchZoom:f,scrollWheelZoom:f,doubleClickZoom:f});p==="satellite"?t.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",{attribution:'&copy; <a href="https://www.esri.com">Esri</a> | DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community'}).addTo(c):t.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="http://osm.org/copyright">OpenStreetMap</a>'}).addTo(c);let l;if(S){const h={showCoverageOnHover:!1};i&&(h.iconCreateFunction=y=>{const n=y.getChildCount();let e;n<10?e=i[0]:n<100?e=i[1]||i[0]:e=i[2]||i[1]||i[0];const m=e.textColor?`style="color: ${e.textColor}"`:"";return new t.DivIcon({html:`<img src="${e.url}" alt><span class="uk-position-center"${m}>${n}</span>`,iconSize:e.size?new t.Point(...e.size):null})}),l=t.markerClusterGroup(h),c.addLayer(l)}u==null||u.forEach(({lat:h,lng:y,content:n,show_popup:e,icon:m,iconSize:g,iconAnchor:P,title:z})=>{const r=t.marker({lat:h,lng:y},{title:z});if(m&&r.setIcon(t.icon({iconUrl:m,iconSize:g,iconAnchor:P})),l?l.addLayer(r):r.addTo(c),n){const I={maxWidth:$?parseInt($,10):300};g&&(I.offset=new t.Point(0,-1*g[1]+7));const E=t.popup(I).setContent(n);r.bindPopup(E),e&&r.openPopup()}})}w.component("Map",{connected(){var p;if(this.script||(this.script=a.$("script",this.$el)),!this.script)return;this.map=JSON.parse(this.script.textContent);const d=a.$$("template",this.$el);(p=this.map.markers)==null||p.forEach((o,s)=>{o.content=a.html(d[s]).trim(),!o.icon&&this.map.icon&&(o.icon=this.map.icon,o.iconSize=this.map.iconSize,o.iconAnchor=this.map.iconAnchor)}),this.map.lazyload&&"IntersectionObserver"in window?a.observeIntersection(this.$el,(o,s)=>{C(this.$el,this.map),s.disconnect()},{rootMargin:`${window.innerHeight/2}px 0px`}):C(this.$el,this.map)}})})(L,UIkit,UIkit.util);
