"use client";
import { createSplitProps } from "../../utils/create-split-props.js";
import { ark } from "../factory.js";
import { useSelectContext } from "./use-select-context.js";
import { SelectItemGroupPropsProvider } from "./use-select-item-group-props.js";
import { forwardRef, useId } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/select/select-item-group.tsx
var splitItemGroupProps = createSplitProps();
var SelectItemGroup = forwardRef((props, ref) => {
	const id = useId();
	const [_itemGroupProps, localProps] = splitItemGroupProps(props, ["id"]);
	const itemGroupProps = {
		id,
		..._itemGroupProps
	};
	const mergedProps = mergeProps(useSelectContext().getItemGroupProps(itemGroupProps), localProps);
	return /* @__PURE__ */ jsx(SelectItemGroupPropsProvider, {
		value: itemGroupProps,
		children: /* @__PURE__ */ jsx(ark.div, {
			...mergedProps,
			ref
		})
	});
});
SelectItemGroup.displayName = "SelectItemGroup";
//#endregion
export { SelectItemGroup };
