import e from"@babel/runtime/helpers/toConsumableArray";import{useMemo as t}from"react";import{partitionWells as r,createWellFeature as l}from"./utils/well-markers-utils.js";var n=function(n){var i=n.wells,u=n.offsetWellIds,o=n.activeWellId,f=n.subjectWell,s=n.mapStyle,a="satellite"===s,c=t((function(){return new Set(u)}),[u]),p=t((function(){var t=r(i,null==f?void 0:f.id,c),n=t.offsetWells,u=t.unSelectedWells,o=[].concat(e(u),e(n)),p=[];return o.forEach((function(e){var t=l(e,f,c,s,a);t&&p.push(t)})),{type:"FeatureCollection",features:p}}),[i,c,f,s,a]),d=t((function(){return{type:"FeatureCollection",features:p.features.filter((function(e){return e.properties.isOffsetWell}))}}),[p]),m=t((function(){if(!o||o===(null==f?void 0:f.id))return null;var e=p.features.find((function(e){return e.properties.id===o}));return e?{type:"FeatureCollection",features:[e]}:null}),[p,o,null==f?void 0:f.id]);return{wellsGeoJSON:p,highlightGeoJSON:d,activeHighlightGeoJSON:m}};export{n as useWellMarkers};
//# sourceMappingURL=useWellMarkers.js.map
