1import{u as p,r as i,j as e,s as l}from"./index-CUnD0zRX.js";import{L as f}from"./loader-circle-CpOmg-m6.js";import{C as h}from"./check-CC1A47Eq.js";import{M as c}from"./mail-DFtNe6So.js";function b(){const[o]=p(),r=o.get("session_id"),[t,n]=i.useState("loading");return i.useEffect(()=>{if(!r){n("error");return}let a=!1;return(async()=>{const m=`${window.location.origin}/blink-enrollment-success?session_id=${r}&signed_in=1`,{data:s,error:d}=await l.functions.invoke("check-blink-subscription",{body:{session_id:r,redirect_to:m}});if(!a){if(d||s!=null&&s.error){n("error");return}if(s!=null&&s.paid){n("paid");const u=o.get("signed_in")==="1",{data:x}=await l.auth.getSession();if(!u&&!x.session&&s.action_link){window.location.href=s.action_link;return}}else n("pending")}})(),()=>{a=!0}},[r]),e.jsx("div",{className:"min-h-screen bg-background text-foreground flex items-center justify-center px-6 py-16",children:e.jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-border bg-card p-8 sm:p-10 text-center shadow-xl shadow-foreground/5",children:[t==="loading"&&e.jsxs(e.Fragment,{children:[e.jsx(f,{className:"mx-auto h-10 w-10 animate-spin text-primary"}),e.jsx("h1",{className:"mt-5 font-serif text-2xl",children:"Confirming your enrollment..."})]}),t==="paid"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto mb-5 flex h-16 w-16 items-center justify-center rounded-full border-2 border-primary bg-primary/10",children:e.jsx(h,{className:"h-7 w-7 text-primary"})}),e.jsx("h1",{className:"font-serif text-2xl sm:text-3xl",children:"You've been enrolled."}),e.jsx("p",{className:"mt-3 text-sm leading-relaxed text-muted-foreground",children:"Your first 30 days of Blink Retraining are covered. Check your phone for your welcome text and check your email for a receipt and what to expect."}),e.jsxs("p",{className:"mt-6 text-sm text-muted-foreground",children:["If you have any problems, email"," ",e.jsxs("a",{href:"mailto:[email protected]",className:"inline-flex items-center gap-1 font-medium text-primary hover:underline",children:[e.jsx(c,{className:"h-4 w-4"}),"[email protected]"]}),"."]})]}),t==="pending"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"font-serif text-2xl",children:"Payment is still processing."}),e.jsxs("p",{className:"mt-3 text-sm text-muted-foreground",children:["Refresh this page in a moment. If this persists, email"," ",e.jsx("a",{href:"mailto:[email protected]",className:"font-medium text-primary hover:underline",children:"[email protected]"}),"."]})]}),t==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"font-serif text-2xl",children:"Could not verify enrollment."}),e.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"If you completed payment, please reach out and we'll get you set up."}),e.jsx("p",{className:"mt-6 text-sm text-muted-foreground",children:e.jsxs("a",{href:"mailto:[email protected]",className:"inline-flex items-center gap-1 font-medium text-primary hover:underline",children:[e.jsx(c,{className:"h-4 w-4"}),"[email protected]"]})})]})]})})}export{b 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.