1import{t as c}from"./ClnHdtQV.js";import{emailRegex as u}from"./BzQM-gab.js";import{u as i,z as a,A as d}from"./ZPaimFvj.js";import{s as f}from"./CGm3HZhl.js";const g=()=>{const{$toast:t}=i(),e=a(0),o=a(null),n=d(()=>e.value>0?{text:`${e.value}S`,style:{backgroundColor:"#F7F8FB",color:"#000000",cursor:"not-allowed"}}:{text:"GET CODE",style:{backgroundColor:"#6c4bda",color:"#ffffff",cursor:"pointer"}});return{handleSendEmailCode:async r=>{if(!r.email.trim()){t.error("Email can not be empty");return}if(!u.test(r.email)){t.error("Incorrectly formed email");return}if(e.value>0)return;const l=await $fetch("/gateway/user/user/sendEmailCode",{method:"POST",body:{email:r.email,type:r.type}}).catch(s=>{console.log(s)});l?.code===0?(r.type===1&&c("register_send_code"),t.success("Verify code send success"),e.value=60,o.value=f(()=>{e.value--,e.value<=0&&(clearInterval(o.value),e.value=0,o.value=null)},1e3)):t.error(l?.message||"Server error")},verifyCodeBtnConfig:n}};export{g as useGetEmailCode};
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.