import{r as e}from"./chunk-QTnfLwEv.js";import{n as t,t as n}from"./jsx-runtime-BWRPWl8p.js";var r=e(t(),1),i=n(),a=({height:e,width:t,center:n,tileLayer:a,zoom:o,apiKey:s,mapId:c})=>{let l=c||`map`,u=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let e=window.L.DomUtil.get(l);e!=null&&(e._leaflet_id=null);let t=window.L.map(l).setView(n||[0,0],o||12);return window.L.tileLayer(`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,{maxZoom:19,attribution:`&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors`}).addTo(t),window.L.mapquest&&window.L.mapquest.Map&&(window.L.mapquest.Map.maps[l]=t),u.current=t,()=>{window.L.mapquest&&window.L.mapquest.Map&&delete window.L.mapquest.Map.maps[l],t.remove()}},[l]),(0,r.useEffect)(()=>{if(u.current&&n){let e=parseFloat(n[0]),t=parseFloat(n[1]);!isNaN(e)&&!isNaN(t)&&u.current.setView([e,t],o||12)}},[n,o]),(0,i.jsx)(`div`,{id:l,style:{width:t,height:e},children:(0,i.jsx)(`p`,{children:`Cargando mapa...`})})};export{a as t};