import { _ as __nuxt_component_0 } from './nuxt-link-DNVrgHUL.mjs';
import { defineComponent, ref, computed, mergeProps, withCtx, createVNode, toDisplayString, withDirectives, vShow, openBlock, createBlock, createTextVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderClass, ssrRenderAttr, ssrRenderList, ssrInterpolate, ssrRenderStyle, ssrRenderComponent, ssrRenderSlot } from 'vue/server-renderer';
import { u as useAuthStore, _ as _imports_0 } from './auth-CRAMW6e4.mjs';
import { useRoute } from 'vue-router';
import { u as useRouter } from './server.mjs';
import '../nitro/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'node:fs';
import 'node:path';
import 'node:crypto';
import 'node:url';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/utils';
import 'unhead/plugins';
import 'pinia';
import './cookie-CWIsZYm7.mjs';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "default",
__ssrInlineRender: true,
setup(__props) {
const route = useRoute();
useRouter();
const authStore = useAuthStore();
const sidebarOpen = ref(false);
const sidebarCollapsed = ref(false);
const dropdownOpen = ref(false);
ref(null);
const expandedGroups = ref(/* @__PURE__ */ new Set(["K\xF6zpont"]));
const userEmail = computed(() => authStore.userEmail || "admin@servicefinder.hu");
const userInitials = computed(() => {
const email = authStore.userEmail;
if (!email) return "AD";
return email.split("@")[0].split(".").map((s) => s[0]).join("").toUpperCase().slice(0, 2);
});
const menuGroups = [
{
title: "K\xF6zpont",
items: [
{
path: "/",
label: "Dashboard",
icon: ''
}
]
},
{
title: "Felhaszn\xE1l\xF3k & Partnerek",
items: [
{
label: "Gar\xE1zsok",
icon: '',
children: [
{
path: "/garages",
label: "Gar\xE1zsok list\xE1ja",
icon: ''
}
]
},
{
label: "Felhaszn\xE1l\xF3k",
icon: '',
children: [
{
path: "/users",
label: "Felhaszn\xE1l\xF3k list\xE1ja",
icon: ''
}
]
}
]
},
{
title: "Rendszer",
items: [
{
path: "/permissions",
label: "Jogosults\xE1gok",
icon: ''
},
{
label: "Rendszernapl\xF3k",
icon: '',
children: [
{
path: "/logs",
label: "Rendszernapl\xF3k",
icon: ''
}
]
}
]
}
];
const pageTitle = computed(() => {
if (route.path === "/") return "Dashboard";
if (route.path.startsWith("/permissions")) return "Jogosults\xE1g Kezel\xE9s";
if (route.path.startsWith("/garages")) return "Gar\xE1zsok";
if (route.path.startsWith("/users")) return "Felhaszn\xE1l\xF3k";
if (route.path.startsWith("/logs")) return "Rendszernapl\xF3k";
return "Admin Panel";
});
function isActive(path) {
if (path === "/") return route.path === "/";
return route.path.startsWith(path);
}
function isGroupActive(item) {
if (!item.children) return false;
return item.children.some((child) => isActive(child.path));
}
return (_ctx, _push, _parent, _attrs) => {
const _component_NuxtLink = __nuxt_component_0;
_push(`
`);
if (sidebarOpen.value) {
_push(`
`);
} else {
_push(``);
}
_push(`
${ssrInterpolate(pageTitle.value)}
`);
if (dropdownOpen.value) {
_push(`
${ssrInterpolate(userEmail.value)}
Administrator
`);
_push(ssrRenderComponent(_component_NuxtLink, {
to: "/profile",
class: "flex items-center gap-3 px-4 py-2.5 text-sm text-slate-300 hover:bg-slate-700 hover:text-white transition",
onClick: ($event) => dropdownOpen.value = false
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`
Profile Settings `);
} else {
return [
(openBlock(), createBlock("svg", {
class: "w-4 h-4",
fill: "none",
stroke: "currentColor",
viewBox: "0 0 24 24"
}, [
createVNode("path", {
"stroke-linecap": "round",
"stroke-linejoin": "round",
"stroke-width": "2",
d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"
})
])),
createTextVNode(" Profile Settings ")
];
}
}),
_: 1
}, _parent));
_push(`
`);
} else {
_push(``);
}
_push(`
`);
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
_push(` `);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("layouts/default.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };
//# sourceMappingURL=default-DbJQlxCD.mjs.map