1import{r as o,j as e,L as n,y as f,z as y,dB as w}from"./index-D216bJFT.js";import{l as k}from"./account-help.functions-CGiRrKDR.js";function S(){const[s,r]=o.useState(""),[l,d]=o.useState(!1),[c,g]=o.useState(!1),[u,m]=o.useState(null),[i,x]=o.useState(null),b=async()=>{m(null),x(null);const t=y().trim().toLowerCase().email().max(255).safeParse(s);if(!t.success){m("Enter a valid email address first.");return}d(!0);const h=await k({data:{email:t.data}}).catch(()=>null);if(h&&!h.exists){d(!1),x({email:t.data,suggestion:h.suggestionMasked});return}const p=await w(t.data);if(d(!1),!p.ok){m(p.message??"We couldn't send that reset email. Try again in a minute.");return}g(!0)},j=s.trim()?`/reset-password?email=${encodeURIComponent(s.trim())}`:"/reset-password";return e.jsxs("div",{className:"min-h-screen bg-cream text-ink",children:[e.jsx("header",{className:"border-b border-border/60 bg-background/90 backdrop-blur",children:e.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between px-5 py-3",children:[e.jsx(n,{to:"/",className:"flex items-center gap-2",children:e.jsx("img",{src:f,alt:"Beak School",className:"h-12 w-auto sm:h-14"})}),e.jsx(n,{to:"/login",className:"text-sm font-semibold text-jungle-deep hover:text-sunset",children:"Back to sign in"})]})}),e.jsxs("main",{className:"mx-auto flex max-w-2xl flex-col px-5 py-12",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-sunset",children:"Account help"}),e.jsx("h1",{className:"mt-2 font-display text-3xl text-jungle-deep sm:text-4xl",children:"Can't sign in? Let's fix it in 2 minutes."}),e.jsx("p",{className:"mt-3 text-sm text-ink/70",children:"Work through these steps in order. Almost every login problem is solved by step 1 or step 2, and you don't need to email anyone to get back in."}),e.jsxs("div",{className:"mt-8 space-y-4",children:[e.jsx(a,{n:1,title:"Use the exact email you paid with",body:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:"This is the number one cause. If you signed up with a work address, an old address, or a slightly different spelling, the site treats it as a brand new person and your password will never match."}),e.jsx("p",{className:"mt-2",children:"Check your inbox for a Beak School receipt or welcome email. Whichever inbox that email landed in is the address on your account."})]})}),e.jsx(a,{n:2,title:"Send yourself a reset link",body:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Type that email below and we'll send a secure reset link. It's good for 1 hour, and the email also contains a 6-digit code as a backup."}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx("input",{type:"email",autoComplete:"email",placeholder:"[email protected]",value:s,onChange:t=>r(t.target.value),"aria-label":"Your email address",className:"h-11 w-full rounded-lg border border-border bg-white px-3 text-sm outline-none focus:border-sunset focus:ring-2 focus:ring-sunset/40"}),e.jsx("button",{type:"button",onClick:b,disabled:l||c,className:"h-11 shrink-0 rounded-full bg-sunset px-5 text-sm font-semibold text-white shadow-lg shadow-sunset/25 hover:brightness-110 disabled:opacity-60",children:c?"Link sent":l?"Sendingâ¦":"Send reset link"})]}),u&&e.jsx("p",{className:"text-sm text-red-600",children:u}),i&&e.jsxs("div",{className:"rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm text-ink/80",children:[e.jsxs("p",{className:"font-semibold text-ink",children:["We don't have an account for"," ",e.jsx("span",{className:"break-all",children:i.email}),"."]}),i.suggestion?e.jsxs("p",{className:"mt-1.5",children:["There is an account at a very similar address:"," ",e.jsx("span",{className:"break-all font-medium",children:i.suggestion}),". Check the spelling on your purchase receipt and try that one."]}):e.jsxs("p",{className:"mt-1.5",children:["Try the exact address on your purchase receipt, or"," ",e.jsx(n,{to:"/contact",className:"font-semibold underline",children:"send us a message"})," ","and we'll find your account."]})]}),c&&e.jsx("p",{className:"rounded-lg border border-jungle/30 bg-jungle-deep/5 p-3 text-sm text-jungle-deep",children:"If that email has an account with us, a reset link is on its way. Check your inbox and your spam or promotions folder in the next minute. Nothing after 5 minutes almost always means the account uses a different email address, so go back to step 1 and try that one."})]})}),e.jsx(a,{n:3,title:"Open the link and set your new password",body:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:"Tap the button in the email, then choose a new password (at least 6 characters). We sign you in automatically as soon as it saves."}),e.jsxs("p",{className:"mt-2",children:["If the email client strips the link, use the 6-digit code instead on the"," ",e.jsx(n,{to:j,className:"font-semibold text-jungle-deep underline underline-offset-2 hover:text-sunset",children:"reset password page"}),"."]})]})}),e.jsx(a,{n:4,title:'Got "link expired" or "invalid link"?',body:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:"Some email providers (Yahoo, Outlook, Proton) scan links before you click them, which can use up a one-time link. It's not a problem with your account."}),e.jsx("p",{className:"mt-2",children:"Just request a fresh link in step 2 and open it right away, or use the 6-digit code from that same email."})]})}),e.jsx(a,{n:5,title:"Did you originally join with Google or Apple?",body:e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Those accounts have no password at all, so resetting one won't help. On the sign-in page, tap the ",e.jsx("span",{className:"font-semibold",children:"Google"})," or"," ",e.jsx("span",{className:"font-semibold",children:"Apple"})," button instead."]}),e.jsx(n,{to:"/login",className:"mt-3 inline-flex h-10 items-center justify-center rounded-full border border-jungle-deep/30 bg-white px-5 text-sm font-semibold text-jungle-deep hover:bg-jungle-deep/5",children:"Go to sign in"})]})}),e.jsx(a,{n:6,title:"Prefer no password at all?",body:e.jsx(e.Fragment,{children:e.jsxs("p",{children:["On the sign-in page, open"," ",e.jsx("span",{className:"font-semibold",children:"More sign-in options"})," and choose"," ",e.jsx("span",{className:"font-semibold",children:"Email me a sign-in link"}),". One tap from your inbox and you're in, no password needed."]})})})]}),e.jsxs("section",{className:"mt-10 rounded-2xl border border-border/60 bg-white p-6 shadow-sm",children:[e.jsx("h2",{className:"font-display text-2xl text-jungle-deep",children:"Still stuck?"}),e.jsx("p",{className:"mt-2 text-sm text-ink/70",children:"Send us a message with the email address you think you used and roughly when you joined, and we'll match it to your account and get you in."}),e.jsx(n,{to:"/contact",className:"mt-4 inline-flex h-11 items-center justify-center rounded-full bg-jungle-deep px-6 text-sm font-semibold text-white hover:brightness-110",children:"Contact support"})]})]})]})}function a({n:s,title:r,body:l}){return e.jsx("section",{className:"rounded-2xl border border-border/60 bg-white p-5 shadow-sm sm:p-6",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-jungle-deep text-sm font-bold text-white",children:s}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"font-display text-xl text-jungle-deep sm:text-2xl",children:r}),e.jsx("div",{className:"mt-2 text-sm text-ink/70",children:l})]})]})})}export{S as component};
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.