(()=>{var{attach:u,util:h}=window.csGlobal.rivet;var w=new WeakMap,k=o=>{if(!w.has(o)){let e={markers:new Set,active:!1};w.set(o,e)}return w.get(o)};u("[data-x-element-map_google_marker]",(o,e)=>{let a=k(o.closest("[data-x-element-map-google]"));M(a,e)},10);function M(o,{lat:e,lng:a,imageSrc:r,imageWidth:n,imageOffsetX:s,imageHeight:l,imageOffsetY:i,imageRetina:b,content:d,contentStart:y}){let{markers:C}=o;C.add(p=>{let g={map:p,position:new window.google.maps.LatLng(parseFloat(e),parseFloat(a))};if(r){let t={url:r,origin:new window.google.maps.Point(0,0)},f=Math.abs(n/(100/parseFloat(s))-n/2),m=Math.abs(l/(100/parseFloat(i))-l/2);b?(t.anchor=new window.google.maps.Point(f/2,m/2),t.scaledSize=new window.google.maps.Size(n/2,l/2)):(t.anchor=new window.google.maps.Point(f,m),t.size=new window.google.maps.Size(n,l)),g.icon=t}let c=new window.google.maps.Marker(g);if(d!==""){let t=new window.google.maps.InfoWindow({content:d,maxWidth:200});y==="open"&&t.open(p,c),window.google.maps.event.addListener(c,"click",function(){t.open(p,this)})}})}u("[data-x-element-map-google]",(o,e={})=>{if(!window.google||!window.google.maps)return;let a=k(o),r=o.getAttribute("data-x-map-markers");if(r&&JSON.parse(r).forEach(function(i){!i||typeof i!="object"||M(a,i)}),a.active)return;a.active=!0;let n=new window.google.maps.LatLng(e.lat,e.lng),s=new window.google.maps.Map(o,{mapTypeId:"roadmap",center:n,draggable:e.drag,zoomControl:e.zoom,zoom:parseInt(e.zoomLevel,10),clickableIcons:!1,disableDefaultUI:!0,disableDoubleClickZoom:!1,fullscreenControl:!1,mapTypeControl:!1,rotateControl:!1,scrollwheel:!1,streetViewControl:!1,backgroundColor:"transparent"});s.mapTypes.set("map_google",new window.google.maps.StyledMapType(e.styles===""?null:JSON.parse(e.styles),{name:"Styled Map"})),s.setMapTypeId("map_google"),a.markers.forEach(l=>void l(s)),e.drag||s.addListener("center_changed",function(){s.panTo(n)})},100);})();
