1import{B as e,c as a,r as s,av as i,R as t,$ as l,ay as n,az as r,C as o,U as u,aq as c,aH as d,aP as m,aw as v}from"./nX7w3--X.js";import{f as y,V as f,e as p,R as h,h as g,U as k,_}from"#entry";import{d as b}from"./Bo4i1EJY.js";import{u as w}from"./inpFMjNm.js";import{V as C}from"./CVi8ooJQ.js";import"./CzuCJjyz.js";const P={class:"auth-page"},V={class:"auth-card"},j={class:"icon-container pending"},q={class:"auth-subtitle"},x={class:"resend-section"},E={key:0,class:"resend-success mt-3"},I={key:1,class:"resend-error mt-3"},R={key:2,class:"no-user-hint"},z={class:"already-verified"},S=_(e({__name:"verify-email",setup(e){b({name:h.VerifyEmail});const{setSEO:_}=w();_({title:"Verify Your Email",description:"Please verify your email address to complete your registration.",noIndex:!0});const S=y(),U=a((()=>{const e=S.query.user_id;return"string"==typeof e?e:null})),H=a((()=>{const e=S.query.email;return"string"==typeof e?e:null})),O=s(!1),T=s(!1),Y=s(null),$=s(0),A=a((()=>$.value>0)),B=a((()=>!!U.value&&!O.value&&!A.value));function D(){$.value=20;const e=k((()=>{$.value--,$.value<=0&&clearInterval(e)}),1e3)}async function L(){if(B.value){O.value=!0,T.value=!1,Y.value=null;try{await $fetch("/api/auth/resend-verification",{method:"POST",body:{user_id:U.value}}),T.value=!0,D()}catch(e){429===e?.statusCode?(Y.value="Too many requests. Please wait a moment before trying again.",D()):Y.value="Something went wrong. Please wait a moment and try again."}finally{O.value=!1}}}return(e,a)=>(v(),i("div",P,[t("div",V,[t("div",j,[l(f,{size:"48",color:"white"},{default:n((()=>[...a[1]||(a[1]=[r("mdi-email-outline",-1)])])),_:1})]),a[8]||(a[8]=t("h1",{class:"auth-title"},"Check Your Email",-1)),t("p",q,[a[3]||(a[3]=r(" We've sent a verification link to ",-1)),o(H)?(v(),i(u,{key:0},[a[2]||(a[2]=t("br",null,null,-1)),t("strong",null,c(o(H)),1)],64)):(v(),i(u,{key:1},[r(" your email address. ")],64))]),a[9]||(a[9]=t("p",{class:"auth-instructions"}," Click the link in the email to verify your account and complete your registration. ",-1)),t("div",x,[a[6]||(a[6]=t("p",{class:"resend-prompt"},"Didn't receive the email?",-1)),l(p,{variant:"outlined",color:"primary",class:"text-none resend-btn",loading:o(O),disabled:!o(B),onClick:L},{default:n((()=>[o(A)?(v(),i(u,{key:0},[r(" Resend in "+c(o($))+"s ",1)],64)):(v(),i(u,{key:1},[r(" Resend verification email ")],64))])),_:1},8,["loading","disabled"]),o(T)?(v(),i("div",E,[l(f,{color:"success",size:"20",class:"mr-1"},{default:n((()=>[...a[4]||(a[4]=[r("mdi-check-circle",-1)])])),_:1}),a[5]||(a[5]=t("span",null,"Verification email sent!",-1))])):d("",!0),o(Y)?(v(),i("p",I,c(o(Y)),1)):d("",!0),o(U)?d("",!0):(v(),i("p",R," Unable to resend email. Please try signing up again. "))]),l(C,{class:"my-6"}),t("p",z,[a[7]||(a[7]=r(" Already verified? ",-1)),t("a",{href:"#",class:"text-primary",onClick:a[0]||(a[0]=m(((...e)=>o(g)&&o(g)(...e)),["prevent"]))},"Log in")])])]))}}),[["__scopeId","data-v-79f6d9ce"]]);export{S 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.