"use client";
import { useEnvironmentContext } from "../../providers/environment/use-environment-context.js";
import * as clipboard from "@zag-js/clipboard";
import { useId } from "react";
import { normalizeProps, useMachine } from "@zag-js/react";
//#region src/components/clipboard/use-clipboard.ts
var useClipboard = (props) => {
	const id = useId();
	const { getRootNode } = useEnvironmentContext();
	const machineProps = {
		id,
		getRootNode,
		...props
	};
	const service = useMachine(clipboard.machine, machineProps);
	return clipboard.connect(service, normalizeProps);
};
//#endregion
export { useClipboard };
