"use client";
import { useEnvironmentContext } from "../environment/use-environment-context.js";
import { useCallback, useSyncExternalStore } from "react";
import { getInteractionModality, trackInteractionModality } from "@zag-js/focus-visible";
//#region src/providers/interaction/use-interaction-modality.ts
function useInteractionModality() {
	const { getRootNode } = useEnvironmentContext();
	return useSyncExternalStore(useCallback((onChange) => trackInteractionModality({
		root: getRootNode(),
		onChange
	}), [getRootNode]), getInteractionModality, () => null);
}
//#endregion
export { useInteractionModality };
