import e from"@babel/runtime/helpers/slicedToArray";import{useState as t,useCallback as n,useEffect as i,useMemo as o}from"react";import{usePickerPropsStore as r}from"../../stores/picker-props-store/usePickerPropsStore.js";import{useViewStore as l}from"../../stores/view-store/useViewStore.js";var c=function(c){var s=c.data,u=c.isLimitedOffsetWells,f=c.maxOffsetWellNumber,a=c.metricsKeys,d=c.isWellSectionColumnVisible,h=c.handleChangeOffsetWell,p=c.setActiveWellId,m=c.onRowClick,k=c.registerRow,w=r((function(e){return e.isWDUser})),C=r((function(e){return e.isViewOnly})),W=l((function(e){return e.isMapHidden})),b=t(s.checked),v=e(b,2),O=v[0],g=v[1],x=n((function(e){k(s.id,e)}),[k,s.id]);i((function(){g(s.checked)}),[s.checked]);var y=o((function(){return C?"View only mode. To edit offsets, use ".concat(w?"Offset Well Selection app":"WellHub","."):u&&!s.checked?"App can't process more than (".concat(f-1,") Offset Wells."):""}),[C,u,s.checked,w,f]),M=o((function(){return d?"wellSection":a.length>0?"lastMetric":"lastActive"}),[d,a.length]);return{isViewOnly:C,isMapHidden:W,isChecked:O,rowRef:x,handleChangeCheckbox:function(e){h(s,e),g(e)},checkboxTooltipText:y,lastCellColumn:M,handleMouseEnter:function(){p(s.id)},handleMouseLeave:function(){p(null)},handleRowClick:function(){W||null==m||m(s.id)}}};export{c as useRowInteractions};
//# sourceMappingURL=useRowInteractions.js.map
