import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
import { Fragment as t, computed as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, normalizeClass as s, openBlock as c, ref as l, renderList as u, renderSlot as d, resolveComponent as f, toDisplayString as p, vShow as m, withCtx as h, withDirectives as g } from "vue";
//#region src/components/on-demand/wt-navigation-menu/components/_internals/nav-menu-lvl-1.vue
var _ = { class: "nav-menu__category nav-menu-lvl-1" }, v = ["onClick"], y = /*#__PURE__*/ e({
	__name: "nav-menu-lvl-1",
	props: {
		categories: {
			type: Array,
			default: () => []
		},
		selected: {
			type: Object,
			default: () => ({})
		},
		icons: {
			type: Array,
			default: () => []
		}
	},
	emits: ["select"],
	setup(e, { emit: n }) {
		let l = n;
		function h(e) {
			l("select", e);
		}
		return (n, l) => {
			let y = f("wt-icon");
			return c(), r("ul", _, [(c(!0), r(t, null, u(e.categories, (t, l) => (c(), r("li", {
				key: l,
				class: "nav-menu__option"
			}, [i("button", {
				class: s([{ "nav-menu__item--selected": e.selected.value === t.value }, "typo-body-1 nav-menu__item nav-menu__item--active"]),
				onClick: (e) => h(t)
			}, [o(y, {
				color: e.selected.value === t.value ? "on-primary" : "default",
				icon: e.icons.find((e) => e.includes(t.value))
			}, null, 8, ["color", "icon"]), a(" " + p(t.name), 1)], 10, v), g(i("div", null, [d(n.$slots, "default", {}, void 0, !0)], 512), [[m, e.selected.value === t.value]])]))), 128))]);
		};
	}
}, [["__scopeId", "data-v-dd3e01a2"]]), b = { class: "nav-menu__category nav-menu-lvl-2" }, x = /*#__PURE__*/ e({
	__name: "nav-menu-lvl-2",
	props: { categories: {
		type: Array,
		default: () => []
	} },
	setup(e) {
		return (n, s) => {
			let l = f("router-link");
			return c(), r("ul", b, [(c(!0), r(t, null, u(e.categories, (e, t) => (c(), r("li", {
				key: t,
				class: "typo-body-1 nav-menu__option nav-menu__item nav-menu-lvl-2--inner"
			}, [s[0] ||= i("span", { class: "nav-menu-lvl-2__indicator" }, null, -1), o(l, {
				to: e.route,
				class: "nav-menu-lvl-2__link"
			}, {
				default: h(() => [a(p(e.name), 1)], void 0, !0),
				_: 2
			}, 1032, ["to"])]))), 128))]);
		};
	}
}, [["__scopeId", "data-v-d3104e61"]]), S = { class: "wt-navigation-menu" }, C = { class: "wt-navigation-menu__wrapper" }, w = /*#__PURE__*/ e({
	__name: "wt-navigation-menu",
	props: {
		nav: {
			type: Array,
			required: !0
		},
		icons: {
			type: Array,
			default: () => []
		}
	},
	setup(e) {
		let t = e, a = l(""), s = n(() => {
			let e = /* @__PURE__ */ new Map();
			return t.nav.forEach((t) => {
				e.set(t.value, {
					...t,
					name: t.name
				});
			}), e;
		}), u = n(() => {
			let e = /* @__PURE__ */ new Map();
			return t.nav.forEach((t) => {
				if (t.subNav) {
					let n = t.subNav.map((e) => {
						let n = t.route ? `${t.route}/${e.route}` : e.route;
						return {
							...e,
							name: e.name,
							route: n
						};
					});
					e.set(t.value, n);
				} else e.set(t.value, []);
			}), e;
		}), d = n(() => Array.from(s.value.values()).filter((e) => {
			let t = u.value.get(e.value);
			return t && t.length > 0;
		})), f = n(() => u.value.get(p.value?.value) || []), p = n(() => s.value.get(a.value) || d.value[0]);
		function m(e) {
			a.value = e.value;
		}
		return (t, n) => (c(), r("section", S, [i("article", C, [o(y, {
			categories: d.value,
			icons: e.icons,
			selected: p.value,
			onSelect: m
		}, {
			default: h(() => [o(x, {
				categories: f.value,
				class: "wt-navigation-menu__categories--display"
			}, null, 8, ["categories"])], void 0, !0),
			_: 1
		}, 8, [
			"categories",
			"icons",
			"selected"
		]), o(x, {
			categories: f.value,
			class: "wt-navigation-menu__categories--hidden"
		}, null, 8, ["categories"])])]));
	}
}, [["__scopeId", "data-v-fcbc24f4"]]);
//#endregion
export { w as default };
