"use client";
import { createSplitProps } from "../../utils/create-split-props.js";
import { ark } from "../factory.js";
import { useSelectContext } from "./use-select-context.js";
import { SelectItemProvider } from "./use-select-item-context.js";
import { SelectItemPropsProvider } from "./use-select-item-props-context.js";
import { forwardRef } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/select/select-item.tsx
var splitItemProps = createSplitProps();
var SelectItem = forwardRef((props, ref) => {
	const [itemProps, localProps] = splitItemProps(props, ["item", "persistFocus"]);
	const select = useSelectContext();
	const mergedProps = mergeProps(select.getItemProps(itemProps), localProps);
	return /* @__PURE__ */ jsx(SelectItemPropsProvider, {
		value: itemProps,
		children: /* @__PURE__ */ jsx(SelectItemProvider, {
			value: select.getItemState(itemProps),
			children: /* @__PURE__ */ jsx(ark.div, {
				...mergedProps,
				ref
			})
		})
	});
});
SelectItem.displayName = "SelectItem";
//#endregion
export { SelectItem };
