"use strict";const e=require("../../../../common/vendor.js");require("../../../adapter-vue.js");const n=require("../config.js"),u=require("../../../utils/enableSampleTaskStatus.js"),l=require("../offlinePushInfoManager/index.js"),a=require("../offlinePushInfoManager/const.js");Math||(s+i+o+r+t+v)();const i=()=>"./image-upload/index.js",o=()=>"./video-upload/index.js",r=()=>"./words/index.js",t=()=>"./toolbar-item-container/index.js",s=()=>"./emoji-picker/emoji-picker-dialog.js",v=()=>"./user-selector/index.js",f=e.defineComponent({options:{styleIsolation:"shared"},__name:"index",props:{displayType:{}},setup(i){const o=i,r=e.ref(),t=e.ref(!1),s=e.ref(""),v=e.ref(),f=e.ref(),c=e.ref([]),d=e.ref(!1),p=n.ChatConfig.getFeatureConfig(),I=e.ref(8),m=e.ref(0);e.onMounted((()=>{e.Jt.watch(e.o.CUSTOM,{activeConversation:g})})),e.onUnmounted((()=>{e.Jt.unwatch(e.o.CUSTOM,{activeConversation:g})}));const g=n=>{var u;n&&n!==(null==(u=r.value)?void 0:u.conversationID)&&(C(),p.InputImage&&p.InputVideo?I.value-=4:(p.InputImage||p.InputVideo)&&(I.value-=2),m.value=I.value,I.value-=c.value.length,1===I.value?d.value=p.InputEvaluation&&p.InputQuickReplies:I.value<1&&(d.value=p.InputEvaluation||p.InputQuickReplies),r.value=e.Jt.getData(e.o.CONV,"currentConversation"),t.value=n.startsWith(e.qt.TYPES.CONV_GROUP))},C=()=>{const l=n.ChatConfig.getChatType(),a={chatType:l};l===e.E.TUIChat.TYPE.CUSTOMER_SERVICE&&(a.filterVoice=!0,a.filterVideo=!0,u.enableSampleTaskStatus("customerService")),c.value=[...e.R.getExtensionList(e.E.TUIChat.EXTENSION.INPUT_MORE.EXT_ID,a)].filter((e=>{var n;return"search"!==(null==(n=null==e?void 0:e.data)?void 0:n.name)||p.MessageSearch})),c.value.forEach((n=>{var u;const l=null==(u=null==n?void 0:n.data)?void 0:u.name;"voiceCall"===l?e.ss.reportFeature(203,"voice-call"):"videoCall"===l?e.ss.reportFeature(203,"video-call"):"quickRoom"===l&&e.ss.reportFeature(204)}))};const h=(n,u)=>{var i,o,c,d,p,I,m;s.value=null==(i=null==n?void 0:n.data)?void 0:i.name,(null==(o=null==r?void 0:r.value)?void 0:o.type)===e.qt.TYPES.CONV_C2C?null==(I=null==(c=null==n?void 0:n.listener)?void 0:c.onClicked)||I.call(c,{userIDList:[null==(p=null==(d=null==r?void 0:r.value)?void 0:d.conversationID)?void 0:p.slice(3)],type:u,callParams:{offlinePushInfo:l.OfflinePushInfoManager.getOfflinePushInfo(a.PUSH_SCENE.CALL)}}):t.value&&(f.value=n,(null==(m=null==v?void 0:v.value)?void 0:m.toggleShow)&&v.value.toggleShow(!0))},k=e=>null==e?void 0:e.icon,S=e=>null==e?void 0:e.text,T=e=>{var n,u,i;null==(i=null==(u=null==(n=f.value)?void 0:n.listener)?void 0:u.onClicked)||i.call(u,{...e,callParams:{offlinePushInfo:l.OfflinePushInfoManager.getOfflinePushInfo(a.PUSH_SCENE.CALL)}}),f.value=null},E=()=>{f.value=null},P=e=>{d.value=I.value<=1&&!e};return(n,u)=>e.e({a:"emojiPicker"===o.displayType},"emojiPicker"===o.displayType?{}:e.e({b:e.unref(p).InputImage},e.unref(p).InputImage?{c:e.p({imageSourceType:"camera"})}:{},{d:e.unref(p).InputImage},e.unref(p).InputImage?{e:e.p({imageSourceType:"album"})}:{},{f:e.unref(p).InputVideo},e.unref(p).InputVideo?{g:e.p({videoSourceType:"album"})}:{},{h:e.unref(p).InputVideo},e.unref(p).InputVideo?{i:e.p({videoSourceType:"camera"})}:{},{j:e.unref(c).length>0},e.unref(c).length>0?{k:e.f(e.unref(c).slice(0,e.unref(m)),((e,n,u)=>({a:n})))}:{},{l:1===e.unref(I)},1===e.unref(I)?e.e({m:e.unref(p).InputQuickReplies},e.unref(p).InputQuickReplies?{n:e.o$1(P)}:{}):{},{o:e.unref(I)>1},e.unref(I)>1?e.e({p:e.unref(p).InputQuickReplies},e.unref(p).InputQuickReplies?{q:e.o$1(P)}:{}):{},{r:e.unref(I)<=1},e.unref(I)<=1?e.e({s:e.f(e.unref(c).slice(e.unref(m)),((n,u,l)=>e.e({a:n},n?{b:e.o$1((e=>(e=>{var n,u,l;const a=c.value.find((n=>{var u,l;return(null==(u=null==n?void 0:n.data)?void 0:u.name)===(null==(l=null==e?void 0:e.data)?void 0:l.name)}));switch(null==(n=null==a?void 0:a.data)?void 0:n.name){case"voiceCall":h(a,1);break;case"videoCall":h(a,2);break;case"search":null==(l=null==(u=null==a?void 0:a.listener)?void 0:u.onClicked)||l.call(u)}})(n)),u),c:"76f68da4-7-"+l,d:e.p({iconFile:k(n),title:S(n),iconWidth:"25px",iconHeight:"25px",needDialog:!1})}:{},{e:u}))),t:1===e.unref(I)},1===e.unref(I)?e.e({v:e.unref(p).InputQuickReplies},e.unref(p).InputQuickReplies?{w:e.o$1(P)}:{}):e.e({x:e.unref(p).InputQuickReplies},e.unref(p).InputQuickReplies?{y:e.o$1(P)}:{})):{},{z:e.unref(d)}),{A:e.sr(v,"76f68da4-10",{k:"userSelectorRef"}),B:e.o$1(T),C:e.o$1(E),D:e.p({type:e.unref(s),currentConversation:e.unref(r),isGroup:e.unref(t)})})}});wx.createComponent(f);
