import { FluentButton } from "../../inputs/buttons/FluentButton.mjs";
import { FluentIcon } from "../../../utilities/iconLibrary/FluentIcon.mjs";
import { FluentIconButton } from "../../inputs/buttons/FluentIconButton.mjs";
import { StandardTitle } from "./StandardTitle.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { CircularProgress, Typography, makeStyles, useTheme } from "@material-ui/core";
import clsx from "clsx";
import { ChromeCloseIcon } from "@fluentui/react-icons";
//#region src/UI/dataDisplay/typography/SidebarHeader.jsx
const useStyles = makeStyles((theme) => ({
	root: {
		display: "flex",
		flexDirection: "row",
		padding: theme.spacing(1),
		paddingLeft: 0,
		background: theme?.getThemeData()?.mode === "dark" ? theme.palette.grey[800] : theme.palette.common.white
	},
	title: {
		display: "flex",
		flex: 1,
		alignItems: "center",
		marginLeft: theme.spacing(1.5)
	},
	actionButton: {
		marginRight: theme.spacing(1),
		position: "relative"
	},
	fabProgress: {
		position: "absolute",
		top: 4,
		left: "35%",
		zIndex: 1
	}
}));
const SidebarHeader = (props) => {
	const $ = c(60);
	let additionalInputs;
	let buttonLabel;
	let buttonProgress;
	let classProps;
	let hideCloseButton;
	let onClose;
	let onSubmit;
	let otherProps;
	let secondaryButtonLabel;
	let secondaryButtonProgress;
	let t0;
	let t1;
	let t2;
	let t3;
	let t4;
	let title;
	if ($[0] !== props) {
		({title, onClose, buttonLabel, buttonProgress, buttonVariant: t0, buttonIcon: t1, onSubmit, secondaryButtonLabel, secondaryButtonProgress, secondaryButtonVariant: t2, secondaryButtonIcon: t3, secondaryOnSubmit: t4, additionalInputs, classes: classProps, hideCloseButton, ...otherProps} = props);
		$[0] = props;
		$[1] = additionalInputs;
		$[2] = buttonLabel;
		$[3] = buttonProgress;
		$[4] = classProps;
		$[5] = hideCloseButton;
		$[6] = onClose;
		$[7] = onSubmit;
		$[8] = otherProps;
		$[9] = secondaryButtonLabel;
		$[10] = secondaryButtonProgress;
		$[11] = t0;
		$[12] = t1;
		$[13] = t2;
		$[14] = t3;
		$[15] = t4;
		$[16] = title;
	} else {
		additionalInputs = $[1];
		buttonLabel = $[2];
		buttonProgress = $[3];
		classProps = $[4];
		hideCloseButton = $[5];
		onClose = $[6];
		onSubmit = $[7];
		otherProps = $[8];
		secondaryButtonLabel = $[9];
		secondaryButtonProgress = $[10];
		t0 = $[11];
		t1 = $[12];
		t2 = $[13];
		t3 = $[14];
		t4 = $[15];
		title = $[16];
	}
	const buttonVariant = t0 === void 0 ? "contained" : t0;
	const buttonIcon = t1 === void 0 ? null : t1;
	const secondaryButtonVariant = t2 === void 0 ? "contained" : t2;
	const secondaryButtonIcon = t3 === void 0 ? "" : t3;
	const secondaryOnSubmit = t4 === void 0 ? _temp : t4;
	const classes = useStyles(props);
	let t5;
	if ($[17] !== classProps) {
		t5 = classProps || {};
		$[17] = classProps;
		$[18] = t5;
	} else t5 = $[18];
	const { root, actionButton } = t5;
	const theme = useTheme();
	let t6;
	if ($[19] !== classes.root || $[20] !== root) {
		t6 = clsx(classes.root, root);
		$[19] = classes.root;
		$[20] = root;
		$[21] = t6;
	} else t6 = $[21];
	let t7;
	if ($[22] !== hideCloseButton || $[23] !== onClose) {
		t7 = !hideCloseButton && /* @__PURE__ */ React.createElement(FluentIconButton, {
			id: "udpRecord-SidebarHeader-ClosePanel",
			udprecordid: "udpRecord-SidebarHeader-ClosePanel",
			icon: ChromeCloseIcon,
			onClick: onClose,
			"aria-label": "Close Panel"
		});
		$[22] = hideCloseButton;
		$[23] = onClose;
		$[24] = t7;
	} else t7 = $[24];
	let t8;
	if ($[25] !== classes.title || $[26] !== title) {
		t8 = /* @__PURE__ */ React.createElement(StandardTitle, { className: classes.title }, title);
		$[25] = classes.title;
		$[26] = title;
		$[27] = t8;
	} else t8 = $[27];
	let t9;
	if ($[28] !== classes.title || $[29] !== t7 || $[30] !== t8) {
		t9 = /* @__PURE__ */ React.createElement("div", { className: classes.title }, t7, t8);
		$[28] = classes.title;
		$[29] = t7;
		$[30] = t8;
		$[31] = t9;
	} else t9 = $[31];
	let t10;
	if ($[32] !== actionButton || $[33] !== classes.actionButton || $[34] !== classes.fabProgress || $[35] !== otherProps || $[36] !== secondaryButtonIcon || $[37] !== secondaryButtonLabel || $[38] !== secondaryButtonProgress || $[39] !== secondaryButtonVariant || $[40] !== secondaryOnSubmit || $[41] !== theme) {
		t10 = secondaryButtonLabel && /* @__PURE__ */ React.createElement("div", { className: clsx(classes.actionButton, actionButton) }, /* @__PURE__ */ React.createElement(FluentButton, {
			variant: secondaryButtonVariant,
			color: "secondary",
			onClick: secondaryOnSubmit,
			height: theme.spacing(5.25),
			...otherProps
		}, secondaryButtonProgress && /* @__PURE__ */ React.createElement(CircularProgress, {
			size: theme.spacing(3),
			color: "secondary",
			className: classes.fabProgress
		}), secondaryButtonIcon && /* @__PURE__ */ React.createElement(FluentIcon, {
			size: "small",
			component: secondaryButtonIcon,
			color: "primary",
			style: { marginRight: theme.spacing(1) }
		}), /* @__PURE__ */ React.createElement(Typography, null, secondaryButtonLabel)));
		$[32] = actionButton;
		$[33] = classes.actionButton;
		$[34] = classes.fabProgress;
		$[35] = otherProps;
		$[36] = secondaryButtonIcon;
		$[37] = secondaryButtonLabel;
		$[38] = secondaryButtonProgress;
		$[39] = secondaryButtonVariant;
		$[40] = secondaryOnSubmit;
		$[41] = theme;
		$[42] = t10;
	} else t10 = $[42];
	let t11;
	if ($[43] !== actionButton || $[44] !== buttonIcon || $[45] !== buttonLabel || $[46] !== buttonProgress || $[47] !== buttonVariant || $[48] !== classes.actionButton || $[49] !== classes.fabProgress || $[50] !== onSubmit || $[51] !== otherProps || $[52] !== theme) {
		t11 = buttonLabel && /* @__PURE__ */ React.createElement("div", { className: clsx(classes.actionButton, actionButton) }, /* @__PURE__ */ React.createElement(FluentButton, {
			variant: buttonVariant,
			color: "secondary",
			onClick: onSubmit,
			height: theme.spacing(5.25),
			...otherProps
		}, buttonProgress && /* @__PURE__ */ React.createElement(CircularProgress, {
			size: theme.spacing(3),
			color: "secondary",
			className: classes.fabProgress
		}), buttonIcon && /* @__PURE__ */ React.createElement(FluentIcon, {
			size: "small",
			component: buttonIcon,
			color: "primary",
			style: { marginRight: theme.spacing(1) }
		}), /* @__PURE__ */ React.createElement(Typography, null, buttonLabel)));
		$[43] = actionButton;
		$[44] = buttonIcon;
		$[45] = buttonLabel;
		$[46] = buttonProgress;
		$[47] = buttonVariant;
		$[48] = classes.actionButton;
		$[49] = classes.fabProgress;
		$[50] = onSubmit;
		$[51] = otherProps;
		$[52] = theme;
		$[53] = t11;
	} else t11 = $[53];
	let t12;
	if ($[54] !== additionalInputs || $[55] !== t10 || $[56] !== t11 || $[57] !== t6 || $[58] !== t9) {
		t12 = /* @__PURE__ */ React.createElement("div", { className: t6 }, t9, additionalInputs, t10, t11);
		$[54] = additionalInputs;
		$[55] = t10;
		$[56] = t11;
		$[57] = t6;
		$[58] = t9;
		$[59] = t12;
	} else t12 = $[59];
	return t12;
};
function _temp() {}
//#endregion
export { SidebarHeader };

//# sourceMappingURL=SidebarHeader.mjs.map