import e from"@babel/runtime/helpers/defineProperty";import{getClusterColorExpression as o}from"../utils/getClusterColorExpression.js";import{useMapStoreSelectors as t}from"./useMapStoreSelectors.js";import{useMapTooltipState as i}from"./useMapTooltipState.js";import"@babel/runtime/helpers/slicedToArray";import"react";import"geolib";import"lodash/isEqual";import"lodash/throttle";import"../../../../../../utils/index.js";import"../constants.js";import"../../../../../../utils/convert.js";import"@turf/circle";import"@turf/bbox";import"@mapbox/tilebelt";import"@babel/runtime/helpers/toConsumableArray";import"mapbox-gl";import{useWellMarkers as s}from"./useWellMarkers.js";import"../../../../stores/selection-tool-store/SelectionToolStoreContext.js";import"../../../../stores/selection-tool-store/SelectionToolStoreProvider.js";import"zustand";import"../../../../stores/viewport-store/ViewportStoreContext.js";import{useLoadingTilesGeoJSON as l}from"./useLoadingTilesGeoJSON.js";import{useSelectionToolOrchestration as r}from"./useSelectionToolOrchestration.js";import{useMapInteractionHandlers as n}from"./useMapInteractionHandlers.js";import{useMapCameraControl as a}from"./useMapCameraControl.js";function c(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);o&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),t.push.apply(t,i)}return t}function p(o){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?c(Object(i),!0).forEach((function(t){e(o,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}))}return o}var d=function(e){var c,d=e.subjectWell,u=e.wells,m=e.offsetWellIds,f=e.activeWellId,b=e.isClickable,g=t(d),h=a({mapRef:g.mapRef,subjectWellCoords:g.subjectWellCoords,subjectWell:d,isLoadAllWells:g.isLoadAllWells,isMapReady:g.isMapReady,selectionZone:e.selectionZone,shouldRecenter:e.shouldRecenter,onRecenterComplete:e.onRecenterComplete,radius:g.radius,selectionMode:g.selectionMode,circleGeoJSON:g.circleGeoJSON}),j=r({mapRef:g.mapRef,isMapReady:g.isMapReady,wells:u,offsetWellIds:m,subjectWellId:null!==(c=null==d?void 0:d.id)&&void 0!==c?c:null,isViewOnly:g.isViewOnly,onBatchSelectWells:e.onBatchSelectWells,onSelectionZoneConfirm:e.onSelectionZoneConfirm,showSelectionResult:g.showSelectionResult}),S=i({mapRef:g.mapRef,isViewOnly:g.isViewOnly,isClickable:b}),w=n({mapRef:g.mapRef,isViewOnly:g.isViewOnly,isRadiusToolActive:j.isRadiusToolActive,radiusDrawingHandlers:j.radiusDrawingHandlers,shouldSuppressClickRef:j.shouldSuppressClickRef,handleChangeOffsetWell:e.handleChangeOffsetWell,showTooltip:S.showTooltip,showClusterTooltip:S.showClusterTooltip,hideTooltip:S.hideTooltip,hoveredWell:S.hoveredWell,subjectWell:d,subjectWellCoords:g.subjectWellCoords,radiusState:j.radiusState,isRadiusDrawingDragging:j.isRadiusDrawingDragging,isRadiusHoveringEdge:j.isRadiusHoveringEdge,isRadiusHoveringInside:j.isRadiusHoveringInside,lassoState:j.lassoState,isLassoActive:j.isLassoActive,isDrawing:j.isDrawing,isEditingPolygon:j.isEditingPolygon,isEditingVertices:j.isEditingVertices,isShiftHeld:j.isShiftHeld,boxStateIsActive:j.boxState.isActive}),O=l(),y=s({wells:u,offsetWellIds:m,activeWellId:f,subjectWell:d,mapStyle:g.mapStyle});return p(p(p(p(p(p(p({},g),h),j),w),S),y),{},{showGhostZone:!!e.selectionZone&&!j.isUserDrawing,isActiveWellIsSubjectWell:(null==d?void 0:d.id)===f,loadingTilesGeoJSON:O,clusterColorExpression:o(g.mapStyle)})};export{d as useOffsetWellMapState};
//# sourceMappingURL=useOffsetWellMapState.js.map
