import { FluentIcon } from "../../../../utilities/iconLibrary/FluentIcon.mjs";
import FUICardHeader_default from "./FUICardHeader.mjs";
import FUISquareIconButton from "../../../inputs/buttons/FUISquareIconButton.mjs";
import { FluentCard } from "./FluentCard.mjs";
import { FluentCardContent } from "./FluentCardContent.mjs";
import { FluentCardActions } from "./FluentCardActions.mjs";
import useId from "../../../widgets/utils/useId.mjs";
import { c } from "react-compiler-runtime";
import React, { forwardRef } from "react";
import { Button, Menu, makeStyles } from "@material-ui/core";
import clsx from "clsx";
import { MoreIcon } from "@fluentui/react-icons";
//#region src/UI/surfaces/cards/fluentCards/FUICard.jsx
const useStyles = makeStyles((theme) => ({
	root: {
		display: "flex",
		flexDirection: "column"
	},
	raised: { zIndex: 1 },
	contentArea: {
		flex: "1 1 auto",
		minHeight: 0,
		display: "flex",
		flexDirection: "column"
	},
	cardActions: {
		display: "flex",
		flexDirection: "row",
		justifyContent: "flex-start",
		paddingTop: theme.spacing(1),
		padding: theme.spacing(2)
	}
}), { name: "FUICard" });
let FUICardAction = (props, ref) => {
	const $ = c(7);
	let children;
	let other;
	if ($[0] !== props) {
		({children, ...other} = props);
		$[0] = props;
		$[1] = children;
		$[2] = other;
	} else {
		children = $[1];
		other = $[2];
	}
	let t0;
	if ($[3] !== children || $[4] !== other || $[5] !== ref) {
		t0 = /* @__PURE__ */ React.createElement(Button, {
			ref,
			size: "small",
			variant: "contained",
			disableElevation: true,
			...other
		}, children);
		$[3] = children;
		$[4] = other;
		$[5] = ref;
		$[6] = t0;
	} else t0 = $[6];
	return t0;
};
FUICardAction = forwardRef(FUICardAction);
let FUICardHeaderMenu = (props, ref) => {
	const $ = c(3);
	const { children } = props;
	let t0;
	if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
		t0 = /* @__PURE__ */ React.createElement(FUISquareIconButton, null, /* @__PURE__ */ React.createElement(FluentIcon, {
			component: MoreIcon,
			size: "small"
		}));
		$[0] = t0;
	} else t0 = $[0];
	let t1;
	if ($[1] !== children) {
		t1 = /* @__PURE__ */ React.createElement("div", {
			button: t0,
			menu: /* @__PURE__ */ React.createElement(Menu, null, children)
		});
		$[1] = children;
		$[2] = t1;
	} else t1 = $[2];
	return t1;
};
FUICardHeaderMenu = forwardRef(FUICardHeaderMenu);
const FUICard = (props, ref) => {
	const $ = c(38);
	const classes = useStyles();
	let CardHeaderProps;
	let CardProps;
	let actions;
	let cardProps;
	let children;
	let className;
	let headerActions;
	let name;
	let raised;
	let title;
	if ($[0] !== props) {
		({className, children, actions, title, headerActions, CardHeaderProps, CardProps, raised, name, ...cardProps} = props);
		$[0] = props;
		$[1] = CardHeaderProps;
		$[2] = CardProps;
		$[3] = actions;
		$[4] = cardProps;
		$[5] = children;
		$[6] = className;
		$[7] = headerActions;
		$[8] = name;
		$[9] = raised;
		$[10] = title;
	} else {
		CardHeaderProps = $[1];
		CardProps = $[2];
		actions = $[3];
		cardProps = $[4];
		children = $[5];
		className = $[6];
		headerActions = $[7];
		name = $[8];
		raised = $[9];
		title = $[10];
	}
	const titleId = `${useId(name, cardProps.id)}-title`;
	const t0 = raised && classes.raised;
	let t1;
	if ($[11] !== className || $[12] !== t0) {
		t1 = clsx(className, t0);
		$[11] = className;
		$[12] = t0;
		$[13] = t1;
	} else t1 = $[13];
	let t2;
	if ($[14] !== classes.root) {
		t2 = { root: classes.root };
		$[14] = classes.root;
		$[15] = t2;
	} else t2 = $[15];
	let t3;
	if ($[16] !== CardHeaderProps || $[17] !== headerActions || $[18] !== title || $[19] !== titleId) {
		t3 = /* @__PURE__ */ React.createElement(FUICardHeader_default, {
			titleId,
			headerActions,
			...CardHeaderProps
		}, title);
		$[16] = CardHeaderProps;
		$[17] = headerActions;
		$[18] = title;
		$[19] = titleId;
		$[20] = t3;
	} else t3 = $[20];
	let t4;
	if ($[21] !== children || $[22] !== classes.contentArea) {
		t4 = /* @__PURE__ */ React.createElement(FluentCardContent, { className: classes.contentArea }, children);
		$[21] = children;
		$[22] = classes.contentArea;
		$[23] = t4;
	} else t4 = $[23];
	let t5;
	if ($[24] !== actions || $[25] !== classes.cardActions) {
		t5 = actions && /* @__PURE__ */ React.createElement(FluentCardActions, { className: classes.cardActions }, actions);
		$[24] = actions;
		$[25] = classes.cardActions;
		$[26] = t5;
	} else t5 = $[26];
	let t6;
	if ($[27] !== CardProps || $[28] !== cardProps || $[29] !== raised || $[30] !== ref || $[31] !== t1 || $[32] !== t2 || $[33] !== t3 || $[34] !== t4 || $[35] !== t5 || $[36] !== titleId) {
		t6 = /* @__PURE__ */ React.createElement(FluentCard, {
			ref,
			component: "section",
			"aria-labelledby": titleId,
			...cardProps,
			raised,
			className: t1,
			...CardProps,
			classes: t2
		}, t3, t4, t5);
		$[27] = CardProps;
		$[28] = cardProps;
		$[29] = raised;
		$[30] = ref;
		$[31] = t1;
		$[32] = t2;
		$[33] = t3;
		$[34] = t4;
		$[35] = t5;
		$[36] = titleId;
		$[37] = t6;
	} else t6 = $[37];
	return t6;
};
var FUICard_default = forwardRef(FUICard);
//#endregion
export { FUICardHeaderMenu, FUICard_default as default };

//# sourceMappingURL=FUICard.mjs.map