import{u as h}from"./vue-i18n-90d534a9.js";import{k as B,Q as F,bf as r,be as I,C,I as V,q as A}from"./index-ae60edf9.js";import{S as N}from"./index-ce3b9548.js";import{_ as R}from"./index.vue_vue_type_script_setup_true_lang-1170722e.js";import{D as s}from"./index-b61dcf4f.js";import{a as g}from"./open-im-sdk-wasm-f19f04ec.js";import{d as O,k as w,l as T,o as U,c as k,$ as a,a as b,bj as c,u as v,i as M}from"./@vue-cb50a1c4.js";import{s as y}from"./function-call-079e4448.js";import"./@intlify-1c0af683.js";import"./vue-router-7f882520.js";import"./dayjs-4460abc8.js";import"./@amap-aca98dec.js";import"./pinia-de4079f2.js";import"./axios-7d5a0a64.js";import"./form-data-497f8b5e.js";import"./uuid-a960c1f4.js";import"./date-fns-f56f60e6.js";import"./@babel-7fd5df1e.js";import"./mitt-f7ef348c.js";import"./@vueuse-19adab01.js";import"./livekit-client-ca552de3.js";import"./@livekit-3058dbe8.js";import"./loglevel-e40a507a.js";import"./rxjs-2154ddb2.js";import"./tslib-8dbab242.js";import"./@vuemap-5ebdc63e.js";import"./lodash-es-91418b19.js";import"./index-597402db.js";import"./arrows_left-f963ef62.js";import"./back-099fa84a.js";import"./index-e4a7d928.js";const D={class:"page_container"},H={class:"overflow-hidden rounded-md"},L={class:"mt-2 overflow-hidden rounded-md"},z={class:"mt-2 overflow-hidden rounded-md"},ve=O({__name:"index",setup(P){const{t:i}=h(),d=B(),S=F(),p=w(()=>d.storeSelfInfo.globalRecvMsgOpt===g.NotNotify),m=w(()=>d.storeSelfInfo.allowBeep===r.Allow),u=w(()=>d.storeSelfInfo.allowAddFriend===r.NotAllow),n=T({allowBeep:!1,globalRecvMsgOpt:!1,allowAddFriend:!1}),f=(o,e)=>{const t={};n[e]=!0,e==="allowBeep"&&(t[e]=o?r.Allow:r.NotAllow),e==="globalRecvMsgOpt"&&(t[e]=o?g.NotNotify:g.Nomal),e==="allowAddFriend"&&(t[e]=o?r.NotAllow:r.Allow),I(t).then(()=>{d.updateSelfInfo({...t}),C(i("messageTip.nomalSuccess"))}).catch(l=>C(l.errMsg||i("messageTip.nomalFailed"))).finally(()=>n[e]=!1)},$=()=>{y({title:i("profileMenu.clearChatHistory"),message:i("popover.clearChatHistory"),beforeClose:o=>new Promise(e=>{if(o!=="confirm"){e(!0);return}V.deleteAllMsgFromLocalAndSvr().then(()=>{S.clearHistoryMessage(),A()}).catch(t=>A({error:t})).finally(()=>e(!0))})})};return(o,e)=>{const t=N;return U(),k("div",D,[a(R,{title:o.$t("profileMenu.accountSetting")},null,8,["title"]),b("div",H,[a(s,{lable:o.$t("profileMenu.disturbMode")},{default:c(()=>[a(t,{size:"20",loading:n.globalRecvMsgOpt,"active-color":"#02C25F",modelValue:v(p),"onUpdate:modelValue":e[0]||(e[0]=l=>M(p)?p.value=l:null),onChange:e[1]||(e[1]=l=>f(l,"globalRecvMsgOpt"))},null,8,["loading","modelValue"])]),_:1},8,["lable"]),a(s,{lable:o.$t("profileMenu.newMessageSound")},{default:c(()=>[a(t,{size:"20",loading:n.allowBeep,"active-color":"#02C25F",modelValue:v(m),"onUpdate:modelValue":e[2]||(e[2]=l=>M(m)?m.value=l:null),onChange:e[3]||(e[3]=l=>f(l,"allowBeep"))},null,8,["loading","modelValue"])]),_:1},8,["lable"])]),b("div",L,[a(s,{lable:o.$t("profileMenu.disallowAddMe")},{default:c(()=>[a(t,{size:"20",loading:n.allowAddFriend,"active-color":"#02C25F",modelValue:v(u),"onUpdate:modelValue":e[4]||(e[4]=l=>M(u)?u.value=l:null),onChange:e[5]||(e[5]=l=>f(l,"allowAddFriend"))},null,8,["loading","modelValue"])]),_:1},8,["lable"]),a(s,{arrow:"",lable:o.$t("profileMenu.blacklist"),onClick:e[6]||(e[6]=l=>o.$router.push("blackList"))},null,8,["lable"]),a(s,{arrow:"",lable:o.$t("profileMenu.language"),onClick:e[7]||(e[7]=l=>o.$router.push("/language"))},null,8,["lable"])]),b("div",z,[a(s,{arrow:"",lable:o.$t("changePassword"),onClick:e[8]||(e[8]=l=>o.$router.push("/changePassword"))},null,8,["lable"]),a(s,{arrow:"",danger:"",lable:o.$t("profileMenu.clearChatHistory"),onClick:$},null,8,["lable"])])])}}});export{ve as default};
