import{$ as e,C as t,D as n,E as r,I as i,L as a,O as o,Q as s,S as c,U as l,X as u,Z as d,b as f,i as p,o as m,r as h,v as g,w as _,x as v}from"./app-Ba0Pm69U.js";import{t as y}from"./i18n-DSNHTU1v.js";import{t as b}from"./MarketingLayout-D6jg2nUl.js";var x={class:`mx-auto max-w-6xl px-6 py-16`},S={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`},C={class:`mb-10 flex flex-wrap items-end justify-between gap-4`},w={class:`max-w-2xl`},T={class:`text-4xl font-black tracking-tight`},E={class:`mt-3 text-lg text-ink-2`},D={class:`flex shrink-0 items-center gap-2`},O={key:1,class:`rounded-2xl border border-dashed border-line p-16 text-center text-ink-muted`},k={key:2,class:`grid gap-5 sm:grid-cols-2 lg:grid-cols-3`},A=[`src`,`alt`],j={class:`text-5xl font-black uppercase opacity-90 drop-shadow-sm`},M={class:`flex flex-1 flex-col p-6`},N={class:`flex items-center gap-2`},P={class:`truncate font-bold group-hover:text-primary`},F={class:`ml-auto shrink-0 text-xs font-semibold uppercase tracking-wide text-ink-muted`},I={class:`mt-3 line-clamp-2 text-sm text-ink-2`},L={key:0,class:`mt-3`},R={class:`mt-4 flex flex-1 items-end justify-between border-t border-line pt-4`},z={class:`text-sm font-semibold text-primary group-hover:underline`},B=o({__name:`Index`,props:{products:{}},setup(o){let B=f(()=>m().props.flash?.status),V=f(()=>!!m().props.auth?.user),H=[[`#f472b6`,`#db2777`],[`#60a5fa`,`#2563eb`],[`#34d399`,`#059669`],[`#fbbf24`,`#d97706`],[`#a78bfa`,`#7c3aed`],[`#22d3ee`,`#0891b2`],[`#fb7185`,`#e11d48`],[`#818cf8`,`#4f46e5`]];function U(e){let t=String(e.id??e.slug??e.name??``),n=0;for(let e=0;e<t.length;e++)n=n*31+t.charCodeAt(e)>>>0;return n%H.length}function W(e){let[t,n]=H[U(e)];return`linear-gradient(135deg,${t},${n})`}function G(e){let[,t]=H[U(e)];return{background:t+`0d`,borderColor:t+`47`}}function K(e){return e?.rating===`safe`?{t:y(`✓ Reviewed safe`),c:`bg-emerald-500/15 text-emerald-600 dark:text-emerald-400`}:e?.rating===`caution`?{t:y(`⚠ Review: caution`),c:`bg-amber-500/15 text-amber-600 dark:text-amber-400`}:e?.rating===`unsafe`?{t:y(`⛔ Review: unsafe`),c:`bg-red-500/15 text-red-600 dark:text-red-400`}:null}return(f,m)=>(i(),_(g,null,[n(u(h),{title:u(y)(`Extensions & themes — {brand}`,{brand:`Convoro`})},null,8,[`title`]),n(b,null,{default:l(()=>[v(`section`,x,[B.value?(i(),_(`div`,S,e(B.value),1)):t(``,!0),v(`div`,C,[v(`div`,w,[v(`h1`,T,e(u(y)(`Extensions & themes`)),1),v(`p`,E,e(u(y)(`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)]),v(`div`,D,[V.value?(i(),c(u(p),{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:l(()=>[r(e(u(y)(`Manage yours`)),1)]),_:1})):t(``,!0),n(u(p),{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:l(()=>[m[0]||=v(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[v(`path`,{d:`M12 5v14M5 12h14`})],-1),r(` `+e(u(y)(`Submit your extension`)),1)]),_:1})])]),o.products.length?(i(),_(`div`,k,[(i(!0),_(g,null,a(o.products,n=>(i(),c(u(p),{key:n.slug,href:`/extensions/${n.slug}`,style:s(G(n)),class:`group flex flex-col overflow-hidden rounded-2xl border transition hover:-translate-y-0.5 hover:shadow-lg`},{default:l(()=>[n.image?(i(),_(`img`,{key:0,src:n.image,alt:n.name,loading:`lazy`,class:`aspect-[2/1] w-full object-cover`},null,8,A)):(i(),_(`div`,{key:1,class:`grid aspect-[2/1] w-full place-items-center text-4xl text-white/95`,style:s({background:W(n)})},[v(`span`,j,e((n.name||`?`).slice(0,2)),1)],4)),v(`div`,M,[v(`div`,N,[v(`h3`,P,e(n.name),1),v(`span`,F,e(n.type),1)]),v(`p`,I,e(n.description),1),K(n.review)?(i(),_(`div`,L,[v(`span`,{class:d([`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-bold`,K(n.review).c])},e(K(n.review).t),3)])):t(``,!0),v(`div`,R,[v(`span`,{class:d([`font-extrabold`,n.free?`text-ink-muted`:`text-primary`])},e(n.price),3),v(`span`,z,e(u(y)(`View →`)),1)])])]),_:2},1032,[`href`,`style`]))),128))])):(i(),_(`div`,O,e(u(y)(`New premium add-ons are on the way. Check back soon.`)),1))])]),_:1})],64))}});export{B as default};