"use strict";const e=require("../../../../../common/vendor.js");require("../../../../adapter-vue.js");const t=require("../../utils/index.js"),n=require("../../../../utils/env.js");Math||l();const l=()=>"../../../common/Avatar/index.js",u=e.defineComponent({__name:"index",props:{item:{default:()=>({})},displayOnlineStatus:{type:Boolean,default:!1}},setup(l){const u=l,i=e.inject("userOnlineStatusMap"),r=e.ref(!1),o={[e.qt.TYPES.GRP_WORK]:"Work",[e.qt.TYPES.GRP_AVCHATROOM]:"AVChatRoom",[e.qt.TYPES.GRP_PUBLIC]:"Public",[e.qt.TYPES.GRP_MEETING]:"Meeting",[e.qt.TYPES.GRP_COMMUNITY]:"Community"},a=e.computed((()=>{var t,n,l,i,r,o,a,d,s;let v="";return(null==(t=u.item)?void 0:t.type)===(null==(l=null==(n=e.qt)?void 0:n.TYPES)?void 0:l.SNS_APPLICATION_SENT_TO_ME)||(null==(i=u.item)?void 0:i.type)===(null==(o=null==(r=e.qt)?void 0:r.TYPES)?void 0:o.SNS_APPLICATION_SENT_BY_ME)?v=(null==(a=u.item)?void 0:a.wording)||"":(null==(d=u.item)?void 0:d.groupID)&&(v=`ID:${null==(s=u.item)?void 0:s.groupID}`),v})),d=e.computed((()=>{var e,t;let n="";return(null==(e=u.item)?void 0:e.groupID)&&(n=o[null==(t=u.item)?void 0:t.type]),n})),s=e.computed((()=>{var n,l,i,r,o,a;return(null==(n=u.item)?void 0:n.type)===(null==(i=null==(l=e.qt)?void 0:l.TYPES)?void 0:i.SNS_APPLICATION_SENT_BY_ME)?{style:"text",label:"等待验证"}:(null==(r=u.item)?void 0:r.type)===(null==(a=null==(o=e.qt)?void 0:o.TYPES)?void 0:a.SNS_APPLICATION_SENT_TO_ME)&&{style:"button",label:"同意",onClick:()=>{var e;t.acceptFriendApplication(null==(e=u.item)?void 0:e.userID)}}}));return e.watch((()=>null==i?void 0:i.value),(()=>{var t,n,l;r.value=!!(u.displayOnlineStatus&&(null==i?void 0:i.value)&&(null==(t=u.item)?void 0:t.userID)&&(null==(l=null==(n=i.value)?void 0:n[u.item.userID])?void 0:l.statusType)===e.qt.TYPES.USER_STATUS_ONLINE)}),{immediate:!0,deep:!0}),(l,i)=>e.e({a:e.p({useSkeletonAnimation:!0,url:e.unref(t.generateAvatar)(u.item)}),b:u.displayOnlineStatus&&u.item},u.displayOnlineStatus&&u.item?{c:e.unref(r)?1:"",d:e.unref(r)?"":1}:{},{e:e.t(e.unref(t.generateName)(u.item)),f:e.unref(a)},e.unref(a)?{g:e.t(e.unref(a))}:{},{h:e.unref(d)},e.unref(d)?{i:e.t(e.unref(d))}:{},{j:e.unref(s)},e.unref(s)?e.e({k:"text"===e.unref(s).style},"text"===e.unref(s).style?{l:e.t(e.unref(e.Wt).t(`TUIContact.${e.unref(s).label}`))}:"button"===e.unref(s).style?{n:e.t(e.unref(e.Wt).t(`TUIContact.${e.unref(s).label}`)),o:e.o$1(((...t)=>e.unref(s).onClick&&e.unref(s).onClick(...t)))}:{},{m:"button"===e.unref(s).style}):{},{p:e.n(!e.unref(n.isPC)&&"tui-contact-list-card-h5")})}}),i=e._export_sfc(u,[["__scopeId","data-v-e4c5c96e"]]);wx.createComponent(i);
