1import{j as e}from"./vendor-query-CsYqNbmM.js";import{L as b}from"./vendor-react-CkrtinOd.js";import{D as j}from"./Dialog-D7jwhwui.js";import{B as u,t as N}from"./index-BGtza9SP.js";import{u as _}from"./vendor-i18n-l7OMnJqp.js";import{B as k,f as v,M as w,Z as y,s as L,aa as I,al as $,q as C,am as S}from"./vendor-ui-Dv3q5jvr.js";const V={generic:y,chat:w,generate:v,study:k},B={collections:$,decks:I,flashcards:k},M={collections:{free:2,pro:10,premium:"unlimited"},decks:{free:3,pro:15,premium:"unlimited"},flashcards:{free:150,pro:1e3,premium:"unlimited"}},z=({open:l,onClose:i,reason:a,variant:r="generic",topic:c,troubleCardCount:n,limit:d})=>{const{t:s}=_("common");if(r==="limit"&&d)return e.jsx(T,{open:l,onClose:i,limit:d});const m=V[r]??y,p=`upgrade.${r}.title`,x=`upgrade.${r}.highlight`,g=()=>{switch(r){case"generate":return c?s("upgrade.generate.message_with_topic",{topic:c}):s("upgrade.generate.message");case"study":return n?s("upgrade.study.message_with_count",{count:n}):s("upgrade.study.message");default:return s(`upgrade.${r}.message`)}},t=[s("ai_quota.pro_per_day"),s("upgrade.benefits.flashcards_and_decks"),s("upgrade.benefits.all_study_modes"),s("upgrade.benefits.ai_deck_generation"),s("upgrade.benefits.full_insights_dashboard")];return e.jsx(j,{open:l,onClose:i,title:s(p),children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-amber-50 dark:bg-amber-500/10 border border-amber-200 dark:border-amber-500/20",children:[e.jsx(m,{className:"h-5 w-5 text-amber-500 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-foreground",children:g()}),a&&r==="generic"&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a})]})]}),r!=="generic"&&e.jsxs("div",{className:"relative overflow-hidden rounded-lg border border-border p-3",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent to-card/90 z-10"}),e.jsxs("div",{className:"blur-[2px] opacity-60",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground mb-2",children:[e.jsx(m,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"font-medium",children:s(x)})]}),e.jsx("div",{className:"h-2 w-3/4 bg-muted rounded mb-1.5"}),e.jsx("div",{className:"h-2 w-1/2 bg-muted rounded"})]}),e.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-medium text-primary bg-primary/10 px-3 py-1.5 rounded-full",children:s("upgrade.available_with_pro")})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground mb-3",children:s("upgrade.everything_in_pro")}),e.jsx("ul",{className:"space-y-2",children:t.map((o,h)=>e.jsxs("li",{className:"flex items-center gap-2 text-sm text-foreground",children:[e.jsx(L,{className:"h-4 w-4 text-success flex-shrink-0"}),o]},h))})]}),e.jsxs("div",{className:"space-y-2 pt-2",children:[e.jsx(b,{to:"/pricing",className:"block",onClick:()=>{N("upgrade_clicked",{source:r}),i()},children:e.jsx(u,{variant:"brand",className:"w-full",children:s("upgrade.view_plans")})}),e.jsx("div",{className:"flex gap-2",children:e.jsx(u,{variant:"outline",onClick:i,className:"flex-1",children:s("upgrade.maybe_later")})})]})]})})};function T({open:l,onClose:i,limit:a}){const{t:r}=_("common"),c=B[a.resource],n=M[a.resource],d={free:r("tier_free"),pro:r("tier_pro"),premium:r("tier_premium"),unlimited:r("tier_premium")},s=d[a.tier],m=()=>{N("upgrade_clicked",{source:"limit_modal",resource:a.resource,tier:a.tier,limit:a.limit}),i()},p=r(`upgrade.limit.${a.resource}.title`,{defaultValue:r(`upgrade.limit.${a.resource}.title`)}),x=r(`upgrade.limit.${a.resource}.headline`,{count:a.limit,tier:s}),g=t=>t==="unlimited"?"â":t.toLocaleString();return e.jsx(j,{open:l,onClose:i,title:p,children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl bg-amber-50 dark:bg-amber-500/10 border border-amber-200 dark:border-amber-500/30",children:[e.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-lg bg-amber-500/15 flex items-center justify-center",children:e.jsx(C,{className:"h-5 w-5 text-amber-600 dar
1k:text-amber-400"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[e.jsx(c,{className:"h-4 w-4 text-amber-600 dark:text-amber-400 flex-shrink-0"}),x]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1.5 leading-relaxed",children:r("upgrade.limit.subhead",{defaultValue:"Upgrade to unlock more capacity. Your existing data is safe â nothing gets deleted."})})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground mb-2 font-medium",children:r("upgrade.limit.compare_title",{defaultValue:"Compare plans"})}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:["free","pro","premium"].map(t=>{const o=a.tier===t,h=n[t],f=t==="premium";return e.jsxs("div",{className:`relative rounded-lg border p-3 text-center transition-colors ${o?"border-amber-500/40 bg-amber-500/5":f?"border-primary/30 bg-primary/5":"border-border bg-card"}`,children:[o&&e.jsx("div",{className:"absolute -top-2 left-1/2 -translate-x-1/2 text-[9px] font-bold uppercase tracking-wider bg-amber-500 text-white px-1.5 py-0.5 rounded-full",children:r("upgrade.limit.you_are_here",{defaultValue:"You"})}),e.jsxs("div",{className:"flex items-center justify-center gap-1 mb-1",children:[f&&e.jsx(S,{className:"h-3 w-3 text-primary"}),e.jsx("span",{className:"text-xs font-semibold text-foreground",children:d[t]})]}),e.jsx("div",{className:"text-xl font-extrabold text-foreground tabular-nums",children:g(h)})]},t)})})]}),e.jsxs("div",{className:"space-y-2 pt-1",children:[e.jsx(b,{to:"/pricing",className:"block",onClick:m,children:e.jsx(u,{variant:"brand",className:"w-full",children:r("upgrade.view_plans")})}),e.jsx(u,{variant:"outline",onClick:i,className:"w-full",children:r("upgrade.maybe_later")})]})]})})}export{z as UpgradeModal};
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.