1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9057],{2576:(e,a,t)=>{Promise.resolve().then(t.bind(t,7327))},7327:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>V});var l=t(909),s=t(7193),r=t(587),n=t(5963),i=t(9577),o=t(570),c=t(5352),d=t(4282),u=t(3551),m=t(4615);let p=(0,u.F)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-green-100 text-green-800",purple:"border-transparent bg-purple-100 text-purple-800"}},defaultVariants:{variant:"default"}});function x(e){let{className:a,variant:t,...s}=e;return(0,l.jsx)("div",{className:(0,m.cn)(p({variant:t}),a),...s})}var h=t(6930),f=t(7036);let g=h.bL;h.l9;let b=h.ZL;h.bm;let v=s.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,l.jsx)(h.hJ,{ref:a,className:(0,m.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...s})});v.displayName=h.hJ.displayName;let y=s.forwardRef((e,a)=>{let{className:t,children:s,...r}=e;return(0,l.jsxs)(b,{children:[(0,l.jsx)(v,{}),(0,l.jsxs)(h.UC,{ref:a,className:(0,m.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...r,children:[s,(0,l.jsxs)(h.bm,{className:"absolute right-4 top-4 roun
1ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,l.jsx)(f.A,{className:"h-4 w-4"}),(0,l.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});y.displayName=h.UC.displayName;let j=e=>{let{className:a,...t}=e;return(0,l.jsx)("div",{className:(0,m.cn)("flex flex-col space-y-1.5 text-center sm:text-left",a),...t})};j.displayName="DialogHeader";let w=e=>{let{className:a,...t}=e;return(0,l.jsx)("div",{className:(0,m.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...t})};w.displayName="DialogFooter";let N=s.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,l.jsx)(h.hE,{ref:a,className:(0,m.cn)("text-lg font-semibold leading-none tracking-tight",t),...s})});N.displayName=h.hE.displayName;let S=s.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,l.jsx)(h.VY,{ref:a,className:(0,m.cn)("text-sm text-muted-foreground",t),...s})});S.displayName=h.VY.displayName;var P=t(4659);let k=(0,u.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),C=s.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,l.jsx)(P.b,{ref:a,className:(0,m.cn)(k(),t),...s})});C.displayName=P.b.displayName;var E=t(8232),F=t(3768);let R=s.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,l.jsx)(E.bL,{className:(0,m.cn)("grid gap-2",t),...s,ref:a})});R.displayName=E.bL.displayName;let A=s.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,l.jsx)(E.q7,{ref:a,className:(0,m.cn)("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:(0,l.jsx)(E.C1,{className:"flex items-center justify-center",children:(0,l.jsx)(F.A,{className:"h-2.5 w-2.5 fill-current text-current"})})})});A.displayName=E.q7.displayName;let I=s.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,l.jsx)("textarea",{className:(0,m.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:a,...s})});I.displayName="Textarea";var T=t(3683),D=t(3760),_=t(5753),z=t(9391),O=t(7014),U=t(5920),M=t(8107);let Y=[{value:"too_expensive",label:"It's too expensive"},{value:"dont_use",label:"I don't use it enough"},{value:"missing_features",label:"Missing features I need"},{value:"found_alternative",label:"Found an alternative"},{value:"didnt_sign_up",label:"I didn't mean to sign up"},{value:"other",label:"Other reason"}],L={id:"free",name:"Eleanor Free",description:"Get started with Eleanor",features:["10 minutes per day","Daily check-in calls","Basic conversations"]},J=["free","daily","always"],$=e=>J.indexOf(e);function G(){var e,a,t;let{data:u,status:m}
1=(0,r.wV)(),p=(0,n.useSearchParams)(),h=(0,n.useRouter)(),b=(0,s.useRef)(!1),[v,P]=(0,s.useState)({}),[k]=(0,s.useState)(()=>p.get("plan")),[E,F]=(0,s.useState)(null),[J,G]=(0,s.useState)(!1),[V,B]=(0,s.useState)([]),[q,H]=(0,s.useState)(!0),[K,W]=(0,s.useState)(null),[Z,X]=(0,s.useState)("free"),[Q,ee]=(0,s.useState)(!1),[ea,et]=(0,s.useState)(null),[el,es]=(0,s.useState)(null),[er,en]=(0,s.useState)(null),[ei,eo]=(0,s.useState)(null),[ec,ed]=(0,s.useState)(null),[eu,em]=(0,s.useState)(!1),[ep,ex]=(0,s.useState)(null),[eh,ef]=(0,s.useState)(""),[eg,eb]=(0,s.useState)(!1);async function ev(e){try{console.log("[MAGIC_LINK] Client: calling signIn('magic-link'), code length=",e.length);let a=await (0,r.Jv)("magic-link",{code:e,redirect:!1});console.log("[MAGIC_LINK] Client: signIn result:",{error:null==a?void 0:a.error,ok:null==a?void 0:a.ok,status:null==a?void 0:a.status}),(null==a?void 0:a.error)?F("This link has expired."):(null==a?void 0:a.ok)&&h.replace("/subscribe",{scroll:!1})}catch(e){console.error("[MAGIC_LINK] Client: signIn exception:",e),F("This link is invalid.")}finally{G(!1)}}function ey(){console.log("[Subscribe] Starting Google sign-in..."),(0,r.Jv)("google",{callbackUrl:"/subscribe"})}(0,s.useEffect)(()=>{if(console.log("[Subscribe] Auth status:",m),console.log("[Subscribe] Session data:",u),null==u?void 0:u.user){let e=u.user;console.log("[Subscribe] User:",{name:u.user.name,email:u.user.email,id:e.id,subscription:e.subscription,eleanorJwt:e.eleanorJwt?"present":"missing",googleIdToken:e.googleIdToken?"present":"missing"})}},[u,m]),(0,s.useEffect)(()=>{(async function(){if("authenticated"===m)try{console.log("[Subscribe] Fetching subscription from Stripe...");let e=await fetch("/api/stripe/subscription");if(e.ok){let a=await e.json();console.log("[Subscribe] Stripe subscription data:",a),X(a.tier||"free"),ee(a.cancelAtPeriodEnd||!1),et(a.currentPeriodEnd||null),es(a.interval||null),en(a.cancelAt||null),eo(a.pendingDowngrade||null)}else console.error("[Subscribe] Failed to fetch subscription:",e.status),X("free"),ee(!1),et(null),es(null),en(null),eo(null)}catch(e){console.error("[Subscribe] Error fetching subscription:",e),X("free")}})()},[m]),(0,s.useEffect)(()=>{(async function(){try{let e=await fetch("/api/stripe/products"),a=await e.json();if(a.products){B(a.products);let e={};a.products.forEach(a=>{a.monthlyPrice&&(e[a.id]="monthly")}),P(e)}}catch(e){console.error("Failed to fetch products:",e)}finally{H(!1)}})()},[]),(0,s.useEffect)(()=>{let e=p.get("code");if(p.get("error")){F("Sign-in failed. Please try again.");return}e&&"unauthenticated"===m&&!b.current&&(b.current=!0,G(!0),ev(e))},[p,m]);let ej=(e,a)=>{P(t=>({...t,[e]:a}))},ew=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(e),eN=(e,a)=>{let t=12*e;return Math.round((t-a)/t*100)},eS=e=>new Date(e).toLocaleDateString("en-US",{month:"long",day:"numeric"}),eP=e=>{let a=new Date(e).getDate(),t=["th","st","nd","rd"],l=a%100;return a+(t[(l-20)%10]||t[l]||t[0])};async function ek(){if(!ep){M.oR.error("Please select a reason for canceling");return}eb(!0);try{let e=await fetch("/api/stripe/cancel",{method:"POST"});if(!e.ok){let a=await e.json();throw Error(a.error||"Failed to cancel subscription")}let a=(await e.json()).cancelAt;try{await fetch("/api/stripe/cancel-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:ep,reasonText:"other"===ep?eh:void 0,planTier:Z,cancelAt:a||ea})})}catch(e){console.error("Failed to send cancel feedback:",e)}ee(!0),en(a||ea),em(!1),ex(null),ef(""),M.oR.success("Subscription canceled",{description:"Your plan will remain active until ".concat(eS(a||ea||""))})}catch(e){console.error("Cancel error:",e),M.oR.error("Failed to cancel subscription",{description:e instanceof Error?e.message:"Please try again"})}finally{eb(!1)}}async function eC(e,a){W(a);try{var t;let a=await fetch("/api/stripe/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({priceId:e})}),l=await a.json();(null===(t=l.error)||void 0===t?void 0:t.includes("EXISTING_SUBSCRIPTION"))?M.oR.error("You already have a subscription. Use upgrade/downgrade instead."):l.url?window.location.href=l.url:(console.error("No checkout URL returned",l),M.oR.error(l.error||"Failed to start checkout"))}catch(e){console.error("Checkout error:",e),M.oR.error("Failed to start checkout")}finally{W(null)}}async function eE(e,a,t){ed(a);try{let l=await fetch("/api/stripe/change-plan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({priceId:e})}),s=await l.json();if(!l.ok)throw Error(s.error||"Failed to change plan");t?(M.oR.success("Plan upgraded!",{description:"Your new plan is now active."}),X(a),eo(null)):(M.oR.success("Downgrade scheduled",{description:"Your plan will change to ".concat(a," on ").concat(eS(s.effectiveDate))}),eo({newTier:a,effectiveDate:s.effectiveDate,newPriceId:e}))}catch(e){console.error("Change plan error:",e),M.oR.error("Failed to change plan",{description:e instanceof Error?e.message:"Please try again"})}finally{ed(null)}}async function eF(){ed("cancel-downgrade");try{let e=await fetch("/api/stripe/cancel-downgrade",{method:"POST"}),a=await e.json();if(!e.ok)throw Error(a.error||"Failed to cancel downgrade");M.oR.success("Downgrade canceled",{description:"Your current plan will continue."}),eo(null)}catch(e){console.error("Cancel downgrade error:",e),M.oR.error("Failed to cancel downgrade",{description:e instanceof Error?e.message:"Please try again"})}finally{ed(null)}}async function eR(){ed("reactivate");try{let e=await fetch("/api/stripe/reactivate",{method:"POST"}),a=await e.json();if(!e.ok)throw Error(a.error||"Failed to reactivate subscription");M.oR.success("Subscription reactivated!",{description:"Your plan will continue as normal."}),ee(!1),en(null)}catch(e){console.error("Reactivate error:",e),M.oR.error("Failed to reactivate subscription",{description:e instanceof Error?e.message:"Please try again"})}finally{ed(null)}}let eA="authenticated"===m,eI="loading"===m||J,eT=Z||"free",eD="free"===eT?"daily":eT,e_=(null==u?void 0:null===(a=u.user)||void 0===a?void 0:null===(e=a.name)||void 0===e?void 0:e.split(" ")[0])||void 0,ez=(null==u?void 0:null===(t=u.user)||void 0===t?void 0:t.email)||void 0,eO=[{...L,monthlyPrice:null,annualPrice:null,isPopular:!1,stripeProductId:null},...V.map(e=>({id:e.id,name:e.name,description:e.description,features:e.features,monthlyPrice:e.monthlyPrice,annualPrice:e.annualPrice,isPopular:e.isPopular,stripeProductId:e.stripeProductId}))],eU=e=>"free"===e?(0,l.jsx)(T.A,{className:"h-10 w-10"}):"always"===e?(0,l.jsx)(D.A,{className:"h-10 w-10"}):(0,l.jsx)(_.A,{className:"h-10 w-10"}),eM=e=>"free"===e?"Always Free":"always"===e?"Unlimited Usage":"Most Popular",eY=k&&["daily","always","free"].includes(k)?k:null;return(0,s.useEffect)(()=>
1{if(!eY||eI||q)return;let e="plan-".concat(eY),a=window.requestAnimationFrame(()=>{let a=document.getElementById(e);a&&a.scrollIntoView({behavior:"auto",block:"start"})});return()=>window.cancelAnimationFrame(a)},[eY,eI,q,eO.length]),(0,l.jsxs)("div",{className:"flex min-h-screen flex-col lg:h-screen lg:overflow-hidden",children:[(0,l.jsx)(i.Navbar,{userName:e_,userEmail:ez,isAuthenticated:eA,onSignIn:ey,variant:"subscribe"}),(0,l.jsxs)("main",{className:"flex-1 lg:flex lg:flex-col",children:[(0,l.jsx)("section",{className:"w-full py-6 md:py-8 lg:py-6 bg-gradient-to-b from-purple-50 to-white",children:(0,l.jsx)("div",{className:"container px-4 md:px-6",children:(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-2 text-center",children:[(0,l.jsx)("h1",{className:"text-3xl font-bold tracking-tighter sm:text-4xl md:text-5xl lg:text-4xl",children:"Choose Your Eleanor Plan"}),(0,l.jsx)("p",{className:"mx-auto max-w-[700px] text-gray-500 text-lg md:text-xl lg:text-xl",children:"More time with Eleanor means more meaningful conversations, cognitive engagement, and companionship every day."})]})})}),E&&(0,l.jsx)("section",{className:"w-full py-4",children:(0,l.jsx)("div",{className:"container px-4 md:px-6",children:(0,l.jsxs)("div",{className:"max-w-md mx-auto",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 p-4 rounded-lg bg-amber-50 border border-amber-200",children:[(0,l.jsx)(z.A,{className:"h-5 w-5 text-amber-600 shrink-0"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"text-amber-800 font-medium",children:E}),(0,l.jsx)("p",{className:"text-amber-700 text-sm mt-1",children:"Please sign in with Google to continue."})]})]}),(0,l.jsx)("div",{className:"mt-4 text-center",children:(0,l.jsxs)(c.$,{variant:"purple",size:"xl",className:"min-h-[56px]",onClick:ey,children:[(0,l.jsxs)("svg",{className:"w-5 h-5 mr-2",viewBox:"0 0 24 24",children:[(0,l.jsx)("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,l.jsx)("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,l.jsx)("path",{fill:"currentColor",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,l.jsx)("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Sign in with Google"]})})]})})}),(eI||q)&&(0,l.jsx)("section",{className:"w-full py-12",children:(0,l.jsx)("div",{className:"container px-4 md:px-6",children:(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,l.jsx)(O.A,{className:"h-8 w-8 animate-spin text-purple-600"}),(0,l.jsx)("p",{className:"mt-4 text-gray-500",children:"Loading..."})]})})}),!eI&&!q&&(0,l.jsx)("section",{className:"w-full py-6 md:py-8 lg:py-4 lg:flex-1",children:(0,l.jsx)("div",{className:"container px-4 md:px-6 lg:h-full",children:(0,l.jsx)("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3 max-w-6xl mx-auto lg:h-full",children:eO.map(e=>{var a,t;let s=v[e.id]||"monthly",r="monthly"===s?(null===(a=e.monthlyPrice)||void 0===a?void 0:a.amount)||0:(null===(t=e.annualPrice)||void 0===t?void 0:t.amount)||0,n=e.id===eT,i=e.monthlyPrice&&e.annualPrice?eN(e.monthlyPrice.amount,e.annualPrice.amount):0,o=null!==e.monthlyPrice,u=e.id===eD;return(0,l.jsxs)(d.Zp,{id:"plan-".concat(e.id),className:"relative flex flex-col transition-all ".concat(u?"border-purple-500 border-2 shadow-lg":"hover:border-purple-300 hover:shadow-md"),children:[u&&(0,l.jsx)("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:(0,l.jsx)(x,{variant:"purple",className:"px-3 py-1",children:eM(e.id)})}),(0,l.jsxs)(d.aR,{className:"text-center pb-4 lg:pb-4 lg:pt-6",children:[(0,l.jsx)("div",{className:"mx-auto mb-3 text-purple-600",children:eU(e.id)}),(0,l.jsx)(d.ZB,{className:"text-2xl lg:text-2xl",children:e.name}),(0,l.jsx)(d.BT,{className:"text-base lg:text-base",children:e.description})]}),(0,l.jsxs)(d.Wu,{className:"flex-1 space-y-4 lg:space-y-4 lg:py-4",children:[(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsxs)("div",{className:"text-4xl lg:text-4xl font-bold",children:[ew(r),o&&(0,l.jsxs)("span",{className:"text-lg lg:text-lg font-normal text-gray-500",children:["/","monthly"===s?"mo":"yr"]})]}),o&&(0,l.jsxs)("div",{className:"mt-3 lg:mt-3 flex items-center justify-center gap-2",children:[(0,l.jsx)("button",{onClick:a=>{a.stopPropagation(),ej(e.id,"monthly")},className:"text-base px-4 py-1.5 rounded-full transition-colors ".concat("monthly"===s?"bg-purple-100 text-purple-700":"text-gray-500 hover:text-gray-700"),children:"Monthly"}),(0,l.jsx)("button",{onClick:a=>{a.stopPropagation(),ej(e.id,"annual")},className:"text-base px-4 py-1.5 rounded-full transition-colors ".concat("annual"===s?"bg-purple-100 text-purple-700":"text-gray-500 hover:text-gray-700"),children:"Annual"}),"annual"===s&&i>0&&(0,l.jsxs)(x,{variant:"success",className:"ml-1",children:["Save ",i,"%"]})]})]}),(0,l.jsx)("ul",{className:"space-y-3 lg:space-y-3 pt-4 lg:pt-4",children:e.features.map((e,a)=>(0,l.jsxs)("li",{className:"flex items-start gap-3",children:[(0,l.jsx)(U.A,{className:"h-5 w-5 lg:h-5 lg:w-5 text-purple-600 shrink-0 mt-0.5"}),(0,l.jsx)("span",{className:"text-base lg:text-base",children:e})]},a))})]}),(0,l.jsx)(d.wL,{className:"pt-4 lg:pt-4 lg:pb-6 flex-col gap-3",children:(()=>{let a=$(e.id),t=$(eT),r=(null==ei?void 0:ei.newTier)===e.id;return eA?n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"w-full text-center",children:[(0,l.jsxs)("div",{className:"flex items-center justify-center gap-2 mb-2",children:[(0,l.jsx)("span",{className:"font-semibold text-purple-700",children:"Your Current Plan"}),Q&&(0,l.jsx)(x,{variant:"destructive",className:"text-xs",children:"Canceled"})]}),ea&&(0,l.jsx)("p",{className:"text-sm text-gray-500",children:Q?(0,l.jsxs)(l.Fragment,{children:["Ends on ",eS(er||ea)]}):"year"===el?(0,l.jsxs)(l.Fragment,{children:["Renews on ",eS(ea)]}):(0,l.jsxs)(l.Fragment,{children:["Renews on the ",eP(ea)," every month"]})}),ei&&(0,l.jsxs)("p",{className:"text-sm text-amber-600 mt-1",children:["Changing to ",ei.newTier," on ",eS(ei.effectiveDate)]})]}),Q&&o&&(0,l.jsxs)(c.$,{variant:"purple",size:"sm",className:"w-full",disabled:"reactivate"===ec,onClick:eR,children:["reactivate"===ec?(0,l.jsx)(O.A,{className:"h-4 w-4 animate-spin mr-2"}):null,"Reactivate Subscription"]}),ei&&!Q&&(0,l.jsxs)(c.$,{variant:"outline",size:"sm",className:"w-full",disabled:"cancel-downgrade"===ec,onClick:eF,children:["cancel-downgrade"===ec?(0,l.jsx)(O.A,{className:"h-4 w-4 animate-spin mr-2"}):null,"Cancel Pending Downgrade"]}),!Q&&!ei&&o&&(0,l.jsxs)(c.$,{variant:"ghost",size:"sm",className:"text-gray-500 hover:text-red-600 hover:bg-red-50",onClick:()=>em(!0),children:[(0,l.jsx)(f.A,{className:"h-4 w-4 mr-1"}),"Cancel subscription"]})]}):r?(0,l.jsx)("div",{className:"w-full text-center",children:(0,l.jsxs)(x,{variant:"outline",className:"bg-amber-50 text-amber-700 border-amber-200",children:["Starting ",eS(ei.effectiveDate)]})}):o?a<t&&a>0&&!Q&&!ei?(0,l.jsx)(c.$,{variant:"outline",size:"xl",className:"w-full min-h-[56px] text-lg",disabled:ec===e.id,onClick:()=>{var a,t;let l="monthly"===s?null===(a=e.monthlyPrice)||void 0===a?void 0:a.id:null===(t=e.annualPrice)||void 0===t?void 0:t.id;l&&eE(l,e.id,!1)},children:ec===e.id?(0,l.jsx)(O.A,{className:"h-5 w-5 animate-spin"}):"Downgrade"}):a>t?(0,l.jsx)(c.$,{variant:"purple",size:"xl",className:"w-full min-h-[56px] text-lg",disabled:K===e.id||ec===e.id,onClick:()=>{var a,t;let l="monthly"===s?null===(a=e.monthlyPrice)||void 0===a?void 0:a.id:null===(t=e.annualPrice)||void 0===t?void 0:t.id;l&&("free"===eT?eC(l,e.id):eE(l,e.id,!0))},children:K===e.id||ec===e.id?(0,l.jsx)(O.A,{className:"h-5 w-5 animate-spin"}):"free"!==eT?"Upgrade":"Subscribe"}):null:"free"===e.id&&"free"===eT?(0,l.jsx)("div",{className:"w-full text-center",children:(0,l.jsx)("span",{className:"font-semibold text-purple-700",children:"Your Current Plan"})}):null:o?(0,l.jsx)(c.$,{variant:"purple",size:"xl",className:"w-full min-h-[56px] text-lg",onClick:ey,children:"Sign in to Subscribe"}):null})()})]},e.id)})})})}),(0,l.jsx)("section",{className:"w-full py-6 md:py-8 lg:py-4 bg-gray-50",children:(0,l.jsx)("div",{className:"container px-4 md:px-6",children:(0,l.jsx)("div",{className:"max-w-2xl mx-auto text-center",children:(0,l.jsx)("p",{className:"text-gray-500 text-base",children:"All subscriptions automatically renew until canceled. You can cancel anytime from this page. Secure payment powered by Stripe."})})})})]}),(0,l.jsx)(g,{open:eu,onOpenChange:em,children:(0,l.jsxs)(y,{className:"sm:max-w-md",children:[(0,l.jsxs)(j,{children:[(0,l.jsx)(N,{children:"Cancel your subscription?"}),(0,l.jsx)(S,{children:"We're sorry to see you go. Please let us know why you're canceling."})]}),(0,l.jsxs)("div",{className:"py-4",children:[(0,l.jsx)(R,{value:ep||"",onValueChange:e=>ex(e),children:Y.map(e=>(0,l.jsxs)("div",{className:"flex items-center space-x-2 py-2",children:[(0,l.jsx)(A,{value:e.value,id:e.value}),(0,l.jsx)(C,{htmlFor:e.value,className:"cursor-pointer",children:e.label})]},e.value))}),"other"===ep&&(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)(C,{htmlFor:"reason-text",className:"text-sm text-gray-600",children:"Please tell us more (optional)"}),(0,l.jsx)(I,{id:"reason-text",value:eh,onChange:e=>ef(e.target.value),placeholder:"What could we do better?",className:"mt-2",rows:3})]})]}),(0,l.jsxs)(w,{className:"flex gap-2 sm:gap-0",children:[(0,l.jsx)(c.$,{variant:"outline",onClick:()=>{em(!1),ex(null),ef("")},children:"Keep subscription"}),(0,l.jsxs)(c.$,{variant:"destructive",onClick:ek,disabled:!ep||eg,children:[eg?(0,l.jsx)(O.A,{className:"h-4 w-4 animate-spin mr-2"}):null,"Cancel subscription"]})]})]})}),(0,l.jsx)(o.w,{userEmail:ez})]})}function V(){return(0,l.jsx)(s.Suspense,{fallback:(0,l.jsx)("div",{className:"flex min-h-screen items-center justify-center",children:(0,l.jsx)(O.A,{className:"h-8 w-8 animate-spin text-purple-600"})}),children:(0,l.jsx)(G,{})})}}},e=>{var a=a=>e(e.s=a);e.O(0,[587,7484,2636,6431,416,558,7358],()=>a(2576)),_N_E=e.O()}]);
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.