1import{e as oe,m as ne,o as g,r as y,b6 as H,j as e,B as d,a0 as x,b4 as ie,L as le,b7 as ce,b8 as de,b1 as me,b2 as ue,a7 as xe,a6 as ge}from"./index-OkXy-d5Y.js";import{A as he,a as pe}from"./alert-0QuNooNy.js";import{B as O}from"./badge-D70DEMXH.js";import{C as fe,a as ye,c as be,b as je}from"./card-BOYNs0rn.js";import{S as Ne}from"./skeleton-CTnX7jIE.js";import{y as T,f as V}from"./billing-format-CjDMm46p.js";function Ae({currentPlanSlug:h,onSelectPlan:t,billingCycle:X,onBillingCycleChange:Y}={}){var k,$,S,A,P;const p=oe(),b=ne(),Z=g(ge),o=g(me),J=g(ue),j=g(de),[K,Q]=y.useState("yearly"),[W,ee]=y.useState(null),n=!!t,i=X??K,N=Y??Q;if(y.useEffect(()=>{typeof window<"u"&&window.__PRERENDER__||p(H())},[p]),j)return e.jsx("section",{className:"py-20",children:e.jsxs("div",{className:"container mx-auto px-4 max-w-md",children:[e.jsx(he,{variant:"destructive",children:e.jsx(pe,{children:j})}),e.jsx(d,{className:"mt-4",onClick:()=>p(H()),children:"Retry"})]})});const f=o.length||4,re=f<=2?"@2xl:grid-cols-2":f===3?"@3xl:grid-cols-3":"@2xl:grid-cols-2 @5xl:grid-cols-4",se=((k=o.find(r=>r.slug==="pro"))==null?void 0:k.slug)??(($=o.find(r=>{var a;return(((a=r.pricing)==null?void 0:a.monthlyPricePerMonth)??0)>0}))==null?void 0:$.slug)??((S=o[0])==null?void 0:S.slug)??null,v=W??se,l=o.find(r=>r.slug===v),w=T(((A=l==null?void 0:l.pricing)==null?void 0:A.monthlyPricePerMonth)??0,((P=l==null?void 0:l.pricing)==null?void 0:P.yearlyPricePerMonth)??0),C=r=>{const a=`/dashboard/subscribe?plan=${r}&cycle=${i}`;Z?b(a):(xe(a),b("/auth/login"))};return e.jsxs("section",{className:n?"":"py-20 relative",children:[!n&&e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 -z-10",style:{backgroundImage:"linear-gradient(to right, var(--grid-color) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px)",backgroundSize:"64px 64px"}}),e.jsxs("div",{className:n?"":"container mx-auto px-4 max-w-[1200px]",children:[!n&&e.jsxs("div",{className:"max-w-2xl",children:[e.jsx("h2",{className:"text-4xl md:text-5xl font-semibold tracking-tight",children:"Plans that grow with you"}),e.jsx("p",{className:"text-muted-foreground mt-4 text-lg",children:"Simple, transparent pricing for every stage â from your first prototype to a production fleet."})]}),!n&&e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-3 border-b border-border pb-7 mt-10",children:[e.jsxs("div",{className:"inline-flex items-center rounded-full bg-muted p-1 border border-border",children:[e.jsx("button",{type:"button",onClick:()=>N("monthly"),className:`px-5 py-2 text-sm rounded-full transition-colors ${i==="monthly"?"bg-background text-foreground shadow-sm":"text-muted-foreground"}`,children:"Monthly"}),e.jsx("button",{type:"button",onClick:()=>N("yearly"),className:`px-5 py-2 text-sm rounded-full transition-colors ${i==="yearly"?"bg-background text-foreground shadow-sm":"text-muted-foreground"}`,children:"Yearly"})]}),w>0?e.jsxs("span",{className:"text-xs font-semibold rounded-full bg-accent border border-border px-3 py-1.5 tabular-nums font-mono",children:["Save ",w,"% yearly"]}):null]}),e.jsx("div",{className:"@container",children:e.jsx("div",{className:`grid grid-cols-1 ${re} gap-6 mt-10 items-start`,children:J||o.length===0?Array.from({length:f}).map((r,a)=>e.jsx(Ne,{className:"min-h-[640px] rounded-[var(--radius)]"},`plan-placeholder-${a}`)):o.map((r,a)=>{var R,E,D,L,_,q,I,z,F;const s=r.slug===v,te=r.slug==="pro",c=i==="monthly"?((R=r.pricing)==null?void 0:R.monthlyPricePerMonth)??0:((E=r.pricing)==null?void 0:E.yearlyPricePerMonth)??0,M=((D=r.pricing)==null?void 0:D.currency)??"USD",B=T(((L=r.pricing)==null?void 0:L.monthlyPricePerMonth)??0,((_=r.pricing)==null?void 0:_.yearlyPricePerMonth)??0),m=s?"text-primary-foreground/70":"text-muted-foreground",u=s?"text-primary-foreground":"text-primary";return e.jsxs(fe,{onClick:()=>ee(r.slug??null),"aria-current":s||void 0,style:{animationDelay:`${a*80}ms`,...s?{"--archframe-card-bg":"var(--primary)","--archframe-card-border":"var(--primary)"}:{}},className:`${s?"relative z-10 text-primary-foreground shadow-xl hover:shadow-2xl md:scale-[1.035]":"border-border hover:shadow-lg"} min-h-[640px] cursor-pointer transition-transform duration-500 hover:-translate-y-1 animate-in fade-in slide-in-from-bottom-3 fill-mode-both motion-reduce:animate-none motion-reduce:transition-none motion-reduce:hover:translate-y-0`,children:[e.jsxs(ye,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(be,{as:"h3",children:r.name}
1),te&&e.jsx(O,{className:s?"bg-primary-foreground/15 text-primary-foreground hover:bg-primary-foreground/15":"",children:"Recommended"})]}),e.jsx("p",{className:`text-sm ${m}`,children:r.description})]}),e.jsxs(je,{className:"flex flex-1 flex-col gap-6",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-4xl font-semibold tracking-tight tabular-nums font-mono",children:c===0?"Free":V(c,M)}),c>0&&e.jsx("span",{className:`${m} ml-1`,children:"/mo"}),c>0&&e.jsx("p",{className:`text-xs ${m} mt-2`,children:i==="yearly"?`Billed annually â ${V(c*12,M)} today`:"Billed monthly"}),i==="yearly"&&B>0&&e.jsx("div",{className:"mt-3",children:e.jsxs(O,{variant:"secondary",className:s?"bg-primary-foreground/15 text-primary-foreground hover:bg-primary-foreground/15 border-primary-foreground/20":"",children:["Save ",B,"% vs monthly"]})})]}),e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(x,{className:`h-4 w-4 ${u}`}),(((q=r.quotas)==null?void 0:q.memoryCredits)??0).toLocaleString()," memory credits/mo"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(x,{className:`h-4 w-4 ${u}`}),(((I=r.quotas)==null?void 0:I.searchCredits)??0).toLocaleString()," search credits/mo"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(x,{className:`h-4 w-4 ${u}`}),((z=r.quotas)==null?void 0:z.maxApps)??0," apps"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(x,{className:`h-4 w-4 ${u}`}),((F=r.quotas)==null?void 0:F.maxMembers)??0," members"]}),r.features&&Object.entries(r.features).map(([U,G])=>e.jsxs("li",{className:"flex items-center gap-2",children:[G?e.jsx(x,{className:`h-4 w-4 ${u}`}):e.jsx(ie,{className:`h-4 w-4 ${m}`}),e.jsx("span",{className:G?"":m,children:U.replace(/([A-Z])/g," $1").replace(/^./,ae=>ae.toUpperCase())})]},U))]}),e.jsx("div",{className:"mt-auto",children:c===0?t?e.jsx(d,{className:s?"w-full bg-primary-foreground text-primary [background-image:none] hover:bg-primary-foreground/90":"w-full",variant:s?"default":"outline",onClick:()=>t(r.slug),children:r.slug===h?"Current plan":"Get Started Free"}):e.jsx(d,{className:s?"w-full bg-primary-foreground text-primary [background-image:none] hover:bg-primary-foreground/90":"w-full",variant:s?"default":"outline",asChild:!0,children:e.jsx(le,{to:"/auth/login",children:"Get Started Free"})}):h&&r.slug===h?e.jsx(d,{className:"w-full",variant:"outline",disabled:!0,children:"Current plan"}):s?e.jsx(d,{className:"w-full bg-primary-foreground text-primary [background-image:none] hover:bg-primary-foreground/90",onClick:()=>t?t(r.slug):C(r.slug),children:t?"Select plan":"Subscribe"}):e.jsx(d,{className:"w-full",variant:"outline",onClick:()=>t?t(r.slug):C(r.slug),children:t?"Select plan":"Subscribe"})})]})]},r.id)})})}),!n&&e.jsx("div",{className:"mt-12 flex justify-center",children:e.jsx("a",{href:ce("pricing.md"),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-full border border-border px-3 py-1.5 text-xs font-mono text-muted-foreground hover:bg-accent hover:text-foreground transition-colors",children:"Are you an AI agent? View pricing as Markdown â"})})]})]})}export{Ae as P};
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.