PageSourceSearch

https://khososy.ai/assets/pricing-FPf7VonH.js

js khososy.ai collected 2026-10-05 12:09:11 UTC 8,290 bytes, 1 lines download raw bytes

1import{v as H,m as K,z as U,o as Q,n,c as m,j as e,B as V,G as E,p as d,q as h}from"./index-euS5ES71.js";import{u as W}from"./use-force-theme-njIB8P2A.js";import{A as X}from"./arrow-left-BFgkYHoc.js";import{L as Z}from"./log-out-Uu_NP1QR.js";import{C as ee}from"./check-1wLzMGyy.js";import{E as te}from"./external-link-DhW4zbbl.js";const se=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],F=H("arrow-right-left",se),re=["home.pricing.feature.chat","home.pricing.feature.animations","home.pricing.feature.notes","home.pricing.feature.generate","home.pricing.feature.presentations","home.pricing.feature.multimedia","home.pricing.feature.images","home.pricing.feature.exam","home.pricing.feature.vision","home.pricing.feature.personalize","home.pricing.feature.pomodoro","home.pricing.feature.websearch","home.pricing.feature.audiovisualiser","home.pricing.feature.knowledgegraph","home.pricing.feature.homework","home.pricing.feature.teacher","home.pricing.feature.notion","home.pricing.feature.dataanalyst","home.pricing.feature.integrations"];function me(){W("dark");const{isAuthenticated:A,logout:I}=K(),{isTrialing:O,trialDaysLeft:g,trialExpired:p,isSubscribed:l,billingInterval:T,refreshAccess:M}=U(),{t}=Q(),[f,y]=n.useState(!1),[b,j]=n.useState(!1),[c,w]=n.useState(!1),[N,v]=n.useState(""),[o,$]=n.useState(null),[i,k]=n.useState("yearly");n.useEffect(()=>{m("/api/payments/price").then(s=>s.json()).then($).catch(console.error)},[]);const z=async()=>{y(!0);try{const r=await(await m("/api/payments/create-checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({billing_interval:i})})).json();if(r.checkout_url)window.location.href=r.checkout_url;else{const a=r.detail?.message||r.detail||r.error||"Could not start checkout. Please try again.";alert(typeof a=="string"?a:JSON.stringify(a))}}catch{alert("Checkout failed. Please check your connection and try again.")}finally{y(!1)}},B=async()=>{j(!0);try{const r=await(await m("/api/payments/portal-session",{method:"POST"})).json();r.portal_url&&(window.location.href=r.portal_url)}catch(s){console.error("Portal session failed:",s)}finally{j(!1)}},S=async s=>{w(!0),v("");try{const a=await(await m("/api/payments/switch-interval",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({billing_interval:s})})).json();if(a.switched)v(t("pricing.switch.success")),M();else{const x=a.detail?.message||a.detail||a.error||"Switch failed.";alert(typeof x=="string"?x:JSON.stringify(x))}}catch{alert("Failed to switch plan. Please try again.")}finally{w(!1)}},L=o?.monthly_price??12,u=o?.yearly_price??120,J=o?.original_monthly??20,R=o?.original_yearly??200,P=o?.is_launch??!0,q=o?.spots_left??0,Y=i==="yearly"?u:L,D=i==="yearly"?R:J,G=t(i==="yearly"?"pricing.billing.per.year":"home.pricing.month"),C=i==="yearly"?(u/12).toFixed(2):null,_=Math.round((1-u/(L*12))*100);return e.jsxs("div",{className:"relative min-h-screen bg-background overflow-hidden",children:[e.jsx(V,{}),e.jsxs("div",{className:"relative z-10 flex flex-col items-center justify-center min-h-screen px-4 py-16",children:[A&&e.jsxs("div",{className:"absolute top-6 left-6 right-6 flex items-center justify-between",children:[p?e.jsx("div",{}):e.jsxs("a",{href:"/dashboard",className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(X,{className:"h-4 w-4"}),t("pricing.back.dashboard")]}),e.jsxs("button",{onClick:()=>I(),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(Z,{className:"h-4 w-4"}),t("sign.out")]})]}),e.jsxs("div",{className:"text-center max-w-2xl mb-12",children:[e.jsx("div",{className:"mx-auto mb-6 flex h-20 w-20 items-center justify-center rounded-full bg-gradient-to-br from-amber-100 to-amber-200 dark:from-amber-900/30 dark:to-amber-800/30",children:e.jsx(E,{className:"h-10 w-10 text-amber-500"})}),l?e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-3xl font-bold mb-3",children:t("pricing.subscribed.title")}),e.jsx("p",{className:"text-lg text-muted-foreground",children:t("pricing.subscribed.desc")})]}):p?e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-3xl font-bold mb-3",children:t("pricing.trial.ended.title")}),e.jsx("p",{className:"text-lg text-muted-foreground",children:t("pricing.trial.ended.desc")})]}):O?e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-3xl font-bold mb-3",children:g!==null&&g<=3?t("pricing.trial.days.left",{days:String(g)}):t("pricing.subscribe.title")}),e.jsx("p",{className:"text-lg text-muted-foreground",children:t("pricing.trial.lock.desc")})]}):e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-3xl font-bold mb-3",children:t("pricing.subscribe.title")}),e.jsx("p",{className:"text-lg text-muted-foreground",children:t("pricing.subscribed.desc")})]})]}),!l&&e.jsxs("div",{className:"flex items-center gap-1 p-1 rounded-lg bg-muted mb-6",children:[e.jsx("button",{onClick:()=>k("monthly"),className:`px-4 py-2 text-sm font-medium rounded-md transition-colors ${i==="monthly"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:t("pricing.billing.monthly")}),e.jsxs("button",{onClick:()=>k("yearly"),className:`px-4 py-2 text-sm font-medium rounded-md transition-colors flex items-center gap-2 ${i==="yearly"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[t("pricing.billing.yearly"),_>0&&e.jsx("span",{className:"text-xs font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded",children:t("pricing.billing.save",{percent:String(_)})})]})]}),e.jsxs("div",{className:"w-full max-w-lg rounded-2xl border bg-card p-8 shadow-lg relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-4 right-4 bg-primary text-primary-foreground text-xs font-bold px-3 py-1 rounded-full",children:t("home.pricing.trial.badge")}),e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h3",{className:"text-xl font-bold mb-3",children:t("home.pricing.trial.title")}),e.jsxs("div",{className:"flex items-baseline justify-center gap-2 flex-wrap",children:[P&&e.jsxs("span",{className:"text-xl text-muted-foreground line-through",children:["$",D]}),e.jsxs("span",{className:"text-5xl font-bold",children:["$",Y]}),e.jsx("span",{className:"text-lg text-muted-foreground",children:G})]}),C&&e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["~$",C,t("home.pricing.month")]}),P&&q>0&&e.jsx("p",{className:"text-green-500 font-bold mt-2 text-sm animate-pulse",children:t("home.pricing.trial.price.limited")})]}),e.jsx("ul",{className:"space-y-2.5 mb-8",children:re.map(s=>e.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[e.jsx(ee,{className:"h-4 w-4 text-green-500 shrink-0 mt-0.5"}),e.jsx("span",{className:"text-muted-foreground",children:t(s)})]},s))}),l?e.jsxs("div",{className:"space-y-3",children:[T==="yearly"?e.jsxs(d,{onClick:()=>S("monthly"),disabled:c,variant:"secondary",className:"w-full",children:[c?e.jsx(h,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(F,{className:"mr-2 h-4 w-4"}),t("pricing.switch.to.monthly")]}):e.jsxs(d,{onClick:()=>
1S("yearly"),disabled:c,className:"w-full bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-600 hover:to-orange-600 text-white",children:[c?e.jsx(h,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(F,{className:"mr-2 h-4 w-4"}),t("pricing.switch.to.yearly")]}),e.jsxs(d,{onClick:B,disabled:b,variant:"outline",className:"w-full",children:[b?e.jsx(h,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(te,{className:"mr-2 h-4 w-4"}),t("pricing.manage.subscription")]}),N&&e.jsx("p",{className:"text-sm text-center text-green-500 font-medium",children:N})]}):e.jsxs(d,{onClick:z,disabled:f,className:"w-full bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-600 hover:to-orange-600 text-white",children:[f?e.jsx(h,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(E,{className:"mr-2 h-4 w-4"}),t("pricing.subscribe.now")]}),!l&&e.jsx("p",{className:"text-xs text-center text-muted-foreground mt-4",children:t("pricing.secure.payment")})]})]})]})}export{me 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.