"use client";
const require_create_split_props = require("../../utils/create-split-props.cjs");
const require_factory = require("../factory.cjs");
const require_split_presence_props = require("../presence/split-presence-props.cjs");
const require_use_presence = require("../presence/use-presence.cjs");
const require_use_presence_context = require("../presence/use-presence-context.cjs");
const require_use_color_picker_context = require("./use-color-picker-context.cjs");
let react = require("react");
let _zag_js_react = require("@zag-js/react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/color-picker/color-picker-root-provider.tsx
var splitRootProviderProps = require_create_split_props.createSplitProps();
var ColorPickerRootProvider = (0, react.forwardRef)((props, ref) => {
	const [presenceProps, colorPickerProps] = require_split_presence_props.splitPresenceProps(props);
	const [{ value: colorPicker }, localProps] = splitRootProviderProps(colorPickerProps, ["value"]);
	const presence = require_use_presence.usePresence((0, _zag_js_react.mergeProps)({ present: colorPicker.open }, presenceProps));
	const mergedProps = (0, _zag_js_react.mergeProps)(colorPicker.getRootProps(), localProps);
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_color_picker_context.ColorPickerProvider, {
		value: colorPicker,
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_presence_context.PresenceProvider, {
			value: presence,
			children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.div, {
				...mergedProps,
				ref
			})
		})
	});
});
ColorPickerRootProvider.displayName = "ColorPickerRootProvider";
//#endregion
exports.ColorPickerRootProvider = ColorPickerRootProvider;
