import { c } from "react-compiler-runtime";
import React from "react";
import { InputAdornment, makeStyles } from "@material-ui/core";
import { KeyboardDateTimePicker, MuiPickersUtilsProvider } from "@material-ui/pickers";
import DateFnsUtils from "@date-io/date-fns";
import { EventDateIcon } from "@fluentui/react-icons";
import PropTypes from "prop-types";
//#region src/UI/inputs/pickers/FluentDateTimePicker.jsx
const useStyles = makeStyles((theme) => ({
	root: {},
	inputRoot: { fontSize: 12 },
	input: {
		borderRadius: 2,
		height: 32,
		padding: 0,
		paddingLeft: theme.spacing(1)
	},
	formTextInput: { fontSize: 14 },
	labelRoot: { fontSize: 14 },
	FormControl: {
		display: "none",
		marginTop: 0
	}
}));
const FluentDateTimePicker = (props) => {
	const $ = c(42);
	const classes = useStyles();
	let endAdornment;
	let id;
	let label;
	let onChangeProp;
	let otherProps;
	let selectedDate;
	let startAdornment;
	let udprecordid;
	if ($[0] !== props) {
		({id, udprecordid, label, startAdornment, endAdornment, handleDateChange: onChangeProp, selectedDate, ...otherProps} = props);
		$[0] = props;
		$[1] = endAdornment;
		$[2] = id;
		$[3] = label;
		$[4] = onChangeProp;
		$[5] = otherProps;
		$[6] = selectedDate;
		$[7] = startAdornment;
		$[8] = udprecordid;
	} else {
		endAdornment = $[1];
		id = $[2];
		label = $[3];
		onChangeProp = $[4];
		otherProps = $[5];
		selectedDate = $[6];
		startAdornment = $[7];
		udprecordid = $[8];
	}
	let t0;
	if ($[9] !== onChangeProp) {
		t0 = (e, value) => onChangeProp?.(e, value);
		$[9] = onChangeProp;
		$[10] = t0;
	} else t0 = $[10];
	const onChange = t0;
	const t1 = udprecordid + "-button";
	let t2;
	if ($[11] !== t1) {
		t2 = {
			"aria-label": "change date",
			udprecordid: t1
		};
		$[11] = t1;
		$[12] = t2;
	} else t2 = $[12];
	let t3;
	if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
		t3 = /* @__PURE__ */ React.createElement(EventDateIcon, { style: { fontSize: 16 } });
		$[13] = t3;
	} else t3 = $[13];
	const t4 = props.InputProps?.classes;
	let t5;
	if ($[14] !== classes.formTextInput || $[15] !== classes.input || $[16] !== t4) {
		t5 = {
			root: classes.input,
			input: classes.formTextInput,
			...t4
		};
		$[14] = classes.formTextInput;
		$[15] = classes.input;
		$[16] = t4;
		$[17] = t5;
	} else t5 = $[17];
	let t6;
	if ($[18] !== classes.inputRoot) {
		t6 = { root: classes.inputRoot };
		$[18] = classes.inputRoot;
		$[19] = t6;
	} else t6 = $[19];
	let t7;
	if ($[20] !== classes.inputRoot || $[21] !== label || $[22] !== t6) {
		t7 = /* @__PURE__ */ React.createElement(InputAdornment, {
			classes: t6,
			className: classes.inputRoot,
			position: "start"
		}, label);
		$[20] = classes.inputRoot;
		$[21] = label;
		$[22] = t6;
		$[23] = t7;
	} else t7 = $[23];
	let t8;
	if ($[24] !== endAdornment || $[25] !== props.InputProps || $[26] !== startAdornment || $[27] !== t5 || $[28] !== t7) {
		t8 = {
			classes: t5,
			...props.InputProps,
			...startAdornment,
			...endAdornment,
			startAdornment: t7
		};
		$[24] = endAdornment;
		$[25] = props.InputProps;
		$[26] = startAdornment;
		$[27] = t5;
		$[28] = t7;
		$[29] = t8;
	} else t8 = $[29];
	let t9;
	if ($[30] !== classes.labelFocused || $[31] !== classes.labelRoot) {
		t9 = {
			shrink: false,
			classes: {
				root: classes.labelRoot,
				focused: classes.labelFocused
			}
		};
		$[30] = classes.labelFocused;
		$[31] = classes.labelRoot;
		$[32] = t9;
	} else t9 = $[32];
	let t10;
	if ($[33] !== id || $[34] !== onChange || $[35] !== otherProps || $[36] !== selectedDate || $[37] !== t2 || $[38] !== t8 || $[39] !== t9 || $[40] !== udprecordid) {
		t10 = /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(MuiPickersUtilsProvider, { utils: DateFnsUtils }, /* @__PURE__ */ React.createElement(KeyboardDateTimePicker, {
			format: "MM/dd/yyyy HH:mm",
			margin: "normal",
			id,
			udprecordid,
			inputVariant: "outlined",
			value: selectedDate,
			onChange,
			...otherProps,
			KeyboardButtonProps: t2,
			keyboardIcon: t3,
			InputProps: t8,
			InputLabelProps: t9
		})));
		$[33] = id;
		$[34] = onChange;
		$[35] = otherProps;
		$[36] = selectedDate;
		$[37] = t2;
		$[38] = t8;
		$[39] = t9;
		$[40] = udprecordid;
		$[41] = t10;
	} else t10 = $[41];
	return t10;
};
FluentDateTimePicker.propTypes = { label: PropTypes.string.isRequired };
//#endregion
export { FluentDateTimePicker };

//# sourceMappingURL=FluentDateTimePicker.mjs.map