try {
	let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
	n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "2f19cac2-1576-40a9-94ef-cf25d7190d05", e._sentryDebugIdIdentifier = "sentry-dbid-2f19cac2-1576-40a9-94ef-cf25d7190d05");
} catch (e) {}
import { r as useTranslation } from "./translation-Br5wIPO-.js";
import { t as createFormUtils } from "./formUtils-DERTAXyh.js";
import { t as Field } from "./Field-BEqknhTe.js";
import { t as InputText } from "./InputText-CadVntiC.js";
import { jsx, jsxs } from "preact/jsx-runtime";
//#region src/components/Shared/fields/Name/Name.tsx
var nameFields = ["firstName", "lastName"];
function Name(props) {
	const { data, handleFieldChange, errors, valid, fieldValidationErrors } = props;
	const { t } = useTranslation("common");
	if (!handleFieldChange) return;
	const formUtils = createFormUtils(props, t);
	return /* @__PURE__ */ jsxs("div", {
		className: "adyen-kyc-field-wrapper",
		children: [formUtils.isRequiredField("firstName") && /* @__PURE__ */ jsx(Field, {
			name: "firstName",
			label: formUtils.getLabel("firstName"),
			className: "u-width-half",
			errorMessage: formUtils.getErrorMessage("firstName", errors, fieldValidationErrors),
			isValid: valid?.firstName,
			helper: formUtils.getLabel("enterNameExactlyAsAppearInID"),
			children: (childProps) => /* @__PURE__ */ jsx(InputText, {
				...childProps,
				name: "firstName",
				value: data?.firstName,
				readonly: formUtils.isReadOnly("firstName"),
				onInput: handleFieldChange("firstName", "input"),
				onBlur: handleFieldChange("firstName", "blur"),
				trimOnBlur: true,
				spellCheck: false,
				"aria-required": true,
				"aria-invalid": !valid?.firstName
			})
		}), formUtils.isRequiredField("lastName") && /* @__PURE__ */ jsx(Field, {
			name: "lastName",
			label: formUtils.getLabel("lastName"),
			className: "u-width-half",
			errorMessage: formUtils.getErrorMessage("lastName", errors, fieldValidationErrors),
			isValid: valid?.lastName,
			helper: formUtils.getLabel("enterLastNameExactlyAsAppearInID"),
			children: (childProps) => /* @__PURE__ */ jsx(InputText, {
				...childProps,
				name: "lastName",
				value: data?.lastName,
				readonly: formUtils.isReadOnly("lastName"),
				onInput: handleFieldChange("lastName", "input"),
				onBlur: handleFieldChange("lastName", "blur"),
				trimOnBlur: true,
				spellCheck: false,
				"aria-required": true,
				"aria-invalid": !valid?.lastName
			})
		})]
	});
}
//#endregion
export { nameFields as n, Name as t };
