import { a as usePage, n as head_default, o as vue_exports, r as link_default } from "../ssr.js";
import { n as server_renderer_exports, t } from "./i18n-CXLOYfyq.js";
import { t as MarketingLayout_default } from "./MarketingLayout-B4vwnMD8.js";
//#region resources/js/Pages/Store/Index.vue?vue&type=script&setup=true&lang.ts
var Index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_exports.defineComponent)({
	__name: "Index",
	__ssrInlineRender: true,
	props: { products: {} },
	setup(__props) {
		const status = (0, vue_exports.computed)(() => usePage().props.flash?.status);
		const loggedIn = (0, vue_exports.computed)(() => !!usePage().props.auth?.user);
		const ACCENTS = [
			["#f472b6", "#db2777"],
			["#60a5fa", "#2563eb"],
			["#34d399", "#059669"],
			["#fbbf24", "#d97706"],
			["#a78bfa", "#7c3aed"],
			["#22d3ee", "#0891b2"],
			["#fb7185", "#e11d48"],
			["#818cf8", "#4f46e5"]
		];
		function accentIdx(p) {
			const key = String(p.id ?? p.slug ?? p.name ?? "");
			let h = 0;
			for (let i = 0; i < key.length; i++) h = h * 31 + key.charCodeAt(i) >>> 0;
			return h % ACCENTS.length;
		}
		function coverGradient(p) {
			const [a, b] = ACCENTS[accentIdx(p)];
			return `linear-gradient(135deg,${a},${b})`;
		}
		function cardStyle(p) {
			const [, b] = ACCENTS[accentIdx(p)];
			return {
				background: b + "0d",
				borderColor: b + "47"
			};
		}
		function reviewBadge(r) {
			if (r?.rating === "safe") return {
				t: t("✓ Reviewed safe"),
				c: "bg-emerald-500/15 text-emerald-600 dark:text-emerald-400"
			};
			if (r?.rating === "caution") return {
				t: t("⚠ Review: caution"),
				c: "bg-amber-500/15 text-amber-600 dark:text-amber-400"
			};
			if (r?.rating === "unsafe") return {
				t: t("⛔ Review: unsafe"),
				c: "bg-red-500/15 text-red-600 dark:text-red-400"
			};
			return null;
		}
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(head_default), { title: (0, vue_exports.unref)(t)("Extensions & themes — {brand}", { brand: "Convoro" }) }, null, _parent));
			_push((0, server_renderer_exports.ssrRenderComponent)(MarketingLayout_default, null, {
				default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
					if (_push) {
						_push(`<section class="mx-auto max-w-6xl px-6 py-16"${_scopeId}>`);
						if (status.value) _push(`<div class="mb-8 rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-4 py-3 text-sm font-medium text-emerald-700 dark:text-emerald-300"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(status.value)}</div>`);
						else _push(`<!---->`);
						_push(`<div class="mb-10 flex flex-wrap items-end justify-between gap-4"${_scopeId}><div class="max-w-2xl"${_scopeId}><h1 class="text-4xl font-black tracking-tight"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Extensions & themes"))}</h1><p class="mt-3 text-lg text-ink-2"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Browse the directory of Convoro extensions and themes. Free add-ons install in one click; premium ones are purchased on their detail page — you get a license key to install on any of your sites."))}</p></div><div class="flex shrink-0 items-center gap-2"${_scopeId}>`);
						if (loggedIn.value) _push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(link_default), {
							href: "/extensions/manage",
							class: "inline-flex items-center gap-2 rounded-c border border-line px-4 py-2.5 text-sm font-bold text-ink-2 hover:bg-surface-2"
						}, {
							default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
								if (_push) _push(`${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Manage yours"))}`);
								else return [(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Manage yours")), 1)];
							}),
							_: 1
						}, _parent, _scopeId));
						else _push(`<!---->`);
						_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(link_default), {
							href: "/extensions/submit",
							class: "inline-flex items-center gap-2 rounded-c bg-primary px-5 py-2.5 text-sm font-bold text-white hover:bg-primary-600"
						}, {
							default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
								if (_push) _push(`<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"${_scopeId}><path d="M12 5v14M5 12h14"${_scopeId}></path></svg> ${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Submit your extension"))}`);
								else return [((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("svg", {
									width: "16",
									height: "16",
									viewBox: "0 0 24 24",
									fill: "none",
									stroke: "currentColor",
									"stroke-width": "2",
									"stroke-linecap": "round",
									"stroke-linejoin": "round"
								}, [(0, vue_exports.createVNode)("path", { d: "M12 5v14M5 12h14" })])), (0, vue_exports.createTextVNode)(" " + (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Submit your extension")), 1)];
							}),
							_: 1
						}, _parent, _scopeId));
						_push(`</div></div>`);
						if (!__props.products.length) _push(`<div class="rounded-2xl border border-dashed border-line p-16 text-center text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("New premium add-ons are on the way. Check back soon."))}</div>`);
						else {
							_push(`<div class="grid gap-5 sm:grid-cols-2 lg:grid-cols-3"${_scopeId}><!--[-->`);
							(0, server_renderer_exports.ssrRenderList)(__props.products, (p) => {
								_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(link_default), {
									key: p.slug,
									href: `/extensions/${p.slug}`,
									style: cardStyle(p),
									class: "group flex flex-col overflow-hidden rounded-2xl border transition hover:-translate-y-0.5 hover:shadow-lg"
								}, {
									default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
										if (_push) {
											if (p.image) _push(`<img${(0, server_renderer_exports.ssrRenderAttr)("src", p.image)}${(0, server_renderer_exports.ssrRenderAttr)("alt", p.name)} loading="lazy" class="aspect-[2/1] w-full object-cover"${_scopeId}>`);
											else _push(`<div class="grid aspect-[2/1] w-full place-items-center text-4xl text-white/95" style="${(0, server_renderer_exports.ssrRenderStyle)({ background: coverGradient(p) })}"${_scopeId}><span class="text-5xl font-black uppercase opacity-90 drop-shadow-sm"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((p.name || "?").slice(0, 2))}</span></div>`);
											_push(`<div class="flex flex-1 flex-col p-6"${_scopeId}><div class="flex items-center gap-2"${_scopeId}><h3 class="truncate font-bold group-hover:text-primary"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(p.name)}</h3><span class="ml-auto shrink-0 text-xs font-semibold uppercase tracking-wide text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(p.type)}</span></div><p class="mt-3 line-clamp-2 text-sm text-ink-2"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(p.description)}</p>`);
											if (reviewBadge(p.review)) _push(`<div class="mt-3"${_scopeId}><span class="${(0, server_renderer_exports.ssrRenderClass)([reviewBadge(p.review).c, "inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-bold"])}"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(reviewBadge(p.review).t)}</span></div>`);
											else _push(`<!---->`);
											_push(`<div class="mt-4 flex flex-1 items-end justify-between border-t border-line pt-4"${_scopeId}><span class="${(0, server_renderer_exports.ssrRenderClass)([p.free ? "text-ink-muted" : "text-primary", "font-extrabold"])}"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(p.price)}</span><span class="text-sm font-semibold text-primary group-hover:underline"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("View →"))}</span></div></div>`);
										} else return [p.image ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("img", {
											key: 0,
											src: p.image,
											alt: p.name,
											loading: "lazy",
											class: "aspect-[2/1] w-full object-cover"
										}, null, 8, ["src", "alt"])) : ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
											key: 1,
											class: "grid aspect-[2/1] w-full place-items-center text-4xl text-white/95",
											style: { background: coverGradient(p) }
										}, [(0, vue_exports.createVNode)("span", { class: "text-5xl font-black uppercase opacity-90 drop-shadow-sm" }, (0, vue_exports.toDisplayString)((p.name || "?").slice(0, 2)), 1)], 4)), (0, vue_exports.createVNode)("div", { class: "flex flex-1 flex-col p-6" }, [
											(0, vue_exports.createVNode)("div", { class: "flex items-center gap-2" }, [(0, vue_exports.createVNode)("h3", { class: "truncate font-bold group-hover:text-primary" }, (0, vue_exports.toDisplayString)(p.name), 1), (0, vue_exports.createVNode)("span", { class: "ml-auto shrink-0 text-xs font-semibold uppercase tracking-wide text-ink-muted" }, (0, vue_exports.toDisplayString)(p.type), 1)]),
											(0, vue_exports.createVNode)("p", { class: "mt-3 line-clamp-2 text-sm text-ink-2" }, (0, vue_exports.toDisplayString)(p.description), 1),
											reviewBadge(p.review) ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
												key: 0,
												class: "mt-3"
											}, [(0, vue_exports.createVNode)("span", { class: ["inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-bold", reviewBadge(p.review).c] }, (0, vue_exports.toDisplayString)(reviewBadge(p.review).t), 3)])) : (0, vue_exports.createCommentVNode)("", true),
											(0, vue_exports.createVNode)("div", { class: "mt-4 flex flex-1 items-end justify-between border-t border-line pt-4" }, [(0, vue_exports.createVNode)("span", { class: ["font-extrabold", p.free ? "text-ink-muted" : "text-primary"] }, (0, vue_exports.toDisplayString)(p.price), 3), (0, vue_exports.createVNode)("span", { class: "text-sm font-semibold text-primary group-hover:underline" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("View →")), 1)])
										])];
									}),
									_: 2
								}, _parent, _scopeId));
							});
							_push(`<!--]--></div>`);
						}
						_push(`</section>`);
					} else return [(0, vue_exports.createVNode)("section", { class: "mx-auto max-w-6xl px-6 py-16" }, [
						status.value ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
							key: 0,
							class: "mb-8 rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-4 py-3 text-sm font-medium text-emerald-700 dark:text-emerald-300"
						}, (0, vue_exports.toDisplayString)(status.value), 1)) : (0, vue_exports.createCommentVNode)("", true),
						(0, vue_exports.createVNode)("div", { class: "mb-10 flex flex-wrap items-end justify-between gap-4" }, [(0, vue_exports.createVNode)("div", { class: "max-w-2xl" }, [(0, vue_exports.createVNode)("h1", { class: "text-4xl font-black tracking-tight" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Extensions & themes")), 1), (0, vue_exports.createVNode)("p", { class: "mt-3 text-lg text-ink-2" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Browse the directory of Convoro extensions and themes. Free add-ons install in one click; premium ones are purchased on their detail page — you get a license key to install on any of your sites.")), 1)]), (0, vue_exports.createVNode)("div", { class: "flex shrink-0 items-center gap-2" }, [loggedIn.value ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)((0, vue_exports.unref)(link_default), {
							key: 0,
							href: "/extensions/manage",
							class: "inline-flex items-center gap-2 rounded-c border border-line px-4 py-2.5 text-sm font-bold text-ink-2 hover:bg-surface-2"
						}, {
							default: (0, vue_exports.withCtx)(() => [(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Manage yours")), 1)]),
							_: 1
						})) : (0, vue_exports.createCommentVNode)("", true), (0, vue_exports.createVNode)((0, vue_exports.unref)(link_default), {
							href: "/extensions/submit",
							class: "inline-flex items-center gap-2 rounded-c bg-primary px-5 py-2.5 text-sm font-bold text-white hover:bg-primary-600"
						}, {
							default: (0, vue_exports.withCtx)(() => [((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("svg", {
								width: "16",
								height: "16",
								viewBox: "0 0 24 24",
								fill: "none",
								stroke: "currentColor",
								"stroke-width": "2",
								"stroke-linecap": "round",
								"stroke-linejoin": "round"
							}, [(0, vue_exports.createVNode)("path", { d: "M12 5v14M5 12h14" })])), (0, vue_exports.createTextVNode)(" " + (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Submit your extension")), 1)]),
							_: 1
						})])]),
						!__props.products.length ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
							key: 1,
							class: "rounded-2xl border border-dashed border-line p-16 text-center text-ink-muted"
						}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("New premium add-ons are on the way. Check back soon.")), 1)) : ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
							key: 2,
							class: "grid gap-5 sm:grid-cols-2 lg:grid-cols-3"
						}, [((0, vue_exports.openBlock)(true), (0, vue_exports.createBlock)(vue_exports.Fragment, null, (0, vue_exports.renderList)(__props.products, (p) => {
							return (0, vue_exports.openBlock)(), (0, vue_exports.createBlock)((0, vue_exports.unref)(link_default), {
								key: p.slug,
								href: `/extensions/${p.slug}`,
								style: cardStyle(p),
								class: "group flex flex-col overflow-hidden rounded-2xl border transition hover:-translate-y-0.5 hover:shadow-lg"
							}, {
								default: (0, vue_exports.withCtx)(() => [p.image ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("img", {
									key: 0,
									src: p.image,
									alt: p.name,
									loading: "lazy",
									class: "aspect-[2/1] w-full object-cover"
								}, null, 8, ["src", "alt"])) : ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
									key: 1,
									class: "grid aspect-[2/1] w-full place-items-center text-4xl text-white/95",
									style: { background: coverGradient(p) }
								}, [(0, vue_exports.createVNode)("span", { class: "text-5xl font-black uppercase opacity-90 drop-shadow-sm" }, (0, vue_exports.toDisplayString)((p.name || "?").slice(0, 2)), 1)], 4)), (0, vue_exports.createVNode)("div", { class: "flex flex-1 flex-col p-6" }, [
									(0, vue_exports.createVNode)("div", { class: "flex items-center gap-2" }, [(0, vue_exports.createVNode)("h3", { class: "truncate font-bold group-hover:text-primary" }, (0, vue_exports.toDisplayString)(p.name), 1), (0, vue_exports.createVNode)("span", { class: "ml-auto shrink-0 text-xs font-semibold uppercase tracking-wide text-ink-muted" }, (0, vue_exports.toDisplayString)(p.type), 1)]),
									(0, vue_exports.createVNode)("p", { class: "mt-3 line-clamp-2 text-sm text-ink-2" }, (0, vue_exports.toDisplayString)(p.description), 1),
									reviewBadge(p.review) ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
										key: 0,
										class: "mt-3"
									}, [(0, vue_exports.createVNode)("span", { class: ["inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-bold", reviewBadge(p.review).c] }, (0, vue_exports.toDisplayString)(reviewBadge(p.review).t), 3)])) : (0, vue_exports.createCommentVNode)("", true),
									(0, vue_exports.createVNode)("div", { class: "mt-4 flex flex-1 items-end justify-between border-t border-line pt-4" }, [(0, vue_exports.createVNode)("span", { class: ["font-extrabold", p.free ? "text-ink-muted" : "text-primary"] }, (0, vue_exports.toDisplayString)(p.price), 3), (0, vue_exports.createVNode)("span", { class: "text-sm font-semibold text-primary group-hover:underline" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("View →")), 1)])
								])]),
								_: 2
							}, 1032, ["href", "style"]);
						}), 128))]))
					])];
				}),
				_: 1
			}, _parent));
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/Store/Index.vue
var _sfc_setup = Index_vue_vue_type_script_setup_true_lang_default.setup;
Index_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/Pages/Store/Index.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var Index_default = Index_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { Index_default as default };
