1var g=(E,t,v)=>new Promise((n,u)=>{var p=a=>{try{o(v.next(a))}catch(s){u(s)}},h=a=>{try{o(v.throw(a))}catch(s){u(s)}},o=a=>a.done?n(a.value):Promise.resolve(a.value).then(p,h);o((v=v.apply(E,t)).next())});import{e as U,f as N,u as P,g as T,s as $,o as _,c as w,w as j,a as e,t as r,h as l,k as L,m as x,q as F,n as C,v as O,E as R,p as S,b as z,D as A,_ as G,y as d,G as H,H as f,I as J,J as K,K as Q,L as W,M as X,N as Y,O as Z}from"./index-lVioz9VK.js";const ee={class:"flex justify-center"},ae={class:"w-full max-w-[640px]"},te={class:"text-[32px] lg:text-[40px] font-bold leading-none"},le={class:"text-gray-400 mt-2 text-sm lg:text-base"},se={class:"block text-gray-400 mb-2"},oe={class:"text-black"},ne={class:"block text-gray-400 mb-2"},re={class:"relative"},ue=["src"],ie=["placeholder"],ce={class:"block text-gray-400 mb-2"},de={class:"relative"},ve=["src"],pe=["placeholder"],he={class:"block text-gray-400 mb-2"},me={class:"relative"},fe=["src"],ye=["type","placeholder"],ge=["disabled"],we={__name:"ChangeEmailView",setup(E){const{t}=U(),v=d(""),n=d(""),u=d(""),p=d(""),h=d(!1),o=d(!1),a=d(0),s=d(!1),b=N(),k=P(),I=f(()=>n.value?K:Q),V=f(()=>u.value?W:X),B=f(()=>p.value?Y:Z),y=f(()=>n.value.trim()!==""&&u.value.trim()!==""&&p.value.trim()!=="");T(()=>g(this,null,function*(){try{const i=yield $();v.value=i.data.email}catch(i){console.error("Failed to fetch user info:",i),b.error("Failed to load user information")}}));const D=()=>g(this,null,function*(){if(!(!n.value||o.value||a.value>0))try{o.value=!0,yield J({email:n.value,type:3}),a.value=60;const i=setInterval(()=>{a.value--,a.value<=0&&clearInterval(i)},1e3);b.success("éªè¯ç å·²åéï¼è¯·æ¥æ¶é®ä»¶")}finally{o.value=!1}}),M=()=>g(this,null,function*(){if(!(!y.value||s.value))try{s.value=!0,yield H({email:n.value,code:p.value,password:u.value}),b.success("é®ç®±ä¿®æ¹æå"),k.push("/client-portal")}catch(i){console.error("Change email failed:",i)}finally{s.value=!1}}),q=f(()=>o.value?t("auth.sending"):a.value>0?`${a.value}s`:t("auth.getCode"));return(i,c)=>(_(),w(G,{showBgImage:!0,bgPosition:"bottom-right"},{default:j(()=>[e("div",ee,[e("div",ae,[e("div",null,[e("h2",te,r(l(t)("changeEmail.title")),1),e("p",le,r(l(t)("changeEmail.subtitle")),1)]),e("form",{onSubmit:L(M,["prevent"]),class:"mt-8 space-y-6"},[e("div",null,[e("label",se,r(l(t)("changeEmail.currentEmail")),1),e("p",oe,r(v.value),1)]),e("div",null,[e("label",ne,r(l(t)("changeEmail.newEmail")),1),e("div",re,[e("img",{src:I.value,alt:"",class:"absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5"},null,8,ue),x(e("input",{type:"email","onUpdate:modelValue":c[0]||(c[0]=m=>n.value=m),placeholder:l(t)("auth.enterEmail"),class:"w-full pl-12 pr-4 py-3 rounded-lg border border-[#D4E1F2] focus:outline-none focus:border-[#0174FF]",required:""},null,8,ie),[[F,n.value]])])]),e("div",null,[e("label",ce,r(l(t)("changeEmail.verificationCode")),1),e("div",de,[e("img",{src:B.value,alt:"",class:"absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5"},null,8,ve),x(e("input",{type:"text","onUpdate:modelValue":c[1]||(c[1]=m=>p.value=m),placeholder:l(t)("auth.enterCode"),class:"w-full pl-12 pr-24 py-3 rounded-lg border border-[#D4E1F2] focus:outline-none focus:border-[#0174FF]",required:""},null,8,pe),[[F,p.value]]),e("button",{type:"button",class:C(["absolute right-3 top-1/2 -translate-y-1/2 text-[#0174FF]",{"opacity-50 cursor-not-allowed":o.value||a.value>0,"cursor-pointer":!o.value&&a.value===0}]),onClick:D},r(q.value),3)])]),e("div",null,[e("label",he,r(l(t)("changeEmail.password")),1),e("div",me,[e("img",{src:V.value,alt:"",class:"absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5"},null,8,fe),x(e("input",{type:h.value?"text":"password","onUpdate:modelValue":c[2]||(c[2]=m=>u.value=m),placeholder:l(t)("auth.enterPassword"),class:"w-full pl-12 pr-12 py-3 rounded-lg border border-[#D4E1F2] focus:outline-none focus:border-[#0174FF]",required:""},null,8,ye),[[O,u.value]]),e("button",{type:"button",onClick:c[3]||(c[3]=m=>
1h.value=!h.value),class:"absolute right-4 top-1/2 -translate-y-1/2 text-gray-400"},[h.value?(_(),w(l(S),{key:1,class:"h-5 w-5"})):(_(),w(l(R),{key:0,class:"h-5 w-5"}))])])]),e("button",{type:"submit",disabled:!y.value||s.value,class:C(["w-full py-3 bg-gradient-to-r from-[#0174FF] to-[#00E39B] text-white rounded-full flex items-center justify-center",{"opacity-70 cursor-not-allowed":!y.value||s.value,"hover:opacity-90":y.value&&!s.value}])},[e("span",null,r(s.value?l(t)("changeEmail.changing"):l(t)("changeEmail.changeButton")),1),z(l(A),{class:"w-5 h-5 ml-2"})],10,ge)],32)])])]),_:1}))}};export{we as default};
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.