"use client";
import { addGlobalEventListener } from '../../../../../../@ariakit_core@0.4.15/node_modules/@ariakit/core/esm/utils/events.js';
import { useRef, useEffect } from 'react';

function usePreviousMouseDownRef(enabled) {
  const previousMouseDownRef = useRef();
  useEffect(() => {
    if (!enabled) {
      previousMouseDownRef.current = null;
      return;
    }
    const onMouseDown = (event) => {
      previousMouseDownRef.current = event.target;
    };
    return addGlobalEventListener("mousedown", onMouseDown, true);
  }, [enabled]);
  return previousMouseDownRef;
}

export { usePreviousMouseDownRef };
//# sourceMappingURL=HLTQOHKZ.js.map
