"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),t=require("react"),l=require("../constants.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(e);exports.useMapMoveHandler=function(e){var o=e.isRadiusToolActive,i=e.radiusDrawingHandlers,s=e.isSubjectWellHovered,a=e.showTooltip,u=e.showClusterTooltip,n=e.hideTooltip;return t.useCallback((function(e){var t;o&&i.handleMouseMove(e);var d=e.features;if(null!=d&&d.length){var c=d[0];if((null===(t=c.layer)||void 0===t?void 0:t.id)!==l.MapConfig.LayerIds.WellsClusters){var v=c.properties;if(v&&"Point"===c.geometry.type){var f=r.default(c.geometry.coordinates,2),p=f[0],g=f[1],y={id:v.id,name:v.name,formation:v.formation,status:v.status,totalDepth:v.totalDepth,rigReleaseDate:v.rigReleaseDate};a({well:y,isOffsetWell:v.isOffsetWell,isSubjectWell:v.isSubjectWell,coords:{latitude:g,longitude:p}})}}else{var m,b=c.properties,h=null!==(m=null==b?void 0:b.count_selected)&&void 0!==m?m:0;if(h>0&&"Point"===c.geometry.type){var j,C,M=r.default(c.geometry.coordinates,2),W=M[0],D=M[1];u({clusterId:null!==(j=null==b?void 0:b.cluster_id)&&void 0!==j?j:0,coords:{latitude:D,longitude:W},totalCount:null!==(C=null==b?void 0:b.point_count)&&void 0!==C?C:0,selectedCount:h})}else n()}}else s||n()}),[a,u,n,s,o,i])};
//# sourceMappingURL=useMapMoveHandler.js.map
