import { ExpanderItem } from "./ExpanderItem.mjs";
import { c } from "react-compiler-runtime";
import React, { useState } from "react";
import { lighten, makeStyles } from "@material-ui/core";
import MuiExpansionPanel from "@material-ui/core/ExpansionPanel";
import MuiExpansionPanelSummary from "@material-ui/core/ExpansionPanelSummary";
import MuiExpansionPanelDetails from "@material-ui/core/ExpansionPanelDetails";
//#region src/UI/navigation/menus/Expander.jsx
const useStyles = makeStyles((theme) => ({
	rootPanel: {
		boxShadow: "none",
		padding: 0,
		minWidth: 300,
		"&:not(:last-child)": { borderBottom: 0 },
		"&$expanded": { margin: "auto" }
	},
	expanded: { minHeight: 40 },
	root: {
		background: (props) => props.accent ? theme.palette.primary.main : lighten(theme.palette.primary.light, .4),
		color: (props) => props.accent && theme.palette.common.white,
		marginBottom: -1,
		minHeight: 40,
		"&$expanded": {
			minHeight: 40,
			height: 20,
			paddingTop: 25,
			backgroundColor: (props) => props.accent ? theme.palette.primary.main : lighten(theme.palette.primary.light, .7)
		}
	},
	content: { "&$expanded": { margin: "12px 0" } },
	detailsRoot: {
		padding: 0,
		flexDirection: (props) => props.single ? "column" : "row"
	}
}));
const Block = (props) => {
	const $ = c(33);
	const [expanded, setExpanded] = useState("panel1");
	const classes = useStyles(props);
	let children;
	let id;
	let label;
	let number;
	let otherProps;
	if ($[0] !== props) {
		({label, children, number, id, ...otherProps} = props);
		$[0] = props;
		$[1] = children;
		$[2] = id;
		$[3] = label;
		$[4] = number;
		$[5] = otherProps;
	} else {
		children = $[1];
		id = $[2];
		label = $[3];
		number = $[4];
		otherProps = $[5];
	}
	let t0;
	if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
		t0 = (panel) => (event, newExpanded) => {
			setExpanded(newExpanded ? panel : false);
		};
		$[6] = t0;
	} else t0 = $[6];
	const handleChange = t0;
	let t1;
	if ($[7] !== classes.rootPanel) {
		t1 = { root: classes.rootPanel };
		$[7] = classes.rootPanel;
		$[8] = t1;
	} else t1 = $[8];
	const t2 = expanded === `panel${number}`;
	const t3 = `panel${number}`;
	let t4;
	if ($[9] !== t3) {
		t4 = handleChange(t3);
		$[9] = t3;
		$[10] = t4;
	} else t4 = $[10];
	let t5;
	if ($[11] !== classes.expanded || $[12] !== classes.root) {
		t5 = {
			root: classes.root,
			expanded: classes.expanded
		};
		$[11] = classes.expanded;
		$[12] = classes.root;
		$[13] = t5;
	} else t5 = $[13];
	const t6 = expanded === `panel${number}`;
	let t7;
	if ($[14] !== label || $[15] !== t6) {
		t7 = /* @__PURE__ */ React.createElement(ExpanderItem, {
			label,
			expanded: t6
		});
		$[14] = label;
		$[15] = t6;
		$[16] = t7;
	} else t7 = $[16];
	let t8;
	if ($[17] !== t5 || $[18] !== t7) {
		t8 = /* @__PURE__ */ React.createElement(MuiExpansionPanelSummary, {
			classes: t5,
			"aria-controls": "panel3d-content"
		}, t7);
		$[17] = t5;
		$[18] = t7;
		$[19] = t8;
	} else t8 = $[19];
	let t9;
	if ($[20] !== classes.detailsRoot) {
		t9 = { root: classes.detailsRoot };
		$[20] = classes.detailsRoot;
		$[21] = t9;
	} else t9 = $[21];
	let t10;
	if ($[22] !== children || $[23] !== t9) {
		t10 = /* @__PURE__ */ React.createElement(MuiExpansionPanelDetails, { classes: t9 }, children);
		$[22] = children;
		$[23] = t9;
		$[24] = t10;
	} else t10 = $[24];
	let t11;
	if ($[25] !== id || $[26] !== otherProps || $[27] !== t1 || $[28] !== t10 || $[29] !== t2 || $[30] !== t4 || $[31] !== t8) {
		t11 = /* @__PURE__ */ React.createElement(MuiExpansionPanel, {
			classes: t1,
			...otherProps,
			square: true,
			expanded: t2,
			onChange: t4,
			id
		}, t8, t10);
		$[25] = id;
		$[26] = otherProps;
		$[27] = t1;
		$[28] = t10;
		$[29] = t2;
		$[30] = t4;
		$[31] = t8;
		$[32] = t11;
	} else t11 = $[32];
	return t11;
};
//#endregion
export { Block };

//# sourceMappingURL=Expander.mjs.map