import{useRef as n,useContext as t,useEffect as o}from"react";import{MotionConfigContext as r}from"../context/MotionConfigContext.js";import{usePointerEvent as e}from"../events/use-pointer-event.js";import{PanSession as u}from"./PanSession.js";import{useUnmountEffect as i}from"../utils/use-unmount-effect.js";function a(a,s){var f=a.onPan,c=a.onPanStart,m=a.onPanEnd,p=a.onPanSessionStart,P=f||c||m||p,l=n(null),S=t(r).transformPagePoint,d={onSessionStart:p,onStart:c,onMove:f,onEnd:function(n,t){l.current=null,m&&m(n,t)}};o((function(){null!==l.current&&l.current.updateHandlers(d)})),e(s,"pointerdown",P&&function(n){l.current=new u(n,d,{transformPagePoint:S})}),i((function(){return l.current&&l.current.end()}))}export{a as usePanGesture};
//# sourceMappingURL=use-pan-gesture.js.map
