import { c } from "react-compiler-runtime";
import React from "react";
import { Button, makeStyles } from "@material-ui/core";
import clsx from "clsx";
import { Alert, AlertTitle } from "@material-ui/lab";
//#region src/UI/feedback/AmbientAlert.jsx
const useStyles = makeStyles((theme) => ({
	root: {},
	"@global": { ".MuiPaper-rounded": { borderRadius: 0 } },
	alertSuccess: { borderLeft: `4px solid ${theme.palette.success.main}` },
	alertWarning: { borderLeft: `4px solid ${theme.palette.warning.main}` },
	alertError: {
		borderLeft: `4px solid ${theme.palette.error.main}`,
		color: theme.palette.error.main
	},
	alertInfo: { borderLeft: `4px solid ${theme.palette.info.main}` },
	square: { borderRadius: 0 }
}));
const AmbientAlert = (t0) => {
	const $ = c(27);
	let alertAction;
	let alertActionButton;
	let alertHandleAction;
	let alertMessage;
	let alertSeverity;
	let alertTitle;
	let closeAlert;
	let otherProps;
	let showAlert;
	if ($[0] !== t0) {
		const { alertButton, alertMessage: t1, alertTitle: t2, showAlert: t3, alertSeverity: t4, closeAlert: t5, alertAction: t6, alertActionButton: t7, alertHandleAction: t8, ...t9 } = t0;
		alertMessage = t1;
		alertTitle = t2;
		showAlert = t3;
		alertSeverity = t4;
		closeAlert = t5;
		alertAction = t6;
		alertActionButton = t7;
		alertHandleAction = t8;
		otherProps = t9;
		$[0] = t0;
		$[1] = alertAction;
		$[2] = alertActionButton;
		$[3] = alertHandleAction;
		$[4] = alertMessage;
		$[5] = alertSeverity;
		$[6] = alertTitle;
		$[7] = closeAlert;
		$[8] = otherProps;
		$[9] = showAlert;
	} else {
		alertAction = $[1];
		alertActionButton = $[2];
		alertHandleAction = $[3];
		alertMessage = $[4];
		alertSeverity = $[5];
		alertTitle = $[6];
		closeAlert = $[7];
		otherProps = $[8];
		showAlert = $[9];
	}
	const classes = useStyles();
	let t1;
	if ($[10] !== alertSeverity || $[11] !== classes) {
		t1 = () => {
			if (alertSeverity === "success") return classes.alertSuccess;
			else if (alertSeverity === "warning") return classes.alertWarning;
			else if (alertSeverity === "error") return classes.alertError;
			else if (alertSeverity === "info") return classes.alertInfo;
		};
		$[10] = alertSeverity;
		$[11] = classes;
		$[12] = t1;
	} else t1 = $[12];
	const alertColor = t1;
	let t2;
	if ($[13] !== alertAction || $[14] !== alertActionButton || $[15] !== alertColor || $[16] !== alertHandleAction || $[17] !== alertMessage || $[18] !== alertSeverity || $[19] !== alertTitle || $[20] !== classes || $[21] !== closeAlert || $[22] !== otherProps || $[23] !== showAlert) {
		t2 = showAlert && /* @__PURE__ */ React.createElement(Alert, {
			classes: { root: clsx(alertColor(), classes.square) },
			...otherProps,
			severity: alertSeverity,
			onClose: closeAlert,
			action: alertAction ? /* @__PURE__ */ React.createElement(Button, {
				onClick: alertHandleAction,
				id: "udpRecord-AmbientAlert-alertActionButton",
				udprecordid: "udpRecord-AmbientAlert-alertActionButton"
			}, alertActionButton) : null
		}, alertTitle && /* @__PURE__ */ React.createElement(AlertTitle, null, alertTitle), alertMessage);
		$[13] = alertAction;
		$[14] = alertActionButton;
		$[15] = alertColor;
		$[16] = alertHandleAction;
		$[17] = alertMessage;
		$[18] = alertSeverity;
		$[19] = alertTitle;
		$[20] = classes;
		$[21] = closeAlert;
		$[22] = otherProps;
		$[23] = showAlert;
		$[24] = t2;
	} else t2 = $[24];
	let t3;
	if ($[25] !== t2) {
		t3 = /* @__PURE__ */ React.createElement("div", null, t2);
		$[25] = t2;
		$[26] = t3;
	} else t3 = $[26];
	return t3;
};
//#endregion
export { AmbientAlert };

//# sourceMappingURL=AmbientAlert.mjs.map