"use client";
import { createSplitProps } from "../../utils/create-split-props.js";
import { ark } from "../factory.js";
import { TimerProvider } from "./use-timer-context.js";
import { useTimer } from "./use-timer.js";
import { forwardRef } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/timer/timer-root.tsx
var splitRootProps = createSplitProps();
var TimerRoot = forwardRef((props, ref) => {
	const [useTimerProps, localProps] = splitRootProps(props, [
		"id",
		"ids",
		"autoStart",
		"interval",
		"countdown",
		"startMs",
		"targetMs",
		"translations",
		"onComplete",
		"onTick"
	]);
	const timer = useTimer(useTimerProps);
	const mergedProps = mergeProps(timer.getRootProps(), localProps);
	return /* @__PURE__ */ jsx(TimerProvider, {
		value: timer,
		children: /* @__PURE__ */ jsx(ark.div, {
			...mergedProps,
			ref
		})
	});
});
TimerRoot.displayName = "TimerRoot";
//#endregion
export { TimerRoot };
