import { createChangeEvent } from "./utils/formEvents.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { UdpDateTimeInput } from "udp-react-stencil-component-library";
//#region src/UI/fluent-web-components/UdpDateTimeInput.tsx
const UdpDateTimeInput$1 = (t0) => {
	const $ = c(18);
	let error;
	let helperText;
	let hint;
	let name;
	let onChange;
	let props;
	let value;
	if ($[0] !== t0) {
		({onChange, name, value, error, helperText, hint, ...props} = t0);
		$[0] = t0;
		$[1] = error;
		$[2] = helperText;
		$[3] = hint;
		$[4] = name;
		$[5] = onChange;
		$[6] = props;
		$[7] = value;
	} else {
		error = $[1];
		helperText = $[2];
		hint = $[3];
		name = $[4];
		onChange = $[5];
		props = $[6];
		value = $[7];
	}
	let t1;
	if ($[8] !== name || $[9] !== onChange) {
		t1 = (e) => {
			onChange?.(createChangeEvent(e.detail, name, "datetime-local"));
		};
		$[8] = name;
		$[9] = onChange;
		$[10] = t1;
	} else t1 = $[10];
	const handleValueChanged = t1;
	const hintStr = typeof hint === "string" ? hint : void 0;
	let normalizedError;
	let normalizedHint;
	if (typeof error === "string") {
		normalizedError = error;
		normalizedHint = hintStr;
	} else if (typeof error === "boolean") {
		normalizedError = error ? helperText || "" : void 0;
		normalizedHint = !error ? helperText || hintStr : hintStr;
	} else normalizedHint = hintStr ?? helperText;
	let t2;
	if ($[11] !== handleValueChanged || $[12] !== name || $[13] !== normalizedError || $[14] !== normalizedHint || $[15] !== props || $[16] !== value) {
		t2 = /* @__PURE__ */ React.createElement(UdpDateTimeInput, {
			...props,
			name,
			value,
			error: normalizedError,
			hint: normalizedHint,
			onValueChanged: handleValueChanged
		});
		$[11] = handleValueChanged;
		$[12] = name;
		$[13] = normalizedError;
		$[14] = normalizedHint;
		$[15] = props;
		$[16] = value;
		$[17] = t2;
	} else t2 = $[17];
	return t2;
};
//#endregion
export { UdpDateTimeInput$1 as UdpDateTimeInput };

//# sourceMappingURL=UdpDateTimeInput.mjs.map