1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"stable-commerce-web@d14b09d"};var s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="3856a7eb-3abd-4b22-9f19-d6d3a6d5c325",e._sentryDebugIdIdentifier="sentry-dbid-3856a7eb-3abd-4b22-9f19-d6d3a6d5c325")}catch(t){}}();import{d as e,b as s,r as t,i as a,j as n,L as i,C as l,I as o,ab as r,ac as c,a6 as d,w as y}from"./index-B-mMgbQT.js";const f=()=>{const{user:f,logout:m}=e(),h=s(),[u,p]=t.useState("loading"),[x,g]=t.useState(""),[b,w]=t.useState(null),[j,F]=t.useState(!1),[S,v]=t.useState(null);t.useEffect(()=>{(null==f?void 0:f.email)&&(a(f.email)?h("/dashboard",{replace:!0}):async function(e){const s=await fetch(`${y()}/api/waitlist/status?email=${encodeURIComponent(e)}`);return(await s.json().catch(()=>({}))).status}(f.email).then(e=>{"activated"===e?h("/dashboard",{replace:!0}):p("not_found"===e?"needs_etsy":"confirmed")}).catch(()=>p("confirmed")))},[null==f?void 0:f.email,h]);const N=async()=>{await m(),h("/",{replace:!0})};return n.jsx("div",{className:"min-h-screen flex items-center justify-center px-4",style:{background:"#F5EFE2"},children:n.jsxs("div",{className:"w-full max-w-md p-10 space-y-6",style:{border:"1px solid #1A1614",boxShadow:"8px 8px 0 #1A1614",background:"#FDFAF4"},children:["loading"===u&&n.jsxs("div",{className:"flex flex-col items-center gap-4 py-4",children:[n.jsx(i,{className:"w-8 h-8 animate-spin",style:{color:"#1A1614"}}),n.jsx("p",{style:{fontFamily:"Inter, sans-serif",fontSize:14,color:"#4A3F35"},children:"Checking your status..."})]}),"needs_etsy"===u&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("h1",{style:{fontFamily:"Fraunces, Georgia, serif",fontWeight:300,fontSize:26,color:"#1A1614",letterSpacing:"-0.03em",lineHeight:1.2},children:"One more step"}),n.jsx("p",{style:{fontFamily:"Inter, sans-serif",fontSize:14,color:"#4A3F35",lineHeight:1.6},children:"Enter your Etsy shop URL to complete your waitlist registration."})]}),n.jsxs("form",{onSubmit:async e=>{if(e.preventDefault(),w(null),v(null),x.trim()){F(!0);try{if((await async function(e,s){const t=await fetch(`${y()}/api/waitlist/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,etsyShopUrl:s,source:"main"})});if(!t.ok){const e=await t.json().catch(()=>({}));throw new Error(e.error||"Registration failed")}return t.json()}(f.email,x.trim())).alreadyActivated)return void h("/dashboard",{replace:!0});p("confirmed")}catch(s){v(s.message||"Something went wrong. Please try again.")}finally{F(!1)}}else w("Please enter your Etsy shop URL")},className:"space-y-4",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(l,{htmlFor:"etsy-url",style:{fontFamily:"Inter, sans-serif",fontSize:13,fontWeight:500,color:"#1A1614"},children:"Your Etsy shop URL"}),n.jsx(o,{id:"etsy-url",type:"url",placeholder:"https://www.etsy.com/shop/yourshop",value:x,onChange:e=>{g(e.target.value),w(null)},disabled:j,className:(A=!!b,"bg-[#F5EFE2] text-sm transition-all "+(A?"border border-red-400":"border border-[#1A1614]")),style:{fontFamily:"Inter, sans-serif"},autoFocus:!0}),b&&n.jsx("p",{className:"text-xs text-destructive",style:{fontFamily:"Inter, sans-serif"},children:b})]}),S&&n.jsx("p",{className:"text-sm",style:{fontFamily:"Inter, sans-serif",color:"#A1081E"},children:S}),n.jsxs("button",{type:"submit",disabled:j,className:"w-full h-11 flex items-center justify-center gap-2 text-white text-sm font-semibold transition-all hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",style:{background:"#1A1614",boxShadow:"3px 3px 0 #D2461E",fontFamily:"Inter, sans-serif"},children:[j?n.jsx(i,{className:"w-4 h-4 animate-spin"}):n.jsx(r,{className:"w-4 h-4"}),"Join the Waitlist"]})]}),n.jsxs("button",{onClick:N,className:"inline-flex items-center gap-2 text-sm hover:opacity-80 transition-opacity",style:{fontFamily:"Inter, sans-serif",color:"#78716C"},children:[n.jsx(c,{className:"w-3.5 h-3.5"}),"Sign out"]})]}),"confirmed"===u&&n.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[n.jsx(d,{className:"w-12 h-12",style:{color:"#5C7A5E"}}
1),n.jsxs("div",{className:"space-y-2",children:[n.jsx("h1",{style:{fontFamily:"Fraunces, Georgia, serif",fontWeight:300,fontSize:28,color:"#1A1614",letterSpacing:"-0.03em",lineHeight:1.2},children:"You're on the list!"}),n.jsx("p",{style:{fontFamily:"Inter, sans-serif",fontSize:15,color:"#4A3F35",lineHeight:1.6},children:"We're setting up your store. You'll receive an email with your login credentials as soon as everything is ready."})]}),n.jsx("p",{style:{fontFamily:"Inter, sans-serif",fontSize:13,color:"#8A7A68",lineHeight:1.5},children:"This usually takes 1â2 business days. Keep an eye on your inbox."}),n.jsxs("button",{onClick:N,className:"inline-flex items-center gap-2 text-sm hover:opacity-80 transition-opacity",style:{fontFamily:"Inter, sans-serif",color:"#78716C"},children:[n.jsx(c,{className:"w-3.5 h-3.5"}),"Sign out"]})]})]})});var A};export{f 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.