import { a as usePage, o as vue_exports, r as link_default } from "../ssr.js";
import { n as server_renderer_exports } from "./i18n-CXLOYfyq.js";
import { t as ThemeToggle_default } from "./ThemeToggle-BRrS6gIk.js";
import { n as useCommandPalette, r as Toast_default, t as CommandPalette_default } from "./CommandPalette-CuQJmtpu.js";
//#region resources/js/Layouts/AdminLayout.vue?vue&type=script&setup=true&lang.ts
var AdminLayout_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_exports.defineComponent)({
	__name: "AdminLayout",
	__ssrInlineRender: true,
	setup(__props) {
		const page = usePage();
		useCommandPalette();
		const current = (0, vue_exports.computed)(() => page.component);
		const url = (0, vue_exports.computed)(() => page.props.ziggy?.location ?? page.url ?? "");
		const extNav = (0, vue_exports.computed)(() => page.props.adminExtNav ?? []);
		(0, vue_exports.computed)(() => !!page.props.storeOwner);
		const I = {
			dash: "M3 12l9-9 9 9M5 10v10h14V10",
			members: "M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2 M9 11a4 4 0 100-8 4 4 0 000 8 M23 21v-2a4 4 0 0 0-3-3.87 M16 3.13a4 4 0 010 7.75",
			tags: "M3 7h18M3 12h18M3 17h10",
			pwa: "M12 2a10 10 0 100 20 10 10 0 000-20M2 12h20M12 2a15 15 0 010 20M12 2a15 15 0 000 20",
			cog: "M12 15a3 3 0 100-6 3 3 0 000 6z M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 11-2.83 2.83l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 11-4 0v-.09A1.65 1.65 0 009 19.4",
			mail: "M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2z M22 6l-10 7L2 6",
			market: "M3 9l1-5h16l1 5M4 9v10h16V9M9 9v10M15 9v10",
			store: "M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z",
			system: "M12 15a3 3 0 100-6 3 3 0 000 6z M4 12h2M18 12h2M12 4v2M12 18v2",
			puzzle: "M4 7h3a2 2 0 002-2 2 2 0 114 0 2 2 0 002 2h3v3a2 2 0 002 2 2 2 0 110 4 2 2 0 00-2 2v3h-3",
			shield: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",
			log: "M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2 M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 M9 12h6 M9 16h4",
			import: "M12 3v12M8 11l4 4 4-4M4 17v2a2 2 0 002 2h12a2 2 0 002-2v-2",
			invite: "M4 4h16v16H4zM4 7l8 6 8-6",
			ai: "M12 2a2 2 0 012 2v1h2a2 2 0 012 2v2h1a2 2 0 010 4h-1v2a2 2 0 01-2 2h-2v1a2 2 0 01-4 0v-1H6a2 2 0 01-2-2v-2H3a2 2 0 010-4h1V7a2 2 0 012-2h2V4a2 2 0 012-2zM9 10h.01M15 10h.01M9 15h6",
			globe: "M12 2a10 10 0 100 20 10 10 0 000-20M2 12h20M12 2a15 15 0 010 20M12 2a15 15 0 000 20",
			database: "M12 3c4.42 0 8 1.34 8 3s-3.58 3-8 3-8-1.34-8-3 3.58-3 8-3z M4 6v6c0 1.66 3.58 3 8 3s8-1.34 8-3V6 M4 12v6c0 1.66 3.58 3 8 3s8-1.34 8-3v-6",
			book: "M4 19.5A2.5 2.5 0 016.5 17H20 M6.5 2H20v20H6.5A2.5 2.5 0 014 19.5v-15A2.5 2.5 0 016.5 2z"
		};
		const EXT = {
			megaphone: "M3 11v2a1 1 0 001 1h3l5 4V5L7 10H4a1 1 0 00-1 1z M16 9a4 4 0 010 6",
			chart: "M3 3v18h18 M7 14l3-3 3 3 5-6",
			privacy: "M6 11h12v9H6z M9 11V7a3 3 0 016 0v4",
			cookie: "M12 3a9 9 0 109 9 3 3 0 01-3-3 3 3 0 01-3-3 9 9 0 00-3-3z M9 12h.01 M13 15h.01 M15 10h.01",
			social: "M9 15l6-6 M10 6l1-1a4 4 0 115 5l-1 1 M14 18l-1 1a4 4 0 11-5-5l1-1",
			badge: "M12 14a5 5 0 100-10 5 5 0 000 10z M9 13l-1 8 4-2.5 4 2.5-1-8",
			rss: "M4 11a9 9 0 019 9 M4 4a16 16 0 0116 16 M6 18.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z",
			queue: "M4 5h16v5H4z M4 14h16v5H4z M8 7.5h.01 M8 16.5h.01"
		};
		function extIcon(e) {
			const s = ((e.id ?? "") + " " + (e.name ?? "")).toLowerCase();
			if (s.includes("announc")) return EXT.megaphone;
			if (s.includes("analytic") || s.includes("stat")) return EXT.chart;
			if (s.includes("cookie")) return EXT.cookie;
			if (s.includes("gdpr") || s.includes("privacy") || s.includes("consent")) return EXT.privacy;
			if (s.includes("social") || s.includes("login") || s.includes("oauth")) return EXT.social;
			if (s.includes("badge") || s.includes("award")) return EXT.badge;
			if (s.includes("rss") || s.includes("feed")) return EXT.rss;
			if (s.includes("horizon") || s.includes("queue")) return EXT.queue;
			return I.puzzle;
		}
		const groups = (0, vue_exports.computed)(() => [
			{
				label: null,
				items: [{
					label: "Dashboard",
					href: "/admin",
					component: "Admin/Dashboard",
					icon: I.dash
				}]
			},
			{
				label: "Community",
				items: [
					{
						label: "Members",
						href: "/admin/members",
						component: "Admin/Members",
						icon: I.members
					},
					{
						label: "Categories & Tags",
						href: "/admin/content",
						component: "Admin/Content",
						icon: I.tags
					},
					{
						label: "Moderation",
						href: "/admin/moderation",
						component: "Admin/Moderation",
						icon: I.shield
					},
					{
						label: "Audit log",
						href: "/admin/audit-log",
						component: "Admin/AuditLog",
						icon: I.log
					},
					{
						label: "Invites",
						href: "/admin/invites",
						component: "Admin/Invites",
						icon: I.invite
					}
				]
			},
			{
				label: "Configuration",
				items: [
					{
						label: "Settings",
						href: "/admin/settings",
						component: "Admin/Settings",
						icon: I.cog
					},
					{
						label: "Email",
						href: "/admin/email",
						component: "Admin/Email",
						icon: I.mail
					},
					{
						label: "Languages",
						href: "/admin/languages",
						component: "Admin/Languages",
						icon: I.globe
					},
					{
						label: "PWA",
						href: "/admin/pwa",
						component: "Admin/Pwa",
						icon: I.pwa
					},
					{
						label: "Single sign-on",
						href: "/admin/sso",
						component: "Admin/Sso",
						icon: I.shield
					}
				]
			},
			{
				label: "Extensions",
				items: [{
					label: "Marketplace",
					href: "/admin/marketplace",
					component: "Admin/Marketplace",
					icon: I.market
				}, ...extNav.value.map((e) => ({
					label: e.name,
					href: e.href,
					component: "",
					icon: extIcon(e),
					iconSvg: e.icon || null
				}))]
			},
			{
				label: "System",
				items: [
					{
						label: "AI",
						href: "/admin/ai",
						component: "Admin/Ai",
						icon: I.ai
					},
					{
						label: "Knowledge Base",
						href: "/admin/knowledge",
						component: "Admin/Knowledge",
						icon: I.book
					},
					{
						label: "Import",
						href: "/admin/import",
						component: "Admin/Import",
						icon: I.import
					},
					{
						label: "Backups",
						href: "/admin/backups",
						component: "Admin/Backups",
						icon: I.database
					}
				]
			}
		]);
		const banner = () => page.props.updateBanner ?? null;
		function active(item) {
			if (item.component) return current.value === item.component;
			return typeof url.value === "string" && url.value.startsWith(item.href);
		}
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<div${(0, server_renderer_exports.ssrRenderAttrs)((0, vue_exports.mergeProps)({ class: "flex min-h-screen bg-appbg text-ink" }, _attrs))}><aside class="hidden w-[240px] shrink-0 flex-col border-r border-line bg-surface p-4 md:flex"><div class="mb-6 flex items-center gap-2 px-2"><span class="flex h-8 w-8 items-center justify-center rounded-lg bg-gradient-to-br from-indigo-500 to-violet-500 font-extrabold text-white">C</span><span class="text-sm font-bold text-ink">Convoro Admin</span></div><nav class="flex flex-col gap-1 overflow-y-auto"><!--[-->`);
			(0, server_renderer_exports.ssrRenderList)(groups.value, (group, gi) => {
				_push(`<!--[-->`);
				if (group.label) _push(`<div class="px-3 pb-1 pt-4 text-[10px] font-bold uppercase tracking-wider text-ink-muted">${(0, server_renderer_exports.ssrInterpolate)(group.label)}</div>`);
				else _push(`<!---->`);
				_push(`<!--[-->`);
				(0, server_renderer_exports.ssrRenderList)(group.items, (item) => {
					_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(link_default), {
						key: item.href,
						href: item.href,
						class: ["flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition", active(item) ? "bg-surface-2 text-ink" : "text-ink-2 hover:bg-surface-2 hover:text-ink"]
					}, {
						default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
							if (_push) {
								if (item.iconSvg) _push(`<span class="inline-flex shrink-0 [&amp;&gt;svg]:h-[18px] [&amp;&gt;svg]:w-[18px]"${_scopeId}>${item.iconSvg ?? ""}</span>`);
								else _push(`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"${_scopeId}><path${(0, server_renderer_exports.ssrRenderAttr)("d", item.icon)}${_scopeId}></path></svg>`);
								_push(` ${(0, server_renderer_exports.ssrInterpolate)(item.label)}`);
							} else return [item.iconSvg ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
								key: 0,
								class: "inline-flex shrink-0 [&>svg]:h-[18px] [&>svg]:w-[18px]",
								innerHTML: item.iconSvg
							}, null, 8, ["innerHTML"])) : ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("svg", {
								key: 1,
								width: "18",
								height: "18",
								viewBox: "0 0 24 24",
								fill: "none",
								stroke: "currentColor",
								"stroke-width": "2",
								"stroke-linecap": "round",
								"stroke-linejoin": "round"
							}, [(0, vue_exports.createVNode)("path", { d: item.icon }, null, 8, ["d"])])), (0, vue_exports.createTextVNode)(" " + (0, vue_exports.toDisplayString)(item.label), 1)];
						}),
						_: 2
					}, _parent));
				});
				_push(`<!--]--><!--]-->`);
			});
			_push(`<!--]--></nav>`);
			_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(link_default), {
				href: "/",
				class: "mt-auto flex items-center gap-2 rounded-lg px-3 py-2 text-sm text-ink-2 hover:bg-surface-2 hover:text-ink"
			}, {
				default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
					if (_push) _push(`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"${_scopeId}><path d="M19 12H5M12 19l-7-7 7-7"${_scopeId}></path></svg> Back to site `);
					else return [((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("svg", {
						width: "18",
						height: "18",
						viewBox: "0 0 24 24",
						fill: "none",
						stroke: "currentColor",
						"stroke-width": "2",
						"stroke-linecap": "round",
						"stroke-linejoin": "round"
					}, [(0, vue_exports.createVNode)("path", { d: "M19 12H5M12 19l-7-7 7-7" })])), (0, vue_exports.createTextVNode)(" Back to site ")];
				}),
				_: 1
			}, _parent));
			_push(`</aside><div class="flex-1"><header class="flex items-center gap-4 border-b border-line bg-surface/70 px-6 py-4"><div class="min-w-0 flex-1"><h1 class="text-lg font-bold text-ink">`);
			(0, server_renderer_exports.ssrRenderSlot)(_ctx.$slots, "title", {}, () => {
				_push(`Admin`);
			}, _push, _parent);
			_push(`</h1>`);
			if (_ctx.$slots.subtitle) {
				_push(`<p class="mt-0.5 text-sm text-ink-2">`);
				(0, server_renderer_exports.ssrRenderSlot)(_ctx.$slots, "subtitle", {}, null, _push, _parent);
				_push(`</p>`);
			} else _push(`<!---->`);
			_push(`</div><button type="button" class="hidden items-center gap-2 rounded-lg border border-line bg-surface-2 px-3 py-1.5 text-sm text-ink-muted hover:text-ink sm:flex" aria-label="Open command palette"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="7"></circle><path d="m21 21-4.3-4.3"></path></svg><span>Search</span><kbd class="rounded border border-line bg-surface px-1.5 text-[10px] font-semibold">⌘K</kbd></button>`);
			_push((0, server_renderer_exports.ssrRenderComponent)(ThemeToggle_default, null, null, _parent));
			_push(`</header><main class="p-6">`);
			if (banner()?.available) _push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(link_default), {
				href: "/admin/marketplace",
				class: "mb-5 flex items-center gap-3 rounded-xl border border-indigo-500/40 bg-indigo-500/10 px-4 py-3 text-sm"
			}, {
				default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
					if (_push) _push(`<span class="flex h-7 w-7 items-center justify-center rounded-full bg-indigo-500/30 text-indigo-300"${_scopeId}>↑</span><span class="text-ink"${_scopeId}>Convoro <strong${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(banner().latest)}</strong> is available.</span><span class="ml-auto font-semibold text-indigo-300"${_scopeId}>Update →</span>`);
					else return [
						(0, vue_exports.createVNode)("span", { class: "flex h-7 w-7 items-center justify-center rounded-full bg-indigo-500/30 text-indigo-300" }, "↑"),
						(0, vue_exports.createVNode)("span", { class: "text-ink" }, [
							(0, vue_exports.createTextVNode)("Convoro "),
							(0, vue_exports.createVNode)("strong", null, (0, vue_exports.toDisplayString)(banner().latest), 1),
							(0, vue_exports.createTextVNode)(" is available.")
						]),
						(0, vue_exports.createVNode)("span", { class: "ml-auto font-semibold text-indigo-300" }, "Update →")
					];
				}),
				_: 1
			}, _parent));
			else _push(`<!---->`);
			(0, server_renderer_exports.ssrRenderSlot)(_ctx.$slots, "default", {}, null, _push, _parent);
			_push(`</main></div>`);
			_push((0, server_renderer_exports.ssrRenderComponent)(Toast_default, null, null, _parent));
			_push((0, server_renderer_exports.ssrRenderComponent)(CommandPalette_default, null, null, _parent));
			_push(`</div>`);
		};
	}
});
//#endregion
//#region resources/js/Layouts/AdminLayout.vue
var _sfc_setup = AdminLayout_vue_vue_type_script_setup_true_lang_default.setup;
AdminLayout_vue_vue_type_script_setup_true_lang_default.setup = (props, ctx) => {
	const ssrContext = (0, vue_exports.useSSRContext)();
	(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Layouts/AdminLayout.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var AdminLayout_default = AdminLayout_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { AdminLayout_default as t };
