import { n as ROUTES, t as TheCommandPalette_default } from "./CommandPalette-CL8k4CoN.js";
import { T as PathId, w as useActiveEntities } from "./store-DpSUVhjp.js";
import { a as useLayout } from "./useSidebar-DLTwHDI-.js";
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BmmBcIzD.js";
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
import { ScalarDropdown, ScalarDropdownItem, ScalarIcon } from "@scalar/components";
import { RouterLink, useRouter } from "vue-router";
//#endregion
//#region src/components/SideNav/SideNavLink.vue
var SideNavLink_default = /* @__PURE__ */ defineComponent({
	__name: "SideNavLink",
	props: {
		is: {},
		active: { type: Boolean },
		icon: {}
	},
	setup(__props) {
		const { layout } = useLayout();
		return (_ctx, _cache) => {
			return openBlock(), createBlock(resolveDynamicComponent(__props.is ?? "a"), { class: normalizeClass(["hover:bg-b-3 hover:dark:bg-b-2 flex max-w-[37px] min-w-[37px] items-center justify-center rounded-lg p-2 no-underline", {
				"bg-b-3 dark:bg-b-2 text-c-1 transition-none hover:cursor-default": __props.active,
				"sm:max-w-max sm:min-w-max sm:rounded sm:py-1.5": unref(layout) === "web"
			}]) }, {
				default: withCtx(() => [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(unref(ScalarIcon), {
					class: normalizeClass(unref(layout) === "web" ? "sm:hidden" : ""),
					icon: __props.icon,
					thickness: "1.5"
				}, null, 8, ["class", "icon"])]), createElementVNode("span", { class: normalizeClass(["sr-only text-sm font-medium", { "sm:not-sr-only": unref(layout) === "web" }]) }, [renderSlot(_ctx.$slots, "default")], 2)]),
				_: 3
			}, 8, ["class"]);
		};
	}
});
//#endregion
//#region src/components/SideNav/DownloadAppButton.vue
var DownloadAppButton_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
	__name: "DownloadAppButton",
	setup(__props) {
		const { layout } = useLayout();
		return (_ctx, _cache) => {
			return openBlock(), createBlock(SideNavLink_default, {
				class: "download-app-button gap-2 !px-3 !py-1.5 sm:px-3",
				href: "https://scalar.com/download?utm_source=web_client&utm_medium=download_button&utm_campaign=topnav",
				icon: "Download",
				target: "_blank"
			}, {
				icon: withCtx(() => [createVNode(unref(ScalarIcon), {
					icon: "Download",
					size: "sm",
					thickness: "2"
				})]),
				default: withCtx(() => [createElementVNode("span", { class: normalizeClass(["sr-only text-sm font-medium", { "sm:not-sr-only": unref(layout) === "web" }]) }, " Download App ", 2)]),
				_: 1
			});
		};
	}
}), [["__scopeId", "data-v-cb45fa05"]]);
//#endregion
//#region src/components/SideNav/SideHelp.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1$1 = {
	class: "block no-underline",
	href: "https://discord.gg/scalar",
	target: "_blank"
};
var _hoisted_2$1 = { class: "flex items-center justify-center" };
var _hoisted_3$1 = {
	class: "block no-underline",
	href: "https://github.com/scalar/scalar",
	target: "_blank"
};
var _hoisted_4 = { class: "flex items-center justify-center" };
var _hoisted_5 = {
	class: "block no-underline",
	href: "mailto:support@scalar.com",
	target: "_blank"
};
var _hoisted_6 = { class: "flex items-center justify-center" };
var _hoisted_7 = {
	class: "block no-underline",
	href: "https://scalar.com/changelog",
	target: "_blank"
};
var _hoisted_8 = { class: "flex items-center justify-center" };
var _hoisted_9 = {
	class: "block no-underline",
	href: "https://github.com/scalar/scalar/issues/2669",
	target: "_blank"
};
var _hoisted_10 = { class: "flex items-center justify-center" };
//#endregion
//#region src/components/SideNav/SideHelp.vue
var SideHelp_default = /* @__PURE__ */ defineComponent({
	__name: "SideHelp",
	setup(__props) {
		return (_ctx, _cache) => {
			return openBlock(), createBlock(unref(ScalarDropdown), {
				class: "max-w-[150px]",
				placement: "top-end"
			}, {
				items: withCtx(() => [
					_cache[6] || (_cache[6] = createElementVNode("span", { class: "text-c-2 px-2.5 py-1.5 text-xs font-medium" }, "Support", -1)),
					createElementVNode("a", _hoisted_1$1, [createVNode(unref(ScalarDropdownItem), { class: "flex w-full items-center gap-1.5" }, {
						default: withCtx(() => [createElementVNode("div", _hoisted_2$1, [createVNode(unref(ScalarIcon), {
							icon: "Discord",
							size: "xs",
							thickness: "1.75"
						})]), _cache[1] || (_cache[1] = createElementVNode("span", null, "Discord", -1))]),
						_: 1
					})]),
					createElementVNode("a", _hoisted_3$1, [createVNode(unref(ScalarDropdownItem), { class: "flex w-full items-center gap-1.5" }, {
						default: withCtx(() => [createElementVNode("div", _hoisted_4, [createVNode(unref(ScalarIcon), {
							icon: "GitHubLine",
							size: "xs",
							thickness: "1.75"
						})]), _cache[2] || (_cache[2] = createElementVNode("span", null, "GitHub", -1))]),
						_: 1
					})]),
					createElementVNode("a", _hoisted_5, [createVNode(unref(ScalarDropdownItem), { class: "flex w-full items-center gap-1.5" }, {
						default: withCtx(() => [createElementVNode("div", _hoisted_6, [createVNode(unref(ScalarIcon), {
							icon: "Email",
							size: "xs"
						})]), _cache[3] || (_cache[3] = createElementVNode("span", null, "Email", -1))]),
						_: 1
					})]),
					_cache[7] || (_cache[7] = createElementVNode("span", { class: "text-c-2 px-2.5 py-1.5 text-xs font-medium" }, "Product", -1)),
					createElementVNode("a", _hoisted_7, [createVNode(unref(ScalarDropdownItem), { class: "flex w-full items-center gap-1.5" }, {
						default: withCtx(() => [createElementVNode("div", _hoisted_8, [createVNode(unref(ScalarIcon), {
							icon: "Changelog",
							size: "xs",
							thickness: "1.75"
						})]), _cache[4] || (_cache[4] = createElementVNode("span", null, "Changelog", -1))]),
						_: 1
					})]),
					createElementVNode("a", _hoisted_9, [createVNode(unref(ScalarDropdownItem), { class: "flex w-full items-center gap-1.5" }, {
						default: withCtx(() => [createElementVNode("div", _hoisted_10, [createVNode(unref(ScalarIcon), {
							icon: "Roadmap",
							size: "xs",
							thickness: "1.75"
						})]), _cache[5] || (_cache[5] = createElementVNode("span", null, "Roadmap", -1))]),
						_: 1
					})])
				]),
				default: withCtx(() => [createVNode(SideNavLink_default, {
					is: "button",
					icon: "Help",
					type: "button"
				}, {
					default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode(" About ", -1)])]),
					_: 1
				})]),
				_: 1
			});
		};
	}
});
//#endregion
//#region src/components/SideNav/SideNavGroup.vue
var SideNavGroup_default = /* @__PURE__ */ defineComponent({
	__name: "SideNavGroup",
	setup(__props) {
		const { layout } = useLayout();
		return (_ctx, _cache) => {
			return openBlock(), createElementBlock("ul", { class: normalizeClass(["flex gap-1.5", unref(layout) === "web" ? "sm:gap-px sm:px-2" : "sm:flex-col"]) }, [renderSlot(_ctx.$slots, "default")], 2);
		};
	}
});
//#endregion
//#region src/components/SideNav/SideNavRouterLink.vue
var SideNavRouterLink_default = /* @__PURE__ */ defineComponent({
	__name: "SideNavRouterLink",
	props: {
		icon: {},
		to: {},
		active: { type: Boolean }
	},
	setup(__props) {
		return (_ctx, _cache) => {
			return openBlock(), createBlock(SideNavLink_default, {
				is: unref(RouterLink),
				active: Boolean(__props.active),
				icon: __props.icon,
				to: __props.to
			}, {
				default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
				_: 3
			}, 8, [
				"is",
				"active",
				"icon",
				"to"
			]);
		};
	}
});
//#endregion
//#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"
};
//#endregion
//#region src/components/SideNav/SideNav.vue
var SideNav_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
//#region src/layouts/App/MainLayout.vue
var MainLayout_default = /* @__PURE__ */ defineComponent({
	__name: "MainLayout",
	setup(__props) {
		const { layout } = useLayout();
		return (_ctx, _cache) => {
			return openBlock(), createElementBlock("main", { class: normalizeClass(["flex min-h-0 flex-1 flex-col", unref(layout) === "web" ? "sm:flex-col" : "sm:flex-row"]) }, [
				createVNode(SideNav_default, { class: "sidenav order-last sm:order-none" }),
				createVNode(unref(TheCommandPalette_default)),
				createElementVNode("div", { class: normalizeClass(["flex min-h-0 min-w-0 flex-1 flex-col", { "border sm:mr-1.5 sm:mb-1.5 sm:rounded-lg sm:*:rounded-lg": unref(layout) === "desktop" }]) }, [renderSlot(_ctx.$slots, "default")], 2)
			], 2);
		};
	}
});
//#endregion
export { MainLayout_default as t };

//# sourceMappingURL=MainLayout-BEFMl1ud.js.map