1import{c as b,j as e,cr as x}from"./vendor-1kUQ7zn2.js";import{ap as C,w as P,au as L,K as a,c as s,B as $,bw as B,ao as S}from"./index--kdl1ae9.js";import{s as _}from"./checkout-DROMBe3d.js";import"./vendor-date-en1IyhsK.js";import"./vendor-supabase-Dh2gyaRa.js";import"./vendor-motion-BX-jsy7E.js";import"./checkoutState-C2DchyvW.js";const Y=({size:N="default",variant:k="tabs",layout:v="stack",onEnterLicense:m,className:p,onCheckout:g,initialPlan:o,onStarted:y})=>{const c=S(),[r,h]=b.useState(()=>o&&c.includes(o)?o:C()),n=N==="large",i=k==="cards",u=v==="inline";b.useEffect(()=>{P("plans_viewed",{layout:L()})},[]);const f=e.jsx("div",{className:s(i?"grid gap-2":"flex gap-1 rounded-lg bg-muted/60 p-1"),style:i?{gridTemplateColumns:`repeat(${c.length}, minmax(0, 1fr))`}:void 0,role:"radiogroup","aria-label":"Plan",children:c.map(t=>{const d=r===t;if(i){const l=a.priceMain(t);return e.jsxs("button",{type:"button",role:"radio","aria-checked":d,"aria-label":[a.planName[t],l.amount,l.unit].filter(Boolean).join(" "),"data-testid":`plan-${t}`,onClick:()=>h(t),className:s("min-w-0 rounded-lg border px-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",n?"min-h-14 py-2":"py-1.5",d?"border-primary bg-primary/[0.06] ring-1 ring-primary":"border-border bg-card hover:border-foreground
1/25"),children:[e.jsx("span",{className:s("block text-xs font-medium",d?"text-foreground":"text-muted-foreground"),children:a.planName[t]}),e.jsxs("span",{className:"flex flex-wrap items-baseline gap-x-1 text-[15px] font-semibold leading-6 text-foreground","data-testid":`plan-price-${t}`,children:[l.amount,l.unit&&e.jsx("span",{className:"whitespace-nowrap text-xs font-normal text-muted-foreground",children:l.unit})]})]},t)}return e.jsx("button",{type:"button",role:"radio","aria-checked":d,"data-testid":`plan-${t}`,onClick:()=>h(t),className:s("flex-1 rounded-md px-2 font-medium transition-colors",n?"min-h-11 text-[15px]":"py-1.5 text-sm",d?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:a.planName[t]},t)})}),j=e.jsx($,{size:u?"default":"lg","data-testid":"checkout-button",className:s("w-full rounded-lg font-semibold",n&&"min-h-12 text-base",u&&"h-9"),onClick:()=>{g?g(r):_(r),y?.()},children:a.cta}),w=e.jsxs("p",{className:"text-balance",children:[e.jsx(x,{className:"mr-1 inline h-3 w-3 align-[-1px]","aria-hidden":!0}),a.trust]});return u?e.jsxs("div",{className:s("grid grid-cols-[15.5rem_13rem] gap-x-3 gap-y-1.5",p),"data-testid":"plan-picker",children:[f,e.jsx("div",{className:"self-center",children:j}),e.jsxs("div",{className:"col-span-2 grid grid-cols-[15.5rem_13rem] gap-x-3 text-xs text-muted-foreground","data-testid":"checkout-trust",children:[e.jsxs("p",{className:"truncate",children:[e.jsx(x,{className:"mr-1 inline h-3 w-3 align-[-1px]","aria-hidden":!0}),a.trustShort]}),e.jsx("p",{className:"truncate text-center","data-testid":"checkout-reassurance",children:a.reassurance(r).join(" · ")})]})]}):e.jsxs("div",{className:s("w-full space-y-3",p),"data-testid":"plan-picker",children:[f,!i&&e.jsx("p",{className:s("text-center text-muted-foreground",n?"text-[15px]":"text-sm"),"data-testid":"plan-line",children:a.planLine(r)}),j,i?e.jsxs("div",{className:"space-y-0.5 text-center text-muted-foreground","data-testid":"checkout-trust",children:[e.jsxs("p",{className:"text-xs leading-4",children:[e.jsx(x,{className:"mr-1 inline h-3 w-3 align-[-1px]","aria-hidden":!0}),a.trustShort]}),e.jsx("p",{className:"text-xs leading-4","data-testid":"checkout-reassurance",children:a.reassurance(r).join(" · ")})]}):e.jsxs("div",{className:"space-y-1 text-center text-xs text-muted-foreground","data-testid":"checkout-trust",children:[w,e.jsx("p",{"data-testid":"checkout-reassurance",children:a.reassurance(r).join(" · ")})]}),m&&e.jsx("div",{className:"text-center",children:e.jsx(B,{onClick:m,size:n?"large":"default"})})]})};export{Y as PlanPicker};
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.