/**
 * Minified by jsDelivr using Terser v5.48.0.
 * Original file: /npm/@tencentcloud/chat-uikit-wechat@2.4.5/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import constant from"./utils/constant";import TUICore,{TUIConstants}from"@tencentcloud/tui-core-lite";const app=getApp();Component({properties:{conversationID:{type:String,value:"",observer(t){this.setData({outsideConversation:!0,currentConversationID:t})}}},data:{isShowConversation:!1,isShowConversationList:!1,currentConversationID:"",unreadCount:0,hasCallKit:!1,config:{userID:"",userSig:"",type:1,tim:null,SDKAppID:0},outsideConversation:!1},methods:{init(){const{config:t}=this.data;t.userID=wx.$chat_userID,t.userSig=wx.$chat_userSig,t.tim=wx.$TUIKit,t.SDKAppID=wx.$chat_SDKAppID,this.data.outsideConversation?this.createConversation({detail:{currentConversationID:this.data.currentConversationID,unreadCount:0}}):this.showConversationList(),this.setData({config:t},()=>{this.initCallKit()})},initCallKit(){TUICore.getService(TUIConstants.TUICalling.SERVICE.NAME)&&this.setData({hasCallKit:!0})},createConversation(t){this.setData({isShowConversation:!0,currentConversationID:t.detail.currentConversationID,unreadCount:t.detail.unreadCount},()=>{this.selectComponent("#TUIChat").init();const t=setTimeout(()=>{this.selectComponent("#TUIConversation").destroy(),clearTimeout(t)},300)})},showConversationList(){if(this.data.outsideConversation)this.handleBack();else{this.selectComponent("#TUIConversation").init(),this.setData({isShowConversation:!1})}},async handleCall(t){let{userIDList:e=[]}=t.detail;const{groupID:n="",userID:s="",type:a}=t.detail;s&&(e=[s]),TUICore.callService({serviceName:TUIConstants.TUICalling.SERVICE.NAME,method:TUIConstants.TUICalling.SERVICE.METHOD.START_CALL,params:{groupID:n,userIDList:e,type:a}})},handleBack(){app.globalData&&app.globalData.reportType!==constant.OPERATING_ENVIRONMENT?wx.navigateBack({delta:1}):wx.switchTab({url:"/pages/TUI-Index/index"})},sendMessage(t){this.selectComponent("#TUIChat").sendMessage(t)}}});
//# sourceMappingURL=/sm/1e7e6ba75613806dc4484b97bdb81d1f28072ed27dfbf8fb9e2558cd37af41d0.map