import { useState as o, useRef as u, useCallback as f, useEffect as l } from "../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
const m = (e = 1e3, a = !1) => {
  const [r, s] = o(a), t = u(), n = u(), c = f(() => {
    r || (n.current = setTimeout(() => {
      t.current = requestAnimationFrame(() => s(!1));
    }, e), s(!0));
  }, [r, e]);
  return l(() => () => {
    cancelAnimationFrame(t.current), clearTimeout(n.current), t.current = n.current = null;
  }, [e]), { freeze: c, frozen: r };
};
export {
  m as default,
  m as useFreezePeriod
};
