import{O as g,b as h}from"./index-CCifRZXy.js";import{b as f,H as m,o as s,c as y,e as v,w,h as b,j as c,A as k,p as B,r as u}from"./app-B-4i4xU3.js";const _={style:{width:"100%",height:"300px"}},L="AIzaSyBO0p0HW9N2P0f_4QIuzdIK14ffob5B_BQ",x={__name:"MapDisplay",props:{enableSetLocation:{type:Boolean,default:!1},width:{type:String,default:"100%"},height:{type:String,default:"300px"},latitude:{type:Number},longitude:{type:Number},hasOldValue:{type:Boolean,default:!1}},emits:["location-updated"],setup(o,{emit:d}){const a=o,l=d,n=u(!1),e=u({lat:40.6892,lng:-74.0445}),r=t=>{if(!a.enableSetLocation)return;const i=t.latLng.lat(),p=t.latLng.lng();e.value={lat:i,lng:p},console.log("New Marker Position:",e.value),l("location-updated",e.value)};return f(()=>{n.value=!0,navigator.geolocation&&!a.hasOldValue&&navigator.geolocation.getCurrentPosition(t=>{e.value={lat:t.coords.latitude,lng:t.coords.longitude},l("location-updated",e.value)},t=>{console.warn("Location access denied")})}),m([()=>a.latitude,()=>a.longitude],()=>{e.value={lat:a.latitude,lng:a.longitude},l("location-updated",e.value)}),(t,i)=>(s(),y("div",_,[n.value?(s(),v(c(h),{key:0,"api-key":L,style:k("width:"+o.width+"; height:"+o.height),center:e.value,zoom:15,onClick:r},{default:w(()=>[b(c(g),{options:{position:e.value}},null,8,["options"])]),_:1},8,["style","center"])):B("",!0)]))}};export{x as _};
