import WidgetCard from "../../WidgetCard.mjs";
import FluentStatsSnippet from "../../FluentComponents/atoms/FluentStatsSnippet.mjs";
import FluentTimeline from "../../FluentComponents/molecules/FluentTimeline.mjs";
import { c } from "react-compiler-runtime";
import React, { forwardRef } from "react";
import { Box, Grid } from "@material-ui/core";
//#region src/UI/widgets/library/BubbleWidget/BubbleWidget.jsx
const layout = {
	w: {
		default: 2,
		min: 0,
		max: 4
	},
	h: {
		default: 2,
		min: 0,
		max: 4
	}
};
const params = { mode: { defaultValue: "chart" } };
const BubbleWidget = (props, ref) => {
	const $ = c(18);
	let children;
	let other;
	let params;
	if ($[0] !== props) {
		const { children: t0, params: t1, setParam, ...t2 } = props;
		children = t0;
		params = t1;
		other = t2;
		$[0] = props;
		$[1] = children;
		$[2] = other;
		$[3] = params;
	} else {
		children = $[1];
		other = $[2];
		params = $[3];
	}
	const { mockData, theme } = params;
	const t0 = mockData?.title;
	let t1;
	if ($[4] !== mockData?.stats) {
		t1 = mockData?.stats?.map(_temp);
		$[4] = mockData?.stats;
		$[5] = t1;
	} else t1 = $[5];
	let t2;
	if ($[6] !== t1) {
		t2 = /* @__PURE__ */ React.createElement(Grid, { container: true }, t1);
		$[6] = t1;
		$[7] = t2;
	} else t2 = $[7];
	const t3 = mockData?.data;
	let t4;
	if ($[8] !== t3) {
		t4 = /* @__PURE__ */ React.createElement(Box, {
			clone: true,
			flex: 1,
			mt: 1,
			overflow: "hidden"
		}, /* @__PURE__ */ React.createElement(FluentTimeline, { categories: t3 }));
		$[8] = t3;
		$[9] = t4;
	} else t4 = $[9];
	let t5;
	if ($[10] !== children || $[11] !== other || $[12] !== ref || $[13] !== t0 || $[14] !== t2 || $[15] !== t4 || $[16] !== theme) {
		t5 = /* @__PURE__ */ React.createElement(WidgetCard, {
			ref,
			...other,
			title: t0,
			theme
		}, t2, t4, children);
		$[10] = children;
		$[11] = other;
		$[12] = ref;
		$[13] = t0;
		$[14] = t2;
		$[15] = t4;
		$[16] = theme;
		$[17] = t5;
	} else t5 = $[17];
	return t5;
};
var BubbleWidget_default = forwardRef(BubbleWidget);
function _temp(stat) {
	return /* @__PURE__ */ React.createElement(Grid, {
		item: true,
		xs: 3,
		key: stat.label
	}, /* @__PURE__ */ React.createElement(FluentStatsSnippet, {
		label: stat.label,
		amount: stat.currentValue,
		prevAmount: stat.previousValue
	}));
}
//#endregion
export { BubbleWidget_default as default, layout, params };

//# sourceMappingURL=BubbleWidget.mjs.map