import{F as N}from"./section-Dbg05qO2.js";import{$ as i,aA as A,b as t,a7 as U,a8 as m,d as k,o as b,P as F}from"./app-QjDgb7aF.js";import{b as x,a as d,w,c as E,j as I,p as R,k as n,i as o,_ as S,q as g,u as l,J as s,D as u}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const M={class:"_formRoot"},W=x({__name:"email",setup(C){const r=d(i.email),q=p=>{k("i/update",{receiveAnnouncementEmail:p})},B=()=>{b({title:t.ts.password,type:"password"}).then(({canceled:p,result:e})=>{p||F("i/update-email",{password:e,email:r.value})})},f=d(i.emailNotificationTypes.includes("mention")),c=d(i.emailNotificationTypes.includes("reply")),v=d(i.emailNotificationTypes.includes("quote")),_=d(i.emailNotificationTypes.includes("follow")),V=d(i.emailNotificationTypes.includes("receiveFollowRequest")),y=d(i.emailNotificationTypes.includes("groupInvited")),T=()=>{k("i/update",{emailNotificationTypes:[f.value?"mention":null,c.value?"reply":null,v.value?"quote":null,_.value?"follow":null,V.value?"receiveFollowRequest":null,y.value?"groupInvited":null].filter(p=>p!=null)})};return w([f,c,v,_,V,y],()=>{T()}),E(()=>{w(r,()=>{B()})}),A({title:t.ts.email,icon:"ph-envelope-simple-open ph-bold ph-lg"}),(p,e)=>(I(),R("div",M,[n(N,null,{label:o(()=>[s(u(l(t).ts.emailAddress),1)]),default:o(()=>[n(U,{modelValue:r.value,"onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),type:"email","manual-save":""},S({prefix:o(()=>[e[7]||(e[7]=g("i",{class:"ph-envelope-simple-open ph-bold ph-lg"},null,-1))]),_:2},[l(i).email&&!l(i).emailVerified?{name:"caption",fn:o(()=>[s(u(l(t).ts.verificationEmailSent),1)]),key:"0"}:r.value===l(i).email&&l(i).emailVerified?{name:"caption",fn:o(()=>[e[8]||(e[8]=g("i",{class:"ph-check ph-bold ph-lg",style:{color:"var(--success)"}},null,-1)),s(" "+u(l(t).ts.emailVerified),1)]),key:"1"}:void 0]),1032,["modelValue"])]),_:1}),n(N,null,{default:o(()=>[n(m,{"model-value":l(i).receiveAnnouncementEmail,"onUpdate:modelValue":q},{default:o(()=>[s(u(l(t).ts.receiveAnnouncementFromInstance),1)]),_:1},8,["model-value"])]),_:1}),n(N,null,{label:o(()=>[s(u(l(t).ts.emailNotification),1)]),default:o(()=>[n(m,{modelValue:f.value,"onUpdate:modelValue":e[1]||(e[1]=a=>f.value=a),class:"_formBlock"},{default:o(()=>[s(u(l(t).ts._notification._types.mention),1)]),_:1},8,["modelValue"]),n(m,{modelValue:c.value,"onUpdate:modelValue":e[2]||(e[2]=a=>c.value=a),class:"_formBlock"},{default:o(()=>[s(u(l(t).ts._notification._types.reply),1)]),_:1},8,["modelValue"]),n(m,{modelValue:v.value,"onUpdate:modelValue":e[3]||(e[3]=a=>v.value=a),class:"_formBlock"},{default:o(()=>[s(u(l(t).ts._notification._types.quote),1)]),_:1},8,["modelValue"]),n(m,{modelValue:_.value,"onUpdate:modelValue":e[4]||(e[4]=a=>_.value=a),class:"_formBlock"},{default:o(()=>[s(u(l(t).ts._notification._types.follow),1)]),_:1},8,["modelValue"]),n(m,{modelValue:V.value,"onUpdate:modelValue":e[5]||(e[5]=a=>V.value=a),class:"_formBlock"},{default:o(()=>[s(u(l(t).ts._notification._types.receiveFollowRequest),1)]),_:1},8,["modelValue"]),n(m,{modelValue:y.value,"onUpdate:modelValue":e[6]||(e[6]=a=>y.value=a),class:"_formBlock"},{default:o(()=>[s(u(l(t).ts._notification._types.groupInvited),1)]),_:1},8,["modelValue"])]),_:1})]))}});export{W as default};
//# sourceMappingURL=email-BgNvUqMr.js.map
