1import{u as m,j as e,d as v,R as T,a6 as q,a7 as _,D as I,O,r as p,K as E,e as x,S as F,V as H,x as L,a8 as R,a9 as D,aa as M,ab as $}from"./app-0Bbpq1Mr.js";import{u as w}from"./planCopy-Bab-u24p.js";import{S as N,t as G}from"./creditMath-B6xGGw4H.js";import{A as U,a as B,b as z,c as K}from"./accordion-ZAONdgFN.js";import{f as V}from"./faqPageSchema-COg_rkuF.js";import"./index-B5Z53tXv.js";const J=()=>{const{t}=m(),s=w(),o=[{label:t("pricing.compare.monthlyCredits"),value:r=>r.oneTime?t("pricing.compare.once",{count:r.monthlyCredits}):String(r.monthlyCredits)},{label:t("pricing.compare.dailyBonus"),value:r=>String(r.dailyCredits)},{label:t("pricing.compare.dailyCap"),value:r=>String(r.dailyMonthlyMax)},{label:t("pricing.compare.yearlyPrice"),value:r=>r.yearlyTotal>0?`$${r.yearlyTotal}`:"â"}];return e.jsxs("section",{className:"mt-20 border-t border-border pt-16 sm:mt-24",children:[e.jsx("h2",{className:"text-center text-2xl font-black tracking-tight text-foreground sm:text-3xl",children:t("pricing.compare.title")}),e.jsx("p",{className:"mx-auto mt-3 max-w-xl text-center text-base text-muted-foreground",children:t("pricing.compare.subtitle")}),e.jsx("div",{className:"mt-10 overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[560px] border-collapse text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{scope:"col",className:"py-3 pr-4 text-left font-semibold text-muted-foreground",children:t("pricing.compare.plan")}),s.map(r=>e.jsx("th",{scope:"col",className:"px-4 py-3 text-right font-bold text-foreground",children:r.name},r.id))]})}),e.jsxs("tbody",{children:[o.map(r=>e.jsxs("tr",{className:"border-b border-border/60",children:[e.jsx("th",{scope:"row",className:"py-3 pr-4 text-left font-medium text-foreground/90",children:r.label}),s.map(a=>e.jsx("td",{className:"px-4 py-3 text-right font-mono tabular-nums text-foreground",children:r.value(a)},a.id))]},r.label)),e.jsxs("tr",{children:[e.jsx("th",{scope:"row",className:"py-3 pr-4 text-left font-medium text-foreground/90",children:t("pricing.compare.everyPlan")}),e.jsx("td",{colSpan:s.length,className:"px-4 py-3 text-right",children:e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[e.jsx(v,{className:"h-4 w-4 shrink-0 text-primary"}),t("pricing.compare.everyPlanValue")]})})]})]})]})})]})},Q=[6,15],W=()=>{const{t}=m();return e.jsxs("section",{className:"mt-20 border-t border-border pt-16 sm:mt-24",children:[e.jsx("h2",{className:"text-center text-2xl font-black tracking-tight text-foreground sm:text-3xl",children:t("pricing.credits.title")}),e.jsx("p",{className:"mx-auto mt-3 max-w-2xl text-pretty text-center text-sm leading-relaxed text-muted-foreground",children:t("pricing.credits.lead")}),e.jsx("div",{className:"mx-auto mt-8 max-w-2xl overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[26rem] border-collapse text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{scope:"col",className:"py-2 pr-4 text-left font-semibold text-foreground",children:t("pricing.credits.videoHeader")}),N.map(s=>e.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-semibold text-foreground",children:s},s))]})}),e.jsx("tbody",{children:Q.map(s=>e.jsxs("tr",{className:"border-b border-border/60",children:[e.jsx("th",{scope:"row",className:"py-2.5 pr-4 text-left font-normal text-muted-foreground",children:t("pricing.credits.adOfLength",{sec:s})}),N.map(o=>e.jsx("td",{className:"px-3 py-2.5 text-right tabular-nums text-foreground",children:G(s,o)},o))]},s))})]})}),e.jsx("p",{className:"mx-auto mt-5 max-w-2xl text-pretty text-center text-xs leading-relaxed text-muted-foreground",children:t("pricing.credits.note")})]})},g=["free","credit","failed","switch","yearly","which"],k=()=>{const{t}=m();return g.map(s=>({question:t(`pricing.faq.${s}.q`),answer:t(`pricing.faq.${s}.a`)}))},Y=()=>{const{t}=m(),s=k();return e.jsxs("section",{className:"mt-20 border-t border-border pt-16 sm:mt-24",children:[e.jsx("h2",{className:"text-center text-2xl font-black tracking-tight text-foreground sm:text-3xl",children:t("pricing.faq.title")}),e.jsx(U,{type:"single",collapsible:!0,className:"mx-auto mt-10 max-w-3xl",children:s.map((o,r)=>
1e.jsxs(B,{value:g[r],className:"border-border",children:[e.jsx(z,{className:"text-left text-sm font-bold text-foreground hover:no-underline sm:text-base [&[data-state=open]>svg]:text-primary",children:o.question}),e.jsx(K,{className:"text-sm leading-relaxed text-muted-foreground",children:o.answer})]},g[r]))})]})},X={free:"pricing.highlightFree",begin:"pricing.highlightBegin",advance:"pricing.highlightAdvance",conquer:"pricing.highlightConquer"},ie=()=>{const{user:t}=T(),{plan:s,checkSubscription:o}=q(),{toast:r}=_(),{t:a}=m(),S=w(),u=I().page("pricing");O();const[c,h]=p.useState("yearly"),P=k(),[f,b]=p.useState(!1),[C,y]=p.useState(!1),A=async i=>{if(!t){y(!0);return}const l=$[i];if(l){b(!0),L("checkout_started",{target_plan:i,trigger:"pricing_page"});try{const{data:n,error:d}=await R.functions.invoke("create-checkout",{body:{priceId:c==="monthly"?l.monthly:l.yearly}});if(d)throw d;n!=null&&n.url&&window.open(n.url,"_blank")}catch(n){r({title:a("pricing.checkoutFailed"),description:D(M(n)),variant:"destructive"})}finally{b(!1)}}};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(E,{title:u.title,description:u.description,canonical:"/pricing",schemaJson:V(P)??void 0}),e.jsxs("main",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6 sm:py-16",children:[e.jsxs("div",{className:"mb-12 text-center",children:[e.jsx("h1",{className:"text-3xl font-black tracking-tight text-foreground sm:text-4xl",children:a("pricing.title")}),e.jsx("p",{className:"mx-auto mt-3 max-w-lg text-base text-muted-foreground",children:a("pricing.subtitle")}),e.jsxs("div",{className:"mt-8 inline-flex items-center gap-1 rounded-full border border-border bg-card p-1",children:[e.jsx("button",{onClick:()=>h("monthly"),className:x("flex min-h-11 items-center rounded-full px-5 text-sm font-bold transition-colors sm:min-h-0 sm:py-2",c==="monthly"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:a("pricing.monthly")}),e.jsxs("button",{onClick:()=>h("yearly"),className:x("inline-flex min-h-11 items-center whitespace-nowrap rounded-full px-5 text-sm font-bold transition-colors sm:min-h-0 sm:py-2",c==="yearly"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[a("pricing.yearly"),e.jsx("span",{className:"ml-1.5 text-xs opacity-80",children:a("pricing.yearlySave")})]})]})]}),e.jsx("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-4",children:S.map(i=>{const l=i.id===s,n=i.id==="advance",d=c==="monthly"?i.monthlyPrice:i.yearlyPrice;return e.jsxs("div",{className:x("relative flex flex-col rounded-2xl border bg-card p-6 transition-shadow",n?"border-primary shadow-lg shadow-primary/10 ring-1 ring-primary":"border-border",l&&"ring-2 ring-primary/50"),children:[n&&e.jsxs("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 inline-flex items-center whitespace-nowrap rounded-full bg-primary px-4 py-1 text-xs font-bold text-primary-foreground",children:[e.jsx(F,{className:"mr-1 h-3 w-3 shrink-0"}),a("pricing.mostPopular")]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("h3",{className:"text-lg font-bold text-foreground",children:i.name}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:a(X[i.id])})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("span",{className:"text-3xl font-black text-foreground",children:["$",d===0?"0":d.toFixed(2)]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:a("pricing.perMonth")}),c==="yearly"&&i.yearlyTotal>0&&e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:a("pricing.billedAnnually",{total:i.yearlyTotal})})]}),l?e.jsx("div",{className:"mb-6 rounded-xl border border-primary/30 bg-primary/5 px-4 py-2.5 text-center text-sm font-bold text-primary",children:a("pricing.currentPlan")}):i.id==="free"?e.jsx("div",{className:"mb-6 rounded-xl border border-border px-4 py-2.5 text-center text-sm font-bold text-muted-foreground",children:a("pricing.freeForever")}):e.jsx("button",{onClick:()=>A(i.id),disabled:f,className:x("mb-6 rounded-xl px-4 py-2.5 text-sm font-bold transition-opacity hover:opacity-90 disabled:opacity-50",n?"bg-gradient-to-r from-[hsl(var(--primary))] to-[#A57DD3] text-primary-foreground":"bg-primary text-primary-foreground"),children:a(f?"pricing.processing":"pricing.upgrade")}),e.jsx("ul",{className:"flex flex-col gap-2.5 text-sm text-foreground
1/90",children:i.features.map(j=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(v,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),e.jsx("span",{children:j})]},j))})]},i.id)})}),e.jsx(W,{}),e.jsx(J,{}),e.jsx(Y,{})]}),e.jsx(H,{open:C,onOpenChange:y})]})};export{ie as default};
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.