export type MobilePanelGestureDirection = -1 | 1; export type MobilePanelGestureIntent = "activate" | "fail" | "wait"; export function resolveMobilePanelGestureIntent(input: { deltaX: number; deltaY: number; direction: MobilePanelGestureDirection; openGesturesBlocked: boolean; }): MobilePanelGestureIntent { "worklet"; if (input.openGesturesBlocked) { return "fail"; } const directedDelta = input.deltaX * input.direction; const absDeltaX = Math.abs(input.deltaX); const absDeltaY = Math.abs(input.deltaY); if (directedDelta <= -10 || (absDeltaY > 10 && absDeltaY > absDeltaX)) { return "fail"; } if (directedDelta >= 15 && absDeltaX > absDeltaY) { return "activate"; } return "wait"; }