import { ROUTES } from "../../constants.js";
import { PathId } from "../../routes.js";
import { useActiveEntities } from "../../store/active-entities.js";
import { useLayout } from "../../hooks/useLayout.js";
import DownloadAppButton_default from "./DownloadAppButton.vue.js";
import SideHelp_default from "./SideHelp.vue.js";
import SideNavGroup_default from "./SideNavGroup.vue.js";
import SideNavRouterLink_default from "./SideNavRouterLink.vue.js";
import { Fragment, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
import { ScalarIcon } from "@scalar/components";
import { useRouter } from "vue-router";
//#region src/components/SideNav/SideNav.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1 = { class: "flex items-center" };
var _hoisted_2 = { class: "flex items-center" };
var _hoisted_3 = {
	key: 0,
	class: "hidden items-center justify-center sm:ml-1.5 sm:flex"
};
var SideNav_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "SideNav",
	setup(__props) {
		const { currentRoute } = useRouter();
		const { layout } = useLayout();
		const { activeWorkspace } = useActiveEntities();
		return (_ctx, _cache) => {
			return openBlock(), createElementBlock("nav", {
				"aria-label": "App Navigation",
				class: normalizeClass(["app-drag-region flex items-center justify-center gap-1.5 pt-2 sm:justify-between", unref(layout) === "web" ? "h-header border !pt-0" : "px-2 pb-2 sm:flex-col"]),
				role: "navigation"
			}, [createVNode(SideNavGroup_default, { class: "app-no-drag-region" }, {
				default: withCtx(() => [createElementVNode("a", {
					class: normalizeClass(["mr-3 ml-1 hidden items-center", { "sm:flex": unref(layout) === "web" }]),
					href: "https://www.scalar.com",
					target: "_blank"
				}, [createVNode(unref(ScalarIcon), {
					icon: "Logo",
					size: "xl"
				})], 2), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(ROUTES).filter((route) => route.to.name !== "settings.default"), ({ icon, to, displayName }, i) => {
					return openBlock(), createElementBlock("li", { key: i }, [createVNode(SideNavRouterLink_default, {
						active: Boolean(unref(currentRoute).name === displayName.toLowerCase() || displayName.toLowerCase() === "environment" && unref(currentRoute).name === "environment.collection"),
						icon,
						to: {
							...to,
							params: { [unref(PathId).Workspace]: unref(activeWorkspace)?.uid ?? "default" }
						}
					}, {
						default: withCtx(() => [createTextVNode(toDisplayString(displayName), 1)]),
						_: 2
					}, 1032, [
						"active",
						"icon",
						"to"
					])]);
				}), 128))]),
				_: 1
			}), createVNode(SideNavGroup_default, { class: "app-no-drag-region" }, {
				default: withCtx(() => [
					createElementVNode("li", _hoisted_1, [createVNode(SideNavRouterLink_default, {
						active: unref(currentRoute).name === "settings",
						icon: "Settings",
						to: {
							name: `settings.default`,
							params: { [unref(PathId).Workspace]: unref(activeWorkspace)?.uid }
						}
					}, {
						default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode(" Settings ", -1)])]),
						_: 1
					}, 8, ["active", "to"])]),
					createElementVNode("li", _hoisted_2, [createVNode(SideHelp_default)]),
					unref(layout) !== "desktop" ? (openBlock(), createElementBlock("li", _hoisted_3, [createVNode(DownloadAppButton_default)])) : createCommentVNode("", true)
				]),
				_: 1
			})], 2);
		};
	}
});
//#endregion
export { SideNav_vue_vue_type_script_setup_true_lang_default as default };

//# sourceMappingURL=SideNav.vue.script.js.map