1import{r as m,l as x,f as j,u as y,j as e,F as b}from"./vendor-react-uJJ-sCZi.js";import{e as S,h as u,u as E,b as w,f as L}from"./painted-dots-D9gMCW4K.js";import{F}from"./vendor-forms-cc_8dO4Q.js";import{n as _,L as p}from"./input-group-CHV9rPUN.js";import{S as g,a as M,T as R,F as k,I as f,b as B}from"./reset-password-Dw6v8tj8.js";import{E as D,a as P}from"./app-Din040zV.js";import{SeoMarkup as v}from"./form-BkNLjctN.js";import{action as ae}from"./form-BkNLjctN.js";import"./vendor-state-f0PB_cmY.js";import"./vendor-logrocket-oGyAbWQ1.js";import"./vendor-maps-DP291Pe7.js";import"./vendor-sanity-c4zigSsd.js";import"./resend-verification-BkoTyEdW.js";import"./app-mD5Wrmch.js";import"./app-tWJAkY20.js";const C={session_expired:{text:"Your session expired. Please sign in again.",type:"info"},oauth_failure:{text:"Google sign-in failed. Please try again.",type:"error"},password_reset_success:{text:"You've successfully reset your password!",type:"success"},email_verified:{text:"Your email has been verified. Welcome to ByBlack!",type:"success"},email_already_verified:{text:"Your email is already verified.",type:"info"},unauthorized:{text:"Please sign in to continue.",type:"info"}};function A(r){return r?C[r]:null}function I(){const[r,s]=m.useState(null),[t,a]=x(),o=t.get("reason");m.useEffect(()=>{o&&(s(A(o)),a(l=>(l.delete("reason"),l),{replace:!0}))},[o,s,a]);const n=m.useCallback(()=>s(null),[]);return[r,n]}function Z({request:r}){const s=w(r).get("redirect_url");return s?{redirectUrl:s}:null}const ee={breadcrumb:"Login",title:"Welcome back to the best platform for your Black business.",description:"Things change â Keep consumers updated with your hours, services, certifications and what makes you special.",theme:R.YELLOW};function se(){const r=j(),s=y(),[t,a]=I(),o=s?.redirectUrl&&`?redirect_url=${encodeURIComponent(s.redirectUrl)}`;return e.jsxs(e.Fragment,{children:[e.jsx(v,{}),r?.message?e.jsx(D,{error:r.message},Math.random()):t?e.jsx(P,{isVisible:!0,className:S(u.banner,{[u.reset]:t.type==="success",[u.error]:t.type==="error"}),onDismiss:a,children:t.text}):null,e.jsx(g,{children:"Social Login"}),e.jsx(M,{}),e.jsx(g,{children:"Email Login"}),e.jsx(T,{action:o})]})}const Y=r=>{const s={};return L(r.email)||(s.email="Invalid email"),Object.entries(r).forEach(([t,a])=>{a||(s[t]="Required")}),s};function T({action:r}){const[s,t]=E("login-email","");return e.jsx(F,{enableReinitialize:!0,initialValues:{email:s,password:""},onSubmit:_,validate:Y,children:({errors:a,handleBlur:o,handleChange:n,isSubmitting:l,setSubmitting:h,touched:d,values:c})=>e.jsxs(k,{as:b,action:r,method:"post",onSubmit:()=>h(!0),reloadDocument:!0,children:[e.jsx(f,{autoComplete:"username",placeholder:"e.g. [email protected]",error:a.email,label:"Email Address",name:"email",onBlur:o,onChange:i=>{n(i),t(i.target.value)},touched:d.email,type:"email",value:c.email}),e.jsx(f,{autoComplete:"current-password",placeholder:"*****",error:a.password,label:"Password",name:"password",onBlur:o,onChange:n,touched:d.password,type:"password",value:c.password}),e.jsx(B,{isLoading:l,disabled:Object.keys(c).some(i=>a[i]||!c[i]),subtext:e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Don't have an account?"," ",e.jsx(p,{to:"/signup",children:"Join now."})]}),e.jsx("p",{children:e.jsx(p,{to:"/forgot-password",children:"Forgot your password?"})})]}),children:"Log in"})]})})}export{T as LoginForm,ae as action,se as default,ee as handle,Z as loader};
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.