1import{cM as P,cN as I,cO as Q,Z as z,cP as A,cQ as O,r as u,cR as E,_ as R,cS as T,cc as B,cd as D,j as e,g as V,d as q,bh as Z,cf as X,T as Y,aQ as w,as as $,m as x,ao as b,h as L}from"./index-Cc6SKmJ5.js";import{u as k,a as F,b as G}from"./index-DVFISLOK.js";import{s as K}from"./queries-DZQMPYx5.js";import{S as W}from"./SubscribeModal-sB8nmLdA.js";import{f as _}from"./currency-B2KsSKGc.js";import{Z as H}from"./zap-BBpi1190.js";import"./keys-DuDDGVju.js";import"./external-link-CZRlA07R.js";import"./keys-6kSWFkYN.js";import"./infinity-CwA5HNv8.js";function M(s,i){return P({...s,enabled:!0,suspense:!0,throwOnError:Q,placeholderData:void 0},I,i)}const J=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],U=z("cpu",J);const ee=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],se=z("layers",ee);function S(s){const i=A(()=>O(s)),{isStatic:d}=u.useContext(E);if(d){const[,c]=u.useState(s);u.useEffect(()=>i.on("change",c),[])}return i}const te=({children:s,className:i,onClick:d,variant:c="primary",disabled:o})=>{const m=u.useRef(null),l=S(0),p=S(0),v=t=>{if(!m.current||o)return;const{clientX:a,clientY:h}=t,{left:f,top:y,width:j,height:N}=m.current.getBoundingClientRect(),r=f+j/2,n=y+N/2;l.set((a-r)*.15),p.set((h-n)*.15)},g=()=>{l.set(0),p.set(0)};return e.jsx(x.button,{ref:m,onClick:d,disabled:o,onMouseMove:v,onMouseLeave:g,style:{x:l,y:p},className:b("relative overflow-hidden rounded-xl w-full py-4 font-medium transition-all duration-300",o?"opacity-50 cursor-not-allowed grayscale":"",c==="primary"?"bg-foreground text-background hover:bg-foreground
1/90":"border border-input bg-background hover:bg-accent hover:text-accent-foreground",i),children:e.jsx("span",{className:"relative z-10 flex items-center justify-center gap-2",children:s})})},re=({icon:s,className:i})=>e.jsx("div",{className:b("flex items-center justify-center transition-transform hover:scale-110 duration-300",i),children:e.jsx(s,{className:"h-full w-full",strokeWidth:1.5})}),C=({children:s})=>e.jsxs("div",{className:"inline-flex items-center gap-1.5 rounded-full border border-border/40 bg-secondary/30 px-3 py-1 text-[10px] uppercase tracking-wider text-muted-foreground backdrop-blur-sm",children:[e.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-emerald-500"})]}),s]}),ae=({images:s,currentIndex:i,setIndex:d})=>e.jsxs("div",{className:"relative group aspect-4/3 w-full overflow-hidden rounded-3xl bg-muted/10 border border-border/40",children:[e.jsx(L,{mode:"wait",children:e.jsx(x.img,{src:s[i],initial:{opacity:0,scale:1.05},animate:{opacity:1,scale:1},exit:{opacity:0},transition:{duration:.5},className:"h-full w-full object-cover opacity-90"},i)}),e.jsx("div",{className:"absolute inset-0 bg-linear-to-t from-background via-transparent to-transparent opacity-80"}),e.jsx("div",{className:"absolute bottom-6 left-0 right-0 flex justify-center gap-2 z-10",children:s.map((c,o)=>e.jsx("button",{onClick:()=>d(o),className:b("h-1.5 rounded-full transition-all duration-300 backdrop-blur-sm",o===i?"w-8 bg-foreground":"w-2 bg-muted-foreground/40 hover:bg-muted-foreground/60")},o))})]});function ge(){const{t:s}=R(),{productId:i}=T.useParams(),[d,c]=u.useState(!1),[o,m]=u.useState(null),[l,p]=k("view",F(["overview","specs","pricing"]).withDefault("overview")),[v,g]=k("idx",G.withDefault(0)),{data:t}=M(B(i)),{data:a,isLoading:h}=D(i),{data:f}=M(K.list()),y=a&&f?f.some(r=>(r.status==="active"||r.status==="trialing")&&a.some(n=>n.id===r.plan.id)):!1,j=()=>{a&&a.length>0&&(m(a[0]),c(!0))};u.useEffect(()=>{if(!t?.images?.length)return;const r=setInterval(()=>{g(n=>(n+1)%(t?.images?.length||1))},6e3);return()=>clearInterval(r)},[t,g]);const N=t?.images?.length?t.images:t?.image?[t.image]:[];return t?e.jsxs("div",{className:"min-h-screen bg-background text-foreground selection:bg-indigo-500/30",children:[e.jsx("div",{className:"fixed inset-0 z-0 opacity-[0.03] pointer-events-none",style:{backgroundImage:"radial-gradient(#888 1px, transparent 1px)",backgroundSize:"32px 32px"}}),e.jsxs("div",{className:"relative z-10 container mx-auto max-w-400 px-4 md:px-8 py-8 md:py-12",children:[e.jsxs("header",{className:"mb-10 flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs(V,{to:"/products",className:"group flex items-center gap-2 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full border border-border/50 bg-background group-hover:border-foreground
1/50 transition-colors",children:e.jsx(q,{className:"h-4 w-4 transition-transform group-hover:-translate-x-0.5"})}),e.jsx("span",{children:s("products_ui.detail.directory")})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[t.category&&e.jsx(C,{children:t.category}),t.isNew&&e.jsx(C,{children:s("products_ui.detail.new_arrival")})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-10 lg:gap-16 items-start",children:[e.jsxs("div",{className:"lg:col-span-7 flex flex-col gap-6 lg:sticky lg:top-8",children:[e.jsx(ae,{images:N,currentIndex:v,setIndex:g}),e.jsx("div",{className:"grid grid-cols-3 gap-4",children:t.features.slice(0,3).map((r,n)=>e.jsxs("div",{className:"flex flex-col items-center justify-center text-center gap-3 rounded-2xl border border-border/30 bg-secondary/5 p-4 hover:bg-secondary/20 transition-colors",children:[e.jsx(re,{icon:[H,Z,se][n%3],className:"h-6 w-6 text-foreground/70"}),e.jsx("span",{className:"text-[11px] font-medium leading-tight text-muted-foreground",children:r})]},n))})]}),e.jsxs("div",{className:"lg:col-span-5 flex flex-col gap-8",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h1",{className:"text-3xl md:text-5xl font-bold tracking-tight text-foreground",children:t.name}),e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-1 text-amber-400",children:[e.jsx(X,{className:"fill-current h-4 w-4"}),e.jsx("span",{className:"font-mono font-bold",children:t.rating})]}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-muted-foreground/40"}),e.jsx("span",{className:"font-mono text-muted-foreground",children:e.jsx(Y,{keyName:"products_ui.detail.verified_reviews",params:{count:t.reviews},defaultValue:"{count} Verified Reviews"})})]})]}),e.jsxs("div",{className:"rounded-3xl border border-border/50 bg-linear-to-br from-background to-secondary/10 p-6 backdrop-blur-xl",children:[e.jsxs("div",{className:"mb-6 flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-widest mb-2",children:h?s("products_ui.detail.loading"):a&&a.length>0?s("products_ui.detail.billing_cycle",{cycle:a[0].billing_cycle}):s("products_ui.detail.subscription")}),e.jsx("div",{className:"flex items-baseline gap-1",children:h?e.jsx("div",{className:"h-10 w-32 bg-muted/20 rounded animate-pulse"}):a&&a.length>0?e.jsx(e.Fragment,{children:e.jsx("span",{className:"text-4xl font-bold tracking-tight text-foreground",children:_(a[0])})}):e.jsx("span",{className:"text-xl font-bold text-muted-foreground",children:s("products_ui.detail.unavailable")})})]}
1),e.jsx("div",{className:"h-12 w-12 rounded-2xl bg-foreground/5 flex items-center justify-center",children:e.jsx(U,{className:"h-6 w-6 opacity-50"})})]}),y?e.jsxs("div",{className:"p-4 rounded-xl border border-emerald-500/20 bg-emerald-500/10 flex flex-col items-center text-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-emerald-500 font-bold text-sm",children:[e.jsx(w,{className:"h-4 w-4"})," ",s("products_ui.detail.active_subscription")]}),e.jsx("p",{className:"text-xs text-muted-foreground opacity-60",children:s("products_ui.detail.full_access")})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs(te,{onClick:j,disabled:h||!a||a.length===0,children:[s("products_ui.detail.initialize_plan")," ",e.jsx($,{className:"ml-1 h-4 w-4 opacity-60"})]}),e.jsx("p",{className:"text-center text-[10px] text-muted-foreground opacity-60",children:s("products_ui.detail.secure_info")})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"relative flex w-full rounded-xl bg-secondary/20 p-1",children:["overview","specs","pricing"].map(r=>e.jsxs("button",{onClick:()=>p(r),className:b("relative z-10 flex-1 py-2 text-xs font-medium uppercase tracking-wider transition-colors",l===r?"text-foreground":"text-muted-foreground hover:text-foreground/70"),children:[s(`products_ui.detail.marketplace.tabs.${r}`),l===r&&e.jsx(x.div,{layoutId:"activeTab",className:"absolute inset-0 -z-10 rounded-lg bg-background shadow-sm border border-border/50",transition:{type:"spring",bounce:.2,duration:.6}})]},r))}),e.jsx("div",{className:"min-h-25",children:e.jsxs(L,{mode:"wait",children:[l==="overview"&&e.jsxs(x.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"space-y-6",children:[e.jsx("p",{className:"text-base leading-relaxed text-muted-foreground",children:t.details?.overview||t.description||s("products_ui.detail.no_overview")}),t.details?.benefits&&t.details.benefits.length>0&&e.jsxs("div",{className:"bg-secondary/5 rounded-xl p-5 border border-border/30",children:[e.jsx("h4",{className:"text-xs font-bold uppercase text-muted-foreground mb-3",children:s("products_ui.detail.key_advantages")}),e.jsx("ul",{className:"grid gap-3",children:t.details.benefits.map((r,n)=>e.jsxs("li",{className:"flex items-start gap-3 text-sm text-foreground/80",children:[e.jsx("div",{className:"mt-0.5 flex h-4 w-4 items-center justify-center rounded-full bg-emerald-500/10 shrink-0",children:e.jsx(w,{className:"h-2.5 w-2.5 text-emerald-500"})}),e.jsx("span",{children:r})]},n))})]})]},"overview"),l==="specs"&&e.jsx(x.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"grid grid-cols-1 gap-3",children:t.features.map((r,n)=>e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border/40 bg-background/50 px-5 py-4 text-sm transition-colors hover:bg-secondary/10",children:[e.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:s("products_ui.detail.spec_label",{count:n+1})}),e.jsx("span",{className:"font-medium text-foreground",children:r})]},n))},"specs"),l==="pricing"&&e.jsx(x.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"space-y-3",children:a&&a.length>0?a.map(r=>e.jsxs("div",{className:"group relative flex items-center justify-between p-5 rounded-xl border border-border/30 bg-secondary/5 hover:border-primary/30 transition-all cursor-default",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-sm text-foreground",children:r.name}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1 capitalize",children:s("products_ui.detail.billing_cycle_suffix",{cycle:r.billing_cycle})})]}),e.jsx("div",{className:"text-right",children:e.jsx("div",{className:"font-mono font-bold text-lg text-foreground",children:_(r)})})]},r.id)):e.jsx("div",{className:"text-center py-12 border border-dashed border-border/30 rounded-xl bg-secondary/5",children:e.jsx("p",{className:"text-muted-foreground text-sm",children:s("products_ui.detail.additional_pricing_none")})})},"pricing")]})})]})]})]})]}),e.jsx(W,{open:d,onOpenChange:c,plan:o,productName:t?.name,productKey:t?.key})]}):null}export{ge as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.