import{_ as z,__tla as A}from"./Form-e4dc4c6b.js";import{_ as D,__tla as K}from"./XButton-9ed21af4.js";import{Q as k,d as T,e as j,a as l,r as x,x as O,k as Q,v as H,o as J,A as M,B as i,f as d,C as _,E as N,G as W,K as X,a8 as Y,__tla as Z}from"./index-92ad187a.js";import{u as ee,__tla as ae}from"./useForm-a4caf49a.js";import{_ as le,__tla as oe}from"./LoginFormTitle.vue_vue_type_script_setup_true_lang-d6513d00.js";import{u as re,L as te,__tla as se}from"./useLogin-8ecc0208.js";import{u as ne,__tla as ce}from"./useMessage-d9788660.js";let R,ie=Promise.all([(()=>{try{return A}catch{}})(),(()=>{try{return K}catch{}})(),(()=>{try{return Z}catch{}})(),(()=>{try{return ae}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return se}catch{}})(),(()=>{try{return ce}catch{}})()]).then(async()=>{let p,h,g,f,w,y;({t:p}=k()),h=()=>({required:o=>({required:!0,message:o||p("common.required")}),lengthRange:o=>{const{min:r,max:e,message:a}=o;return{min:r,max:e,message:a||p("common.lengthRange",{min:r,max:e})}},notSpace:o=>({validator:(r,e,a)=>{(e==null?void 0:e.indexOf(" "))!==-1?a(new Error(o||p("common.notSpace"))):a()}}),notSpecialCharacters:o=>({validator:(r,e,a)=>{/[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/gi.test(e)?a(new Error(o||p("common.notSpecialCharacters"))):a()}})}),g={class:"w-[100%] flex"},f={class:"w-[100%] flex"},w={class:"w-[100%]"},y={class:"mt-15px w-[100%]"},R=T({name:"RegisterForm",__name:"RegisterForm",setup(o){const r=ne(),{t:e}=k(),{required:a}=h(),{register:V,elFormRef:I,methods:C}=ee(),{handleBackLogin:S,getLoginState:q}=re(),E=j(()=>l(q)===te.REGISTER),c=x(0),U=async()=>{const{getFormData:m}=C,t=await m();if(t.phone!=null)if(/^(?:(?:\+|00)86)?1\d{10}$/.test(t.phone))try{F()}catch{}else r.error("\u624B\u673A\u53F7\u683C\u5F0F\u9519\u8BEF");else r.error("\u624B\u673A\u53F7\u4E0D\u80FD\u4E3A\u7A7A")},F=()=>{c.value=60;const m=setInterval(()=>{c.value--,c.value===0&&clearInterval(m)},1e3)},$=O([{field:"title",colProps:{span:24}},{field:"username",label:e("login.username"),value:"",component:"Input",colProps:{span:24},componentProps:{placeholder:e("login.usernamePlaceholder")}},{field:"password",label:e("login.password"),value:"",component:"InputPassword",colProps:{span:24},componentProps:{style:{width:"100%"},strength:!0,placeholder:e("login.passwordPlaceholder")}},{field:"check_password",label:e("login.checkPassword"),value:"",component:"InputPassword",colProps:{span:24},componentProps:{style:{width:"100%"},strength:!0,placeholder:e("login.passwordPlaceholder")}},{field:"phone",label:"\u624B\u673A\u53F7",colProps:{span:24}},{field:"code",label:e("login.code"),colProps:{span:24}},{field:"register",colProps:{span:24}}]),L={username:[a()],password:[a()],check_password:[a()],phone:[a(),{pattern:/^(?:(?:\+|00)86)?1\d{10}$/,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7",trigger:"blur"}],code:[a()]},u=x(!1);return(m,t)=>{const v=X,P=Y,b=D,B=z;return Q((J(),M(B,{rules:L,schema:l($),class:"dark:(border-1 border-[var(--el-border-color)] border-solid)","hide-required-asterisk":"","label-position":"top",size:"large",onRegister:l(V)},{title:i(()=>[d(le,{style:{width:"100%"}})]),phone:i(s=>[_("div",g,[d(P,{modelValue:s.phone,"onUpdate:modelValue":n=>s.phone=n,placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7"},{append:i(()=>[d(v,{type:"primary",onClick:U,disabled:l(c)>0},{default:i(()=>[N(W(l(c)>0?`${l(c)}\u79D2\u540E\u53EF\u91CD\u65B0\u83B7\u53D6`:"\u83B7\u53D6\u9A8C\u8BC1\u7801"),1)]),_:1},8,["disabled"])]),_:2},1032,["modelValue","onUpdate:modelValue"])])]),code:i(s=>[_("div",f,[d(P,{modelValue:s.code,"onUpdate:modelValue":n=>s.code=n,placeholder:l(e)("login.codePlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"])])]),register:i(()=>[_("div",w,[d(b,{loading:l(u),title:l(e)("login.register"),class:"w-[100%]",type:"primary",onClick:t[0]||(t[0]=s=>(async()=>{const n=l(I);n==null||n.validate(async G=>{if(G)try{u.value=!0}finally{u.value=!1}})})())},null,8,["loading","title"])]),_("div",y,[d(b,{title:l(e)("login.hasUser"),class:"w-[100%]",onClick:t[1]||(t[1]=s=>l(S)())},null,8,["title"])])]),_:1},8,["schema","onRegister"])),[[H,l(E)]])}}})});export{R as _,ie as __tla};
