import { Label } from "../../ui/label.js";
import { c } from "react/compiler-runtime";
import React from "react";
import { jsx, jsxs } from "react/jsx-runtime";
const BaseFieldWrapper = (i) => {
	let a = c(27), { name: o, label: s, required: l, error: u, helpText: d, description: f, children: p, labelClassName: m, showLabel: h, helpTextPosition: g } = i, _ = m === void 0 ? "" : m, v = h === void 0 ? !0 : h, y = g === void 0 ? "after" : g, b;
	a[0] !== s || a[1] !== _ || a[2] !== o || a[3] !== l || a[4] !== v ? (b = v && /* @__PURE__ */ jsx(Label, {
		htmlFor: o,
		className: `text-sm leading-none font-medium ${l ? "after:ml-0.5 after:text-red-500 after:content-['*']" : ""} ${_}`,
		children: s
	}), a[0] = s, a[1] = _, a[2] = o, a[3] = l, a[4] = v, a[5] = b) : b = a[5];
	let x;
	a[6] !== u || a[7] !== d || a[8] !== y ? (x = y === "before" && d && !u && /* @__PURE__ */ jsx("p", {
		className: "text-muted-foreground text-sm",
		children: d
	}), a[6] = u, a[7] = d, a[8] = y, a[9] = x) : x = a[9];
	let S;
	a[10] !== f || a[11] !== u || a[12] !== o ? (S = f && !u && /* @__PURE__ */ jsx("p", {
		id: `${o}-description`,
		className: "text-muted-foreground text-sm",
		children: f
	}), a[10] = f, a[11] = u, a[12] = o, a[13] = S) : S = a[13];
	let C;
	a[14] !== u || a[15] !== d || a[16] !== y ? (C = y === "after" && d && !u && /* @__PURE__ */ jsx("p", {
		className: "text-muted-foreground text-sm",
		children: d
	}), a[14] = u, a[15] = d, a[16] = y, a[17] = C) : C = a[17];
	let w;
	a[18] === u ? w = a[19] : (w = u && /* @__PURE__ */ jsx("p", {
		className: "text-destructive text-sm font-medium",
		role: "alert",
		children: String(u.message || "Invalid value")
	}), a[18] = u, a[19] = w);
	let T;
	return a[20] !== p || a[21] !== b || a[22] !== x || a[23] !== S || a[24] !== C || a[25] !== w ? (T = /* @__PURE__ */ jsxs("div", {
		className: "mt-4 mb-8 block space-y-2",
		children: [
			b,
			x,
			p,
			S,
			C,
			w
		]
	}), a[20] = p, a[21] = b, a[22] = x, a[23] = S, a[24] = C, a[25] = w, a[26] = T) : T = a[26], T;
};
export { BaseFieldWrapper };
