import{i as e}from"./chunk-aKtaBQYM.js";import{Vt as t,Y as n}from"./mui-B6lh3XSP.js";import{A as r,Ct as i,I as a,P as o,R as s}from"./index-KVuxnkWj.js";var c=e(t(),1),l=({markers:e,showTitles:t})=>{let l=(0,c.useId)(),u=s(`iconScale`,i(n().breakpoints.up(`md`))?.75:1);return(0,c.useEffect)(()=>(a.addSource(l,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),t?a.addLayer({id:l,type:`symbol`,source:l,filter:[`!has`,`point_count`],layout:{"icon-image":`{image}`,"icon-size":u,"icon-allow-overlap":!0,"text-field":`{title}`,"text-allow-overlap":!0,"text-anchor":`bottom`,"text-offset":[0,-2*u],"text-font":r(a),"text-size":12},paint:{"text-halo-color":`white`,"text-halo-width":1}}):a.addLayer({id:l,type:`symbol`,source:l,layout:{"icon-image":`{image}`,"icon-size":u,"icon-allow-overlap":!0}}),()=>{a.getLayer(l)&&a.removeLayer(l),a.getSource(l)&&a.removeSource(l)}),[t,u,l]),(0,c.useEffect)(()=>{a.getSource(l)?.setData({type:`FeatureCollection`,features:e.map(({latitude:e,longitude:t,image:n,title:r})=>({type:`Feature`,geometry:{type:`Point`,coordinates:o(t,e)},properties:{image:n||`default-neutral`,title:r||``}}))})},[t,e,l]),null};export{l as t};