"use strict";const e=require("../../../../common/vendor.js");require("../../../adapter-vue.js");const t=require("../../../utils/env.js");Math||n();const n=()=>"../../common/Avatar/index.js",r=e.defineComponent({__name:"manage-profile",props:{userInfo:{type:Object,default:()=>({})}},emits:["handleSwitchConversation","close","openConversation"],setup(n,{emit:r}){const a=n,o=e.ref(!1),s=e.ref({});e.watchEffect((()=>{s.value=a.userInfo}));const u=r;e.watch((()=>a.userInfo),(async(t,n)=>{if(t===n)return;const r=await e.Zt.getUserProfile({userIDList:[a.userInfo.userID]});s.value=null==r?void 0:r.data[0],c()}),{deep:!0,immediate:!0});const i=async(n,r)=>{const a=`${r}${n}`;e.Xt.getConversationProfile(a).then((n=>{e.Xt.switchConversation(n.data.conversation.conversationID).then((()=>{var n;e.Jt.update(e.o.GRP,"isShowManageComponent",!1),t.isUniFrameWork&&(null==(n=e.i)||n.navigateBack())}))})).catch((e=>{console.warn("获取会话资料失败",e.code,e.msg)}))},c=async()=>{s.value.userID&&e.ts.checkFriend({userIDList:[s.value.userID],type:e.qt.TYPES.SNS_CHECK_TYPE_BOTH}).then((t=>{var n,r,a;const s=null==(a=null==(r=null==(n=null==t?void 0:t.data)?void 0:n.successUserIDList)?void 0:r[0])?void 0:a.relation;o.value=s===e.qt.TYPES.SNS_TYPE_BOTH_WAY}))},f=()=>o.value||!e.Jt.getData(e.o.APP,"isOfficial");return(n,r)=>e.e({a:!e.unref(t.isUniFrameWork)},e.unref(t.isUniFrameWork)?e.e({j:e.t(e.unref(e.Wt).t("TUIGroup.群成员")),k:e.t(e.unref(e.Wt).t("关闭")),l:e.o$1((e=>{u("close","profile")})),m:e.p({url:e.unref(s).avatar,size:"60px"}),n:e.t(e.unref(s).nick||e.unref(s).userID),o:e.t(e.unref(s).userID),p:e.t(e.unref(e.Wt).t("TUIContact.个性签名")),q:e.t(e.unref(s).selfSignature),r:f()},f()?{s:e.t(e.unref(e.Wt).t("TUIContact.发送消息")),t:e.o$1((t=>i(e.unref(s).userID,"C2C")))}:{}):e.e({b:e.unref(s).avatar||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png",c:e.t(e.unref(s).nick||e.unref(s).userID),d:e.t(e.unref(s).userID),e:e.t(e.unref(e.Wt).t("TUIContact.个性签名")),f:e.t(e.unref(s).selfSignature),g:f()},f()?{h:e.t(e.unref(e.Wt).t("TUIContact.发送消息")),i:e.o$1((t=>i(e.unref(s).userID,"C2C")))}:{}))}}),a=e._export_sfc(r,[["__scopeId","data-v-aae3e3b6"]]);wx.createComponent(a);
