import r from"@babel/runtime/helpers/slicedToArray";import{useState as t,useCallback as n,useEffect as e,useMemo as i}from"react";var o=function(o){var c=o.minItemWidth,f=o.gap,u=t(null),a=r(u,2),s=a[0],m=a[1],v=t(0),d=r(v,2),h=d[0],l=d[1],p=n((function(r){m(r)}),[]);e((function(){if(s){l(s.offsetWidth);var r=new ResizeObserver((function(r){var t=r[0];t&&l(t.contentRect.width)}));return r.observe(s),function(){return r.disconnect()}}l(0)}),[s]);var b=i((function(){return 0===h?1:Math.floor((h+f)/(c+f))}),[h,f,c]);return{containerRef:p,isAtRightEdge:n((function(r,t){return(r+1)%b==0||r===t-1}),[b])}};export{o as useGridEdgeDetection};
//# sourceMappingURL=useGridEdgeDetection.js.map
