import { useEffect, useState } from "react";
/**
 * Returns `true` only if `value` remains `true` for at least `delayMs`.
 * Resets immediately to `false` when `value` becomes `false`.
 */
export function useDelayedTrue(value, delayMs) {
    const [delayed, setDelayed] = useState(false);
    useEffect(() => {
        if (!value) {
            setDelayed(false);
            return;
        }
        const timer = setTimeout(() => {
            setDelayed(true);
        }, delayMs);
        return () => {
            clearTimeout(timer);
        };
    }, [value, delayMs]);
    return delayed;
}
//# sourceMappingURL=useDelayedTrue.js.map