"use strict";const e=require("../../../../common/vendor.js");require("../../../adapter-vue.js");const t=require("../../common/Toast/index.js"),s=require("../../../utils/env.js"),n=require("../utils/utils.js"),o=require("../offlinePushInfoManager/index.js"),a=require("../../common/Toast/type.js");Math||(i+r)();const r=()=>"../../common/Overlay/index.js",i=()=>"../../common/Transfer/index.js",u=e.defineComponent({__name:"index",emits:["toggleMultipleSelectMode"],setup(r,{emit:i}){const u=i;let l=[],c=!1;const d=e.ref(!1),m=e.ref();function g(e){void 0!==e&&(c=!1,l=[e],T())}function f(s){if(!s)return;c=!1;const{isMergeForward:n,messageIDList:o}=s||{};(null==o?void 0:o.length)>0?(c=n,l=o,T()):t.Toast({message:e.Wt.t("TUIChat.未选择消息"),type:a.TOAST_TYPE.ERROR})}function M(){e.Jt.update(e.o.CUSTOM,"singleForwardMessageID",void 0),e.Jt.update(e.o.CUSTOM,"multipleForwardMessageID",void 0)}function p(){M(),d.value=!1}function T(){!function(){const t=e.Jt.getData(e.o.CONV,"conversationList");m.value=t.map((e=>({userID:e.conversationID,nick:e.getShowName(),avatar:e.getAvatar()})))}(),d.value=!0}function v(s){if(0===(null==s?void 0:s.length))return;const r=s.map((t=>e.Jt.getConversationModel(t.userID))),i=l.map((t=>e.Jt.getMessageModel(t))).sort(((e,t)=>e.time-t.time)),d=r.map((t=>{const s={conversation:t,messageType:e.qt.TYPES.MSG_MERGER};return e.Qt.sendForwardMessage([t],i,{needMerge:c,offlinePushInfo:o.OfflinePushInfoManager.create(s),params:{needReadReceipt:n.isEnabledMessageReadReceiptGlobal()}})}));Promise.allSettled(d).then((s=>{for(const n of s){const{status:s}=n;if("rejected"===s){const s=80001===n.reason.code?e.Wt.t("TUIChat.内容包含敏感词汇"):n.reason.message;t.Toast({message:s,type:a.TOAST_TYPE.ERROR});break}}})),p(),u("toggleMultipleSelectMode",!1)}return e.onMounted((()=>{e.Jt.watch(e.o.CUSTOM,{singleForwardMessageID:g,multipleForwardMessageID:f})})),e.onUnmounted((()=>{e.Jt.unwatch(e.o.CUSTOM,{singleForwardMessageID:g,multipleForwardMessageID:f}),M()})),(t,n)=>({a:e.o$1(p),b:e.o$1(v),c:e.p({title:e.unref(e.Wt).t("TUIChat.转发"),isSearch:!1,isCustomItem:!1,list:e.unref(m),isHiddenBackIcon:e.unref(s.isUniFrameWork)}),d:e.p({visible:e.unref(d),useMask:!1})})}});wx.createComponent(u);
