import { ConfigService } from "../configService/index.mjs";
import { UdpPageEnums } from "../enums/pageEnums.mjs";
import { PageLoading } from "../UI/feedback/PageLoading.mjs";
import { useMenuContext } from "../utilities/menus/MenuProvider.mjs";
import { PrivateRoute } from "./PrivateRoute.mjs";
import { PublicRoute } from "./PublicRoute.mjs";
import { c } from "react-compiler-runtime";
import React, { Suspense, lazy } from "react";
import { Redirect, Route, Switch } from "react-router-dom";
//#region src/routes/UdpRoutes.jsx
const VirtualBrowser = lazy(() => import("../maintenanceEngine/virtualBrowser/VirtualBrowser.mjs"));
const MenuPage = lazy(() => import("../menuPage/MenuPage.mjs"));
const UdpPublicForm = lazy(() => import("../udp/pages/UdpFormsPublicForm/index.mjs"));
const WorkflowContainer = lazy(() => import("../workflow/WorkflowContainer.mjs"));
const PasswordResetRedirect = lazy(() => import("./components/PasswordResetRedirect.mjs"));
const MyExportsPage = lazy(() => import("../udp/export/MyExportsPage.mjs"));
const PageNotFoundRoute = lazy(() => import("./components/PageNotFoundRoute.mjs"));
const UdpMaintenanceConfigPage = lazy(() => import("../udp/pages/UdpMaintenanceConfigPage/index.mjs"));
const UdpMaintenanceEnginePage = lazy(() => import("../udp/pages/UdpMaintenanceEnginePage/index.mjs"));
const AadCallback = lazy(() => import("../utilities/auth/AadCallback.mjs"));
const UdpTransactionsPage = lazy(() => import("../udp/pages/UdpTransactionsPage/index.mjs"));
const UdpTransactionTypesPage = lazy(() => import("../udp/pages/UdpTransactionTypesPage/index.mjs"));
const PageContainer = lazy(() => import("../page/PageContainer/index.mjs").then((module) => ({ default: module.PageContainer })));
const Reports = lazy(() => import("../reports/Reports.mjs"));
const Inquiry = lazy(() => import("../inquiry/Inquiry.mjs").then((module) => ({ default: module.Inquiry })));
const UdpRoutes = (props) => {
	const $ = c(36);
	let homeRoute;
	let other;
	if ($[0] !== props) {
		({homeRoute, ...other} = props);
		$[0] = props;
		$[1] = homeRoute;
		$[2] = other;
	} else {
		homeRoute = $[1];
		other = $[2];
	}
	const { leftMenuLoading } = useMenuContext();
	let t0;
	if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
		t0 = /* @__PURE__ */ React.createElement(PageLoading, null);
		$[3] = t0;
	} else t0 = $[3];
	let t1;
	if ($[4] !== homeRoute) {
		t1 = homeRoute && /* @__PURE__ */ React.createElement(Redirect, {
			exact: true,
			from: "/",
			to: homeRoute
		});
		$[4] = homeRoute;
		$[5] = t1;
	} else t1 = $[5];
	let t2;
	if ($[6] !== leftMenuLoading) {
		t2 = leftMenuLoading && /* @__PURE__ */ React.createElement(Route, {
			exact: true,
			path: "/",
			component: PageLoading
		});
		$[6] = leftMenuLoading;
		$[7] = t2;
	} else t2 = $[7];
	let t3;
	if ($[8] !== other) {
		t3 = /* @__PURE__ */ React.createElement(PrivateRoute, {
			path: "/virtual/:id",
			render: (props_0) => /* @__PURE__ */ React.createElement(VirtualBrowser, {
				...props_0,
				...other
			})
		});
		$[8] = other;
		$[9] = t3;
	} else t3 = $[9];
	let t4;
	if ($[10] !== other) {
		t4 = /* @__PURE__ */ React.createElement(PrivateRoute, {
			path: "/menupage/:id",
			render: (props_1) => /* @__PURE__ */ React.createElement(MenuPage, {
				...props_1,
				...other
			})
		});
		$[10] = other;
		$[11] = t4;
	} else t4 = $[11];
	let t5;
	if ($[12] !== other) {
		t5 = /* @__PURE__ */ React.createElement(PublicRoute, {
			path: `/page/${UdpPageEnums.Udp_Forms_Renderer_Page_Public}`,
			render: (props_2) => /* @__PURE__ */ React.createElement(UdpPublicForm, {
				...props_2,
				...other
			})
		});
		$[12] = other;
		$[13] = t5;
	} else t5 = $[13];
	let t6;
	if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
		t6 = /* @__PURE__ */ React.createElement(PublicRoute, {
			path: "/passwordresetsuccess",
			render: _temp
		});
		$[14] = t6;
	} else t6 = $[14];
	let t7;
	if ($[15] !== other) {
		t7 = /* @__PURE__ */ React.createElement(PrivateRoute, {
			path: "/workflowtask/:id",
			render: (props_4) => /* @__PURE__ */ React.createElement(WorkflowContainer, {
				...props_4,
				...other
			})
		});
		$[15] = other;
		$[16] = t7;
	} else t7 = $[16];
	let t8;
	if ($[17] !== other) {
		t8 = /* @__PURE__ */ React.createElement(PrivateRoute, {
			path: "/myexports",
			render: (props_5) => /* @__PURE__ */ React.createElement(MyExportsPage, {
				productId: ConfigService.config.UNITY_PRODUCT_ID,
				...props_5,
				...other
			})
		});
		$[17] = other;
		$[18] = t8;
	} else t8 = $[18];
	let t10;
	let t11;
	let t12;
	let t13;
	let t14;
	let t15;
	let t16;
	let t17;
	let t9;
	if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
		t9 = /* @__PURE__ */ React.createElement(PrivateRoute, {
			path: "/crudbrowser",
			render: _temp2
		});
		t10 = /* @__PURE__ */ React.createElement(PrivateRoute, {
			path: "/tablebrowser",
			render: _temp3
		});
		t11 = /* @__PURE__ */ React.createElement(Route, {
			path: "/aad_callback",
			component: AadCallback
		});
		t12 = /* @__PURE__ */ React.createElement(PrivateRoute, {
			path: "/transactionsPage",
			render: _temp4
		});
		t13 = /* @__PURE__ */ React.createElement(PrivateRoute, {
			path: "/transactionTypesPage",
			render: _temp5
		});
		t14 = /* @__PURE__ */ React.createElement(PrivateRoute, {
			path: "/reports/:id",
			exact: true,
			component: Reports
		});
		t15 = /* @__PURE__ */ React.createElement(PrivateRoute, {
			path: "/inquiry/:id",
			render: _temp6
		});
		t16 = /* @__PURE__ */ React.createElement(PrivateRoute, {
			path: "/page/:id",
			render: _temp7
		});
		t17 = /* @__PURE__ */ React.createElement(PrivateRoute, {
			path: "*",
			component: PageNotFoundRoute
		});
		$[19] = t10;
		$[20] = t11;
		$[21] = t12;
		$[22] = t13;
		$[23] = t14;
		$[24] = t15;
		$[25] = t16;
		$[26] = t17;
		$[27] = t9;
	} else {
		t10 = $[19];
		t11 = $[20];
		t12 = $[21];
		t13 = $[22];
		t14 = $[23];
		t15 = $[24];
		t16 = $[25];
		t17 = $[26];
		t9 = $[27];
	}
	let t18;
	if ($[28] !== t1 || $[29] !== t2 || $[30] !== t3 || $[31] !== t4 || $[32] !== t5 || $[33] !== t7 || $[34] !== t8) {
		t18 = /* @__PURE__ */ React.createElement(Suspense, { fallback: t0 }, /* @__PURE__ */ React.createElement(Switch, null, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17));
		$[28] = t1;
		$[29] = t2;
		$[30] = t3;
		$[31] = t4;
		$[32] = t5;
		$[33] = t7;
		$[34] = t8;
		$[35] = t18;
	} else t18 = $[35];
	return t18;
};
function _temp(props_3) {
	return /* @__PURE__ */ React.createElement(PasswordResetRedirect, { props: props_3 });
}
function _temp2(props_6) {
	return /* @__PURE__ */ React.createElement(UdpMaintenanceEnginePage, props_6);
}
function _temp3(props_7) {
	return /* @__PURE__ */ React.createElement(UdpMaintenanceConfigPage, props_7);
}
function _temp4(props_8) {
	return /* @__PURE__ */ React.createElement(UdpTransactionsPage, props_8);
}
function _temp5(props_9) {
	return /* @__PURE__ */ React.createElement(UdpTransactionTypesPage, props_9);
}
function _temp6(props_10) {
	return /* @__PURE__ */ React.createElement(Inquiry, props_10);
}
function _temp7(props_11) {
	return /* @__PURE__ */ React.createElement(PageContainer, {
		fromMenu: true,
		...props_11
	});
}
//#endregion
export { UdpRoutes };

//# sourceMappingURL=UdpRoutes.mjs.map