"use strict";const e=require("../../../../../common/vendor.js");require("../../../../adapter-vue.js"),require("../../emoji-config/index.js");const t=require("../../../../utils/env.js"),n=e.defineComponent({__name:"message-text",props:{content:{default:()=>({})},messageItem:{default:()=>({})},enableURLHighlight:{type:Boolean,default:!1}},setup(n){const a=n,l=e.ref([]);return e.watch((()=>a.messageItem),((t,n)=>{var o,r,s,u,i,m;(null==t?void 0:t.ID)!==(null==n?void 0:n.ID)&&(a.enableURLHighlight&&e.ss.reportFeature(208),a.messageItem.getMessageContent?l.value=null==(o=a.messageItem.getMessageContent())?void 0:o.text:l.value=null==(s=null==(r=e.Jt.getMessageModel(a.messageItem.ID))?void 0:r.getMessageContent())?void 0:s.text,l.value=l.value||(null==(u=a.content)?void 0:u.text),(null==(i=l.value)?void 0:i.length)?l.value=null==(m=l.value.map((t=>{if("img"===t.name&&"custom"===(null==t?void 0:t.type))return console.warn("CUSTOM_BASIC_EMOJI_URL is required for custom emoji."),t;if(a.enableURLHighlight&&"text"===t.name&&t.text){if(!e.A$1)return console.warn("parseTextAndValidateUrls not found. Please update @tencentcloud/universal-api to 2.3.7 or higher."),t;const n=e.A$1(t.text);if(n.length)return n.map((e=>({name:e.type,text:e.text,url:e.url})))}return t})))?void 0:m.flat():l.value=[])}),{deep:!0,immediate:!0}),(n,a)=>({a:e.f(e.unref(l),((n,a,l)=>e.e({a:"text"===n.name},"text"===n.name?{b:e.t(n.text)}:"url"===n.name?{d:e.t(n.text),e:e.o$1((a=>{var l;(l=n.url)&&(t.isUniFrameWork?e.i.navigateTo({url:`/pages/views/webview?url=${l}`}):e.i.open(l,"_blank"))}),a)}:{f:n.src,g:n.emojiKey},{c:"url"===n.name,h:a}))),b:e.n(e.unref(t.isPC)&&"text-select")})}}),a=e._export_sfc(n,[["__scopeId","data-v-7d054f1e"]]);wx.createComponent(a);
