import { UdpTabs } from "./UdpTabs.mjs";
import { UdpTabPanel } from "./UdpTabPanel.mjs";
import { c } from "react-compiler-runtime";
import React, { useState } from "react";
//#region src/UI/navigation/tabs/UdpTabUtility.jsx
const UdpTabUtility = (props) => {
	const $ = c(16);
	const { tabList, menuWidth, menuMaxHeight, menuItemProps, variant } = props;
	const [selectedTab, setSelectedTab] = useState(0);
	let t0;
	if ($[0] !== tabList) {
		t0 = tabList?.map(_temp);
		$[0] = tabList;
		$[1] = t0;
	} else t0 = $[1];
	const currentTabList = t0;
	let t1;
	if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
		t1 = (e, value) => {
			setSelectedTab(value);
		};
		$[2] = t1;
	} else t1 = $[2];
	let t2;
	if ($[3] !== currentTabList || $[4] !== menuItemProps || $[5] !== menuMaxHeight || $[6] !== menuWidth || $[7] !== selectedTab || $[8] !== variant) {
		t2 = /* @__PURE__ */ React.createElement(UdpTabs, {
			value: selectedTab,
			onChange: t1,
			tabList: currentTabList,
			menuItemProps,
			menuWidth,
			menuMaxHeight,
			variant
		});
		$[3] = currentTabList;
		$[4] = menuItemProps;
		$[5] = menuMaxHeight;
		$[6] = menuWidth;
		$[7] = selectedTab;
		$[8] = variant;
		$[9] = t2;
	} else t2 = $[9];
	let t3;
	if ($[10] !== currentTabList || $[11] !== selectedTab) {
		t3 = currentTabList?.map((tab_0) => /* @__PURE__ */ React.createElement(UdpTabPanel, {
			key: tab_0?.id,
			index: tab_0?.id,
			value: selectedTab
		}, tab_0?.child));
		$[10] = currentTabList;
		$[11] = selectedTab;
		$[12] = t3;
	} else t3 = $[12];
	let t4;
	if ($[13] !== t2 || $[14] !== t3) {
		t4 = /* @__PURE__ */ React.createElement("div", null, t2, t3);
		$[13] = t2;
		$[14] = t3;
		$[15] = t4;
	} else t4 = $[15];
	return t4;
};
function _temp(tab, index) {
	return {
		id: index,
		...tab
	};
}
//#endregion
export { UdpTabUtility };

//# sourceMappingURL=UdpTabUtility.mjs.map