"use client";
import { createSplitProps } from "../../utils/create-split-props.js";
import { ark } from "../factory.js";
import { useNavigationMenuContext } from "./use-navigation-menu-context.js";
import { useNavigationMenuItemPropsContext } from "./use-navigation-menu-item-props-context.js";
import { ensure } from "@zag-js/utils";
import { forwardRef } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/navigation-menu/navigation-menu-trigger.tsx
var splitItemProps = createSplitProps();
var NavigationMenuTrigger = forwardRef((props, ref) => {
	const itemContext = useNavigationMenuItemPropsContext();
	ensure(itemContext, () => "NavigationMenu.Trigger must be used within NavigationMenu.Item");
	const value = itemContext.value;
	const disabled = props.disabled ?? itemContext.disabled;
	const [triggerProps, localProps] = splitItemProps({
		...props,
		value,
		disabled
	}, ["value", "disabled"]);
	const mergedProps = mergeProps(useNavigationMenuContext().getTriggerProps(triggerProps), localProps);
	return /* @__PURE__ */ jsx(ark.button, {
		...mergedProps,
		ref
	});
});
NavigationMenuTrigger.displayName = "NavigationMenuTrigger";
//#endregion
export { NavigationMenuTrigger };
