import{_ as F,j as R,k as T,l as U,a as _,m as q,b as N,o as E,c as G,d as a,t as n,e as s,u as i,q as h,g as d,s as L,B as M,f,I as P,p as j,i as x}from"./index-4e8c1b57.js";import{u as z}from"./vue.f36acd1f-b96688a7.js";import{B as S}from"./BaseInput-1a25812b.js";import{B as D}from"./BaseCheckbox-dff8834d.js";import{_ as H,G as J}from"./Turnstile-7971e28c.js";import{u as K,c as O,a as V,b as y}from"./index.esm-1201bb6a.js";import"./load-script-8d839500.js";import"./BaseRadio-a051ce67.js";/* empty css */const Q=l=>(j("data-v-7b7e26b9"),l=l(),x(),l),W={class:"main"},X={id:"signin-prompt",class:""},Y={id:"one-click-signin"},Z=Q(()=>a("div",{class:"or"},"or",-1)),ee={id:"signin-form"},oe={class:"remember-row"},se={class:"create-account"},ae={__name:"SigninView",setup(l){z({title:"FindingFive - Sign in",meta:[{name:"description",content:"Sign in to participate or conduct a behavioral study"}]});const k=R(),u=T(),v=U(),B="0x4AAAAAAABoTm3RhiSAJmaK",g=_(null),r=_(""),{errors:b,handleSubmit:$,isSubmitting:A}=K({validationSchema:O({email:V().required().label("Email"),password:V().required().label("Password")})}),{value:p}=y("email"),{value:m}=y("password"),c=_(!0),I=q(()=>r.value&&!A.value),C=$(async e=>{u.pop("Signing in...","loading");try{await v.signin({remember:c.value,"cf-turnstile-response":r.value},e.email,e.password),u.remove(),k.push(v.redirectUrl)}catch(o){u.pop(o,"error",2500),r.value="",g.value.reset()}});return(e,o)=>{const w=N("RouterLink");return E(),G("main",W,[a("div",X,n(e.$t("default-signin-prompt")),1),a("div",Y,[s(J)]),Z,a("section",ee,[a("form",null,[s(S,{class:"email",type:"email",name:"email",underlined:"",placeholder:e.$t("field-email"),modelValue:i(p),"onUpdate:modelValue":o[0]||(o[0]=t=>h(p)?p.value=t:null),modelModifiers:{lazy:!0},error:i(b).email},null,8,["placeholder","modelValue","error"]),s(S,{class:"password",type:"password",name:"password",underlined:"",placeholder:e.$t("field-password"),autocomplete:"current-password",modelValue:i(m),"onUpdate:modelValue":o[1]||(o[1]=t=>h(m)?m.value=t:null),error:i(b).password},null,8,["placeholder","modelValue","error"]),a("div",oe,[s(D,{modelValue:c.value,"onUpdate:modelValue":o[2]||(o[2]=t=>c.value=t)},{default:d(()=>[f(n(e.$t("remember-me")),1)]),_:1},8,["modelValue"]),s(w,{to:"/reset-password"},{default:d(()=>[f(n(e.$t("forget-password-prompt")),1)]),_:1})]),s(H,{ref_key:"cfTurnstile",ref:g,modelValue:r.value,"onUpdate:modelValue":o[3]||(o[3]=t=>r.value=t),sitekey:i(B)},null,8,["modelValue","sitekey"]),s(M,{id:"signin-button",type:"submit",variant:"main",disabled:!I.value,onClick:L(i(C),["prevent"])},{default:d(()=>[s(i(P),{icon:"uiw:login",inline:"true"}),a("span",null,n(e.$t("sign-in-btn")),1)]),_:1},8,["disabled","onClick"]),a("div",se,[s(w,{to:"/signup"},{default:d(()=>[f(n(e.$t("create-account-prompt")),1)]),_:1})])])])])}}},ce=F(ae,[["__scopeId","data-v-7b7e26b9"]]);export{ce as default};