"use client";
import { useRenderStrategyPropsContext } from "../../utils/render-strategy.js";
import { composeRefs } from "../../utils/compose-refs.js";
import { ark } from "../factory.js";
import { usePresence } from "../presence/use-presence.js";
import { useDialogContext } from "./use-dialog-context.js";
import { forwardRef } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/dialog/dialog-backdrop.tsx
var DialogBackdrop = forwardRef((props, ref) => {
	const dialog = useDialogContext();
	const presence = usePresence({
		...useRenderStrategyPropsContext(),
		present: dialog.open
	});
	const mergedProps = mergeProps(dialog.getBackdropProps(), presence.getPresenceProps(), props);
	if (presence.unmounted) return null;
	return /* @__PURE__ */ jsx(ark.div, {
		...mergedProps,
		ref: composeRefs(presence.ref, ref)
	});
});
DialogBackdrop.displayName = "DialogBackdrop";
//#endregion
export { DialogBackdrop };
