"use strict";const e=require("../../../../../common/vendor.js");require("../../../../adapter-vue.js");const t=require("../../utils.js"),s=require("../../type.js"),a=require("../../../../utils/env.js");Math||(n+i+l+p+r)();const n=()=>"./message-abstract/message-abstract-text.js",i=()=>"./message-abstract/message-abstract-file.js",l=()=>"./message-abstract/message-abstract-custom.js",p=()=>"./message-abstract/message-abstract-image.js",r=()=>"./message-abstract/message-abstract-video.js",y=e.defineComponent({__name:"index",props:{listItem:{default:()=>({})},listItemContent:{default:()=>({})},type:{default:"allMessage"},displayType:{default:"info"},keywordList:{default:()=>[]}},emits:["showResultDetail","navigateToChatPosition"],setup(n,{emit:i}){const l=n,p=i,r=e.ref(e.qt.TYPES),y=e.ref(""),u=e.ref(""),o=e.ref([]),m=e.ref(""),d=e.ref(!1);e.watchEffect((()=>{var e,s;y.value=t.generateSearchResultAvatar(l.listItem),u.value=t.generateSearchResultShowName(l.listItem,null==l?void 0:l.listItemContent),o.value=t.generateSearchResultShowContent(l.listItem,l.type,l.keywordList,"info"===(null==l?void 0:l.displayType)),m.value=(null==(e=l.listItem)?void 0:e.time)?t.generateSearchResultTime(1e3*(null==(s=l.listItem)?void 0:s.time)):""}));const f=()=>{var e;"contact"===l.type||"group"===l.type?t.enterConversation(l.listItem):"info"!==l.displayType||(null==(e=l.listItem)?void 0:e.ID)?I():p("showResultDetail",!0,l.type,l.listItem)},T=e=>{d.value=e},I=()=>{p("navigateToChatPosition",l.listItem)};return(t,n)=>{return e.e({a:"info"===t.displayType||"bubble"===t.displayType},"info"===t.displayType||"bubble"===t.displayType?e.e({b:e.n(t.displayType+"-left-avatar"),c:e.unref(y)||"",d:e.n(t.displayType+"-left"),e:e.t(e.unref(u)),f:e.n(t.displayType+"-main-name"),g:"info"===t.displayType||t.listItem.type===e.unref(r).MSG_TEXT},"info"===t.displayType||t.listItem.type===e.unref(r).MSG_TEXT?{h:e.p({content:e.unref(o),highlightType:"info"===t.displayType?"font":"background",displayType:t.displayType})}:t.listItem.type===e.unref(r).MSG_FILE?{j:e.p({contentText:e.unref(o),messageContent:t.listItemContent,displayType:t.displayType})}:t.listItem.type===e.unref(r).MSG_IMAGE||t.listItem.type===e.unref(r).MSG_VIDEO?{}:t.listItem.type===e.unref(r).MSG_CUSTOM?{n:e.p({contentText:e.unref(o),message:t.listItem,messageContent:t.listItemContent})}:{o:e.t((i=t.listItem,(null==i?void 0:i.type)?e.Wt.t(`TUISearch.${s.messageTypeAbstractMap[i.type]}`):e.Wt.t("TUISearch.[合并消息]")))},{i:t.listItem.type===e.unref(r).MSG_FILE,k:t.listItem.type===e.unref(r).MSG_IMAGE,l:t.listItem.type===e.unref(r).MSG_VIDEO,m:t.listItem.type===e.unref(r).MSG_CUSTOM,p:e.n(t.displayType+"-main-content"),q:e.n(t.displayType+"-main"),r:e.t(e.unref(m)),s:e.n(t.displayType+"-right-time"),t:"bubble"===t.displayType&&e.unref(d)},"bubble"===t.displayType&&e.unref(d)?{v:e.t(e.unref(e.Wt).t("TUISearch.定位到聊天位置")),w:e.n(t.displayType+"-right-to"),x:e.o$1(I)}:{},{y:e.n(t.displayType+"-right"),z:e.n(t.displayType)}):"file"===t.displayType?e.e({B:e.n(t.displayType+"-header-avatar"),C:e.unref(y),D:e.t(e.unref(u)),E:e.n(t.displayType+"-header-name"),F:e.unref(d)},e.unref(d)?{G:e.t(e.unref(e.Wt).t("TUISearch.定位到聊天位置")),H:e.n(t.displayType+"-header-to"),I:e.o$1(I)}:{},{J:e.t(e.unref(m)),K:e.n(t.displayType+"-header-time"),L:e.n(t.displayType+"-header"),M:e.p({contentText:e.unref(o),messageContent:t.listItemContent,displayType:"bubble"}),N:e.n(t.displayType+"-main-content"),O:e.n(t.displayType)}):"image"===t.displayType?e.e({Q:t.listItem.type===e.unref(r).MSG_IMAGE},t.listItem.type===e.unref(r).MSG_IMAGE?{R:e.p({messageContent:t.listItemContent})}:t.listItem.type===e.unref(r).MSG_VIDEO?{T:e.p({messageContent:t.listItemContent})}:{},{S:t.listItem.type===e.unref(r).MSG_VIDEO,U:e.unref(d)},e.unref(d)?{V:e.t(e.unref(e.Wt).t("TUISearch.定位到聊天位置"))}:{},{W:e.o$1(I),X:e.n(t.displayType)}):{},{A:"file"===t.displayType,P:"image"===t.displayType,Y:e.n(!e.unref(a.isPC)&&"search-result-list-item-h5"),Z:e.n("search-result-list-item-"+t.displayType),aa:e.n(e.unref(d)&&"hover-"+t.displayType),ab:e.o$1(f),ac:e.o$1((e=>T(!0))),ad:e.o$1((e=>T(!1)))});var i}}}),u=e._export_sfc(y,[["__scopeId","data-v-4eb143e0"]]);wx.createComponent(u);
