@rongcloud/imlib-next 5.8.2-enterprise-lz.32 → 5.8.2-enterprise-lz.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -1 +1 @@
1
- import{httpRequest as e,NetworkType as t,HttpMethod as n,HTTP_TIMEOUT as o,appendUrl as r,ErrorCode as i,ReceivedStatus as a,ConversationType as s,isNumber as c,EventEmitter as u,RCConnectionStatus as d,VersionManage as l,assert as f,AssertRules as v,isArray as g,isHttpUrl as R,APIContext as I,LogTagId as h,logger as E,validate as m,isValidConversationType as T,isValidNotificationLevel as S,NotificationLevel as p,isTypeInConversationList as O,UltraGroupChannelType as N,isString as _,MAX_UPLOAD_FILE_SIZE as C,UPLOAD_FILE_CHUNK_SIZE as A,UploadMethod as y,fixUrlProtocol as U,FileType as M,getUUID as P,isValidFileType as L,usingCppEngine as w,MessageDirection as B,SentStatus as D,isObject as b,isUndefined as G}from"@rongcloud/engine";export{AreaCode,ChatroomEntryType,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ChrmSyncStatus,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,OperateStatus,PushImportanceHonor,RCConnectionStatus,ReceivedStatus,SentStatus,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var V=function(e,t){return V=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},V(e,t)};function k(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}V(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var x=function(){return x=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},x.apply(this,arguments)};function F(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))}function Z(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}"function"==typeof SuppressedError&&SuppressedError;var H=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,o=t.length;n<o;n++)if(!e[t[n]])return!1;return!0}(uni))},J=H();var Y=null,q=function(e){return F(void 0,void 0,void 0,(function(){var t;return Z(this,(function(n){switch(n.label){case 0:return[4,K.getNetworkType()];case 1:return t=n.sent(),Y({status:"online"===e.type,type:t}),[2]}}))}))};var K={tag:"browser",httpReq:e,localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:J,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:t.UNKONWN},n=e.type,o=e.effectiveType,r=n||o||t.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){Y=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",q),window.addEventListener("online",q))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",q),window.removeEventListener("online",q)),Y=null}},z=H(),j=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},W={setItem:j("setStorageSync"),getItem:j("getStorageSync"),removeItem:j("removeStorageSync"),clear:j("clearStorageSync")},Q=null,X=function(e){var t=e.isConnected,n=e.networkType;Q({status:t,type:n})};var $={tag:"wechat",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){wx.request({url:d,method:t,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:W,sessionStorage:W,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:z,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Q=e,wx.onNetworkStatusChange(X)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(X),Q=null}},ee=H(),te=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var o=my[e]({key:t[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},ne={setItem:te("setStorageSync"),getItem:te("getStorageSync"),removeItem:te("removeStorageSync"),clear:te("clearStorageSync")},oe=null,re=function(e){var t=e.isConnected,n=e.networkType;oe({status:t,type:n})};var ie={tag:"alipay",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c),l=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:t,headers:s,timeout:a,data:u,dataType:l,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:ne,sessionStorage:ne,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ee,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){oe=e,my.onNetworkStatusChange(re)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(re),oe=null}},ae=H(),se=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,t)}catch(e){}}},ce={setItem:se("setStorageSync"),getItem:se("getStorageSync"),removeItem:se("removeStorageSync"),clear:se("clearStorageSync")},ue=null,de=function(e){var t=e.isConnected,n=e.networkType;ue({status:t,type:n})};var le={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ae,localStorage:ce,sessionStorage:ce,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){ue=e,tt.onNetworkStatusChange(de)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(de),ue=null}},fe=H(),ve=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},ge={setItem:ve("setStorageSync"),getItem:ve("getStorageSync"),removeItem:ve("removeStorageSync"),clear:ve("clearStorageSync")},Re=null,Ie=function(e){var t=e.isConnected,n=e.networkType;Re({status:t,type:n})};var he={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:fe,localStorage:ge,sessionStorage:ge,httpReq:function(e){return new Promise((function(t,n){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Re=e,swan.onNetworkStatusChange(Ie)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Ie),Re=null}},Ee=H(),me=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,t)}catch(e){null===console||void 0===console||console.error(e)}}},Te={setItem:me("setStorageSync"),getItem:me("getStorageSync"),removeItem:me("removeStorageSync"),clear:me("clearStorageSync")},Se=null,pe=function(e){var t=e.isConnected,n=e.networkType;Se({status:t,type:n})};var Oe={tag:"jingdong",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){jd.request({url:d,method:t,headers:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:Te,sessionStorage:Te,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ee,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Se=e,jd.onNetworkStatusChange(pe)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(pe),Se=null}},Ne=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},_e={setItem:Ne("setStorageSync"),getItem:Ne("getStorageSync"),removeItem:Ne("removeStorageSync"),clear:Ne("clearStorageSync")},Ce=null,Ae=function(e){var t=e.isConnected,n=e.networkType;Ce({status:t,type:n})};var ye,Ue={tag:"uniapp",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){uni.request({url:d,method:t,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:_e,sessionStorage:_e,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ce=e,uni.onNetworkStatusChange(Ae)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Ae),Ce=null}},Me=function(e){return e&&e.request&&e.getSystemInfo},Pe="undefined"!=typeof uni&&Me(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return Ue;case"mp-jd":return Oe;case"mp-baidu":return he;case"mp-toutiao":return le;case"mp-alipay":return ie;case"mp-weixin":return $;default:return K}}():"undefined"!=typeof jd&&Me(jd)?Oe:"undefined"!=typeof my&&Me(my)?ie:"undefined"!=typeof tt&&Me(tt)?le:"undefined"!=typeof swan&&Me(swan)?he:"undefined"!=typeof wx&&Me(wx)?$:K;function Le(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,i=e.senderUserId,u=e.targetId,d=e.sentTime,l=e.receivedTime,f=e.messageUId,v=e.messageDirection,g=e.isPersited,R=e.isCounted,I=e.isOffLineMessage,h=e.canIncludeExpansion,E=e.expansion,m=e.receivedStatus,T=e.disableNotification,S=e.isMentioned,p=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,y=e.channelType,U=e.sentStatus,M=e.needReceipt,P=e.sentReceipt;m||(m=a.UNREAD);var L={messageType:o,channelId:n||"",content:r,senderUserId:i,targetId:u,conversationType:t,sentTime:d,receivedTime:l,messageUId:f,messageDirection:v,isPersited:g,isCounted:R,isMentioned:S,disableNotification:T,isStatusMessage:p,canIncludeExpansion:h,expansion:E,receivedStatus:m,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:U,needReceipt:M,sentReceipt:P};return t!==s.ULTRA_GROUP&&(L.isOffLineMessage=I),t===s.ULTRA_GROUP&&c(y)&&(L.channelType=y),L}function we(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,i=e.hasMentioned,a=e.mentionedInfo,c=e.lastUnreadTime,u=e.notificationStatus,d=e.notificationLevel,l=e.isTop,f=e.channelId,v=e.unreadMentionedCount,g=e.matchCount,R=e.unreadMentionedMeCount,I=e.draft,h=e.operationTime,E={conversationType:t,targetId:n,latestMessage:o&&Le(o),unreadMessageCount:r,hasMentioned:i,mentionedInfo:i?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0,lastUnreadTime:c,notificationStatus:u,notificationLevel:d,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:g,unreadMentionedMeCount:R,draft:I,operationTime:h};return E.conversationType===s.ULTRA_GROUP&&(E.firstUnreadMessage=e.firstUnreadMessage,E.channelType=e.channelType),E}function Be(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",e.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",e.USER_GROUP_STATUS="USER_GROUP_STATUS",e.MESSAGE_READ_RECEIPT="MESSAGES_READ_RECEIPT",e.DATABASE_OPERATION_FAILED="DATABASE_OPERATION_FAILED"}(ye||(ye={}));var De=new u,be={connection:function(e,t){switch(e){case d.CONNECTED:De.emit(ye.CONNECTED);break;case d.CONNECTING:De.emit(ye.CONNECTING);break;case d.SUSPENDED:De.emit(ye.SUSPEND,t);break;case d.DISCONNECTED:De.emit(ye.DISCONNECT,t)}},batchMessage:function(e){De.emit(ye.MESSAGES,{messages:e.map((function(e){return Le(e)}))})},typingState:function(e){De.emit(ye.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){De.emit(ye.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){De.emit(ye.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){De.emit(ye.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(e){var t=e.map((function(e){var t=e.conversationType,n={conversationType:t,latestMessage:e.latestMessage?Le(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===s.ULTRA_GROUP?(n.versionTime=e.versionTime,n.unreadMessageCount=Ge(e.unreadMessageCount||0),n.unreadMentionedCount=Ge(e.unreadMentionedCount||0),n.unreadMentionedMeCount=Ge(e.unreadMentionedMeCount||0),{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));De.emit(ye.CONVERSATION,{conversationList:t})},chatroomState:function(e){De.emit(ye.CHATROOM,e)},expansion:function(e){De.emit(ye.EXPANSION,e)},pullFinished:function(){De.emit(ye.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){De.emit(ye.TAG)},conversationTagChanged:function(){De.emit(ye.CONVERSATION_TAG)},messageBlocked:function(e){De.emit(ye.MESSAGE_BLOCKED,e)},messageDelivered:function(e){De.emit(ye.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){De.emit(ye.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){De.emit(ye.ULTRA_GROUP_ENABLE,e.map((function(e){return we(e)})))},operateStatus:function(e){De.emit(ye.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){De.emit(ye.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return Le(e)})))},ultraGroupMessageModified:function(e){De.emit(ye.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return Le(e)})))},ultraGroupMessageRecalled:function(e){De.emit(ye.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return Le(e)})))},ultraGroupChannelChangeType:function(e){De.emit(ye.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){De.emit(ye.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){De.emit(ye.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){De.emit(ye.USER_GROUP_STATUS,e)},messageReadReceipt:function(e){De.emit(ye.MESSAGE_READ_RECEIPT,e)},onDatabaseOperationFailed:function(e){De.emit(ye.DATABASE_OPERATION_FAILED,e)}};function Ge(e){return e>999?999:e}l.add("imlib-next","5.8.2-enterprise-lz.32");var Ve=null,ke=null,xe=null;function Fe(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){switch(e.label){case 0:return Ve?(xe.info(h.A_DESTROY_O),[4,I.destroy()]):[2];case 1:return e.sent(),ke=null,Ve=null,xe=null,[2]}}))}))}function Ze(e){if(!Ve)throw new Error("Not initialized yet!");return e(Ve,xe,ke)}function He(e){return Ve?e(Ve,xe,ke):Promise.resolve({code:i.BIZ_ERROR_CLIENT_NOT_INIT})}function Je(e,t,n){De.on(e,t,n)}function Ye(e,t,n){De.once(e,t,n)}function qe(e,t,n){De.off(e,t,n)}function Ke(e){De.removeAll(e)}function ze(){De.clear()}function je(e){!function(e){var t,n,o=e.appkey,r=e.navigators;Ve?xe.warn(h.A_INIT_REPEAT_O):(f("options.appkey",e.appkey,v.STRING,!0),f("options.navigators",e.navigators,(function(e){return g(e)&&(0===e.length||e.every(R))})),ke=e,Ve=I.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||Pe,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl,environment:null!==(n=e.environment)&&void 0!==n?n:"default"}),(xe=Ve.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),xe.info(h.A_INIT_O,JSON.stringify({appkey:o,navigators:r,version:"5.8.2-enterprise-lz.32",commit:"e4b4778d680f9862f5bd7fc575d75bb7fda8e432"})),Ve.assignWatcher(be),E.init(xe))}(e)}function We(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return Ve?(ze(),[2,Fe()]):[2]}))}))}function Qe(){return Ze((function(e){return e.getConnectionStatus()}))}function Xe(){return Ze((function(e){return e.getServerTime()}))}function $e(){return Ze((function(e){return e.getCurrentUserId()}))}function et(e,t){l.add(e,t)}function nt(){return Ze((function(e){return e.getDeviceId()}))}function ot(e,t){return Ze((function(n){return n.install(e,t)}))}var rt={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:i.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:i.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},it={};for(var at in rt){var st=rt[at].code;it[st]=at}function ct(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return m("token",e,v.STRING,!0)&&m("reconnectKickEnable",t,v.BOOLEAN)?(n=r.createTraceId(),r.info(h.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,o.connect(e,!!t,n)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=c.sent(),s=a.code===i.SUCCESS?"info":"warn",r[s](h.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===i.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:it[a.code]}]}}))}))}))]}))}))}function ut(e){return E.info(h.A_DISCONNECT_O,{}),Ze((function(t){return t.disconnect(e)}))}function dt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("options.count",null==e?void 0:e.count,v.NUMBER)&&m("options.startTime",null==e?void 0:e.startTime,v.NUMBER)&&m("options.order",null==e?void 0:e.order,v.NUMBER)&&m("channelId",t,v.CHANNEL_ID)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return we(e)}))}]:(r.warn(h.O,"get conversation list fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),r=t.code,a=t.data,r!==i.SUCCESS?(o.warn(h.O,"getConversation ->code:".concat(r,", targetId:").concat(e.targetId)),[2,{code:r,msg:it[r]}]):[2,{code:r,data:a?we(a):null}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r;return Z(this,(function(a){switch(a.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.O,"destroy conversation ->".concat(r)),t!==i.SUCCESS?(o.warn(h.O,"destroy conversation fail ->".concat(t,":").concat(it[t],",").concat(r)),[2,{code:t,msg:it[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.O,"get draft ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a||""}]:(o.warn(h.O,"get draft fail ->".concat(r,":").concat(it[r],",").concat(s)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("options",e,v.CONVERSATION,!0)&&m("draft",t,v.STRING,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(h.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())===i.SUCCESS?[2,{code:a}]:(r.warn(h.O,"set draft fail ->".concat(a,":").concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r;return Z(this,(function(a){switch(a.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.O,"delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(r=a.sent())===i.SUCCESS?[2,{code:r}]:(o.warn(h.O,"delete draft fail ->".concat(r,":").concat(it[r],",").concat(t)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("includeMuted",e,v.BOOLEAN,!1)&&m("conversationTypes",t,v.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!m("conversationType",e,T)})))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return r.debug(h.O,"get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",t,e)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(h.O,"getTotalUnreadCount fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return!m("conversationTypes",e,v.ARRAY,!0)||!m("levels",t,v.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,T)}))||t.some((function(e){return!m("level",e,S)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(h.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]}))}))}function Et(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return!m("conversationTypes",e,v.ARRAY,!0)||!m("levels",t,v.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,T)}))||t.some((function(e){return!m("level",e,S)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(h.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]}))}))}function mt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.O,"get unreadCount ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(h.O,"get unreadCount fail ->".concat(r,":").concat(it[r],",").concat(s)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r;return Z(this,(function(a){switch(a.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.O,"clear unreadMsgNum ->".concat(r)),t!==i.SUCCESS?(o.warn(h.O,"clear unreadMsgNum fail ->".concat(t,":").concat(it[t],",").concat(r)),[2,{code:t,msg:it[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function St(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){return Z(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}rt.ROAMING_SERVICE_UNAVAILABLE.code;var pt=function(e,t,n){void 0===n&&(n="");var o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(h.O,"".concat(n," -> ").concat(o)),o},Ot=function(e,t,n,o){return void 0===o&&(o=""),F(void 0,void 0,void 0,(function(){var r,a;return Z(this,(function(s){switch(s.label){case 0:return r=pt(e,t,o),[4,n()];case 1:return(a=s.sent())!==i.SUCCESS?(e.warn(h.O,"".concat(o," fail -> ").concat(a," : ").concat(it[a]," , ").concat(r)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))};function Nt(e,t){return F(this,void 0,void 0,(function(){return Z(this,(function(n){return m("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)&&m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return Ot(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e,t){return F(this,void 0,void 0,(function(){return Z(this,(function(n){return m("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return Ot(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return t=pt(o,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS?[2,{code:a,data:s}]:(o.warn(h.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(it[a]," , ").concat(t)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function At(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return o.info(h.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(h.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yt(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,He((function(e){return e.getBlockConversationList()}))]}))}))}function Ut(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("conversationType",e,(function(){return[s.PRIVATE,s.GROUP,s.SYSTEM,s.PUBLIC_SERVICE,s.APP_PUBLIC_SERVICE,s.ULTRA_GROUP].includes(e)}))&&m("level",t,S)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return r.info(h.O,"setConversationTypeNotificationLevel ->conversationType:".concat(e,",level:").concat(t)),[4,o.setConversationTypeNotificationLevel(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(h.O,"setConversationTypeNotificationLevel ->conversationType:".concat(e,",level:").concat(t)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("conversationType",e,(function(){return[s.PRIVATE,s.GROUP,s.SYSTEM,s.PUBLIC_SERVICE,s.APP_PUBLIC_SERVICE,s.ULTRA_GROUP].includes(e)}))?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return o.info(h.O,"getConversationTypeNotificationLevel ->conversationType:".concat(e)),[4,n.getConversationTypeNotificationLevel(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(h.O,"getConversationTypeNotificationLevel ->conversationType:".concat(e)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Pt(e,t,n){return void 0===t&&(t=!0),void 0===n&&(n=!0),F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return m("options",e,v.CONVERSATION,!0)&&m("isTop",t,v.BOOLEAN)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s;return Z(this,(function(c){switch(c.label){case 0:return o="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(h.O,"set conversation status ->".concat(o)),[4,r.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId,n)];case 1:return(s=c.sent())!==i.SUCCESS?(a.warn(h.O,"set conversation status fail ->".concat(s,":").concat(it[s],",").concat(o)),[2,{code:s,msg:it[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("conversationTypes",e,v.ARRAY)&&!(null==e?void 0:e.some((function(e){return!m("conversationType",e,T)})))&&m("channelId",t,v.CHANNEL_ID)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getTopConversationList(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return we(e)}))}]:(r.warn(h.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return!m("conversationTypes",e,v.ARRAY)||(null==e?void 0:e.some((function(e){return!m("conversationType",e,O)})))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,n.getUnreadConversationList(e)];case 1:return t=a.sent(),o=t.code,r=t.data,o===i.SUCCESS&&r?[2,{code:0,data:r.map((function(e){return we(e)}))}]:[2,{code:o,msg:it[o]}]}}))}))}))]}))}))}function Bt(e){return F(this,void 0,void 0,(function(){return Z(this,(function(t){return m("options",e,v.CONVERSATION,!0)?[2,He((function(t,n){return n.debug(h.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,He((function(e,t){return t.debug(h.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function bt(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,He((function(e){return e.getAllConversationState()}))]}))}))}function Gt(e){return void 0===e&&(e={}),F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options.targetId",e.targetId,v.STRING,!1)&&m("options.channelType",e.channelType,(function(e){return void 0!==N[e]}),!1)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:i.SUCCESS,data:a}]:(o.warn(h.O,"get ultragroup ->".concat(r,":").concat(it[r])),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:i.SUCCESS,data:r}]:(n.warn(h.O,"get block ultragroup ->".concat(o,":").concat(it[o])),[2,{code:o,msg:it[o]}])}}))}))}))]}))}))}function kt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(h.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(it[t])),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("options",e,v.CONVERSATION,!0)&&m("msgs",t,v.ARRAY,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g;return Z(this,(function(R){switch(R.label){case 0:return n=e.targetId,a=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),u={targetId:n,conversationType:a,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:if(d=R.sent(),l=d.code,f=d.data,l===i.SUCCESS){for(g in v={},f)v[g]=f[g]?Le(f[g]):void 0;return[2,{code:i.SUCCESS,data:v}]}return r.warn(h.O,"get UltraGroup MessageList by messageUId ->".concat(l,":").concat(it[l])),[2,{code:l,msg:it[l]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("expansion",e,v.OBJECT,!0)&&m("message",t,v.OBJECT,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v;return Z(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(h.O,"update expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(f)];case 1:return(v=g.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(h.O,"update expansion for ultragroup message ->".concat(v,":").concat(it[v])),[2,{code:v,msg:it[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("expansion",e,v.ARRAY,!0)&&m("message",t,v.OBJECT,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v;return Z(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(h.O,"remove expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(f)];case 1:return(v=g.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(h.O,"remove expansion for ultraGroup message ->".concat(v,":").concat(it[v])),[2,{code:v,msg:it[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("message",e,v.OBJECT,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,l,f;return Z(this,(function(v){switch(v.label){case 0:return t=e.conversationType,r=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(a),o.debug(h.O,"remove all expansion for ultraGroup message ->".concat(d)),l={targetId:r,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(l)];case 1:return(f=v.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(h.O,"remove all expansion for ultraGroup message ->".concat(f,":").concat(it[f])),[2,{code:f,msg:it[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("content",e,v.OBJECT,!0)&&m("message",t,v.OBJECT,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g;return Z(this,(function(R){switch(R.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.senderUserId,u=t.sentTime,d=t.canIncludeExpansion,l=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(l,",messageUId:").concat(s),r.debug(h.O,"update ultragroup message expansion ->".concat(f)),v={targetId:a,channelId:l,conversationType:n,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(v)];case 1:return(g=R.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(h.O,"modify ultraGroup message ->".concat(g,":").concat(it[g])),[2,{code:g,msg:it[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&m("notificationLevels",t,v.ARRAY)&&!(null==t?void 0:t.some((function(e){return!m("notificationLevel",e,S)})))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return r.debug(h.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:i.SUCCESS,data:s}]:(r.warn(h.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options.targetId",e.targetId,v.STRING,!0)&&m("options.channelId",e.channelId,v.CHANNEL_ID)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(h.O,"".concat(t," -> ").concat(r)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:(o.warn(h.O,"".concat(t," fail -> ").concat(s," : ").concat(it[s]," , ").concat(r)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,v.STRING,!0)&&m("options.channelId",e.channelId,v.CHANNEL_ID,!0)&&m("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),r.debug(h.O,"".concat(n," -> ").concat(a)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===i.SUCCESS?[2,{code:s}]:(r.warn(h.O,"".concat(n," fail -> ").concat(s," : ").concat(it[s]," , ").concat(a)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&m("notificationLevels",t,v.ARRAY)&&!(null==t?void 0:t.some((function(e){return!m("notificationLevel",e,S)})))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,i,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return i=u.sent(),a=i.code,s=i.data,c="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),r.debug(h.O,"".concat(n," -> ").concat(c)),[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jt(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r,a;return Z(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(h.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(h.O,"".concat(e," fail ->").concat(r,": ").concat(it[r])),[2,{code:r,msg:it[r]}])}}))}))}))]}))}))}function Wt(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r,a;return Z(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(h.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(h.O,"".concat(e," fail ->").concat(r,": ").concat(it[r])),[2,{code:r,msg:it[r]}])}}))}))}))]}))}))}function Qt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,v.STRING,!0)&&m("options.channelId",e.channelId,v.CHANNEL_ID,!0)&&m("options.sentTime",e.sentTime,v.NUMBER,!0)&&m("options.count",e.count,(function(e){return c(e)&&e>0&&e<=50}),!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return t=e.targetId,r=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:r,sentTime:a,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=f.sent(),d=u.code,l=u.data,d===i.SUCCESS?[2,{code:d,data:l}]:(o.warn(h.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(it[d])),[2,{code:d,msg:it[d]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("conversation.targetId",e.targetId,v.STRING,!0)&&m("conversation.channelId",e.channelId,v.CHANNEL_ID,!0)?[2,He((function(n){return F(t,void 0,void 0,(function(){var t,o,r,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,r={targetId:t,channelId:o},[4,n.getUltraGroupFirstUnreadMessageTimestamp(r)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:it[s]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $t(e){return F(this,void 0,void 0,(function(){var t,n=this;return Z(this,(function(o){return m("targetIds",e,v.ARRAY,!0)&&m("targetIds.length",e,(function(e){return e.length>0&&e.length<20}))&&!e.some((function(e){return!m("targetId",e,v.STRING)}))?(t=e.filter((function(t,n){return e.indexOf(t)===n})),[2,He((function(e){return F(n,void 0,void 0,(function(){var n,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,e.getUltraGroupUnreadInfoList(t)];case 1:return n=a.sent(),o=n.code,r=n.data,o===i.SUCCESS?[2,{code:o,data:r}]:[2,{code:o,msg:it[o]}]}}))}))}))]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var en=function(e){return!!(m("options.key",e.key,v.STRING,!0)&&m("options.value",e.value,v.STRING,!0)&&m("options.isAutoDelete",e.isAutoDelete,v.BOOLEAN)&&m("options.isSendNotification",e.isSendNotification,v.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,v.STRING))},tn=function(e){return m("options.key",e.key,v.STRING,!0)&&m("options.isSendNotification",e.isSendNotification,v.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,v.STRING)};function nn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&m("options.count",t.count,v.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return n=r.createTraceId(),r.info(h.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,o.joinChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===i.SUCCESS?"info":"warn",r[s](h.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==i.SUCCESS?[2,{code:a,msg:it[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function on(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&m("options.count",t.count,v.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return n=r.createTraceId(),r.info(h.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,o.joinExistChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===i.SUCCESS?"info":"warn",r[s](h.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==i.SUCCESS?[2,{code:a,msg:it[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("targetId",e,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(h.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return r=s.sent(),a=r===i.SUCCESS?"info":"warn",o[a](h.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),t),r!==i.SUCCESS?[2,{code:r,msg:it[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function an(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&m("options.count",t.count,v.NUMBER)&&m("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(h.O,"get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(h.O,"get chatroom info fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&en(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(h.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(h.O,"set chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function cn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&function(e){return e.entries.every((function(e){return m("entry.key",e.key,v.STRING,!0)&&m("entry.value",e.value,v.STRING,!0)}))&&m("options.isAutoDelete",e.isAutoDelete,v.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,v.STRING)&&m("options.isForce",e.isForce,v.BOOLEAN)}(t)?t.entries.length>10?[2,rt.CHATROOM_KV_STORE_OUT_LIMIT]:[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(h.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s!==i.SUCCESS?(r.warn(h.O,"set chatroom entry fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function un(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&en(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(h.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(h.O,"force set chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&tn(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(h.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(h.O,"remove chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ln(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&function(e){return e.entries.every((function(e){return m("key",e,v.STRING,!0)}))&&m("options.notificationExtra",e.notificationExtra,v.STRING)}(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),r.info(h.O,"remove chatroom entry->".concat(n)),(a=x({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,a)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==i.SUCCESS?(r.warn(h.O,"remove chatroom entry fail ->code+:".concat(it[c],",").concat(n)),[2,{code:c,msg:it[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&tn(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.info(h.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(h.O,"force remove chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&m("key",t,(function(e){return _(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(h.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(h.O,"get chatroom entry fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("targetId",e,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(h.O,"get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS&&s?[2,{code:a,data:s}]:(o.warn(h.O,"get all chatroom entries fail ->code+:".concat(it[a],",").concat(t)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&m("options.timestamp",t.timestamp,v.NUMBER)&&m("options.count",t.count,v.NUMBER)&&m("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t}))&&m("options.order",t.order,(function(e){return 0===e||1===e}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),r.debug(h.O,"get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Le(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(r.warn(h.O,"get chatroom history message fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function In(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("option.chatRoomId",e.chatRoomId,v.STRING,!0)&&m("option.rtcRoomId",e.rtcRoomId,v.STRING,!0)?[2,He((function(n){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:it[t]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function hn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("userId",e,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return o.info(h.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function En(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("userId",e,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return o.info(h.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mn(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return n.info(h.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS&&r?[2,{code:o,data:r}]:(n.warn(h.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Tn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("userId",e,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return o.info(h.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:0===a}]:(o.warn(h.O,"getBlacklistStatus fail -> code: ".concat(r,", userId: ").concat(e)),[2,{code:r}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Sn=function(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=o};function pn(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Sn(e,o,t,n)}}var On,Nn=pn("RC:ImgMsg"),_n=pn("RC:HQVCMsg"),Cn=pn("RC:SightMsg"),An=pn("RC:TxtMsg"),yn=pn("RC:CombineMsg"),Un=pn("RC:FileMsg"),Mn=pn("RC:GIFMsg"),Pn=pn("RC:VcMsg"),Ln=pn("RC:LBSMsg"),wn=pn("RC:ReferenceMsg"),Bn=pn("RC:ImgTextMsg"),Dn=pn("RC:CmdMsg"),bn=pn("RC:InfoNtf"),Gn=pn("RC:GrpNtf");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(On||(On={}));var Vn,kn,xn=function(){function e(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._url=e,this._getFileToken=t,this._serverType=n}return e.prototype.upload=function(e){return e.file.size>C?Promise.resolve({code:i.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):e.file.size>A&&this.isSupportMultipart?this.multipartUpload(e):this.commonUpload(e)},e}(),Fn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=d.sent(),s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),[4,e({url:U(this._url),headers:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.QINIU}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(e){return F(this,void 0,void 0,(function(){return Z(this,(function(e){throw new Error("Method not implemented.")}))}))},n}(xn),Zn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=U("".concat(a.ossBucketName,".").concat(this._url)),(c=new FormData).set("token",a.token),c.set("OSSAccessKeyId",a.osskeyId),c.set("policy",a.ossPolicy),c.set("Signature",a.ossSign),c.set("success_action_status","200"),c.set("key",a.fileName),c.set("file",n),[4,e({url:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.ALI}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(xn),Hn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r<=M.FILE?r:M.FILE)];case 1:return s=f.sent(),c=a||("text/html"===n.type?"inline":"attachment"),u={authorization:s.bosToken,"x-bce-date":s.bosDate,"Content-Disposition":"".concat(c,"; filename=").concat(encodeURIComponent(n.name),";")},d=U("".concat(this._url).concat(s.path)),[4,e({url:d,headers:u,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:n,timeout:0})];case 2:return 200===(l=f.sent().status)||204===l?[2,{code:i.SUCCESS,data:{uniqueName:s.fileName,downloadUrl:d}}]:[2,{code:i.UPLOAD_FAIL,msg:l.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(xn),Jn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f;return Z(this,(function(v){switch(v.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r,n.name)];case 1:return s=v.sent(),c={},u=U("".concat(s.s3BucketName,".").concat(this._url)),d=new FormData,a?d.set("Content-Disposition",a):d.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),d.set("Content-Type",n.type),d.set("x-amz-credential",s.s3Credential),d.set("x-amz-algorithm",s.s3Algorithm),d.set("x-amz-date",s.s3Date),d.set("policy",s.s3Policy),d.set("x-amz-signature",s.s3Signature),d.set("key",s.fileName),d.set("file",n),[4,e({url:u,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:d,timeout:0})];case 2:return l=v.sent(),f=l.status,l.data,200===f||204===f?[2,{code:i.SUCCESS,data:{uniqueName:s.fileName,uploadMethod:y.AWS}}]:[2,{code:i.UPLOAD_FAIL,msg:f.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(xn),Yn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=U("".concat(this._url,"/").concat(a.stcBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(n,a,t),[4,e({url:s,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.STC}}]:[2,{code:i.UPLOAD_FAIL}]}}))}))},n.prototype.multipartUpload=function(t){var n;return F(this,void 0,void 0,(function(){var o,r,a,s,c,u,d,l,f,v,g,R,I,h,E,m,T;return Z(this,(function(S){switch(S.label){case 0:return o=t.file,t.onProgress,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=S.sent(),s=U("".concat(this._url,"/").concat(a.stcBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(o,a,t),[4,e({url:"".concat(s,"?uploads"),headers:c,method:"POST"})];case 2:return u=S.sent(),d=u.status,l=u.data,f=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==d&&204!==d||!f?[2,{code:i.UPLOAD_FAIL,msg:"start upload fail"}]:(v=[],[4,this.requestUploadPart(s,o,f,a.fileName,t,v)]);case 3:return g=S.sent(),R=g.code,I=g.msg,R!==i.SUCCESS?[2,{code:R,msg:I}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(f))];case 4:return h=S.sent(),E=v.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),E="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(E,"</CompleteMultipartUpload>"),m=this.getBaseHeaders(o,h,t),[4,e({url:"".concat(s,"?uploadId=").concat(f),headers:m,method:"POST",body:E})];case 5:return 200===(T=S.sent().status)||204===T?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.STC}}]:[2,{code:i.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,o,r,a,s,c,u){return void 0===c&&(c=1),void 0===u&&(u=0),F(this,void 0,void 0,(function(){var d,l,f,v,g,R,I,h,E;return Z(this,(function(m){switch(m.label){case 0:return u>=5?[2,{code:i.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(d=(c-1)*A,l=Math.min(A,n.size-d),f="partNumber=".concat(c,"&uploadId=").concat(o),[4,this._getFileToken(a.fileType,r,"PUT",f)]);case 1:return v=m.sent(),g=n.slice(d,c*A),R=this.getBaseHeaders(n,v,a),[4,e({url:"".concat(t,"?").concat(f),headers:R,method:"PUT",body:g,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,d+e.loaded,n.size)},timeout:0})];case 2:return I=m.sent(),h=I.status,I.data,E=I.xhr,200===h||204===h?(s.push((null==E?void 0:E.getResponseHeader("ETag"))||""),d+l<n.size?[2,this.requestUploadPart(t,n,o,r,a,s,c+1,0)]:[2,{code:i.SUCCESS}]):[2,this.requestUploadPart(t,n,o,r,a,s,c,u+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},n}(xn),qn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=U("".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(n,a,t),[4,e({url:s,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.MINIO}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(t){var n;return F(this,void 0,void 0,(function(){var o,r,a,s,c,u,d,l,f,v,g,R,I,h,E,m,T;return Z(this,(function(S){switch(S.label){case 0:return o=t.file,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=S.sent(),s=U("".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(o,a,t),[4,e({url:"".concat(s,"?uploads"),headers:c,method:"POST"})];case 2:return u=S.sent(),d=u.status,l=u.data,f=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==d&&204!==d||!f?[2,{code:i.UPLOAD_FAIL,msg:"start upload fail"}]:(v=[],[4,this.requestUploadPart(s,o,f,a.fileName,t,v)]);case 3:return g=S.sent(),R=g.code,I=g.msg,R!==i.SUCCESS?[2,{code:R,msg:I}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(f))];case 4:return h=S.sent(),E=v.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),E="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(E,"</CompleteMultipartUpload>"),m=this.getBaseHeaders(o,h,t),[4,e({url:"".concat(s,"?uploadId=").concat(f),headers:m,method:"POST",body:E,timeout:0})];case 5:return 200===(T=S.sent().status)||204===T?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.MINIO}}]:[2,{code:i.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,o,r,a,s,c,u){return void 0===c&&(c=1),void 0===u&&(u=0),F(this,void 0,void 0,(function(){var d,l,f,v,g,R,I,h,E;return Z(this,(function(m){switch(m.label){case 0:return u>=5?[2,{code:i.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(d=(c-1)*A,l=Math.min(A,n.size-d),f="partNumber=".concat(c,"&uploadId=").concat(o),[4,this._getFileToken(a.fileType,r,"PUT",f)]);case 1:return v=m.sent(),g=n.slice(d,c*A),R=this.getBaseHeaders(n,v,a),[4,e({url:"".concat(t,"?").concat(f),headers:R,method:"PUT",body:g,timeout:0,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,d+e.loaded,n.size)}})];case 2:return I=m.sent(),h=I.status,E=I.xhr,200===h||204===h?(s.push((null==E?void 0:E.getResponseHeader("ETag"))||""),d+l<n.size?[2,this.requestUploadPart(t,n,o,r,a,s,c+1,0)]:[2,{code:i.SUCCESS}]):[2,this.requestUploadPart(t,n,o,r,a,s,c,u+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},n}(xn),Kn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f,v;return Z(this,(function(g){switch(g.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=g.sent(),s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),u=U(this._url),[4,e({url:u,headers:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return d=g.sent(),l=d.status,f=d.data,200!==l&&204!==l||!f?[2,{code:i.UPLOAD_FAIL,msg:l.toString()}]:(v=JSON.parse(f),[2,{code:i.SUCCESS,data:{uniqueName:v.rc_url.file_name,downloadUrl:"".concat(u,"/").concat(v.rc_url.path)}}])}}))}))},n.prototype.multipartUpload=function(e){return F(this,void 0,void 0,(function(){var t,n,o,r,i;return Z(this,(function(a){switch(a.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,r=P(),[4,this._getFileToken(o,t.name)];case 1:return i=a.sent().token,[2,this._requestUploadPart(r,t,i,n)]}}))}))},n.prototype._requestUploadPart=function(t,n,o,r,a){return void 0===a&&(a=0),F(this,void 0,void 0,(function(){var s,c,u,d,l,f,v,g,R,I;return Z(this,(function(h){switch(h.label){case 0:return s=Math.min(A,n.size-a),c=t+n.name.substring(n.name.lastIndexOf(".")),u={Range:"bytes=".concat(a,"-").concat(a+s),"X-File-TransactionId":c,"X-File-Total-Size":n.size.toString()},d=n.slice(a,a+s),(l=new FormData).set("file",d,n.name),l.set("key",c),l.set("name",c),l.set("token",o),f=U(this._url),[4,e({url:f,headers:u,onProgress:function(e){return null==r?void 0:r(a+e.loaded,n.size)},method:"POST",body:l,timeout:0})];case 1:return v=h.sent(),g=v.status,R=v.data,200===g||204===g?a+s<n.size?[2,this._requestUploadPart(t,n,o,r,a+s)]:(I=JSON.parse(R),[2,{code:i.SUCCESS,data:{uniqueName:I.rc_url.file_name,downloadUrl:"".concat(f,"/").concat(I.rc_url.path)}}]):[2,{code:i.UPLOAD_FAIL,msg:g.toString()}]}}))}))},n}(xn);function zn(e,t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f,v,g,R,I,h,E,m,T,S,p,O,N,_,C;return Z(this,(function(A){switch(A.label){case 0:return n=t.getFileToken,o=t.serverType,r=t.customDomain,a=t.ossConfig,s=t.uploadServer,c=t.bosAddr,u=e.file,d=e.fileType,l=e.thumbnailConfig,f=function(e,t,n,o,r){if(n)return[{type:On.RCX,url:n,p:"1"}];if(e){return JSON.parse(e).map((function(e){var t={type:On.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}))}var i=[];o&&i.push({type:On.QINIU,url:o,p:"1"});r&&i.push({type:On.BAIDU,url:r,p:"2"});return i}(a,0,r,s,c),0===f.length?[2,Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER,msg:"uploadUrlList is empty"})]:[4,Xn(f,e,n,o)];case 1:return v=A.sent(),g=v.code,R=v.data,I=v.msg,g===i.SUCCESS&&R?[4,jn(e,t,R)]:[2,{code:g,msg:I}];case 2:return h=A.sent(),E={downloadUrl:h,uniqueName:(null==R?void 0:R.uniqueName)||"",name:u.name,size:u.size,type:u.type},d!==M.AUDIO?[3,5]:[4,u.arrayBuffer()];case 3:return[4,Wn(A.sent())];case 4:return m=A.sent(),T=m.duration,S=m.length,C=x(x({},E),{duration:T,length:S}),[2,{code:g,data:C}];case 5:return d!==M.IMAGE?[3,7]:[4,$n(u,l)];case 6:return p=A.sent(),O=p.thumbnail,N=p.width,_=p.height,C=x(x({},E),{thumbnail:O,width:N,height:_}),[2,{code:g,data:C}];case 7:return[2,{code:g,data:E}]}}))}))}function jn(e,t,n){return F(this,void 0,void 0,(function(){var o,r,i,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return o=t.getFileUrl,r=e.fileType,i=e.file,a=n.uploadMethod,s=n.downloadUrl,c=n.uniqueName,(u=s)?[3,2]:[4,o(r,c,i.name,void 0,a)];case 1:u=d.sent().downloadUrl,d.label=2;case 2:return[2,u]}}))}))}function Wn(e){return kn=kn||new AudioContext,new Promise((function(t,n){kn.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}var Qn=((Vn={})[On.QINIU]=Fn,Vn[On.ALIYUN]=Zn,Vn[On.BAIDU]=Hn,Vn[On.S3]=Jn,Vn[On.STC]=Yn,Vn[On.MINIO]=qn,Vn[On.RCX]=Kn,Vn);function Xn(e,t,n,o,r){return void 0===r&&(r=[]),F(this,void 0,void 0,(function(){var a,s,c,u,d;return Z(this,(function(l){switch(l.label){case 0:return 0===e.length?[2,Promise.resolve({code:i.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: ".concat(JSON.stringify(r))})]:(a=e.shift(),[4,new Qn[a.type](a.url,n,o).upload(t)]);case 1:return s=l.sent(),c=s.code,u=s.data,d=s.msg,c!==i.SUCCESS?(r.push({type:a.type,url:a.url,code:c,msg:d}),[2,Xn(e,t,n,o,r)]):[2,{code:c,data:u}]}}))}))}function $n(e,t){return new Promise((function(n,o){var r=document.createElement("canvas"),i=r.getContext("2d"),a=new Image;a.onload=function(o){var s=t||{},c=s.maxHeight,u=void 0===c?160:c,d=s.maxWidth,l=void 0===d?160:d,f=s.quality,v=void 0===f?.7:f,g=s.scale,R=void 0===g?1:g,I=eo(a.width,a.height,{maxHeight:u,maxWidth:l,scale:R});r.width=Math.min(I.w,l),r.height=Math.min(I.h,u),i.drawImage(a,I.x,I.y,I.w,I.h);var h=r.toDataURL("string"==typeof e?"image/jpg":e.type,v);h=h.replace(/data:image\/[^;]+;base64,/,""),n({thumbnail:h,width:I.w,height:I.h})},a.src=(window.URL||window.webkitURL).createObjectURL(e)}))}var eo=function(e,t,n){var o,r,i=n.maxHeight,a=void 0===i?160:i,s=n.maxWidth,c=void 0===s?160:s,u=n.scale,d=e<t,l=0,f=0;return(d?t/e:e/t)>(void 0===u?1:u)?(d?(o=100,f=((r=t/(e/100))-a)/2):(r=100,l=((o=e/(t/100))-c)/2),{w:o,h:r,x:-l,y:-f}):(d?(r=a,o=e/(t/a)):(o=c,r=t/(e/c)),{w:o,h:r,x:-l,y:-f})};function to(e,t,n,o){return He((function(r){return new Promise((function(a){r.getFileToken(e,t,n,o).then((function(e){a({code:i.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:it[e]})}))}))}))}function no(e){return m("url",e,v.STRING,!0)?He((function(t){return new Promise((function(n){t.getFileToken(1,void 0,void 0,void 0,e).then((function(e){var t=e.token,o=e.downloadAuthInfo,r=e.deadline;n({code:i.SUCCESS,data:{token:t,downloadAuthInfo:o,deadline:r}})})).catch((function(e){n({code:e,msg:it[e]})}))}))})):Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER})}function oo(e,t,n,o,r){return m("fileType",e,L,!0)&&m("filename",t,v.STRING)&&m("saveName",n,v.STRING)&&m("serverType",r,v.NUMBER)?He((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,o,r).then((function(e){s({code:i.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER})}function ro(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return[2,He((function(r,c){return F(o,void 0,void 0,(function(){var o,u,d,l,f,g,R,I,E,T,S,p;return Z(this,(function(O){switch(O.label){case 0:return n=n||{},t instanceof Sn==!1?(c.warn(h.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,rt.ILLGAL_PARAMS]):m("conversation",e,v.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,m("conversation.targetId",u,v.STRING,!0)&&m("conversation.conversationType",o,v.NUMBER,!0)&&m("conversation.channelId",d,v.CHANNEL_ID)&&m("options.isStatusMessage",null==n?void 0:n.isStatusMessage,v.BOOLEAN)&&m("options.disableNotification",null==n?void 0:n.disableNotification,v.BOOLEAN)&&m("options.pushContent",null==n?void 0:n.pushContent,v.STRING)&&m("options.pushData",null==n?void 0:n.pushData,v.STRING)&&m("options.isMentioned",null==n?void 0:n.isMentioned,v.BOOLEAN)&&m("options.mentionedType",null==n?void 0:n.mentionedType,v.NUMBER)&&m("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,v.ARRAY)&&m("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,v.ARRAY)&&m("options.isVoipPush",null==n?void 0:n.isVoipPush,v.BOOLEAN)&&m("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,v.BOOLEAN)&&m("options.expansion",null==n?void 0:n.expansion,v.OBJECT)&&m("options.pushConfig",null==n?void 0:n.pushConfig,v.OBJECT)&&m("options.messageId",null==n?void 0:n.messageId,v.NUMBER)&&m("options.encrypted",null==n?void 0:n.encrypted,v.BOOLEAN)&&m("options.needReceipt",null==n?void 0:n.needReceipt,v.BOOLEAN)?(l="conversationType:".concat(o,",targetId:").concat(u),c.debug(h.O,"send message ->".concat(l)),f=function(e,t,n){var o=e.isStatusMessage,r=e.disableNotification,i=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,l=e.isVoipPush,f=e.canIncludeExpansion,v=e.expansion,g=e.isFilerWhiteBlacklist,R=e.pushConfig,I=e.messageId,h=e.encrypted,E=e.needReceipt,m=n.channelId;return x({isStatusMessage:o,disableNotification:r,pushContent:i,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:l,canIncludeExpansion:f,expansion:v,isFilerWhiteBlacklist:g,pushConfig:R,channelId:m||"",messageId:I,encrypted:h||!1,needReceipt:null!=E&&E},t)}(n,t,e),g={isMentioned:!!n.isMentioned,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!(null==n?void 0:n.disableNotification),canIncludeExpansion:!!(null==n?void 0:n.canIncludeExpansion),expansion:(null==n?void 0:n.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:r.getCurrentUserId(),messageUId:"",messageDirection:B.SEND,receivedTime:0,isStatusMessage:!!n.isStatusMessage,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig,sentStatus:D.SENDING,encrypted:(null==n?void 0:n.encrypted)||!1,needReceipt:(null==n?void 0:n.needReceipt)||!1},o!==s.ULTRA_GROUP&&(g.isOffLineMessage=!1),R=c.createTraceId(),I=function(e){g.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(Le(g))}catch(e){c.error(h.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),R)}},c.info(h.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:o,targetId:u,channelId:d}),R),[4,r.sendMessage(o,u,f,I,R)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=O.sent(),T=E.code,S=E.data,T===i.SUCCESS?(c.info(h.A_SEND_MSG_R,JSON.stringify({code:T,messageUId:S.messageUId,messageId:S.messageId}),R),p=Le(S),[2,{code:T,data:p}]):(c.warn(h.A_SEND_MSG_R,"send message fail ->".concat(T,":").concat(it[T],",").concat(l)),g.sentTime=(null==S?void 0:S.sentTime)||0,g.sentStatus=null==S?void 0:S.sentStatus,[2,{code:T,msg:it[T],data:Le(g)}])}}))}))}))]}))}))}function io(e,t,n){return ro(e,new An(t),n)}function ao(e,t){return function(n,o,r,a){if(!m("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(m("sendOptions.maxHeight",null==c?void 0:c.maxHeight,v.NUMBER)&&m("sendOptions.maxWidth",null==c?void 0:c.maxWidth,v.NUMBER)&&m("sendOptions.quality",null==c?void 0:c.quality,v.NUMBER)&&m("sendOptions.scale",null==c?void 0:c.scale,v.NUMBER)))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return He((function(c,u,d){return new Promise((function(c){var d,l=u.createTraceId();u.info(h.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),(d={file:o.file,fileType:e,onProgress:function(e,t){var n;null===(n=null==r?void 0:r.onProgress)||void 0===n||n.call(r,Math.floor(e/t*100))},contentDisposition:s.contentDisposition,thumbnailConfig:s.thumbnailConfig},He((function(e,t,n){return new Promise((function(t){var o=e.getNaviInfoFromCache();zn(d,{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:n.uploadDomain||"",serverType:null==o?void 0:o.type,ossConfig:null==o?void 0:o.ossConfig,uploadServer:null==o?void 0:o.uploadServer,bosAddr:null==o?void 0:o.bosAddr}).then((function(e){t(e)}))}))}))).then((function(e){var s,d=e.code,f=e.data,v=e.msg;if(d===i.SUCCESS&&f){var g=(null===(s=null==r?void 0:r.onComplete)||void 0===s?void 0:s.call(r,x({url:f.downloadUrl},f)))||t(f,o);return u.info(h.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:f.downloadUrl,code:i.SUCCESS}),l),void ro(n,g,a).then(c)}c({code:d,msg:v})}))}))}))}}var so=ao(M.FILE,(function(e,t){return new Un({name:e.name,size:t.file.size,type:(n=e.name,o=n.match(/\.(\w+)$/),o?o[1]:"bin"),fileUrl:e.downloadUrl,user:t.user,extra:t.extra});var n,o})),co=ao(M.IMAGE,(function(e,t){return new Nn({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),uo=ao(M.IMAGE,(function(e,t){return new Mn({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:t.user,extra:t.extra})})),lo=ao(M.AUDIO,(function(e,t){return new _n({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),fo=ao(M.SIGHT,(function(e,t){return new Cn({sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name,user:t.user,extra:t.extra})}));function vo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("options.timestamp",null==t?void 0:t.timestamp,v.NUMBER)&&m("options.count",null==t?void 0:t.count,v.NUMBER)&&(w()||m("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})))&&m("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&m("conversation",e,v.CONVERSATION,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=r.createTraceId(),r.info(h.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,o.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Le(e)})),r.info(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function go(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("options.timestamp",null==t?void 0:t.timestamp,v.NUMBER)&&m("options.count",null==t?void 0:t.count,v.NUMBER)&&m("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("options.count is invalid, It should be greater than 0 and less than 100"),t}))&&m("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&m("conversation",e,v.CONVERSATION,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(h.O,"get history message ->".concat(n)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Le(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(h.O,"get history message fail ->".concat(s,":").concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ro(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return m("targetId",e,v.STRING,!0)&&m("messageUId",t,v.STRING,!0)&&m("timestamp",n,v.NUMBER,!0)&&m("channelId",o,v.CHANNEL_ID)?[2,He((function(i){return F(r,void 0,void 0,(function(){var r,i,a,c,u;return Z(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:s.PRIVATE,channelId:o},i=new Sn("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,ro(r,i)];case 1:return a=d.sent(),c=a.code,u=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Io(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return m("messageUId",t,v.STRING,!0)&&m("targetId",e,v.STRING,!0)&&m("channelId",n,v.CHANNEL_ID)?[2,He((function(r,i){return F(o,void 0,void 0,(function(){var o,r,a,c,u;return Z(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(h.O,"send read receipt message ->".concat(o)),r=new Sn("RC:RRReqMsg",{messageUId:t}),[4,ro({targetId:e,conversationType:s.GROUP,channelId:n},r)];case 1:return a=d.sent(),c=a.code,u=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ho(e,t,n){return F(this,void 0,void 0,(function(){return Z(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function Eo(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return m("targetId",e,v.STRING,!0)&&m("messageList",t,v.OBJECT,!0)&&m("channelId",n,v.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!m(e,t[e],v.ARRAY)}))?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,c,u,d,l,f;return Z(this,(function(v){switch(v.label){case 0:return o={targetId:e,conversationType:s.GROUP,channelId:n},u=r.getNaviInfoFromCache(),1!==(null==u?void 0:u.grpRRVer)?[3,2]:(d=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===d.indexOf(e)&&d.push(e)}))})),d.length?[4,r.sendReadReceiptMessage(e,d,n)]:(a.warn(h.O,"Error in parameter messageList."),[2,{code:i.PARAMETER_ERROR}]));case 1:return c=v.sent(),[3,4];case 2:return l=new Sn("RC:RRRspMsg",{receiptMessageDic:t}),[4,ro(o,l)];case 3:c=v.sent(),v.label=4;case 4:return(f=c.code)===i.SUCCESS?[2,{code:f}]:(a.warn(h.O,"send read receipt message fail ->".concat(f,":").concat(it[f])),[2,{code:f,msg:it[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mo(e,t){return F(this,void 0,void 0,(function(){var n,o,r,a;return Z(this,(function(s){switch(s.label){case 0:return m("conversation",e,v.CONVERSATION,!0)&&m("lastMessageSendTime",t,v.NUMBER,!0)?(n=new Sn("RC:SRSMsg",{lastMessageSendTime:t}),[4,ro(e,n)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),r=o.code,a=o.msg,0===r?[2,{code:r}]:[2,{code:r,msg:a}]}}))}))}function To(e,t){return F(this,void 0,void 0,(function(){var n,o,r=this;return Z(this,(function(a){return m("conversation",e,v.CONVERSATION,!0)&&m("conversationType",e.conversationType,(function(e){return[s.PRIVATE,s.GROUP].includes(e)}),!0)&&m("messages",t,v.ARRAY,!0)&&m("messages",t,(function(e){return e.length>0&&e.length<=100&&e.every((function(e){return b(e)}))}),!0)?(n=[],o=[],t.some((function(t){var r=t.messageUId&&t.conversationType===e.conversationType&&t.targetId===e.targetId,i=t.messageDirection===B.RECEIVE,a=!!t.needReceipt,s=!!t.sentReceipt;return!(r&&a&&i)||(s?n.push(t.messageUId):o.push(x(x({},t),{isMentioned:!!t.isMentioned,disableNotification:!!t.disableNotification,isStatusMessage:!!t.isStatusMessage,expansion:t.expansion||null})),!1)}))?[2,{code:i.INVALID_PARAMETER_MESSAGELIST}]:[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u;return Z(this,(function(d){switch(d.label){case 0:return r=a.getNaviInfoFromCache(),4!==(null==r?void 0:r.grpRRVer)?(s.warn(h.O,"sendReadReceipt V5 is not supported by the current server version."),[2,{code:i.READ_RECEIPT_V5_NOT_SUPPORT}]):0===o.length?(s.warn(h.O,"sendReadReceipt No valid message -> conversation: ".concat(JSON.stringify(e),",\n message: ").concat(JSON.stringify(t))),[2,{code:i.SUCCESS}]):(c="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",\n messages:").concat(JSON.stringify(o),", invalidMessageUIds: ").concat(JSON.stringify(n)),s.info(h.O,"sendReadReceipt ->".concat(c)),[4,a.sendReadReceipt(e,o)]);case 1:return(u=d.sent().code)!==i.SUCCESS?(s.warn(h.O,"sendReadReceipt fail ->".concat(u,":").concat(it[u])),[2,{code:u,msg:it[u]}]):(s.info(h.O,"sendReadReceipt ack ->".concat(u)),[2,{code:i.SUCCESS}])}}))}))}))]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("conversation",e,v.CONVERSATION,!0)&&m("options.messageUId",t.messageUId,v.STRING,!0)&&m("options.sentTime",t.sentTime,v.NUMBER,!0)&&m("options.disableNotification",null==t?void 0:t.disableNotification,v.BOOLEAN)&&m("options.pushConfig",null==t?void 0:t.pushConfig,v.OBJECT)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete},a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),r.debug(h.O,"recall message ->".concat(a)),[4,o.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS&&u?[2,{code:c,data:Le(u)}]:c===i.SUCCESS?[2,{code:c}]:(r.warn(h.O,"recall message fail ->".concat(c,":").concat(it[c],",").concat(a)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("conversation",e,v.CONVERSATION,!0)&&m("options",t,(function(e){return g(e)&&e.length}),!0)&&!t.some((function(e){return!m("options.messageUId",e.messageUId,v.STRING,!0)||!m("options.sentTime",e.sentTime,v.NUMBER,!0)||!m("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(h.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(h.O,"delete message fail ->".concat(a,":").concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("conversation",e,v.CONVERSATION,!0)&&m("timestamp",t,v.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(h.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(h.O,"clear message ->".concat(a,":").concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function No(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("expansion",e,v.OBJECT,!0)&&m("message",t,v.OBJECT,!0)&&m("message.conversationType",t.conversationType,v.NUMBER,!0)&&m("message.targetId",t.targetId,v.STRING,!0)&&m("message.channelId",t.channelId,v.CHANNEL_ID)&&m("message.messageUId",t.messageUId,v.STRING,!0)&&m("message.expansion",t.expansion,v.OBJECT)&&m("message.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f;return Z(this,(function(v){switch(v.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.expansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),r.debug(h.O,"update message expansion ->".concat(l)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(f=v.sent().code)!==i.SUCCESS?(r.warn(h.O,"update message expansion fail ->".concat(f,":").concat(it[f],",").concat(l)),[2,{code:f,msg:it[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _o(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("keys",e,v.ARRAY,!0)&&m("message",t,v.OBJECT,!0)&&m("message.conversationType",t.conversationType,v.NUMBER,!0)&&m("message.targetId",t.targetId,v.STRING,!0)&&m("message.channelId",t.channelId,v.CHANNEL_ID)&&m("message.messageUId",t.messageUId,v.STRING,!0)&&m("message.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),r.debug(h.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(l=f.sent().code)!==i.SUCCESS?(r.warn(h.O,"remove message expansion fail ->".concat(l,":").concat(it[l],",").concat(d)),[2,{code:l,msg:it[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("conversation",e,v.CONVERSATION,!0)&&m("typingContentType",t,v.STRING,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d;return Z(this,(function(l){switch(l.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=r.createTraceId(),r.info(h.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,o.sendMessage(e.conversationType,e.targetId,n,void 0,a)];case 1:return s=l.sent(),c=s.code,u=s.data,d=c===i.SUCCESS?"info":"warn",r[d](h.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===i.SUCCESS?[2,{code:c,data:Le(u)}]:[2,{code:c,msg:it[c]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ao(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return m("messageUId",t,v.STRING,!0)&&m("targetId",e,v.STRING,!0)&&m("channelId",n,v.CHANNEL_ID)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(h.O,"get message reader ->".concat(o)),[4,r.getMessageReader(e,t,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS?[2,{code:c,data:u}]:(a.warn(h.O,"get message reader fail ->".concat(c,":").concat(it[c],",").concat(o)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(e,t,n,o,r){return Ze((function(i,a){return f("messageType",e,v.STRING,!0),f("isPersited",t,v.BOOLEAN,!0),f("isCounted",n,v.BOOLEAN,!0),f("isStatusMessage",r,v.BOOLEAN,!1),f("searchProps",o,v.ARRAY),a.info(h.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),i.registerMessageType(e,t,n,o,r),pn(e,t,n)}))}function Uo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?m("conversation",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,r===i.SUCCESS?(s=a&&Le(a)||null,[2,{code:r,data:s}]):(o.warn(h.O,"insertMessage ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Mo(e,t,n){return void 0===n&&(n={}),F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return Be("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),w()?m("conversation",e,v.CONVERSATION,!0)&&m("message",t,v.OBJECT,!0)&&m("options",n,v.OBJECT)&&m("options.isUnread",null==n?void 0:n.isUnread,v.BOOLEAN)&&m("options.searchContent",null==n?void 0:n.searchContent,v.STRING)&&m("content.senderUserId",t.senderUserId,v.STRING,!0)&&m("content.messageType",t.messageType,v.STRING,!0)&&m("content.content",t.content,v.OBJECT,!0)&&m("content.messageDirection",t.messageDirection,v.NUMBER,!0)&&m("content.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN)&&m("content.expansion",t.expansion,v.OBJECT)&&m("content.disableNotification",t.disableNotification,v.BOOLEAN)&&m("content.sentTime",t.sentTime,v.NUMBER)&&m("content.sentStatus",t.sentStatus,v.NUMBER)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,v,g,R,I,E,m,T,S,p;return Z(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,l=t.canIncludeExpansion,f=t.expansion,v=t.disableNotification,g=t.sentTime,R=t.sentStatus,a.info(h.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=n.isUnread,E=n.searchContent,m={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:g,sentStatus:R,searchContent:E,isUnread:I,messageUId:d,disableNotification:v,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,m)];case 1:return T=O.sent(),S=T.code,p=T.data,S===i.SUCCESS?[2,{code:S,data:Le(p)}]:(a.warn(h.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:it[S]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Po(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?m("messageId",e,(function(e){return c(e)||_(e)}),!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:Le(a)}]:(o.warn(h.O,"getMessage ->code:".concat(r,",messageId:").concat(e)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Lo(e){if(!w())return{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,r=e.channelId;return m("conversation",e,v.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,r),a=[];return t&&t.length&&t.forEach((function(e){return a.push(Le(e))})),{code:i.SUCCESS,data:a}},Ve?t(Ve,xe,ke):{code:i.BIZ_ERROR_CLIENT_NOT_INIT}):{code:i.BIZ_ERROR_INVALID_PARAMETER}}function wo(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return Be("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),w()?m("conversation",e,v.CONVERSATION,!0)&&m("keyword",t,v.STRING,!0)&&m("timestamp",n,v.NUMBER)&&m("count",o,v.NUMBER)?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u,d;return Z(this,(function(l){switch(l.label){case 0:return[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return r=l.sent(),c=r.code,u=r.data,c===i.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(Le(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(h.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Bo(e,t,n){return F(this,void 0,void 0,(function(){var o,r,a,s=this;return Z(this,(function(c){return Be("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),w()?(o=e.conversationType,r=e.targetId,a=e.channelId,m("conversationType",o,v.NUMBER,!0)&&m("targetId",r,v.STRING,!0)&&m("timestamp",t,v.NUMBER,!0)&&m("cleanSpace",n,v.BOOLEAN)?[2,He((function(c,u){return F(s,void 0,void 0,(function(){var s;return Z(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,r,t,n,a)];case 1:return s=d.sent(),u.debug(h.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:r,channelId:a,timestamp:t})),s===i.SUCCESS?[2,{code:s}]:(u.warn(h.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Do(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return Be("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),w()?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return t=e.conversationType,r=e.targetId,a=e.channelId,o.info(h.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,a)];case 1:return(s=c.sent())===i.SUCCESS?[2,{code:s}]:(o.warn(h.O,"clearMessages ->code:".concat(s,",targetId:").concat(r)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function bo(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return Be("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),w()?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u;return Z(this,(function(d){switch(d.label){case 0:return s.info(h.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,n,o,t)];case 1:return r=d.sent(),c=r.code,u=r.data,c===i.SUCCESS?[2,{code:c,data:u}]:(s.warn(h.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Go(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("conversation",e,v.CONVERSATION,!0)&&m("timestamp",t,v.NUMBER)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,r.info(h.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,a,t,s)];case 1:return(c=u.sent())===i.SUCCESS?[2,{code:c}]:(r.warn(h.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Vo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return Be("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),w()?m("messageId",e,v.NUMBER,!0)&&m("receivedStatus",t,v.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(h.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=a.sent())===i.SUCCESS?[2,{code:n}]:(r.warn(h.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function ko(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("messageUId",t,v.STRING,!0)&&m("conversation",e,v.CONVERSATION,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n=o.getNaviInfoFromCache(),4!==(null==n?void 0:n.grpRRVer)?(r.warn(h.O,"sendReadReceipt V5 is not supported by the current server version."),[2,{code:i.READ_RECEIPT_V5_NOT_SUPPORT}]):(r.info(h.O,"getReadReceiptUsers ->param:".concat(JSON.stringify({messageUId:t,conversation:e}))),[4,o.getReadReceiptUsers(e,t)]);case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:(r.warn(h.O,"getReadReceiptUsers ->code:".concat(s)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function xo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("messageUIds",t,v.ARRAY,!0)&&m("messageUIds",t,(function(e){return e.length>0&&e.length<=100}),!0)&&m("conversation",e,v.CONVERSATION,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n=o.getNaviInfoFromCache(),4!==(null==n?void 0:n.grpRRVer)?(r.warn(h.O,"sendReadReceipt V5 is not supported by the current server version."),[2,{code:i.READ_RECEIPT_V5_NOT_SUPPORT}]):(r.info(h.O,"getMessageReadReceiptInfos ->messageUIds:".concat(t,", conversation:").concat(e)),[4,o.getMessageReadReceiptInfos(e,t)]);case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:(r.warn(h.O,"getMessageReadReceiptInfos ->code:".concat(s,",messageUIds:").concat(t,", conversation:").concat(e)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Fo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("tag.tagId",e.tagId,v.STRING,!0)&&m("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&m("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&m("tag.tagName",e.tagName,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(h.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(h.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("tagId",e,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(h.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(h.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ho(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("tag.tagId",e.tagId,v.STRING,!0)&&m("tag.tagName",e.tagName,v.STRING,!0)&&m("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(h.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(h.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jo(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,t.getTagList()];case 1:return e=a.sent(),o=e.code,r=e.data,n.warn(h.O,"getTagList ->code:".concat(o)),[2,{code:i.SUCCESS,data:r}]}}))}))}))]}))}))}function Yo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("conversation",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return o.info(h.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:it[r]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("tagId",e,v.STRING,!0)&&m("conversations",t,v.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,v.CONVERSATION,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(h.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(h.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ko(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("tagId",e,v.STRING,!0)&&m("conversations",t,v.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,v.CONVERSATION,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(h.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(h.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("conversation",e,v.CONVERSATION,!0)&&m("tagIds",t,v.ARRAY,!0)&&!t.some((function(e){return!m("tagId",e,v.STRING,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(h.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(h.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("tagId",e,v.STRING,!0)&&m("conversations",t,v.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,v.CONVERSATION,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(h.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(h.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wo(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return m("tagId",e,v.STRING,!0)&&m("count",t,v.NUMBER,!0)&&m("startTime",n,v.NUMBER,!0)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c;return Z(this,(function(u){switch(u.label){case 0:return a.info(h.O,"getConversationListByTag ->tagId:".concat(e)),[4,r.getConversationListByTag(e,n,t)];case 1:return o=u.sent(),s=o.code,c=o.data,s===i.SUCCESS?[2,{code:s,data:null==c?void 0:c.map((function(e){return function(e){return x(x({},we(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(h.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("tagId",e,v.STRING,!0)&&m("containMuted",t,v.BOOLEAN,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,i,a;return Z(this,(function(s){switch(s.label){case 0:return r.info(h.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=s.sent(),i=n.code,a=n.data,[2,{code:i,data:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xo(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return m("tagId",e,v.STRING,!0)&&m("conversation",t,v.CONVERSATION,!0)&&m("status.isTop",n,v.BOOLEAN,!0)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o;return Z(this,(function(s){switch(s.label){case 0:return a.info(h.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,r.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===i.SUCCESS?[2,{code:o}]:(a.warn(h.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:it[o]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}ao(M.COMBINE_HTML,(function(e,t){return new yn({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var $o={COMET:"comet",WEBSOCKET:"websocket"},er={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var tr=Object.freeze({__proto__:null,getAllConversationList:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?m("channelId",e,v.CHANNEL_ID)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return o.info(h.O,"getAllConversationList -> channelId: ".concat(e)),G(e)?[4,n.getConversationListWithAllChannel()]:[3,2];case 1:return t=u.sent(),[3,4];case 2:return[4,n.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:t=u.sent(),u.label=4;case 4:return r=t.code,a=t.data,r===i.SUCCESS&&a?(s=a.map((function(e){return we(e)})),c=JSON.stringify(s.map((function(e){var t=e.targetId,n=e.latestMessage;return{targetId:t,type:e.conversationType,msgId:null==n?void 0:n.messageId,msgUId:null==n?void 0:n.messageUId}}))),o.info(h.O,"getAllConversationList success -> ".concat(c)),[2,{code:r,data:s}]):(o.warn(h.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(e)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return w()?m("startTime",e,v.NUMBER,!0)&&m("count",t,v.NUMBER,!0)&&m("channelId",n,v.CHANNEL_ID)&&m("topPriority",o,v.BOOLEAN)?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u,d,l,f;return Z(this,(function(v){switch(v.label){case 0:return r="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),s.info(h.O,"getConversationList -> ".concat(r)),G(n)?[4,a.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return c=v.sent(),[3,4];case 2:return u=[1,2,3,5,6,7,8],[4,a.getConversationsByPage(u,e,t,n,o)];case 3:c=v.sent(),v.label=4;case 4:return d=c.code,l=c.data,d===i.SUCCESS&&l?(f=l.map((function(e){return we(e)})),[2,{code:d,data:f}]):(s.warn(h.O,"getConversationList fail -> code: ".concat(d," ").concat(r)),[2,{code:d,msg:it[d]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchConversationByContent:function(e,t,n,o){return void 0===n&&(n=!1),F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return w()?m("keyword",e,v.STRING,!0)&&m("messageTypes",t,v.ARRAY,!0)&&m("includeDeleted",n,v.BOOLEAN)&&m("channelId",o,v.CHANNEL_ID)&&!t.some((function(e){return!m("messageType",e,v.STRING,!0)}))?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return r="keyword: ".concat(e,", messageTypes: ").concat(JSON.stringify(t),", channelId: ").concat(o),s.info(h.O,"searchConversationByContent -> ".concat(r)),!G(o)||n?[3,2]:[4,a.searchConversationByContentWithAllChannel(e,t)];case 1:return c=f.sent(),[3,4];case 2:return o=o||"",[4,a.searchConversationByContent(e,t,o,void 0,n)];case 3:c=f.sent(),f.label=4;case 4:return u=c.code,d=c.data,u===i.SUCCESS&&d?(l=d.map((function(e){return we(e)})),[2,{code:u,data:l}]):(s.warn(h.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(r)),[2,{code:u,msg:it[u]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchConversationsByPage:function(e){var t,n;return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return w()?m("option",e,v.OBJECT)&&m("keyword",null==e?void 0:e.keyword,v.STRING,!0)&&m("conversationTypes",null==e?void 0:e.conversationTypes,v.ARRAY,!0)&&!(null===(t=null==e?void 0:e.conversationTypes)||void 0===t?void 0:t.some((function(e){return!m("conversationType",e,T,!0)})))&&m("startTime",null==e?void 0:e.startTime,v.NUMBER,!0)&&m("startTime",null==e?void 0:e.startTime,(function(e){return e>=0}))&&m("count",null==e?void 0:e.count,v.NUMBER,!0)&&m("count",null==e?void 0:e.count,(function(e){return e>0&&e<=50}))&&m("messageTypes",null==e?void 0:e.messageTypes,v.ARRAY)&&!(null===(n=null==e?void 0:e.messageTypes)||void 0===n?void 0:n.some((function(e){return!m("messageType",e,v.STRING,!0)})))&&m("includeDeleted",null==e?void 0:e.includeDeleted,v.BOOLEAN)?[2,He((function(t,n){return F(o,void 0,void 0,(function(){var o,r,a,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return o=n.createTraceId(),n.info(h.L_SEARCH_CONVERSATIONS_T,JSON.stringify(e),o),[4,t.searchConversationsByPage(e,o)];case 1:return r=f.sent(),a=r.code,s=r.data,a!==i.SUCCESS?(n.warn(h.L_SEARCH_CONVERSATIONS_R,JSON.stringify({code:a}),o),[2,{code:a}]):(u=(c=s).list,d=c.totalCount,n.info(h.L_SEARCH_CONVERSATIONS_R,JSON.stringify({resCount:u.length,totalCount:d}),o),l={list:u.map((function(e){return we(e)})),totalCount:d},[2,{code:a,data:l}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},initAndOpenDatabase:function(e){var t=this;return He((function(n){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return[4,n.initAndOpenDatabase(e)];case 1:return[2,{code:t.sent().code}]}}))}))}))},closeDatabase:function(){var e=this;return He((function(t){return F(e,void 0,void 0,(function(){return Z(this,(function(e){switch(e.label){case 0:return[4,t.closeDatabase()];case 1:return[2,{code:e.sent().code}]}}))}))}))},searchMessages:function(e,t,n,o,r){return F(this,void 0,void 0,(function(){var a=this;return Z(this,(function(s){return w()?m("conversation",e,v.CONVERSATION,!0)&&m("keyword",t,v.STRING,!0)&&m("startTime",n,v.NUMBER,!0)&&m("startTime",n,(function(e){return e>=0}),!0)&&m("count",o,v.NUMBER,!0)&&m("count",o,(function(){return o>0&&o<=100}),!0)&&m("messageTypes",r,v.ARRAY,!1)&&m("messageTypes",r,(function(){return r.every((function(e){return"string"==typeof e}))}),!1)?[2,He((function(s,c){return F(a,void 0,void 0,(function(){var a,u,d,l,f,v,g,R,I,E;return Z(this,(function(m){switch(m.label){case 0:return a="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),c.info(h.O,"searchMessages -> ".concat(a)),u=e.targetId,d=e.conversationType,l=e.channelId,r?[4,s.searchMessageByContentAndMessageType(d,u,t,n,o,r,l)]:[3,2];case 1:return f=m.sent(),[3,6];case 2:return G(l)?[4,s.searchMessageByContentWithAllChannel(d,u,t,n,o)]:[3,4];case 3:return f=m.sent(),[3,6];case 4:return[4,s.searchMessageByContent(d,u,t,n,o,0,l)];case 5:f=m.sent(),m.label=6;case 6:return v=f.code,g=f.data,v===i.SUCCESS&&g?(R=g.messages,I=g.count,E=R.map((function(e){return Le(e)})),[2,{code:v,data:{messages:E,count:I}}]):(c.warn(h.O,"searchMessages fail -> code: ".concat(v," ").concat(a)),[2,{code:v,msg:it[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("conversation",e,v.CONVERSATION,!0)&&m("option",t,v.OBJECT,!0)&&m("option.keyword",t.keyword,v.STRING,!0)&&m("option.startTime",t.startTime,v.NUMBER,!0)&&m("option.endTime",t.endTime,v.NUMBER,!0)&&m("option.offset",t.offset,v.NUMBER)&&m("option.limit",t.limit,v.NUMBER)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g,R;return Z(this,(function(I){switch(I.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(h.O,"searchMessageInTimeRange -> ".concat(n)),a=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,l=t.offset,f=t.limit,l=l||0,f=f||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,l,f)];case 1:return v=I.sent(),g=v.code,R=v.data,g===i.SUCCESS&&R?[2,{code:g,data:{messages:R.messages.map((function(e){return Le(e)}))}}]:(r.warn(h.O,"searchMessageInTimeRange fail -> code: ".concat(g,", ").concat(n)),[2,{code:g}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return w()?m("conversation",e,v.CONVERSATION,!0)&&m("userId",t,v.STRING,!0)&&m("startTime",n,v.NUMBER,!0)&&m("count",o,v.NUMBER,!0)?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u,d,l,f,v;return Z(this,(function(g){switch(g.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(h.A_SEARCH_MESSAGE_BY_USER_T,"searchMessagesByUser -> ".concat(r)),c=e.conversationType,u=e.targetId,d=e.channelId,[4,a.searchMessagesByUser(c,u,t,n,o,d)];case 1:return l=g.sent(),f=l.code,v=l.data,f===i.SUCCESS&&v?[2,{code:f,data:{messages:v.messages.map((function(e){return Le(e)}))}}]:(s.warn(h.A_SEARCH_MESSAGE_BY_USER_R,"searchMessagesByUser fail -> code: ".concat(f,", ").concat(r)),[2,{code:f}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("conversation",e,v.CONVERSATION,!0)&&m("option",t,v.OBJECT,!0)&&m("option.count",t.count,v.NUMBER)&&m("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t}))&&m("option.timestamp",t.timestamp,v.NUMBER)&&m("option.order",t.order,(function(e){return[0,1].includes(e)}))&&m("option.messageTypes",t.messageTypes,v.ARRAY,!0)&&!t.messageTypes.some((function(e){return!m("option.messageType",e,v.STRING,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g,R,I,E,m,T,S,p,O,N;return Z(this,(function(_){switch(_.label){case 0:return n=t.count,a=void 0===n?20:n,s=t.timestamp,c=void 0===s?0:s,u=t.order,d=void 0===u?0:u,l=t.messageTypes,f="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(h.O,"getHistoryMessagesByMessageTypes -> ".concat(f)),v=e.conversationType,g=e.targetId,R=e.channelId,I=void 0===R?"":R,[4,o.getHistoryMessagesByObjectNames(v,g,c,a,l,d,I)];case 1:return E=_.sent(),m=E.code,T=E.data,m===i.SUCCESS?(p=(S=T).list,O=S.hasMore,N=p.map((function(e){return Le(e)})),[2,{code:m,data:{messages:N,hasMore:O,list:N}}]):(r.warn(h.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(m," ").concat(f)),[2,{code:m,msg:it[m]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("conversation",e,v.CONVERSATION,!0)&&m("timestamp",t,v.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,i,a,s;return Z(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(h.O,"updateSentMsgReceiptStatus -> ".concat(n)),i=e.conversationType,a=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(i,a,t,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("messageId",e,v.NUMBER,!0)&&m("receivedStatus",t,(function(e){return!G(a[e])}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){return Z(this,(function(n){switch(n.label){case 0:return r.info(h.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("messageId",e,v.NUMBER,!0)&&m("sentStatus",t,(function(e){return!G(D[e])}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){return Z(this,(function(n){switch(n.label){case 0:return r.info(h.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return w()?m("messageId",e,v.NUMBER,!0)&&m("content",t,v.OBJECT,!0)&&m("messageType",n,v.ONLY_STRING,!0)?[2,He((function(r,i){return F(o,void 0,void 0,(function(){return Z(this,(function(o){switch(o.label){case 0:return i.info(h.O,"setMessageContent ->messageId: ".concat(e,", messageType: ").concat(n)),[4,r.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?!m("messageIds",e,v.ARRAY,!0)||e.some((function(e){return!m("messageId",e,v.NUMBER,!0)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(n,o){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return o.info(h.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,i;return Z(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.targetId,i=e.channelId,o.info(h.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,i)];case 1:return[2,{code:a.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return F(this,void 0,void 0,(function(){var o,r,a,s=this;return Z(this,(function(c){return w()?(o=e.conversationType,r=e.targetId,a=e.channelId,m("conversationType",o,v.NUMBER,!0)&&m("targetId",r,v.STRING,!0)&&m("timestamp",t,v.NUMBER,!0)&&m("cleanSpace",n,v.BOOLEAN)?[2,He((function(e,i){return F(s,void 0,void 0,(function(){return Z(this,(function(i){switch(i.label){case 0:return[4,e.deleteMessagesByTimestamp(o,r,t,n,a)];case 1:return[2,{code:i.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return w()?m("conversation",e,v.CONVERSATION,!0)&&m("message",t,v.OBJECT,!0)&&m("options",n,v.OBJECT)&&m("options.isUnread",null==n?void 0:n.isUnread,v.BOOLEAN)&&m("options.searchContent",null==n?void 0:n.searchContent,v.STRING)&&(t instanceof Sn||m("message.senderUserId",t.senderUserId,v.STRING,!0)&&m("message.messageType",t.messageType,v.STRING,!0)&&m("message.content",t.content,v.OBJECT,!0)&&m("message.messageDirection",t.messageDirection,v.NUMBER,!0)&&m("message.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN)&&m("message.expansion",t.expansion,v.OBJECT)&&m("message.disableNotification",t.disableNotification,v.BOOLEAN)&&m("message.sentTime",t.sentTime,v.NUMBER)&&m("message.sentStatus",t.sentStatus,v.NUMBER))?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,v,g,R,I,E,m,T,S;return Z(this,(function(p){switch(p.label){case 0:return o="",s=1,l=!1,v=t.messageType,g=t.content,t instanceof Sn||(o=t.senderUserId,s=t.messageDirection,l=t.canIncludeExpansion,f=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),a.info(h.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),R=n.isUnread,I=n.searchContent,E={senderUserId:o,messageType:v,content:g,messageDirection:s,sentTime:c,sentStatus:u,searchContent:I,isUnread:R,messageUId:"",disableNotification:d,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,E)];case 1:return m=p.sent(),T=m.code,S=m.data,T===i.SUCCESS?[2,{code:T,data:Le(S)}]:(a.warn(h.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:it[T]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,o;return F(this,void 0,void 0,(function(){var r,a=this;return Z(this,(function(c){if(!w())return[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}];if(!m("messages",e,(function(e){return g(e)&&!(e.length<=0||e.length>500)}),!0)||!m("checkDuplicate",t,v.BOOLEAN))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];for(r in e)if(!(m("message",e[r],v.OBJECT,!0)&&m("message.conversationType",e[r].conversationType,(function(e){return[s.PRIVATE,s.DISCUSSION,s.GROUP,s.CUSTOMER_SERVICE,s.SYSTEM,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE].includes(e)}),!0)&&m("message.targetId",e[r].targetId,v.STRING,!0)&&m("message.senderUserId",e[r].senderUserId,v.STRING,!0)&&m("message.messageType",e[r].messageType,v.STRING,!0)&&m("message.content",e[r].content,v.OBJECT,!0)&&m("message.messageDirection",e[r].messageDirection,v.NUMBER,!0)&&m("message.canIncludeExpansion",e[r].canIncludeExpansion,v.BOOLEAN)&&m("message.expansion",e[r].expansion,v.OBJECT)&&m("message.disableNotification",e[r].disableNotification,v.BOOLEAN)&&m("message.sentTime",e[r].sentTime,v.NUMBER)&&m("message.sentStatus",e[r].sentStatus,v.NUMBER)&&m("options.isUnread",null===(n=e[r])||void 0===n?void 0:n.isUnread,v.BOOLEAN)&&m("options.searchContent",null===(o=e[r])||void 0===o?void 0:o.searchContent,v.STRING)))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER,msg:String(r)}];return[2,He((function(n){return F(a,void 0,void 0,(function(){var o,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.batchInsertMessage(e,t)];case 1:return o=s.sent(),r=o.code,a=o.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:it[r]}]}}))}))}))]}))}))},getMessageCount:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?[2,He((function(n){return F(t,void 0,void 0,(function(){var t,o,r,i,a,s;return Z(this,(function(c){switch(c.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,[4,n.getMessageCount(t,o,r)];case 1:return i=c.sent(),a=i.code,s=i.data,[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?m("messageUId",e,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getPrivateMessageDeliverTime(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(h.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(r,",messageUId:").concat(e)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("targetId",e,v.STRING,!0)&&m("messageUId",t,v.STRING,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getGroupMessageDeliverList(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(h.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(a,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?m("enableCheck",e,v.BOOLEAN)?[2,He((function(n){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return[4,n.setCheckDuplicateMessage(e)];case 1:return[2,{code:t.sent().code}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchMessagesFromConversationTypes:function(e){var t,n;return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return w()?m("option",e,v.OBJECT,!0)&&m("option.count",e.count,v.NUMBER)&&m("options.count",e.count,(function(e){return e>0&&e<=1e3}))&&m("option.keyword",e.keyword,v.STRING)&&m("option.keyword",e.keyword,(function(e){return e.length<=1e3}))&&m("option.timestamp",e.timestamp,v.NUMBER)&&m("option.order",e.order,(function(e){return[0,1].includes(e)}))&&m("option.messageTypes",e.messageTypes,v.ARRAY)&&!(null===(t=e.messageTypes)||void 0===t?void 0:t.some((function(e){return!m("messageTypes",e,v.STRING)})))&&m("option.conversationTypes",e.conversationTypes,v.ARRAY)&&!(null===(n=e.conversationTypes)||void 0===n?void 0:n.some((function(e){return!m("conversationType",e,T)})))?[2,He((function(t,n){return F(o,void 0,void 0,(function(){var o,r,a,c,u,d,l,f,v,g,R,I,E,m,T,S,p,O,N,_,C,A,y,U;return Z(this,(function(M){switch(M.label){case 0:return o=e.targetIds,r=void 0===o?null:o,a=e.messageTypes,c=void 0===a?null:a,u=e.keyword,d=void 0===u?"":u,l=e.count,f=void 0===l?20:l,v=e.timestamp,g=void 0===v?0:v,R=e.order,I=void 0===R?0:R,E=e.channelIds,m=void 0===E?null:E,T=e.conversationTypes,S=void 0===T?[s.PRIVATE,s.GROUP,s.SYSTEM,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE,s.ULTRA_GROUP]:T,p="option:".concat(JSON.stringify(e)),n.info(h.O,"getMessagesByMessageTypeFromConversationTypes -> ".concat(p)),[4,t.getMessagesByMessageTypeFromConversationTypes(r,m,c,d,g,I,f,S)];case 1:return O=M.sent(),N=O.code,_=O.data,N===i.SUCCESS?(A=(C=_).list,y=C.hasMore,U=A.map((function(e){return Le(e)})),[2,{code:N,data:{hasMore:y,list:U}}]):(n.warn(h.O,"getMessagesByMessageTypeFromConversationTypes fail -> code: ".concat(N," ").concat(p)),[2,{code:N,msg:it[N]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return w()?[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(i){switch(i.label){case 0:return n.info(h.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=i.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}});function nr(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return!e||m("proxy.socksHost",e.socksHost,v.STRING,!0)&&m("proxy.socksPort",e.socksPort,v.NUMBER,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(h.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(h.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function or(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,t.getProxy()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:o,data:r}]:(n.warn(h.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:it[o]}])}}))}))}))]}))}))}function rr(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return!e||m("proxy.socksHost",e.socksHost,v.STRING,!0)&&m("proxy.socksPort",e.socksPort,v.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return r.info(h.O,"testProxy: ->".concat(e)),[4,o.testProxy(e,t)];case 1:return n=c.sent(),a=n.status,s=n.data,a===i.SUCCESS?[2,{code:a,msg:s}]:(r.warn(h.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{Sn as BaseMessage,yn as CombineMessage,Dn as CommandMessage,$o as ConnectType,ye as Events,Un as FileMessage,Mn as GIFMessage,Gn as GroupNotificationMessage,_n as HQVoiceMessage,Nn as ImageMessage,bn as InformationNotificationMessage,Ln as LocationMessage,er as MessageType,wn as ReferenceMessage,Bn as RichContentMessage,Cn as SightMessage,An as TextMessage,Pn as VoiceMessage,et as __addSDKVersion,qo as addConversationsToTag,Je as addEventListener,Fo as addTag,hn as addToBlacklist,In as bindRTCRoomForChatroom,St as clearAllMessagesUnreadStatus,ze as clearEventListeners,Oo as clearHistoryMessages,Do as clearMessages,Tt as clearMessagesUnreadStatus,Rt as clearTextMessageDraft,Go as clearUnreadCountByTimestamp,ct as connect,Bo as deleteLocalMessagesByTimestamp,po as deleteMessages,We as destroy,ut as disconnect,tr as electronExtension,fn as forceRemoveChatRoomEntry,un as forceSetChatRoomEntry,gn as getAllChatRoomEntries,bt as getAllConversationState,jt as getAllUltraGroupUnreadCount,Wt as getAllUltraGroupUnreadMentionedCount,Dt as getAllUnreadMentionedCount,mn as getBlacklist,Tn as getBlacklistStatus,Vt as getBlockUltraGroupList,yt as getBlockedConversationList,vn as getChatRoomEntry,an as getChatRoomInfo,Rn as getChatroomHistoryMessages,Qe as getConnectionStatus,lt as getConversation,dt as getConversationList,Ct as getConversationNotificationLevel,At as getConversationNotificationStatus,Mt as getConversationTypeNotificationLevel,Wo as getConversationsFromTagByPage,$e as getCurrentUserId,nt as getDeviceId,no as getDownloadAuth,to as getFileToken,oo as getFileUrl,Uo as getFirstUnreadMessage,vo as getHistoryMessages,Po as getMessage,xo as getMessageReadReceiptInfos,Ao as getMessageReader,or as getProxy,ko as getReadReceiptUsers,go as getRemoteHistoryMessages,Xe as getServerTime,Jo as getTags,Yo as getTagsFromConversation,vt as getTextMessageDraft,Lt as getTopConversationList,It as getTotalUnreadCount,ht as getTotalUnreadCountByLevels,Et as getTotalUnreadMentionedCountByLevels,qt as getUltraGroupDefaultNotificationLevel,Xt as getUltraGroupFirstUnreadMessageTimestamp,Gt as getUltraGroupList,xt as getUltraGroupMessageListByMessageUId,zt as getUltraGroupUnreadCountByTargetId,$t as getUltraGroupUnreadInfoList,Yt as getUltraGroupUnreadMentionedCountByTargetId,Qt as getUltraGroupUnreadMentionedMessages,wt as getUnreadConversationList,mt as getUnreadCount,Qo as getUnreadCountByTag,Bt as getUnreadMentionedCount,Lo as getUnreadMentionedMessages,je as init,Mo as insertMessage,ot as installPlugin,nn as joinChatRoom,on as joinExistChatRoom,Jt as modifyMessage,Ye as onceEventListener,rn as quitChatRoom,So as recallMessage,yo as registerMessageType,Ht as removeAllExpansionForUltraGroupMessage,ln as removeChatRoomEntries,dn as removeChatRoomEntry,ft as removeConversation,Ko as removeConversationsFromTag,qe as removeEventListener,Ke as removeEventListeners,Zt as removeExpansionForUltraGroupMessage,En as removeFromBlacklist,_o as removeMessageExpansionForKey,Zo as removeTag,jo as removeTagFromConversations,zo as removeTagsFromConversation,gt as saveTextMessageDraft,bo as searchConversationByContent,wo as searchMessages,so as sendFileMessage,uo as sendGIFMessage,lo as sendHQVoiceMessage,co as sendImageMessage,ro as sendMessage,To as sendReadReceipt,Ro as sendReadReceiptMessage,Io as sendReadReceiptRequest,ho as sendReadReceiptResponse,Eo as sendReadReceiptResponseV2,fo as sendSightMessage,mo as sendSyncReadStatusMessage,io as sendTextMessage,Co as sendTypingStatusMessage,kt as sendUltraGroupTypingStatus,cn as setChatRoomEntries,sn as setChatRoomEntry,Nt as setConversationNotificationLevel,_t as setConversationNotificationStatus,Pt as setConversationToTop,Xo as setConversationToTopInTag,Ut as setConversationTypeNotificationLevel,Vo as setMessageReceivedStatus,nr as setProxy,Kt as setUltraGroupDefaultNotificationLevel,rr as testProxy,Ft as updateExpansionForUltraGroupMessage,No as updateMessageExpansion,Ho as updateTag};
1
+ import{httpRequest as e,NetworkType as t,HttpMethod as n,HTTP_TIMEOUT as o,appendUrl as r,ErrorCode as i,ReceivedStatus as a,ConversationType as s,isNumber as c,EventEmitter as u,RCConnectionStatus as d,VersionManage as l,assert as f,AssertRules as v,isArray as g,isHttpUrl as R,APIContext as I,LogTagId as h,logger as E,validate as m,isValidConversationType as T,isValidNotificationLevel as S,NotificationLevel as p,isTypeInConversationList as O,UltraGroupChannelType as N,isString as _,MAX_UPLOAD_FILE_SIZE as C,UPLOAD_FILE_CHUNK_SIZE as A,UploadMethod as y,fixUrlProtocol as U,FileType as M,getUUID as P,isValidFileType as L,usingCppEngine as w,MessageDirection as B,SentStatus as D,isObject as b,isUndefined as G}from"@rongcloud/engine";export{AreaCode,ChatroomEntryType,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ChrmSyncStatus,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,OperateStatus,PushImportanceHonor,RCConnectionStatus,ReceivedStatus,SentStatus,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var V=function(e,t){return V=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},V(e,t)};function k(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}V(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var x=function(){return x=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},x.apply(this,arguments)};function F(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))}function Z(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}"function"==typeof SuppressedError&&SuppressedError;var H=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,o=t.length;n<o;n++)if(!e[t[n]])return!1;return!0}(uni))},J=H();var Y=null,q=function(e){return F(void 0,void 0,void 0,(function(){var t;return Z(this,(function(n){switch(n.label){case 0:return[4,K.getNetworkType()];case 1:return t=n.sent(),Y({status:"online"===e.type,type:t}),[2]}}))}))};var K={tag:"browser",httpReq:e,localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:J,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:t.UNKONWN},n=e.type,o=e.effectiveType,r=n||o||t.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){Y=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",q),window.addEventListener("online",q))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",q),window.removeEventListener("online",q)),Y=null}},z=H(),j=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},W={setItem:j("setStorageSync"),getItem:j("getStorageSync"),removeItem:j("removeStorageSync"),clear:j("clearStorageSync")},Q=null,X=function(e){var t=e.isConnected,n=e.networkType;Q({status:t,type:n})};var $={tag:"wechat",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){wx.request({url:d,method:t,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:W,sessionStorage:W,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:z,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Q=e,wx.onNetworkStatusChange(X)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(X),Q=null}},ee=H(),te=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var o=my[e]({key:t[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},ne={setItem:te("setStorageSync"),getItem:te("getStorageSync"),removeItem:te("removeStorageSync"),clear:te("clearStorageSync")},oe=null,re=function(e){var t=e.isConnected,n=e.networkType;oe({status:t,type:n})};var ie={tag:"alipay",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c),l=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:t,headers:s,timeout:a,data:u,dataType:l,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:ne,sessionStorage:ne,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ee,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){oe=e,my.onNetworkStatusChange(re)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(re),oe=null}},ae=H(),se=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,t)}catch(e){}}},ce={setItem:se("setStorageSync"),getItem:se("getStorageSync"),removeItem:se("removeStorageSync"),clear:se("clearStorageSync")},ue=null,de=function(e){var t=e.isConnected,n=e.networkType;ue({status:t,type:n})};var le={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ae,localStorage:ce,sessionStorage:ce,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){ue=e,tt.onNetworkStatusChange(de)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(de),ue=null}},fe=H(),ve=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},ge={setItem:ve("setStorageSync"),getItem:ve("getStorageSync"),removeItem:ve("removeStorageSync"),clear:ve("clearStorageSync")},Re=null,Ie=function(e){var t=e.isConnected,n=e.networkType;Re({status:t,type:n})};var he={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:fe,localStorage:ge,sessionStorage:ge,httpReq:function(e){return new Promise((function(t,n){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Re=e,swan.onNetworkStatusChange(Ie)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Ie),Re=null}},Ee=H(),me=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,t)}catch(e){null===console||void 0===console||console.error(e)}}},Te={setItem:me("setStorageSync"),getItem:me("getStorageSync"),removeItem:me("removeStorageSync"),clear:me("clearStorageSync")},Se=null,pe=function(e){var t=e.isConnected,n=e.networkType;Se({status:t,type:n})};var Oe={tag:"jingdong",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){jd.request({url:d,method:t,headers:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:Te,sessionStorage:Te,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ee,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Se=e,jd.onNetworkStatusChange(pe)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(pe),Se=null}},Ne=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},_e={setItem:Ne("setStorageSync"),getItem:Ne("getStorageSync"),removeItem:Ne("removeStorageSync"),clear:Ne("clearStorageSync")},Ce=null,Ae=function(e){var t=e.isConnected,n=e.networkType;Ce({status:t,type:n})};var ye,Ue={tag:"uniapp",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){uni.request({url:d,method:t,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:_e,sessionStorage:_e,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ce=e,uni.onNetworkStatusChange(Ae)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Ae),Ce=null}},Me=function(e){return e&&e.request&&e.getSystemInfo},Pe="undefined"!=typeof uni&&Me(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return Ue;case"mp-jd":return Oe;case"mp-baidu":return he;case"mp-toutiao":return le;case"mp-alipay":return ie;case"mp-weixin":return $;default:return K}}():"undefined"!=typeof jd&&Me(jd)?Oe:"undefined"!=typeof my&&Me(my)?ie:"undefined"!=typeof tt&&Me(tt)?le:"undefined"!=typeof swan&&Me(swan)?he:"undefined"!=typeof wx&&Me(wx)?$:K;function Le(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,i=e.senderUserId,u=e.targetId,d=e.sentTime,l=e.receivedTime,f=e.messageUId,v=e.messageDirection,g=e.isPersited,R=e.isCounted,I=e.isOffLineMessage,h=e.canIncludeExpansion,E=e.expansion,m=e.receivedStatus,T=e.disableNotification,S=e.isMentioned,p=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,y=e.channelType,U=e.sentStatus,M=e.needReceipt,P=e.sentReceipt;m||(m=a.UNREAD);var L={messageType:o,channelId:n||"",content:r,senderUserId:i,targetId:u,conversationType:t,sentTime:d,receivedTime:l,messageUId:f,messageDirection:v,isPersited:g,isCounted:R,isMentioned:S,disableNotification:T,isStatusMessage:p,canIncludeExpansion:h,expansion:E,receivedStatus:m,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:U,needReceipt:M,sentReceipt:P};return t!==s.ULTRA_GROUP&&(L.isOffLineMessage=I),t===s.ULTRA_GROUP&&c(y)&&(L.channelType=y),L}function we(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,i=e.hasMentioned,a=e.mentionedInfo,c=e.lastUnreadTime,u=e.notificationStatus,d=e.notificationLevel,l=e.isTop,f=e.channelId,v=e.unreadMentionedCount,g=e.matchCount,R=e.unreadMentionedMeCount,I=e.draft,h=e.operationTime,E={conversationType:t,targetId:n,latestMessage:o&&Le(o),unreadMessageCount:r,hasMentioned:i,mentionedInfo:i?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0,lastUnreadTime:c,notificationStatus:u,notificationLevel:d,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:g,unreadMentionedMeCount:R,draft:I,operationTime:h};return E.conversationType===s.ULTRA_GROUP&&(E.firstUnreadMessage=e.firstUnreadMessage,E.channelType=e.channelType),E}function Be(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",e.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",e.USER_GROUP_STATUS="USER_GROUP_STATUS",e.MESSAGE_READ_RECEIPT="MESSAGES_READ_RECEIPT",e.DATABASE_OPERATION_FAILED="DATABASE_OPERATION_FAILED"}(ye||(ye={}));var De=new u,be={connection:function(e,t){switch(e){case d.CONNECTED:De.emit(ye.CONNECTED);break;case d.CONNECTING:De.emit(ye.CONNECTING);break;case d.SUSPENDED:De.emit(ye.SUSPEND,t);break;case d.DISCONNECTED:De.emit(ye.DISCONNECT,t)}},batchMessage:function(e){De.emit(ye.MESSAGES,{messages:e.map((function(e){return Le(e)}))})},typingState:function(e){De.emit(ye.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){De.emit(ye.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){De.emit(ye.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){De.emit(ye.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(e){var t=e.map((function(e){var t=e.conversationType,n={conversationType:t,latestMessage:e.latestMessage?Le(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===s.ULTRA_GROUP?(n.versionTime=e.versionTime,n.unreadMessageCount=Ge(e.unreadMessageCount||0),n.unreadMentionedCount=Ge(e.unreadMentionedCount||0),n.unreadMentionedMeCount=Ge(e.unreadMentionedMeCount||0),{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));De.emit(ye.CONVERSATION,{conversationList:t})},chatroomState:function(e){De.emit(ye.CHATROOM,e)},expansion:function(e){De.emit(ye.EXPANSION,e)},pullFinished:function(){De.emit(ye.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){De.emit(ye.TAG)},conversationTagChanged:function(){De.emit(ye.CONVERSATION_TAG)},messageBlocked:function(e){De.emit(ye.MESSAGE_BLOCKED,e)},messageDelivered:function(e){De.emit(ye.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){De.emit(ye.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){De.emit(ye.ULTRA_GROUP_ENABLE,e.map((function(e){return we(e)})))},operateStatus:function(e){De.emit(ye.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){De.emit(ye.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return Le(e)})))},ultraGroupMessageModified:function(e){De.emit(ye.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return Le(e)})))},ultraGroupMessageRecalled:function(e){De.emit(ye.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return Le(e)})))},ultraGroupChannelChangeType:function(e){De.emit(ye.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){De.emit(ye.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){De.emit(ye.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){De.emit(ye.USER_GROUP_STATUS,e)},messageReadReceipt:function(e){De.emit(ye.MESSAGE_READ_RECEIPT,e)},onDatabaseOperationFailed:function(e){De.emit(ye.DATABASE_OPERATION_FAILED,e)}};function Ge(e){return e>999?999:e}l.add("imlib-next","5.8.2-enterprise-lz.33");var Ve=null,ke=null,xe=null;function Fe(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){switch(e.label){case 0:return Ve?(xe.info(h.A_DESTROY_O),[4,I.destroy()]):[2];case 1:return e.sent(),ke=null,Ve=null,xe=null,[2]}}))}))}function Ze(e){if(!Ve)throw new Error("Not initialized yet!");return e(Ve,xe,ke)}function He(e){return Ve?e(Ve,xe,ke):Promise.resolve({code:i.BIZ_ERROR_CLIENT_NOT_INIT})}function Je(e,t,n){De.on(e,t,n)}function Ye(e,t,n){De.once(e,t,n)}function qe(e,t,n){De.off(e,t,n)}function Ke(e){De.removeAll(e)}function ze(){De.clear()}function je(e){!function(e){var t,n,o=e.appkey,r=e.navigators;Ve?xe.warn(h.A_INIT_REPEAT_O):(f("options.appkey",e.appkey,v.STRING,!0),f("options.navigators",e.navigators,(function(e){return g(e)&&(0===e.length||e.every(R))})),ke=e,Ve=I.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||Pe,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl,environment:null!==(n=e.environment)&&void 0!==n?n:"default"}),(xe=Ve.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),xe.info(h.A_INIT_O,JSON.stringify({appkey:o,navigators:r,version:"5.8.2-enterprise-lz.33",commit:"463380662ecd02a964b442195d5719a2c1469569"})),Ve.assignWatcher(be),E.init(xe))}(e)}function We(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return Ve?(ze(),[2,Fe()]):[2]}))}))}function Qe(){return Ze((function(e){return e.getConnectionStatus()}))}function Xe(){return Ze((function(e){return e.getServerTime()}))}function $e(){return Ze((function(e){return e.getCurrentUserId()}))}function et(e,t){l.add(e,t)}function nt(){return Ze((function(e){return e.getDeviceId()}))}function ot(e,t){return Ze((function(n){return n.install(e,t)}))}var rt={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:i.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:i.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},it={};for(var at in rt){var st=rt[at].code;it[st]=at}function ct(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return m("token",e,v.STRING,!0)&&m("reconnectKickEnable",t,v.BOOLEAN)?(n=r.createTraceId(),r.info(h.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,o.connect(e,!!t,n)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=c.sent(),s=a.code===i.SUCCESS?"info":"warn",r[s](h.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===i.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:it[a.code]}]}}))}))}))]}))}))}function ut(e){return E.info(h.A_DISCONNECT_O,{}),Ze((function(t){return t.disconnect(e)}))}function dt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("options.count",null==e?void 0:e.count,v.NUMBER)&&m("options.startTime",null==e?void 0:e.startTime,v.NUMBER)&&m("options.order",null==e?void 0:e.order,v.NUMBER)&&m("channelId",t,v.CHANNEL_ID)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return we(e)}))}]:(r.warn(h.O,"get conversation list fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),r=t.code,a=t.data,r!==i.SUCCESS?(o.warn(h.O,"getConversation ->code:".concat(r,", targetId:").concat(e.targetId)),[2,{code:r,msg:it[r]}]):[2,{code:r,data:a?we(a):null}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r;return Z(this,(function(a){switch(a.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.O,"destroy conversation ->".concat(r)),t!==i.SUCCESS?(o.warn(h.O,"destroy conversation fail ->".concat(t,":").concat(it[t],",").concat(r)),[2,{code:t,msg:it[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.O,"get draft ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a||""}]:(o.warn(h.O,"get draft fail ->".concat(r,":").concat(it[r],",").concat(s)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("options",e,v.CONVERSATION,!0)&&m("draft",t,v.STRING,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(h.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())===i.SUCCESS?[2,{code:a}]:(r.warn(h.O,"set draft fail ->".concat(a,":").concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r;return Z(this,(function(a){switch(a.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.O,"delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(r=a.sent())===i.SUCCESS?[2,{code:r}]:(o.warn(h.O,"delete draft fail ->".concat(r,":").concat(it[r],",").concat(t)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("includeMuted",e,v.BOOLEAN,!1)&&m("conversationTypes",t,v.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!m("conversationType",e,T)})))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return r.debug(h.O,"get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",t,e)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(h.O,"getTotalUnreadCount fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return!m("conversationTypes",e,v.ARRAY,!0)||!m("levels",t,v.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,T)}))||t.some((function(e){return!m("level",e,S)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(h.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]}))}))}function Et(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return!m("conversationTypes",e,v.ARRAY,!0)||!m("levels",t,v.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,T)}))||t.some((function(e){return!m("level",e,S)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(h.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]}))}))}function mt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.O,"get unreadCount ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(h.O,"get unreadCount fail ->".concat(r,":").concat(it[r],",").concat(s)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r;return Z(this,(function(a){switch(a.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.O,"clear unreadMsgNum ->".concat(r)),t!==i.SUCCESS?(o.warn(h.O,"clear unreadMsgNum fail ->".concat(t,":").concat(it[t],",").concat(r)),[2,{code:t,msg:it[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function St(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){return Z(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}rt.ROAMING_SERVICE_UNAVAILABLE.code;var pt=function(e,t,n){void 0===n&&(n="");var o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(h.O,"".concat(n," -> ").concat(o)),o},Ot=function(e,t,n,o){return void 0===o&&(o=""),F(void 0,void 0,void 0,(function(){var r,a;return Z(this,(function(s){switch(s.label){case 0:return r=pt(e,t,o),[4,n()];case 1:return(a=s.sent())!==i.SUCCESS?(e.warn(h.O,"".concat(o," fail -> ").concat(a," : ").concat(it[a]," , ").concat(r)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))};function Nt(e,t){return F(this,void 0,void 0,(function(){return Z(this,(function(n){return m("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)&&m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return Ot(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e,t){return F(this,void 0,void 0,(function(){return Z(this,(function(n){return m("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return Ot(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return t=pt(o,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS?[2,{code:a,data:s}]:(o.warn(h.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(it[a]," , ").concat(t)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function At(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return o.info(h.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(h.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yt(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,He((function(e){return e.getBlockConversationList()}))]}))}))}function Ut(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("conversationType",e,(function(){return[s.PRIVATE,s.GROUP,s.SYSTEM,s.PUBLIC_SERVICE,s.APP_PUBLIC_SERVICE,s.ULTRA_GROUP].includes(e)}))&&m("level",t,S)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return r.info(h.O,"setConversationTypeNotificationLevel ->conversationType:".concat(e,",level:").concat(t)),[4,o.setConversationTypeNotificationLevel(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(h.O,"setConversationTypeNotificationLevel ->conversationType:".concat(e,",level:").concat(t)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("conversationType",e,(function(){return[s.PRIVATE,s.GROUP,s.SYSTEM,s.PUBLIC_SERVICE,s.APP_PUBLIC_SERVICE,s.ULTRA_GROUP].includes(e)}))?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return o.info(h.O,"getConversationTypeNotificationLevel ->conversationType:".concat(e)),[4,n.getConversationTypeNotificationLevel(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(h.O,"getConversationTypeNotificationLevel ->conversationType:".concat(e)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Pt(e,t,n){return void 0===t&&(t=!0),void 0===n&&(n=!0),F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return m("options",e,v.CONVERSATION,!0)&&m("isTop",t,v.BOOLEAN)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s;return Z(this,(function(c){switch(c.label){case 0:return o="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(h.O,"set conversation status ->".concat(o)),[4,r.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId,n)];case 1:return(s=c.sent())!==i.SUCCESS?(a.warn(h.O,"set conversation status fail ->".concat(s,":").concat(it[s],",").concat(o)),[2,{code:s,msg:it[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("conversationTypes",e,v.ARRAY)&&!(null==e?void 0:e.some((function(e){return!m("conversationType",e,T)})))&&m("channelId",t,v.CHANNEL_ID)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getTopConversationList(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return we(e)}))}]:(r.warn(h.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return!m("conversationTypes",e,v.ARRAY)||(null==e?void 0:e.some((function(e){return!m("conversationType",e,O)})))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,n.getUnreadConversationList(e)];case 1:return t=a.sent(),o=t.code,r=t.data,o===i.SUCCESS&&r?[2,{code:0,data:r.map((function(e){return we(e)}))}]:[2,{code:o,msg:it[o]}]}}))}))}))]}))}))}function Bt(e){return F(this,void 0,void 0,(function(){return Z(this,(function(t){return m("options",e,v.CONVERSATION,!0)?[2,He((function(t,n){return n.debug(h.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,He((function(e,t){return t.debug(h.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function bt(){return F(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,He((function(e){return e.getAllConversationState()}))]}))}))}function Gt(e){return void 0===e&&(e={}),F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options.targetId",e.targetId,v.STRING,!1)&&m("options.channelType",e.channelType,(function(e){return void 0!==N[e]}),!1)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:i.SUCCESS,data:a}]:(o.warn(h.O,"get ultragroup ->".concat(r,":").concat(it[r])),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:i.SUCCESS,data:r}]:(n.warn(h.O,"get block ultragroup ->".concat(o,":").concat(it[o])),[2,{code:o,msg:it[o]}])}}))}))}))]}))}))}function kt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(h.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(it[t])),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("options",e,v.CONVERSATION,!0)&&m("msgs",t,v.ARRAY,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g;return Z(this,(function(R){switch(R.label){case 0:return n=e.targetId,a=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),u={targetId:n,conversationType:a,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:if(d=R.sent(),l=d.code,f=d.data,l===i.SUCCESS){for(g in v={},f)v[g]=f[g]?Le(f[g]):void 0;return[2,{code:i.SUCCESS,data:v}]}return r.warn(h.O,"get UltraGroup MessageList by messageUId ->".concat(l,":").concat(it[l])),[2,{code:l,msg:it[l]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("expansion",e,v.OBJECT,!0)&&m("message",t,v.OBJECT,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v;return Z(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(h.O,"update expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(f)];case 1:return(v=g.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(h.O,"update expansion for ultragroup message ->".concat(v,":").concat(it[v])),[2,{code:v,msg:it[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("expansion",e,v.ARRAY,!0)&&m("message",t,v.OBJECT,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v;return Z(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(h.O,"remove expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(f)];case 1:return(v=g.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(h.O,"remove expansion for ultraGroup message ->".concat(v,":").concat(it[v])),[2,{code:v,msg:it[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("message",e,v.OBJECT,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,l,f;return Z(this,(function(v){switch(v.label){case 0:return t=e.conversationType,r=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(a),o.debug(h.O,"remove all expansion for ultraGroup message ->".concat(d)),l={targetId:r,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(l)];case 1:return(f=v.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(h.O,"remove all expansion for ultraGroup message ->".concat(f,":").concat(it[f])),[2,{code:f,msg:it[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("content",e,v.OBJECT,!0)&&m("message",t,v.OBJECT,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g;return Z(this,(function(R){switch(R.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.senderUserId,u=t.sentTime,d=t.canIncludeExpansion,l=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(l,",messageUId:").concat(s),r.debug(h.O,"update ultragroup message expansion ->".concat(f)),v={targetId:a,channelId:l,conversationType:n,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(v)];case 1:return(g=R.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(h.O,"modify ultraGroup message ->".concat(g,":").concat(it[g])),[2,{code:g,msg:it[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&m("notificationLevels",t,v.ARRAY)&&!(null==t?void 0:t.some((function(e){return!m("notificationLevel",e,S)})))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return r.debug(h.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:i.SUCCESS,data:s}]:(r.warn(h.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(it[a])),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("options.targetId",e.targetId,v.STRING,!0)&&m("options.channelId",e.channelId,v.CHANNEL_ID)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(h.O,"".concat(t," -> ").concat(r)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:(o.warn(h.O,"".concat(t," fail -> ").concat(s," : ").concat(it[s]," , ").concat(r)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,v.STRING,!0)&&m("options.channelId",e.channelId,v.CHANNEL_ID,!0)&&m("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),r.debug(h.O,"".concat(n," -> ").concat(a)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===i.SUCCESS?[2,{code:s}]:(r.warn(h.O,"".concat(n," fail -> ").concat(s," : ").concat(it[s]," , ").concat(a)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zt(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&m("notificationLevels",t,v.ARRAY)&&!(null==t?void 0:t.some((function(e){return!m("notificationLevel",e,S)})))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,i,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return i=u.sent(),a=i.code,s=i.data,c="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),r.debug(h.O,"".concat(n," -> ").concat(c)),[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jt(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r,a;return Z(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(h.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(h.O,"".concat(e," fail ->").concat(r,": ").concat(it[r])),[2,{code:r,msg:it[r]}])}}))}))}))]}))}))}function Wt(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r,a;return Z(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(h.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(h.O,"".concat(e," fail ->").concat(r,": ").concat(it[r])),[2,{code:r,msg:it[r]}])}}))}))}))]}))}))}function Qt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,v.STRING,!0)&&m("options.channelId",e.channelId,v.CHANNEL_ID,!0)&&m("options.sentTime",e.sentTime,v.NUMBER,!0)&&m("options.count",e.count,(function(e){return c(e)&&e>0&&e<=50}),!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return t=e.targetId,r=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:r,sentTime:a,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=f.sent(),d=u.code,l=u.data,d===i.SUCCESS?[2,{code:d,data:l}]:(o.warn(h.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(it[d])),[2,{code:d,msg:it[d]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xt(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("conversation.targetId",e.targetId,v.STRING,!0)&&m("conversation.channelId",e.channelId,v.CHANNEL_ID,!0)?[2,He((function(n){return F(t,void 0,void 0,(function(){var t,o,r,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,r={targetId:t,channelId:o},[4,n.getUltraGroupFirstUnreadMessageTimestamp(r)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:it[s]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $t(e){return F(this,void 0,void 0,(function(){var t,n=this;return Z(this,(function(o){return m("targetIds",e,v.ARRAY,!0)&&m("targetIds.length",e,(function(e){return e.length>0&&e.length<20}))&&!e.some((function(e){return!m("targetId",e,v.STRING)}))?(t=e.filter((function(t,n){return e.indexOf(t)===n})),[2,He((function(e){return F(n,void 0,void 0,(function(){var n,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,e.getUltraGroupUnreadInfoList(t)];case 1:return n=a.sent(),o=n.code,r=n.data,o===i.SUCCESS?[2,{code:o,data:r}]:[2,{code:o,msg:it[o]}]}}))}))}))]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var en=function(e){return!!(m("options.key",e.key,v.STRING,!0)&&m("options.value",e.value,v.STRING,!0)&&m("options.isAutoDelete",e.isAutoDelete,v.BOOLEAN)&&m("options.isSendNotification",e.isSendNotification,v.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,v.STRING))},tn=function(e){return m("options.key",e.key,v.STRING,!0)&&m("options.isSendNotification",e.isSendNotification,v.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,v.STRING)};function nn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&m("options.count",t.count,v.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return n=r.createTraceId(),r.info(h.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,o.joinChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===i.SUCCESS?"info":"warn",r[s](h.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==i.SUCCESS?[2,{code:a,msg:it[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function on(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&m("options.count",t.count,v.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return n=r.createTraceId(),r.info(h.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,o.joinExistChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===i.SUCCESS?"info":"warn",r[s](h.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==i.SUCCESS?[2,{code:a,msg:it[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("targetId",e,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(h.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return r=s.sent(),a=r===i.SUCCESS?"info":"warn",o[a](h.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),t),r!==i.SUCCESS?[2,{code:r,msg:it[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function an(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&m("options.count",t.count,v.NUMBER)&&m("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(h.O,"get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(h.O,"get chatroom info fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&en(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(h.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(h.O,"set chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function cn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&function(e){return e.entries.every((function(e){return m("entry.key",e.key,v.STRING,!0)&&m("entry.value",e.value,v.STRING,!0)}))&&m("options.isAutoDelete",e.isAutoDelete,v.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,v.STRING)&&m("options.isForce",e.isForce,v.BOOLEAN)}(t)?t.entries.length>10?[2,rt.CHATROOM_KV_STORE_OUT_LIMIT]:[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(h.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s!==i.SUCCESS?(r.warn(h.O,"set chatroom entry fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function un(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&en(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(h.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(h.O,"force set chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&tn(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(h.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(h.O,"remove chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ln(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&function(e){return e.entries.every((function(e){return m("key",e,v.STRING,!0)}))&&m("options.notificationExtra",e.notificationExtra,v.STRING)}(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),r.info(h.O,"remove chatroom entry->".concat(n)),(a=x({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,a)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==i.SUCCESS?(r.warn(h.O,"remove chatroom entry fail ->code+:".concat(it[c],",").concat(n)),[2,{code:c,msg:it[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&tn(t)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.info(h.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(h.O,"force remove chatroom entry fail ->code+:".concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&m("key",t,(function(e){return _(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(h.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(h.O,"get chatroom entry fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("targetId",e,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(h.O,"get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS&&s?[2,{code:a,data:s}]:(o.warn(h.O,"get all chatroom entries fail ->code+:".concat(it[a],",").concat(t)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rn(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("targetId",e,v.STRING,!0)&&m("options.timestamp",t.timestamp,v.NUMBER)&&m("options.count",t.count,v.NUMBER)&&m("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t}))&&m("options.order",t.order,(function(e){return 0===e||1===e}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),r.debug(h.O,"get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Le(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(r.warn(h.O,"get chatroom history message fail ->code+:".concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function In(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("option.chatRoomId",e.chatRoomId,v.STRING,!0)&&m("option.rtcRoomId",e.rtcRoomId,v.STRING,!0)?[2,He((function(n){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:it[t]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function hn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("userId",e,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return o.info(h.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function En(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("userId",e,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return o.info(h.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mn(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return n.info(h.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS&&r?[2,{code:o,data:r}]:(n.warn(h.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Tn(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("userId",e,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return o.info(h.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:0===a}]:(o.warn(h.O,"getBlacklistStatus fail -> code: ".concat(r,", userId: ").concat(e)),[2,{code:r}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Sn=function(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=o};function pn(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Sn(e,o,t,n)}}var On,Nn=pn("RC:ImgMsg"),_n=pn("RC:HQVCMsg"),Cn=pn("RC:SightMsg"),An=pn("RC:TxtMsg"),yn=pn("RC:CombineMsg"),Un=pn("RC:FileMsg"),Mn=pn("RC:GIFMsg"),Pn=pn("RC:VcMsg"),Ln=pn("RC:LBSMsg"),wn=pn("RC:ReferenceMsg"),Bn=pn("RC:ImgTextMsg"),Dn=pn("RC:CmdMsg"),bn=pn("RC:InfoNtf"),Gn=pn("RC:GrpNtf");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(On||(On={}));var Vn,kn,xn=function(){function e(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._url=e,this._getFileToken=t,this._serverType=n}return e.prototype.upload=function(e){return e.file.size>C?Promise.resolve({code:i.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):e.file.size>A&&this.isSupportMultipart?this.multipartUpload(e):this.commonUpload(e)},e}(),Fn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=d.sent(),s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),[4,e({url:U(this._url),headers:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.QINIU}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(e){return F(this,void 0,void 0,(function(){return Z(this,(function(e){throw new Error("Method not implemented.")}))}))},n}(xn),Zn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=U("".concat(a.ossBucketName,".").concat(this._url)),(c=new FormData).set("token",a.token),c.set("OSSAccessKeyId",a.osskeyId),c.set("policy",a.ossPolicy),c.set("Signature",a.ossSign),c.set("success_action_status","200"),c.set("key",a.fileName),c.set("file",n),[4,e({url:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.ALI}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(xn),Hn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r<=M.FILE?r:M.FILE)];case 1:return s=f.sent(),c=a||("text/html"===n.type?"inline":"attachment"),u={authorization:s.bosToken,"x-bce-date":s.bosDate,"Content-Disposition":"".concat(c,"; filename=").concat(encodeURIComponent(n.name),";")},d=U("".concat(this._url).concat(s.path)),[4,e({url:d,headers:u,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:n,timeout:0})];case 2:return 200===(l=f.sent().status)||204===l?[2,{code:i.SUCCESS,data:{uniqueName:s.fileName,downloadUrl:d}}]:[2,{code:i.UPLOAD_FAIL,msg:l.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(xn),Jn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f;return Z(this,(function(v){switch(v.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r,n.name)];case 1:return s=v.sent(),c={},u=U("".concat(s.s3BucketName,".").concat(this._url)),d=new FormData,a?d.set("Content-Disposition",a):d.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),d.set("Content-Type",n.type),d.set("x-amz-credential",s.s3Credential),d.set("x-amz-algorithm",s.s3Algorithm),d.set("x-amz-date",s.s3Date),d.set("policy",s.s3Policy),d.set("x-amz-signature",s.s3Signature),d.set("key",s.fileName),d.set("file",n),[4,e({url:u,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:d,timeout:0})];case 2:return l=v.sent(),f=l.status,l.data,200===f||204===f?[2,{code:i.SUCCESS,data:{uniqueName:s.fileName,uploadMethod:y.AWS}}]:[2,{code:i.UPLOAD_FAIL,msg:f.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(xn),Yn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=U("".concat(this._url,"/").concat(a.stcBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(n,a,t),[4,e({url:s,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.STC}}]:[2,{code:i.UPLOAD_FAIL}]}}))}))},n.prototype.multipartUpload=function(t){var n;return F(this,void 0,void 0,(function(){var o,r,a,s,c,u,d,l,f,v,g,R,I,h,E,m,T;return Z(this,(function(S){switch(S.label){case 0:return o=t.file,t.onProgress,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=S.sent(),s=U("".concat(this._url,"/").concat(a.stcBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(o,a,t),[4,e({url:"".concat(s,"?uploads"),headers:c,method:"POST"})];case 2:return u=S.sent(),d=u.status,l=u.data,f=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==d&&204!==d||!f?[2,{code:i.UPLOAD_FAIL,msg:"start upload fail"}]:(v=[],[4,this.requestUploadPart(s,o,f,a.fileName,t,v)]);case 3:return g=S.sent(),R=g.code,I=g.msg,R!==i.SUCCESS?[2,{code:R,msg:I}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(f))];case 4:return h=S.sent(),E=v.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),E="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(E,"</CompleteMultipartUpload>"),m=this.getBaseHeaders(o,h,t),[4,e({url:"".concat(s,"?uploadId=").concat(f),headers:m,method:"POST",body:E})];case 5:return 200===(T=S.sent().status)||204===T?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.STC}}]:[2,{code:i.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,o,r,a,s,c,u){return void 0===c&&(c=1),void 0===u&&(u=0),F(this,void 0,void 0,(function(){var d,l,f,v,g,R,I,h,E;return Z(this,(function(m){switch(m.label){case 0:return u>=5?[2,{code:i.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(d=(c-1)*A,l=Math.min(A,n.size-d),f="partNumber=".concat(c,"&uploadId=").concat(o),[4,this._getFileToken(a.fileType,r,"PUT",f)]);case 1:return v=m.sent(),g=n.slice(d,c*A),R=this.getBaseHeaders(n,v,a),[4,e({url:"".concat(t,"?").concat(f),headers:R,method:"PUT",body:g,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,d+e.loaded,n.size)},timeout:0})];case 2:return I=m.sent(),h=I.status,I.data,E=I.xhr,200===h||204===h?(s.push((null==E?void 0:E.getResponseHeader("ETag"))||""),d+l<n.size?[2,this.requestUploadPart(t,n,o,r,a,s,c+1,0)]:[2,{code:i.SUCCESS}]):[2,this.requestUploadPart(t,n,o,r,a,s,c,u+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},n}(xn),qn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=U("".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(n,a,t),[4,e({url:s,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.MINIO}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(t){var n;return F(this,void 0,void 0,(function(){var o,r,a,s,c,u,d,l,f,v,g,R,I,h,E,m,T;return Z(this,(function(S){switch(S.label){case 0:return o=t.file,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=S.sent(),s=U("".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(o,a,t),[4,e({url:"".concat(s,"?uploads"),headers:c,method:"POST"})];case 2:return u=S.sent(),d=u.status,l=u.data,f=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==d&&204!==d||!f?[2,{code:i.UPLOAD_FAIL,msg:"start upload fail"}]:(v=[],[4,this.requestUploadPart(s,o,f,a.fileName,t,v)]);case 3:return g=S.sent(),R=g.code,I=g.msg,R!==i.SUCCESS?[2,{code:R,msg:I}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(f))];case 4:return h=S.sent(),E=v.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),E="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(E,"</CompleteMultipartUpload>"),m=this.getBaseHeaders(o,h,t),[4,e({url:"".concat(s,"?uploadId=").concat(f),headers:m,method:"POST",body:E,timeout:0})];case 5:return 200===(T=S.sent().status)||204===T?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:y.MINIO}}]:[2,{code:i.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,o,r,a,s,c,u){return void 0===c&&(c=1),void 0===u&&(u=0),F(this,void 0,void 0,(function(){var d,l,f,v,g,R,I,h,E;return Z(this,(function(m){switch(m.label){case 0:return u>=5?[2,{code:i.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(d=(c-1)*A,l=Math.min(A,n.size-d),f="partNumber=".concat(c,"&uploadId=").concat(o),[4,this._getFileToken(a.fileType,r,"PUT",f)]);case 1:return v=m.sent(),g=n.slice(d,c*A),R=this.getBaseHeaders(n,v,a),[4,e({url:"".concat(t,"?").concat(f),headers:R,method:"PUT",body:g,timeout:0,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,d+e.loaded,n.size)}})];case 2:return I=m.sent(),h=I.status,E=I.xhr,200===h||204===h?(s.push((null==E?void 0:E.getResponseHeader("ETag"))||""),d+l<n.size?[2,this.requestUploadPart(t,n,o,r,a,s,c+1,0)]:[2,{code:i.SUCCESS}]):[2,this.requestUploadPart(t,n,o,r,a,s,c,u+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},n}(xn),Kn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return k(n,t),n.prototype.commonUpload=function(t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f,v;return Z(this,(function(g){switch(g.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=g.sent(),s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),u=U(this._url),[4,e({url:u,headers:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return d=g.sent(),l=d.status,f=d.data,200!==l&&204!==l||!f?[2,{code:i.UPLOAD_FAIL,msg:l.toString()}]:(v=JSON.parse(f),[2,{code:i.SUCCESS,data:{uniqueName:v.rc_url.file_name,downloadUrl:"".concat(u,"/").concat(v.rc_url.path)}}])}}))}))},n.prototype.multipartUpload=function(e){return F(this,void 0,void 0,(function(){var t,n,o,r,i;return Z(this,(function(a){switch(a.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,r=P(),[4,this._getFileToken(o,t.name)];case 1:return i=a.sent().token,[2,this._requestUploadPart(r,t,i,n)]}}))}))},n.prototype._requestUploadPart=function(t,n,o,r,a){return void 0===a&&(a=0),F(this,void 0,void 0,(function(){var s,c,u,d,l,f,v,g,R,I;return Z(this,(function(h){switch(h.label){case 0:return s=Math.min(A,n.size-a),c=t+n.name.substring(n.name.lastIndexOf(".")),u={Range:"bytes=".concat(a,"-").concat(a+s),"X-File-TransactionId":c,"X-File-Total-Size":n.size.toString()},d=n.slice(a,a+s),(l=new FormData).set("file",d,n.name),l.set("key",c),l.set("name",c),l.set("token",o),f=U(this._url),[4,e({url:f,headers:u,onProgress:function(e){return null==r?void 0:r(a+e.loaded,n.size)},method:"POST",body:l,timeout:0})];case 1:return v=h.sent(),g=v.status,R=v.data,200===g||204===g?a+s<n.size?[2,this._requestUploadPart(t,n,o,r,a+s)]:(I=JSON.parse(R),[2,{code:i.SUCCESS,data:{uniqueName:I.rc_url.file_name,downloadUrl:"".concat(f,"/").concat(I.rc_url.path)}}]):[2,{code:i.UPLOAD_FAIL,msg:g.toString()}]}}))}))},n}(xn);function zn(e,t){return F(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f,v,g,R,I,h,E,m,T,S,p,O,N,_,C;return Z(this,(function(A){switch(A.label){case 0:return n=t.getFileToken,o=t.serverType,r=t.customDomain,a=t.ossConfig,s=t.uploadServer,c=t.bosAddr,u=e.file,d=e.fileType,l=e.thumbnailConfig,f=function(e,t,n,o,r){if(n)return[{type:On.RCX,url:n,p:"1"}];if(e){return JSON.parse(e).map((function(e){var t={type:On.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}))}var i=[];o&&i.push({type:On.QINIU,url:o,p:"1"});r&&i.push({type:On.BAIDU,url:r,p:"2"});return i}(a,0,r,s,c),0===f.length?[2,Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER,msg:"uploadUrlList is empty"})]:[4,Xn(f,e,n,o)];case 1:return v=A.sent(),g=v.code,R=v.data,I=v.msg,g===i.SUCCESS&&R?[4,jn(e,t,R)]:[2,{code:g,msg:I}];case 2:return h=A.sent(),E={downloadUrl:h,uniqueName:(null==R?void 0:R.uniqueName)||"",name:u.name,size:u.size,type:u.type},d!==M.AUDIO?[3,5]:[4,u.arrayBuffer()];case 3:return[4,Wn(A.sent())];case 4:return m=A.sent(),T=m.duration,S=m.length,C=x(x({},E),{duration:T,length:S}),[2,{code:g,data:C}];case 5:return d!==M.IMAGE?[3,7]:[4,$n(u,l)];case 6:return p=A.sent(),O=p.thumbnail,N=p.width,_=p.height,C=x(x({},E),{thumbnail:O,width:N,height:_}),[2,{code:g,data:C}];case 7:return[2,{code:g,data:E}]}}))}))}function jn(e,t,n){return F(this,void 0,void 0,(function(){var o,r,i,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return o=t.getFileUrl,r=e.fileType,i=e.file,a=n.uploadMethod,s=n.downloadUrl,c=n.uniqueName,(u=s)?[3,2]:[4,o(r,c,i.name,void 0,a)];case 1:u=d.sent().downloadUrl,d.label=2;case 2:return[2,u]}}))}))}function Wn(e){return kn=kn||new AudioContext,new Promise((function(t,n){kn.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}var Qn=((Vn={})[On.QINIU]=Fn,Vn[On.ALIYUN]=Zn,Vn[On.BAIDU]=Hn,Vn[On.S3]=Jn,Vn[On.STC]=Yn,Vn[On.MINIO]=qn,Vn[On.RCX]=Kn,Vn);function Xn(e,t,n,o,r){return void 0===r&&(r=[]),F(this,void 0,void 0,(function(){var a,s,c,u,d;return Z(this,(function(l){switch(l.label){case 0:return 0===e.length?[2,Promise.resolve({code:i.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: ".concat(JSON.stringify(r))})]:(a=e.shift(),[4,new Qn[a.type](a.url,n,o).upload(t)]);case 1:return s=l.sent(),c=s.code,u=s.data,d=s.msg,c!==i.SUCCESS?(r.push({type:a.type,url:a.url,code:c,msg:d}),[2,Xn(e,t,n,o,r)]):[2,{code:c,data:u}]}}))}))}function $n(e,t){return new Promise((function(n,o){var r=document.createElement("canvas"),i=r.getContext("2d"),a=new Image;a.onload=function(o){var s=t||{},c=s.maxHeight,u=void 0===c?160:c,d=s.maxWidth,l=void 0===d?160:d,f=s.quality,v=void 0===f?.7:f,g=s.scale,R=void 0===g?1:g,I=eo(a.width,a.height,{maxHeight:u,maxWidth:l,scale:R});r.width=Math.min(I.w,l),r.height=Math.min(I.h,u),i.drawImage(a,I.x,I.y,I.w,I.h);var h=r.toDataURL("string"==typeof e?"image/jpg":e.type,v);h=h.replace(/data:image\/[^;]+;base64,/,""),n({thumbnail:h,width:I.w,height:I.h})},a.src=(window.URL||window.webkitURL).createObjectURL(e)}))}var eo=function(e,t,n){var o,r,i=n.maxHeight,a=void 0===i?160:i,s=n.maxWidth,c=void 0===s?160:s,u=n.scale,d=e<t,l=0,f=0;return(d?t/e:e/t)>(void 0===u?1:u)?(d?(o=100,f=((r=t/(e/100))-a)/2):(r=100,l=((o=e/(t/100))-c)/2),{w:o,h:r,x:-l,y:-f}):(d?(r=a,o=e/(t/a)):(o=c,r=t/(e/c)),{w:o,h:r,x:-l,y:-f})};function to(e,t,n,o){return He((function(r){return new Promise((function(a){r.getFileToken(e,t,n,o).then((function(e){a({code:i.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:it[e]})}))}))}))}function no(e){return m("url",e,v.STRING,!0)?He((function(t){return new Promise((function(n){t.getFileToken(1,void 0,void 0,void 0,e).then((function(e){var t=e.token,o=e.downloadAuthInfo,r=e.deadline;n({code:i.SUCCESS,data:{token:t,downloadAuthInfo:o,deadline:r}})})).catch((function(e){n({code:e,msg:it[e]})}))}))})):Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER})}function oo(e,t,n,o,r){return m("fileType",e,L,!0)&&m("filename",t,v.STRING)&&m("saveName",n,v.STRING)&&m("serverType",r,v.NUMBER)?He((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,o,r).then((function(e){s({code:i.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER})}function ro(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return[2,He((function(r,c){return F(o,void 0,void 0,(function(){var o,u,d,l,f,g,R,I,E,T,S,p;return Z(this,(function(O){switch(O.label){case 0:return n=n||{},t instanceof Sn==!1?(c.warn(h.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,rt.ILLGAL_PARAMS]):m("conversation",e,v.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,m("conversation.targetId",u,v.STRING,!0)&&m("conversation.conversationType",o,v.NUMBER,!0)&&m("conversation.channelId",d,v.CHANNEL_ID)&&m("options.isStatusMessage",null==n?void 0:n.isStatusMessage,v.BOOLEAN)&&m("options.disableNotification",null==n?void 0:n.disableNotification,v.BOOLEAN)&&m("options.pushContent",null==n?void 0:n.pushContent,v.STRING)&&m("options.pushData",null==n?void 0:n.pushData,v.STRING)&&m("options.isMentioned",null==n?void 0:n.isMentioned,v.BOOLEAN)&&m("options.mentionedType",null==n?void 0:n.mentionedType,v.NUMBER)&&m("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,v.ARRAY)&&m("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,v.ARRAY)&&m("options.isVoipPush",null==n?void 0:n.isVoipPush,v.BOOLEAN)&&m("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,v.BOOLEAN)&&m("options.expansion",null==n?void 0:n.expansion,v.OBJECT)&&m("options.pushConfig",null==n?void 0:n.pushConfig,v.OBJECT)&&m("options.messageId",null==n?void 0:n.messageId,v.NUMBER)&&m("options.encrypted",null==n?void 0:n.encrypted,v.BOOLEAN)&&m("options.needReceipt",null==n?void 0:n.needReceipt,v.BOOLEAN)?(l="conversationType:".concat(o,",targetId:").concat(u),c.debug(h.O,"send message ->".concat(l)),f=function(e,t,n){var o=e.isStatusMessage,r=e.disableNotification,i=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,l=e.isVoipPush,f=e.canIncludeExpansion,v=e.expansion,g=e.isFilerWhiteBlacklist,R=e.pushConfig,I=e.messageId,h=e.encrypted,E=e.needReceipt,m=n.channelId;return x({isStatusMessage:o,disableNotification:r,pushContent:i,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:l,canIncludeExpansion:f,expansion:v,isFilerWhiteBlacklist:g,pushConfig:R,channelId:m||"",messageId:I,encrypted:h||!1,needReceipt:null!=E&&E},t)}(n,t,e),g={isMentioned:!!n.isMentioned,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!(null==n?void 0:n.disableNotification),canIncludeExpansion:!!(null==n?void 0:n.canIncludeExpansion),expansion:(null==n?void 0:n.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:r.getCurrentUserId(),messageUId:"",messageDirection:B.SEND,receivedTime:0,isStatusMessage:!!n.isStatusMessage,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig,sentStatus:D.SENDING,encrypted:(null==n?void 0:n.encrypted)||!1,needReceipt:(null==n?void 0:n.needReceipt)||!1},o!==s.ULTRA_GROUP&&(g.isOffLineMessage=!1),R=c.createTraceId(),I=function(e){g.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(Le(g))}catch(e){c.error(h.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),R)}},c.info(h.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:o,targetId:u,channelId:d}),R),[4,r.sendMessage(o,u,f,I,R)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=O.sent(),T=E.code,S=E.data,T===i.SUCCESS?(c.info(h.A_SEND_MSG_R,JSON.stringify({code:T,messageUId:S.messageUId,messageId:S.messageId}),R),p=Le(S),[2,{code:T,data:p}]):(c.warn(h.A_SEND_MSG_R,"send message fail ->".concat(T,":").concat(it[T],",").concat(l)),g.sentTime=(null==S?void 0:S.sentTime)||0,g.sentStatus=null==S?void 0:S.sentStatus,[2,{code:T,msg:it[T],data:Le(g)}])}}))}))}))]}))}))}function io(e,t,n){return ro(e,new An(t),n)}function ao(e,t){return function(n,o,r,a){if(!m("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(m("sendOptions.maxHeight",null==c?void 0:c.maxHeight,v.NUMBER)&&m("sendOptions.maxWidth",null==c?void 0:c.maxWidth,v.NUMBER)&&m("sendOptions.quality",null==c?void 0:c.quality,v.NUMBER)&&m("sendOptions.scale",null==c?void 0:c.scale,v.NUMBER)))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return He((function(c,u,d){return new Promise((function(c){var d,l=u.createTraceId();u.info(h.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),(d={file:o.file,fileType:e,onProgress:function(e,t){var n;null===(n=null==r?void 0:r.onProgress)||void 0===n||n.call(r,Math.floor(e/t*100))},contentDisposition:s.contentDisposition,thumbnailConfig:s.thumbnailConfig},He((function(e,t,n){return new Promise((function(t){var o=e.getNaviInfoFromCache();zn(d,{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:n.uploadDomain||"",serverType:null==o?void 0:o.type,ossConfig:null==o?void 0:o.ossConfig,uploadServer:null==o?void 0:o.uploadServer,bosAddr:null==o?void 0:o.bosAddr}).then((function(e){t(e)}))}))}))).then((function(e){var s,d=e.code,f=e.data,v=e.msg;if(d===i.SUCCESS&&f){var g=(null===(s=null==r?void 0:r.onComplete)||void 0===s?void 0:s.call(r,x({url:f.downloadUrl},f)))||t(f,o);return u.info(h.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:f.downloadUrl,code:i.SUCCESS}),l),void ro(n,g,a).then(c)}c({code:d,msg:v})}))}))}))}}var so=ao(M.FILE,(function(e,t){return new Un({name:e.name,size:t.file.size,type:(n=e.name,o=n.match(/\.(\w+)$/),o?o[1]:"bin"),fileUrl:e.downloadUrl,user:t.user,extra:t.extra});var n,o})),co=ao(M.IMAGE,(function(e,t){return new Nn({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),uo=ao(M.IMAGE,(function(e,t){return new Mn({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:t.user,extra:t.extra})})),lo=ao(M.AUDIO,(function(e,t){return new _n({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),fo=ao(M.SIGHT,(function(e,t){return new Cn({sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name,user:t.user,extra:t.extra})}));function vo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("options.timestamp",null==t?void 0:t.timestamp,v.NUMBER)&&m("options.count",null==t?void 0:t.count,v.NUMBER)&&(w()||m("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})))&&m("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&m("conversation",e,v.CONVERSATION,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n=r.createTraceId(),r.info(h.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,o.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Le(e)})),r.info(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function go(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("options.timestamp",null==t?void 0:t.timestamp,v.NUMBER)&&m("options.count",null==t?void 0:t.count,v.NUMBER)&&m("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("options.count is invalid, It should be greater than 0 and less than 100"),t}))&&m("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&m("conversation",e,v.CONVERSATION,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(h.O,"get history message ->".concat(n)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Le(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(h.O,"get history message fail ->".concat(s,":").concat(it[s],",").concat(n)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ro(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return m("targetId",e,v.STRING,!0)&&m("messageUId",t,v.STRING,!0)&&m("timestamp",n,v.NUMBER,!0)&&m("channelId",o,v.CHANNEL_ID)?[2,He((function(i){return F(r,void 0,void 0,(function(){var r,i,a,c,u;return Z(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:s.PRIVATE,channelId:o},i=new Sn("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,ro(r,i)];case 1:return a=d.sent(),c=a.code,u=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Io(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return m("messageUId",t,v.STRING,!0)&&m("targetId",e,v.STRING,!0)&&m("channelId",n,v.CHANNEL_ID)?[2,He((function(r,i){return F(o,void 0,void 0,(function(){var o,r,a,c,u;return Z(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(h.O,"send read receipt message ->".concat(o)),r=new Sn("RC:RRReqMsg",{messageUId:t}),[4,ro({targetId:e,conversationType:s.GROUP,channelId:n},r)];case 1:return a=d.sent(),c=a.code,u=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ho(e,t,n){return F(this,void 0,void 0,(function(){return Z(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function Eo(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return m("targetId",e,v.STRING,!0)&&m("messageList",t,v.OBJECT,!0)&&m("channelId",n,v.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!m(e,t[e],v.ARRAY)}))?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,c,u,d,l,f;return Z(this,(function(v){switch(v.label){case 0:return o={targetId:e,conversationType:s.GROUP,channelId:n},u=r.getNaviInfoFromCache(),1!==(null==u?void 0:u.grpRRVer)?[3,2]:(d=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===d.indexOf(e)&&d.push(e)}))})),d.length?[4,r.sendReadReceiptMessage(e,d,n)]:(a.warn(h.O,"Error in parameter messageList."),[2,{code:i.PARAMETER_ERROR}]));case 1:return c=v.sent(),[3,4];case 2:return l=new Sn("RC:RRRspMsg",{receiptMessageDic:t}),[4,ro(o,l)];case 3:c=v.sent(),v.label=4;case 4:return(f=c.code)===i.SUCCESS?[2,{code:f}]:(a.warn(h.O,"send read receipt message fail ->".concat(f,":").concat(it[f])),[2,{code:f,msg:it[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mo(e,t){return F(this,void 0,void 0,(function(){var n,o,r,a;return Z(this,(function(s){switch(s.label){case 0:return m("conversation",e,v.CONVERSATION,!0)&&m("lastMessageSendTime",t,v.NUMBER,!0)?(n=new Sn("RC:SRSMsg",{lastMessageSendTime:t}),[4,ro(e,n)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),r=o.code,a=o.msg,0===r?[2,{code:r}]:[2,{code:r,msg:a}]}}))}))}function To(e,t){return F(this,void 0,void 0,(function(){var n,o,r=this;return Z(this,(function(a){return m("conversation",e,v.CONVERSATION,!0)&&m("conversationType",e.conversationType,(function(e){return[s.PRIVATE,s.GROUP].includes(e)}),!0)&&m("messages",t,v.ARRAY,!0)&&m("messages",t,(function(e){return e.length>0&&e.length<=100&&e.every((function(e){return b(e)}))}),!0)?(n=[],o=[],t.some((function(t){var r=t.messageUId&&t.conversationType===e.conversationType&&t.targetId===e.targetId,i=t.messageDirection===B.RECEIVE,a=!!t.needReceipt,s=!!t.sentReceipt;return!(r&&a&&i)||(s?n.push(t.messageUId):o.push(x(x({},t),{isMentioned:!!t.isMentioned,disableNotification:!!t.disableNotification,isStatusMessage:!!t.isStatusMessage,expansion:t.expansion||null})),!1)}))?[2,{code:i.INVALID_PARAMETER_MESSAGELIST}]:[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u;return Z(this,(function(d){switch(d.label){case 0:return r=a.getNaviInfoFromCache(),4!==(null==r?void 0:r.grpRRVer)?(s.warn(h.O,"sendReadReceipt V5 is not supported by the current server version."),[2,{code:i.READ_RECEIPT_V5_NOT_SUPPORT}]):0===o.length?(s.warn(h.O,"sendReadReceipt No valid message -> conversation: ".concat(JSON.stringify(e),",\n message: ").concat(JSON.stringify(t))),[2,{code:i.SUCCESS}]):(c="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",\n messages:").concat(JSON.stringify(o),", invalidMessageUIds: ").concat(JSON.stringify(n)),s.info(h.O,"sendReadReceipt ->".concat(c)),[4,a.sendReadReceipt(e,o)]);case 1:return(u=d.sent().code)!==i.SUCCESS?(s.warn(h.O,"sendReadReceipt fail ->".concat(u,":").concat(it[u])),[2,{code:u,msg:it[u]}]):(s.info(h.O,"sendReadReceipt ack ->".concat(u)),[2,{code:i.SUCCESS}])}}))}))}))]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("conversation",e,v.CONVERSATION,!0)&&m("options.messageUId",t.messageUId,v.STRING,!0)&&m("options.sentTime",t.sentTime,v.NUMBER,!0)&&m("options.disableNotification",null==t?void 0:t.disableNotification,v.BOOLEAN)&&m("options.pushConfig",null==t?void 0:t.pushConfig,v.OBJECT)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete},a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),r.debug(h.O,"recall message ->".concat(a)),[4,o.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS&&u?[2,{code:c,data:Le(u)}]:c===i.SUCCESS?[2,{code:c}]:(r.warn(h.O,"recall message fail ->".concat(c,":").concat(it[c],",").concat(a)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("conversation",e,v.CONVERSATION,!0)&&m("options",t,(function(e){return g(e)&&e.length}),!0)&&!t.some((function(e){return!m("options.messageUId",e.messageUId,v.STRING,!0)||!m("options.sentTime",e.sentTime,v.NUMBER,!0)||!m("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(h.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(h.O,"delete message fail ->".concat(a,":").concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("conversation",e,v.CONVERSATION,!0)&&m("timestamp",t,v.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a;return Z(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(h.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(h.O,"clear message ->".concat(a,":").concat(it[a],",").concat(n)),[2,{code:a,msg:it[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function No(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("expansion",e,v.OBJECT,!0)&&m("message",t,v.OBJECT,!0)&&m("message.conversationType",t.conversationType,v.NUMBER,!0)&&m("message.targetId",t.targetId,v.STRING,!0)&&m("message.channelId",t.channelId,v.CHANNEL_ID)&&m("message.messageUId",t.messageUId,v.STRING,!0)&&m("message.expansion",t.expansion,v.OBJECT)&&m("message.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f;return Z(this,(function(v){switch(v.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.expansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),r.debug(h.O,"update message expansion ->".concat(l)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(f=v.sent().code)!==i.SUCCESS?(r.warn(h.O,"update message expansion fail ->".concat(f,":").concat(it[f],",").concat(l)),[2,{code:f,msg:it[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _o(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("keys",e,v.ARRAY,!0)&&m("message",t,v.OBJECT,!0)&&m("message.conversationType",t.conversationType,v.NUMBER,!0)&&m("message.targetId",t.targetId,v.STRING,!0)&&m("message.channelId",t.channelId,v.CHANNEL_ID)&&m("message.messageUId",t.messageUId,v.STRING,!0)&&m("message.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),r.debug(h.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(l=f.sent().code)!==i.SUCCESS?(r.warn(h.O,"remove message expansion fail ->".concat(l,":").concat(it[l],",").concat(d)),[2,{code:l,msg:it[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("conversation",e,v.CONVERSATION,!0)&&m("typingContentType",t,v.STRING,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d;return Z(this,(function(l){switch(l.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=r.createTraceId(),r.info(h.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,o.sendMessage(e.conversationType,e.targetId,n,void 0,a)];case 1:return s=l.sent(),c=s.code,u=s.data,d=c===i.SUCCESS?"info":"warn",r[d](h.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===i.SUCCESS?[2,{code:c,data:Le(u)}]:[2,{code:c,msg:it[c]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ao(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return m("messageUId",t,v.STRING,!0)&&m("targetId",e,v.STRING,!0)&&m("channelId",n,v.CHANNEL_ID)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u;return Z(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(h.O,"get message reader ->".concat(o)),[4,r.getMessageReader(e,t,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS?[2,{code:c,data:u}]:(a.warn(h.O,"get message reader fail ->".concat(c,":").concat(it[c],",").concat(o)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(e,t,n,o,r){return Ze((function(i,a){return f("messageType",e,v.STRING,!0),f("isPersited",t,v.BOOLEAN,!0),f("isCounted",n,v.BOOLEAN,!0),f("isStatusMessage",r,v.BOOLEAN,!1),f("searchProps",o,v.ARRAY),a.info(h.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),i.registerMessageType(e,t,n,o,r),pn(e,t,n)}))}function Uo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?m("conversation",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,r===i.SUCCESS?(s=a&&Le(a)||null,[2,{code:r,data:s}]):(o.warn(h.O,"insertMessage ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Mo(e,t,n){return void 0===n&&(n={}),F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return Be("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),w()?m("conversation",e,v.CONVERSATION,!0)&&m("message",t,v.OBJECT,!0)&&m("options",n,v.OBJECT)&&m("options.isUnread",null==n?void 0:n.isUnread,v.BOOLEAN)&&m("options.searchContent",null==n?void 0:n.searchContent,v.STRING)&&m("content.senderUserId",t.senderUserId,v.STRING,!0)&&m("content.messageType",t.messageType,v.STRING,!0)&&m("content.content",t.content,v.OBJECT,!0)&&m("content.messageDirection",t.messageDirection,v.NUMBER,!0)&&m("content.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN)&&m("content.expansion",t.expansion,v.OBJECT)&&m("content.disableNotification",t.disableNotification,v.BOOLEAN)&&m("content.sentTime",t.sentTime,v.NUMBER)&&m("content.sentStatus",t.sentStatus,v.NUMBER)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,v,g,R,I,E,m,T,S,p;return Z(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,l=t.canIncludeExpansion,f=t.expansion,v=t.disableNotification,g=t.sentTime,R=t.sentStatus,a.info(h.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=n.isUnread,E=n.searchContent,m={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:g,sentStatus:R,searchContent:E,isUnread:I,messageUId:d,disableNotification:v,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,m)];case 1:return T=O.sent(),S=T.code,p=T.data,S===i.SUCCESS?[2,{code:S,data:Le(p)}]:(a.warn(h.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:it[S]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Po(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?m("messageId",e,(function(e){return c(e)||_(e)}),!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:Le(a)}]:(o.warn(h.O,"getMessage ->code:".concat(r,",messageId:").concat(e)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Lo(e){if(!w())return{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,r=e.channelId;return m("conversation",e,v.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,r),a=[];return t&&t.length&&t.forEach((function(e){return a.push(Le(e))})),{code:i.SUCCESS,data:a}},Ve?t(Ve,xe,ke):{code:i.BIZ_ERROR_CLIENT_NOT_INIT}):{code:i.BIZ_ERROR_INVALID_PARAMETER}}function wo(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return Be("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),w()?m("conversation",e,v.CONVERSATION,!0)&&m("keyword",t,v.STRING,!0)&&m("timestamp",n,v.NUMBER)&&m("count",o,v.NUMBER)?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u,d;return Z(this,(function(l){switch(l.label){case 0:return[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return r=l.sent(),c=r.code,u=r.data,c===i.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(Le(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(h.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Bo(e,t,n){return F(this,void 0,void 0,(function(){var o,r,a,s=this;return Z(this,(function(c){return Be("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),w()?(o=e.conversationType,r=e.targetId,a=e.channelId,m("conversationType",o,v.NUMBER,!0)&&m("targetId",r,v.STRING,!0)&&m("timestamp",t,v.NUMBER,!0)&&m("cleanSpace",n,v.BOOLEAN)?[2,He((function(c,u){return F(s,void 0,void 0,(function(){var s;return Z(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,r,t,n,a)];case 1:return s=d.sent(),u.debug(h.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:r,channelId:a,timestamp:t})),s===i.SUCCESS?[2,{code:s}]:(u.warn(h.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Do(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return Be("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),w()?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s;return Z(this,(function(c){switch(c.label){case 0:return t=e.conversationType,r=e.targetId,a=e.channelId,o.info(h.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,a)];case 1:return(s=c.sent())===i.SUCCESS?[2,{code:s}]:(o.warn(h.O,"clearMessages ->code:".concat(s,",targetId:").concat(r)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function bo(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return Be("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),w()?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u;return Z(this,(function(d){switch(d.label){case 0:return s.info(h.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,n,o,t)];case 1:return r=d.sent(),c=r.code,u=r.data,c===i.SUCCESS?[2,{code:c,data:u}]:(s.warn(h.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Go(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("conversation",e,v.CONVERSATION,!0)&&m("timestamp",t,v.NUMBER)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,r.info(h.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,a,t,s)];case 1:return(c=u.sent())===i.SUCCESS?[2,{code:c}]:(r.warn(h.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:it[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Vo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return Be("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),w()?m("messageId",e,v.NUMBER,!0)&&m("receivedStatus",t,v.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(h.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=a.sent())===i.SUCCESS?[2,{code:n}]:(r.warn(h.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function ko(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("messageUId",t,v.STRING,!0)&&m("conversation",e,v.CONVERSATION,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n=o.getNaviInfoFromCache(),4!==(null==n?void 0:n.grpRRVer)?(r.warn(h.O,"sendReadReceipt V5 is not supported by the current server version."),[2,{code:i.READ_RECEIPT_V5_NOT_SUPPORT}]):(r.info(h.O,"getReadReceiptUsers ->param:".concat(JSON.stringify({messageUId:t,conversation:e}))),[4,o.getReadReceiptUsers(e,t)]);case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:(r.warn(h.O,"getReadReceiptUsers ->code:".concat(s)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function xo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("messageUIds",t,v.ARRAY,!0)&&m("messageUIds",t,(function(e){return e.length>0&&e.length<=100}),!0)&&m("conversation",e,v.CONVERSATION,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return n=o.getNaviInfoFromCache(),4!==(null==n?void 0:n.grpRRVer)?(r.warn(h.O,"sendReadReceipt V5 is not supported by the current server version."),[2,{code:i.READ_RECEIPT_V5_NOT_SUPPORT}]):(r.info(h.O,"getMessageReadReceiptInfos ->messageUIds:".concat(t,", conversation:").concat(e)),[4,o.getMessageReadReceiptInfos(e,t)]);case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:(r.warn(h.O,"getMessageReadReceiptInfos ->code:".concat(s,",messageUIds:").concat(t,", conversation:").concat(e)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}function Fo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("tag.tagId",e.tagId,v.STRING,!0)&&m("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&m("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&m("tag.tagName",e.tagName,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(h.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(h.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("tagId",e,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(h.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(h.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ho(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("tag.tagId",e.tagId,v.STRING,!0)&&m("tag.tagName",e.tagName,v.STRING,!0)&&m("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(h.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(h.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jo(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,t.getTagList()];case 1:return e=a.sent(),o=e.code,r=e.data,n.warn(h.O,"getTagList ->code:".concat(o)),[2,{code:i.SUCCESS,data:r}]}}))}))}))]}))}))}function Yo(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return m("conversation",e,v.CONVERSATION,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return o.info(h.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:it[r]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("tagId",e,v.STRING,!0)&&m("conversations",t,v.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,v.CONVERSATION,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(h.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(h.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ko(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("tagId",e,v.STRING,!0)&&m("conversations",t,v.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,v.CONVERSATION,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(h.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(h.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("conversation",e,v.CONVERSATION,!0)&&m("tagIds",t,v.ARRAY,!0)&&!t.some((function(e){return!m("tagId",e,v.STRING,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(h.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(h.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("tagId",e,v.STRING,!0)&&m("conversations",t,v.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,v.CONVERSATION,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n;return Z(this,(function(a){switch(a.label){case 0:return r.info(h.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(h.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:it[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wo(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return m("tagId",e,v.STRING,!0)&&m("count",t,v.NUMBER,!0)&&m("startTime",n,v.NUMBER,!0)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c;return Z(this,(function(u){switch(u.label){case 0:return a.info(h.O,"getConversationListByTag ->tagId:".concat(e)),[4,r.getConversationListByTag(e,n,t)];case 1:return o=u.sent(),s=o.code,c=o.data,s===i.SUCCESS?[2,{code:s,data:null==c?void 0:c.map((function(e){return function(e){return x(x({},we(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(h.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:it[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qo(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return m("tagId",e,v.STRING,!0)&&m("containMuted",t,v.BOOLEAN,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,i,a;return Z(this,(function(s){switch(s.label){case 0:return r.info(h.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=s.sent(),i=n.code,a=n.data,[2,{code:i,data:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xo(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return m("tagId",e,v.STRING,!0)&&m("conversation",t,v.CONVERSATION,!0)&&m("status.isTop",n,v.BOOLEAN,!0)?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o;return Z(this,(function(s){switch(s.label){case 0:return a.info(h.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,r.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===i.SUCCESS?[2,{code:o}]:(a.warn(h.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:it[o]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}ao(M.COMBINE_HTML,(function(e,t){return new yn({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var $o={COMET:"comet",WEBSOCKET:"websocket"},er={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var tr=Object.freeze({__proto__:null,getAllConversationList:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?m("channelId",e,v.CHANNEL_ID)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a,s,c;return Z(this,(function(u){switch(u.label){case 0:return o.info(h.O,"getAllConversationList -> channelId: ".concat(e)),G(e)?[4,n.getConversationListWithAllChannel()]:[3,2];case 1:return t=u.sent(),[3,4];case 2:return[4,n.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:t=u.sent(),u.label=4;case 4:return r=t.code,a=t.data,r===i.SUCCESS&&a?(s=a.map((function(e){return we(e)})),c=JSON.stringify(s.map((function(e){var t=e.targetId,n=e.latestMessage;return{targetId:t,type:e.conversationType,msgId:null==n?void 0:n.messageId,msgUId:null==n?void 0:n.messageUId}}))),o.info(h.O,"getAllConversationList success -> ".concat(c)),[2,{code:r,data:s}]):(o.warn(h.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(e)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return w()?m("startTime",e,v.NUMBER,!0)&&m("count",t,v.NUMBER,!0)&&m("channelId",n,v.CHANNEL_ID)&&m("topPriority",o,v.BOOLEAN)?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u,d,l,f;return Z(this,(function(v){switch(v.label){case 0:return r="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),s.info(h.O,"getConversationList -> ".concat(r)),G(n)?[4,a.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return c=v.sent(),[3,4];case 2:return u=[1,2,3,5,6,7,8],[4,a.getConversationsByPage(u,e,t,n,o)];case 3:c=v.sent(),v.label=4;case 4:return d=c.code,l=c.data,d===i.SUCCESS&&l?(f=l.map((function(e){return we(e)})),[2,{code:d,data:f}]):(s.warn(h.O,"getConversationList fail -> code: ".concat(d," ").concat(r)),[2,{code:d,msg:it[d]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchConversationByContent:function(e,t,n,o){return void 0===n&&(n=!1),F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return w()?m("keyword",e,v.STRING,!0)&&m("messageTypes",t,v.ARRAY,!0)&&m("includeDeleted",n,v.BOOLEAN)&&m("channelId",o,v.CHANNEL_ID)&&!t.some((function(e){return!m("messageType",e,v.STRING,!0)}))?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return r="keyword: ".concat(e,", messageTypes: ").concat(JSON.stringify(t),", channelId: ").concat(o),s.info(h.O,"searchConversationByContent -> ".concat(r)),!G(o)||n?[3,2]:[4,a.searchConversationByContentWithAllChannel(e,t)];case 1:return c=f.sent(),[3,4];case 2:return o=o||"",[4,a.searchConversationByContent(e,t,o,void 0,n)];case 3:c=f.sent(),f.label=4;case 4:return u=c.code,d=c.data,u===i.SUCCESS&&d?(l=d.map((function(e){return we(e)})),[2,{code:u,data:l}]):(s.warn(h.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(r)),[2,{code:u,msg:it[u]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchConversationsByPage:function(e){var t,n;return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return w()?m("option",e,v.OBJECT)&&m("keyword",null==e?void 0:e.keyword,v.STRING,!0)&&m("conversationTypes",null==e?void 0:e.conversationTypes,v.ARRAY,!0)&&!(null===(t=null==e?void 0:e.conversationTypes)||void 0===t?void 0:t.some((function(e){return!m("conversationType",e,T,!0)})))&&m("startTime",null==e?void 0:e.startTime,v.NUMBER,!0)&&m("startTime",null==e?void 0:e.startTime,(function(e){return e>=0}))&&m("count",null==e?void 0:e.count,v.NUMBER,!0)&&m("count",null==e?void 0:e.count,(function(e){return e>0&&e<=50}))&&m("messageTypes",null==e?void 0:e.messageTypes,v.ARRAY)&&!(null===(n=null==e?void 0:e.messageTypes)||void 0===n?void 0:n.some((function(e){return!m("messageType",e,v.STRING,!0)})))&&m("includeDeleted",null==e?void 0:e.includeDeleted,v.BOOLEAN)?[2,He((function(t,n){return F(o,void 0,void 0,(function(){var o,r,a,s,c,u,d,l;return Z(this,(function(f){switch(f.label){case 0:return o=n.createTraceId(),n.info(h.L_SEARCH_CONVERSATIONS_T,JSON.stringify(e),o),[4,t.searchConversationsByPage(e,o)];case 1:return r=f.sent(),a=r.code,s=r.data,a!==i.SUCCESS?(n.warn(h.L_SEARCH_CONVERSATIONS_R,JSON.stringify({code:a}),o),[2,{code:a}]):(u=(c=s).list,d=c.totalCount,n.info(h.L_SEARCH_CONVERSATIONS_R,JSON.stringify({resCount:u.length,totalCount:d}),o),l={list:u.map((function(e){return we(e)})),totalCount:d},[2,{code:a,data:l}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},initAndOpenDatabase:function(e){var t=this;return He((function(n){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return[4,n.initAndOpenDatabase(e)];case 1:return[2,{code:t.sent().code}]}}))}))}))},closeDatabase:function(){var e=this;return He((function(t){return F(e,void 0,void 0,(function(){return Z(this,(function(e){switch(e.label){case 0:return[4,t.closeDatabase()];case 1:return[2,{code:e.sent().code}]}}))}))}))},searchMessages:function(e,t,n,o,r){return F(this,void 0,void 0,(function(){var a=this;return Z(this,(function(s){return w()?m("conversation",e,v.CONVERSATION,!0)&&m("keyword",t,v.STRING,!0)&&m("startTime",n,v.NUMBER,!0)&&m("startTime",n,(function(e){return e>=0}),!0)&&m("count",o,v.NUMBER,!0)&&m("count",o,(function(){return o>0&&o<=100}),!0)&&m("messageTypes",r,v.ARRAY,!1)&&m("messageTypes",r,(function(){return r.every((function(e){return"string"==typeof e}))}),!1)?[2,He((function(s,c){return F(a,void 0,void 0,(function(){var a,u,d,l,f,v,g,R,I,E;return Z(this,(function(m){switch(m.label){case 0:return a="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),c.info(h.O,"searchMessages -> ".concat(a)),u=e.targetId,d=e.conversationType,l=e.channelId,r?[4,s.searchMessageByContentAndMessageType(d,u,t,n,o,r,l)]:[3,2];case 1:return f=m.sent(),[3,6];case 2:return G(l)?[4,s.searchMessageByContentWithAllChannel(d,u,t,n,o)]:[3,4];case 3:return f=m.sent(),[3,6];case 4:return[4,s.searchMessageByContent(d,u,t,n,o,0,l)];case 5:f=m.sent(),m.label=6;case 6:return v=f.code,g=f.data,v===i.SUCCESS&&g?(R=g.messages,I=g.count,E=R.map((function(e){return Le(e)})),[2,{code:v,data:{messages:E,count:I}}]):(c.warn(h.O,"searchMessages fail -> code: ".concat(v," ").concat(a)),[2,{code:v,msg:it[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("conversation",e,v.CONVERSATION,!0)&&m("option",t,v.OBJECT,!0)&&m("option.keyword",t.keyword,v.STRING,!0)&&m("option.startTime",t.startTime,v.NUMBER,!0)&&m("option.endTime",t.endTime,v.NUMBER,!0)&&m("option.offset",t.offset,v.NUMBER)&&m("option.limit",t.limit,v.NUMBER)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g,R;return Z(this,(function(I){switch(I.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(h.O,"searchMessageInTimeRange -> ".concat(n)),a=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,l=t.offset,f=t.limit,l=l||0,f=f||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,l,f)];case 1:return v=I.sent(),g=v.code,R=v.data,g===i.SUCCESS&&R?[2,{code:g,data:{messages:R.messages.map((function(e){return Le(e)}))}}]:(r.warn(h.O,"searchMessageInTimeRange fail -> code: ".concat(g,", ").concat(n)),[2,{code:g}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(e,t,n,o){return F(this,void 0,void 0,(function(){var r=this;return Z(this,(function(a){return w()?m("conversation",e,v.CONVERSATION,!0)&&m("userId",t,v.STRING,!0)&&m("startTime",n,v.NUMBER,!0)&&m("count",o,v.NUMBER,!0)?[2,He((function(a,s){return F(r,void 0,void 0,(function(){var r,c,u,d,l,f,v;return Z(this,(function(g){switch(g.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(h.A_SEARCH_MESSAGE_BY_USER_T,"searchMessagesByUser -> ".concat(r)),c=e.conversationType,u=e.targetId,d=e.channelId,[4,a.searchMessagesByUser(c,u,t,n,o,d)];case 1:return l=g.sent(),f=l.code,v=l.data,f===i.SUCCESS&&v?[2,{code:f,data:{messages:v.messages.map((function(e){return Le(e)}))}}]:(s.warn(h.A_SEARCH_MESSAGE_BY_USER_R,"searchMessagesByUser fail -> code: ".concat(f,", ").concat(r)),[2,{code:f}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("conversation",e,v.CONVERSATION,!0)&&m("option",t,v.OBJECT,!0)&&m("option.count",t.count,v.NUMBER)&&m("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t}))&&m("option.timestamp",t.timestamp,v.NUMBER)&&m("option.order",t.order,(function(e){return[0,1].includes(e)}))&&m("option.messageTypes",t.messageTypes,v.ARRAY,!0)&&!t.messageTypes.some((function(e){return!m("option.messageType",e,v.STRING,!0)}))?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g,R,I,E,m,T,S,p,O,N;return Z(this,(function(_){switch(_.label){case 0:return n=t.count,a=void 0===n?20:n,s=t.timestamp,c=void 0===s?0:s,u=t.order,d=void 0===u?0:u,l=t.messageTypes,f="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(h.O,"getHistoryMessagesByMessageTypes -> ".concat(f)),v=e.conversationType,g=e.targetId,R=e.channelId,I=void 0===R?"":R,[4,o.getHistoryMessagesByObjectNames(v,g,c,a,l,d,I)];case 1:return E=_.sent(),m=E.code,T=E.data,m===i.SUCCESS?(p=(S=T).list,O=S.hasMore,N=p.map((function(e){return Le(e)})),[2,{code:m,data:{messages:N,hasMore:O,list:N}}]):(r.warn(h.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(m," ").concat(f)),[2,{code:m,msg:it[m]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("conversation",e,v.CONVERSATION,!0)&&m("timestamp",t,v.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,i,a,s;return Z(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(h.O,"updateSentMsgReceiptStatus -> ".concat(n)),i=e.conversationType,a=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(i,a,t,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("messageId",e,v.NUMBER,!0)&&m("receivedStatus",t,(function(e){return!G(a[e])}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){return Z(this,(function(n){switch(n.label){case 0:return r.info(h.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("messageId",e,v.NUMBER,!0)&&m("sentStatus",t,(function(e){return!G(D[e])}),!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){return Z(this,(function(n){switch(n.label){case 0:return r.info(h.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return w()?m("messageId",e,v.NUMBER,!0)&&m("content",t,v.OBJECT,!0)&&m("messageType",n,v.ONLY_STRING,!0)?[2,He((function(r,i){return F(o,void 0,void 0,(function(){return Z(this,(function(o){switch(o.label){case 0:return i.info(h.O,"setMessageContent ->messageId: ".concat(e,", messageType: ").concat(n)),[4,r.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?!m("messageIds",e,v.ARRAY,!0)||e.some((function(e){return!m("messageId",e,v.NUMBER,!0)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(n,o){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return o.info(h.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,i;return Z(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.targetId,i=e.channelId,o.info(h.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,i)];case 1:return[2,{code:a.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return F(this,void 0,void 0,(function(){var o,r,a,s=this;return Z(this,(function(c){return w()?(o=e.conversationType,r=e.targetId,a=e.channelId,m("conversationType",o,v.NUMBER,!0)&&m("targetId",r,v.STRING,!0)&&m("timestamp",t,v.NUMBER,!0)&&m("cleanSpace",n,v.BOOLEAN)?[2,He((function(e,i){return F(s,void 0,void 0,(function(){return Z(this,(function(i){switch(i.label){case 0:return[4,e.deleteMessagesByTimestamp(o,r,t,n,a)];case 1:return[2,{code:i.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return w()?m("conversation",e,v.CONVERSATION,!0)&&m("message",t,v.OBJECT,!0)&&m("options",n,v.OBJECT)&&m("options.isUnread",null==n?void 0:n.isUnread,v.BOOLEAN)&&m("options.searchContent",null==n?void 0:n.searchContent,v.STRING)&&(t instanceof Sn||m("message.senderUserId",t.senderUserId,v.STRING,!0)&&m("message.messageType",t.messageType,v.STRING,!0)&&m("message.content",t.content,v.OBJECT,!0)&&m("message.messageDirection",t.messageDirection,v.NUMBER,!0)&&m("message.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN)&&m("message.expansion",t.expansion,v.OBJECT)&&m("message.disableNotification",t.disableNotification,v.BOOLEAN)&&m("message.sentTime",t.sentTime,v.NUMBER)&&m("message.sentStatus",t.sentStatus,v.NUMBER))?[2,He((function(r,a){return F(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,v,g,R,I,E,m,T,S;return Z(this,(function(p){switch(p.label){case 0:return o="",s=1,l=!1,v=t.messageType,g=t.content,t instanceof Sn||(o=t.senderUserId,s=t.messageDirection,l=t.canIncludeExpansion,f=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),a.info(h.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),R=n.isUnread,I=n.searchContent,E={senderUserId:o,messageType:v,content:g,messageDirection:s,sentTime:c,sentStatus:u,searchContent:I,isUnread:R,messageUId:"",disableNotification:d,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,E)];case 1:return m=p.sent(),T=m.code,S=m.data,T===i.SUCCESS?[2,{code:T,data:Le(S)}]:(a.warn(h.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:it[T]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,o;return F(this,void 0,void 0,(function(){var r,a=this;return Z(this,(function(c){if(!w())return[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}];if(!m("messages",e,(function(e){return g(e)&&!(e.length<=0||e.length>500)}),!0)||!m("checkDuplicate",t,v.BOOLEAN))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];for(r in e)if(!(m("message",e[r],v.OBJECT,!0)&&m("message.conversationType",e[r].conversationType,(function(e){return[s.PRIVATE,s.DISCUSSION,s.GROUP,s.CUSTOMER_SERVICE,s.SYSTEM,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE].includes(e)}),!0)&&m("message.targetId",e[r].targetId,v.STRING,!0)&&m("message.senderUserId",e[r].senderUserId,v.STRING,!0)&&m("message.messageType",e[r].messageType,v.STRING,!0)&&m("message.content",e[r].content,v.OBJECT,!0)&&m("message.messageDirection",e[r].messageDirection,v.NUMBER,!0)&&m("message.canIncludeExpansion",e[r].canIncludeExpansion,v.BOOLEAN)&&m("message.expansion",e[r].expansion,v.OBJECT)&&m("message.disableNotification",e[r].disableNotification,v.BOOLEAN)&&m("message.sentTime",e[r].sentTime,v.NUMBER)&&m("message.sentStatus",e[r].sentStatus,v.NUMBER)&&m("options.isUnread",null===(n=e[r])||void 0===n?void 0:n.isUnread,v.BOOLEAN)&&m("options.searchContent",null===(o=e[r])||void 0===o?void 0:o.searchContent,v.STRING)))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER,msg:String(r)}];return[2,He((function(n){return F(a,void 0,void 0,(function(){var o,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.batchInsertMessage(e,t)];case 1:return o=s.sent(),r=o.code,a=o.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:it[r]}]}}))}))}))]}))}))},getMessageCount:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?[2,He((function(n){return F(t,void 0,void 0,(function(){var t,o,r,i,a,s;return Z(this,(function(c){switch(c.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,[4,n.getMessageCount(t,o,r)];case 1:return i=c.sent(),a=i.code,s=i.data,[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?m("messageUId",e,v.STRING,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t,r,a;return Z(this,(function(s){switch(s.label){case 0:return[4,n.getPrivateMessageDeliverTime(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(h.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(r,",messageUId:").concat(e)),[2,{code:r,msg:it[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return w()?m("targetId",e,v.STRING,!0)&&m("messageUId",t,v.STRING,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return[4,o.getGroupMessageDeliverList(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(h.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(a,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return w()?m("enableCheck",e,v.BOOLEAN)?[2,He((function(n){return F(t,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return[4,n.setCheckDuplicateMessage(e)];case 1:return[2,{code:t.sent().code}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},searchMessagesFromConversationTypes:function(e){var t,n;return F(this,void 0,void 0,(function(){var o=this;return Z(this,(function(r){return w()?m("option",e,v.OBJECT,!0)&&m("option.count",e.count,v.NUMBER)&&m("options.count",e.count,(function(e){return e>0&&e<=1e3}))&&m("option.keyword",e.keyword,v.STRING)&&m("option.keyword",e.keyword,(function(e){return e.length<=1e3}))&&m("option.timestamp",e.timestamp,v.NUMBER)&&m("option.order",e.order,(function(e){return[0,1].includes(e)}))&&m("option.messageTypes",e.messageTypes,v.ARRAY)&&!(null===(t=e.messageTypes)||void 0===t?void 0:t.some((function(e){return!m("messageTypes",e,v.STRING)})))&&m("option.conversationTypes",e.conversationTypes,v.ARRAY)&&!(null===(n=e.conversationTypes)||void 0===n?void 0:n.some((function(e){return!m("conversationType",e,T)})))?[2,He((function(t,n){return F(o,void 0,void 0,(function(){var o,r,a,c,u,d,l,f,v,g,R,I,E,m,T,S,p,O,N,_,C,A,y,U;return Z(this,(function(M){switch(M.label){case 0:return o=e.targetIds,r=void 0===o?null:o,a=e.messageTypes,c=void 0===a?null:a,u=e.keyword,d=void 0===u?"":u,l=e.count,f=void 0===l?20:l,v=e.timestamp,g=void 0===v?0:v,R=e.order,I=void 0===R?0:R,E=e.channelIds,m=void 0===E?null:E,T=e.conversationTypes,S=void 0===T?[s.PRIVATE,s.GROUP,s.SYSTEM,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE,s.ULTRA_GROUP]:T,p="option:".concat(JSON.stringify(e)),n.info(h.O,"getMessagesByMessageTypeFromConversationTypes -> ".concat(p)),[4,t.getMessagesByMessageTypeFromConversationTypes(r,m,c,d,g,I,f,S)];case 1:return O=M.sent(),N=O.code,_=O.data,N===i.SUCCESS?(A=(C=_).list,y=C.hasMore,U=A.map((function(e){return Le(e)})),[2,{code:N,data:{hasMore:y,list:U}}]):(n.warn(h.O,"getMessagesByMessageTypeFromConversationTypes fail -> code: ".concat(N," ").concat(p)),[2,{code:N,msg:it[N]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return w()?[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(i){switch(i.label){case 0:return n.info(h.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=i.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:it[i.NOT_SUPPORT]}]}))}))}});function nr(e){return F(this,void 0,void 0,(function(){var t=this;return Z(this,(function(n){return!e||m("proxy.socksHost",e.socksHost,v.STRING,!0)&&m("proxy.socksPort",e.socksPort,v.NUMBER,!0)?[2,He((function(n,o){return F(t,void 0,void 0,(function(){var t;return Z(this,(function(r){switch(r.label){case 0:return o.info(h.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(h.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:it[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function or(){return F(this,void 0,void 0,(function(){var e=this;return Z(this,(function(t){return[2,He((function(t,n){return F(e,void 0,void 0,(function(){var e,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,t.getProxy()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:o,data:r}]:(n.warn(h.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:it[o]}])}}))}))}))]}))}))}function rr(e,t){return F(this,void 0,void 0,(function(){var n=this;return Z(this,(function(o){return!e||m("proxy.socksHost",e.socksHost,v.STRING,!0)&&m("proxy.socksPort",e.socksPort,v.NUMBER,!0)?[2,He((function(o,r){return F(n,void 0,void 0,(function(){var n,a,s;return Z(this,(function(c){switch(c.label){case 0:return r.info(h.O,"testProxy: ->".concat(e)),[4,o.testProxy(e,t)];case 1:return n=c.sent(),a=n.status,s=n.data,a===i.SUCCESS?[2,{code:a,msg:s}]:(r.warn(h.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:it[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{Sn as BaseMessage,yn as CombineMessage,Dn as CommandMessage,$o as ConnectType,ye as Events,Un as FileMessage,Mn as GIFMessage,Gn as GroupNotificationMessage,_n as HQVoiceMessage,Nn as ImageMessage,bn as InformationNotificationMessage,Ln as LocationMessage,er as MessageType,wn as ReferenceMessage,Bn as RichContentMessage,Cn as SightMessage,An as TextMessage,Pn as VoiceMessage,et as __addSDKVersion,qo as addConversationsToTag,Je as addEventListener,Fo as addTag,hn as addToBlacklist,In as bindRTCRoomForChatroom,St as clearAllMessagesUnreadStatus,ze as clearEventListeners,Oo as clearHistoryMessages,Do as clearMessages,Tt as clearMessagesUnreadStatus,Rt as clearTextMessageDraft,Go as clearUnreadCountByTimestamp,ct as connect,Bo as deleteLocalMessagesByTimestamp,po as deleteMessages,We as destroy,ut as disconnect,tr as electronExtension,fn as forceRemoveChatRoomEntry,un as forceSetChatRoomEntry,gn as getAllChatRoomEntries,bt as getAllConversationState,jt as getAllUltraGroupUnreadCount,Wt as getAllUltraGroupUnreadMentionedCount,Dt as getAllUnreadMentionedCount,mn as getBlacklist,Tn as getBlacklistStatus,Vt as getBlockUltraGroupList,yt as getBlockedConversationList,vn as getChatRoomEntry,an as getChatRoomInfo,Rn as getChatroomHistoryMessages,Qe as getConnectionStatus,lt as getConversation,dt as getConversationList,Ct as getConversationNotificationLevel,At as getConversationNotificationStatus,Mt as getConversationTypeNotificationLevel,Wo as getConversationsFromTagByPage,$e as getCurrentUserId,nt as getDeviceId,no as getDownloadAuth,to as getFileToken,oo as getFileUrl,Uo as getFirstUnreadMessage,vo as getHistoryMessages,Po as getMessage,xo as getMessageReadReceiptInfos,Ao as getMessageReader,or as getProxy,ko as getReadReceiptUsers,go as getRemoteHistoryMessages,Xe as getServerTime,Jo as getTags,Yo as getTagsFromConversation,vt as getTextMessageDraft,Lt as getTopConversationList,It as getTotalUnreadCount,ht as getTotalUnreadCountByLevels,Et as getTotalUnreadMentionedCountByLevels,qt as getUltraGroupDefaultNotificationLevel,Xt as getUltraGroupFirstUnreadMessageTimestamp,Gt as getUltraGroupList,xt as getUltraGroupMessageListByMessageUId,zt as getUltraGroupUnreadCountByTargetId,$t as getUltraGroupUnreadInfoList,Yt as getUltraGroupUnreadMentionedCountByTargetId,Qt as getUltraGroupUnreadMentionedMessages,wt as getUnreadConversationList,mt as getUnreadCount,Qo as getUnreadCountByTag,Bt as getUnreadMentionedCount,Lo as getUnreadMentionedMessages,je as init,Mo as insertMessage,ot as installPlugin,nn as joinChatRoom,on as joinExistChatRoom,Jt as modifyMessage,Ye as onceEventListener,rn as quitChatRoom,So as recallMessage,yo as registerMessageType,Ht as removeAllExpansionForUltraGroupMessage,ln as removeChatRoomEntries,dn as removeChatRoomEntry,ft as removeConversation,Ko as removeConversationsFromTag,qe as removeEventListener,Ke as removeEventListeners,Zt as removeExpansionForUltraGroupMessage,En as removeFromBlacklist,_o as removeMessageExpansionForKey,Zo as removeTag,jo as removeTagFromConversations,zo as removeTagsFromConversation,gt as saveTextMessageDraft,bo as searchConversationByContent,wo as searchMessages,so as sendFileMessage,uo as sendGIFMessage,lo as sendHQVoiceMessage,co as sendImageMessage,ro as sendMessage,To as sendReadReceipt,Ro as sendReadReceiptMessage,Io as sendReadReceiptRequest,ho as sendReadReceiptResponse,Eo as sendReadReceiptResponseV2,fo as sendSightMessage,mo as sendSyncReadStatusMessage,io as sendTextMessage,Co as sendTypingStatusMessage,kt as sendUltraGroupTypingStatus,cn as setChatRoomEntries,sn as setChatRoomEntry,Nt as setConversationNotificationLevel,_t as setConversationNotificationStatus,Pt as setConversationToTop,Xo as setConversationToTopInTag,Ut as setConversationTypeNotificationLevel,Vo as setMessageReceivedStatus,nr as setProxy,Kt as setUltraGroupDefaultNotificationLevel,rr as testProxy,Ft as updateExpansionForUltraGroupMessage,No as updateMessageExpansion,Ho as updateTag};