import { SummaryBlock } from "../../../dataDisplay/SummaryBlock.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { Box, Typography, makeStyles } from "@material-ui/core";
import { PropTypes as PropTypes$1 } from "prop-types";
//#region src/UI/widgets/library/CircleGaugeWidget/CircleGaugeWidget.jsx
const useStyles = makeStyles((theme) => ({
	circle: {
		width: (props) => props.width || "134px",
		minHeight: (props) => props.height || "134px",
		borderRadius: "50%",
		boxSizing: "border-box",
		display: "flex",
		flexDirection: "column",
		justifyContent: "center",
		alignItems: "center",
		padding: "8px 0px",
		background: (props) => props?.background || theme.palette.background.paper,
		border: (props) => props?.borderColor ? `2px solid ${props.borderColor}` : `2px solid #BDBDBD`
	},
	cardStat: {
		fontSize: "1.5rem",
		fontWeight: "700",
		color: "#000",
		textAlign: "center",
		display: "flex",
		flexDirection: "column",
		justifyContent: "center",
		alignItems: "center",
		padding: "0px",
		width: (props) => props.width || "134px",
		height: "50%"
	},
	primaryText: {
		display: "flex",
		flexDirection: "row",
		justifyContent: "center",
		alignItems: "center",
		padding: "0px",
		gap: "8px",
		fontWeight: "400",
		fontSize: "22px",
		fontStyle: "normal",
		width: (props) => props.width || "134px",
		height: "32px",
		margin: "-4px 0px"
	},
	secondaryText: {
		fontStyle: "normal",
		fontWeight: "400",
		fontSize: "12px",
		display: "flex",
		flexDirection: "column",
		alignItems: "center",
		padding: "0px",
		width: (props) => props.width || "134px",
		height: "20px",
		color: "rgba(0, 0, 0, 0.6)"
	},
	keySummary: {
		fontSize: "1rem",
		fontWeight: "700",
		color: "#000",
		textAlign: "center",
		lineHeight: "50px",
		display: "flex",
		flexDirection: "column",
		justifyContent: "center",
		alignItems: "center",
		padding: "0px",
		width: (props) => props.width || "134px",
		height: "50%",
		borderTop: (props) => props?.borderColor ? `2px solid ${props.borderColor}` : `2px solid #BDBDBD`
	}
}));
const DEFAULT_SUMMARY_BLOCK = {
	border: "none",
	width: "69px",
	height: "32px",
	fontStyle: "normal",
	fontWeight: 400,
	fontSize: "22px",
	label: { color: "#000" }
};
const CircleGaugeWidget = (props) => {
	const $ = c(24);
	const { value, label, textVariant: t0, secondaryValue, secondaryStartLabel, background, style: styleProps } = props;
	const textVariant = t0 === void 0 ? "h5" : t0;
	const classes = useStyles(props);
	let t1;
	if ($[0] !== classes.primaryText || $[1] !== value) {
		t1 = /* @__PURE__ */ React.createElement(Typography, { className: classes.primaryText }, value);
		$[0] = classes.primaryText;
		$[1] = value;
		$[2] = t1;
	} else t1 = $[2];
	let t2;
	if ($[3] !== classes.secondaryText || $[4] !== label) {
		t2 = /* @__PURE__ */ React.createElement(Typography, { className: classes.secondaryText }, label);
		$[3] = classes.secondaryText;
		$[4] = label;
		$[5] = t2;
	} else t2 = $[5];
	let t3;
	if ($[6] !== classes.cardStat || $[7] !== t1 || $[8] !== t2) {
		t3 = /* @__PURE__ */ React.createElement(Box, { className: classes.cardStat }, t1, t2);
		$[6] = classes.cardStat;
		$[7] = t1;
		$[8] = t2;
		$[9] = t3;
	} else t3 = $[9];
	let t4;
	if ($[10] !== background || $[11] !== secondaryStartLabel || $[12] !== secondaryValue || $[13] !== styleProps?.summaryBlock || $[14] !== textVariant) {
		t4 = secondaryValue && /* @__PURE__ */ React.createElement(SummaryBlock, {
			value: secondaryValue,
			startLabel: secondaryStartLabel || "",
			textVariant,
			backgroundColor: background,
			style: styleProps?.summaryBlock || DEFAULT_SUMMARY_BLOCK
		});
		$[10] = background;
		$[11] = secondaryStartLabel;
		$[12] = secondaryValue;
		$[13] = styleProps?.summaryBlock;
		$[14] = textVariant;
		$[15] = t4;
	} else t4 = $[15];
	let t5;
	if ($[16] !== classes.keySummary || $[17] !== t4) {
		t5 = /* @__PURE__ */ React.createElement(Box, { className: classes.keySummary }, t4);
		$[16] = classes.keySummary;
		$[17] = t4;
		$[18] = t5;
	} else t5 = $[18];
	let t6;
	if ($[19] !== classes.circle || $[20] !== styleProps || $[21] !== t3 || $[22] !== t5) {
		t6 = /* @__PURE__ */ React.createElement(Box, {
			className: classes.circle,
			style: styleProps
		}, t3, t5);
		$[19] = classes.circle;
		$[20] = styleProps;
		$[21] = t3;
		$[22] = t5;
		$[23] = t6;
	} else t6 = $[23];
	return t6;
};
CircleGaugeWidget.propTypes = {
	value: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]).isRequired,
	label: PropTypes$1.string,
	textVariant: PropTypes$1.string,
	secondaryValue: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]).isRequired,
	secondaryStartLabel: PropTypes$1.string,
	background: PropTypes$1.string,
	style: PropTypes$1.object
};
//#endregion
export { CircleGaugeWidget };

//# sourceMappingURL=CircleGaugeWidget.mjs.map