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