import{j as d,T as v,o as i,f as m,g as a,u as o,w as f,F as _,Z as V,a as e,b as w,d as y,e as g,r as x,t as E,n as q,i as N,h as S}from"./app-270ac1a5.js";import{_ as U}from"./GuestLayout-722d30d2.js";import{_ as n}from"./TextInput-60dc8639.js";import{u as C}from"./errorToast-95a14887.js";import{t as R}from"./toast-fef29cb3.js";import"./CountryFlagHeader-66028c87.js";import"./toastify-7dbd0b73.js";const F={class:"row g-3",style:{"margin-top":"50px","margin-bottom":"100px"}},M={class:"col-lg-6 d-flex justify-content-center align-items-center mx-auto"},P={class:"d-flex flex-column"},j=e("h1",null,"Create Your Account",-1),k={class:"tab-content mt-4 mb-3"},A={id:"Email",class:"tab-pane fade show active"},B={class:"card"},T={class:"card-body p-4"},D=["onSubmit"],I={class:"mb-3"},L=e("label",{class:"form-label fs-6"},"Referral Id",-1),$={class:"mb-3"},z=e("label",{class:"form-label fs-6"},"Name",-1),Y={class:"mb-3"},Z=e("label",{class:"form-label fs-6"},"Email address",-1),G={class:"mb-3"},H=e("label",{class:"form-label fs-6"},"Mobile Number",-1),J={class:"mb-3"},K=e("label",{class:"form-label fs-6"},"Country",-1),O=e("option",{disabled:"",selected:"",value:"null"},"Select Country",-1),Q=["value"],W={class:"mb-3"},X=e("label",{class:"form-label fs-6"},"Password",-1),ee={class:"mb-3"},se=e("label",{class:"form-label fs-6"},"Confirm Password",-1),oe={class:"flex items-center justify-end mt-4"},te=["disabled"],le=e("span",{class:"text-secondary text-decoration-underline"},"Log In",-1),ce={__name:"Register",props:{referred_by:String,countries:Array},setup(u){const p=u,c=d(null),s=v({referral:p.referred_by,name:"",email:"",password:"",password_confirmation:"",terms:!1,mobile:"",country:null}),b=()=>{s.post(route("register"),{onError:r=>C(r),onFinish:()=>s.reset("password","password_confirmation")})},h=()=>{c.value=null,s.referral&&axios.post(route("validate.user"),{referral:s.referral}).then(r=>{c.value=r.data.sponsor_name}).catch(r=>{R("Referral does not exist","danger")})};return d(!1),d(!1),(r,l)=>(i(),m(_,null,[a(o(V),{title:"Register"}),a(U,null,{default:f(()=>[e("div",F,[e("div",M,[e("div",P,[j,e("div",k,[e("div",A,[e("div",B,[e("div",T,[e("form",{onSubmit:w(b,["prevent"])},[e("div",I,[L,a(n,{modelValue:o(s).referral,"onUpdate:modelValue":l[0]||(l[0]=t=>o(s).referral=t),placeholder:"Referral",required:"",onFocusout:h},null,8,["modelValue"])]),e("div",$,[z,a(n,{modelValue:o(s).name,"onUpdate:modelValue":l[1]||(l[1]=t=>o(s).name=t),required:"",autofocus:"",placeholder:"Enter Name"},null,8,["modelValue"])]),e("div",Y,[Z,a(n,{type:"email",modelValue:o(s).email,"onUpdate:modelValue":l[2]||(l[2]=t=>o(s).email=t),required:"",autofocus:"",placeholder:"Enter Email"},null,8,["modelValue"])]),e("div",G,[H,a(n,{modelValue:o(s).mobile,"onUpdate:modelValue":l[3]||(l[3]=t=>o(s).mobile=t),required:"",autofocus:"",placeholder:"Enter Mobile"},null,8,["modelValue"])]),e("div",J,[K,y(e("select",{"onUpdate:modelValue":l[4]||(l[4]=t=>o(s).country=t),class:"form-select",required:""},[O,(i(!0),m(_,null,x(u.countries,t=>(i(),m("option",{value:t.id},E(t.name),9,Q))),256))],512),[[g,o(s).country]])]),e("div",W,[X,a(n,{type:"password",modelValue:o(s).password,"onUpdate:modelValue":l[5]||(l[5]=t=>o(s).password=t),required:"",autofocus:"",placeholder:"Enter Password"},null,8,["modelValue"])]),e("div",ee,[se,a(n,{type:"password",modelValue:o(s).password_confirmation,"onUpdate:modelValue":l[6]||(l[6]=t=>o(s).password_confirmation=t),required:"",autofocus:"",placeholder:"Enter Password"},null,8,["modelValue"])]),e("div",oe,[e("button",{type:"submit",class:q([{"opacity-25":o(s).processing},"ml-4 btn btn-primary"]),disabled:o(s).processing}," Register ",10,te)])],40,D)])])])]),a(o(N),{href:r.route("login"),title:"#"},{default:f(()=>[S("Already registered? "),le]),_:1},8,["href"])])])])]),_:1})],64))}};export{ce as default};