import{r as d,d as c,o as r,c as i,a as s,H as _,l as v,v as f,t as h,e as p,w as C,f as N,g as u,F as P,i as m}from"./app-91dba96b.js";import{i as V}from"./index-0653e21c.js";import"./appFunction-1b5b1f43.js";const B={class:"text-center mt-4"},D=s("h1",{class:"h2 p-3"},"Join User",-1),U={class:"card"},E={class:"card-body"},j={class:"m-sm-3"},F={class:"mb-3"},J=s("label",{class:"form-label"},[u("Password "),s("span",{class:"text-danger"},"*")],-1),M={key:0,class:"text-danger"},S={class:"mb-3"},T=s("label",{class:"form-label"},[u("Confirm Password "),s("span",{class:"text-danger"},"*")],-1),q={key:0,class:"text-danger"},H=s("div",{class:"mb-2"},[s("small",{class:"text-danger"},[s("i",null," * Password must be at least 8 characters least one uppercase and one lowercase letter and one symbol and one number ")])],-1),O={class:"d-grid gap-2 mt-3"},z=["disabled"],K={__name:"joinUser",props:{user:{required:!0}},setup(w){const b=w,o=d({}),t=d(!1),a=d({}),g=()=>{t.value=!0,o.value={};const l=JSON.parse(b.user);a.value.invitation_token=l.invitation_token,a.value.email=l.email,V.post("join/user",a.value).then(e=>{m.success(e.data.message),window.location.href="/login"}).catch(({response:e})=>{e.status===422?(o.value=e.data.errors,e.data.message&&m.error(e.data.message)):m.error(e.data.message)}).finally(()=>t.value=!1)};return(l,e)=>{const y=c("app-logo"),x=c("app-button-loader"),k=c("app-auth-footer");return r(),i(P,null,[s("div",B,[_(y),D]),s("div",U,[s("div",E,[s("div",j,[s("div",F,[J,v(s("input",{class:"form-control form-control-lg email",type:"password","onUpdate:modelValue":e[0]||(e[0]=n=>a.value.password=n),placeholder:"Enter New Password"},null,512),[[f,a.value.password]]),o.value.password?(r(),i("div",M,h(o.value.password[0]),1)):p("",!0)]),s("div",S,[T,v(s("input",{class:"form-control form-control-lg email",type:"password","onUpdate:modelValue":e[1]||(e[1]=n=>a.value.confirm_password=n),placeholder:"Enter Confirm Password"},null,512),[[f,a.value.confirm_password]]),o.value.confirm_password?(r(),i("div",q,h(o.value.confirm_password[0]),1)):p("",!0)]),H,s("div",O,[s("button",{type:"button",class:"btn btn-lg btn-primary",onClick:C(g,["prevent"]),disabled:t.value},[t.value?(r(),N(x,{key:0})):p("",!0),u(" Confirm ")],8,z)])])])]),_(k)],64)}}};export{K as default};
