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, makeStyles } from "@material-ui/core";
import { ChromeCloseIcon } from "@fluentui/react-icons";
//#region src/UI/dataDisplay/typography/SideSheetHeader.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,
		position: ({ isSticky }) => isSticky ? "sticky" : "relative",
		top: ({ isSticky }) => isSticky ? 0 : "auto",
		zIndex: ({ isSticky }) => isSticky ? 1200 : "auto"
	},
	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 SideSheetHeader = (t0) => {
	const $ = c(54);
	let props;
	let t1;
	if ($[0] !== t0) {
		({isSticky: t1, ...props} = t0);
		$[0] = t0;
		$[1] = props;
		$[2] = t1;
	} else {
		props = $[1];
		t1 = $[2];
	}
	const isSticky = t1 === void 0 ? false : t1;
	let t2;
	if ($[3] !== isSticky) {
		t2 = { isSticky };
		$[3] = isSticky;
		$[4] = t2;
	} else t2 = $[4];
	const classes = useStyles(t2);
	let buttonLabel;
	let buttonOneDisabled;
	let buttonProgress;
	let buttonTwoAction;
	let buttonTwoDisabled;
	let buttonTwoIcon;
	let buttonTwoLabel;
	let buttonTwoProgress;
	let id;
	let onClose;
	let onSubmit;
	let otherProps;
	let t3;
	let title;
	if ($[5] !== props) {
		({title, onClose, buttonLabel, onSubmit, buttonProgress, buttonTwoLabel, buttonTwoIcon, buttonTwoAction, buttonTwoProgress, id, udprecordid: t3, buttonOneDisabled, buttonTwoDisabled, ...otherProps} = props);
		$[5] = props;
		$[6] = buttonLabel;
		$[7] = buttonOneDisabled;
		$[8] = buttonProgress;
		$[9] = buttonTwoAction;
		$[10] = buttonTwoDisabled;
		$[11] = buttonTwoIcon;
		$[12] = buttonTwoLabel;
		$[13] = buttonTwoProgress;
		$[14] = id;
		$[15] = onClose;
		$[16] = onSubmit;
		$[17] = otherProps;
		$[18] = t3;
		$[19] = title;
	} else {
		buttonLabel = $[6];
		buttonOneDisabled = $[7];
		buttonProgress = $[8];
		buttonTwoAction = $[9];
		buttonTwoDisabled = $[10];
		buttonTwoIcon = $[11];
		buttonTwoLabel = $[12];
		buttonTwoProgress = $[13];
		id = $[14];
		onClose = $[15];
		onSubmit = $[16];
		otherProps = $[17];
		t3 = $[18];
		title = $[19];
	}
	const udprecordid = t3 === void 0 ? "" : t3;
	const t4 = id + "-Close";
	const t5 = udprecordid + "-Close";
	let t6;
	if ($[20] !== onClose || $[21] !== t4 || $[22] !== t5) {
		t6 = /* @__PURE__ */ React.createElement(FluentIconButton, {
			id: t4,
			udprecordid: t5,
			icon: ChromeCloseIcon,
			onClick: onClose,
			"aria-label": "Close Panel"
		});
		$[20] = onClose;
		$[21] = t4;
		$[22] = t5;
		$[23] = t6;
	} else t6 = $[23];
	let t7;
	if ($[24] !== classes.title || $[25] !== title) {
		t7 = /* @__PURE__ */ React.createElement(StandardTitle, { className: classes.title }, title);
		$[24] = classes.title;
		$[25] = title;
		$[26] = t7;
	} else t7 = $[26];
	let t8;
	if ($[27] !== classes.title || $[28] !== t6 || $[29] !== t7) {
		t8 = /* @__PURE__ */ React.createElement("div", { className: classes.title }, t6, t7);
		$[27] = classes.title;
		$[28] = t6;
		$[29] = t7;
		$[30] = t8;
	} else t8 = $[30];
	let t9;
	if ($[31] !== buttonTwoAction || $[32] !== buttonTwoDisabled || $[33] !== buttonTwoIcon || $[34] !== buttonTwoLabel || $[35] !== buttonTwoProgress || $[36] !== classes.fabProgress || $[37] !== otherProps) {
		t9 = buttonTwoLabel && /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(FluentButton, {
			color: "secondary",
			onClick: buttonTwoAction,
			disabled: buttonTwoDisabled,
			...otherProps
		}, buttonTwoProgress && /* @__PURE__ */ React.createElement(CircularProgress, {
			size: 24,
			color: "secondary",
			className: classes.fabProgress
		}), buttonTwoIcon && /* @__PURE__ */ React.createElement(FluentIcon, {
			size: "small",
			component: buttonTwoIcon,
			style: { marginRight: 8 }
		}), buttonTwoLabel));
		$[31] = buttonTwoAction;
		$[32] = buttonTwoDisabled;
		$[33] = buttonTwoIcon;
		$[34] = buttonTwoLabel;
		$[35] = buttonTwoProgress;
		$[36] = classes.fabProgress;
		$[37] = otherProps;
		$[38] = t9;
	} else t9 = $[38];
	let t10;
	if ($[39] !== buttonLabel || $[40] !== buttonOneDisabled || $[41] !== buttonProgress || $[42] !== classes.actionButton || $[43] !== classes.fabProgress || $[44] !== id || $[45] !== onSubmit || $[46] !== otherProps || $[47] !== udprecordid) {
		t10 = buttonLabel && /* @__PURE__ */ React.createElement("div", { className: classes.actionButton }, /* @__PURE__ */ React.createElement(FluentButton, {
			id: id + "-CreateView",
			udprecordid: udprecordid + "-CreateView",
			variant: "contained",
			color: "secondary",
			onClick: onSubmit,
			disabled: buttonOneDisabled,
			...otherProps
		}, buttonProgress && /* @__PURE__ */ React.createElement(CircularProgress, {
			id: id + "-ButtonProgress",
			udprecordid: udprecordid + "-ButtonProgress",
			size: 24,
			color: "secondary",
			className: classes.fabProgress
		}), buttonLabel));
		$[39] = buttonLabel;
		$[40] = buttonOneDisabled;
		$[41] = buttonProgress;
		$[42] = classes.actionButton;
		$[43] = classes.fabProgress;
		$[44] = id;
		$[45] = onSubmit;
		$[46] = otherProps;
		$[47] = udprecordid;
		$[48] = t10;
	} else t10 = $[48];
	let t11;
	if ($[49] !== classes.root || $[50] !== t10 || $[51] !== t8 || $[52] !== t9) {
		t11 = /* @__PURE__ */ React.createElement("div", { className: classes.root }, t8, t9, t10);
		$[49] = classes.root;
		$[50] = t10;
		$[51] = t8;
		$[52] = t9;
		$[53] = t11;
	} else t11 = $[53];
	return t11;
};
//#endregion
export { SideSheetHeader };

//# sourceMappingURL=SideSheetHeader.mjs.map