"use client";
import { t as e } from "./useIsoLayoutEffect-CKOv1bV_.js";
import { o as t, s as n, u as r } from "./useRenderElement-CmuWsiNa.js";
import * as i from "react";
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/field/control/FieldControlDataAttributes.js
var a = /*#__PURE__*/ function(e) {
	return e.disabled = "data-disabled", e.valid = "data-valid", e.invalid = "data-invalid", e.touched = "data-touched", e.dirty = "data-dirty", e.filled = "data-filled", e.focused = "data-focused", e;
}({}), o = {
	badInput: !1,
	customError: !1,
	patternMismatch: !1,
	rangeOverflow: !1,
	rangeUnderflow: !1,
	stepMismatch: !1,
	tooLong: !1,
	tooShort: !1,
	typeMismatch: !1,
	valid: null,
	valueMissing: !1
}, s = {
	valid: null,
	touched: !1,
	dirty: !1,
	filled: !1,
	focused: !1
}, c = {
	disabled: !1,
	...s
}, l = { valid(e) {
	return e === null ? null : e ? { [a.valid]: "" } : { [a.invalid]: "" };
} }, u = {
	invalid: void 0,
	name: void 0,
	validityData: {
		state: o,
		errors: [],
		error: "",
		value: "",
		initialValue: null
	},
	setValidityData: n,
	disabled: void 0,
	touched: s.touched,
	setTouched: n,
	dirty: s.dirty,
	setDirty: n,
	filled: s.filled,
	setFilled: n,
	focused: s.focused,
	setFocused: n,
	validate: () => null,
	validationMode: "onSubmit",
	validationDebounceTime: 0,
	shouldValidateOnChange: () => !1,
	state: c,
	markedDirtyRef: { current: !1 },
	registerFieldControl: n,
	validation: {
		getValidationProps: (e = t) => e,
		getInputValidationProps: (e = t) => e,
		inputRef: { current: null },
		commit: async () => {}
	}
}, d = /*#__PURE__*/ i.createContext(u);
process.env.NODE_ENV !== "production" && (d.displayName = "FieldRootContext");
function f(e = !0) {
	let t = i.useContext(d);
	if (t.setValidityData === n && !e) throw Error(process.env.NODE_ENV === "production" ? r(28) : "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.");
	return t;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/internals/field-register-control/useRegisterFieldControl.js
function p(t, n, r, a, o = !0) {
	let { registerFieldControl: s } = f(), c = i.useRef(null);
	c.current ||= Symbol(), e(() => {
		let e = c.current;
		if (!(!e || !o)) return s(e, {
			controlRef: t,
			getValue: a,
			id: n,
			value: r
		}), () => {
			s(e, void 0);
		};
	}, [
		t,
		o,
		a,
		n,
		s,
		r
	]);
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/internals/labelable-provider/LabelableContext.js
var m = /*#__PURE__*/ i.createContext({
	controlId: void 0,
	registerControlId: n,
	labelId: void 0,
	setLabelId: n,
	messageIds: [],
	setMessageIds: n,
	getDescriptionProps: (e) => e
});
process.env.NODE_ENV !== "production" && (m.displayName = "LabelableContext");
function h() {
	return i.useContext(m);
}
//#endregion
export { l as i, p as n, f as r, h as t };
